-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'support-redefine-php8' into support-redefine
- Loading branch information
Showing
62 changed files
with
4,072 additions
and
1,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
# These are supported funding model platforms | ||
|
||
github: goetas | ||
patreon: goetas | ||
custom: https://www.goetas.com/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
name: Build and test | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
name: Build (PHP ${{ matrix.php-versions }}) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1', '8.2'] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: | | ||
dir="$(composer config cache-files-dir)" | ||
echo "dir=$dir" >> $GITHUB_OUTPUT | ||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
test: | ||
name: Tests (PHP ${{ matrix.php-versions }}) | ||
runs-on: ubuntu-latest | ||
needs: build | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1', '8.2'] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
# Docs: https://github.com/shivammathur/setup-php | ||
- name: Setup PHP with PCOV | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
tools: php-cs-fixer, phpunit-bridge | ||
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql | ||
coverage: pcov | ||
#ini-values: post_max_size=256M, max_execution_time=180 | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run unit tests with coverage | ||
run: ./vendor/bin/phpunit | ||
|
||
- name: Determine coverage badge | ||
uses: timkrase/phpunit-coverage-badge@main | ||
with: | ||
push_badge: true | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
qa-phpstan: | ||
name: QA - Run phpstan (PHP ${{ matrix.php-versions }}) | ||
runs-on: ubuntu-latest | ||
needs: test | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1']#, '8.2'] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run phpstan | ||
run: ./vendor/bin/phpstan analyse -c ./phpstan.neon --level 6 src | ||
|
||
qa-psalm: | ||
name: QA - Run psalm (PHP ${{ matrix.php-versions }}) | ||
runs-on: ubuntu-latest | ||
needs: test | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1']#, '8.2'] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run psalm | ||
run: ./vendor/bin/psalm | ||
|
||
qa-phpcpd: | ||
name: QA - Run phpcpd (PHP ${{ matrix.php-versions }}) | ||
runs-on: ubuntu-latest | ||
needs: test | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1']#, '8.2'] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run phpcpd | ||
run: ./vendor/bin/phpcpd ./src/ | ||
|
||
qa-cs-fixer: | ||
name: QA - Run php-cs-fixer (PHP ${{ matrix.php-versions }}) | ||
runs-on: ubuntu-latest | ||
needs: test | ||
strategy: | ||
matrix: | ||
php-versions: ['8.1']#, '8.2'] | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Run php-cs-fixer | ||
run: ./vendor/bin/php-cs-fixer fix --verbose --allow-risky=yes --dry-run --config ".php-cs-fixer.dist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ vendor/ | |
/.php_cs.cache | ||
/phpunit/ | ||
/composer.lock | ||
/.phpunit.result.cache | ||
/.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
// see also https://github.com/symfony/symfony/blob/6.1/.php-cs-fixer.dist.php | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PHP81Migration' => true, | ||
'@PHPUnit84Migration:risky' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'combine_nested_dirname' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'fopen_flags' => false, | ||
'mb_str_functions' => true, | ||
'native_constant_invocation' => false, | ||
'native_function_invocation' => false, | ||
'no_short_bool_cast' => true, | ||
'nullable_type_declaration_for_default_null_value' => true, | ||
'phpdoc_align' => ['align' => 'left'], | ||
'phpdoc_to_comment' => false, // for custom annotations (e.g. php-translation) | ||
'phpdoc_to_param_type' => true, | ||
'phpdoc_to_return_type' => true, | ||
'php_unit_test_annotation' => false, // breaks "@depends App\Something::testFooBar()" | ||
'protected_to_private' => false, | ||
'simplified_null_return' => true, | ||
'no_unreachable_default_argument_value' => false, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder( | ||
(new PhpCsFixer\Finder()) | ||
->in([ | ||
'src', | ||
'tests' | ||
]) | ||
->notPath('#/Fixtures/#') | ||
->notPath('#/vendor/#') | ||
) | ||
->setCacheFile('.php-cs-fixer.cache') | ||
; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,55 @@ | ||
[![Build Status](https://travis-ci.org/goetas-webservices/xsd-reader.svg?branch=master)](https://travis-ci.org/goetas-webservices/xsd-reader) | ||
[![Code Coverage](https://scrutinizer-ci.com/g/goetas-webservices/xsd-reader/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/goetas-webservices/xsd-reader/?branch=master) | ||
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/goetas-webservices/xsd-reader/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/goetas-webservices/xsd-reader/?branch=master) | ||
[![Build status](https://github.com/goetas-webservices/xsd-reader/workflows/Build%20and%20test/badge.svg)](https://github.com/goetas-webservices/xsd-reader/actions?query=workflow%3A"Build+and+test") | ||
![Code Coverage Badge](./coverage_badge.svg) | ||
|
||
|
||
PHP XSD Reader | ||
============== | ||
# PHP XSD Reader | ||
|
||
Read any [XML Schema](http://www.w3.org/XML/Schema) (XSD) programmatically with PHP. | ||
|
||
|
||
Installation | ||
------------ | ||
## Installation | ||
|
||
The recommended way to install the `xsd-reader` via [Composer](https://getcomposer.org/): | ||
|
||
```bash | ||
composer require 'goetas-webservices/xsd-reader' | ||
``` | ||
|
||
Getting started | ||
--------------- | ||
## Getting started | ||
|
||
```php | ||
use GoetasWebservices\XML\XSDReader\SchemaReader; | ||
|
||
$reader = new SchemaReader(); | ||
$schema = $reader->readFile("http://www.example.com/exaple.xsd"); | ||
$schema = $reader->readFile("http://www.example.com/example.xsd"); | ||
|
||
// $schema is instance of GoetasWebservices\XML\XSDReader\Schema\Schema; | ||
|
||
// Now you can navigate the entire schema structure | ||
|
||
foreach ($schema->getSchemas() as $innerSchema){ | ||
foreach ($schema->getSchemas() as $innerSchema) { | ||
|
||
} | ||
foreach ($schema->getTypes() as $type){ | ||
foreach ($schema->getTypes() as $type) { | ||
|
||
} | ||
foreach ($schema->getElements() as $element){ | ||
foreach ($schema->getElements() as $element) { | ||
|
||
} | ||
foreach ($schema->getGroups() as $group){ | ||
foreach ($schema->getGroups() as $group) { | ||
|
||
} | ||
foreach ($schema->getAttributes() as $attr){ | ||
foreach ($schema->getAttributes() as $attr) { | ||
|
||
} | ||
foreach ($schema->getAttributeGroups() as $attrGroup){ | ||
foreach ($schema->getAttributeGroups() as $attrGroup) { | ||
|
||
} | ||
``` | ||
## Note | ||
|
||
The code in this project is provided under the | ||
[MIT](https://opensource.org/licenses/MIT) license. | ||
For professional support | ||
contact [[email protected]](mailto:[email protected]) | ||
## Note | ||
|
||
The code in this project is provided under the | ||
[MIT](https://opensource.org/licenses/MIT) license. | ||
For professional support | ||
contact [[email protected]](mailto:[email protected]) | ||
or visit [https://www.goetas.com](https://www.goetas.com) |
Oops, something went wrong.