protected function getFileTypeClass(/*# string */ $filename)
    {
        $parts  = explode('.', strtolower(basename($filename)));
        $count  = count($parts);
        $suffix = $count > 1 ? $parts[$count - 1] : 'php';
        $type   = $count > 2 ? $parts[$count - 2][0] : '_';

        // valid types
        $types  = ['s' => 'services', 'p' => 'parameters', 'm' => 'mappings'];

        return [
            isset($types[$type]) ? $types[$type] : false,
            $this->getLoaderClass($suffix, $filename)
        ];
    }
protected function getFileTypeClass(/*# string */ $filename)
    {
        $parts  = explode('.', strtolower(basename($filename)));
        $count  = count($parts);
        $suffix = $count > 1 ? $parts[$count - 1] : 'php';
        $type   = $count > 2 ? $parts[$count - 2][0] : '_';

        // valid types
        $types  = ['s' => 'services', 'p' => 'parameters', 'm' => 'mappings'];

        return [
            isset($types[$type]) ? $types[$type] : false,
            $this->getLoaderClass($suffix, $filename)
        ];
    }
protected function getFileTypeClass ( /*# string */ $ filename ) { $ parts = explode ( '.' , strtolower ( basename ( $ filename ) ) ) ; $ count = count ( $ parts ) ; $ suffix = $ count > 1 ? $ parts [ $ count - 1 ] : 'php' ; $ type = $ count > 2 ? $ parts [ $ count - 2 ] [ 0 ] : '_' ; // valid types $ types = [ 's' => 'services' , 'p' => 'parameters' , 'm' => 'mappings' ] ; return [ isset ( $ types [ $ type ] ) ? $ types [ $ type ] : false , $ this -> getLoaderClass ( $ suffix , $ filename ) ] ; }
Get definition type and loader class

*.[php|json|xml]    : all definitions
*.s*.[php|json|xml] : service definitions
*.p*.[php|json|xml] : parameter definitions
*.m*.[php|json|xml] : mappings definitions

@param  string $filename definition file name
@return string[]
@throws LogicException if something goes wrong
@access protected
Get definition type and loader class