Skip to content

Commit 94b53b0

Browse files
Merge branch '6.0' of github.com:darkwebdesign/symfony-addon-pack
2 parents 8c94893 + 1289b71 commit 94b53b0

22 files changed

+263
-215
lines changed

.github/workflows/build.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: 'Build'
2+
3+
on:
4+
push:
5+
6+
concurrency:
7+
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}"
8+
cancel-in-progress: true
9+
10+
jobs:
11+
rector:
12+
name: 'Rector'
13+
runs-on: 'ubuntu-24.04'
14+
steps:
15+
- name: 'Checkout'
16+
uses: 'actions/checkout@v4'
17+
- name: 'Setup PHP'
18+
uses: 'shivammathur/setup-php@v2'
19+
with:
20+
php-version: '8.0'
21+
- name: 'Composer Install'
22+
uses: 'ramsey/composer-install@v3'
23+
- name: 'Rector'
24+
run: 'vendor/bin/rector process --dry-run --no-progress-bar --ansi'
25+
26+
phpstan:
27+
name: 'PHPStan'
28+
runs-on: 'ubuntu-24.04'
29+
steps:
30+
- name: 'Checkout'
31+
uses: 'actions/checkout@v4'
32+
- name: 'Setup PHP'
33+
uses: 'shivammathur/setup-php@v2'
34+
with:
35+
php-version: '8.0'
36+
- name: 'Composer Install'
37+
uses: 'ramsey/composer-install@v3'
38+
- name: 'PHPStan'
39+
run: 'vendor/bin/phpstan analyze --no-progress --ansi'
40+
41+
php-cs-fixer:
42+
name: 'PHP CS Fixer'
43+
runs-on: 'ubuntu-24.04'
44+
steps:
45+
- name: 'Checkout'
46+
uses: 'actions/checkout@v4'
47+
- name: 'Setup PHP'
48+
uses: 'shivammathur/setup-php@v2'
49+
with:
50+
php-version: '8.0'
51+
- name: 'Composer Install'
52+
uses: 'ramsey/composer-install@v3'
53+
- name: 'PHP CS Fixer'
54+
run: 'vendor/bin/php-cs-fixer fix --diff --dry-run --show-progress=none --ansi'
55+
56+
phpunit:
57+
name: 'PHPUnit'
58+
runs-on: 'ubuntu-24.04'
59+
strategy:
60+
matrix:
61+
include:
62+
- php: '8.0'
63+
- php: '8.1'
64+
- php: '8.2'
65+
- php: '8.3'
66+
fail-fast: false
67+
steps:
68+
- name: 'Checkout'
69+
uses: 'actions/checkout@v4'
70+
- name: 'Setup PHP'
71+
uses: 'shivammathur/setup-php@v2'
72+
with:
73+
php-version: "${{ matrix.php }}"
74+
- name: 'Composer Install'
75+
uses: 'ramsey/composer-install@v3'
76+
- name: 'PHPUnit'
77+
run: 'XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-clover phpunit-coverage.xml'
78+
- name: 'Code Climate'
79+
uses: 'paambaati/codeclimate-action@v6'
80+
with:
81+
coverageLocations: 'phpunit-coverage.xml:clover'
82+
env:
83+
CC_TEST_REPORTER_ID: "${{ secrets.CODECLIMATE_REPORTER_ID }}"

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/.phpunit.result.cache
2-
/build/
1+
/.idea/
2+
/.php-cs-fixer.cache
3+
/.phpunit.cache/
34
/composer.lock
45
/vendor/

