Webmozart\Expression\Expr::isInstanceOf PHP Method

isInstanceOf() public static method

Check that a value is an instance of a given class.
public static isInstanceOf ( string $className ) : IsEmpty
$className string The class name.
return Webmozart\Expression\Constraint\IsEmpty The created expression.
    public static function isInstanceOf($className)
    {
        return new IsInstanceOf($className);
    }

Usage Example

コード例 #1
0
ファイル: FindCommandHandler.php プロジェクト: holloway87/cli
 /**
  * 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;
 }
All Usage Examples Of Webmozart\Expression\Expr::isInstanceOf