protected static function ensureDirObject(&$pathOrObject)
    {
        if ($pathOrObject instanceof DirectoryInterface) {
            return $pathOrObject;
        } elseif ($pathOrObject instanceof FileInterface) {
            return static::dir($pathOrObject->getPath());
        } elseif (is_string($pathOrObject)) {
            return static::dir($pathOrObject);
        }
        return $pathOrObject;
    }
protected static function ensureDirObject(&$pathOrObject)
    {
        if ($pathOrObject instanceof DirectoryInterface) {
            return $pathOrObject;
        } elseif ($pathOrObject instanceof FileInterface) {
            return static::dir($pathOrObject->getPath());
        } elseif (is_string($pathOrObject)) {
            return static::dir($pathOrObject);
        }
        return $pathOrObject;
    }
protected static function ensureDirObject ( & $ pathOrObject ) { if ( $ pathOrObject instanceof DirectoryInterface ) { return $ pathOrObject ; } elseif ( $ pathOrObject instanceof FileInterface ) { return static :: dir ( $ pathOrObject -> getPath ( ) ) ; } elseif ( is_string ( $ pathOrObject ) ) { return static :: dir ( $ pathOrObject ) ; } return $ pathOrObject ; }
Ensure that object is implementing DirectoryInterface
@param FileInterface|DirectoryInterface|string $pathOrObject
@return DirectoryInterface
Ensure that object is implementing DirectoryInterface