DebugKit\Routing\Filter\DebugBarFilter::isEnabled PHP Method

isEnabled() public method

Check whether or not debug kit is enabled.
public isEnabled ( ) : boolean
return boolean
    public function isEnabled()
    {
        $enabled = (bool) Configure::read('debug');
        if ($enabled) {
            return true;
        }
        $force = $this->config('forceEnable');
        if (is_callable($force)) {
            return $force();
        }
        return $force;
    }

Usage Example

 /**
  * test isEnabled responds to forceEnable callable.
  *
  * @return void
  */
 public function testIsEnabledForceEnableCallable()
 {
     Configure::write('debug', false);
     $bar = new DebugBarFilter($this->events, ['forceEnable' => function () {
         return true;
     }]);
     $this->assertTrue($bar->isEnabled(), 'debug is off, panel is forced on');
 }
All Usage Examples Of DebugKit\Routing\Filter\DebugBarFilter::isEnabled