disableIf() public method

Disables the command if a condition holds and enables it otherwise.
public disableIf ( boolean $condition ) : static
$condition boolean The condition under which to disable the command.
return static The current instance.
Example #1
0
 public function testDisableIf()
 {
     $this->config->disableIf(true);
     $this->assertFalse($this->config->isEnabled());
     $this->config->disableIf(false);
     $this->assertTrue($this->config->isEnabled());
 }