diff --git a/src/API/LDAPApiProviderInterface.php b/src/API/LDAPApiProviderInterface.php index 29cd2649e1bd91102160649d9f22bed41ef6f6ec..396c22654f890c123869f45ed81e82c5de2a213c 100644 --- a/src/API/LDAPApiProviderInterface.php +++ b/src/API/LDAPApiProviderInterface.php @@ -10,19 +10,11 @@ interface LDAPApiProviderInterface { /** * Allows manipulation of the person with a hash array of $attributes at the end of "personFromUserItem". - * - * @param array $attributes - * @param Person $person - * @param bool $full */ public function personFromUserItemPostHook(array $attributes, Person $person, bool $full = false); /** * Allows to fetch a person for a services by service id. - * - * @param string $service - * @param string $serviceID - * @return Person */ public function getPersonForExternalServiceHook(string $service, string $serviceID): Person; } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index c028728ae6c1b6290f8551a5ff59cdb2aa48484b..4cac8a9204fc78392742d5db6cc8145b736e50fb 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Dbp\Relay\LdapPersonProviderBundle\DependencyInjection; +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -19,7 +20,11 @@ class Configuration implements ConfigurationInterface ->scalarNode('person_cache_path')->end() ->scalarNode('ldap_cache_path')->end() ->end(); - $treeBuilder->getRootNode()->append($cacheNode); + + /** @var ArrayNodeDefinition $rootNode */ + $rootNode = $treeBuilder->getRootNode(); + + $rootNode->append($cacheNode); $ldapBuilder = new TreeBuilder('ldap'); $ldapNode = $ldapBuilder->getRootNode() @@ -41,7 +46,7 @@ class Configuration implements ConfigurationInterface ->end(); $ldapNode->append($attributesNode); - $treeBuilder->getRootNode()->append($ldapNode); + $rootNode->append($ldapNode); return $treeBuilder; } diff --git a/src/Service/DummyLDAPApiProvider.php b/src/Service/DummyLDAPApiProvider.php index 2733138a18aba5d71f42f34d0e9b5596e1ef01d3..4ed67b1debf625ca32eb3aa68eb9c608db5f6f8d 100644 --- a/src/Service/DummyLDAPApiProvider.php +++ b/src/Service/DummyLDAPApiProvider.php @@ -21,7 +21,8 @@ class DummyLDAPApiProvider implements LDAPApiProviderInterface // $person->setBirthDate($birthDate); } - public function getPersonForExternalServiceHook(string $service, string $serviceID): Person { + public function getPersonForExternalServiceHook(string $service, string $serviceID): Person + { // For example, you can use the service and serviceID to get the person from some other service. // if ($service === 'SOME-SERVICE') { diff --git a/src/Service/LDAPApi.php b/src/Service/LDAPApi.php index 075855eca13194d9b0fb9bcaacd99352ccd944f3..8caed5a10644ea3a5ca24f1b2732c915d3e63700 100644 --- a/src/Service/LDAPApi.php +++ b/src/Service/LDAPApi.php @@ -23,7 +23,6 @@ use Psr\Cache\CacheItemPoolInterface; use Psr\Container\ContainerInterface; use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareTrait; -use Symfony\Component\Cache\Adapter\FilesystemAdapter; use Symfony\Component\Cache\Psr16Cache; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\HttpFoundation\Response; @@ -267,7 +266,7 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface // Remove all value with numeric keys $attributes = []; - foreach($user->getAttributes() as $key => $value) { + foreach ($user->getAttributes() as $key => $value) { if (!is_numeric($key)) { $attributes[$key] = $value; }