create() public method

Returns a package instance.
public create ( string $packagesBasePath, string $packagePath, string $packageKey, string $composerName, array $autoloadConfiguration = [], array $packageClassInformation = null ) : Neos\Flow\Package\PackageInterface
$packagesBasePath string the base install path of packages,
$packagePath string path to package, relative to base path
$packageKey string key / name of the package
$composerName string
$autoloadConfiguration array Autoload configuration as defined in composer.json
$packageClassInformation array
return Neos\Flow\Package\PackageInterface
 /**
  * @test
  */
 public function createReturnsAnInstanceOfTheDefaultPackageIfNoCustomPackageExists()
 {
     $packagePath = 'vfs://Packages/Some/Path/Some.Package/';
     mkdir($packagePath, 0777, true);
     file_put_contents($packagePath . 'composer.json', '{"name": "some/package", "type": "neos-test"}');
     $package = $this->packageFactory->create('vfs://Packages/', 'Some/Path/Some.Package/', 'Some.Package', 'some/package');
     $this->assertSame(Package::class, get_class($package));
 }
 /**
  * Registers a package under the given composer name with the configuration.
  * This uses the PackageFactory to create the Package instance and sets it
  * to all relevant data arrays.
  *
  * @param string $composerName
  * @param array $packageStateConfiguration
  * @return void
  */
 protected function registerPackageFromStateConfiguration($composerName, $packageStateConfiguration)
 {
     $packagePath = isset($packageStateConfiguration['packagePath']) ? $packageStateConfiguration['packagePath'] : null;
     $packageClassInformation = isset($packageStateConfiguration['packageClassInformation']) ? $packageStateConfiguration['packageClassInformation'] : null;
     $package = $this->packageFactory->create($this->packagesBasePath, $packagePath, $packageStateConfiguration['packageKey'], $composerName, $packageStateConfiguration['autoloadConfiguration'], $packageClassInformation);
     $this->packageKeys[strtolower($package->getPackageKey())] = $package->getPackageKey();
     $this->packages[$package->getPackageKey()] = $package;
     if (isset($this->activePackages[$package->getPackageKey()])) {
         unset($this->activePackages[$package->getPackageKey()]);
     }
     if (isset($packageStateConfiguration['state']) && $packageStateConfiguration['state'] === self::PACKAGE_STATE_ACTIVE || $package->isProtected()) {
         $this->activePackages[$package->getPackageKey()] = $package;
     }
 }