Skip to content

Commit 17c6c7d

Browse files
authored
Remove allowance of PHP8.1 and 8.2; Allow psr/log 2 and 3 (#36)
1 parent 2a53275 commit 17c6c7d

4 files changed

Lines changed: 19 additions & 42 deletions

File tree

.github/workflows/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
php-versions: ['8.1', '8.2', '8.3']
11+
php-versions: ['8.3']
1212
name: PHP ${{ matrix.php-versions }}
1313
steps:
1414
- uses: actions/checkout@v2

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"license": "MIT",
55
"minimum-stability": "stable",
66
"require": {
7-
"php": "^8.1",
7+
"php": "^8.3",
88
"hostnet/entity-tracker-component": "^2.0.0",
9-
"psr/log": "^1.1.0",
9+
"psr/log": "^1.1.0||^2.0.0||^3.0.0",
1010
"symfony/config": "^5.4||^6.0",
1111
"symfony/dependency-injection": "^5.4||^6.0",
1212
"symfony/http-kernel": "^5.4||^6.0",
@@ -16,10 +16,10 @@
1616
"hostnet/entity-blamable-component": "^1.0.4",
1717
"hostnet/phpcs-tool": "^9.1.0",
1818
"phpspec/prophecy": "^1.19",
19+
"phpspec/prophecy-phpunit": "^2.2",
1920
"phpunit/phpunit": "^9.5.6",
2021
"symfony/framework-bundle": "^5.4||^6.0",
21-
"symfony/security-bundle": "^5.4||^6.0",
22-
"phpspec/prophecy-phpunit": "^2.2"
22+
"symfony/security-bundle": "^5.4||^6.0"
2323
},
2424
"suggest": {
2525
"hostnet/entity-blamable-component": "Provides the @Blamable annotation and listeners",

src/DependencyInjection/Configuration.php

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@
66

77
namespace Hostnet\Bundle\EntityTrackerBundle\DependencyInjection;
88

9-
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
109
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
1110
use Symfony\Component\Config\Definition\ConfigurationInterface;
12-
use Symfony\Component\HttpKernel\Kernel;
1311

1412
class Configuration implements ConfigurationInterface
1513
{
16-
public const REVISION_FACTORY_INTERFACE = 'Hostnet\Component\EntityRevision\Factory\RevisionFactoryInterface';
17-
public const BLAMABLE_PROVIDER_INTERFACE = 'Hostnet\Component\EntityBlamable\Provider\BlamableProviderInterface';
18-
public const BLAMABLE_DEFAULT_PROVIDER = 'entity_tracker.provider.blamable';
14+
public const string REVISION_FACTORY_INTERFACE
15+
= 'Hostnet\Component\EntityRevision\Factory\RevisionFactoryInterface';
1916

20-
private const CONFIG_ROOT = 'hostnet_entity_tracker';
17+
public const string BLAMABLE_PROVIDER_INTERFACE
18+
= 'Hostnet\Component\EntityBlamable\Provider\BlamableProviderInterface';
19+
20+
public const string BLAMABLE_DEFAULT_PROVIDER
21+
= 'entity_tracker.provider.blamable';
22+
23+
private const string CONFIG_ROOT = 'hostnet_entity_tracker';
2124

2225
public function getConfigTreeBuilder(): TreeBuilder
2326
{
24-
$tree_builder = $this->createTreeBuilder();
25-
$root_node = $this->retrieveRootNode($tree_builder);
27+
$tree_builder = new TreeBuilder(self::CONFIG_ROOT);
28+
$root_node = $tree_builder->getRootNode();
2629

2730
$component_info = 'Configures and enables the %s listener';
2831

@@ -58,30 +61,4 @@ public function getConfigTreeBuilder(): TreeBuilder
5861

5962
return $tree_builder;
6063
}
61-
62-
private function createTreeBuilder(): TreeBuilder
63-
{
64-
if (Kernel::VERSION_ID >= 40200) {
65-
return new TreeBuilder(self::CONFIG_ROOT);
66-
}
67-
68-
if (Kernel::VERSION_ID < 40200) {
69-
return new TreeBuilder();
70-
}
71-
72-
throw new \RuntimeException('This bundle can only be used by Symfony 4.0 and up.');
73-
}
74-
75-
private function retrieveRootNode(TreeBuilder $tree_builder): NodeDefinition
76-
{
77-
if (Kernel::VERSION_ID >= 40200) {
78-
return $tree_builder->getRootNode();
79-
}
80-
81-
if (Kernel::VERSION_ID < 40200) {
82-
return $tree_builder->root(self::CONFIG_ROOT);
83-
}
84-
85-
throw new \RuntimeException('This bundle can only be used by Symfony 4.0 and up.');
86-
}
8764
}

src/DependencyInjection/HostnetEntityTrackerExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
class HostnetEntityTrackerExtension extends Extension
1616
{
17-
private const BLAMABLE = 'Hostnet\Component\EntityBlamable\Blamable';
18-
private const MUTATION = 'Hostnet\Component\EntityMutation\Mutation';
19-
private const REVISION = 'Hostnet\Component\EntityRevision\Revision';
17+
private const string BLAMABLE = 'Hostnet\Component\EntityBlamable\Blamable';
18+
private const string MUTATION = 'Hostnet\Component\EntityMutation\Mutation';
19+
private const string REVISION = 'Hostnet\Component\EntityRevision\Revision';
2020

2121
public function load(array $configs, ContainerBuilder $container): void
2222
{

0 commit comments

Comments
 (0)