AsyncPHP\Doorman\Manager\ProcessManager::getShell PHP Method

getShell() public method

Gets or creates a Shell instance.
public getShell ( ) : AsyncPHP\Doorman\Shell
return AsyncPHP\Doorman\Shell
    public function getShell()
    {
        if ($this->shell === null) {
            $this->shell = $this->newShell();
        }
        return $this->shell;
    }

Usage Example

Beispiel #1
0
 /**
  * @test
  */
 public function gettersAndSettersWork()
 {
     $this->manager->setLogPath(__DIR__);
     $this->assertEquals(__DIR__, $this->manager->getLogPath());
     $this->assertInstanceOf("AsyncPHP\\Doorman\\Shell", $this->manager->getShell());
     $shell = new BashShell();
     $this->manager->setShell($shell);
     $this->assertEquals($shell, $this->manager->getShell());
     $this->assertInstanceOf("AsyncPHP\\Doorman\\Rules", $this->manager->getRules());
     $rules = new InMemoryRules();
     $this->manager->setRules($rules);
     $this->assertEquals($rules, $this->manager->getRules());
 }