public function getFQCN(PackageInterface $package, $bundleFileName)
    {
        $bundleName = substr(basename($bundleFileName), 0, -4);
        $autoload = $package->getAutoload();

        if (isset($autoload['psr-0'])) {
            $namespace = key($autoload['psr-0']);

            return rtrim($namespace, '\\') . '\\' . $bundleName;
        }

        if (isset($autoload['psr-4'])) {
            $namespace = key($autoload['psr-4']);

            return $namespace . $bundleName;
        }

        return $bundleName;
    }
public function getFQCN(PackageInterface $package, $bundleFileName)
    {
        $bundleName = substr(basename($bundleFileName), 0, -4);
        $autoload = $package->getAutoload();

        if (isset($autoload['psr-0'])) {
            $namespace = key($autoload['psr-0']);

            return rtrim($namespace, '\\') . '\\' . $bundleName;
        }

        if (isset($autoload['psr-4'])) {
            $namespace = key($autoload['psr-4']);

            return $namespace . $bundleName;
        }

        return $bundleName;
    }
public function getFQCN ( PackageInterface $ package , $ bundleFileName ) { $ bundleName = substr ( basename ( $ bundleFileName ) , 0 , - 4 ) ; $ autoload = $ package -> getAutoload ( ) ; if ( isset ( $ autoload [ 'psr-0' ] ) ) { $ namespace = key ( $ autoload [ 'psr-0' ] ) ; return rtrim ( $ namespace , '\\' ) . '\\' . $ bundleName ; } if ( isset ( $ autoload [ 'psr-4' ] ) ) { $ namespace = key ( $ autoload [ 'psr-4' ] ) ; return $ namespace . $ bundleName ; } return $ bundleName ; }
Try to determine the package name with the filename and
the package autoload definition.
This won't work 100%, f.e. with Bundles that have only have
an autoloader prefix, instead of the full namespace untill the BundleFile

@param  \Composer\Package\PackageInterface $package
@param  type                               $bundleFileName
@return string
Try to determine the package name with the filename and the package autoload definition . This won t work 100% f . e . with Bundles that have only have an autoloader prefix instead of the full namespace untill the BundleFile