Moved method
parent
3dae4cd517
commit
bef46a17dc
|
@ -38,22 +38,6 @@ class InitCommand extends Command
|
|||
private $gitConfig;
|
||||
private $pool;
|
||||
|
||||
public function parseAuthorString($author)
|
||||
{
|
||||
if (preg_match('/^(?P<name>[- \.,\p{L}\p{N}\'’]+) <(?P<email>.+?)>$/u', $author, $match)) {
|
||||
if ($this->isValidEmail($match['email'])) {
|
||||
return array(
|
||||
'name' => trim($match['name']),
|
||||
'email' => $match['email']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(
|
||||
'Invalid author string. Must be in the format: '.
|
||||
'John Smith <john@example.com>'
|
||||
);
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
|
@ -293,6 +277,27 @@ EOT
|
|||
$input->setOption('require-dev', $devRequirements);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $author
|
||||
* @return array
|
||||
*/
|
||||
public function parseAuthorString($author)
|
||||
{
|
||||
if (preg_match('/^(?P<name>[- \.,\p{L}\p{N}\'’]+) <(?P<email>.+?)>$/u', $author, $match)) {
|
||||
if ($this->isValidEmail($match['email'])) {
|
||||
return array(
|
||||
'name' => trim($match['name']),
|
||||
'email' => $match['email']
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
throw new \InvalidArgumentException(
|
||||
'Invalid author string. Must be in the format: '.
|
||||
'John Smith <john@example.com>'
|
||||
);
|
||||
}
|
||||
|
||||
protected function findPackages($name)
|
||||
{
|
||||
return $this->getRepos()->search($name);
|
||||
|
|
Loading…
Reference in New Issue