Skip to content

Commit

Permalink
ignore phpstan function not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu-rolland committed Aug 31, 2022
1 parent 401323b commit d60e1b9
Show file tree
Hide file tree
Showing 12 changed files with 2 additions and 26 deletions.
15 changes: 0 additions & 15 deletions classes/UpgradeTools/ModuleAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,6 @@ public function getCommandBus()
return $this->commandBus;
}

/**
* Available since PrestaShop 8.0
*/
public function getModuleRepository()
{
if (null === $this->moduleRepository) {
$this->moduleRepository = $this->symfonyAdapter
->initAppKernel()
->getContainer()
->get('prestashop.adapter.module.repository.module_repository');
}

return $this->moduleRepository;
}

/**
* Upgrade action, disabling all modules not made by PrestaShop.
*
Expand Down
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.6.1.18.neon
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ parameters:
- '#Call to method assign\(\) on an unknown class Smarty.#'
- '#Call to method fetch\(\) on an unknown class Smarty.#'
- '#Call to method getContainer\(\) on an unknown class AppKernel.#'
- '#Function deactivate_custom_modules not found.#'
- '#PrestaShop\\PrestaShop\\Adapter\\Module\\ModuleDataUpdater#'
- '#Property ModuleCore::\$version \(float\) does not accept string.#'
- '#Return typehint of method PrestaShop\\Module\\AutoUpgrade\\UpgradeTools\\ModuleAdapter::getCommandBus\(\) has invalid type PrestaShop\\PrestaShop\\Core\\CommandBus\\TacticianCommandBusAdapter.#'
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.7.2.5.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ parameters:
- '#Call to method loadClassCache\(\) on an unknown class AppKernel.#'
- '#Caught class PrestaShop\\PrestaShop\\Core\\Exception\\CoreException not found.#'
- '#Class AppKernel not found.#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class AppKernel not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Domain\\Theme\\ValueObject\\ThemeName not found.#'
- '#PHPDoc tag @var for variable \$commandBus contains unknown class PrestaShop\\PrestaShop\\Core\\CommandBus\\CommandBusInterface.#'
Expand Down
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.7.3.4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ parameters:
- '#Call to method loadClassCache\(\) on an unknown class AppKernel.#'
- '#Caught class PrestaShop\\PrestaShop\\Core\\Exception\\CoreException not found.#'
- '#Class AppKernel not found.#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class AppKernel not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Domain\\Theme\\ValueObject\\ThemeName not found.#'
- '#PHPDoc tag @var for variable \$commandBus contains unknown class PrestaShop\\PrestaShop\\Core\\CommandBus\\CommandBusInterface.#'
Expand Down
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.7.4.4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ parameters:
- '#Call to method getMessage\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Exception\\CoreException.#'
- '#Call to method handle\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\CommandBus\\CommandBusInterface.#'
- '#Caught class PrestaShop\\PrestaShop\\Core\\Exception\\CoreException not found.#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Domain\\Theme\\ValueObject\\ThemeName not found.#'
- '#PHPDoc tag @var for variable \$commandBus contains unknown class PrestaShop\\PrestaShop\\Core\\CommandBus\\CommandBusInterface.#'
- '#Property ModuleCore::\$version \(float\) does not accept string.#'
Expand Down
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.7.5.1.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ parameters:
- '#Access to an undefined property Autoupgrade::\$bootstrap.#'
- '#Access to an undefined property Module::\$installed.#'
- '#Call to an undefined static method ConfigurationTest::test_memory_limit\(\).#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Domain\\Theme\\ValueObject\\ThemeName not found.#'
- '#Property ModuleCore::\$version \(float\) does not accept string.#'
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.7.6.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ parameters:
- '#Access to an undefined property Module::\$installed.#'
- '#Call to an undefined static method ConfigurationTest::test_memory_limit\(\).#'
- '#Call to method fetchLocale\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Cldr\\Update.#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Cldr\\Update not found.#'
- '#Parameter \#1 \$id_hook of method ModuleCore::updatePosition\(\) expects bool, int given.#'
- '#Property ModuleCore::\$version \(float\) does not accept string.#'
Expand Down
2 changes: 0 additions & 2 deletions tests/phpstan/phpstan-1.7.7.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ parameters:
ignoreErrors:
- '#Access to an undefined property Module::\$installed.#'
- '#Call to method fetchLocale\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Cldr\\Update.#'
- '#Function deactivate_custom_modules not found.#'
- '#Function deactivate_custom_modules80 not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Cldr\\Update not found.#'
1 change: 0 additions & 1 deletion tests/phpstan/phpstan-1.7.8.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ parameters:
ignoreErrors:
- '#Access to an undefined property Module::\$installed.#'
- '#Call to method fetchLocale\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Cldr\\Update.#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Cldr\\Update not found.#'

1 change: 0 additions & 1 deletion tests/phpstan/phpstan-latest.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ parameters:
ignoreErrors:
- '#Access to an undefined property Module::\$installed.#'
- '#Call to method fetchLocale\(\) on an unknown class PrestaShop\\PrestaShop\\Core\\Cldr\\Update.#'
- '#Function deactivate_custom_modules not found.#'
- '#Instantiated class PrestaShop\\PrestaShop\\Core\\Cldr\\Update not found.#'
1 change: 1 addition & 0 deletions tests/phpstan/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
paths:
# From PHPStan 0.12, paths to check are relative to the neon file
- ./../../classes
- ./../../upgrade/php/deactivate_custom_modules.php
- ./../../AdminSelfUpgrade.php
- ./../../ajax-upgradetab.php
- ./../../ajax-upgradetabconfig.php
Expand Down
2 changes: 1 addition & 1 deletion upgrade/php/deactivate_custom_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function deactivate_custom_modules()
$nativeModules = $nativeModules->modules;
}
$arrNativeModules = [];
if (is_array($nativeModules)) {
if (!empty($nativeModules)) {
foreach ($nativeModules as $nativeModulesType) {
if (in_array($nativeModulesType['type'], ['native', 'partner'])) {
$arrNativeModules[] = '""';
Expand Down

0 comments on commit d60e1b9

Please sign in to comment.