annotate vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyNameMatcher.php @ 2:5311817fb629

Theme updates
author Chris Cannam
date Tue, 10 Jul 2018 13:19:18 +0000
parents
children
rev   line source
Chris@2 1 <?php
Chris@2 2
Chris@2 3 namespace DeepCopy\Matcher;
Chris@2 4
Chris@2 5 /**
Chris@2 6 * @final
Chris@2 7 */
Chris@2 8 class PropertyNameMatcher implements Matcher
Chris@2 9 {
Chris@2 10 /**
Chris@2 11 * @var string
Chris@2 12 */
Chris@2 13 private $property;
Chris@2 14
Chris@2 15 /**
Chris@2 16 * @param string $property Property name
Chris@2 17 */
Chris@2 18 public function __construct($property)
Chris@2 19 {
Chris@2 20 $this->property = $property;
Chris@2 21 }
Chris@2 22
Chris@2 23 /**
Chris@2 24 * Matches a property by its name.
Chris@2 25 *
Chris@2 26 * {@inheritdoc}
Chris@2 27 */
Chris@2 28 public function matches($object, $property)
Chris@2 29 {
Chris@2 30 return $property == $this->property;
Chris@2 31 }
Chris@2 32 }