X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fconsolidation%2Frobo%2Fsrc%2FTask%2FComposer%2FInit.php;fp=vendor%2Fconsolidation%2Frobo%2Fsrc%2FTask%2FComposer%2FInit.php;h=c841299ddbefe210cc6d2c7a74757cd00553ac28;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/consolidation/robo/src/Task/Composer/Init.php b/vendor/consolidation/robo/src/Task/Composer/Init.php new file mode 100644 index 000000000..c841299dd --- /dev/null +++ b/vendor/consolidation/robo/src/Task/Composer/Init.php @@ -0,0 +1,115 @@ +taskComposerInit()->run(); + * ?> + * ``` + */ +class Init extends Base +{ + /** + * {@inheritdoc} + */ + protected $action = 'init'; + + /** + * @return $this + */ + public function projectName($projectName) + { + $this->option('name', $projectName); + return $this; + } + + /** + * @return $this + */ + public function description($description) + { + $this->option('description', $description); + return $this; + } + + /** + * @return $this + */ + public function author($author) + { + $this->option('author', $author); + return $this; + } + + /** + * @return $this + */ + public function projectType($type) + { + $this->option('type', $type); + return $this; + } + + /** + * @return $this + */ + public function homepage($homepage) + { + $this->option('homepage', $homepage); + return $this; + } + + /** + * 'require' is a keyword, so it cannot be a method name. + * @return $this + */ + public function dependency($project, $version = null) + { + if (isset($version)) { + $project .= ":$version"; + } + $this->option('require', $project); + return $this; + } + + /** + * @return $this + */ + public function stability($stability) + { + $this->option('stability', $stability); + return $this; + } + + /** + * @return $this + */ + public function license($license) + { + $this->option('license', $license); + return $this; + } + + /** + * @return $this + */ + public function repository($repository) + { + $this->option('repository', $repository); + return $this; + } + + /** + * {@inheritdoc} + */ + public function run() + { + $command = $this->getCommand(); + $this->printTaskInfo('Creating composer.json: {command}', ['command' => $command]); + return $this->executeCommand($command); + } +}