Issues (32)

config/languages.php (2 issues)

Labels
Severity
1
<?php
2
3
$path = $container->getParameter('kernel.root_dir') . '/../translations/*.json';
4
$languages = [];
5
$dictionaries = [];
6
7
foreach (glob($path) as $file) {
8
    $languageId = substr(basename($file), 0, 2);
9
    $content = json_decode(file_get_contents($file), GLOB_BRACE);
0 ignored issues
show
GLOB_BRACE of type integer is incompatible with the type boolean expected by parameter $assoc of json_decode(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

9
    $content = json_decode(file_get_contents($file), /** @scrutinizer ignore-type */ GLOB_BRACE);
Loading history...
10
11
    $dictionaries += [$languageId => $content]; // ToDo : optimize by selecting only the language used
12
    array_push($languages, $languageId);
13
}
14
15
$container->setParameter('languages', $languages);
16
17
$container->setParameter('dictionaries', $dictionaries);
18
19
$ldapInstance = ldap_connect(env('LDAP_HOST'), env('LDAP_PORT'));
0 ignored issues
show
It seems like env('LDAP_PORT') can also be of type string and boolean; however, parameter $port of ldap_connect() does only seem to accept integer, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
$ldapInstance = ldap_connect(env('LDAP_HOST'), /** @scrutinizer ignore-type */ env('LDAP_PORT'));
Loading history...
20
ldap_set_option($ldapInstance, LDAP_OPT_PROTOCOL_VERSION, 3);
21
ldap_set_option($ldapInstance, LDAP_OPT_REFERRALS, 0);
22
$container->set('ldap', /** @scrutinizer ignore-type */ $ldapInstance);