public function resolveRequirements(Plugin $plugin, $moodleVersion)
    {
        $map = [
            'auth'       => new AuthRequirements($plugin, $moodleVersion),
            'block'      => new BlockRequirements($plugin, $moodleVersion),
            'filter'     => new FilterRequirements($plugin, $moodleVersion),
            'format'     => new FormatRequirements($plugin, $moodleVersion),
            'mod'        => new ModuleRequirements($plugin, $moodleVersion),
            'qtype'      => new QuestionRequirements($plugin, $moodleVersion),
            'repository' => new RepositoryRequirements($plugin, $moodleVersion),
            'theme'      => new ThemeRequirements($plugin, $moodleVersion),
        ];

        if (array_key_exists($plugin->type, $map)) {
            return $map[$plugin->type];
        }

        return new GenericRequirements($plugin, $moodleVersion);
    }
public function resolveRequirements(Plugin $plugin, $moodleVersion)
    {
        $map = [
            'auth'       => new AuthRequirements($plugin, $moodleVersion),
            'block'      => new BlockRequirements($plugin, $moodleVersion),
            'filter'     => new FilterRequirements($plugin, $moodleVersion),
            'format'     => new FormatRequirements($plugin, $moodleVersion),
            'mod'        => new ModuleRequirements($plugin, $moodleVersion),
            'qtype'      => new QuestionRequirements($plugin, $moodleVersion),
            'repository' => new RepositoryRequirements($plugin, $moodleVersion),
            'theme'      => new ThemeRequirements($plugin, $moodleVersion),
        ];

        if (array_key_exists($plugin->type, $map)) {
            return $map[$plugin->type];
        }

        return new GenericRequirements($plugin, $moodleVersion);
    }
public function resolveRequirements ( Plugin $ plugin , $ moodleVersion ) { $ map = [ 'auth' => new AuthRequirements ( $ plugin , $ moodleVersion ) , 'block' => new BlockRequirements ( $ plugin , $ moodleVersion ) , 'filter' => new FilterRequirements ( $ plugin , $ moodleVersion ) , 'format' => new FormatRequirements ( $ plugin , $ moodleVersion ) , 'mod' => new ModuleRequirements ( $ plugin , $ moodleVersion ) , 'qtype' => new QuestionRequirements ( $ plugin , $ moodleVersion ) , 'repository' => new RepositoryRequirements ( $ plugin , $ moodleVersion ) , 'theme' => new ThemeRequirements ( $ plugin , $ moodleVersion ) , ] ; if ( array_key_exists ( $ plugin -> type , $ map ) ) { return $ map [ $ plugin -> type ] ; } return new GenericRequirements ( $ plugin , $ moodleVersion ) ; }
Find the requirements for a given plugin type.

@param Plugin $plugin
@param int    $moodleVersion

@return AbstractRequirements
Find the requirements for a given plugin type .