Skip to content

Bump PHP to 8.1 in composer.json #506

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

Merged
merged 6 commits into from
Jun 14, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
coverage: none

- name: Download dependencies
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
php-version: '8.1'
coverage: none

- name: Download dependencies
Expand Down
19 changes: 11 additions & 8 deletions Catalogue/CatalogueManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,26 +67,29 @@ public function getMessages(string $locale, string $domain): array
/**
* @param array $config {
*
* @var string $domain
* @var string $locale
* @var bool $isNew
* @var bool $isObsolete
* @var bool $isApproved
* }
*
* @return CatalogueMessage[]
* @return CatalogueMessage[] Contains:
* - string $domain
* - string $locale
* - bool $isNew
* - bool $isObsolete
* - bool $isApproved
*/
public function findMessages(array $config = []): array
{
/** @var string $inputDomain */
$inputDomain = $config['domain'] ?? null;
/** @var bool $isNew */
$isNew = $config['isNew'] ?? null;
/** @var bool $isObsolete */
$isObsolete = $config['isObsolete'] ?? null;
/** @var bool $isApproved */
$isApproved = $config['isApproved'] ?? null;
$isEmpty = $config['isEmpty'] ?? null;

$messages = [];
$catalogues = [];
if (isset($config['locale'])) {
/** @var string $locale */
$locale = $config['locale'];
if (isset($this->catalogues[$locale])) {
$catalogues = [$locale => $this->catalogues[$locale]];
Expand Down
2 changes: 2 additions & 0 deletions Command/DeleteEmptyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -96,6 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

if ($input->isInteractive()) {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion(sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
if (!$helper->ask($input, $output, $question)) {
Expand Down
2 changes: 2 additions & 0 deletions Command/DeleteObsoleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
Expand Down Expand Up @@ -97,6 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}

if ($input->isInteractive()) {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion(sprintf('You are about to remove %d translations. Do you wish to continue? (y/N) ', $messageCount), false);
if (!$helper->ask($input, $output, $question)) {
Expand Down
10 changes: 4 additions & 6 deletions Service/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ public function __construct(Extractor $extractor, Environment $twig, string $def

/**
* @param MessageCatalogue[] $catalogues
* @param array $config {
*
* @var array $blacklist_domains Blacklist the domains we should exclude. Cannot be used with whitelist.
* @var array $whitelist_domains Whitelist the domains we should include. Cannot be used with blacklist.
* @var string $project_root The project root will be removed from the source location.
* }
* @param array $config Configuration options:
* - array $blacklist_domains Domains to be excluded. Cannot be used with whitelist.
* - array $whitelist_domains Domains to be included. Cannot be used with blacklist.
* - string $project_root The project root that will be removed from the source location.
*/
public function extractToCatalogues(Finder $finder, array $catalogues, array $config = []): ImportResult
{
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"symfony/framework-bundle": "^5.3 || ^6.0",
"symfony/validator": "^5.3 || ^6.0",
"symfony/translation": "^5.3 || ^6.0",
Expand Down Expand Up @@ -38,7 +38,8 @@
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"matthiasnoback/symfony-config-test": "^4.1",
"nyholm/psr7": "^1.1",
"nyholm/symfony-bundle-test": "^2.0"
"nyholm/symfony-bundle-test": "^2.0",
"phpstan/phpstan": "^1.11"
},
"suggest": {
"php-http/httplug-bundle": "To easier configure your httplug clients."
Expand Down
56 changes: 33 additions & 23 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ parameters:
path: Command/StatusCommand.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder\\:\\:root\\(\\)\\.$#"
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\\\\NodeDefinition\\:\\:fixXmlConfig\\(\\)\\.$#"
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:booleanNode\\(\\)\\.$#"
count: 1
path: DependencyInjection/Configuration.php

Expand All @@ -41,7 +41,7 @@ parameters:
path: DependencyInjection/Configuration.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:booleanNode\\(\\)\\.$#"
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\TreeBuilder\\:\\:root\\(\\)\\.$#"
count: 1
path: DependencyInjection/Configuration.php

Expand All @@ -51,22 +51,22 @@ parameters:
path: Service/CacheClearer.php

-
message: "#^Property Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:\\$translator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#"
message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/EditInPlaceTranslator.php

-
message: "#^Parameter \\$translator of method Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:__construct\\(\\) has invalid typehint type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Call to method getCatalogues\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/EditInPlaceTranslator.php

-
message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#"
count: 1
message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 2
path: Translator/EditInPlaceTranslator.php

-
message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/EditInPlaceTranslator.php

Expand All @@ -76,32 +76,42 @@ parameters:
path: Translator/EditInPlaceTranslator.php

-
message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 2
message: "#^Call to method transChoice\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/EditInPlaceTranslator.php

-
message: "#^Call to method transChoice\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#"
count: 1
path: Translator/EditInPlaceTranslator.php

-
message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Parameter \\$translator of method Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:__construct\\(\\) has invalid type 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\\.$#"
message: "#^Property Translation\\\\Bundle\\\\Translator\\\\EditInPlaceTranslator\\:\\:\\$translator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#"
count: 1
path: Translator/EditInPlaceTranslator.php

-
message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/FallbackTranslator.php

-
message: "#^Parameter \\$symfonyTranslator of method Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:__construct\\(\\) has invalid typehint type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Call to method getCatalogues\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/FallbackTranslator.php

-
message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#"
message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/FallbackTranslator.php

-
message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/FallbackTranslator.php

Expand All @@ -116,29 +126,29 @@ parameters:
path: Translator/FallbackTranslator.php

-
message: "#^Call to method setLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#"
count: 1
path: Translator/FallbackTranslator.php

-
message: "#^Call to method getLocale\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Parameter \\$symfonyTranslator of method Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:__construct\\(\\) has invalid type Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
count: 1
path: Translator/FallbackTranslator.php

-
message: "#^Call to method getCatalogue\\(\\) on an unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface\\.$#"
message: "#^Property Translation\\\\Bundle\\\\Translator\\\\FallbackTranslator\\:\\:\\$symfonyTranslator has unknown class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface as its type\\.$#"
count: 1
path: Translator/FallbackTranslator.php

-
message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#"
count: 1
message: "#^Call to an undefined method Symfony\\\\Component\\\\Translation\\\\TranslatorBagInterface\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface\\:\\:transChoice\\(\\)\\.$#"
count: 2
path: Twig/TranslationExtension.php

-
message: "#^Call to an undefined method Symfony\\\\Component\\\\Translation\\\\TranslatorBagInterface\\|Symfony\\\\Contracts\\\\Translation\\\\TranslatorInterface\\:\\:transChoice\\(\\)\\.$#"
count: 2
message: "#^Class Symfony\\\\Component\\\\Translation\\\\TranslatorInterface not found\\.$#"
count: 1
path: Twig/TranslationExtension.php

excludes_analyse:
excludePaths:
- Translator/TranslatorInterface.php
Loading