getNamespaces() public method

It does not return the global namespace which always exists.
public getNamespaces ( ) : string[]
return string[] An array of namespaces
 public function __construct(Application $application, CompletionContext $context = null)
 {
     $this->application = $application;
     $this->context = $context;
     $this->addHandler(new Completion('help', 'command_name', Completion::TYPE_ARGUMENT, array_keys($application->all())));
     $this->addHandler(new Completion('list', 'namespace', Completion::TYPE_ARGUMENT, $application->getNamespaces()));
 }
Ejemplo n.º 2
0
 public function testGetNamespaces()
 {
     $application = new Application();
     $application->add(new \FooCommand());
     $application->add(new \Foo1Command());
     $this->assertEquals(array('foo'), $application->getNamespaces(), '->getNamespaces() returns an array of unique used namespaces');
 }