Passed
Push — master ( d5adc1...45b033 )
by Fabio
06:12
created

TPhpShellAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 19
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A performAction() 0 8 2
1
<?php
2
/**
3
 * TPhpShellAction class file
4
 *
5
 * @author Brad Anderson <[email protected]>
6
 * @link https://github.com/pradosoft/prado
7
 * @license https://github.com/pradosoft/prado/blob/master/LICENSE
8
 * @package Prado\Shell\Actions
9
 */
10
11
namespace Prado\Shell\Actions;
12
13
use Prado\Prado;
14
use Prado\Shell\TShellAction;
15
16
/**
17
 * Creates and run a Prado application in a PHP Shell.
18
 *
19
 * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
20
 * @package Prado\Shell\Actions
21
 * @since 3.0.5
22
 */
23
class TPhpShellAction extends TShellAction
24
{
25
	protected $action = 'shell';
26
	protected $parameters = [];
27
	protected $optional = ['directory'];
28
	protected $description = 'Runs a PHP interactive interpreter. Initializes the Prado application in the given [directory].';
29
30
	/**
31
	 * @param array $args parameters
32
	 * @return bool
33
	 */
34
	public function performAction($args)
35
	{
36
		if (count($args) > 1) {
37
			$this->initializePradoApplication($args[1]);
38
		}
39
40
		\Psy\debug([], Prado::getApplication());
41
		return true;
42
	}
43
}
44