LdapTools\Object\LdapObject::__call PHP Method

__call() public method

Determines which function, if any, should be called.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
return mixed
    public function __call($method, $arguments)
    {
        if (!preg_match('/^(' . implode('|', $this->functions) . ')(.*)$/', $method, $matches)) {
            throw new \RuntimeException(sprintf('The method "%s" is unknown.', $method));
        }
        $method = $matches[1];
        $attribute = lcfirst($matches[2]);
        if ('get' == $method || 'reset' == $method) {
            return $this->{$method}($attribute);
        } else {
            return $this->{$method}($attribute, ...$arguments);
        }
    }