Skip to content

Commit cfff686

Browse files
authored
Merge pull request #92 from wol-soft/BuilderClassPostProcessor
BuilderClassPostProcessor
2 parents b7c40c6 + 53117fa commit cfff686

File tree

60 files changed

+1347
-545
lines changed

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

+1347
-545
lines changed

.codeclimate.yml

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

.github/workflows/main.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on: [push, pull_request]
55
jobs:
66
tests:
77
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
id-token: write
11+
812
strategy:
913
matrix:
1014
php: ['8.0', '8.1', '8.3', '8.4', '8.5']
@@ -21,33 +25,37 @@ jobs:
2125
uses: shivammathur/setup-php@v2
2226
with:
2327
php-version: ${{ matrix.php }}
24-
extensions: mbstring, json
28+
extensions: mbstring
2529
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
2630

2731
- name: Install dependencies
2832
run: composer update --no-interaction
2933

34+
# Run tests WITHOUT coverage on non-coverage matrix jobs
3035
- name: Execute tests
31-
if: ${{ ! matrix.coverage }}
32-
run: |
33-
./vendor/bin/phpunit --testdox
36+
if: ${{ !matrix.coverage }}
37+
run: ./vendor/bin/phpunit --testdox
3438

35-
- name: Upload the reports to codeclimate
39+
# Run tests WITH Clover coverage for the coverage job
40+
- name: Execute tests with coverage (Clover)
3641
if: ${{ matrix.coverage }}
3742
env:
3843
XDEBUG_MODE: coverage
39-
CC_TEST_REPORTER_ID: 5e32818628fac9eb11d34e2b35289f88169610cc4a98c6f170c74923342284f1
40-
uses: paambaati/codeclimate-action@v9
44+
run: ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox
45+
46+
- name: Upload coverage to Qlty
47+
if: ${{ matrix.coverage }}
48+
uses: qltysh/qlty-action/coverage@v2
4149
with:
42-
coverageCommand: |
43-
./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox
50+
oidc: true
51+
files: build/logs/clover.xml
4452

4553
- name: Upload the reports to coveralls.io
4654
if: ${{ matrix.coverage }}
47-
env:
48-
COVERALLS_REPO_TOKEN: ${{ github.token }}
4955
uses: coverallsapp/github-action@v2
5056
with:
51-
github-token: ${{ env.COVERALLS_REPO_TOKEN }}
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
file: build/logs/clover.xml
59+
format: clover
5260
flag-name: Unit
53-
allow-empty: false
61+
allow-empty: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Latest Version](https://img.shields.io/packagist/v/wol-soft/php-json-schema-model-generator.svg)](https://packagist.org/packages/wol-soft/php-json-schema-model-generator)
22
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg)](https://php.net/)
3-
[![Maintainability](https://api.codeclimate.com/v1/badges/7eb29e7366dc3d6a5f44/maintainability)](https://codeclimate.com/github/wol-soft/php-json-schema-model-generator/maintainability)
3+
[![Maintainability](https://qlty.sh/gh/wol-soft/projects/php-json-schema-model-generator/maintainability.svg)](https://qlty.sh/gh/wol-soft/projects/php-json-schema-model-generator)
44
[![Build Status](https://github.com/wol-soft/php-json-schema-model-generator/actions/workflows/main.yml/badge.svg)](https://github.com/wol-soft/php-json-schema-model-generator/actions/workflows/main.yml)
55
[![Coverage Status](https://coveralls.io/repos/github/wol-soft/php-json-schema-model-generator/badge.svg?branch=master)](https://coveralls.io/github/wol-soft/php-json-schema-model-generator?branch=master)
66
[![MIT License](https://img.shields.io/packagist/l/wol-soft/php-json-schema-model-generator.svg)](https://github.com/wol-soft/php-json-schema-model-generator/blob/master/LICENSE)

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
],
1313
"require": {
1414
"symfony/polyfill-php81": "^1.28",
15-
"wol-soft/php-json-schema-model-generator-production": "^0.19.0",
16-
"wol-soft/php-micro-template": "^1.9.0",
15+
"wol-soft/php-json-schema-model-generator-production": "dev-BuilderClassPostProcessor",
16+
"wol-soft/php-micro-template": "^1.10.0",
1717

1818
"php": ">=8.0",
19-
"ext-json": "*",
2019
"ext-mbstring": "*"
2120
},
2221
"require-dev": {

docs/source/combinedSchemas/allOf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Generated interface:
3030

3131
.. code-block:: php
3232
33-
public function setExample(float $example): self;
33+
public function setExample(float $example): static;
3434
public function getExample(): float;
3535
3636

docs/source/combinedSchemas/anyOf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Generated interface:
3030

3131
.. code-block:: php
3232
33-
public function setExample(float $example): self;
33+
public function setExample(float $example): static;
3434
public function getExample(): float;
3535
3636

docs/source/combinedSchemas/if.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Generated interface:
3030

3131
.. code-block:: php
3232
33-
public function setExample(float $example): self;
33+
public function setExample(float $example): static;
3434
public function getExample(): ?float;
3535
3636
Possible exception (in this case 50 was provided so the if condition succeeds but the then branch failed):
@@ -112,8 +112,8 @@ Generated interface:
112112

113113
.. code-block:: php
114114
115-
public function setCountry(string $country): self;
115+
public function setCountry(string $country): static;
116116
public function getCountry(): ?string;
117117
118-
public function setPostalCode(string $country): self;
118+
public function setPostalCode(string $country): static;
119119
public function getPostalCode(): ?string;

docs/source/combinedSchemas/mergedProperty.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ Generated interface:
5353
.. code-block:: php
5454
5555
# class Company
56-
public function setCeo(?Company_Merged_CEO $example): self;
56+
public function setCeo(Company_Merged_CEO $example): static;
5757
public function getCeo(): ?Company_Merged_CEO;
5858
5959
# class Company_Merged_CEO
6060
public function getName(): ?string
61-
public function setName(?string $name): self
61+
public function setName(string $name): static
6262
public function getAge(): ?int
63-
public function setAge(?int $name): self
63+
public function setAge(int $name): static
6464
6565
If your composition is defined on object level the object will gain access to all properties of the combined schemas:
6666

@@ -99,6 +99,6 @@ This schema will generate three classes as no merged property is created. The ma
9999
100100
# class CEO
101101
public function getName(): ?string
102-
public function setName(?string $name): self
102+
public function setName(string $name): static
103103
public function getAge(): ?int
104-
public function setAge(?int $name): self
104+
public function setAge(int $name): static

docs/source/combinedSchemas/not.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Generated interface:
2121

2222
.. code-block:: php
2323
24-
public function setExample($example): self;
24+
public function setExample($example): static;
2525
public function getExample();
2626
2727

docs/source/combinedSchemas/oneOf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Generated interface:
3030

3131
.. code-block:: php
3232
33-
public function setExample(float $example): self;
33+
public function setExample(float $example): static;
3434
public function getExample(): float;
3535
3636

0 commit comments

Comments
 (0)