Exemplo n.º 1
0
 /**
  * Create a stability enumeration from the supplied raw data.
  *
  * @param string|null $stability The raw stability data.
  *
  * @return Element\Stability|null The newly created stability enumeration.
  */
 protected function createStability($stability)
 {
     if (null !== $stability) {
         $stability = Element\Stability::memberByValue($stability, false);
     }
     return $stability;
 }
 /**
  * Construct a new configuration.
  *
  * @param string|null                              $name             The package name.
  * @param string|null                              $description      The package description.
  * @param string|null                              $version          The package version.
  * @param string|null                              $type             The package type.
  * @param array<integer,string>|null               $keywords         The keywords the package is related to.
  * @param string|null                              $homepage         The URI of the package's home page.
  * @param DateTime|null                            $time             The release date of this version.
  * @param array<integer,string>|null               $license          The licences the package is released under.
  * @param array<integer,Author>|null               $authors          The authors of the package.
  * @param SupportInformation|null                  $support          Support information for the package.
  * @param array<string,string>|null                $dependencies     The package's dependencies.
  * @param array<string,string>|null                $devDependencies  The package's development dependencies.
  * @param array<string,string>|null                $conflict         Packages that conflict with this version of the package.
  * @param array<string,string>|null                $replace          Packages that are replaced by this package.
  * @param array<string,string>|null                $provide          Packages that are provided by this package.
  * @param array<string,string>|null                $suggest          Suggested packages for use with this package.
  * @param array<string,array<integer,string>>|null $autoloadPsr4     PSR-4 autoloading configuration for the package.
  * @param array<string,array<integer,string>>|null $autoloadPsr0     PSR-0 autoloading configuration for the package.
  * @param array<integer,string>|null               $autoloadClassmap Class map autoloading configuration for the package.
  * @param array<integer,string>|null               $autoloadFiles    File autoloading configuration for the package.
  * @param array<integer,string>|null               $includePath      Include path autoloading configuration for the package.
  * @param string|null                              $targetDir        The target directory for installation.
  * @param Stability|null                           $minimumStability The minimum stability for packages.
  * @param bool|null                                $preferStable     True if stable packages should take precedence.
  * @param array<integer,RepositoryInterface>       $repositories     The custom repositories used by this package.
  * @param ProjectConfiguration|null                $config           The configuration options for the package that are specific to project-type repositories.
  * @param ScriptConfiguration|null                 $scripts          The hook scripts for the package.
  * @param mixed                                    $extra            Arbitrary extra data contained in the project's configuration.
  * @param array<integer,string>|null               $bin              Binary executable files provided by the package.
  * @param ArchiveConfiguration|null                $archive          The archive configuration for the package.
  * @param mixed                                    $rawData          The raw data describing the configuration.
  */
 public function __construct($name = null, $description = null, $version = null, $type = null, array $keywords = null, $homepage = null, DateTime $time = null, array $license = null, array $authors = null, SupportInformation $support = null, array $dependencies = null, array $devDependencies = null, array $conflict = null, array $replace = null, array $provide = null, array $suggest = null, array $autoloadPsr4 = null, array $autoloadPsr0 = null, array $autoloadClassmap = null, array $autoloadFiles = null, array $includePath = null, $targetDir = null, Stability $minimumStability = null, $preferStable = null, array $repositories = null, ProjectConfiguration $config = null, ScriptConfiguration $scripts = null, $extra = null, array $bin = null, ArchiveConfiguration $archive = null, $rawData = null)
 {
     if (null === $type) {
         $type = 'library';
     }
     if (null === $keywords) {
         $keywords = array();
     }
     if (null === $license) {
         $license = array();
     }
     if (null === $authors) {
         $authors = array();
     }
     if (null === $support) {
         $support = new SupportInformation();
     }
     if (null === $dependencies) {
         $dependencies = array();
     }
     if (null === $devDependencies) {
         $devDependencies = array();
     }
     if (null === $conflict) {
         $conflict = array();
     }
     if (null === $replace) {
         $replace = array();
     }
     if (null === $provide) {
         $provide = array();
     }
     if (null === $suggest) {
         $suggest = array();
     }
     if (null === $autoloadPsr4) {
         $autoloadPsr4 = array();
     }
     if (null === $autoloadPsr0) {
         $autoloadPsr0 = array();
     }
     if (null === $autoloadClassmap) {
         $autoloadClassmap = array();
     }
     if (null === $autoloadFiles) {
         $autoloadFiles = array();
     }
     if (null === $includePath) {
         $includePath = array();
     }
     if (null === $minimumStability) {
         $minimumStability = Stability::STABLE();
     }
     if (null === $preferStable) {
         $preferStable = false;
     }
     if (null === $repositories) {
         $repositories = array();
     }
     if (null === $config) {
         $config = new ProjectConfiguration();
     }
     if (null === $scripts) {
         $scripts = new ScriptConfiguration();
     }
     if (null === $archive) {
         $archive = new ArchiveConfiguration();
     }
     if (null === $bin) {
         $bin = array();
     }
     $this->name = $name;
     $this->description = $description;
     $this->version = $version;
     $this->type = $type;
     $this->keywords = $keywords;
     $this->homepage = $homepage;
     $this->time = $time;
     $this->license = $license;
     $this->authors = $authors;
     $this->support = $support;
     $this->dependencies = $dependencies;
     $this->devDependencies = $devDependencies;
     $this->conflict = $conflict;
     $this->replace = $replace;
     $this->provide = $provide;
     $this->suggest = $suggest;
     $this->autoloadPsr4 = $autoloadPsr4;
     $this->autoloadPsr0 = $autoloadPsr0;
     $this->autoloadClassmap = $autoloadClassmap;
     $this->autoloadFiles = $autoloadFiles;
     $this->includePath = $includePath;
     $this->targetDir = $targetDir;
     $this->minimumStability = $minimumStability;
     $this->preferStable = $preferStable;
     $this->repositories = $repositories;
     $this->config = $config;
     $this->scripts = $scripts;
     $this->extra = $extra;
     $this->bin = $bin;
     $this->archive = $archive;
     $this->rawData = $rawData;
 }