mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
cs fixer
This commit is contained in:
parent
fe1fe31b68
commit
75bca46b98
@ -94,7 +94,7 @@ class CountPerson implements ExportInterface
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
// we gather all center the user choose.
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@ -56,7 +56,7 @@ class ChillMainConfiguration implements ConfigurationInterface
|
||||
->end() // end of widgets
|
||||
->end() // end of root/children
|
||||
->end() // end of root
|
||||
;
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
}
|
||||
|
@ -2,6 +2,13 @@
|
||||
|
||||
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 Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
|
||||
use Rector\Config\RectorConfig;
|
||||
use Rector\Set\ValueObject\LevelSetList;
|
||||
|
@ -320,7 +320,6 @@ final class ActivityController extends AbstractController
|
||||
|
||||
private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper
|
||||
{
|
||||
|
||||
$filterBuilder = $this->filterOrderHelperFactory->create(self::class);
|
||||
$types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated);
|
||||
$jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated);
|
||||
@ -679,8 +678,8 @@ final class ActivityController extends AbstractController
|
||||
throw $this->createNotFoundException('Accompanying Period not found');
|
||||
}
|
||||
|
||||
// TODO Add permission
|
||||
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
||||
// TODO Add permission
|
||||
// $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person);
|
||||
} else {
|
||||
throw $this->createNotFoundException('Person or Accompanying Period not found');
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
|
||||
$counter++;
|
||||
}
|
||||
|
||||
foreach ($person->getAccompanyingPeriodParticipations() as $participation) {
|
||||
foreach ($person->getAccompanyingPeriodParticipations() as $participation) {
|
||||
if (!$this->security->isGranted(ActivityVoter::SEE, $participation->getAccompanyingPeriod())) {
|
||||
continue;
|
||||
}
|
||||
|
@ -122,5 +122,4 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
yield [$person, $scopes, true, null, new \DateTimeImmutable("1 week ago"), "content"];
|
||||
yield [$person, [], true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), "content"];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
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\Export\Aggregator;
|
||||
|
||||
use Chill\AsideActivityBundle\Export\Declarations;
|
||||
@ -11,7 +20,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class ByLocationAggregator implements AggregatorInterface
|
||||
{
|
||||
|
||||
public function __construct(private LocationRepository $locationRepository)
|
||||
{
|
||||
}
|
||||
@ -89,4 +97,4 @@ class ByLocationAggregator implements AggregatorInterface
|
||||
{
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,14 @@
|
||||
<?php
|
||||
|
||||
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\Export\Filter;
|
||||
|
||||
use Chill\AsideActivityBundle\Export\Declarations;
|
||||
@ -91,4 +100,4 @@ class ByLocationFilter implements FilterInterface
|
||||
{
|
||||
return Declarations::ASIDE_ACTIVITY_TYPE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,13 @@
|
||||
|
||||
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\AsideActivity;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -65,5 +65,4 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
|
||||
default => throw new UserAbsenceSyncException("this status is not documented by Microsoft")
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -190,6 +190,4 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -172,5 +172,4 @@ class MSUserAbsenceReaderTest extends TestCase
|
||||
"User is absent: absence is always enabled"
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -94,5 +94,4 @@ final readonly class GenericDocForAccompanyingPeriodController
|
||||
]
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -91,5 +91,4 @@ final readonly class GenericDocForPerson
|
||||
]
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,7 +82,6 @@ class FetchQuery implements FetchQueryInterface
|
||||
}
|
||||
|
||||
unset($this->wheres[$index], $this->whereParams[$index], $this->whereTypes[$index]);
|
||||
|
||||
}
|
||||
|
||||
public function removeJoinClause(int $index): void
|
||||
@ -92,7 +91,6 @@ class FetchQuery implements FetchQueryInterface
|
||||
}
|
||||
|
||||
unset($this->joins[$index], $this->joinParams[$index], $this->joinTypes[$index]);
|
||||
|
||||
}
|
||||
|
||||
public function getSelectKeyString(): string
|
||||
|
@ -27,5 +27,4 @@ interface GenericDocForAccompanyingPeriodProviderInterface
|
||||
* Return true if the user is allowed to see some documents for this provider.
|
||||
*/
|
||||
public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool;
|
||||
|
||||
}
|
||||
|
@ -143,5 +143,4 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,5 +46,4 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
|
||||
|
||||
throw new \LogicException("no renderer found");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -20,5 +20,4 @@ interface GenericDocRendererInterface
|
||||
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string;
|
||||
|
||||
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array;
|
||||
|
||||
}
|
||||
|
@ -98,7 +98,6 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
|
||||
continue;
|
||||
}
|
||||
$orPersonId[] = $participation->getPerson()->getId();
|
||||
|
||||
}
|
||||
|
||||
if ([] === $orPersonId) {
|
||||
|
@ -54,9 +54,6 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
|
||||
);
|
||||
self::assertEquals(['foo', 'bar_baz', 'baz'], $params);
|
||||
self::assertEquals([Types::STRING, Types::STRING, Types::STRING], $types);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function testToSqlWithoutWhere(): void
|
||||
@ -85,5 +82,4 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
|
||||
self::assertEquals([], $params);
|
||||
self::assertEquals([], $types);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -142,7 +142,6 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
yield [$period, new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), null];
|
||||
yield [$period, null, null, 'test'];
|
||||
yield [$period, new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), 'test'];
|
||||
|
||||
}
|
||||
|
||||
public function provideDataBuildFetchQueryForPerson(): iterable
|
||||
@ -154,5 +153,4 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
|
||||
yield [null, null, 'test'];
|
||||
yield [new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), 'test'];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -88,7 +88,6 @@ class CronManager implements CronManagerInterface
|
||||
foreach ($orderedJobs as $job) {
|
||||
if ($job->canRun($lasts[$job->getKey()] ?? null)) {
|
||||
if (array_key_exists($job->getKey(), $lasts)) {
|
||||
|
||||
$executionData = $lasts[$job->getKey()]->getLastExecutionData();
|
||||
|
||||
$this->entityManager
|
||||
|
@ -122,7 +122,6 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType
|
||||
foreach ($helper->getUserPickers() as $name => [
|
||||
'label' => $label, 'options' => $opts
|
||||
]) {
|
||||
|
||||
$userPickersBuilder->add(
|
||||
$name,
|
||||
PickUserDynamicType::class,
|
||||
@ -136,7 +135,6 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType
|
||||
|
||||
$builder->add($userPickersBuilder);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function buildCheckboxChoices(array $choices, array $trans = []): array
|
||||
|
@ -65,7 +65,6 @@ class CronJobDatabaseInteractionTest extends KernelTestCase
|
||||
// run a second time
|
||||
$manager->run();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class JobWithReturn implements CronJobInterface
|
||||
|
@ -64,5 +64,4 @@ class CollateAddressWithReferenceOrPostalCodeCronJobTest extends TestCase
|
||||
yield [new \DateTimeImmutable('2023-07-10T12:00:00'), new \DateTimeImmutable('2023-07-01T12:00:00'), true];
|
||||
yield [new \DateTimeImmutable('2023-07-10T12:00:00'), null, true];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -47,11 +47,9 @@ class RelationshipNoDuplicateValidator extends ConstraintValidator
|
||||
|
||||
foreach ($relationships as $r) {
|
||||
if (spl_object_hash($r) !== spl_object_hash($value)
|
||||
and
|
||||
(
|
||||
and (
|
||||
($r->getFromPerson() === $fromPerson and $r->getToPerson() === $toPerson)
|
||||
||
|
||||
($r->getFromPerson() === $toPerson and $r->getToPerson() === $fromPerson)
|
||||
|| ($r->getFromPerson() === $toPerson and $r->getToPerson() === $fromPerson)
|
||||
)
|
||||
) {
|
||||
$this->context->buildViolation($constraint->message)
|
||||
|
@ -43,5 +43,4 @@ class SingleTaskStateRepository
|
||||
|
||||
return $states;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ class ThirdPartyType extends AbstractType
|
||||
'label' => 'thirdparty.Contact data are confidential',
|
||||
]);
|
||||
|
||||
// Institutional ThirdParty (parent)
|
||||
// Institutional ThirdParty (parent)
|
||||
} else {
|
||||
$builder
|
||||
->add('nameCompany', TextType::class, [
|
||||
|
Loading…
x
Reference in New Issue
Block a user