mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-23 15:14:58 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -11,8 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\DependencyInjection;
|
||||
|
||||
use DateInterval;
|
||||
use Exception;
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
|
||||
@@ -24,8 +22,8 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
class Configuration implements ConfigurationInterface
|
||||
{
|
||||
private string $validationBirthdateNotAfterInfos = 'The period before today during which'
|
||||
. ' any birthdate is not allowed. The birthdate is expressed as ISO8601 : '
|
||||
. 'https://en.wikipedia.org/wiki/ISO_8601#Durations';
|
||||
.' any birthdate is not allowed. The birthdate is expressed as ISO8601 : '
|
||||
.'https://en.wikipedia.org/wiki/ISO_8601#Durations';
|
||||
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
@@ -48,19 +46,19 @@ class Configuration implements ConfigurationInterface
|
||||
->validate()
|
||||
->ifTrue(static function ($period) {
|
||||
try {
|
||||
$interval = new DateInterval($period);
|
||||
} catch (Exception) {
|
||||
$interval = new \DateInterval($period);
|
||||
} catch (\Exception) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
})
|
||||
->thenInvalid('Invalid period for birthdate validation : "%s" '
|
||||
. 'The parameter should match duration as defined by ISO8601 : '
|
||||
. 'https://en.wikipedia.org/wiki/ISO_8601#Durations')
|
||||
.'The parameter should match duration as defined by ISO8601 : '
|
||||
.'https://en.wikipedia.org/wiki/ISO_8601#Durations')
|
||||
->end() // birthdate_not_after, parent = children of validation
|
||||
->end() // children for 'validation', parent = validation
|
||||
->end() //validation, parent = children of root
|
||||
->end() // validation, parent = children of root
|
||||
->end() // children of root, parent = root
|
||||
->booleanNode('create_person_allowed')
|
||||
->defaultTrue()
|
||||
@@ -107,7 +105,7 @@ class Configuration implements ConfigurationInterface
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end() //children for 'person_fields', parent = array 'person_fields'
|
||||
->end() // children for 'person_fields', parent = array 'person_fields'
|
||||
->end() // person_fields, parent = children of root
|
||||
->arrayNode('accompanying_periods_fields')
|
||||
->canBeDisabled()
|
||||
@@ -122,7 +120,7 @@ class Configuration implements ConfigurationInterface
|
||||
->append($this->addFieldNode('anonymous'))
|
||||
->append($this->addFieldNode('emergency'))
|
||||
->append($this->addFieldNode('confidential'))
|
||||
->end() //children for 'accompanying_person_fields', parent = array 'person_fields'
|
||||
->end() // children for 'accompanying_person_fields', parent = array 'person_fields'
|
||||
->end() // paccompanying_person_fields, parent = children of root
|
||||
->booleanNode('allow_multiple_simultaneous_accompanying_periods')
|
||||
->info('Can we have more than one simultaneous accompanying period in the same time. Default false.')
|
||||
|
Reference in New Issue
Block a user