isInstanceOf() public static méthode

Check that a value is an instance of a given class.
public static isInstanceOf ( string $className ) : IsEmpty
$className string The class name.
Résultat Webmozart\Expression\Constraint\IsEmpty The created expression.
 /**
  * Finds the resources for a given binding type.
  *
  * @param string $typeName The type name.
  *
  * @return string[] An array of short resource class names indexed by
  *                  the resource path.
  */
 private function findByBindingType($typeName)
 {
     $matches = array();
     $expr = Expr::isInstanceOf('Puli\\Discovery\\Binding\\ResourceBinding');
     foreach ($this->discovery->findBindings($typeName, $expr) as $binding) {
         /** @var ResourceBinding $binding */
         foreach ($binding->getResources() as $resource) {
             $matches[$resource->getPath()] = StringUtil::getShortClassName(get_class($resource));
         }
     }
     ksort($matches);
     return $matches;
 }
Exemple #2
0
 public function orInstanceOf($className)
 {
     return $this->orX(Expr::isInstanceOf($className));
 }
Exemple #3
0
 public function andInstanceOf($className)
 {
     return $this->andX(Expr::isInstanceOf($className));
 }