mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
DX: fix cs
This commit is contained in:
parent
4b2c330d22
commit
70871176fc
@ -18,7 +18,7 @@ $finder
|
|||||||
->notPath('tests/app')
|
->notPath('tests/app')
|
||||||
->ignoreDotFiles(true)
|
->ignoreDotFiles(true)
|
||||||
->name('**.php')
|
->name('**.php')
|
||||||
;
|
;
|
||||||
|
|
||||||
$config = new PhpCsFixer\Config();
|
$config = new PhpCsFixer\Config();
|
||||||
$config
|
$config
|
||||||
|
@ -58,7 +58,8 @@ class DateAggregator implements AggregatorInterface
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'year':
|
case 'year':
|
||||||
$fmt = 'YYYY'; $order = 'DESC';
|
$fmt = 'YYYY';
|
||||||
|
$order = 'DESC';
|
||||||
|
|
||||||
break; // order DESC does not works !
|
break; // order DESC does not works !
|
||||||
|
|
||||||
|
@ -53,6 +53,11 @@ class ResourceKindRepository implements ObjectRepository
|
|||||||
->getResult();
|
->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findOneByKind(string $kind): ?ResourceKind
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy(['kind' => $kind]) ;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ResourceType[]
|
* @return ResourceType[]
|
||||||
*/
|
*/
|
||||||
|
@ -512,7 +512,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
*/
|
*/
|
||||||
public function getUsers(): Collection
|
public function getUsers(): Collection
|
||||||
{
|
{
|
||||||
return $this->getInvites()->map(static function (Invite $i) { return $i->getUser(); });
|
return $this->getInvites()->map(static function (Invite $i) {
|
||||||
|
return $i->getUser();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hasCalendarRange(): bool
|
public function hasCalendarRange(): bool
|
||||||
@ -597,7 +599,9 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
|
|||||||
}
|
}
|
||||||
|
|
||||||
$invite = $this->invites
|
$invite = $this->invites
|
||||||
->filter(static function (Invite $invite) use ($user) { return $invite->getUser() === $user; })
|
->filter(static function (Invite $invite) use ($user) {
|
||||||
|
return $invite->getUser() === $user;
|
||||||
|
})
|
||||||
->first();
|
->first();
|
||||||
$this->removeInvite($invite);
|
$this->removeInvite($invite);
|
||||||
|
|
||||||
|
@ -89,10 +89,14 @@ class CalendarToRemoteHandler implements MessageHandlerInterface
|
|||||||
|
|
||||||
$newInvites = array_filter(
|
$newInvites = array_filter(
|
||||||
array_map(
|
array_map(
|
||||||
function ($id) { return $this->inviteRepository->find($id); },
|
function ($id) {
|
||||||
|
return $this->inviteRepository->find($id);
|
||||||
|
},
|
||||||
$calendarMessage->getNewInvitesIds(),
|
$calendarMessage->getNewInvitesIds(),
|
||||||
),
|
),
|
||||||
static function (?Invite $invite) { return null !== $invite; }
|
static function (?Invite $invite) {
|
||||||
|
return null !== $invite;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->calendarConnector->syncCalendar(
|
$this->calendarConnector->syncCalendar(
|
||||||
|
@ -167,7 +167,9 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
]
|
]
|
||||||
)->toArray();
|
)->toArray();
|
||||||
|
|
||||||
$ids = array_map(static function ($item) { return $item['id']; }, $bareEvents['value']);
|
$ids = array_map(static function ($item) {
|
||||||
|
return $item['id'];
|
||||||
|
}, $bareEvents['value']);
|
||||||
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
|
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
|
||||||
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
$existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids);
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
];
|
];
|
||||||
|
|
||||||
$calendar = new Calendar();
|
$calendar = new Calendar();
|
||||||
$calendar->setMainUser(new class() extends User {
|
$calendar->setMainUser(new class () extends User {
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return '1';
|
return '1';
|
||||||
@ -114,8 +114,12 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
$this->assertEquals(8, $calendar->getCalendarRange()->getId());
|
||||||
$this->assertEquals(9, $calendar->getLocation()->getId());
|
$this->assertEquals(9, $calendar->getLocation()->getId());
|
||||||
$this->assertEquals(true, $calendar->getSendSMS());
|
$this->assertEquals(true, $calendar->getSendSMS());
|
||||||
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
$this->assertContains(2, $calendar->getUsers()->map(static function (User $u) {
|
||||||
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) { return $u->getId(); }));
|
return $u->getId();
|
||||||
|
}));
|
||||||
|
$this->assertContains(3, $calendar->getUsers()->map(static function (User $u) {
|
||||||
|
return $u->getId();
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getExtensions()
|
protected function getExtensions()
|
||||||
@ -147,7 +151,9 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
->will(static function ($args) {
|
->will(static function ($args) {
|
||||||
return implode(
|
return implode(
|
||||||
',',
|
',',
|
||||||
array_map(static function ($p) { return $p->getId(); }, $args[0])
|
array_map(static function ($p) {
|
||||||
|
return $p->getId();
|
||||||
|
}, $args[0])
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
$transformer->transform(Argument::exact(null))
|
$transformer->transform(Argument::exact(null))
|
||||||
@ -156,7 +162,9 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
->will(static function ($args) {
|
->will(static function ($args) {
|
||||||
return implode(
|
return implode(
|
||||||
',',
|
',',
|
||||||
array_map(static function ($p) { return $p->getId(); }, $args[0]->toArray())
|
array_map(static function ($p) {
|
||||||
|
return $p->getId();
|
||||||
|
}, $args[0]->toArray())
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
$transformer->reverseTransform(Argument::type('string'))
|
$transformer->reverseTransform(Argument::type('string'))
|
||||||
|
@ -274,7 +274,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->end() // end of root/children
|
->end() // end of root/children
|
||||||
->end() // end of root
|
->end() // end of root
|
||||||
;
|
;
|
||||||
|
|
||||||
$rootNode->children()
|
$rootNode->children()
|
||||||
->arrayNode('add_address')->addDefaultsIfNotSet()->children()
|
->arrayNode('add_address')->addDefaultsIfNotSet()->children()
|
||||||
|
@ -42,7 +42,9 @@ class IdToEntityDataTransformer implements DataTransformerInterface
|
|||||||
{
|
{
|
||||||
$this->repository = $repository;
|
$this->repository = $repository;
|
||||||
$this->multiple = $multiple;
|
$this->multiple = $multiple;
|
||||||
$this->getId = $getId ?? static function (object $o) { return $o->getId(); };
|
$this->getId = $getId ?? static function (object $o) {
|
||||||
|
return $o->getId();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,13 +77,13 @@ final class IdToEntityDataTransformerTest extends TestCase
|
|||||||
|
|
||||||
public function testTransformMulti()
|
public function testTransformMulti()
|
||||||
{
|
{
|
||||||
$o1 = new class() {
|
$o1 = new class () {
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$o2 = new class() {
|
$o2 = new class () {
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return 2;
|
return 2;
|
||||||
@ -104,7 +104,7 @@ final class IdToEntityDataTransformerTest extends TestCase
|
|||||||
|
|
||||||
public function testTransformSingle()
|
public function testTransformSingle()
|
||||||
{
|
{
|
||||||
$o = new class() {
|
$o = new class () {
|
||||||
public function getId()
|
public function getId()
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -33,7 +33,7 @@ final class DefaultScopeResolverTest extends TestCase
|
|||||||
public function testHasScopeInterface()
|
public function testHasScopeInterface()
|
||||||
{
|
{
|
||||||
$scope = new Scope();
|
$scope = new Scope();
|
||||||
$entity = new class($scope) implements HasScopeInterface {
|
$entity = new class ($scope) implements HasScopeInterface {
|
||||||
public function __construct(Scope $scope)
|
public function __construct(Scope $scope)
|
||||||
{
|
{
|
||||||
$this->scope = $scope;
|
$this->scope = $scope;
|
||||||
@ -52,7 +52,7 @@ final class DefaultScopeResolverTest extends TestCase
|
|||||||
|
|
||||||
public function testHasScopesInterface()
|
public function testHasScopesInterface()
|
||||||
{
|
{
|
||||||
$entity = new class($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface {
|
$entity = new class ($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface {
|
||||||
public function __construct(Scope $scopeA, Scope $scopeB)
|
public function __construct(Scope $scopeA, Scope $scopeB)
|
||||||
{
|
{
|
||||||
$this->scopes = [$scopeA, $scopeB];
|
$this->scopes = [$scopeA, $scopeB];
|
||||||
|
@ -34,7 +34,7 @@ final class ScopeResolverDispatcherTest extends TestCase
|
|||||||
public function testHasScopeInterface()
|
public function testHasScopeInterface()
|
||||||
{
|
{
|
||||||
$scope = new Scope();
|
$scope = new Scope();
|
||||||
$entity = new class($scope) implements HasScopeInterface {
|
$entity = new class ($scope) implements HasScopeInterface {
|
||||||
public function __construct(Scope $scope)
|
public function __construct(Scope $scope)
|
||||||
{
|
{
|
||||||
$this->scope = $scope;
|
$this->scope = $scope;
|
||||||
@ -52,7 +52,7 @@ final class ScopeResolverDispatcherTest extends TestCase
|
|||||||
|
|
||||||
public function testHasScopesInterface()
|
public function testHasScopesInterface()
|
||||||
{
|
{
|
||||||
$entity = new class($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface {
|
$entity = new class ($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface {
|
||||||
public function __construct(Scope $scopeA, Scope $scopeB)
|
public function __construct(Scope $scopeA, Scope $scopeB)
|
||||||
{
|
{
|
||||||
$this->scopes = [$scopeA, $scopeB];
|
$this->scopes = [$scopeA, $scopeB];
|
||||||
|
@ -129,7 +129,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->defaultValue(false)
|
->defaultValue(false)
|
||||||
->end()
|
->end()
|
||||||
->end() // children of 'root', parent = root
|
->end() // children of 'root', parent = root
|
||||||
;
|
;
|
||||||
|
|
||||||
return $treeBuilder;
|
return $treeBuilder;
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T
|
|||||||
|
|
||||||
protected function generateClass(AccompanyingPeriod $period, Collection $socialIssues): AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
|
protected function generateClass(AccompanyingPeriod $period, Collection $socialIssues): AccompanyingPeriodLinkedWithSocialIssuesEntityInterface
|
||||||
{
|
{
|
||||||
return new class($period, $socialIssues) implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface {
|
return new class ($period, $socialIssues) implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface {
|
||||||
public Collection $socialIssues;
|
public Collection $socialIssues;
|
||||||
|
|
||||||
public AccompanyingPeriod $period;
|
public AccompanyingPeriod $period;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user