whiteCube/lingua

View on GitHub
src/Lingua/LanguagesRepository.php

Summary

Maintainability
A
1 hr
Test Coverage

Showing 3 of 3 total issues

Function find has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

public static function find($format, $value)
{
$instance = self::getInstance();
foreach ($instance->languages as $language) {
if(!isset($language[$format])) continue;
Severity: Minor
Found in src/Lingua/LanguagesRepository.php - About 1 hr to fix

Remove error control operator '@' on line 59.
Open

protected function loadRepository()
{
if(false === @file_get_contents($this->path)) {
throw new \Exception('Lingua\'s languages repository could not be loaded');
}
Severity: Minor
Found in src/Lingua/LanguagesRepository.php by phpmd

Missing class import via use statement (line '60', column '23').
Open

throw new \Exception('Lingua\'s languages repository could not be loaded');
Severity: Minor
Found in src/Lingua/LanguagesRepository.php by phpmd

There are no issues that match your filters.

Category
Status