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

TShellApplication::getShellActionClasses()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * TShellApplication class file
4
 *
5
 * @author Qiang Xue <[email protected]>
6
 * @link https://github.com/pradosoft/prado
7
 * @license https://github.com/pradosoft/prado/blob/master/LICENSE
8
 * @package Prado\Shell
9
 */
10
11
namespace Prado\Shell;
12
13
/**
14
 * TShellApplication class.
15
 *
16
 * TShellApplication is the base class for developing command-line PRADO
17
 * tools that share the same configurations as their Web application counterparts.
18
 *
19
 * A typical usage of TShellApplication in a command-line PHP script is as follows:
20
 * <code>
21
 * require 'path/to/vendor/autoload.php';
22
 * $application=new TShellApplication('path/to/application.xml');
23
 * $application->run();
24
 * // perform command-line tasks here
25
 * </code>
26
 *
27
 * Since the application instance has access to all configurations, including
28
 * path aliases, modules and parameters, the command-line script has nearly the same
29
 * accessibility to resources as the PRADO Web applications.
30
 *
31
 * @author Qiang Xue <[email protected]>
32
 * @package Prado\Shell
33
 * @since 3.1.0
34
 */
35
class TShellApplication extends \Prado\TApplication
36
{
37
	/**
38
	 * @var cli shell Application commands. Modules can add their own command
0 ignored issues
show
Bug introduced by
The type Prado\Shell\cli was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
39
	 */
40
	private $_actionClasses = [];
41
	
42
	/**
43
	 * Runs the application.
44
	 * This method overrides the parent implementation by initializing
45
	 * application with configurations specified when it is created.
46
	 */
47
	public function run()
48
	{
49
		$this->initApplication();
50
	}
51
	
52
	/**
53
	 * @param $v string a CLI Action class to add to the list of what the app is capable
54
	 */
55
	public function addShellActionClass($v)
56
	{
57
		$this->_actionClasses[] = $v;
58
	}
59
	
60
	/**
61
	 * @@return array the CLI Action classes that the application has registered
62
	 */
63
	public function getShellActionClasses()
64
	{
65
		return $this->_actionClasses;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->_actionClasses returns the type Prado\Shell\cli which is incompatible with the documented return type array.
Loading history...
66
	}
67
}
68