1
0
Fork 0

Moved method

pull/3983/head
Rob Bast 2015-04-30 12:22:09 +02:00
parent 3dae4cd517
commit bef46a17dc
1 changed files with 21 additions and 16 deletions

View File

@ -38,22 +38,6 @@ class InitCommand extends Command
private $gitConfig; private $gitConfig;
private $pool; 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() protected function configure()
{ {
@ -293,6 +277,27 @@ EOT
$input->setOption('require-dev', $devRequirements); $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) protected function findPackages($name)
{ {
return $this->getRepos()->search($name); return $this->getRepos()->search($name);