Beispiel #1
0
 /**
  * Enables or disables Kint, can globally enforce the rendering mode. If called without parameters, returns the
  * current mode.
  *
  * @param mixed $forceMode
  *      null or void - return current mode
  *      false        - disable (no output)
  *      true         - enable and detect cli automatically
  *      Kint::MODE_* - enable and force selected mode disregarding detection and function
  *                     shorthand (s()/d()), note that you can still override this
  *                     with the "~" modifier
  *
  * @return mixed        previously set value if a new one is passed
  */
 public static function enabled($forceMode = null)
 {
     # act both as a setter...
     if (isset($forceMode)) {
         $before = self::$_enabledMode;
         self::$_enabledMode = $forceMode;
         return $before;
     }
     # ...and a getter
     return self::$_enabledMode;
 }