Kahlan\Jit\Patcher\Monkey::blacklisted PHP Method

blacklisted() public static method

Check if a function is part of the blacklisted ones.
public static blacklisted ( string $name = null ) : boolean
$name string A function name.
return boolean
    public static function blacklisted($name = null)
    {
        if (!func_num_args()) {
            return array_keys(static::$_blacklist);
        }
        return isset(static::$_blacklist[strtolower($name)]);
    }

Usage Example

Beispiel #1
0
 /**
  * Setup a monkey patch.
  *
  * @param string $source A fully namespaced reference string.
  * @param string $dest   A fully namespaced reference string.
  */
 public static function patch($source, $dest = null)
 {
     $source = ltrim($source, '\\');
     if (is_object($source) || class_exists($source)) {
         $reference = $source;
     } else {
         $reference = null;
         if (MonkeyPatcher::blacklisted($source)) {
             throw new Exception("Monkey patching `{$source}()` is not supported by Kahlan.");
         }
     }
     $method = static::$_registered[$source] = new Method(compact('reference'));
     if (!$dest) {
         return $method;
     }
     $method->toBe($dest);
     return $method;
 }
All Usage Examples Of Kahlan\Jit\Patcher\Monkey::blacklisted