public function getTotalMetrics(
        Project $project,
        array $domains = [],
        array $languages = []
    ) : array {
        $metrics = [];
        $masterLanguage = $project->getMasterLanguage();
        $languages = empty($languages)
            ? $project->getAvailableLanguages()
            : $languages;

        $languages = array_intersect(
            $languages,
            $project->getAvailableLanguages()
        );
        unset($languages[$masterLanguage]);

        $masterKeys = $project->getKeys(
            $domains,
            [$masterLanguage]
        );
        $masterCount = count($masterKeys);
        $metrics[$masterLanguage] = $masterCount;

        foreach ($languages as $language) {
            $languageKeys = $project->getKeys($domains, [$language]);
            $existentLanguageTranslations = array_intersect(
                $languageKeys,
                $masterKeys
            );

            $metrics[$language] = count($existentLanguageTranslations);
        }
        arsort($metrics);

        return $metrics;
    }
public function getTotalMetrics(
        Project $project,
        array $domains = [],
        array $languages = []
    ) : array {
        $metrics = [];
        $masterLanguage = $project->getMasterLanguage();
        $languages = empty($languages)
            ? $project->getAvailableLanguages()
            : $languages;

        $languages = array_intersect(
            $languages,
            $project->getAvailableLanguages()
        );
        unset($languages[$masterLanguage]);

        $masterKeys = $project->getKeys(
            $domains,
            [$masterLanguage]
        );
        $masterCount = count($masterKeys);
        $metrics[$masterLanguage] = $masterCount;

        foreach ($languages as $language) {
            $languageKeys = $project->getKeys($domains, [$language]);
            $existentLanguageTranslations = array_intersect(
                $languageKeys,
                $masterKeys
            );

            $metrics[$language] = count($existentLanguageTranslations);
        }
        arsort($metrics);

        return $metrics;
    }
public function getTotalMetrics ( Project $ project , array $ domains = [ ] , array $ languages = [ ] ) : array { $ metrics = [ ] ; $ masterLanguage = $ project -> getMasterLanguage ( ) ; $ languages = empty ( $ languages ) ? $ project -> getAvailableLanguages ( ) : $ languages ; $ languages = array_intersect ( $ languages , $ project -> getAvailableLanguages ( ) ) ; unset ( $ languages [ $ masterLanguage ] ) ; $ masterKeys = $ project -> getKeys ( $ domains , [ $ masterLanguage ] ) ; $ masterCount = count ( $ masterKeys ) ; $ metrics [ $ masterLanguage ] = $ masterCount ; foreach ( $ languages as $ language ) { $ languageKeys = $ project -> getKeys ( $ domains , [ $ language ] ) ; $ existentLanguageTranslations = array_intersect ( $ languageKeys , $ masterKeys ) ; $ metrics [ $ language ] = count ( $ existentLanguageTranslations ) ; } arsort ( $ metrics ) ; return $ metrics ; }
Get total metrics given a Project.

The format is that one

[
'en' => 267,
'ca' => 120,
'es' => 12,
]

@param Project $project
@param array   $domains
@param array   $languages

@return array
Get total metrics given a Project .