Skip to content

Commit 833ca25

Browse files
authored
Merge pull request #320 from kbond/modernize-v2
Modernize 2.x
2 parents 330d0bd + b0f5089 commit 833ca25

26 files changed

+91
-377
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18+
php: [ 8.1, 8.2, 8.3, 8.4 ]
19+
deps: [ highest ]
20+
symfony: [ 6.4.*, 7.2.*, 7.3.* ]
1821
include:
19-
- php: 7.4
20-
symfony: 5.4.*
21-
- php: 8.0
22-
symfony: 5.4.*
2322
- php: 8.1
24-
symfony: 6.4.*
25-
- php: 8.2
26-
symfony: 6.4.*
27-
- php: 8.2
28-
symfony: 7.0.*
29-
- php: 8.3
30-
symfony: 7.0.*
23+
deps: lowest
24+
symfony: '*'
25+
exclude:
26+
- php: 8.1
27+
symfony: 7.2.*
28+
- php: 8.1
29+
symfony: 7.3.*
3130

3231
steps:
3332
- name: Checkout code
@@ -40,43 +39,17 @@ jobs:
4039
coverage: none
4140
tools: flex
4241

43-
- name: Install symfony/mailer
44-
run: composer require --dev "symfony/mailer" --no-update
45-
4642
- name: Install dependencies
4743
uses: ramsey/composer-install@v2
4844
with:
45+
dependency-versions: ${{ inputs.deps }}
4946
composer-options: --prefer-dist
5047
env:
5148
SYMFONY_REQUIRE: ${{ matrix.symfony }}
5249

5350
- name: Run tests
5451
run: vendor/bin/phpunit -v
5552

56-
prefer-lowest-tests:
57-
name: "Test: prefer-lowest"
58-
59-
runs-on: ubuntu-latest
60-
61-
steps:
62-
- name: Checkout code
63-
uses: actions/checkout@v4
64-
65-
- name: Setup PHP
66-
uses: shivammathur/setup-php@v2
67-
with:
68-
php-version: 7.3
69-
coverage: none
70-
71-
- name: Install dependencies
72-
uses: ramsey/composer-install@v2
73-
with:
74-
dependency-versions: lowest
75-
composer-options: --prefer-dist
76-
77-
- name: Run tests
78-
run: vendor/bin/phpunit -v
79-
8053
code-coverage:
8154
name: Code Coverage
8255
runs-on: ubuntu-latest
@@ -87,12 +60,9 @@ jobs:
8760
- name: Setup PHP
8861
uses: shivammathur/setup-php@v2
8962
with:
90-
php-version: 7.4
63+
php-version: 8.3
9164
coverage: xdebug
9265

93-
- name: Install symfony/mailer
94-
run: composer require --dev "symfony/mailer" --no-update
95-
9666
- name: Install dependencies
9767
uses: ramsey/composer-install@v2
9868
with:
@@ -111,7 +81,7 @@ jobs:
11181
- name: Setup PHP
11282
uses: shivammathur/setup-php@v2
11383
with:
114-
php-version: 7.4
84+
php-version: 8.3
11585
coverage: none
11686

11787
- name: Validate composer.json
@@ -127,7 +97,7 @@ jobs:
12797
- name: Setup PHP
12898
uses: shivammathur/setup-php@v2
12999
with:
130-
php-version: 7.4
100+
php-version: 8.1
131101
coverage: none
132102

133103
- name: Install dependencies

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/Tests/app/cache
2-
/Tests/app/logs
3-
/Tests/app/var
1+
/Tests/Fixture/cache
2+
/Tests/Fixture/logs
3+
/Tests/Fixture/var
44
/vendor
55
composer.lock
66
.phpunit.result.cache

.scrutinizer.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

Check/DoctrineMigrationsCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class DoctrineMigrationsCollection implements CheckCollectionInterface
4242
*/
4343
public function __construct(
4444
ContainerInterface $container,
45-
array $migrations
45+
array $migrations,
4646
) {
4747
$this->container = $container;
4848
$this->migrations = $migrations;

Check/SymfonyMessengerTransportCount.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Laminas\Diagnostics\Check\AbstractCheck;
66
use Laminas\Diagnostics\Result\Failure;
7+
use Laminas\Diagnostics\Result\ResultInterface;
78
use Laminas\Diagnostics\Result\Success;
89
use Laminas\Diagnostics\Result\Warning;
910
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
@@ -29,7 +30,7 @@ public function __construct(MessageCountAwareInterface $transport, string $trans
2930
}
3031
}
3132

32-
public function check()
33+
public function check(): ResultInterface
3334
{
3435
$count = $this->transport->getMessageCount();
3536

Check/SymfonyMessengerTransportCountCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(ServiceLocator $messengerReceiverLocator, array $tra
2727
$this->transports = $transportConfig;
2828
}
2929

30-
public function getChecks()
30+
public function getChecks(): array
3131
{
3232
$checks = [];
3333
foreach ($this->transports as $transportName => $config) {

DependencyInjection/Compiler/MailerCompilerPass.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@ public function process(ContainerBuilder $container): void
2424
}
2525

2626
try {
27-
$definition = $container->findDefinition('mailer');
28-
} catch (ServiceNotFoundException $e) {
29-
throw new \InvalidArgumentException('To enable mail reporting you have to install the "swiftmailer/swiftmailer" or "symfony/mailer".');
27+
$container->findDefinition('mailer');
28+
} catch (ServiceNotFoundException) {
29+
throw new \InvalidArgumentException('To enable mail reporting you have to install "symfony/mailer".');
3030
}
3131

32-
$filename = \Swift_Mailer::class !== $definition->getClass() ? 'symfony_mailer.xml' : 'swift_mailer.xml';
33-
3432
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../../Resources/config'));
35-
$loader->load($filename);
33+
$loader->load('symfony_mailer.xml');
3634
}
3735
}

DependencyInjection/DoctrineMigrations/AbstractDoctrineMigrationsLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ abstract public function createMigrationConfigurationService(
2222
ContainerBuilder $container,
2323
string $connectionName,
2424
string $serviceId,
25-
?string $filename = null
25+
?string $filename = null,
2626
): void;
2727
}

DependencyInjection/DoctrineMigrations/V2MigrationsLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function createMigrationConfigurationService(
5252
ContainerBuilder $container,
5353
string $connectionName,
5454
string $serviceId,
55-
?string $filename = null
55+
?string $filename = null,
5656
): void {
5757
if (!$container->has(Configuration::class)) {
5858
$container->register(Configuration::class)
@@ -136,7 +136,7 @@ public function createMigrationConfigurationService(
136136
private function createTemporaryConfiguration(
137137
ContainerBuilder $container,
138138
Connection $connection,
139-
string $filename = null
139+
?string $filename = null,
140140
): DoctrineMigrationConfiguration {
141141
if (null === $filename) {
142142
// this is configured from migrations bundle

DependencyInjection/DoctrineMigrations/V3MigrationsLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function createMigrationConfigurationService(
2323
ContainerBuilder $container,
2424
string $connectionName,
2525
string $serviceId,
26-
?string $filename = null
26+
?string $filename = null,
2727
): void {
2828
if (null !== $filename) {
2929
$configurationClass = $this->getConfigurationLoaderClass($container, $filename);

0 commit comments

Comments
 (0)