Skip to content

Commit c3e8431

Browse files
mike-zukowskiprgTW
andauthored
chore!: gatekeeper service fqcn (#8)
* chore: gatekeeper service fqcn * Service argument fix * Include compiler pass definition * Unnecessary alias * alias restored * Update Resources/config/services.yml Co-authored-by: Tomasz Wójcik <[email protected]> --------- Co-authored-by: Tomasz Wójcik <[email protected]>
1 parent afd589a commit c3e8431

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

DependencyInjection/Compiler/GateKeeperCompilerPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace GateKeeperBundle\DependencyInjection\Compiler;
88

9-
9+
use GateKeeper\GateKeeper;
1010
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1111
use Symfony\Component\DependencyInjection\ContainerBuilder;
1212
use Symfony\Component\DependencyInjection\Reference;
@@ -22,15 +22,15 @@ class GateKeeperCompilerPass implements CompilerPassInterface
2222
*/
2323
public function process(ContainerBuilder $container)
2424
{
25-
if (!$container->hasDefinition('gatekeeper'))
25+
if (!$container->hasDefinition(GateKeeper::class))
2626
{
2727
return;
2828
}
2929

3030
$definition = $container->getDefinition('gatekeeper.voter');
3131
$definition->addArgument(new Reference($container->getParameter('gatekeeper.provider.service')));
3232

33-
$definition = $container->getDefinition('gatekeeper');
33+
$definition = $container->getDefinition(GateKeeper::class);
3434
$definition->addArgument(new Reference($container->getParameter('gatekeeper.repository.service')));
3535

3636
$taggedServices = $container->findTaggedServiceIds('gatekeeper.access');
@@ -43,4 +43,4 @@ public function process(ContainerBuilder $container)
4343
}
4444
}
4545

46-
}
46+
}

Resources/config/services.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
parameters:
2-
gatekeeper.class: GateKeeper\GateKeeper
3-
gatekeeper.access.allow.class: GateKeeperBundle\Access\Allow
4-
gatekeeper.access.deny.class: GateKeeperBundle\Access\Deny
5-
61
services:
72
GateKeeper\GateKeeper:
8-
alias: 'gatekeeper'
3+
class: GateKeeper\GateKeeper
4+
public: true
95

106
gatekeeper:
11-
class: '%gatekeeper.class%'
7+
alias: GateKeeper\GateKeeper
8+
deprecated: true
129
public: true
1310

1411
gatekeeper.repository.dummy:
@@ -19,18 +16,18 @@ services:
1916

2017
gatekeeper.voter:
2118
class: GateKeeperBundle\Voter\GateKeeper
22-
arguments: ["@gatekeeper"]
19+
arguments: ['@GateKeeper\GateKeeper']
2320
tags:
2421
- { name: security.voter }
2522

2623
gatekeeper.access.allow:
2724
public: false
28-
class: '%gatekeeper.access.allow.class%'
25+
class: GateKeeperBundle\Access\Allow
2926
tags:
3027
- { name: gatekeeper.access }
3128

3229
gatekeeper.access.deny:
3330
public: false
34-
class: '%gatekeeper.access.deny.class%'
31+
class: GateKeeperBundle\Access\Deny
3532
tags:
3633
- { name: gatekeeper.access }

0 commit comments

Comments
 (0)