Skip to content

Commit

Permalink
Change name of InitializeCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Sep 30, 2024
1 parent 6f48077 commit 89cfe25
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ $ composer require rougin/blueprint

### Creating a new `blueprint.yml`

Create a `blueprint.yml` file by running the `init` command:
Create a `blueprint.yml` file by running the `initialize` command:

``` bash
$ vendor/bin/blueprint init
$ vendor/bin/blueprint initialize
```

``` yml
Expand Down
18 changes: 6 additions & 12 deletions src/Commands/InitializeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
*/
class InitializeCommand extends Command
{
/**
* @var string[]
*/
protected $aliases = array('initialize');

/**
* @var string
*/
Expand All @@ -24,7 +19,7 @@ class InitializeCommand extends Command
/**
* @var string
*/
protected $name = 'init';
protected $name = 'initialize';

/**
* @var string
Expand All @@ -40,11 +35,11 @@ public function init()
{
$this->path = $this->getPlatePath();

$text = 'Creates a "' . $this->file . '" file';
$text = 'Create a "' . $this->file . '" file';

$this->description = $text;

$text = 'Allows to create a "' . $this->file . '" file in the current working directory.';
$text = 'Create a new "' . $this->file . '" file in the current directory.';

$this->help = (string) $text;
}
Expand Down Expand Up @@ -100,11 +95,10 @@ protected function getPlatePath()
*/
protected function getRootPath()
{
/** @var string */
$vendor = realpath(__DIR__ . '/../../../../../');
$root = (string) __DIR__ . '/../../../../../';

$exists = file_exists($vendor . '/../autoload.php');
$exists = file_exists($root . '/vendor/autoload.php');

return $exists ? $vendor : __DIR__ . '/../../';
return $exists ? $root : __DIR__ . '/../../';
}
}
5 changes: 5 additions & 0 deletions tests/Fixture/Commands/GreetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
*/
class GreetCommand extends Command
{
/**
* @var string[]
*/
protected $aliases = array('wave');

/**
* @var string
*/
Expand Down

0 comments on commit 89cfe25

Please sign in to comment.