Skip to content

Commit f4fdf7a

Browse files
authored
Merge pull request #49 from ergebnis/feature/synchronize
Enhancement: Synchronize with ergebnis/php-library-template
2 parents 9d25bba + f2e6ca0 commit f4fdf7a

37 files changed

+139
-103
lines changed

.dependabot/config.yml

-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ update_configs:
99
commit_message:
1010
include_scope: true
1111
prefix: "Build"
12-
default_assignees:
13-
- "ergebnis-bot"
14-
- "localheinz"
1512
default_labels:
1613
- "dependency"
17-
default_reviewers:
18-
- "ergebnis-bot"
19-
- "localheinz"
2014
directory: "/"
2115
package_manager: "php:composer"
2216
update_schedule: "live"

.github/settings.yml

+2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ repository:
7575
allow_merge_commit: true
7676
allow_rebase_merge: false
7777
allow_squash_merge: false
78+
archived: false
7879
default_branch: "master"
80+
delete_branch_on_merge: true
7981
description: ":notebook: Provides a configuration factory and multiple rule sets for friendsofphp/php-cs-fixer."
8082
has_downloads: true
8183
has_issues: true

.github/workflows/continuous-integration.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
env:
1212
MIN_COVERED_MSI: 100
1313
MIN_MSI: 100
14-
REQUIRED_PHP_EXTENSIONS: "filter, mbstring"
14+
REQUIRED_PHP_EXTENSIONS: "mbstring"
1515

1616
jobs:
1717
coding-standards:
@@ -32,7 +32,7 @@ jobs:
3232
uses: "actions/[email protected]"
3333

3434
- name: "Install PHP with extensions"
35-
uses: "shivammathur/[email protected].0"
35+
uses: "shivammathur/[email protected].3"
3636
with:
3737
coverage: "none"
3838
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -94,7 +94,7 @@ jobs:
9494
uses: "actions/[email protected]"
9595

9696
- name: "Install PHP with extensions"
97-
uses: "shivammathur/[email protected].0"
97+
uses: "shivammathur/[email protected].3"
9898
with:
9999
coverage: "none"
100100
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -140,7 +140,7 @@ jobs:
140140
uses: "actions/[email protected]"
141141

142142
- name: "Install PHP with extensions"
143-
uses: "shivammathur/[email protected].0"
143+
uses: "shivammathur/[email protected].3"
144144
with:
145145
coverage: "none"
146146
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -200,7 +200,7 @@ jobs:
200200
uses: "actions/[email protected]"
201201

202202
- name: "Install PHP with extensions"
203-
uses: "shivammathur/[email protected].0"
203+
uses: "shivammathur/[email protected].3"
204204
with:
205205
coverage: "none"
206206
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -252,7 +252,7 @@ jobs:
252252
uses: "actions/[email protected]"
253253

254254
- name: "Install PHP with extensions"
255-
uses: "shivammathur/[email protected].0"
255+
uses: "shivammathur/[email protected].3"
256256
with:
257257
coverage: "xdebug"
258258
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -306,7 +306,7 @@ jobs:
306306
uses: "actions/[email protected]"
307307

308308
- name: "Install PHP with extensions"
309-
uses: "shivammathur/[email protected].0"
309+
uses: "shivammathur/[email protected].3"
310310
with:
311311
coverage: "xdebug"
312312
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -334,8 +334,8 @@ jobs:
334334
- name: "Run mutation tests with Xdebug and infection/infection"
335335
run: "vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${{ env.MIN_COVERED_MSI }} --min-msi=${{ env.MIN_MSI }}"
336336

337-
approve:
338-
name: "Approve"
337+
review:
338+
name: "Review"
339339

340340
runs-on: "ubuntu-latest"
341341

@@ -353,3 +353,9 @@ jobs:
353353
if: "(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')"
354354
with:
355355
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
356+
357+
- name: "Approve pull requests created by @ergebnis-bot that update the license year"
358+
uses: "hmarr/[email protected]"
359+
if: "github.actor == 'ergebnis-bot' && github.event_name == 'pull_request' && github.event.pull_request.title == 'Enhancement: Update license year'"
360+
with:
361+
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"

