Ptondereau\PackMe\Commands\CreateCommand::askForPackageName PHP Method

askForPackageName() protected method

protected askForPackageName ( string $package = 'vendor/package' ) : string
$package string
return string
    protected function askForPackageName($package = 'vendor/package')
    {
        return $this->askAndValidate('Package name (<vendor>/<name>) [<comment>' . $package . '</comment>]: ', function ($value) use($package) {
            if (null === $value) {
                return $package;
            }
            if (!preg_match('{^[a-z0-9_.-]+/[a-z0-9_.-]+$}', $value)) {
                throw new \InvalidArgumentException('The package name ' . $value . ' is invalid, it should be lowercase and have a vendor name, a forward slash, and a package name, matching: [a-z0-9_.-]+/[a-z0-9_.-]+');
            }
            return $value;
        }, null, $package);
    }