Skip to content

Commit

Permalink
fix phpstan ignore errors (afup#1382)
Browse files Browse the repository at this point in the history
* fix phpstan ignore errors

* fix phpstan ignore errors code review
  • Loading branch information
stakovicz authored Dec 10, 2023
1 parent 3a0dc7d commit d1d9ac2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 13 deletions.
1 change: 1 addition & 0 deletions configs/application/config-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@
$configuration['sympa']['directory']='http://127.0.0.1/sympa.php';
$configuration['sympa']['config_url']='http://127.0.0.1/sympa.php';
$configuration['sympa']['host'] = 'old.afup.org';
return $configuration;
1 change: 1 addition & 0 deletions configs/application/config.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ $configuration['sympa']['mot_de_passe']='sympa';
$configuration['sympa']['directory']='http://127.0.0.1/sympa.php';
$configuration['sympa']['config_url']='http://127.0.0.1/sympa.php';
$configuration['sympa']['host'] = 'old.afup.org';
return $configuration;
1 change: 1 addition & 0 deletions configs/application/config.php.dist-docker
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ $configuration['sympa']['mot_de_passe']='sympa';
$configuration['sympa']['directory']='http://127.0.0.1/sympa.php';
$configuration['sympa']['config_url']='http://127.0.0.1/sympa.php';
$configuration['sympa']['host'] = 'old.afup.org';
return $configuration;
9 changes: 0 additions & 9 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,3 @@ parameters:
- sources/AppBundle/Twig/TwigExtension.php
# Ce fichier est impossible à analyser, des variables globales, du eval, etc.
- sources/Afup/Utils/Configuration.php
ignoreErrors:
# Variable globale
-
message: '#Undefined variable: \$configuration#'
path: sources/Afup/Utils/SymfonyKernel.php
# Variable globale
-
message: '#Undefined variable: \$smarty#'
path: sources/AppBundle/Controller/LegacyController.php
2 changes: 1 addition & 1 deletion sources/Afup/Utils/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ function enregistrer()
foreach ($valeurs as $valeur) {
$contenu .= '$configuration' . $valeur . "\n";
}
$contenu .= '?>';
$contenu .= 'return $configuration;';

if (!is_writable($this->_chemin_fichier)) {
return false;
Expand Down
4 changes: 1 addition & 3 deletions sources/Afup/Utils/SymfonyKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public function __construct(Request $request = null)
private function getLegacyConfig()
{
// $configuration comes from this file
include(__DIR__ . '/../../../configs/application/config.php');

return $configuration;
return include(__DIR__ . '/../../../configs/application/config.php');
}

/**
Expand Down

0 comments on commit d1d9ac2

Please sign in to comment.