.github/workflows/license.yml

+16-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
22

3-
name: "Approve"
3+
name: "License"
44

55
on:
66
schedule:
77
- cron: "1 0 1 1 *"
88

99
env:
10-
REQUIRED_PHP_EXTENSIONS: "filter, mbstring"
10+
REQUIRED_PHP_EXTENSIONS: "mbstring"
1111

1212
jobs:
13-
approve:
13+
license:
1414
name: "License"
1515

1616
runs-on: "ubuntu-latest"
@@ -28,7 +28,7 @@ jobs:
2828
uses: "actions/[email protected]"
2929

3030
- name: "Install PHP with extensions"
31-
uses: "shivammathur/[email protected].0"
31+
uses: "shivammathur/[email protected].3"
3232
with:
3333
coverage: "none"
3434
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
@@ -69,10 +69,17 @@ jobs:
6969
- name: "Run friendsofphp/php-cs-fixer"
7070
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"
7171

72-
- name: "Commit files with updated license year"
73-
uses: "stefanzweifel/git-auto-commit-action@v2.5.0"
72+
- name: "Open pull request updating license year"
73+
uses: "gr2m/create-or-update-pull-request-action@v1.2.9"
7474
with:
75-
branch: "master"
76-
commit_message: "Enhancement: Update license year"
75+
author: "ergebnis-bot <[email protected]>"
76+
branch: "feature/license-year"
77+
body: |
78+
This PR
79+
80+
* [x] updates the license year
81+
commit-message: "Enhancement: Update license year"
82+
path: "."
83+
title: "Enhancement: Update license year"
7784
env:
78-
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_GITHUB_TOKEN }}"
85+
GITHUB_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"

.php_cs

+12-46
Original file line numberDiff line numberDiff line change
@@ -6,61 +6,27 @@ declare(strict_types=1);
66
* Copyright (c) 2019-2020 Andreas Möller
77
*
88
* For the full copyright and license information, please view
9-
* the LICENSE file that was distributed with this source code.
9+
* the LICENSE.md file that was distributed with this source code.
1010
*
1111
* @see https://github.com/ergebnis/php-cs-fixer-config
1212
*/
1313

14+
use Ergebnis\License;
1415
use Ergebnis\PhpCsFixer\Config;
1516

16-
$years = Config\License\Copyright\Years::fromRange(
17-
Config\License\Copyright\Year::fromString('2019'),
18-
Config\License\Copyright\Year::current()
19-
);
20-
21-
$holder = Config\License\Copyright\Holder::fromString('Andreas Möller');
22-
23-
$file = Config\License\File::create(
24-
$years,
25-
$holder,
26-
Config\License\Template::fromString(
27-
<<<'EOF'
28-
The MIT License (MIT)
29-
30-
Copyright (c) <copyright-years> <copyright-holder>
31-
32-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
33-
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
34-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
35-
persons to whom the Software is furnished to do so, subject to the following conditions:
36-
37-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
38-
Software.
39-
40-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
41-
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
42-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
43-
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44-
45-
EOF
46-
)
47-
);
48-
49-
$file->saveAs(__DIR__ . '/LICENSE');
50-
51-
$header = Config\License\Header::create(
52-
$years,
53-
$holder,
54-
Config\License\Notice::fromString(
55-
<<<'EOF'
56-
For the full copyright and license information, please view
57-
the LICENSE file that was distributed with this source code.
58-
EOF
17+
$license = License\Type\MIT::markdown(
18+
__DIR__ . '/LICENSE.md',
19+
License\Range::since(
20+
License\Year::fromString('2019'),
21+
new \DateTimeZone('UTC')
5922
),
60-
Config\License\Url::fromString('https://github.com/ergebnis/php-cs-fixer-config')
23+
License\Holder::fromString('Andreas Möller'),
24+
License\Url::fromString('https://github.com/ergebnis/php-cs-fixer-config')
6125
);
6226

63-
$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($header->toString()));
27+
$license->save();
28+
29+
$config = Config\Factory::fromRuleSet(new Config\RuleSet\Php71($license->header()));
6430

6531
$config->getFinder()
6632
->ignoreDotFiles(false)

LICENSE renamed to LICENSE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
The MIT License (MIT)
1+
# The MIT License (MIT)
22

33
Copyright (c) 2019-2020 Andreas Möller
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6-
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
77
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
88
persons to whom the Software is furnished to do so, subject to the following conditions:
99

1010
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
1111
Software.
1212

13-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
1414
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1515
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1616
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
[![Continuous Deployment](https://github.com/ergebnis/php-cs-fixer-config/workflows/Continuous%20Deployment/badge.svg)](https://github.com/ergebnis/php-cs-fixer-config/actions)
44
[![Continuous Integration](https://github.com/ergebnis/php-cs-fixer-config/workflows/Continuous%20Integration/badge.svg)](https://github.com/ergebnis/php-cs-fixer-config/actions)
5+
56
[![Code Coverage](https://codecov.io/gh/ergebnis/php-cs-fixer-config/branch/master/graph/badge.svg)](https://codecov.io/gh/ergebnis/php-cs-fixer-config)
67
[![Type Coverage](https://shepherd.dev/github/ergebnis/php-cs-fixer-config/coverage.svg)](https://shepherd.dev/github/ergebnis/php-cs-fixer-config)
8+
79
[![Latest Stable Version](https://poser.pugx.org/ergebnis/php-cs-fixer-config/v/stable)](https://packagist.org/packages/ergebnis/php-cs-fixer-config)
810
[![Total Downloads](https://poser.pugx.org/ergebnis/php-cs-fixer-config/downloads)](https://packagist.org/packages/ergebnis/php-cs-fixer-config)
911

@@ -268,7 +270,7 @@ Please have a look at [`CODE_OF_CONDUCT.md`](https://github.com/ergebnis/.github
268270

269271
## License
270272

271-
This package is licensed using the MIT License.
273+
This package is licensed using the [MIT License](LICENSE.md).
272274

273275
## Credits
274276

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
},
1818
"require-dev": {
1919
"ergebnis/composer-normalize": "^2.2.2",
20+
"ergebnis/license": "~0.1.0",
2021
"ergebnis/phpstan-rules": "~0.14.2",
2122
"ergebnis/test-util": "~0.9.1",
2223
"infection/infection": "~0.13.6",

composer.lock

+59-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Factory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2019-2020 Andreas Möller
77
*
88
* For the full copyright and license information, please view
9-
* the LICENSE file that was distributed with this source code.
9+
* the LICENSE.md file that was distributed with this source code.
1010
*
1111
* @see https://github.com/ergebnis/php-cs-fixer-config
1212
*/

src/License/Copyright/Holder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2019-2020 Andreas Möller
77
*
88
* For the full copyright and license information, please view
9-
* the LICENSE file that was distributed with this source code.
9+
* the LICENSE.md file that was distributed with this source code.
1010
*
1111
* @see https://github.com/ergebnis/php-cs-fixer-config
1212
*/

src/License/Copyright/Year.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2019-2020 Andreas Möller
77
*
88
* For the full copyright and license information, please view
9-
* the LICENSE file that was distributed with this source code.
9+
* the LICENSE.md file that was distributed with this source code.
1010
*
1111
* @see https://github.com/ergebnis/php-cs-fixer-config
1212
*/

src/License/Copyright/Years.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright (c) 2019-2020 Andreas Möller
77
*
88
* For the full copyright and license information, please view
9-
* the LICENSE file that was distributed with this source code.
9+
* the LICENSE.md file that was distributed with this source code.
1010
*
1111
* @see https://github.com/ergebnis/php-cs-fixer-config
1212
*/

0 commit comments

Comments
 (0)