@param mixed $plugin Plugin Entity, ShortName (ClarolineCoreBundle) Fqcn (Claroline\CoreBundle\ClarolineCoreBundle)

@return array
504360
public function getRequirements($plugin)
    {
        $bundle = $this->getBundle($plugin);

        return [
            'extensions' => $bundle->getRequiredExtensions(),
            'plugins' => $bundle->getRequiredPlugins(),
            'extras' => array_map(function ($require) {
                return $require['failure_msg'];
            }, $bundle->getExtraRequirements()),
        ];
    }
232808
public function getEntity($fqcn)
    {
        $class = trim($fqcn, '.');

        if ( ! isset($this->entities[$class])) {
            throw new \LogicException("Unable to find class : $class");
        }

        return $this->entities[$class];
    }
1325235
public function getPlugins()
    {
        if ($this->noRequire) {
            return [];
        }
        $res = [
            'hiqdev/hidev-php' => 'dev-master',
        ];
        if ($this->vendorRequire) {
            $res[$this->vendorRequire] = 'dev-master';
        }

        return $res;
    }
1102010
public function getPluginOption($plugin, $option = null)
    {
        $option = $option ? '.'.$option : '';

        return $this->config->get('plugins.config.'.$plugin.$option);
    }
403490
protected static function getLocationProviders(Plugin $plugin)
    {
        $locationProviders = $plugin->findMultipleComponents('LocationProvider', 'Piwik\\Plugins\\UserCountry\\LocationProvider');
        $instances  = [];

        foreach ($locationProviders as $locationProvider) {
            $instances[] = new $locationProvider();
        }

        return $instances;
    }
127313
protected static function _checkData($plugin)
    {
        return (Arr::in($plugin, self::$_data)) ? self::$_data[$plugin] : [];
    }
806914
public function getPluginNames() {
    $definitions = $this->getDefinitions();
    $plugin_names = [];

    foreach ($definitions as $definition) {
      $name = $definition['name']->getUntranslatedString();
      $plugin_names[$definition['id']] = $name;
    }

    return $plugin_names;
  }
718102
protected static function getMethods($plugin)
    {
        //Sets the class name
        $class = App::classname($plugin . '.Sitemap', 'Utility');

        //Gets all methods from the `Sitemap` class of the plugin
        $methods = get_child_methods($class);

        if (empty($methods)) {
            return [];
        }

        return collection($methods)->map(function ($method) use ($class) {
            return array_merge(compact('class'), ['name' => $method]);
        })->toList();
    }
696538
public function validatePlugin($plugin)
    {
        try {
            $this->validate($plugin);
        } catch (InvalidServiceException $e) {
            throw new RuntimeException($e->getMessage(), $e->getCode(), $e);
        }
    }
977333
public function getDependencies($plugin)
    {
        if (is_string($plugin) && (!$plugin = $this->findByIdentifier($plugin))) {
            return false;
        }

        if (!isset($plugin->require) || !$plugin->require) {
            return null;
        }

        return is_array($plugin->require) ? $plugin->require : [$plugin->require];
    }
115275
function buildConfig(Plugin $plugin)
  {
    if (!empty($this->fields)) {
      $this->config['fields'] = [];
      foreach($this->fields as $field) {
        $this->config['fields'][] = $field->buildConfig($plugin);
      }
    }

    if (!is_null($this->id)) {
      $this->config['id'] = $this->id;
    }

    return $this->config;
  }
816709
public function orderPluginWrappersByContainerName($pluginWrappers)
    {
        $wrappersSortedByPageContainer = [];

        /** @var \Rcm\Entity\PluginWrapper $wrapper */
        foreach ($pluginWrappers as $wrapper) {
            $containerName = $wrapper->getLayoutContainer();

            $wrappersSortedByPageContainer[$containerName][] = $wrapper;
        }

        foreach ($wrappersSortedByPageContainer as $containerName => $wrapperContainer) {
            $wrappersSortedByPageContainer[$containerName]
                = $this->orderPluginWrappersByRow($wrapperContainer);
        }

        ksort($wrappersSortedByPageContainer);

        return $wrappersSortedByPageContainer;
    }
512276
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);
    }
821607
public static function getDirControllers(string $path, string $plugin = null, bool $fqcn = true): array
    {
        $result = [];

        try {
            static::validatePath($path);
            $dir = new DirectoryIterator($path);
        } catch (InvalidArgumentException $e) {
            return $result;
        } catch (UnexpectedValueException $e) {
            return $result;
        }

        foreach ($dir as $fileinfo) {
            // skip directories
            if (!$fileinfo->isFile()) {
                continue;
            }

            $className = $fileinfo->getBasename('.php');

            // skip AppController
            if ('AppController' === $className) {
                continue;
            }

            if (!empty($plugin)) {
                $className = $plugin . '.' . $className;
            }

            if ($fqcn) {
                $className = App::className($className, 'Controller');
            }

            if ($className) {
                $result[] = $className;
            }
        }

        return $result;
    }
937810
public static function var_names_from_context($classname, $pluginname = '') {
        $pluginname = trim($pluginname);
        if (!empty($pluginname)) {
            $categoryvar = $classname . '_' . $pluginname . '_category';
            $purposevar = $classname . '_' . $pluginname . '_purpose';
        } else {
            $categoryvar = $classname . '_category';
            $purposevar = $classname . '_purpose';
        }
        return [
            $purposevar,
            $categoryvar
        ];
    }
734325
protected function getPluginOptions()
    {
        $this->pluginOptions['type'] = ArrayHelper::getValue($this->pluginOptions, 'type', $this->type);

        return Json::encode($this->pluginOptions);
    }
251279
protected function getMenuMethods($plugin)
    {
        //Gets all methods from `$PLUGIN\View\Helper\MenuHelper`
        $methods = get_child_methods(sprintf('\%s\View\Helper\MenuHelper', $plugin));

        //Filters invalid name methods and returns
        return $methods ? array_values(preg_grep('/^(?!_).+$/', $methods)) : [];
    }