Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
php-versions: ['8.1', '8.2', '8.3']
php-versions: ['8.3']
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"license": "MIT",
"minimum-stability": "stable",
"require": {
"php": "^8.1",
"php": "^8.3",
"hostnet/entity-tracker-component": "^2.0.0",
"psr/log": "^1.1.0",
"psr/log": "^1.1.0||^2.0.0||^3.0.0",
"symfony/config": "^5.4||^6.0",
"symfony/dependency-injection": "^5.4||^6.0",
"symfony/http-kernel": "^5.4||^6.0",
Expand All @@ -16,10 +16,10 @@
"hostnet/entity-blamable-component": "^1.0.4",
"hostnet/phpcs-tool": "^9.1.0",
"phpspec/prophecy": "^1.19",
"phpspec/prophecy-phpunit": "^2.2",
"phpunit/phpunit": "^9.5.6",
"symfony/framework-bundle": "^5.4||^6.0",
"symfony/security-bundle": "^5.4||^6.0",
"phpspec/prophecy-phpunit": "^2.2"
"symfony/security-bundle": "^5.4||^6.0"
},
"suggest": {
"hostnet/entity-blamable-component": "Provides the @Blamable annotation and listeners",
Expand Down
45 changes: 11 additions & 34 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@

namespace Hostnet\Bundle\EntityTrackerBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\HttpKernel\Kernel;

class Configuration implements ConfigurationInterface
{
public const REVISION_FACTORY_INTERFACE = 'Hostnet\Component\EntityRevision\Factory\RevisionFactoryInterface';
public const BLAMABLE_PROVIDER_INTERFACE = 'Hostnet\Component\EntityBlamable\Provider\BlamableProviderInterface';
public const BLAMABLE_DEFAULT_PROVIDER = 'entity_tracker.provider.blamable';
public const string REVISION_FACTORY_INTERFACE
= 'Hostnet\Component\EntityRevision\Factory\RevisionFactoryInterface';

private const CONFIG_ROOT = 'hostnet_entity_tracker';
public const string BLAMABLE_PROVIDER_INTERFACE
= 'Hostnet\Component\EntityBlamable\Provider\BlamableProviderInterface';

public const string BLAMABLE_DEFAULT_PROVIDER
= 'entity_tracker.provider.blamable';

private const string CONFIG_ROOT = 'hostnet_entity_tracker';

public function getConfigTreeBuilder(): TreeBuilder
{
$tree_builder = $this->createTreeBuilder();
$root_node = $this->retrieveRootNode($tree_builder);
$tree_builder = new TreeBuilder(self::CONFIG_ROOT);
$root_node = $tree_builder->getRootNode();

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

Expand Down Expand Up @@ -58,30 +61,4 @@ public function getConfigTreeBuilder(): TreeBuilder

return $tree_builder;
}

private function createTreeBuilder(): TreeBuilder
{
if (Kernel::VERSION_ID >= 40200) {
return new TreeBuilder(self::CONFIG_ROOT);
}

if (Kernel::VERSION_ID < 40200) {
return new TreeBuilder();
}

throw new \RuntimeException('This bundle can only be used by Symfony 4.0 and up.');
}

private function retrieveRootNode(TreeBuilder $tree_builder): NodeDefinition
{
if (Kernel::VERSION_ID >= 40200) {
return $tree_builder->getRootNode();
}

if (Kernel::VERSION_ID < 40200) {
return $tree_builder->root(self::CONFIG_ROOT);
}

throw new \RuntimeException('This bundle can only be used by Symfony 4.0 and up.');
}
}
6 changes: 3 additions & 3 deletions src/DependencyInjection/HostnetEntityTrackerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

class HostnetEntityTrackerExtension extends Extension
{
private const BLAMABLE = 'Hostnet\Component\EntityBlamable\Blamable';
private const MUTATION = 'Hostnet\Component\EntityMutation\Mutation';
private const REVISION = 'Hostnet\Component\EntityRevision\Revision';
private const string BLAMABLE = 'Hostnet\Component\EntityBlamable\Blamable';
private const string MUTATION = 'Hostnet\Component\EntityMutation\Mutation';
private const string REVISION = 'Hostnet\Component\EntityRevision\Revision';

public function load(array $configs, ContainerBuilder $container): void
{
Expand Down
Loading