original_string: public static function defineCheck(string $method, callable $function)
      {
          if (function_exists($method)) {
              throw new \InvalidArgumentException('Can not overwrite internal PHP function ' . $method . '().');
          }
  
          self::$checks[$method] = $function;
      }
code: public static function defineCheck(string $method, callable $function)
      {
          if (function_exists($method)) {
              throw new \InvalidArgumentException('Can not overwrite internal PHP function ' . $method . '().');
          }
  
          self::$checks[$method] = $function;
      }
code_tokens: public static function defineCheck ( string $ method , callable $ function ) { if ( function_exists ( $ method ) ) { throw new \ InvalidArgumentException ( 'Can not overwrite internal PHP function ' . $ method . '().' ) ; } self :: $ checks [ $ method ] = $ function ; }
docstring: adds a check method
  
  The $method must be an allowed method name which can be called on an
  instance of stubbles\values\Value. The given callable function must
  accept the value to check as first parameter and any additional
  parameters after that. It must either return true or false.
  
  <code>
  Value::addCheck('isHttpUri', [stubbles\peer\http\HttpUri::class, 'isValid']);
  
  if (value('http://example.net')->isHttpUri()) {
  // yes, do something with it
  }
  </code>
  
  Self-defined checks can be overwritten by passing another callable with
  the same method name. PHP internal functions like is_int() must not be
  defined as check, they are available by default. Please note that it is
  not allowed to overwrite existing functions, e.g. you can not redefine
  is_int().
  
  @param   string    $method
  @param   callable  $function
  @throws  \InvalidArgumentException
docstring_tokens: adds a check method