Skip to content

Commit 0cc5806

Browse files
committed
Refactor —dev to use processArguments() method.
1 parent 5c9a552 commit 0cc5806

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

src/NewCommand.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class NewCommand extends Command
3030
public $relativePath;
3131
public $absolutePath;
3232
public $name;
33+
public $version;
3334
public $starterKit;
3435
public $starterKitVcs;
3536
public $starterKitLicense;
@@ -160,6 +161,10 @@ protected function processArguments()
160161

161162
$this->name = pathinfo($this->absolutePath)['basename'];
162163

164+
$this->version = $this->input->getOption('dev')
165+
? 'dev-master'
166+
: '';
167+
163168
$this->starterKit = $this->input->getArgument('starter-kit');
164169
$this->starterKitLicense = $this->input->getOption('license');
165170
$this->local = $this->input->getOption('local');
@@ -721,11 +726,9 @@ protected function createProjectCommand()
721726

722727
$baseRepo = self::BASE_REPO;
723728

724-
$version = $this->getVersion();
725-
726729
$directory = $this->pathIsCwd() ? '.' : $this->relativePath;
727730

728-
return $composer." create-project {$baseRepo} \"{$directory}\" {$version} --remove-vcs --prefer-dist";
731+
return $composer." create-project {$baseRepo} \"{$directory}\" {$this->version} --remove-vcs --prefer-dist";
729732
}
730733

731734
/**
@@ -842,13 +845,4 @@ public function __call($method, $args)
842845
}
843846
};
844847
}
845-
846-
protected function getVersion()
847-
{
848-
if ($this->input->getOption('dev')) {
849-
return 'dev-master';
850-
}
851-
852-
return '';
853-
}
854848
}

0 commit comments

Comments
 (0)