Source code of Leftypol imageboard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
691 B

<?php
namespace DeepCopy\Matcher;
/**
* @final
*/
class PropertyMatcher implements Matcher
{
/**
* @var string
*/
private $class;
/**
* @var string
*/
private $property;
/**
* @param string $class Class name
* @param string $property Property name
*/
public function __construct($class, $property)
{
$this->class = $class;
$this->property = $property;
}
/**
* Matches a specific property of a specific class.
*
* {@inheritdoc}
*/
public function matches($object, $property)
{
return ($object instanceof $this->class) && $property == $this->property;
}
}