This commit is contained in:
Mathieu Jaumotte 2023-08-17 14:49:29 +02:00 committed by Julien Fastré
parent fe1fe31b68
commit 75bca46b98
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
29 changed files with 42 additions and 40 deletions

View File

@ -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();

View File

@ -56,7 +56,7 @@ class ChillMainConfiguration implements ConfigurationInterface
->end() // end of widgets
->end() // end of root/children
->end() // end of root
;
;
return $treeBuilder;
}

View File

@ -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;

View File

@ -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');
}

View File

@ -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;
}

View File

@ -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"];
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;

View File

@ -65,5 +65,4 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
default => throw new UserAbsenceSyncException("this status is not documented by Microsoft")
};
}
}

View File

@ -190,6 +190,4 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
return $query;
}
}

View File

@ -172,5 +172,4 @@ class MSUserAbsenceReaderTest extends TestCase
"User is absent: absence is always enabled"
];
}
}

View File

@ -94,5 +94,4 @@ final readonly class GenericDocForAccompanyingPeriodController
]
));
}
}

View File

@ -91,5 +91,4 @@ final readonly class GenericDocForPerson
]
));
}
}

View File

@ -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

View File

@ -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;
}

View File

@ -143,5 +143,4 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
return $query;
}
}

View File

@ -46,5 +46,4 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
throw new \LogicException("no renderer found");
}
}

View File

@ -20,5 +20,4 @@ interface GenericDocRendererInterface
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string;
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array;
}

View File

@ -98,7 +98,6 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
continue;
}
$orPersonId[] = $participation->getPerson()->getId();
}
if ([] === $orPersonId) {

View File

@ -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);
}
}

View File

@ -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'];
}
}

View File

@ -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

View File

@ -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

View File

@ -65,7 +65,6 @@ class CronJobDatabaseInteractionTest extends KernelTestCase
// run a second time
$manager->run();
}
}
class JobWithReturn implements CronJobInterface

View File

@ -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];
}
}

View File

@ -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)

View File

@ -43,5 +43,4 @@ class SingleTaskStateRepository
return $states;
}
}

View File

@ -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, [