Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix phpstan ignore errors #1382

Merged
merged 2 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading