@param $apps

@return Collection
501033
protected function convertGames($apps)
    {
        $convertedApps = new Collection();

        foreach ($apps as $app) {
            if (isset($app->data)) {
                $convertedApps->add(new AppContainer($app->data));
            }
        }

        return $convertedApps;
    }
128127
public function deployApps(array $apps, $guestSpaceId = null, $revert = false): array
    {
        $options = ['json' => compact('apps', 'revert')];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->post(KintoneApi::generateUrl('preview/app/deploy.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
195278
public function getPhpFiles(array $paths): FileCollection
    {
        $this->files = new FileCollection;
        foreach ($paths as $path) {
            $this->getPhpFilesFromPath($path);
        }

        return $this->files;
    }
440310
public function createCache(Application $app)
    {
        $cache = new Pimple;

        foreach ($app['ems.options'] as $name => $options) {
            $cache[$name] = $cache->share(
                function () use ($app, $cache, $options) {
                    $class = 'Doctrine\Common\Cache\\' . $options['caching_driver'];

                    switch ($options['caching_driver']) {
                        case 'ApcCache':
                        case 'ArrayCache':
                        case 'XcacheCache':
                            return new $class();
                        case 'MemcacheCache':
                            $cache = new $class();

                            if ((false === isset($app['memcache']))
                                    && (false === isset($options['memcache']))) {
                                throw new RuntimeException (
                                    'No Memcache client available as a service.'
                                );
                            }

                            $cache->setMemcache(
                                isset($options['memcache'])
                                    ? $options['memcache']
                                    : $app['memcache']
                            );

                            return $cache;
                        case 'MemcachedCache':
                            $cache = new $class();

                            if ((false === isset($app['memcached']))
                                    && (false === isset($options['memcached']))) {
                                throw new RuntimeException (
                                    'No Memcached client available as a service.'
                                );
                            }

                            $cache->setMemcached(
                                isset($options['memcached'])
                                    ? $options['memcached']
                                    : $app['memcached']
                            );

                            return $cache;
                        default:
                            throw new InvalidArgumentException (
                                "Unsupported cache class: $class"
                            );
                    }
                }
            );
        }

        return $cache;
    }
385736
public function addManagedCollections($collections)
    {
        if (!is_array($collections)) {
            $collections = array($collections);
        }
        $this->managedCollections = array_merge($this->managedCollections, $collections);

        return $this;
    }
436740
private function coreModules(): Collection
    {
        return Collection::make(self::CORE_MODULES)
            ->map(static function (string $class, string $name): ModuleInterface {
                $module = app($class);

                $module->setName($name);

                return $module;
            });
    }
1183959
public function exportAppServerList()
    {
        $activeServerCollection = [];

        $activeServers = $this->appServerService->loadActiveAppServerList();
        if (is_array($activeServers) && !empty($activeServers)) {
            foreach ($activeServers as $server) {
                $activeServerCollection[] = $this->convertToArray($server);
            }
        }

        return $activeServerCollection;
    }
868245
public function generateLinksApplications(array $applications)
    {
        $links = [];

        foreach ($applications as $application) {
            if ($this->codeApplication === $application->getCode()) {
                continue;
            }

            $links[] = [
                'href' => $application->getHref(),
                'title' => $application->getTitle(),
            ];
        }

        return $links;
    }
932278
public function getMany($keys)
    {
        if (!is_array($keys))
            $keys = func_get_args();

        $newArray = array();

        foreach($keys as $key) {
            if (isset($_SESSION[$key])) {
                $newArray[$key] = $_SESSION[$key];
            }
        }

        return $newArray;
    }
255452
public function createMany(array $records)
    {
        $instances = array();

        foreach ($records as $record) {
            $instances[] = $this->create($record);
        }

        return $instances;
    }
44112
public function merge($collections = [])
    {
        $collections = func_get_args();

        array_unshift($collections, $this);
        foreach ($collections as &$collection) {
            $collection = (array) $collection;
        }
        unset($collection);

        $merged = call_user_func_array('array_merge', $collections);

        $collections = clone $this;
        $collections->exchangeArray($merged);

        return $collections;
    }
991302
public function only($keys): CollectionInterface
    {
        $args = func_get_args();
        if (count($args) === 1) {
            $args = reset($args);
        }

        if ($args === null) {
            return $this;
        }

        return $this->wrap(function (Iterator $data) use ($args) {
            foreach ($data as $key => $datum) {
                if (in_array($key, $args, false)) {
                    yield $key => $datum;
                }
            }
        });
    }
382485
def get_apps
      apps          = @api_rate_limit.call.app.list.sort_by { |app| DateTime.parse(app["created_at"]) }.reverse
      @app_count    = apps.count
      @hatchet_apps = apps.select {|app| app["name"].match(@regex) }
    end
720678
public void setApps(java.util.Collection<App> apps) {
        if (apps == null) {
            this.apps = null;
            return;
        }

        this.apps = new java.util.ArrayList<App>(apps);
    }
1046552
public function getGroupByAppAndName($app, $name)
    {
        if (array_key_exists($app, $this->groups) && array_key_exists($name, $this->groups[$app])) {
            return $this->groups[$app][$name];
        }

        return false;
    }
563332
public function addCollection($title)
    {
        $collections = $this->getCollections();

        /** @var Collection $collection */
        $collection = $this->getExtensions()->createElement($this, 'app:collection');
        $collection->addTitle($title);

        $collections[] = $collection;
        $this->setCachedProperty('collections', $collections);

        return $collection;
    }
1043373
protected function getLazaretSession(Application $app)
    {
        $lazaretSession = new LazaretSession();

        $app['orm.em']->persist($lazaretSession);
        $app['orm.em']->flush();

        return $lazaretSession;
    }