Nette\Utils\ObjectMixin::strictStaticCall PHP Method

strictStaticCall() public static method

public static strictStaticCall ( $class, $method )
    public static function strictStaticCall($class, $method)
    {
        $hint = self::getSuggestion(array_filter((new \ReflectionClass($class))->getMethods(\ReflectionMethod::IS_PUBLIC), function ($m) {
            return $m->isStatic();
        }), $method);
        throw new MemberAccessException("Call to undefined static method {$class}::{$method}()" . ($hint ? ", did you mean {$hint}()?" : '.'));
    }

Usage Example

Example #1
0
 /**
  * @return void
  * @throws MemberAccessException
  */
 public static function __callStatic($name, $args)
 {
     ObjectMixin::strictStaticCall(get_called_class(), $name);
 }