From de336ecc2b0dcc3a87f3df26159db27787ad9a65 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Wed, 28 Feb 2018 12:59:28 +0100 Subject: [PATCH] [BUGFIX] Make the exception codes 32-bit safe --- CHANGELOG.md | 1 + src/Composer/ModuleFinder.php | 15 +++++++-------- src/Composer/ScriptHandler.php | 2 +- src/Core/ApplicationKernel.php | 2 +- src/Core/ApplicationStructure.php | 2 +- src/Core/Bootstrap.php | 2 +- src/Core/Environment.php | 2 +- src/Routing/ExtraLoader.php | 2 +- src/TestingSupport/Traits/SymfonyServerTrait.php | 8 ++++---- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c151385..03376473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). ### Removed ### Fixed +- Make the exception codes 32-bit safe (#287) - Remove associated subscriptions when a subscriber list or subscriber is removed (#271, #272) - Always truncate the DB tables after an integration test (#259) - Adapt the system tests to possible HTTP errors (#256) diff --git a/src/Composer/ModuleFinder.php b/src/Composer/ModuleFinder.php index 3e89f0fd..0cb7c069 100644 --- a/src/Composer/ModuleFinder.php +++ b/src/Composer/ModuleFinder.php @@ -81,7 +81,7 @@ private function validateBundlesSectionInExtra(array $extra) if (!is_array($extra['phplist/core']['bundles'])) { throw new \InvalidArgumentException( 'The extras.phplist/core.bundles section in the composer.json must be an array.', - 1505411665146 + 1505411665 ); } @@ -90,9 +90,8 @@ private function validateBundlesSectionInExtra(array $extra) foreach ($bundleExtras as $key => $bundleName) { if (!is_string($bundleName)) { throw new \InvalidArgumentException( - 'The extras.phplist/core.bundles. ' . $key . - '" section in the composer.json must be a string.', - 1505412184038 + 'The extras.phplist/core.bundles. ' . $key . '" section in the composer.json must be a string.', + 1505412184 ); } } @@ -112,7 +111,7 @@ private function validatePhpListSectionInExtra(array $extra) if (!is_array($extra['phplist/core'])) { throw new \InvalidArgumentException( 'The extras.phplist/core" section in the composer.json must be an array.', - 1505411436144 + 1505411436 ); } } @@ -183,7 +182,7 @@ private function validateRoutesSectionInExtra(array $extra) if (!is_array($extra['phplist/core']['routes'])) { throw new \InvalidArgumentException( 'The extras.phplist/core.routes section in the composer.json must be an array.', - 1506429004462 + 1506429004 ); } @@ -194,7 +193,7 @@ private function validateRoutesSectionInExtra(array $extra) throw new \InvalidArgumentException( 'The extras.phplist/core.routes. ' . $routeName . '" section in the composer.json must be an array.', - 1506429860740 + 1506429860 ); } } @@ -260,7 +259,7 @@ private function validateGeneralConfigurationSectionInExtra(array $extra) if (!is_array($extra['phplist/core']['configuration'])) { throw new \InvalidArgumentException( 'The extras.phplist/core.configuration section in the composer.json must be an array.', - 1508165934174 + 1508165934 ); } } diff --git a/src/Composer/ScriptHandler.php b/src/Composer/ScriptHandler.php index 06e076f0..ddcb22f5 100644 --- a/src/Composer/ScriptHandler.php +++ b/src/Composer/ScriptHandler.php @@ -113,7 +113,7 @@ private static function preventScriptFromCorePackage(Event $event) if ($packageName === static::CORE_PACKAGE_NAME) { throw new \DomainException( 'This Composer script must not be called for the core package itself.', - 1501240572934 + 1501240572 ); } } diff --git a/src/Core/ApplicationKernel.php b/src/Core/ApplicationKernel.php index 1562e00c..b662eb21 100644 --- a/src/Core/ApplicationKernel.php +++ b/src/Core/ApplicationKernel.php @@ -168,7 +168,7 @@ private function readBundleConfiguration(): array { $configurationFilePath = $this->getApplicationDir() . '/Configuration/bundles.yml'; if (!is_readable($configurationFilePath)) { - throw new \RuntimeException('The file "' . $configurationFilePath . '" could not be read.', 1504272377302); + throw new \RuntimeException('The file "' . $configurationFilePath . '" could not be read.', 1504272377); } return Yaml::parse(file_get_contents($configurationFilePath)); diff --git a/src/Core/ApplicationStructure.php b/src/Core/ApplicationStructure.php index 4e341e26..35f1d6ee 100644 --- a/src/Core/ApplicationStructure.php +++ b/src/Core/ApplicationStructure.php @@ -50,7 +50,7 @@ public function getApplicationRoot(): string if (!file_exists($applicationRoot . '/composer.json')) { throw new \RuntimeException( 'There is no composer.json in the supposed application root "' . $applicationRoot . '".', - 1501169001588 + 1501169001 ); } diff --git a/src/Core/Bootstrap.php b/src/Core/Bootstrap.php index 1be92b5d..ac7025d4 100644 --- a/src/Core/Bootstrap.php +++ b/src/Core/Bootstrap.php @@ -180,7 +180,7 @@ public function configure(): Bootstrap private function assertConfigureHasBeenCalled() { if (!$this->isConfigured) { - throw new \RuntimeException('Please call configure() first.', 1501170550897); + throw new \RuntimeException('Please call configure() first.', 1501170550); } } diff --git a/src/Core/Environment.php b/src/Core/Environment.php index 1a791d30..6cc038d5 100644 --- a/src/Core/Environment.php +++ b/src/Core/Environment.php @@ -63,7 +63,7 @@ public static function validateEnvironment(string $environment) $environmentsText = '"' . implode('", ', static::$validEnvironments) . '"'; throw new \UnexpectedValueException( '$environment must be one of ' . $environmentsText . ', but actually was: "' . $environment . '"', - 1499112172108 + 1499112172 ); } } diff --git a/src/Routing/ExtraLoader.php b/src/Routing/ExtraLoader.php index d22cfffd..a8ce0f6d 100644 --- a/src/Routing/ExtraLoader.php +++ b/src/Routing/ExtraLoader.php @@ -52,7 +52,7 @@ public function __construct(ApplicationStructure $applicationStructure) public function load($resource, $type = null): RouteCollection { if ($this->loaded) { - throw new \RuntimeException('Do not add the "extra" loader twice.', 1500587713150); + throw new \RuntimeException('Do not add the "extra" loader twice.', 1500587713); } $routes = new RouteCollection(); diff --git a/src/TestingSupport/Traits/SymfonyServerTrait.php b/src/TestingSupport/Traits/SymfonyServerTrait.php index 76c19740..391b593e 100644 --- a/src/TestingSupport/Traits/SymfonyServerTrait.php +++ b/src/TestingSupport/Traits/SymfonyServerTrait.php @@ -59,7 +59,7 @@ trait SymfonyServerTrait protected function startSymfonyServer(string $environment) { if (!\in_array($environment, static::$validEnvironments, true)) { - throw new \InvalidArgumentException('"' . $environment . '" is not a valid environment.', 1516284149961); + throw new \InvalidArgumentException('"' . $environment . '" is not a valid environment.', 1516284149); } if ($this->lockFileExists()) { throw new \RuntimeException( @@ -187,18 +187,18 @@ protected function getApplicationRoot(): string private function checkDocumentRoot(string $documentRoot) { if (!\file_exists($documentRoot)) { - throw new \RuntimeException('The document root "' . $documentRoot . '" does not exist.', 1499513246550); + throw new \RuntimeException('The document root "' . $documentRoot . '" does not exist.', 1499513246); } if (!\is_dir($documentRoot)) { throw new \RuntimeException( 'The document root "' . $documentRoot . '" exists, but is no directory.', - 1499513263757 + 1499513263 ); } if (!\is_readable($documentRoot)) { throw new \RuntimeException( 'The document root "' . $documentRoot . '" exists and is a directory, but is not readable.', - 1499513279590 + 1499513279 ); } }