methodExists() public static method

Determines that the named method is defined in the provided object.
public static methodExists ( string $value, mixed $object, null $message = null, null $propertyPath = null ) : boolean
$value string
$object mixed
$message null
$propertyPath null
return boolean
Exemplo n.º 1
0
 /**
  * Puzzle constructor.
  *
  * @param string   $name  The puzzle name
  * @param string[] $parts The different puzzle parts in a 'method' => 'output format' array
  */
 public function __construct(string $name, array $parts)
 {
     $this->name = $name;
     foreach ($parts as $method => $format) {
         Assertion::methodExists($method, $this, sprintf("Could not find part '%s' method in %s", $method, get_called_class()));
         Assertion::string($format);
     }
     $this->parts = $parts;
 }
Exemplo n.º 2
0
 public function testMethodExists()
 {
     Assertion::methodExists('methodExists', new Assertion());
 }