.php-cs-fixer.dist.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Config;
6+
use PhpCsFixer\Finder;
7+
8+
$finder = (new Finder())
9+
->in(__DIR__);
10+
11+
return (new Config())
12+
->setRules([
13+
'@PhpCsFixer' => true,
14+
'@PSR1' => true,
15+
'@PSR2' => true,
16+
'@PSR12' => true,
17+
'@Symfony' => true,
18+
'concat_space' => ['spacing' => 'one'], // overrules @Symfony
19+
'global_namespace_import' => ['import_classes' => false],
20+
'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], // overrules @PhpCsFixer
21+
'no_superfluous_elseif' => false, // overrules @PhpCsFixer
22+
'phpdoc_align' => ['tags' => ['method', 'param', 'property', 'return', 'throws', 'type', 'var'], 'align' => 'left'], // overrules @Symfony
23+
'yoda_style' => false, // overrules @Symfony
24+
])
25+
->setFinder($finder);

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 5 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://app.travis-ci.com/darkwebdesign/symfony-addon-form-types.svg?branch=5.4)](https://app.travis-ci.com/darkwebdesign/symfony-addon-form-types)
8-
[![Coverage Status](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types/branch/5.4/graph/badge.svg)](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types)
9-
[![PHP Version](https://img.shields.io/badge/php-7.2%2B-777BB3.svg)](https://php.net/)
10-
[![Symfony Version](https://img.shields.io/badge/symfony-5.4-93C74B.svg)](https://symfony.com/)
7+
[![Build Status](https://github.com/darkwebdesign/symfony-addon-form-types/actions/workflows/build.yaml/badge.svg?branch=6.0)](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.0/graph/badge.svg)](https://codecov.io/gh/darkwebdesign/symfony-addon-form-types)
9+
[![PHP Version](https://img.shields.io/badge/php-8.0%2B-777BB3.svg)](https://php.net/)
10+
[![Symfony Version](https://img.shields.io/badge/symfony-6.0-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/5.4).
14+
Learn more about it in its [documentation](https://darkwebdesign.github.io/symfony-addon-pack/docs/6.0).
1515

1616
## Features
1717

composer.json

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@
99
{"name": "Raymond Schouten"}
1010
],
1111
"require": {
12-
"php": ">=7.2.5",
13-
"symfony/form": "5.4.*"
12+
"php": "^8.0",
13+
"symfony/event-dispatcher": "6.0.*",
14+
"symfony/form": "6.0.*",
15+
"symfony/options-resolver": "6.0.*"
1416
},
1517
"require-dev": {
16-
"darkwebdesign/symfony-addon-transformers": "5.4.*",
18+
"darkwebdesign/symfony-addon-transformers": "6.0.*",
1719
"doctrine/orm": "^2.7",
18-
"phpunit/phpunit": "^8.5"
20+
"friendsofphp/php-cs-fixer": "^3.58",
21+
"phpstan/extension-installer": "^1.3",
22+
"phpstan/phpstan": "^1.11",
23+
"phpstan/phpstan-doctrine": "^1.4",
24+
"phpstan/phpstan-phpunit": "^1.4",
25+
"phpstan/phpstan-symfony": "^1.4",
26+
"phpunit/phpunit": "^9.5",
27+
"rector/rector": "^1.1"
1928
},
2029
"suggest": {
2130
"darkwebdesign/symfony-addon-pack": "All Symfony add-ons bundled together",
@@ -34,5 +43,11 @@
3443
"psr-4": {
3544
"DarkWebDesign\\SymfonyAddonFormTypes\\Tests\\": "tests/"
3645
}
46+
},
47+
"config": {
48+
"allow-plugins": {
49+
"phpstan/extension-installer": true
50+
},
51+
"sort-packages": true
3752
}
3853
}

phpstan.neon.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
level: 8
3+
4+
paths:
5+
- 'src'
6+
- 'tests'

phpunit.xml.dist

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
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/8.5/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
5+
cacheResultFile=".phpunit.cache/test-results"
56
colors="true"
67
executionOrder="depends,defects"
78
forceCoversAnnotation="true"
89
beStrictAboutCoversAnnotation="true"
910
beStrictAboutOutputDuringTests="true"
1011
beStrictAboutTodoAnnotatedTests="true"
12+
convertDeprecationsToExceptions="true"
13+
failOnRisky="true"
14+
failOnWarning="true"
1115
verbose="true">
1216

1317
<testsuites>
@@ -16,10 +20,11 @@
1620
</testsuite>
1721
</testsuites>
1822

19-
<filter>
20-
<whitelist processUncoveredFilesFromWhitelist="true">
23+
<coverage cacheDirectory=".phpunit.cache/code-coverage"
24+
processUncoveredFiles="true">
25+
<include>
2126
<directory suffix=".php">src</directory>
22-
</whitelist>
23-
</filter>
27+
</include>
28+
</coverage>
2429

2530
</phpunit>

rector.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\Config\RectorConfig;
6+
use Rector\Set\ValueObject\LevelSetList;
7+
use Rector\Symfony\Set\SymfonySetList;
8+
9+
return RectorConfig::configure()
10+
->withPaths([
11+
__DIR__ . '/src',
12+
__DIR__ . '/tests',
13+
])
14+
->withSets([
15+
LevelSetList::UP_TO_PHP_80,
16+
SymfonySetList::SYMFONY_60,
17+
])
18+
->withImportNames(
19+
importShortClasses: false,
20+
);

src/BirthdayType.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Copyright (c) 2017 DarkWeb Design
3+
* Copyright (c) 2017 DarkWeb Design.
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a copy
66
* of this software and associated documentation files (the "Software"), to deal
@@ -27,27 +27,19 @@
2727
use Symfony\Component\OptionsResolver\OptionsResolver;
2828

2929
/**
30-
* Birthday form field type.
31-
*
3230
* @author Raymond Schouten
3331
*
3432
* @since 2.3
3533
*/
3634
class BirthdayType extends AbstractType
3735
{
38-
/**
39-
* Configures the options for this type.
40-
*/
4136
public function configureOptions(OptionsResolver $resolver): void
4237
{
4338
$resolver->setDefaults([
4439
'years' => range(date('Y'), date('Y') - 120),
4540
]);
4641
}
4742

48-
/**
49-
* Returns the name of the parent type.
50-
*/
5143
public function getParent(): string
5244
{
5345
return DateType::class;

0 commit comments

Comments
 (0)