Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PropertyMatcher.php

class PropertyMatcher

@final

Hierarchy

  • class \DeepCopy\Matcher\PropertyMatcher implements \DeepCopy\Matcher\Matcher

Expanded class hierarchy of PropertyMatcher

File

vendor/myclabs/deep-copy/src/DeepCopy/Matcher/PropertyMatcher.php, line 8

Namespace

DeepCopy\Matcher
View source
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;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
PropertyMatcher::$class private property
PropertyMatcher::$property private property
PropertyMatcher::matches public function Matches a specific property of a specific class. Overrides Matcher::matches
PropertyMatcher::__construct public function
RSS feed
Powered by Drupal