cs: Switch to a stricter way of coding - this might break in a lot of places.

This commit is contained in:
Pol Dellaiera 2021-11-30 13:33:18 +01:00
parent 28d2c42454
commit 47c5855a21
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
957 changed files with 9025 additions and 568 deletions

View File

@ -21,11 +21,7 @@ $config
$rules = $config->getRules(); $rules = $config->getRules();
$riskyRules = [ $riskyRules = [
'final_internal_class' => false,
'strict_param' => false,
'declare_strict_types' => false,
'ternary_to_elvis_operator' => false, 'ternary_to_elvis_operator' => false,
'strict_comparison' => false,
'php_unit_mock_short_will_return' => false, 'php_unit_mock_short_will_return' => false,
'php_unit_set_up_tear_down_visibility' => false, 'php_unit_set_up_tear_down_visibility' => false,
'php_unit_construct' => false, 'php_unit_construct' => false,
@ -36,6 +32,10 @@ $riskyRules = [
'php_unit_no_expectation_annotation' => false, 'php_unit_no_expectation_annotation' => false,
'php_unit_test_case_static_method_calls' => false, 'php_unit_test_case_static_method_calls' => false,
'php_unit_test_annotation' => false, 'php_unit_test_annotation' => false,
// 'final_internal_class' => false,
// 'strict_param' => false,
// 'declare_strict_types' => false,
// 'strict_comparison' => false,
// 'no_unreachable_default_argument_value' => false, // 'no_unreachable_default_argument_value' => false,
// 'ereg_to_preg' => false, // 'ereg_to_preg' => false,
// 'ordered_interfaces' => false, // 'ordered_interfaces' => false,

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Export\Filter; namespace Chill\PersonBundle\Export\Filter;
use Chill\MainBundle\Export\ExportElementValidatedInterface; use Chill\MainBundle\Export\ExportElementValidatedInterface;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Export\Export; namespace Chill\PersonBundle\Export\Export;
use Chill\MainBundle\Export\ExportInterface; use Chill\MainBundle\Export\ExportInterface;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MyBundle\Controller; namespace Chill\MyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\HealthBundle\Controller; namespace Chill\HealthBundle\Controller;
use Chill\HealthBundle\Security\Authorization\ConsultationVoter; use Chill\HealthBundle\Security\Authorization\ConsultationVoter;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\DependencyInjection; namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait; use Chill\MainBundle\DependencyInjection\Widget\AddWidgetConfigurationTrait;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\MainBundle\DependencyInjection; namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface; use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Widget; namespace Chill\PersonBundle\Widget;
use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory; use Chill\MainBundle\DependencyInjection\Widget\Factory\AbstractWidgetFactory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\Widget; namespace Chill\PersonBundle\Widget;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Authorization\AuthorizationHelper;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\PersonBundle\DependencyInjection; namespace Chill\PersonBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerBuilder;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle; namespace Chill\ActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\Bundle\Bundle;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Entity\ActivityReasonCategory; use Chill\ActivityBundle\Entity\ActivityReasonCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Controller; namespace Chill\ActivityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityReasonCategory; use Chill\ActivityBundle\Entity\ActivityReasonCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Entity\ActivityType;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Chill\ActivityBundle\Entity\ActivityTypeCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DataFixtures\ORM; namespace Chill\ActivityBundle\DataFixtures\ORM;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
@ -48,7 +57,7 @@ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterfac
case 'administrative': case 'administrative':
case 'direction': case 'direction':
if (in_array($scope->getName()['en'], ['administrative', 'social'])) { if (in_array($scope->getName()['en'], ['administrative', 'social'], true)) {
break 2; // we do not want any power on social or administrative break 2; // we do not want any power on social or administrative
} }

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DependencyInjection; namespace Chill\ActivityBundle\DependencyInjection;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\DependencyInjection; namespace Chill\ActivityBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Chill\ActivityBundle\Validator\Constraints as ActivityValidator; use Chill\ActivityBundle\Validator\Constraints as ActivityValidator;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Entity; namespace Chill\ActivityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Export\Aggregator; namespace Chill\ActivityBundle\Export\Aggregator;
use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter; use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;

View File

@ -206,7 +206,7 @@ class ListActivity implements ListInterface
->setParameter('authorized_centers', $centers); ->setParameter('authorized_centers', $centers);
foreach ($this->fields as $f) { foreach ($this->fields as $f) {
if (in_array($f, $data['fields'])) { if (in_array($f, $data['fields'], true)) {
switch ($f) { switch ($f) {
case 'id': case 'id':
$qb->addSelect('activity.id AS id'); $qb->addSelect('activity.id AS id');

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityPresence; use Chill\ActivityBundle\Entity\ActivityPresence;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Form\Type\TranslatableStringFormType;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory; use Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
@ -385,7 +394,7 @@ class ActivityType extends AbstractType
// test if the timestamp is in the choices. // test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp // If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) { if (!in_array($data->getTimestamp(), $timeChoices, true)) {
// the data are not in the possible values. add them // the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp(); $timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create($fieldName, ChoiceType::class, array_merge( $form = $builder->create($fieldName, ChoiceType::class, array_merge(

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Chill\ActivityBundle\Entity\ActivityTypeCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form; namespace Chill\ActivityBundle\Form;
use Chill\ActivityBundle\Entity\ActivityTypeCategory; use Chill\ActivityBundle\Entity\ActivityTypeCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form\Type; namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityType; use Chill\ActivityBundle\Entity\ActivityType;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form\Type; namespace Chill\ActivityBundle\Form\Type;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Form\Type; namespace Chill\ActivityBundle\Form\Type;
use Doctrine\ORM\EntityRepository; use Doctrine\ORM\EntityRepository;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Menu; namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;

View File

@ -31,7 +31,7 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface
return; return;
} }
if (in_array($menuId, ['admin_index', 'admin_section'])) { if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Activities', [ $menu->addChild('Activities', [
'route' => 'chill_admin_activity_index', 'route' => 'chill_admin_activity_index',
]) ])

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Menu; namespace Chill\ActivityBundle\Menu;
use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\ActivityBundle\Security\Authorization\ActivityVoter;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Notification; namespace Chill\ActivityBundle\Notification;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
@ -26,6 +35,6 @@ final class ActivityNotificationRenderer
public function supports(Notification $notification, array $options = []): bool public function supports(Notification $notification, array $options = []): bool
{ {
return $notification->getRelatedEntityClass() == Activity::class; return $notification->getRelatedEntityClass() === Activity::class;
} }
} }

View File

@ -160,7 +160,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte
foreach ($reachableCenters as $center) { foreach ($reachableCenters as $center) {
// we pass if not in centers // we pass if not in centers
if (!in_array($center, $args['centers'])) { if (!in_array($center, $args['centers'], true)) {
continue; continue;
} }
// we get all the reachable scopes for this center // we get all the reachable scopes for this center

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Repository; namespace Chill\ActivityBundle\Repository;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Kernel;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Composer\Autoload\ClassLoader; use Composer\Autoload\ClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry; use Doctrine\Common\Annotations\AnnotationRegistry;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException; use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Symfony\Component\Debug\Debug; use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -18,7 +27,7 @@ use Symfony\Component\HttpFoundation\Request;
// Feel free to remove this, extend it, or make something more sophisticated. // Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP']) if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR']) || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || \PHP_SAPI === 'cli-server') || !(in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1'], true) || \PHP_SAPI === 'cli-server')
) { ) {
header('HTTP/1.0 403 Forbidden'); header('HTTP/1.0 403 Forbidden');

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Security\Authorization; namespace Chill\ActivityBundle\Security\Authorization;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
@ -63,7 +72,7 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar
protected function supports($attribute, $subject) protected function supports($attribute, $subject)
{ {
if ($subject instanceof Center if ($subject instanceof Center
&& in_array($attribute, $this->getAttributes())) { && in_array($attribute, $this->getAttributes(), true)) {
return true; return true;
} }

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Templating\Entity; namespace Chill\ActivityBundle\Templating\Entity;
use Chill\ActivityBundle\Entity\ActivityReason; use Chill\ActivityBundle\Entity\ActivityReason;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Test; namespace Chill\ActivityBundle\Test;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use RuntimeException; use RuntimeException;
@ -19,11 +28,11 @@ use function in_array;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityControllerTest extends WebTestCase final class ActivityControllerTest extends WebTestCase
{ {
public function getSecuredPagesAuthenticated() public function getSecuredPagesAuthenticated()
{ {
static::bootKernel(); self::bootKernel();
$person = $this->getPersonFromFixtures(); $person = $this->getPersonFromFixtures();
$activities = $this->getActivitiesForPerson($person); $activities = $this->getActivitiesForPerson($person);
@ -59,7 +68,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
public function getSecuredPagesUnauthenticated() public function getSecuredPagesUnauthenticated()
{ {
static::bootKernel(); self::bootKernel();
$person = $this->getPersonFromFixtures(); $person = $this->getPersonFromFixtures();
$activities = $this->getActivitiesForPerson($person); $activities = $this->getActivitiesForPerson($person);
@ -202,7 +211,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function createFakeUser() private function createFakeUser()
{ {
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$em = $container->get('doctrine.orm.entity_manager'); $em = $container->get('doctrine.orm.entity_manager');
//get the social PermissionGroup, and remove CHILL_ACTIVITY_* //get the social PermissionGroup, and remove CHILL_ACTIVITY_*
@ -244,7 +253,7 @@ class ActivityControllerTest extends WebTestCase
private function getActivitiesForPerson(\Chill\PersonBundle\Entity\Person $person) private function getActivitiesForPerson(\Chill\PersonBundle\Entity\Person $person)
{ {
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
$activities = $em->getRepository('ChillActivityBundle:Activity') $activities = $em->getRepository('ChillActivityBundle:Activity')
@ -265,7 +274,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getAuthenticatedClient($username = 'center a_social') private function getAuthenticatedClient($username = 'center a_social')
{ {
return static::createClient([], [ return self::createClient([], [
'PHP_AUTH_USER' => $username, 'PHP_AUTH_USER' => $username,
'PHP_AUTH_PW' => 'password', 'PHP_AUTH_PW' => 'password',
]); ]);
@ -276,7 +285,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getPersonFromFixtures() private function getPersonFromFixtures()
{ {
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
$person = $em->getRepository('ChillPersonBundle:Person') $person = $em->getRepository('ChillPersonBundle:Person')
@ -300,14 +309,14 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getRandomActivityReason(array $excludeIds = []) private function getRandomActivityReason(array $excludeIds = [])
{ {
$reasons = static::$kernel->getContainer() $reasons = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillActivityBundle:ActivityReason') ->getRepository('ChillActivityBundle:ActivityReason')
->findAll(); ->findAll();
$reason = $reasons[array_rand($reasons)]; $reason = $reasons[array_rand($reasons)];
if (in_array($reason->getId(), $excludeIds)) { if (in_array($reason->getId(), $excludeIds, true)) {
return $this->getRandomActivityReason($excludeIds); return $this->getRandomActivityReason($excludeIds);
} }
@ -319,7 +328,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getRandomActivityType() private function getRandomActivityType()
{ {
$types = static::$kernel->getContainer() $types = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillActivityBundle:ActivityType') ->getRepository('ChillActivityBundle:ActivityType')
->findAll(); ->findAll();
@ -335,7 +344,7 @@ class ActivityControllerTest extends WebTestCase
*/ */
private function getRandomScope($username, $centerName) private function getRandomScope($username, $centerName)
{ {
$user = static::$kernel->getContainer() $user = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillMainBundle:User') ->getRepository('ChillMainBundle:User')
->findOneByUsername($username); ->findOneByUsername($username);
@ -345,20 +354,20 @@ class ActivityControllerTest extends WebTestCase
. 'does not exists in database. Did you add fixtures ?'); . 'does not exists in database. Did you add fixtures ?');
} }
$center = static::$kernel->getContainer() $center = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager') ->get('doctrine.orm.entity_manager')
->getRepository('ChillMainBundle:Center') ->getRepository('ChillMainBundle:Center')
->findOneByName($centerName); ->findOneByName($centerName);
// get scope reachable by both role UPDATE and DELETE // get scope reachable by both role UPDATE and DELETE
$reachableScopesUpdate = static::$kernel->getContainer() $reachableScopesUpdate = self::$kernel->getContainer()
->get('chill.main.security.authorization.helper') ->get('chill.main.security.authorization.helper')
->getReachableScopes( ->getReachableScopes(
$user, $user,
new Role('CHILL_ACTIVITY_UPDATE'), new Role('CHILL_ACTIVITY_UPDATE'),
$center $center
); );
$reachableScopesDelete = static::$kernel->getContainer() $reachableScopesDelete = self::$kernel->getContainer()
->get('chill.main.security.authorization.helper') ->get('chill.main.security.authorization.helper')
->getReachableScopes( ->getReachableScopes(
$user, $user,
@ -376,7 +385,7 @@ class ActivityControllerTest extends WebTestCase
} }
foreach ($reachableScopesUpdate as $scope) { foreach ($reachableScopesUpdate as $scope) {
if (in_array($scope->getId(), $reachableScopesId)) { if (in_array($scope->getId(), $reachableScopesId, true)) {
$reachableScopes[] = $scope; $reachableScopes[] = $scope;
} }
} }

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonCategoryControllerTest extends WebTestCase final class ActivityReasonCategoryControllerTest extends WebTestCase
{ {
public function testToWrite() public function testToWrite()
{ {

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonControllerTest extends WebTestCase final class ActivityReasonControllerTest extends WebTestCase
{ {
public function testToWrite() public function testToWrite()
{ {

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Controller; namespace Chill\ActivityBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityTypeControllerTest extends WebTestCase final class ActivityTypeControllerTest extends WebTestCase
{ {
public function testToWrite() public function testToWrite()
{ {

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Aggregator; namespace Chill\ActivityBundle\Tests\Aggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
@ -17,7 +26,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonAggregatorTest extends AbstractAggregatorTest final class ActivityReasonAggregatorTest extends AbstractAggregatorTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator * @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator
@ -26,9 +35,9 @@ class ActivityReasonAggregatorTest extends AbstractAggregatorTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->aggregator = $container->get('chill.activity.export.reason_aggregator'); $this->aggregator = $container->get('chill.activity.export.reason_aggregator');
@ -57,11 +66,11 @@ class ActivityReasonAggregatorTest extends AbstractAggregatorTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Aggregator; namespace Chill\ActivityBundle\Tests\Aggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
@ -17,7 +26,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityTypeAggregatorTest extends AbstractAggregatorTest final class ActivityTypeAggregatorTest extends AbstractAggregatorTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator * @var \Chill\ActivityBundle\Export\Aggregator\ActivityReasonAggregator
@ -26,9 +35,9 @@ class ActivityTypeAggregatorTest extends AbstractAggregatorTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->aggregator = $container->get('chill.activity.export.type_aggregator'); $this->aggregator = $container->get('chill.activity.export.type_aggregator');
@ -56,11 +65,11 @@ class ActivityTypeAggregatorTest extends AbstractAggregatorTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Aggregator; namespace Chill\ActivityBundle\Tests\Aggregator;
use Chill\MainBundle\Test\Export\AbstractAggregatorTest; use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
@ -17,7 +26,7 @@ use Chill\MainBundle\Test\Export\AbstractAggregatorTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityUserAggregatorTest extends AbstractAggregatorTest final class ActivityUserAggregatorTest extends AbstractAggregatorTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator * @var \Chill\ActivityBundle\Export\Aggregator\ActivityUserAggregator
@ -26,9 +35,9 @@ class ActivityUserAggregatorTest extends AbstractAggregatorTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->aggregator = $container->get('chill.activity.export.user_aggregator'); $this->aggregator = $container->get('chill.activity.export.user_aggregator');
@ -56,11 +65,11 @@ class ActivityUserAggregatorTest extends AbstractAggregatorTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Export\Export; namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest; use Chill\MainBundle\Test\Export\AbstractExportTest;
@ -15,7 +24,7 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class CountActivityTest extends AbstractExportTest final class CountActivityTest extends AbstractExportTest
{ {
/** /**
* @var * @var
@ -24,7 +33,7 @@ class CountActivityTest extends AbstractExportTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
$container = self::$kernel->getContainer(); $container = self::$kernel->getContainer();

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Export\Export; namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest; use Chill\MainBundle\Test\Export\AbstractExportTest;
@ -15,7 +24,7 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ListActivityTest extends AbstractExportTest final class ListActivityTest extends AbstractExportTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Export\ListActivity * @var \Chill\ActivityBundle\Export\Export\ListActivity
@ -24,7 +33,7 @@ class ListActivityTest extends AbstractExportTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
$container = self::$kernel->getContainer(); $container = self::$kernel->getContainer();

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Export\Export; namespace Chill\ActivityBundle\Tests\Export\Export;
use Chill\MainBundle\Test\Export\AbstractExportTest; use Chill\MainBundle\Test\Export\AbstractExportTest;
@ -17,7 +26,7 @@ use Chill\MainBundle\Test\Export\AbstractExportTest;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class StatActivityDurationSumTest extends AbstractExportTest final class StatActivityDurationSumTest extends AbstractExportTest
{ {
/** /**
* @var \Chill\ActivityBundle\Export\Export\StatActivityDuration * @var \Chill\ActivityBundle\Export\Export\StatActivityDuration
@ -26,7 +35,7 @@ class StatActivityDurationSumTest extends AbstractExportTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
/** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */ /** @var \Symfony\Component\DependencyInjection\ContainerInterface $container */
$container = self::$kernel->getContainer(); $container = self::$kernel->getContainer();

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Filter; namespace Chill\ActivityBundle\Tests\Filter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
@ -16,7 +25,7 @@ use Doctrine\Common\Collections\ArrayCollection;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityReasonFilterTest extends AbstractFilterTest final class ActivityReasonFilterTest extends AbstractFilterTest
{ {
/** /**
* @var \Chill\PersonBundle\Export\Filter\GenderFilter * @var \Chill\PersonBundle\Export\Filter\GenderFilter
@ -25,9 +34,9 @@ class ActivityReasonFilterTest extends AbstractFilterTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->filter = $container->get('chill.activity.export.reason_filter'); $this->filter = $container->get('chill.activity.export.reason_filter');
@ -48,11 +57,11 @@ class ActivityReasonFilterTest extends AbstractFilterTest
public function getFormData() public function getFormData()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
$reasons = $em->createQuery('SELECT reason ' $reasons = $em->createQuery('SELECT reason '
@ -69,11 +78,11 @@ class ActivityReasonFilterTest extends AbstractFilterTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Filter; namespace Chill\ActivityBundle\Tests\Filter;
use Chill\MainBundle\Test\Export\AbstractFilterTest; use Chill\MainBundle\Test\Export\AbstractFilterTest;
@ -17,7 +26,7 @@ use function array_slice;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
{ {
/** /**
* @var \Chill\PersonBundle\Export\Filter\PersonHavingActivityBetweenDateFilter * @var \Chill\PersonBundle\Export\Filter\PersonHavingActivityBetweenDateFilter
@ -26,9 +35,9 @@ class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$container = static::$kernel->getContainer(); $container = self::$kernel->getContainer();
$this->filter = $container->get('chill.activity.export.' $this->filter = $container->get('chill.activity.export.'
. 'person_having_an_activity_between_date_filter'); . 'person_having_an_activity_between_date_filter');
@ -69,11 +78,11 @@ class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
public function getQueryBuilders() public function getQueryBuilders()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
$em = static::$kernel->getContainer() $em = self::$kernel->getContainer()
->get('doctrine.orm.entity_manager'); ->get('doctrine.orm.entity_manager');
return [ return [
@ -98,11 +107,11 @@ class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest
*/ */
private function getActivityReasons() private function getActivityReasons()
{ {
if (null === static::$kernel) { if (null === self::$kernel) {
static::bootKernel(); self::bootKernel();
} }
return static::$kernel->getContainer() return self::$kernel->getContainer()
->get('chill_activity.repository.reason') ->get('chill_activity.repository.reason')
->findAll(); ->findAll();
} }

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Form; namespace Chill\ActivityBundle\Tests\Form;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;
@ -21,7 +30,7 @@ use Symfony\Component\Security\Core\Role\Role;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityTypeTest extends KernelTestCase final class ActivityTypeTest extends KernelTestCase
{ {
/** /**
* @var \Chill\MainBundle\Entity\Center * @var \Chill\MainBundle\Entity\Center

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Form\Type; namespace Chill\ActivityBundle\Tests\Form\Type;
use Chill\ActivityBundle\Form\Type\TranslatableActivityReason; use Chill\ActivityBundle\Form\Type\TranslatableActivityReason;
@ -20,7 +29,7 @@ use Symfony\Component\Form\Test\TypeTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class TranslatableActivityReasonTest extends TypeTestCase final class TranslatableActivityReasonTest extends TypeTestCase
{ {
/** /**
* @var Prophecy\Prophet * @var Prophecy\Prophet

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Form\Type; namespace Chill\ActivityBundle\Tests\Form\Type;
use Chill\ActivityBundle\Form\Type\TranslatableActivityType; use Chill\ActivityBundle\Form\Type\TranslatableActivityType;
@ -17,7 +26,7 @@ use Symfony\Component\Form\Extension\Core\Type\FormType;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class TranslatableActivityTypeTest extends KernelTestCase final class TranslatableActivityTypeTest extends KernelTestCase
{ {
/** /**
* @var \Symfony\Component\Form\FormBuilderInterface * @var \Symfony\Component\Form\FormBuilderInterface

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Security\Authorization; namespace Chill\ActivityBundle\Tests\Security\Authorization;
use Chill\ActivityBundle\Test\PrepareActivityTrait; use Chill\ActivityBundle\Test\PrepareActivityTrait;
@ -24,7 +33,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class ActivityVoterTest extends KernelTestCase final class ActivityVoterTest extends KernelTestCase
{ {
use PrepareActivityTrait; use PrepareActivityTrait;
use PrepareCenterTrait; use PrepareCenterTrait;
@ -44,8 +53,8 @@ class ActivityVoterTest extends KernelTestCase
public function setUp() public function setUp()
{ {
static::bootKernel(); self::bootKernel();
$this->voter = static::$kernel->getContainer() $this->voter = self::$kernel->getContainer()
->get('chill.activity.security.authorization.activity_voter'); ->get('chill.activity.security.authorization.activity_voter');
$this->prophet = new \Prophecy\Prophet(); $this->prophet = new \Prophecy\Prophet();
} }

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Tests\Timeline; namespace Chill\ActivityBundle\Tests\Timeline;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@ -15,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class TimelineProviderTest extends WebTestCase final class TimelineProviderTest extends WebTestCase
{ {
public function testAnActivityIsShownOnTimeline() public function testAnActivityIsShownOnTimeline()
{ {

View File

@ -119,7 +119,7 @@ class TimelineActivityProvider implements TimelineProviderInterface
*/ */
private function checkContext(string $context) private function checkContext(string $context)
{ {
if (false === in_array($context, self::SUPPORTED_CONTEXTS)) { if (false === in_array($context, self::SUPPORTED_CONTEXTS, true)) {
throw new LogicException( throw new LogicException(
sprintf( sprintf(
"The context '%s' is not supported. Currently only 'person' is supported", "The context '%s' is not supported. Currently only 'person' is supported",
@ -160,7 +160,7 @@ class TimelineActivityProvider implements TimelineProviderInterface
// loop on reachable scopes // loop on reachable scopes
foreach ($reachableScopes as $scope) { foreach ($reachableScopes as $scope) {
if (in_array($scope->getId(), $scopes_ids)) { if (in_array($scope->getId(), $scopes_ids, true)) {
continue; continue;
} }
$scopes_ids[] = '?'; $scopes_ids[] = '?';

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Validator\Constraints; namespace Chill\ActivityBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\Constraint;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\ActivityBundle\Validator\Constraints; namespace Chill\ActivityBundle\Validator\Constraints;
use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Entity\Activity;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Activity; namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
@ -20,7 +29,7 @@ class Version20150701091248 extends AbstractMigration
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
// this down() migration is auto-generated, please modify it to your needs // this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE Activity DROP CONSTRAINT FK_55026B0C59BB1592'); $this->addSql('ALTER TABLE Activity DROP CONSTRAINT FK_55026B0C59BB1592');
$this->addSql('ALTER TABLE ActivityReason DROP CONSTRAINT FK_654A2FCD12469DE2'); $this->addSql('ALTER TABLE ActivityReason DROP CONSTRAINT FK_654A2FCD12469DE2');
@ -38,7 +47,7 @@ class Version20150701091248 extends AbstractMigration
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
// this up() migration is auto-generated, please modify it to your needs // this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SEQUENCE Activity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE Activity_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE ActivityReason_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE ActivityReason_id_seq INCREMENT BY 1 MINVALUE 1 START 1');

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Activity; namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
@ -20,7 +29,7 @@ class Version20150702093317 extends AbstractMigration
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
// this down() migration is auto-generated, please modify it to your needs // this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN name;'); $this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN name;');
$this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN label VARCHAR(255) NOT NULL;'); $this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN label VARCHAR(255) NOT NULL;');
@ -33,7 +42,7 @@ class Version20150702093317 extends AbstractMigration
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
// this up() migration is auto-generated, please modify it to your needs // this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN label;'); $this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN label;');
$this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN name JSON;'); $this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN name JSON;');

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Activity; namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
@ -20,7 +29,7 @@ class Version20150704091347 extends AbstractMigration
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
// this down() migration is auto-generated, please modify it to your needs // this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE Activity ALTER COLUMN remark SET NOT NULL;'); $this->addSql('ALTER TABLE Activity ALTER COLUMN remark SET NOT NULL;');
$this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;');
@ -29,7 +38,7 @@ class Version20150704091347 extends AbstractMigration
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
// this up() migration is auto-generated, please modify it to your needs // this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE Activity ALTER COLUMN remark DROP NOT NULL;'); $this->addSql('ALTER TABLE Activity ALTER COLUMN remark DROP NOT NULL;');
$this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;');

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Activity; namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;
@ -23,7 +32,7 @@ class Version20160222103457 extends AbstractMigration
public function down(Schema $schema): void public function down(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() !== 'postgresql',
'Migration can only be executed safely on \'postgresql\'.' 'Migration can only be executed safely on \'postgresql\'.'
); );
@ -50,7 +59,7 @@ class Version20160222103457 extends AbstractMigration
public function up(Schema $schema): void public function up(Schema $schema): void
{ {
$this->abortIf( $this->abortIf(
$this->connection->getDatabasePlatform()->getName() != 'postgresql', $this->connection->getDatabasePlatform()->getName() !== 'postgresql',
'Migration can only be executed safely on \'postgresql\'.' 'Migration can only be executed safely on \'postgresql\'.'
); );

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Activity; namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Schema;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Controller; namespace Chill\AsideActivityBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController; use Chill\MainBundle\CRUD\Controller\CRUDController;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\DataFixtures\ORM; namespace Chill\AsideActivityBundle\DataFixtures\ORM;
use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivity;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\DataFixtures\ORM; namespace Chill\AsideActivityBundle\DataFixtures\ORM;
use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Chill\AsideActivityBundle\Entity\AsideActivityCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\DependencyInjection; namespace Chill\AsideActivityBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Form; namespace Chill\AsideActivityBundle\Form;
use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivity;
@ -143,7 +152,7 @@ final class AsideActivityFormType extends AbstractType
// test if the timestamp is in the choices. // test if the timestamp is in the choices.
// If not, recreate the field with the new timestamp // If not, recreate the field with the new timestamp
if (!in_array($data->getTimestamp(), $timeChoices)) { if (!in_array($data->getTimestamp(), $timeChoices, true)) {
// the data are not in the possible values. add them // the data are not in the possible values. add them
$timeChoices[$data->format('H:i')] = $data->getTimestamp(); $timeChoices[$data->format('H:i')] = $data->getTimestamp();
$form = $builder->create($fieldName, ChoiceType::class, array_merge( $form = $builder->create($fieldName, ChoiceType::class, array_merge(

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Menu; namespace Chill\AsideActivityBundle\Menu;
use Knp\Menu\MenuItem; use Knp\Menu\MenuItem;
@ -29,7 +38,7 @@ final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuild
return; return;
} }
if (in_array($menuId, ['admin_index', 'admin_section'])) { if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Aside activities', [ $menu->addChild('Aside activities', [
'route' => 'chill_crud_aside_activity_category_index', 'route' => 'chill_crud_aside_activity_category_index',
]) ])

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Menu; namespace Chill\AsideActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\MainBundle\Routing\LocalMenuBuilderInterface;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Menu; namespace Chill\AsideActivityBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\MainBundle\Routing\LocalMenuBuilderInterface;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Templating\Entity; namespace Chill\AsideActivityBundle\Templating\Entity;
use Chill\AsideActivityBundle\Entity\AsideActivityCategory; use Chill\AsideActivityBundle\Entity\AsideActivityCategory;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Tests\Controller; namespace Chill\AsideActivityBundle\Tests\Controller;
use Chill\AsideActivityBundle\Entity\AsideActivity; use Chill\AsideActivityBundle\Entity\AsideActivity;
@ -20,7 +29,7 @@ use function shuffle;
* @internal * @internal
* @coversNothing * @coversNothing
*/ */
class AsideActivityControllerTest extends WebTestCase final class AsideActivityControllerTest extends WebTestCase
{ {
use PrepareClientTrait; use PrepareClientTrait;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Calculator; namespace Chill\AMLI\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement; use Chill\AMLI\BudgetBundle\Entity\AbstractElement;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Calculator; namespace Chill\AMLI\BudgetBundle\Calculator;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement; use Chill\AMLI\BudgetBundle\Entity\AbstractElement;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Calculator; namespace Chill\AMLI\BudgetBundle\Calculator;
class CalculatorResult class CalculatorResult

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle; namespace Chill\AMLI\BudgetBundle;
use Chill\AMLI\BudgetBundle\DependencyInjection\Compiler\CalculatorCompilerPass; use Chill\AMLI\BudgetBundle\DependencyInjection\Compiler\CalculatorCompilerPass;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Config; namespace Chill\AMLI\BudgetBundle\Config;
class ConfigRepository class ConfigRepository

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Controller; namespace Chill\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\AbstractElement; use Chill\AMLI\BudgetBundle\Entity\AbstractElement;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Controller; namespace Chill\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\Charge; use Chill\AMLI\BudgetBundle\Entity\Charge;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Controller; namespace Chill\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Calculator\CalculatorManager; use Chill\AMLI\BudgetBundle\Calculator\CalculatorManager;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\Controller; namespace Chill\AMLI\BudgetBundle\Controller;
use Chill\AMLI\BudgetBundle\Entity\Resource; use Chill\AMLI\BudgetBundle\Entity\Resource;

View File

@ -7,6 +7,15 @@
* the LICENSE file that was distributed with this source code. * the LICENSE file that was distributed with this source code.
*/ */
declare(strict_types=1);
/**
* Chill is a software for social workers.
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AMLI\BudgetBundle\DependencyInjection; namespace Chill\AMLI\BudgetBundle\DependencyInjection;
use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter; use Chill\AMLI\BudgetBundle\Security\Authorization\BudgetElementVoter;

Some files were not shown because too many files have changed in this diff Show More