mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
Merge branch 'master' into upgrade-sf5
This commit is contained in:
@@ -91,7 +91,7 @@ class JobWithReturn implements CronJobInterface
|
||||
return 'with-data';
|
||||
}
|
||||
|
||||
public function run(array $lastExecutionData): null|array
|
||||
public function run(array $lastExecutionData): array|null
|
||||
{
|
||||
return ['data' => 'test'];
|
||||
}
|
||||
|
@@ -161,7 +161,9 @@ final class CronManagerTest extends TestCase
|
||||
|
||||
class JobCanRun implements CronJobInterface
|
||||
{
|
||||
public function __construct(private readonly string $key) {}
|
||||
public function __construct(private readonly string $key)
|
||||
{
|
||||
}
|
||||
|
||||
public function canRun(?CronJobExecution $cronJobExecution): bool
|
||||
{
|
||||
@@ -173,7 +175,7 @@ class JobCanRun implements CronJobInterface
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
public function run(array $lastExecutionData): null|array
|
||||
public function run(array $lastExecutionData): array|null
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -191,7 +193,7 @@ class JobCannotRun implements CronJobInterface
|
||||
return 'job-b';
|
||||
}
|
||||
|
||||
public function run(array $lastExecutionData): null|array
|
||||
public function run(array $lastExecutionData): array|null
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@@ -498,11 +498,11 @@ final class ExportManagerTest extends KernelTestCase
|
||||
* user 'center a_social' from database.
|
||||
*/
|
||||
protected function createExportManager(
|
||||
LoggerInterface $logger = null,
|
||||
EntityManagerInterface $em = null,
|
||||
AuthorizationCheckerInterface $authorizationChecker = null,
|
||||
AuthorizationHelper $authorizationHelper = null,
|
||||
UserInterface $user = null,
|
||||
?LoggerInterface $logger = null,
|
||||
?EntityManagerInterface $em = null,
|
||||
?AuthorizationCheckerInterface $authorizationChecker = null,
|
||||
?AuthorizationHelper $authorizationHelper = null,
|
||||
?UserInterface $user = null,
|
||||
array $exports = [],
|
||||
array $aggregators = [],
|
||||
array $filters = [],
|
||||
@@ -532,14 +532,17 @@ class DummyFilterWithApplying implements FilterInterface
|
||||
public function __construct(
|
||||
private readonly ?string $role,
|
||||
private readonly string $applyOn
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return 'dummy';
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
@@ -556,7 +559,9 @@ class DummyFilterWithApplying implements FilterInterface
|
||||
return $this->role;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data) {}
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
@@ -572,14 +577,17 @@ class DummyExport implements ExportInterface
|
||||
* @var array<string>
|
||||
*/
|
||||
private readonly array $supportedModifiers,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return 'dummy';
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
|
@@ -102,7 +102,7 @@ class SortExportElementTest extends KernelTestCase
|
||||
private function makeTranslator(): TranslatorInterface
|
||||
{
|
||||
return new class () implements TranslatorInterface {
|
||||
public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null)
|
||||
public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null)
|
||||
{
|
||||
return $id;
|
||||
}
|
||||
@@ -117,9 +117,13 @@ class SortExportElementTest extends KernelTestCase
|
||||
private function makeAggregator(string $title): AggregatorInterface
|
||||
{
|
||||
return new class ($title) implements AggregatorInterface {
|
||||
public function __construct(private readonly string $title) {}
|
||||
public function __construct(private readonly string $title)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
@@ -146,7 +150,9 @@ class SortExportElementTest extends KernelTestCase
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data) {}
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
@@ -158,14 +164,18 @@ class SortExportElementTest extends KernelTestCase
|
||||
private function makeFilter(string $title): FilterInterface
|
||||
{
|
||||
return new class ($title) implements FilterInterface {
|
||||
public function __construct(private readonly string $title) {}
|
||||
public function __construct(private readonly string $title)
|
||||
{
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder) {}
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
{
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
@@ -182,7 +192,9 @@ class SortExportElementTest extends KernelTestCase
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data) {}
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
{
|
||||
}
|
||||
|
||||
public function applyOn()
|
||||
{
|
||||
|
@@ -113,7 +113,7 @@ class NotificationMailerTest extends TestCase
|
||||
}
|
||||
|
||||
private function buildNotificationMailer(
|
||||
MailerInterface $mailer = null,
|
||||
?MailerInterface $mailer = null,
|
||||
): NotificationMailer {
|
||||
return new NotificationMailer(
|
||||
$mailer,
|
||||
|
@@ -25,7 +25,7 @@ use PHPUnit\Framework\TestCase;
|
||||
*/
|
||||
final class SearchProviderTest extends TestCase
|
||||
{
|
||||
private \Chill\MainBundle\Search\SearchProvider $search;
|
||||
private SearchProvider $search;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
|
@@ -34,7 +34,9 @@ final class TokenManagerTest extends KernelTestCase
|
||||
$this->tokenManager = new TokenManager('secret', $logger);
|
||||
}
|
||||
|
||||
public static function setUpBefore() {}
|
||||
public static function setUpBefore()
|
||||
{
|
||||
}
|
||||
|
||||
public function testGenerate()
|
||||
{
|
||||
|
@@ -35,7 +35,9 @@ final class DefaultScopeResolverTest extends TestCase
|
||||
{
|
||||
$scope = new Scope();
|
||||
$entity = new class ($scope) implements HasScopeInterface {
|
||||
public function __construct(private readonly Scope $scope) {}
|
||||
public function __construct(private readonly Scope $scope)
|
||||
{
|
||||
}
|
||||
|
||||
public function getScope()
|
||||
{
|
||||
@@ -51,7 +53,9 @@ final class DefaultScopeResolverTest extends TestCase
|
||||
public function testHasScopesInterface()
|
||||
{
|
||||
$entity = new class ($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface {
|
||||
public function __construct(private readonly Scope $scopeA, private readonly Scope $scopeB) {}
|
||||
public function __construct(private readonly Scope $scopeA, private readonly Scope $scopeB)
|
||||
{
|
||||
}
|
||||
|
||||
public function getScopes(): iterable
|
||||
{
|
||||
|
@@ -36,7 +36,9 @@ final class ScopeResolverDispatcherTest extends TestCase
|
||||
{
|
||||
$scope = new Scope();
|
||||
$entity = new class ($scope) implements HasScopeInterface {
|
||||
public function __construct(private readonly Scope $scope) {}
|
||||
public function __construct(private readonly Scope $scope)
|
||||
{
|
||||
}
|
||||
|
||||
public function getScope()
|
||||
{
|
||||
|
@@ -84,7 +84,7 @@ final class DateNormalizerTest extends KernelTestCase
|
||||
$this->assertFalse($this->buildDateNormalizer()->supportsNormalization(new \DateTime(), 'xml'));
|
||||
}
|
||||
|
||||
private function buildDateNormalizer(string $locale = null): DateNormalizer
|
||||
private function buildDateNormalizer(?string $locale = null): DateNormalizer
|
||||
{
|
||||
$requestStack = $this->prophet->prophesize(RequestStack::class);
|
||||
$parameterBag = new ParameterBag();
|
||||
|
@@ -40,7 +40,7 @@ final class PhonenumberNormalizerTest extends TestCase
|
||||
/**
|
||||
* @dataProvider dataProviderNormalizePhonenumber
|
||||
*/
|
||||
public function testNormalize(?Phonenumber $phonenumber, mixed $format, mixed $context, mixed $expected)
|
||||
public function testNormalize(?PhoneNumber $phonenumber, mixed $format, mixed $context, mixed $expected)
|
||||
{
|
||||
$parameterBag = $this->prophesize(ParameterBagInterface::class);
|
||||
$parameterBag->get(Argument::exact('chill_main'))->willReturn(['phone_helper' => ['default_carrier_code' => 'BE']]);
|
||||
|
@@ -117,19 +117,19 @@ final class UserNormalizerTest extends TestCase
|
||||
*
|
||||
* @throws ExceptionInterface
|
||||
*/
|
||||
public function testNormalize(null|User $user, mixed $format, mixed $context, mixed $expected)
|
||||
public function testNormalize(User|null $user, mixed $format, mixed $context, mixed $expected)
|
||||
{
|
||||
$userRender = $this->prophesize(UserRender::class);
|
||||
$userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : '');
|
||||
|
||||
$normalizer = new UserNormalizer($userRender->reveal());
|
||||
$normalizer->setNormalizer(new class () implements NormalizerInterface {
|
||||
public function normalize($object, string $format = null, array $context = [])
|
||||
public function normalize($object, ?string $format = null, array $context = [])
|
||||
{
|
||||
return ['context' => $context['docgen:expects'] ?? null];
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, string $format = null)
|
||||
public function supportsNormalization($data, ?string $format = null)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user