Skip to content

Commit ad8ae4e

Browse files
committed
Docblocks and such
1 parent 8a0905a commit ad8ae4e

7 files changed

Lines changed: 51 additions & 12 deletions

File tree

src/Laracasts/Commander/CommandHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
interface CommandHandler {
44

55
/**
6-
* Handle the command
6+
* Handle the command.
77
*
88
* @param $command
99
* @return mixed

src/Laracasts/Commander/CommandTranslator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
interface CommandTranslator {
44

55
/**
6-
* Translate a command to its handler counterpart
6+
* Translate a command to its handler counterpart.
77
*
88
* @param $command
99
* @return mixed
@@ -12,7 +12,7 @@ interface CommandTranslator {
1212
public function toCommandHandler($command);
1313

1414
/**
15-
* Translate a command to its validator counterpart
15+
* Translate a command to its validator counterpart.
1616
*
1717
* @param $command
1818
* @return mixed

src/Laracasts/Commander/CommanderServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function provides()
3737
}
3838

3939
/**
40-
* Register the command translator binding
40+
* Register the command translator binding.
4141
*/
4242
protected function registerCommandTranslator()
4343
{
4444
$this->app->bind('Laracasts\Commander\CommandTranslator', 'Laracasts\Commander\BasicCommandTranslator');
4545
}
4646

4747
/**
48-
* Register the desired command bus implementation
48+
* Register the command bus implementation.
4949
*/
5050
protected function registerCommandBus()
5151
{
@@ -59,7 +59,7 @@ protected function registerCommandBus()
5959
}
6060

6161
/**
62-
* Register the Artisan command
62+
* Register the Artisan command.
6363
*
6464
* @return void
6565
*/

src/Laracasts/Commander/CommanderTrait.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
trait CommanderTrait {
88

99
/**
10-
* Execute the command
10+
* Execute the command.
1111
*
1212
* @param string $command
1313
* @param array $input
@@ -22,10 +22,8 @@ protected function execute($command, array $input = null, $decorators = [])
2222

2323
$bus = $this->getCommandBus();
2424

25-
// If any decorators are passed, we'll
26-
// filter through and register them
27-
// with the CommandBus, so that they
28-
// are executed first.
25+
// If any decorators are passed, we'll filter through and register them
26+
// with the CommandBus, so that they are executed first.
2927
foreach ($decorators as $decorator)
3028
{
3129
$bus->decorate($decorator);
@@ -46,11 +44,11 @@ public function getCommandBus()
4644

4745
/**
4846
* Map an array of input to a command's properties.
49-
* - Code courtesy of Taylor Otwell.
5047
*
5148
* @param string $command
5249
* @param array $input
5350
* @throws InvalidArgumentException
51+
* @author Taylor Otwell
5452
*
5553
* @return mixed
5654
*/

src/Laracasts/Commander/Console/CommandGenerator.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,31 @@
55

66
class CommandGenerator {
77

8+
/**
9+
* @var Filesystem
10+
*/
811
protected $file;
912

13+
/**
14+
* @var Mustache_Engine
15+
*/
1016
protected $mustache;
1117

18+
/**
19+
* @param Filesystem $file
20+
* @param Mustache_Engine $mustache
21+
*/
1222
public function __construct(Filesystem $file, Mustache_Engine $mustache)
1323
{
1424
$this->file = $file;
1525
$this->mustache = $mustache;
1626
}
1727

28+
/**
29+
* @param CommandInput $input
30+
* @param $template
31+
* @param $destination
32+
*/
1833
public function make(CommandInput $input, $template, $destination)
1934
{
2035
$template = $this->file->get($template);

src/Laracasts/Commander/Console/CommandInput.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,36 @@
22

33
class CommandInput {
44

5+
/**
6+
* @var string
7+
*/
58
public $name;
69

10+
/**
11+
* @var string
12+
*/
713
public $namespace;
814

15+
/**
16+
* @var array
17+
*/
918
public $properties = [];
1019

20+
/**
21+
* @param $name
22+
* @param $namespace
23+
* @param $properties
24+
*/
1125
public function __construct($name, $namespace, $properties)
1226
{
1327
$this->name = $name;
1428
$this->namespace = $namespace;
1529
$this->properties = $properties;
1630
}
1731

32+
/**
33+
* @return string
34+
*/
1835
public function arguments()
1936
{
2037
return implode(', ', array_map(function($property)

src/Laracasts/Commander/Console/CommandInputParser.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
class CommandInputParser {
44

5+
/**
6+
* @param $path
7+
* @param $properties
8+
* @return CommandInput
9+
*/
510
public function parse($path, $properties)
611
{
712
$segments = explode('\\', str_replace('/', '\\', $path));
@@ -13,6 +18,10 @@ public function parse($path, $properties)
1318
return new CommandInput($name, $namespace, $properties);
1419
}
1520

21+
/**
22+
* @param $properties
23+
* @return array
24+
*/
1625
private function parseProperties($properties)
1726
{
1827
return preg_split('/ ?, ?/', $properties, null, PREG_SPLIT_NO_EMPTY);

0 commit comments

Comments
 (0)