| @@ -5,8 +5,8 @@ | ||
| 5 | 5 | use Symfony\Component\Config\Definition\Builder\NodeBuilder; | 
| 6 | 6 | use Symfony\Component\DependencyInjection\ContainerBuilder; | 
| 7 | 7 | |
| 8 | -interface CaptchaConfigurator | |
| 9 | -{
 | |
| 8 | +interface CaptchaConfigurator | |
| 9 | +{ | |
| 10 | 10 | public function buildConfiguration(NodeBuilder $node); | 
| 11 | 11 | |
| 12 | 12 | public function configureClient(ContainerBuilder $container, $clientServiceKey, array $options = []); | 
| @@ -33,14 +33,15 @@ discard block | ||
| 33 | 33 | $this->container = $container; | 
| 34 | 34 | } | 
| 35 | 35 | |
| 36 | -    private function checkOptions(array $object, $field){ | |
| 37 | -        if(!isset($object['fields']) || !isset($object['fields'][$field])){ | |
| 36 | + private function checkOptions(array $object, $field) | |
| 37 | +    { | |
| 38 | +        if(!isset($object['fields']) || !isset($object['fields'][$field])) { | |
| 38 | 39 | return false; | 
| 39 | 40 | } | 
| 40 | 41 | |
| 41 | 42 | $fields = ['class', 'type']; | 
| 42 | -        foreach($fields as $type){ | |
| 43 | -            if(!isset($object['fields'][$field][$type])){ | |
| 43 | +        foreach($fields as $type) { | |
| 44 | +            if(!isset($object['fields'][$field][$type])) { | |
| 44 | 45 |                  $object['ields'][$field][$type] = constant('self::DEFAULT_'.strtoupper($type)); | 
| 45 | 46 | } | 
| 46 | 47 | } | 
| @@ -55,22 +56,22 @@ discard block | ||
| 55 | 56 |          $entities = $this->container->getParameter('sludio_helper.translatable.entities'); | 
| 56 | 57 | $entity = null; | 
| 57 | 58 | $className = $admin->getClass(); | 
| 58 | -        foreach($entities as $key => &$entity){ | |
| 59 | +        foreach($entities as $key => &$entity) { | |
| 59 | 60 | $entity['name'] = $key; | 
| 60 | -            if($entity['entity'] === $className){ | |
| 61 | +            if($entity['entity'] === $className) { | |
| 61 | 62 | break; | 
| 62 | 63 | } | 
| 63 | 64 | } | 
| 64 | 65 | |
| 65 | 66 | $under = 'sludio_helper.extensions.translatable.entities'; | 
| 66 | -        if($entity === null || $entity['entity'] !== $className){ | |
| 67 | +        if($entity === null || $entity['entity'] !== $className) { | |
| 67 | 68 |              throw new \Exception('Entity '.$className.' not defined under '.$under); | 
| 68 | 69 | } | 
| 69 | 70 | |
| 70 | 71 | $id = $admin->getSubject()->getId(); | 
| 71 | 72 | $fieldName = $builder->getName(); | 
| 72 | 73 | |
| 73 | -        if(!$this->checkOptions($entity, $fieldName)){ | |
| 74 | +        if(!$this->checkOptions($entity, $fieldName)) { | |
| 74 | 75 |              throw new \Exception('No fields defined for '.$className.' under '.$under.'.'.$entity['name']); | 
| 75 | 76 | } | 
| 76 | 77 | |