Register multiple view composers via an array.

@param  array  $composers
@return array
354130
public function composers(array $composers)
    {
        $registered = [];

        foreach ($composers as $callback => $views) {
            $registered = array_merge($registered, $this->composer($views, $callback));
        }

        return $registered;
    }
1338969
public function registerListeners(array $listeners)
    {
        foreach ($listeners as $event => $listener) {
            $this->events[$event][] = $listener;
        }
    }
748291
protected function getGenericViews(array $views)
    {
        $genericViews = array();

        foreach ($views as $view) {
            $genericViews[] = $this->getGenericView($view);
        }

        return $genericViews;
    }
849434
public function getAllCustomers(array $filters = null)
    {

        // this doesn't work yet
        throw new CheddarGetter_Client_Exception("This method is a stub for future functionality.  You're probable looking for CheddarGetter_Client::getCustomers()", CheddarGetter_Client_Exception::USAGE_INVALID);

        if ($this->getProductCode()) {
            throw new CheddarGetter_Client_Exception("Can't use a productCode when requesting getAllCustomers()", CheddarGetter_Client_Exception::USAGE_INVALID);
        }
        return new CheddarGetter_Response($this->request('/customers/get-all', $filters));
    }
403842
private function guessComposerCommand()
    {
        $candidateNames = array('composer', 'composer.phar');

        $executableFinder = new ExecutableFinder();
        foreach ($candidateNames as $candidateName) {
            if ($composerPath = $executableFinder->find($candidateName, null, array(getcwd()))) {
                return array(realpath($composerPath));
            }
        }

        foreach ($candidateNames as $candidateName) {
            $composerPath = sprintf('%s/%s', getcwd(), $candidateName);
            if (file_exists($composerPath)) {
                $phpFinder = new PhpExecutableFinder();

                return array_merge(
                    array(
                        $phpFinder->find(false),
                        $composerPath,
                    ),
                    $phpFinder->findArguments()
                );
            }
        }

        return;
    }
963734
private function beautifyAuthorList($authors)
    {
        if ($authors === null) {
            return null;
        }

        $authors = \array_intersect_key($authors, \array_unique(\array_map('strtolower', $authors)));
        \usort($authors, 'strcasecmp');

        $mapped = [];
        foreach ($authors as $author) {
            $mapped[\strtolower($author)] = $author;
        }

        return $mapped;
    }
1111572
private function buildSharingEntries(array $subjects)
    {
        $entries = [];

        if (!empty($subjects)) {
            $res = $this->provider->getSharingEntries(array_values($subjects));

            foreach ($res as $sharing) {
                $id = SharingUtils::getSharingCacheId($sharing);
                $entries[$id][] = $sharing;
            }
        }

        return $entries;
    }
806455
public function registerMap(array $maps)
    {
        foreach ($maps as $prefix => $library) {
            $endChar = substr($prefix, -1);
            if ($endChar == '_') {
                Loaders\Pear::getInstance()->registerMap($prefix, $library);
            } else {
                if (is_array($library)) {
                    if (isset($library['Psr']) && $library['Psr'] == '0') {
                        Loaders\Psr0::getInstance()->registerMap($prefix, $library);
                        continue;
                    }
                }

                Loaders\Psr4::getInstance()->registerMap($prefix, $library);
            }
        }
    }
546205
public static function view_entries($filters = array()) {

        $warnings = array();
        $params = self::validate_parameters(self::view_entries_parameters(), array('filters' => $filters));

        list($context, $filters, $courseid, $userid) = self::validate_access_and_filters($params['filters']);

        $eventparams = array(
            'other' => array('entryid' => $filters['entryid'], 'tagid' => $filters['tagid'], 'userid' => $userid,
                'modid' => $filters['cmid'], 'groupid' => $filters['groupid'], 'search' => $filters['search']
            )
        );
        if (!empty($userid)) {
            $eventparams['relateduserid'] = $userid;
        }
        $eventparams['other']['courseid'] = ($courseid === SITEID) ? 0 : $courseid;
        $event = \core\event\blog_entries_viewed::create($eventparams);
        $event->trigger();

        return array(
            'warnings' => $warnings,
            'status' => true,
        );
    }
1047816
public function setComposerSettings(array $composerSettings = [])
    {
        /**
         * If array is type array("config.value:true","require:library/src",)
         */
        $settings = [];
        foreach ($composerSettings as $index => $value) {
            if (is_numeric($index) && mb_strpos($value, ':') > 0) {
                $path = implode('', array_slice(explode(':', $value), 0, 1));
                $val = implode(':', array_slice(explode(':', $value), 1));
                self::dotNotationToArray($path, $val, $settings);
            } else {
                $settings[$index] = $value;
            }
        }
        return $this->setOptionValue(self::COMPOSER_SETTINGS, $settings);
    }
500840
private function groupRegistrationsByStage(array $registrations)
    {
        $stages = [];
        foreach ($registrations as $registration) {
            /** @var PipelineStepInterface $stepClass */
            $stepClass = $registration->getStepFqcn();
            $stageName = $stepClass::getStageContextClass();

            if (!isset($stages[$stageName])) {
                $stages[$stageName] = [];
            }

            $stages[$stageName][] = $registration;
        }

        return $stages;
    }
183175
private function getOrgAndRepo(array $composer)
    {
        $target = $composer['target'];

        $matches = [];
        preg_match(self::TARGET_REGEX, $target, $matches);

        $org = $matches[1];
        $repo = $matches[2];

        return [$org, $repo];
    }
257364
public function getNotes(array $filters): array
    {
        @trigger_error(sprintf('The %s() method is deprecated since version 0.8. Use NoteActivityApi::list() instead.', __METHOD__), E_USER_DEPRECATED);

        /** @var NoteActivityApi $apiHandler */
        $apiHandler = $this->closeIoApiWrapper->getNoteActivitiesApi();

        return $apiHandler->list(0, self::MAX_ITEMS_PER_REQUEST, $filters);
    }
102192
public function registerViewComposerData()
    {
        View::composer('avored-ecommerce::layouts.left-nav', AdminNavComposer::class);
        View::composer('avored-ecommerce::site-currency._fields', SiteCurrencyFieldsComposer::class);
        View::composer(['avored-ecommerce::category._fields'], CategoryFieldsComposer::class);
        View::composer(['avored-ecommerce::admin-user._fields'], AdminUserFieldsComposer::class);
        View::composer(['avored-ecommerce::product.create',
                        'avored-ecommerce::product.edit',
                        ], ProductFieldsComposer::class);
    }
281858
public static function createFromComposerJson(array $composerJson)
    {
        $class = new self();
        $class->type = $composerJson['type'];
        $class->name = $composerJson['name'];
        $class->description = isset($composerJson['description']) ? $composerJson['description'] : '';
        $class->version = isset($composerJson['version']) ? $composerJson['version'] : 'local';
        $class->authors = isset($composerJson['authors']) ? $composerJson['authors'] : [];
        $class->keywords = isset($composerJson['keywords']) ? $composerJson['keywords'] : [];
        $class->constraint = isset($composerJson['require']['bolt/bolt']) ? $composerJson['require']['bolt/bolt'] : '0.0.0';

        return $class;
    }
638689
public function get(array $params = [])
    {
        $this->getLogger()->info('Getting list of Playlists');
        if (isset($params['embed']))
            $embed = ($params['embed'] != null) ? explode(',', $params['embed']) : [];

        $hydratedWidgets = [];
        $entries = [];

        $response = $this->doGet('/playlist', $params);
        foreach ($response as $item) {
            /** @var XiboPlaylist $playlist */
            $playlist = new XiboPlaylist($this->getEntityProvider());
            $playlist->hydrate($item);
            if (in_array('widgets', $embed) === true) {
                foreach ($playlist->widgets as $widget) {
                    /** @var XiboWidget $widgetObject */
                    $widgetObject = new XiboWidget($this->getEntityProvider());
                    $widgetObject->hydrate($widget);
                    $hydratedWidgets[] = $widgetObject;
                }
                $playlist->widgets = $hydratedWidgets;
            }
            $entries[] = clone $playlist;
        }

        return $entries;
    }
1149750
public static function add_themes($themes = [])
    {
        $currentThemes = SSViewer::get_themes();
        $finalThemes = array_merge($themes, $currentThemes);
        // array_values is used to ensure sequential array keys as array_unique can leave gaps
        static::set_themes(array_values(array_unique($finalThemes)));
    }