public function getType(Content $node)
    {
        $path = $node->getPath() ?: $node->getName();
        $extension = pathinfo($path, PATHINFO_EXTENSION);

        foreach ($this->types as $type) {
            if (in_array($extension, $type->getExtensions())) {
                return $type;
            }
        }

        throw new \RuntimeException("no contentType found for $path");
    }
public function getType(Content $node)
    {
        $path = $node->getPath() ?: $node->getName();
        $extension = pathinfo($path, PATHINFO_EXTENSION);

        foreach ($this->types as $type) {
            if (in_array($extension, $type->getExtensions())) {
                return $type;
            }
        }

        throw new \RuntimeException("no contentType found for $path");
    }
public function getType ( Content $ node ) { $ path = $ node -> getPath ( ) ? : $ node -> getName ( ) ; $ extension = pathinfo ( $ path , PATHINFO_EXTENSION ) ; foreach ( $ this -> types as $ type ) { if ( in_array ( $ extension , $ type -> getExtensions ( ) ) ) { return $ type ; } } throw new \ RuntimeException ( "no contentType found for $path" ) ; }
Get the ContentType able to handle this node

@param Content $node
@return ContentType
Get the ContentType able to handle this node