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.
32 lines
504 B
32 lines
504 B
<?php |
|
|
|
namespace DeepCopy\Matcher; |
|
|
|
/** |
|
* @final |
|
*/ |
|
class PropertyNameMatcher implements Matcher |
|
{ |
|
/** |
|
* @var string |
|
*/ |
|
private $property; |
|
|
|
/** |
|
* @param string $property Property name |
|
*/ |
|
public function __construct($property) |
|
{ |
|
$this->property = $property; |
|
} |
|
|
|
/** |
|
* Matches a property by its name. |
|
* |
|
* {@inheritdoc} |
|
*/ |
|
public function matches($object, $property) |
|
{ |
|
return $property == $this->property; |
|
} |
|
}
|
|
|