Kahlan\Plugin\Double::_generateInterfaceMethods PHP Method

_generateInterfaceMethods() protected static method

Creates method definitions from an interface array.
protected static _generateInterfaceMethods ( array $interfaces, integer $mask = 255 ) : string
$interfaces array A array on interfaces.
$mask integer The method mask to filter.
return string The generated methods.
    protected static function _generateInterfaceMethods($interfaces, $mask = 255)
    {
        if (!$interfaces) {
            return [];
        }
        $result = [];
        foreach ((array) $interfaces as $interface) {
            if (!interface_exists($interface)) {
                throw new MissingImplementationException("Unexisting interface `{$interface}`");
            }
            $reflection = Inspector::inspect($interface);
            $methods = $reflection->getMethods($mask);
            foreach ($methods as $method) {
                $result[$method->getName()] = static::_generateMethod($method);
            }
        }
        return $result;
    }