protected function getItemFromFile(Storage $storage, SplFileInfo $file)
    {
        /* @var $item Item */
        foreach ($storage->getItems() as $item) {
            if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilename()) {
                return $item;
            }
        }

        return false;
    }
protected function getItemFromFile(Storage $storage, SplFileInfo $file)
    {
        /* @var $item Item */
        foreach ($storage->getItems() as $item) {
            if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilename()) {
                return $item;
            }
        }

        return false;
    }
protected function getItemFromFile ( Storage $ storage , SplFileInfo $ file ) { /* @var $item Item */ foreach ( $ storage -> getItems ( ) as $ item ) { if ( pathinfo ( $ item -> getPath ( ) , PATHINFO_BASENAME ) == $ file -> getFilename ( ) ) { return $ item ; } } return false ; }
Get item from files.

@param Storage $storage
@param SplFileInfo $file

@return Item|bool
Get item from files .