Skip to content

Commit 3dd6d19

Browse files
Merge branch '6.2' of github.com:darkwebdesign/symfony-addon-pack
2 parents 54a4caf + c56e0e5 commit 3dd6d19

File tree

11 files changed

+74
-54
lines changed

11 files changed

+74
-54
lines changed

.github/workflows/build.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ jobs:
1818
uses: 'shivammathur/setup-php@v2'
1919
with:
2020
php-version: '8.1'
21+
- name: 'Fix dependencies'
22+
uses: 'php-actions/composer@v6'
23+
with:
24+
command: 'require'
25+
args: 'darkwebdesign/symfony-addon-transformers:6.2.x-dev --dev --no-install'
26+
php_version: '8.1'
2127
- name: 'Composer Install'
2228
uses: 'ramsey/composer-install@v3'
2329
- name: 'Rector'
@@ -33,6 +39,12 @@ jobs:
3339
uses: 'shivammathur/setup-php@v2'
3440
with:
3541
php-version: '8.1'
42+
- name: 'Fix dependencies'
43+
uses: 'php-actions/composer@v6'
44+
with:
45+
command: 'require'
46+
args: 'darkwebdesign/symfony-addon-transformers:6.2.x-dev --dev --no-install'
47+
php_version: '8.1'
3648
- name: 'Composer Install'
3749
uses: 'ramsey/composer-install@v3'
3850
- name: 'PHPStan'
@@ -48,6 +60,12 @@ jobs:
4860
uses: 'shivammathur/setup-php@v2'
4961
with:
5062
php-version: '8.1'
63+
- name: 'Fix dependencies'
64+
uses: 'php-actions/composer@v6'
65+
with:
66+
command: 'require'
67+
args: 'darkwebdesign/symfony-addon-transformers:6.2.x-dev --dev --no-install'
68+
php_version: '8.1'
5169
- name: 'Composer Install'
5270
uses: 'ramsey/composer-install@v3'
5371
- name: 'PHP CS Fixer'
@@ -70,6 +88,12 @@ jobs:
7088
uses: 'shivammathur/setup-php@v2'
7189
with:
7290
php-version: "${{ matrix.php }}"
91+
- name: 'Fix dependencies'
92+
uses: 'php-actions/composer@v6'
93+
with:
94+
command: 'require'
95+
args: 'darkwebdesign/symfony-addon-transformers:6.2.x-dev --dev --no-install'
96+
php_version: "${{ matrix.php }}"
7397
- name: 'Composer Install'
7498
uses: 'ramsey/composer-install@v3'
7599
- name: 'PHPUnit'

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
[![Total Downloads](https://poser.pugx.org/darkwebdesign/symfony-addon-form-types/downloads?format=flat)](https://packagist.org/packages/darkwebdesign/symfony-addon-form-types)
55
[![License](https://poser.pugx.org/darkwebdesign/symfony-addon-form-types/license?format=flat)](https://packagist.org/packages/darkwebdesign/symfony-addon-form-types)
66

7-
[![Build Status](https://github.com/darkwebdesign/symfony-addon-form-types/actions/workflows/build.yaml/badge.svg?branch=6.1)](https://github.com/darkwebdesign/symfony-addon-form-types/actions/workflows/build.yaml)
8-
[![Coverage Status](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types/branch/6.1/graph/badge.svg)](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types)
7+
[![Build Status](https://github.com/darkwebdesign/symfony-addon-form-types/actions/workflows/build.yaml/badge.svg?branch=6.2)](https://github.com/darkwebdesign/symfony-addon-form-types/actions/workflows/build.yaml)
8+
[![Coverage Status](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types/branch/6.2/graph/badge.svg)](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types)
99
[![PHP Version](https://img.shields.io/badge/php-8.1%2B-777BB3.svg)](https://php.net/)
10-
[![Symfony Version](https://img.shields.io/badge/symfony-6.1-93C74B.svg)](https://symfony.com/)
10+
[![Symfony Version](https://img.shields.io/badge/symfony-6.2-93C74B.svg)](https://symfony.com/)
1111

1212
Symfony Add-on Form Types is a collection of extra Symfony form field types that you can use in your Symfony applications.
1313

14-
Learn more about it in its [documentation](https://darkwebdesign.github.io/symfony-addon-pack/docs/6.1).
14+
Learn more about it in its [documentation](https://darkwebdesign.github.io/symfony-addon-pack/docs/6.2).
1515

1616
## Features
1717

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
],
1111
"require": {
1212
"php": "^8.1",
13-
"symfony/event-dispatcher": "6.1.*",
14-
"symfony/form": "6.1.*",
15-
"symfony/options-resolver": "6.1.*"
13+
"symfony/event-dispatcher": "6.2.*",
14+
"symfony/form": "6.2.*",
15+
"symfony/options-resolver": "6.2.*"
1616
},
1717
"require-dev": {
18-
"darkwebdesign/symfony-addon-transformers": "6.1.*",
18+
"darkwebdesign/symfony-addon-transformers": "6.2.*",
1919
"doctrine/orm": "^2.7",
2020
"friendsofphp/php-cs-fixer": "^3.58",
2121
"phpstan/extension-installer": "^1.3",
2222
"phpstan/phpstan": "^1.11",
2323
"phpstan/phpstan-doctrine": "^1.4",
2424
"phpstan/phpstan-phpunit": "^1.4",
2525
"phpstan/phpstan-symfony": "^1.4",
26-
"phpunit/phpunit": "^9.5",
26+
"phpunit/phpunit": "^10.5",
2727
"rector/rector": "^1.1"
2828
},
2929
"suggest": {

phpunit.xml.dist

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
5-
cacheResultFile=".phpunit.cache/test-results"
5+
cacheDirectory=".phpunit.cache"
66
colors="true"
77
executionOrder="depends,defects"
8-
forceCoversAnnotation="true"
9-
beStrictAboutCoversAnnotation="true"
8+
requireCoverageMetadata="true"
9+
beStrictAboutCoverageMetadata="true"
1010
beStrictAboutOutputDuringTests="true"
1111
beStrictAboutTodoAnnotatedTests="true"
12-
convertDeprecationsToExceptions="true"
1312
failOnRisky="true"
14-
failOnWarning="true"
15-
verbose="true">
13+
failOnWarning="true">
1614

1715
<testsuites>
1816
<testsuite name="DarkWeb Design Symfony Add-on Form Types Test Suite">
1917
<directory>tests</directory>
2018
</testsuite>
2119
</testsuites>
2220

23-
<coverage cacheDirectory=".phpunit.cache/code-coverage"
24-
processUncoveredFiles="true">
21+
<source restrictDeprecations="true"
22+
restrictNotices="true"
23+
restrictWarnings="true">
2524
<include>
2625
<directory suffix=".php">src</directory>
2726
</include>
28-
</coverage>
27+
</source>
2928

3029
</phpunit>

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
])
1414
->withSets([
1515
LevelSetList::UP_TO_PHP_81,
16-
SymfonySetList::SYMFONY_61,
16+
SymfonySetList::SYMFONY_62,
1717
])
1818
->withImportNames(
1919
importShortClasses: false,

tests/BirthdayTypeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
namespace DarkWebDesign\SymfonyAddonFormTypes\Tests;
2424

2525
use DarkWebDesign\SymfonyAddonFormTypes\BirthdayType;
26+
use PHPUnit\Framework\Attributes\CoversClass;
2627
use Symfony\Component\Form\Test\TypeTestCase;
2728

2829
/**
29-
* @covers \DarkWebDesign\SymfonyAddonFormTypes\BirthdayType
30-
*
3130
* @internal
3231
*/
32+
#[CoversClass(BirthdayType::class)]
3333
class BirthdayTypeTest extends TypeTestCase
3434
{
3535
public function test(): void

tests/BooleanToYesNoSubscriberTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424

2525
use DarkWebDesign\SymfonyAddonFormTypes\BooleanToYesNoSubscriber;
2626
use DarkWebDesign\SymfonyAddonFormTypes\BooleanType;
27+
use DarkWebDesign\SymfonyAddonTransformers\BooleanToValueTransformer;
28+
use PHPUnit\Framework\Attributes\CoversClass;
29+
use PHPUnit\Framework\Attributes\DataProvider;
30+
use PHPUnit\Framework\Attributes\UsesClass;
2731
use Symfony\Component\Form\Test\TypeTestCase;
2832

2933
/**
30-
* @covers \DarkWebDesign\SymfonyAddonFormTypes\BooleanToYesNoSubscriber
31-
*
32-
* @uses \DarkWebDesign\SymfonyAddonFormTypes\BooleanType
33-
* @uses \DarkWebDesign\SymfonyAddonTransformers\BooleanToValueTransformer
34-
*
3534
* @internal
3635
*/
36+
#[CoversClass(BooleanToYesNoSubscriber::class)]
37+
#[UsesClass(BooleanType::class)]
38+
#[UsesClass(BooleanToValueTransformer::class)]
3739
class BooleanToYesNoSubscriberTest extends TypeTestCase
3840
{
39-
/**
40-
* @dataProvider provider
41-
*/
41+
#[DataProvider('provider')]
4242
public function test(?bool $value): void
4343
{
4444
$form = $this->factory->createBuilder()
@@ -83,7 +83,7 @@ public function testDataNotArray(): void
8383
/**
8484
* @return array<string, array{bool|null}>
8585
*/
86-
public function provider(): array
86+
public static function provider(): array
8787
{
8888
return [
8989
'true' => [true],

tests/BooleanTypeTest.php

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@
2323
namespace DarkWebDesign\SymfonyAddonFormTypes\Tests;
2424

2525
use DarkWebDesign\SymfonyAddonFormTypes\BooleanType;
26+
use DarkWebDesign\SymfonyAddonTransformers\BooleanToValueTransformer;
27+
use PHPUnit\Framework\Attributes\CoversClass;
28+
use PHPUnit\Framework\Attributes\DataProvider;
29+
use PHPUnit\Framework\Attributes\UsesClass;
2630
use Symfony\Component\Form\Test\TypeTestCase;
2731

2832
/**
29-
* @covers \DarkWebDesign\SymfonyAddonFormTypes\BooleanType
30-
*
31-
* @uses \DarkWebDesign\SymfonyAddonTransformers\BooleanToValueTransformer
32-
*
3333
* @internal
3434
*/
35+
#[CoversClass(BooleanType::class)]
36+
#[UsesClass(BooleanToValueTransformer::class)]
3537
class BooleanTypeTest extends TypeTestCase
3638
{
37-
/**
38-
* @dataProvider providerValueTrueFalse
39-
*/
39+
#[DataProvider('providerValueTrueFalse')]
4040
public function test(mixed $valueTrue, mixed $valueFalse): void
4141
{
4242
$options = [
@@ -57,9 +57,7 @@ public function test(mixed $valueTrue, mixed $valueFalse): void
5757
$this->assertFalse($form->getData());
5858
}
5959

60-
/**
61-
* @dataProvider providerValueTrueFalse
62-
*/
60+
#[DataProvider('providerValueTrueFalse')]
6361
public function testInvalidValue(mixed $valueTrue, mixed $valueFalse): void
6462
{
6563
$options = [
@@ -74,9 +72,7 @@ public function testInvalidValue(mixed $valueTrue, mixed $valueFalse): void
7472
$this->assertNull($form->getData());
7573
}
7674

77-
/**
78-
* @dataProvider providerWidget
79-
*/
75+
#[DataProvider('providerWidget')]
8076
public function testWidget(string $widget, bool $expanded): void
8177
{
8278
$options = [
@@ -108,7 +104,7 @@ public function testHumanize(): void
108104
/**
109105
* @return array<string, array{mixed, mixed}>
110106
*/
111-
public function providerValueTrueFalse(): array
107+
public static function providerValueTrueFalse(): array
112108
{
113109
return [
114110
'true/false' => ['true', 'false'],
@@ -123,7 +119,7 @@ public function providerValueTrueFalse(): array
123119
/**
124120
* @return array<string, array{string, bool}>
125121
*/
126-
public function providerWidget(): array
122+
public static function providerWidget(): array
127123
{
128124
return [
129125
'choice' => ['choice', false],

tests/EntityTypeTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,25 @@
2424

2525
use DarkWebDesign\SymfonyAddonFormTypes\EntityType;
2626
use DarkWebDesign\SymfonyAddonFormTypes\Tests\Models\City;
27+
use DarkWebDesign\SymfonyAddonTransformers\EntityToIdentifierTransformer;
2728
use Doctrine\ORM\EntityManager;
2829
use Doctrine\Persistence\ManagerRegistry;
2930
use Doctrine\Persistence\Mapping\ClassMetadata;
3031
use Doctrine\Persistence\ObjectManager;
3132
use Doctrine\Persistence\ObjectRepository;
33+
use PHPUnit\Framework\Attributes\CoversClass;
34+
use PHPUnit\Framework\Attributes\UsesClass;
3235
use PHPUnit\Framework\MockObject\MockObject;
3336
use Symfony\Component\Form\Exception\RuntimeException;
3437
use Symfony\Component\Form\FormExtensionInterface;
3538
use Symfony\Component\Form\PreloadedExtension;
3639
use Symfony\Component\Form\Test\TypeTestCase;
3740

3841
/**
39-
* @covers \DarkWebDesign\SymfonyAddonFormTypes\EntityType
40-
*
41-
* @uses \DarkWebDesign\SymfonyAddonTransformers\EntityToIdentifierTransformer
42-
*
4342
* @internal
4443
*/
44+
#[CoversClass(EntityType::class)]
45+
#[UsesClass(EntityToIdentifierTransformer::class)]
4546
class EntityTypeTest extends TypeTestCase
4647
{
4748
private City $entity;

tests/JsonSchemaSubscriberTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
namespace DarkWebDesign\SymfonyAddonFormTypes\Tests;
2424

2525
use DarkWebDesign\SymfonyAddonFormTypes\JsonSchemaSubscriber;
26+
use PHPUnit\Framework\Attributes\CoversClass;
2627
use Symfony\Component\Form\Extension\Core\Type\TextType;
2728
use Symfony\Component\Form\Test\TypeTestCase;
2829

2930
/**
30-
* @covers \DarkWebDesign\SymfonyAddonFormTypes\JsonSchemaSubscriber
31-
*
3231
* @internal
3332
*/
33+
#[CoversClass(JsonSchemaSubscriber::class)]
3434
class JsonSchemaSubscriberTest extends TypeTestCase
3535
{
3636
public function test(): void

0 commit comments

Comments
 (0)