From e7a0973b728a017c40f41cc6bcb9728ee8eabe86 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 6 Jan 2020 19:43:49 +0100 Subject: [PATCH 1/4] PHPStan fix --- Controller/SymfonyProfilerController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Controller/SymfonyProfilerController.php b/Controller/SymfonyProfilerController.php index 306cfe2e..f518423c 100644 --- a/Controller/SymfonyProfilerController.php +++ b/Controller/SymfonyProfilerController.php @@ -183,6 +183,7 @@ private function getMessages(string $token, string $profileName = 'translation') $messages = $dataCollector->getMessages(); if (\class_exists(Data::class) && $messages instanceof Data) { + /** @var Data $messages */ return $messages->getValue(true); } From 33dc761e1888b20171b982b621e4de79c0d3545a Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 6 Jan 2020 19:55:01 +0100 Subject: [PATCH 2/4] Prepare for 0.11.0 --- Changelog.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Changelog.md b/Changelog.md index d7299c85..ddb2e458 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,23 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.11.0 + +## Added + +- GUI updates on the Profiler page. + +### Fixed + +- Fixed "Unable to edit a missing translation from profiler" by updating SymfonyStorage + +### Changed + +- Modernized SymfonyProfilerController by stop using `$this->get()` and other bad practises. +- Modernized DownloadCommand +- `StorageService::download()` will return an array of `MessageCatalogue` after local copy is downloaded. +- DownloadCommand will automatically clear cache. + ## 0.10.0 ## Added @@ -12,7 +29,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ### Changed -- Use class names as service ids. Old service ids will still be available as aliases. +- Use class names as service ids. Old service ids will still be available as aliases. - Renamed all `*.yml` files to `*.yaml`. ### Removed From d6159641ba2433f2e5b2c22be8b067cb5a68a1a8 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 6 Jan 2020 20:02:48 +0100 Subject: [PATCH 3/4] cs --- Controller/SymfonyProfilerController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/SymfonyProfilerController.php b/Controller/SymfonyProfilerController.php index f518423c..701ed5b1 100644 --- a/Controller/SymfonyProfilerController.php +++ b/Controller/SymfonyProfilerController.php @@ -183,7 +183,7 @@ private function getMessages(string $token, string $profileName = 'translation') $messages = $dataCollector->getMessages(); if (\class_exists(Data::class) && $messages instanceof Data) { - /** @var Data $messages */ + /* @var Data $messages */ return $messages->getValue(true); } From 6bac91b33a28257de090ef723569f9bc5bc5501f Mon Sep 17 00:00:00 2001 From: Nyholm Date: Mon, 6 Jan 2020 20:58:29 +0100 Subject: [PATCH 4/4] Updated basline --- Controller/SymfonyProfilerController.php | 1 - phpstan-baseline.neon | 306 ++++++++++++----------- 2 files changed, 156 insertions(+), 151 deletions(-) diff --git a/Controller/SymfonyProfilerController.php b/Controller/SymfonyProfilerController.php index 701ed5b1..306cfe2e 100644 --- a/Controller/SymfonyProfilerController.php +++ b/Controller/SymfonyProfilerController.php @@ -183,7 +183,6 @@ private function getMessages(string $token, string $profileName = 'translation') $messages = $dataCollector->getMessages(); if (\class_exists(Data::class) && $messages instanceof Data) { - /* @var Data $messages */ return $messages->getValue(true); } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f36a783f..e0a36220 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,151 +1,157 @@ parameters: - ignoreErrors: - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" - count: 1 - path: Command/DeleteObsoleteCommand.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" - count: 1 - path: Command/DownloadCommand.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" - count: 1 - path: Command/ExtractCommand.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" - count: 1 - path: Command/StatusCommand.php - - - - message: "#^Call to an undefined static method Symfony\\\\Component\\\\Intl\\\\Intl\\:\\:getLocaleBundle\\(\\)\\.$#" - count: 1 - path: Controller/WebUIController.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder\\:\\:root\\(\\)\\.$#" - count: 1 - path: DependencyInjection/Configuration.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:fixXmlConfig\\(\\)\\.$#" - count: 1 - path: DependencyInjection/Configuration.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:scalarNode\\(\\)\\.$#" - count: 2 - path: DependencyInjection/Configuration.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:booleanNode\\(\\)\\.$#" - count: 1 - path: DependencyInjection/Configuration.php - - - - message: "#^Class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\PostResponseEvent not found\\.$#" - count: 2 - path: EventListener/AutoAddMissingTranslations.php - - - - message: "#^Class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\FilterResponseEvent not found\\.$#" - count: 2 - path: EventListener/EditInPlaceResponseListener.php - - - - message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" - count: 1 - path: Service/CacheClearer.php - - - - message: "#^Property Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:\\$translator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#" - count: 1 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Parameter \\$translator of method Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:__construct\\(\\) has invalid typehint type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" - count: 1 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Call to method trans\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 2 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 2 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Call to method transChoice\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/EditInPlaceTranslator.php - - - - message: "#^Property Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:\\$symfonyTranslator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#" - count: 1 - path: Translator/FallbackTranslator.php - - - - message: "#^Parameter \\$symfonyTranslator of method Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:__construct\\(\\) has invalid typehint type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/FallbackTranslator.php - - - - message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" - count: 1 - path: Translator/FallbackTranslator.php - - - - message: "#^Call to method trans\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 2 - path: Translator/FallbackTranslator.php - - - - message: "#^Call to method transChoice\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 2 - path: Translator/FallbackTranslator.php - - - - message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/FallbackTranslator.php - - - - message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/FallbackTranslator.php - - - - message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" - count: 1 - path: Translator/FallbackTranslator.php - - - - message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" - count: 1 - path: Twig/TranslationExtension.php - - - - message: "#^Call to an undefined method Symfony\\\\Component\\\\Translation\\\\TranslatorBagInterface\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface\\:\\:transChoice\\(\\)\\.$#" - count: 2 - path: Twig/TranslationExtension.php + ignoreErrors: + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" + count: 1 + path: Command/DeleteObsoleteCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" + count: 1 + path: Command/DownloadCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" + count: 1 + path: Command/ExtractCommand.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Console\\\\Application\\:\\:getKernel\\(\\)\\.$#" + count: 1 + path: Command/StatusCommand.php + + - + message: "#^Call to method getValue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\DataCollector\\\\Data\\.$#" + count: 1 + path: Controller/SymfonyProfilerController.php + + - + message: "#^Call to an undefined static method Symfony\\\\Component\\\\Intl\\\\Intl\\:\\:getLocaleBundle\\(\\)\\.$#" + count: 1 + path: Controller/WebUIController.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder\\:\\:root\\(\\)\\.$#" + count: 1 + path: DependencyInjection/Configuration.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:fixXmlConfig\\(\\)\\.$#" + count: 1 + path: DependencyInjection/Configuration.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:scalarNode\\(\\)\\.$#" + count: 2 + path: DependencyInjection/Configuration.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:booleanNode\\(\\)\\.$#" + count: 1 + path: DependencyInjection/Configuration.php + + - + message: "#^Class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\PostResponseEvent not found\\.$#" + count: 2 + path: EventListener/AutoAddMissingTranslations.php + + - + message: "#^Class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\FilterResponseEvent not found\\.$#" + count: 2 + path: EventListener/EditInPlaceResponseListener.php + + - + message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" + count: 1 + path: Service/CacheClearer.php + + - + message: "#^Property Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:\\$translator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#" + count: 1 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Parameter \\$translator of method Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:__construct\\(\\) has invalid typehint type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" + count: 1 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Call to method trans\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 2 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 2 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Call to method transChoice\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/EditInPlaceTranslator.php + + - + message: "#^Property Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:\\$symfonyTranslator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#" + count: 1 + path: Translator/FallbackTranslator.php + + - + message: "#^Parameter \\$symfonyTranslator of method Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:__construct\\(\\) has invalid typehint type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/FallbackTranslator.php + + - + message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" + count: 1 + path: Translator/FallbackTranslator.php + + - + message: "#^Call to method trans\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 2 + path: Translator/FallbackTranslator.php + + - + message: "#^Call to method transChoice\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 2 + path: Translator/FallbackTranslator.php + + - + message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/FallbackTranslator.php + + - + message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/FallbackTranslator.php + + - + message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#" + count: 1 + path: Translator/FallbackTranslator.php + + - + message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#" + count: 1 + path: Twig/TranslationExtension.php + + - + message: "#^Call to an undefined method Symfony\\\\Component\\\\Translation\\\\TranslatorBagInterface\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface\\:\\:transChoice\\(\\)\\.$#" + count: 2 + path: Twig/TranslationExtension.php +