Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
Deprecated classes & Symfony requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinOnLine committed Nov 1, 2017
1 parent 73ee15d commit 022a1c8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Hydrator/HydrateWithMapTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function hydrateUserWithAttributesMap(
unset($ldapValue['count']);
}

if (count($ldapValue) === 1) {
if (1 === count($ldapValue)) {
$value = array_shift($ldapValue);
} else {
$value = $ldapValue;
Expand Down
2 changes: 1 addition & 1 deletion Ldap/LdapManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function findUserBy(array $criteria)
throw new \Exception('This search can only return a single user');
}

if ($entries['count'] == 0) {
if (0 == $entries['count']) {
return null;
}
$user = $this->hydrator->hydrate($entries[0]);
Expand Down
6 changes: 3 additions & 3 deletions Security/Factory/FormLoginLdapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\Reference;

/**
Expand Down Expand Up @@ -50,7 +50,7 @@ protected function createAuthProvider(ContainerBuilder $container, $id, $userPro
$providerId = $provider.'.'.$id;

$container
->setDefinition($providerId, new DefinitionDecorator($provider))
->setDefinition($providerId, new ChildDefinition($provider))
->replaceArgument(1, $id) // Provider Key
->replaceArgument(2, new Reference($userProviderId)) // User Provider
;
Expand All @@ -62,7 +62,7 @@ protected function createListener(ContainerBuilder $container, $id, $config)
{
$listenerId = 'security.authentication.listener.form';

$listener = new DefinitionDecorator($listenerId);
$listener = new ChildDefinition($listenerId);
$listener->replaceArgument(4, $id);
$listener->replaceArgument(5, $config);

Expand Down
8 changes: 4 additions & 4 deletions Security/Factory/HttpBasicLdapFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\SecurityFactoryInterface;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Reference;

/**
Expand Down Expand Up @@ -58,7 +58,7 @@ protected function createAuthProvider(ContainerBuilder $container, $id, $userPro
$providerId = $provider.'.'.$id;

$container
->setDefinition($providerId, new DefinitionDecorator($provider))
->setDefinition($providerId, new ChildDefinition($provider))
->replaceArgument(1, $id) // Provider Key
->replaceArgument(2, new Reference($userProviderId)) // User Provider
;
Expand All @@ -70,7 +70,7 @@ protected function createListener(ContainerBuilder $container, $id, $entryPointI
{
// listener
$listenerId = 'security.authentication.listener.basic.'.$id;
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.authentication.listener.basic'));
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.basic'));
$listener->replaceArgument(2, $id);
$listener->replaceArgument(3, new Reference($entryPointId));

Expand All @@ -85,7 +85,7 @@ protected function createEntryPoint(ContainerBuilder $container, $id, $config, $

$entryPointId = 'security.authentication.basic_entry_point.'.$id;
$container
->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.basic_entry_point'))
->setDefinition($entryPointId, new ChildDefinition('security.authentication.basic_entry_point'))
->addArgument($config['realm'])
;

Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
"require": {
"php": ">=5.5",
"psr/log": "~1.0",
"symfony/config": "2.3 - 3",
"symfony/dependency-injection": "2.3 - 3",
"symfony/polyfill-php56": "^1.1",
"symfony/security": "2.3 - 3",
"symfony/security-bundle": "2.3 - 3",
"zendframework/zend-ldap": "2.5 - 3"
"symfony/config": "2.3 - 4",
"symfony/dependency-injection": "2.3 - 4",
"symfony/polyfill-php56": "^1.6",
"symfony/security": "2.3 - 4",
"symfony/security-bundle": "2.3 - 4",
"zendframework/zend-ldap": "2.5 - 4"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "@stable",
"fr3d/psr3-message-assertions": "0.1.*",
"friendsofsymfony/user-bundle": "~1.3",
"friendsofsymfony/user-bundle": "~2.0",
"maks3w/phpunit-methods-trait": "^4.6",
"phpunit/phpunit": "^4.6",
"symfony/validator": "2.3 - 3"
"symfony/validator": "2.3 - 4"
},
"suggest": {
"symfony/validator": "Allow pre-validate for existing users before register new ones",
Expand Down

0 comments on commit 022a1c8

Please sign in to comment.