Skip to content

Commit c742a9d

Browse files
committed
Use safe define
1 parent 015ad82 commit c742a9d

File tree

4 files changed

+6
-24
lines changed

4 files changed

+6
-24
lines changed

.phpstan-baseline.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,12 +3721,6 @@
37213721
'count' => 1,
37223722
'path' => __DIR__ . '/src/Glpi/Api/HL/Search.php',
37233723
];
3724-
$ignoreErrors[] = [
3725-
'message' => '#^Function define is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\define;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
3726-
'identifier' => 'theCodingMachineSafe.function',
3727-
'count' => 1,
3728-
'path' => __DIR__ . '/src/Glpi/Application/Environment.php',
3729-
];
37303724
$ignoreErrors[] = [
37313725
'message' => '#^Function preg_replace is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\preg_replace;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
37323726
'identifier' => 'theCodingMachineSafe.function',
@@ -3769,12 +3763,6 @@
37693763
'count' => 2,
37703764
'path' => __DIR__ . '/src/Glpi/Application/ResourcesChecker.php',
37713765
];
3772-
$ignoreErrors[] = [
3773-
'message' => '#^Function define is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\define;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
3774-
'identifier' => 'theCodingMachineSafe.function',
3775-
'count' => 3,
3776-
'path' => __DIR__ . '/src/Glpi/Application/SystemConfigurator.php',
3777-
];
37783766
$ignoreErrors[] = [
37793767
'message' => '#^Function ini_set is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\ini_set;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
37803768
'identifier' => 'theCodingMachineSafe.function',
@@ -5701,12 +5689,6 @@
57015689
'count' => 1,
57025690
'path' => __DIR__ . '/src/Glpi/Kernel/Kernel.php',
57035691
];
5704-
$ignoreErrors[] = [
5705-
'message' => '#^Function define is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\define;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
5706-
'identifier' => 'theCodingMachineSafe.function',
5707-
'count' => 1,
5708-
'path' => __DIR__ . '/src/Glpi/Kernel/Listener/ControllerListener/CheckCsrfListener.php',
5709-
];
57105692
$ignoreErrors[] = [
57115693
'message' => '#^Function ini_set is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\ini_set;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
57125694
'identifier' => 'theCodingMachineSafe.function',
@@ -10465,12 +10447,6 @@
1046510447
'count' => 1,
1046610448
'path' => __DIR__ . '/src/XHProf.php',
1046710449
];
10468-
$ignoreErrors[] = [
10469-
'message' => '#^Function define is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\define;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
10470-
'identifier' => 'theCodingMachineSafe.function',
10471-
'count' => 46,
10472-
'path' => __DIR__ . '/src/autoload/constants.php',
10473-
];
1047410450
$ignoreErrors[] = [
1047510451
'message' => '#^Function preg_replace is unsafe to use\\. It can return FALSE instead of throwing an exception\\. Please add \'use function Safe\\\\preg_replace;\' at the beginning of the file to use the variant provided by the \'thecodingmachine/safe\' library\\.$#',
1047610452
'identifier' => 'theCodingMachineSafe.function',

src/Glpi/Application/Environment.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
use Psr\Log\LogLevel;
3838
use UnexpectedValueException;
3939

40+
use function Safe\define;
41+
4042
enum Environment: string
4143
{
4244
/**

src/Glpi/Application/SystemConfigurator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
use Psr\Log\LoggerInterface;
4242
use Psr\Log\LogLevel;
4343

44+
use function Safe\define;
45+
4446
final class SystemConfigurator
4547
{
4648
private LoggerInterface $logger;

src/autoload/constants.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
* ---------------------------------------------------------------------
3434
*/
3535

36+
use function Safe\define;
37+
3638
define('GLPI_ROOT', dirname(__DIR__, 2));
3739

3840
// Current version of GLPI

0 commit comments

Comments
 (0)