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

Breadcrumb

  1. Drupal Core 11.1.x

TypeMatcher.php

Namespace

DeepCopy\TypeMatcher

File

vendor/myclabs/deep-copy/src/DeepCopy/TypeMatcher/TypeMatcher.php

View source
<?php

namespace DeepCopy\TypeMatcher;

class TypeMatcher {
    
    /**
     * @var string
     */
    private $type;
    
    /**
     * @param string $type
     */
    public function __construct($type) {
        $this->type = $type;
    }
    
    /**
     * @param mixed $element
     *
     * @return boolean
     */
    public function matches($element) {
        return is_object($element) ? is_a($element, $this->type) : gettype($element) === $this->type;
    }

}

Classes

Title Deprecated Summary
TypeMatcher

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal