Skip to content

Commit 33e8b10

Browse files
committed
UPGRADE minimum PHP version to 7.4
Follows CommonMark v2 minimum PHP version. Drops support in code and CI for previous versions.
1 parent 73e18c0 commit 33e8b10

8 files changed

Lines changed: 22 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['7.3', '7.4', '8.0']
10+
php: ['7.4', '8.0']
1111

1212
steps:
1313
# Setup

.github/workflows/installation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['7.2', '7.3', '7.4', '8.0']
10+
php: ['7.4', '8.0']
1111
symfony: ['4.4', '5.0', '5.1', '5.2', '5.3']
1212
exclude:
1313
- php: '8.0'

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [2.0.0] - 2021-11-14
10+
### Changed
11+
- minimal **league/commonmark** supported version is v2.0
12+
- minimal **PHP** supported version is 7.4
13+
14+
### Removed
15+
- converter service IDs as `aymdev_commonmark.converter.CONVERTER_NAME`
16+
917
## [1.3.1] - 2020-11-08
1018
### Fixed
1119
- definition deprecation for *old* service IDs has been corrected for Symfony < 5.1
@@ -36,7 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3644
### Added
3745
- Bundle base
3846

39-
[Unreleased]: https://github.com/AymDev/CommonMarkBundle/compare/v1.3.1...HEAD
47+
[Unreleased]: https://github.com/AymDev/CommonMarkBundle/compare/v2.0.0...HEAD
48+
[2.0.0]: https://github.com/AymDev/CommonMarkBundle/compare/v1.3.1...v2.0.0
4049
[1.3.1]: https://github.com/AymDev/CommonMarkBundle/compare/v1.3.0...v1.3.1
4150
[1.3.0]: https://github.com/AymDev/CommonMarkBundle/compare/v1.2.0...v1.3.0
4251
[1.2.0]: https://github.com/AymDev/CommonMarkBundle/compare/v1.1.1...v1.2.0

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"minimum-stability": "stable",
1313
"require": {
14-
"php": "^7.1||^8.0",
14+
"php": "^7.4||^8.0",
1515
"symfony/http-kernel": "^4.4|^5.0",
1616
"symfony/dependency-injection": "^4.4|^5.0",
1717
"symfony/config": "^4.4|^5.0",

src/DependencyInjection/Compiler/ConvertersPass.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Symfony\Component\DependencyInjection\ContainerBuilder;
1010
use Symfony\Component\DependencyInjection\Definition;
1111
use Symfony\Component\DependencyInjection\Reference;
12-
use Symfony\Component\HttpKernel\Kernel;
1312

1413
/**
1514
* @internal
@@ -18,7 +17,7 @@ class ConvertersPass implements CompilerPassInterface
1817
{
1918
public const PARAMETER_CONVERTERS = 'aymdev_commonmark.converters';
2019
/** @var Reference[] converter service IDs */
21-
private $converters = [];
20+
private array $converters = [];
2221

2322
public function process(ContainerBuilder $container)
2423
{
@@ -64,23 +63,6 @@ private function registerConverters(array $converterConfig, ContainerBuilder $co
6463
$container->setDefinition($converterConfig['name'], $converterDefinition);
6564
$container->registerAliasForArgument($converterConfig['name'], MarkdownConverter::class, $converterConfig['name']);
6665

67-
// Deprecated service ID
68-
$deprecatedConverterDefinition = clone $converterDefinition;
69-
70-
$deprecationMessage = 'Using the %service_id% service ID is deprecated and will be removed in v2. ';
71-
$deprecationMessage .= 'You should use the converter name instead.';
72-
73-
// Symfony <5.1
74-
if (Kernel::MAJOR_VERSION <= 4 || (Kernel::MAJOR_VERSION === 5 && Kernel::MINOR_VERSION === 0)) {
75-
$deprecatedConverterDefinition->setDeprecated(true, $deprecationMessage);
76-
} else {
77-
// Symfony >= 5.1
78-
$deprecatedConverterDefinition->setDeprecated('aymdev/commonmark-bundle', '1.3.0', $deprecationMessage);
79-
}
80-
81-
$converterId = 'aymdev_commonmark.converter.' . $converterConfig['name'];
82-
$container->setDefinition($converterId, $deprecatedConverterDefinition);
83-
8466
// Save converter for later twig extension arguments setup
8567
$this->converters[$converterConfig['name']] = new Reference($converterConfig['name']);
8668

src/Twig/CommonMarkExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class CommonMarkExtension extends AbstractExtension
1414
{
15-
private $serviceLocator;
15+
private ServiceLocator $serviceLocator;
1616

1717
public function __construct(ServiceLocator $serviceLocator)
1818
{

tests/DependencyInjection/Compiler/ConvertersPassTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ public function testContainerServicesRegistration()
6767
self::assertTrue($container->has($extension));
6868
}
6969

70-
// Deprecated service ID
71-
$converterId = 'aymdev_commonmark.converter.' . $converter['name'];
72-
self::assertTrue($container->has($converterId));
73-
self::assertTrue($container->getDefinition($converterId)->isDeprecated());
74-
7570
// Current service ID
7671
self::assertTrue($container->has($converter['name']));
7772

@@ -141,8 +136,7 @@ class AymdevCommonmarkTestKernel extends Kernel
141136
{
142137
public const KERNEL_CACHE_DIR = __DIR__ . '/../../cache';
143138

144-
/** @var array */
145-
private $aymdevCommonmarkConfig;
139+
private array $aymdevCommonmarkConfig;
146140

147141
public function __construct(array $aymdevCommonmarkConfig = [])
148142
{

tests/Twig/CommonMarkExtensionTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@ public function testFilterConverterNameIsOptional()
6868
public function testFilterWithInvalidConverterName()
6969
{
7070
$serviceLocator = new ServiceLocator([
71-
'my_converter' => function() {
72-
return $this->getMockBuilder(MarkdownConverter::class)
73-
->disableOriginalConstructor()
74-
->getMock();
75-
},
71+
'my_converter' => fn() => $this->getMockBuilder(MarkdownConverter::class)
72+
->disableOriginalConstructor()
73+
->getMock(),
7674
]);
7775
$extension = new CommonMarkExtension($serviceLocator);
7876

@@ -88,11 +86,9 @@ public function testFilterWithInvalidConverterName()
8886
public function testFilterWithNullContent()
8987
{
9088
$serviceLocator = new ServiceLocator([
91-
'my_converter' => function() {
92-
return $this->getMockBuilder(MarkdownConverter::class)
93-
->disableOriginalConstructor()
94-
->getMock();
95-
},
89+
'my_converter' => fn() => $this->getMockBuilder(MarkdownConverter::class)
90+
->disableOriginalConstructor()
91+
->getMock(),
9692
]);
9793
$extension = new CommonMarkExtension($serviceLocator);
9894

0 commit comments

Comments
 (0)