diff --git a/src/Command/KimaiImporterCommand.php b/src/Command/KimaiImporterCommand.php index 0e3315f2..16aab59b 100644 --- a/src/Command/KimaiImporterCommand.php +++ b/src/Command/KimaiImporterCommand.php @@ -344,8 +344,8 @@ class KimaiImporterCommand extends Command */ protected function bytesHumanReadable($size) { - $unit=array('b','kB','MB','GB'); - return @round($size/pow(1024, ($i=floor(log($size, 1024)))), 2).' '.$unit[$i]; + $unit = ['b', 'kB', 'MB', 'GB']; + return @round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . ' ' . $unit[$i]; } /** diff --git a/src/Controller/ProfileController.php b/src/Controller/ProfileController.php index fde12e9f..4b6832a1 100644 --- a/src/Controller/ProfileController.php +++ b/src/Controller/ProfileController.php @@ -270,7 +270,7 @@ class ProfileController extends AbstractController UserPasswordType::class, $user, [ - 'validation_groups' => array('passwordUpdate'), + 'validation_groups' => ['passwordUpdate'], 'action' => $this->generateUrl('user_profile_password', ['username' => $user->getUsername()]), 'method' => 'POST' ] diff --git a/src/DependencyInjection/Compiler/DoctrineCompilerPass.php b/src/DependencyInjection/Compiler/DoctrineCompilerPass.php index 808f5618..8b76e0f1 100644 --- a/src/DependencyInjection/Compiler/DoctrineCompilerPass.php +++ b/src/DependencyInjection/Compiler/DoctrineCompilerPass.php @@ -114,13 +114,13 @@ class DoctrineCompilerPass implements CompilerPassInterface $ormConfig = $container->getDefinition('doctrine.orm.default_configuration'); foreach ($sql['string_functions'] as $name => $function) { - $ormConfig->addMethodCall('addCustomStringFunction', array($name, $function)); + $ormConfig->addMethodCall('addCustomStringFunction', [$name, $function]); } foreach ($sql['numeric_functions'] as $name => $function) { - $ormConfig->addMethodCall('addCustomNumericFunction', array($name, $function)); + $ormConfig->addMethodCall('addCustomNumericFunction', [$name, $function]); } foreach ($sql['datetime_functions'] as $name => $function) { - $ormConfig->addMethodCall('addCustomDatetimeFunction', array($name, $function)); + $ormConfig->addMethodCall('addCustomDatetimeFunction', [$name, $function]); } } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index b91df062..4fd26774 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -52,7 +52,7 @@ class Configuration implements ConfigurationInterface ->end() ->end() ->end() - ->defaultValue(array()) + ->defaultValue([]) ->end() ->arrayNode('rates') @@ -84,27 +84,27 @@ class Configuration implements ConfigurationInterface ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() - ->defaultValue(array( + ->defaultValue([ 'default' => 'App\Controller\InvoiceController::invoiceAction', - )) + ]) ->end() ->arrayNode('calculator') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() - ->defaultValue(array( + ->defaultValue([ 'default' => 'App\Invoice\DefaultCalculator', - )) + ]) ->end() ->arrayNode('number_generator') ->requiresAtLeastOneElement() ->useAttributeAsKey('key') ->isRequired() ->prototype('scalar')->end() - ->defaultValue(array( + ->defaultValue([ 'default' => 'App\Invoice\DateNumberGenerator', - )) + ]) ->end() ->end() ->end() diff --git a/src/Doctrine/TablePrefixSubscriber.php b/src/Doctrine/TablePrefixSubscriber.php index e5f5eab1..e4f85dca 100644 --- a/src/Doctrine/TablePrefixSubscriber.php +++ b/src/Doctrine/TablePrefixSubscriber.php @@ -26,7 +26,7 @@ class TablePrefixSubscriber implements EventSubscriber public function getSubscribedEvents() { - return array('loadClassMetadata'); + return ['loadClassMetadata']; } public function loadClassMetadata(LoadClassMetadataEventArgs $args) diff --git a/src/Doctrine/TimesheetSubscriber.php b/src/Doctrine/TimesheetSubscriber.php index 0335b0c3..95beaad1 100644 --- a/src/Doctrine/TimesheetSubscriber.php +++ b/src/Doctrine/TimesheetSubscriber.php @@ -47,10 +47,10 @@ class TimesheetSubscriber implements EventSubscriber */ public function getSubscribedEvents() { - return array( + return [ 'prePersist', 'preUpdate', - ); + ]; } /** diff --git a/src/Form/Toolbar/AbstractToolbarForm.php b/src/Form/Toolbar/AbstractToolbarForm.php index 2f5f87d7..07f5dae5 100644 --- a/src/Form/Toolbar/AbstractToolbarForm.php +++ b/src/Form/Toolbar/AbstractToolbarForm.php @@ -137,7 +137,7 @@ abstract class AbstractToolbarForm extends AbstractType return; } - $event->getForm()->add('project', ProjectType::class, array( + $event->getForm()->add('project', ProjectType::class, [ 'group_by' => null, 'required' => false, 'query_builder' => function (ProjectRepository $repo) use ($data) { @@ -145,7 +145,7 @@ abstract class AbstractToolbarForm extends AbstractType $qb->where('p.customer = :customer')->setParameter('customer', $data['customer']); return $qb; }, - )); + ]); } ); } @@ -163,7 +163,7 @@ abstract class AbstractToolbarForm extends AbstractType return; } - $event->getForm()->add('activity', ActivityType::class, array( + $event->getForm()->add('activity', ActivityType::class, [ 'group_by' => null, 'required' => false, 'query_builder' => function (ActivityRepository $repo) use ($data) { @@ -171,7 +171,7 @@ abstract class AbstractToolbarForm extends AbstractType $qb->where('a.project = :project')->setParameter('project', $data['project']); return $qb; }, - )); + ]); } ); } diff --git a/src/Form/Type/LanguageType.php b/src/Form/Type/LanguageType.php index b10b4010..6e576ae9 100644 --- a/src/Form/Type/LanguageType.php +++ b/src/Form/Type/LanguageType.php @@ -26,10 +26,10 @@ class LanguageType extends AbstractType public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ - 'choices' => array( + 'choices' => [ Intl::getLocaleBundle()->getLocaleName('de', 'de') => 'de', Intl::getLocaleBundle()->getLocaleName('en', 'en') => 'en', - ) + ] ]); } diff --git a/src/Form/Type/SkinType.php b/src/Form/Type/SkinType.php index 0eb44a83..300bcf28 100644 --- a/src/Form/Type/SkinType.php +++ b/src/Form/Type/SkinType.php @@ -26,7 +26,7 @@ class SkinType extends AbstractType { $resolver->setDefaults([ 'required' => true, - 'choices' => array( + 'choices' => [ 'blue' => 'blue', 'black' => 'black', 'green' => 'green', @@ -39,7 +39,7 @@ class SkinType extends AbstractType 'purple-light' => 'purple-light', 'red-light' => 'red-light', 'yellow-light' => 'yellow-light', - ) + ] ]); } diff --git a/src/Form/Type/UserPreferenceType.php b/src/Form/Type/UserPreferenceType.php index 7645a859..954f211b 100644 --- a/src/Form/Type/UserPreferenceType.php +++ b/src/Form/Type/UserPreferenceType.php @@ -60,8 +60,8 @@ class UserPreferenceType extends AbstractType public function configureOptions(OptionsResolver $resolver) { - $resolver->setDefaults(array( + $resolver->setDefaults([ 'data_class' => UserPreference::class, - )); + ]); } } diff --git a/src/Form/UserCreateType.php b/src/Form/UserCreateType.php index 7211b665..43b819c9 100644 --- a/src/Form/UserCreateType.php +++ b/src/Form/UserCreateType.php @@ -33,8 +33,8 @@ class UserCreateType extends UserEditType ->add('plainPassword', RepeatedType::class, [ 'required' => true, 'type' => PasswordType::class, - 'first_options' => array('label' => 'label.password'), - 'second_options' => array('label' => 'label.password_repeat'), + 'first_options' => ['label' => 'label.password'], + 'second_options' => ['label' => 'label.password_repeat'], ]); parent::buildForm($builder, $options); diff --git a/src/Form/UserPasswordType.php b/src/Form/UserPasswordType.php index ecf96b26..34994038 100644 --- a/src/Form/UserPasswordType.php +++ b/src/Form/UserPasswordType.php @@ -30,8 +30,8 @@ class UserPasswordType extends AbstractType $builder ->add('plainPassword', RepeatedType::class, [ 'type' => PasswordType::class, - 'first_options' => array('label' => 'label.password'), - 'second_options' => array('label' => 'label.password_repeat'), + 'first_options' => ['label' => 'label.password'], + 'second_options' => ['label' => 'label.password_repeat'], ]) ; } diff --git a/src/Form/UserPreferencesForm.php b/src/Form/UserPreferencesForm.php index 5bd6c12b..894f7197 100644 --- a/src/Form/UserPreferencesForm.php +++ b/src/Form/UserPreferencesForm.php @@ -29,7 +29,7 @@ class UserPreferencesForm extends AbstractType { $builder->add('preferences', CollectionType::class, [ 'entry_type' => UserPreferenceType::class, - 'entry_options' => array('label' => false), + 'entry_options' => ['label' => false], 'allow_add' => false, 'allow_delete' => false, 'label' => false, @@ -46,7 +46,6 @@ class UserPreferencesForm extends AbstractType 'csrf_protection' => true, 'csrf_field_name' => '_token', 'csrf_token_id' => 'edit_user_preferences', - ]); } } diff --git a/src/Validator/Constraints/Role.php b/src/Validator/Constraints/Role.php index 4b5a4c2c..fbeba592 100644 --- a/src/Validator/Constraints/Role.php +++ b/src/Validator/Constraints/Role.php @@ -19,9 +19,9 @@ class Role extends Constraint { const ROLE_ERROR = 'xd5hffg-dsfef3-426a-83d7-1f2d33hs5d84'; - protected static $errorNames = array( + protected static $errorNames = [ self::ROLE_ERROR => 'ROLE_ERROR', - ); + ]; public $message = 'This value is not a valid role.'; }