Rector changes and immplementations of required methods

This commit is contained in:
2025-05-22 17:47:07 +02:00
parent 053b92b77c
commit 17db59d221
1138 changed files with 2656 additions and 2616 deletions

View File

@@ -28,7 +28,7 @@ final class ConfigCustomizablesEntitiesTest extends KernelTestCase
*
* @internal use a custom config environment
*/
public function testNotEmptyConfig()
public function testNotEmptyConfig(): void
{
self::bootKernel(['environment' => 'test_customizable_entities_test_not_empty_config']);
$customizableEntities = self::$kernel->getContainer()
@@ -51,7 +51,7 @@ final class ConfigCustomizablesEntitiesTest extends KernelTestCase
* In this case, parameter 'chill_custom_fields.customizables_entities'
* should be an empty array in container
*/
public function testNotPresentInConfig()
public function testNotPresentInConfig(): void
{
self::bootKernel(['environment' => 'test']);
$customizableEntities = self::$kernel->getContainer()

View File

@@ -24,7 +24,7 @@ final class CustomFieldsGroupControllerTest extends WebTestCase
/**
* @doesNotPerformAssertions
*/
public function testCompleteScenario()
public function testCompleteScenario(): void
{
self::bootKernel(['environment' => 'test_customizable_entities_test_not_empty_config']);
// Create a new client to browse the application
@@ -40,7 +40,7 @@ final class CustomFieldsGroupControllerTest extends WebTestCase
$this->editCustomFieldsGroup($client);
}
private function createCustomFieldsGroup(Client &$client)
private function createCustomFieldsGroup(Client &$client): void
{
// Create a new entry in the database
$crawler = $client->request('GET', '/fr/admin/customfieldsgroup/');
@@ -71,7 +71,7 @@ final class CustomFieldsGroupControllerTest extends WebTestCase
);
}
private function editCustomFieldsGroup(Client $client)
private function editCustomFieldsGroup(Client $client): void
{
$crawler = $client->request('GET', '/fr/admin/customfieldsgroup/');
$links = $crawler->selectLink('Modifier');

View File

@@ -29,7 +29,7 @@ trait CustomFieldTestHelper
*
* @return Crawler
*/
public function getCrawlerForField(CustomField $field, $locale = 'en')
public function getCrawlerForField(CustomField $field, $locale = 'en'): \Symfony\Component\DomCrawler\Crawler
{
$kernel = static::$kernel;

View File

@@ -133,7 +133,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeMultipleChoiceWithOther($data)
public function testDeserializeMultipleChoiceWithOther($data): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => true,
@@ -156,7 +156,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* - the case when the selected value is `_other`
* - result is null
*/
public function testDeserializeMultipleChoiceWithOtherOtherCases()
public function testDeserializeMultipleChoiceWithOtherOtherCases(): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => true,
@@ -219,7 +219,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeMultipleChoiceWithoutOther($data)
public function testDeserializeMultipleChoiceWithoutOther($data): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => false,
@@ -238,7 +238,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* Covered cases :
* - NULL values
*/
public function testDeserializeMultipleChoiceWithoutOtherOtherCases()
public function testDeserializeMultipleChoiceWithoutOtherOtherCases(): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => false,
@@ -280,7 +280,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeSingleChoiceWithOther($data)
public function testDeserializeSingleChoiceWithOther($data): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => true,
@@ -298,7 +298,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
* - Test if the selected value is '_other
* - Test with null data
*/
public function testDeserializeSingleChoiceWithOtherOtherCases()
public function testDeserializeSingleChoiceWithOtherOtherCases(): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => true,
@@ -359,7 +359,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testDeserializeSingleChoiceWithoutOther($data)
public function testDeserializeSingleChoiceWithoutOther($data): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => false,
@@ -371,7 +371,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
$this->assertSame('my-value', $deserialized);
}
public function testDeserializeSingleChoiceWithoutOtherDataIsNull()
public function testDeserializeSingleChoiceWithoutOtherDataIsNull(): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => false,
@@ -400,7 +400,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
/**
* @dataProvider emptyDataProvider
*/
public function testIsEmptyValueEmpty(mixed $data)
public function testIsEmptyValueEmpty(mixed $data): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => false,
@@ -422,7 +422,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase
*
* @dataProvider serializedRepresentationDataProvider
*/
public function testIsEmptyValueNotEmpty(mixed $data)
public function testIsEmptyValueNotEmpty(mixed $data): void
{
$customField = $this->generateCustomField([
CustomFieldChoice::ALLOW_OTHER => false,

View File

@@ -52,7 +52,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
->push($request);
}
public function testCreateInvalidFormValueGreaterThanMaximum()
public function testCreateInvalidFormValueGreaterThanMaximum(): void
{
$cf = $this->createCustomFieldNumber([
'min' => null,
@@ -72,7 +72,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
$this->assertEquals(1, \count($form['default']->getErrors()));
}
public function testCreateInvalidFormValueLowerThanMinimum()
public function testCreateInvalidFormValueLowerThanMinimum(): void
{
$cf = $this->createCustomFieldNumber([
'min' => 1000,
@@ -92,7 +92,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
$this->assertEquals(1, \count($form['default']->getErrors()));
}
public function testCreateValidForm()
public function testCreateValidForm(): void
{
$cf = $this->createCustomFieldNumber([
'min' => null,
@@ -111,7 +111,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
$this->assertEquals(10, $form['default']->getData());
}
public function testRequiredFieldIsFalse()
public function testRequiredFieldIsFalse(): void
{
$cf = $this->createCustomFieldNumber([
'min' => 1000,
@@ -136,7 +136,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\
);
}
public function testRequiredFieldIsTrue()
public function testRequiredFieldIsTrue(): void
{
$cf = $this->createCustomFieldNumber([
'min' => 1000,

View File

@@ -34,7 +34,7 @@ final class CustomFieldsTextTest extends WebTestCase
->get('chill.custom_field.provider');
}
public function testCustomFieldsTextExists()
public function testCustomFieldsTextExists(): void
{
$customField = $this->customFieldProvider->getCustomFieldByType('text');
@@ -48,7 +48,7 @@ final class CustomFieldsTextTest extends WebTestCase
);
}
public function testFormTextNew()
public function testFormTextNew(): void
{
$client = self::createClient();
@@ -60,7 +60,7 @@ final class CustomFieldsTextTest extends WebTestCase
$this->assertTrue($form->has('custom_field_choice[options][maxLength]'));
}
public function testPublicFormRenderingLengthLessThan256()
public function testPublicFormRenderingLengthLessThan256(): void
{
$customField = new CustomField();
$customField->setType('text')
@@ -76,7 +76,7 @@ final class CustomFieldsTextTest extends WebTestCase
$this->assertCount(1, $crawler->filter("label:contains('my label')"));
}
public function testPublicFormRenderingLengthMoreThan25()
public function testPublicFormRenderingLengthMoreThan25(): void
{
$customField = new CustomField();
$customField->setType('text')

View File

@@ -38,7 +38,7 @@ final class PostTextIntegerExtensionTest extends KernelTestCase
->createBuilder('form', null);
}
public function testCreateView()
public function testCreateView(): void
{
$form = $this->formBuilder->add('test', IntegerType::class, [
'post_text' => 'my text',

View File

@@ -38,7 +38,7 @@ final class PostTextNumberExtensionTest extends KernelTestCase
->createBuilder('form', null);
}
public function testCreateView()
public function testCreateView(): void
{
$form = $this->formBuilder->add('test', NumberType::class, [
'post_text' => 'my text',

View File

@@ -23,7 +23,7 @@ use Symfony\Component\HttpFoundation\Response;
*/
final class RoutingLoaderTest extends WebTestCase
{
public function testRoutesAreLoaded()
public function testRoutesAreLoaded(): void
{
$client = self::createClient();

View File

@@ -43,7 +43,7 @@ final class CustomFieldsHelperTest extends KernelTestCase
->setType('text');
}
public function testIsEmptyValue()
public function testIsEmptyValue(): void
{
// not empty value
$data = [
@@ -60,7 +60,7 @@ final class CustomFieldsHelperTest extends KernelTestCase
$this->assertTrue($this->cfHelper->isEmptyValue($data, $this->randomCFText));
}
public function testRenderCustomField()
public function testRenderCustomField(): void
{
$data = [
$this->randomCFText->getSlug() => 'Sample text',

View File

@@ -45,7 +45,7 @@ final class CustomFieldRenderingTwigTest extends KernelTestCase
->push($request->reveal());
}
public function testIsEmpty()
public function testIsEmpty(): void
{
$cf = $this->getSimpleCustomFieldText();
@@ -68,7 +68,7 @@ final class CustomFieldRenderingTwigTest extends KernelTestCase
$this->assertTrue($result);
}
public function testLabelRendering()
public function testLabelRendering(): void
{
$cf = $this->getSimpleCustomFieldText();
@@ -81,7 +81,7 @@ final class CustomFieldRenderingTwigTest extends KernelTestCase
);
}
public function testWidgetRendering()
public function testWidgetRendering(): void
{
$cf = $this->getSimpleCustomFieldText();
$fields = [

View File

@@ -47,7 +47,7 @@ final class CustomFieldsGroupRenderingTwigTest extends KernelTestCase
->push($request->reveal());
}
public function testRenderingWidget()
public function testRenderingWidget(): void
{
$cfGroup = $this->getCustomFieldsGroup();
@@ -62,7 +62,7 @@ final class CustomFieldsGroupRenderingTwigTest extends KernelTestCase
$this->assertContains('Yes', $text);
}
public function testRenderingWidgetDoNotShowEmpty()
public function testRenderingWidgetDoNotShowEmpty(): void
{
$cfGroup = $this->getCustomFieldsGroup();
$cfGroup->addCustomField($this->getSimpleCustomFieldText('empty', 'Do not answer'));