src/console/BowerPackageController.php
public function actionFetchTop($count = 1000, $skipCache = false)
    {
        $result = [];
        $components = $this->getComponents($skipCache);
        ArrayHelper::multisort($components, 'stars', SORT_DESC, SORT_NUMERIC);

        foreach (array_slice($components, 0, $count) as $component) {
            $result[] = 'bower-asset/' . $component['name'];
            echo Console::renderColoredString("%R{$component['stars']}%N - %g{$component['name']}%N");
            Console::moveCursorTo(0);
            Console::clearLine();
        }

        $componentsListPath = Yii::getAlias('@hiqdev/assetpackagist/config/bower.list');
        file_put_contents($componentsListPath, implode("\n", $result));

        echo Console::renderColoredString('Fetched %YBower%N components list. Found %G' . count($components) . "%N components.\n");
        echo Console::renderColoredString('Only %bTOP-' . $count . "%N components were added to the packages list.\n");
        echo Console::renderColoredString('See %G' . $componentsListPath . "%N\n");
    }
public function actionFetchTop($count = 1000, $skipCache = false)
    {
        $result = [];
        $components = $this->getComponents($skipCache);
        ArrayHelper::multisort($components, 'stars', SORT_DESC, SORT_NUMERIC);

        foreach (array_slice($components, 0, $count) as $component) {
            $result[] = 'bower-asset/' . $component['name'];
            echo Console::renderColoredString("%R{$component['stars']}%N - %g{$component['name']}%N");
            Console::moveCursorTo(0);
            Console::clearLine();
        }

        $componentsListPath = Yii::getAlias('@hiqdev/assetpackagist/config/bower.list');
        file_put_contents($componentsListPath, implode("\n", $result));

        echo Console::renderColoredString('Fetched %YBower%N components list. Found %G' . count($components) . "%N components.\n");
        echo Console::renderColoredString('Only %bTOP-' . $count . "%N components were added to the packages list.\n");
        echo Console::renderColoredString('See %G' . $componentsListPath . "%N\n");
    }
Fetches TOP-$count components from Bower ans saves to `config/bower.list`.

@param int $count
@param bool $skipCache