From a740716f9bbc8f9288190537d1c69c629618578f Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 11 Apr 2016 21:24:33 +0900 Subject: [PATCH] More work on license part Refs #11. --- src/Parts/License/Part.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Parts/License/Part.php b/src/Parts/License/Part.php index f066c53..81e6694 100644 --- a/src/Parts/License/Part.php +++ b/src/Parts/License/Part.php @@ -13,9 +13,22 @@ public function setupPackage($composer, Directory $target) if ($this->input->confirm('Do you want to configure a license for your project?')) { $licenses = new SpdxLicenses(); - // 1. Choose a license from a list - // 2. Generate the license file, with year and name - // 3. Add it to composer.json + $license = $this->selectLicenseFromList($licenses); + + $this->copyLicenseFileTo($target, $license); + + $composer->license = $license; } } + + protected function selectLicenseFromList($licenses) + { + // Ask the user to chosse a license from the list + } + + protected function copyLicenseFileTo(Directory $target, $license) + { + // Download the file + // Add year and name + } }