Skip to content
Snippets Groups Projects
Unverified Commit 6e079496 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Fix linter errors

parent 85d3f792
No related branches found
No related tags found
No related merge requests found
Pipeline #64139 passed
...@@ -10,19 +10,11 @@ interface LDAPApiProviderInterface ...@@ -10,19 +10,11 @@ interface LDAPApiProviderInterface
{ {
/** /**
* Allows manipulation of the person with a hash array of $attributes at the end of "personFromUserItem". * 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); public function personFromUserItemPostHook(array $attributes, Person $person, bool $full = false);
/** /**
* Allows to fetch a person for a services by service id. * 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; public function getPersonForExternalServiceHook(string $service, string $serviceID): Person;
} }
...@@ -4,6 +4,7 @@ declare(strict_types=1); ...@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Dbp\Relay\LdapPersonProviderBundle\DependencyInjection; namespace Dbp\Relay\LdapPersonProviderBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\ConfigurationInterface;
...@@ -19,7 +20,11 @@ class Configuration implements ConfigurationInterface ...@@ -19,7 +20,11 @@ class Configuration implements ConfigurationInterface
->scalarNode('person_cache_path')->end() ->scalarNode('person_cache_path')->end()
->scalarNode('ldap_cache_path')->end() ->scalarNode('ldap_cache_path')->end()
->end(); ->end();
$treeBuilder->getRootNode()->append($cacheNode);
/** @var ArrayNodeDefinition $rootNode */
$rootNode = $treeBuilder->getRootNode();
$rootNode->append($cacheNode);
$ldapBuilder = new TreeBuilder('ldap'); $ldapBuilder = new TreeBuilder('ldap');
$ldapNode = $ldapBuilder->getRootNode() $ldapNode = $ldapBuilder->getRootNode()
...@@ -41,7 +46,7 @@ class Configuration implements ConfigurationInterface ...@@ -41,7 +46,7 @@ class Configuration implements ConfigurationInterface
->end(); ->end();
$ldapNode->append($attributesNode); $ldapNode->append($attributesNode);
$treeBuilder->getRootNode()->append($ldapNode); $rootNode->append($ldapNode);
return $treeBuilder; return $treeBuilder;
} }
......
...@@ -21,7 +21,8 @@ class DummyLDAPApiProvider implements LDAPApiProviderInterface ...@@ -21,7 +21,8 @@ class DummyLDAPApiProvider implements LDAPApiProviderInterface
// $person->setBirthDate($birthDate); // $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. // For example, you can use the service and serviceID to get the person from some other service.
// if ($service === 'SOME-SERVICE') { // if ($service === 'SOME-SERVICE') {
......
...@@ -23,7 +23,6 @@ use Psr\Cache\CacheItemPoolInterface; ...@@ -23,7 +23,6 @@ use Psr\Cache\CacheItemPoolInterface;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use Psr\Log\LoggerAwareInterface; use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait; use Psr\Log\LoggerAwareTrait;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache; use Symfony\Component\Cache\Psr16Cache;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
...@@ -267,7 +266,7 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface ...@@ -267,7 +266,7 @@ class LDAPApi implements LoggerAwareInterface, ServiceSubscriberInterface
// Remove all value with numeric keys // Remove all value with numeric keys
$attributes = []; $attributes = [];
foreach($user->getAttributes() as $key => $value) { foreach ($user->getAttributes() as $key => $value) {
if (!is_numeric($key)) { if (!is_numeric($key)) {
$attributes[$key] = $value; $attributes[$key] = $value;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment