enableIf() public method

Enables the command if a condition holds and disables it otherwise.
public enableIf ( boolean $condition ) : static
$condition boolean The condition under which to enable the command.
return static The current instance.
示例#1
0
 public function testEnableIf()
 {
     $this->config->enableIf(true);
     $this->assertTrue($this->config->isEnabled());
     $this->config->enableIf(false);
     $this->assertFalse($this->config->isEnabled());
 }