src/I18n/GettextMessageSource.php
protected function findAllCategories()
    {
        if (isset($this->_categories)) {
            return resolve($this->_categories);
        }
        $languages = Reaction::$app->getI18n()->languages;
        $messageFiles = [];
        foreach ($languages as $language) {
            $messageFiles[] = $this->getMessageFilePath($language);
        }

        //Use resolve()->then() to convert PromiseInterface to ExtendedPromiseInterface
        return resolve(true)
            ->then(function() use ($messageFiles) {
                $categories = [];
                foreach ($messageFiles as $messageFile) {
                    $gettext = $this->getGettextFile($messageFile);
                    $categories = Reaction\Helpers\ArrayHelper::merge($categories, $gettext->getCategories());
                }
                $this->_categories = array_unique($categories);
                sort($this->_categories);
                return $this->_categories;
            });
    }
protected function findAllCategories()
    {
        if (isset($this->_categories)) {
            return resolve($this->_categories);
        }
        $languages = Reaction::$app->getI18n()->languages;
        $messageFiles = [];
        foreach ($languages as $language) {
            $messageFiles[] = $this->getMessageFilePath($language);
        }

        //Use resolve()->then() to convert PromiseInterface to ExtendedPromiseInterface
        return resolve(true)
            ->then(function() use ($messageFiles) {
                $categories = [];
                foreach ($messageFiles as $messageFile) {
                    $gettext = $this->getGettextFile($messageFile);
                    $categories = Reaction\Helpers\ArrayHelper::merge($categories, $gettext->getCategories());
                }
                $this->_categories = array_unique($categories);
                sort($this->_categories);
                return $this->_categories;
            });
    }
Find all categories used in message source
@return ExtendedPromiseInterface