Skip to content

Commit d8ac0a4

Browse files
committed
Merge branch 'release/4.1.8'
2 parents f0393bc + 2eec5d9 commit d8ac0a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1678
-9374
lines changed

.github/workflows/sonars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Monitor coverage
3434
uses: slavcodev/coverage-monitor-action@v1
3535
with:
36-
github_token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
36+
github_token: ${{ secrets.GITHUB_TOKEN }}
3737
coverage_path: coverage.xml
3838
threshold_alert: 95
3939
threshold_warning: 90
@@ -44,5 +44,5 @@ jobs:
4444
- name: SonarCloud Scan
4545
uses: SonarSource/sonarcloud-github-action@master
4646
env:
47-
GITHUB_TOKEN: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4848
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/static_coverage.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy code coverage content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches: ["develop"]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Single deploy job since we're just deploying
26+
deploy:
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Setup PHP with Xdebug
38+
uses: shivammathur/setup-php@v2
39+
with:
40+
php-version: 7.4
41+
coverage: xdebug
42+
43+
- name: Install dependencies with composer
44+
run: composer update --no-ansi --no-interaction --no-progress
45+
46+
- name: Generate coverage report with phpunit
47+
run: vendor/bin/phpunit --coverage-html=coverage
48+
49+
- name: Setup Pages
50+
uses: actions/configure-pages@v3
51+
52+
- name: Upload artifact
53+
uses: actions/upload-pages-artifact@v1
54+
with:
55+
# Upload entire repository
56+
path: 'coverage'
57+
58+
- name: Deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v2

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# CHANGELOG
22

3+
## 4.1.8 - 2023-04-20
4+
- issue #285, pr #288 - Type-Error when using regex pattern for decimal restriction
5+
- issue #292, pr #293 - Wrong type for gYearMonth and gMonthDay
6+
- pr #291 - Only cover src dir
7+
- pr #281 - Add Rector PHP to ease code improvement
8+
- issue #255, pr #283 - Class inheritance possibly misbehaving when having restriction tag
9+
- issue #280, pr #282 - Optional parameters before required ones in constructor
10+
11+
## 4.1.7 - 2023-02-20
12+
- Fix Github release workflow
13+
-
314
## 4.1.6 - 2023-02-20
415
- issue #266, pr #270 - Usage of an undefined constant within a generate EnumType class #266
516
- pr #267 - Remove deprecated message

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ Developers who helped on this project are listed in the [composer.json](composer
162162
- [Clifford Vickrey](https://github.com/cliffordvickrey)
163163
- [Arnaud POINTET](https://github.com/Oipnet)
164164
- [dypa](https://github.com/dypa)
165+
- [tbreuss](https://github.com/tbreuss)
165166

166167
## FAQ
167168

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
{
8888
"name": "dypa",
8989
"role": "Contributor"
90+
},
91+
{
92+
"name": "tbreuss",
93+
"email": "thomasbreuss@gmx.ch",
94+
"role": "Contributor"
9095
}
9196
],
9297
"support" : {
@@ -110,12 +115,14 @@
110115
"test": "php-7.4 vendor/bin/phpunit",
111116
"lint": "php-7.4 vendor/bin/php-cs-fixer fix --ansi --diff --verbose",
112117
"build": "php-7.4 box build --verbose",
113-
"phpstan": "php-7.4 vendor/bin/phpstan analyze src --level=2"
118+
"phpstan": "php-7.4 vendor/bin/phpstan analyze src --level=2",
119+
"rector": "php-7.4 vendor/bin/rector process"
114120
},
115121
"require-dev": {
116122
"friendsofphp/php-cs-fixer": "^3.0",
117123
"phpstan/phpstan": "^1.3",
118-
"phpunit/phpunit": "^9"
124+
"phpunit/phpunit": "^9",
125+
"rector/rector": "^0.15.17"
119126
},
120127
"autoload": {
121128
"psr-4": {

phpunit.xml.dist

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="vendor/autoload.php">
33
<coverage>
44
<include>
5-
<directory>./</directory>
5+
<directory>src</directory>
66
</include>
7-
<exclude>
8-
<directory>./src/resources</directory>
9-
<directory>./tests</directory>
10-
<directory>./vendor</directory>
11-
</exclude>
127
</coverage>
138
<php>
149
<ini name="error_reporting" value="-1"/>

rector.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
6+
use Rector\CodeQuality\Rector\ClassMethod\ReturnTypeFromStrictScalarReturnExprRector;
7+
use Rector\Config\RectorConfig;
8+
use Rector\Set\ValueObject\LevelSetList;
9+
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector;
10+
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedPropertyRector;
11+
12+
return static function (RectorConfig $rectorConfig): void {
13+
$rectorConfig->paths([
14+
__DIR__.'/src',
15+
__DIR__.'/tests',
16+
]);
17+
$rectorConfig->skip([
18+
__DIR__.'/tests/resources',
19+
]);
20+
// define sets of rules
21+
$rectorConfig->sets([
22+
LevelSetList::UP_TO_PHP_74,
23+
]);
24+
25+
// replace fully qualified class name by use statements
26+
$rectorConfig->importShortClasses(false);
27+
// keep native PHP class short name import
28+
$rectorConfig->importNames();
29+
30+
// register a single rule
31+
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
32+
$rectorConfig->rule(ReturnTypeFromStrictNativeCallRector::class);
33+
$rectorConfig->rule(ReturnTypeFromStrictScalarReturnExprRector::class);
34+
$rectorConfig->rule(ReturnTypeFromStrictTypedPropertyRector::class);
35+
};

src/Command/GeneratePackageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ protected function formatOptionValue($optionValue)
363363
protected function formatArrayForConsole(array $array): array
364364
{
365365
array_walk($array, function (&$value, $index) {
366-
$value = sprintf('%s: %s', $index, json_encode($value));
366+
$value = sprintf('%s: %s', $index, json_encode($value, JSON_THROW_ON_ERROR));
367367
});
368368

369369
return $array;

src/ConfigurationReader/AbstractReservedWord.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ abstract class AbstractReservedWord extends AbstractYamlReader
1010
public const CASE_SENSITIVE_KEY = 'case_sensitive';
1111
public const CASE_INSENSITIVE_KEY = 'case_insensitive';
1212

13-
protected array $keywords;
13+
protected array $keywords = [];
1414

1515
protected function __construct(string $filename)
1616
{
17-
$this->keywords = [];
1817
$this->parseReservedKeywords($filename);
1918
}
2019

src/ConfigurationReader/AbstractYamlReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static function instance(?string $filename = null): self
2323
throw new \InvalidArgumentException(sprintf('Unable to locate file "%s"', $loadFilename), __LINE__);
2424
}
2525

26-
$key = sprintf('%s_%s', get_called_class(), $loadFilename);
26+
$key = sprintf('%s_%s', static::class, $loadFilename);
2727
if (!isset(self::$instances[$key])) {
2828
self::$instances[$key] = new static($loadFilename);
2929
}

0 commit comments

Comments
 (0)