public static function getPluginClassNames(
        \Composer\Package\PackageInterface $package,
        \Composer\Package\PackageInterface $rootPackage = null
    ) {
        $packageType = $package->getType();
        $packagePrettyName = $package->getPrettyName();
        $packageName = $package->getName();

        $classNames = array();

        // 1. root package
        $rootPackageExtra = $rootPackage ? $rootPackage->getExtra() : null;
        if (!empty($rootPackageExtra[$packageType])) {
            $classNames = (array) $this->mapRootExtra($rootPackageExtra[$packageType], $packagePrettyName);
        }

        // 2. package
        if (!$classNames) {
            $packageExtra = $package->getExtra();
            if (!empty($packageExtra[$packageType])) {
                $classNames = (array) $packageExtra[$packageType];
            }
        }

        // 3. guess by installer name
        if (!$classNames) {
            $installName = static::getInstallName($package, $rootPackage);
            $classNames = array($installName);
        }

        return $classNames;
    }
public static function getPluginClassNames(
        \Composer\Package\PackageInterface $package,
        \Composer\Package\PackageInterface $rootPackage = null
    ) {
        $packageType = $package->getType();
        $packagePrettyName = $package->getPrettyName();
        $packageName = $package->getName();

        $classNames = array();

        // 1. root package
        $rootPackageExtra = $rootPackage ? $rootPackage->getExtra() : null;
        if (!empty($rootPackageExtra[$packageType])) {
            $classNames = (array) $this->mapRootExtra($rootPackageExtra[$packageType], $packagePrettyName);
        }

        // 2. package
        if (!$classNames) {
            $packageExtra = $package->getExtra();
            if (!empty($packageExtra[$packageType])) {
                $classNames = (array) $packageExtra[$packageType];
            }
        }

        // 3. guess by installer name
        if (!$classNames) {
            $installName = static::getInstallName($package, $rootPackage);
            $classNames = array($installName);
        }

        return $classNames;
    }
public static function getPluginClassNames ( \ Composer \ Package \ PackageInterface $ package , \ Composer \ Package \ PackageInterface $ rootPackage = null ) { $ packageType = $ package -> getType ( ) ; $ packagePrettyName = $ package -> getPrettyName ( ) ; $ packageName = $ package -> getName ( ) ; $ classNames = array ( ) ; // 1. root package $ rootPackageExtra = $ rootPackage ? $ rootPackage -> getExtra ( ) : null ; if ( ! empty ( $ rootPackageExtra [ $ packageType ] ) ) { $ classNames = ( array ) $ this -> mapRootExtra ( $ rootPackageExtra [ $ packageType ] , $ packagePrettyName ) ; } // 2. package if ( ! $ classNames ) { $ packageExtra = $ package -> getExtra ( ) ; if ( ! empty ( $ packageExtra [ $ packageType ] ) ) { $ classNames = ( array ) $ packageExtra [ $ packageType ] ; } } // 3. guess by installer name if ( ! $ classNames ) { $ installName = static :: getInstallName ( $ package , $ rootPackage ) ; $ classNames = array ( $ installName ) ; } return $ classNames ; }
Determines the plugin class names of a package

Plugin class names are either specified explicitly in either the root
package's or the plugin package's `composer.json`, or are derived
implicitly from the plugin's installer name. The installer name is, for
its part, either specified explicitly, or derived implicitly from the
plugin package's name ({@see static::getInstallName()}).

1. Using the "pico-plugin" extra in the root package's `composer.json`:
```yaml
{
"extra": {
"pico-plugin": {
"<package name>": [ "<class name>", "<class name>", ... ]
}
}
}
```

Besides matching the exact package name, you can also use the
`vendor:` or `name:` prefixes. See {@see static::mapRootExtra()}.

2. Using the "pico-plugin" extra in the package's `composer.json`:
```yaml
{
"extra": {
"pico-plugin": [ "<class name>", "<class name>", ... ]
}
}
```

3. Using the installer name. See {@see static::getInstallName()}.

@param  \Composer\Package\PackageInterface      $package
@param  \Composer\Package\PackageInterface|null $rootPackage
@return string[]
Determines the plugin class names of a package