silverstripe-framework/tests/php/Core/ClassInfoTest/HasMethod.php
Garion Herman e89ae93ac9 FIX Harden hasMethod() against invalid values
This method should typehint the incoming value once union types are
available, but for now this ensures that method_exists() is not called
on scalar values, which is unsupported in PHP 8.
2020-10-28 09:34:33 +13:00

20 lines
313 B
PHP

<?php
namespace SilverStripe\Core\Tests\ClassInfoTest;
use SilverStripe\Core\CustomMethods;
use SilverStripe\Dev\TestOnly;
/**
* Example of class with hasMethod() implementation
*/
class HasMethod implements TestOnly
{
use CustomMethods;
public function example()
{
return true;
}
}