for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Buttress\Concrete\Console\Command\Argument;
class Parser extends \League\CLImate\Argument\Parser
{
/**
* Pull a command name and arguments from $argv.
*
* @param array $argv
* @return array
*/
protected function getCommandAndArguments(array $argv = null)
// If no $argv is provided then use the global PHP defined $argv.
if (is_null($argv)) {
global $argv;
global
Instead of relying on global state, we recommend one of these alternatives:
function myFunction($a, $b) { // Do something }
class MyClass { private $a; private $b; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function myFunction() { // Do something } }
}
$arguments = $argv;
$script = array_shift($arguments);
$command = array_shift($arguments);
return compact('arguments', 'script', 'command');
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state