Skip to content

Commit

Permalink
Prepare version 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipxe13 committed Jan 8, 2020
2 parents 33ae600 + dcce39f commit 1a8bd8d
Show file tree
Hide file tree
Showing 24 changed files with 243 additions and 118 deletions.
26 changes: 13 additions & 13 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
* text=auto

# Do not put this files on a distribution package (by .gitignore)
/vendor export-ignore
/build export-ignore
/composer.lock export-ignore
/vendor export-ignore
/composer.lock export-ignore

# Do not put this files on a distribution package
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/tests/ export-ignore
/phpcs.xml.dist export-ignore
/phpdox.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/build/ export-ignore
/tests/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpcs.xml.dist export-ignore
/phpdox.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# do not include this files on git
/vendor
/build
/composer.lock
11 changes: 8 additions & 3 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ return PhpCsFixer\Config::create()
->setCacheFile(__DIR__.'/build/.php_cs.cache')
->setRules([
'@PSR2' => true,
'psr0' => false, // do not enforce psr-0, it rewrites 'namespace Test\' to 'namespace tests\'
'@PHP70Migration' => true,
// '@PHP70Migration:risky' => true,
// symfony
'class_attributes_separation' => true,
'whitespace_after_comma_in_array' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'no_extra_blank_lines' => true,
'function_typehint_space' => true,
'no_alias_functions' => true,
'trailing_comma_in_multiline_array' => true,
Expand All @@ -24,11 +26,14 @@ return PhpCsFixer\Config::create()
'no_singleline_whitespace_before_semicolons' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'yoda_style' => ['equal' => true, 'identical' => true, 'less_and_greater' => null],
'standardize_not_equals' => true,
// contrib
'concat_space' => ['spacing' => 'one'],
'not_operator_with_successor_space' => true,
'no_blank_lines_before_namespace' => true,
'single_blank_line_before_namespace' => true,
'linebreak_after_opening_tag' => true,
'blank_line_after_opening_tag' => true,
'ordered_imports' => true,
'array_syntax' => ['syntax' => 'short'],
])
Expand Down
11 changes: 0 additions & 11 deletions .phplint.yml

This file was deleted.

28 changes: 16 additions & 12 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
filter:
excluded_paths:
- 'tests/*'
- 'vendor/*'
excluded_paths:
- 'tests/'
- 'vendor/'

checks:
build:
dependencies:
override:
- composer self-update --no-interaction --no-progress
- composer install --no-interaction
nodes:
php:
code_rating: true
duplication: true

tools:
php_code_sniffer:
config:
standard: "PSR2"
external_code_coverage: true
tests:
override:
- php-scrutinizer-run --enable-security-analysis
- command: vendor/bin/phpunit --testdox --coverage-clover=coverage.clover
coverage:
file: coverage.clover
format: clover
39 changes: 9 additions & 30 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,21 @@
language: php

# php compatibility
php:
- 7.0
- 7.1
- 7.2
- 7.3

# This triggers builds to run on the new TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false
dist: xenial

env:
- FULL_BUILD_PHP_VERSION="7.3"
# php compatibility
php: ["7.0", "7.1", "7.2", "7.3", "7.4"]

before_script:
- phpenv config-rm xdebug.ini
- phpenv config-rm xdebug.ini || true
- travis_retry composer install --no-interaction --no-progress --prefer-dist

script:
- mkdir -p build/tests/
- vendor/bin/phplint
- vendor/bin/phpcs -sp src/ tests/
- vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
- |
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
php -dzend_extension=xdebug.so vendor/bin/phpunit --testdox --verbose --coverage-text --coverage-clover=build/tests/coverage.xml
vendor/bin/phpstan.phar analyse --no-progress --level max src/ tests/
else
vendor/bin/phpunit --testdox --verbose
fi
after_script:
- |
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/tests/coverage.xml
fi
- vendor/bin/phpunit --testdox --verbose
- vendor/bin/phpstan analyse --no-progress --level max src/ tests/
- vendor/bin/psalm --no-progress

notifications:
email: false
email:
if: branch = master
42 changes: 33 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
# Version 2.1.0
# CHANGELOG

Notice: This library follows [SEMVER 2.0.0](https://semver.org/spec/v2.0.0.html) convention.

## Version 2.1.1 2020-01-08

- Improve testing, 100% code coverage, each test class uses cover related class.
- Improve Travis-CI, do not create code coverage.
- Improve Scrutinizer-CI, create code coverage.
- Change development dependence from `phpstan/phpstan-shim` to `phpstan/phpstan`.
- Remove development dependence `overtrue/phplint`.
- Remove SensioLabs Insight.
- Update documentation, licence, changelog, etc..

## Version 2.1.0

- Allow create a `SchemaValidator` instance using `DOMDocument`
- Run PHPUnit 7 on PHP >= 7.1
- Run phpstan 0.10/0.11 on PHP >= 7.1

# Version 2.0.2
## Version 2.0.2

- Fix bug when running on PHP >= 7.1 and warning was raised when call `DOMDocument::schemaValidateSource`
making impossible to obtain errors from `libxml_clear_errors` and throw a new `LibXmlException`
- Add a new test `SchemaValidatorTest::testValidateWithEmptySchema` to make sure that
a `LibXmlException` exception is raised

# Version 2.0.1
## Version 2.0.1

- Fix bug when using windows path (backslashs), it does not validate
- Add docblock to buildSchemas
- Improve building, add phpstan
- Use phplint instead of php-parallel-lint
- Update dependencies using composer-require-checker

# Version 2.0.0
## Version 2.0.0

- This version does not include `Locator` nor `DownloaderInterface` implementations.
That functionality is actually outside the scope of this library and that is the reason
why it was removed. A new library was created to implement this, take a look in
Expand All @@ -37,24 +55,29 @@
- Tests: Move files served by php built-in web server to from assets to public

# Version 1.1.4

- Fix implementation of libxml use internal errors on `SchemaValidator::validate`
- When creating the dom document avoid warnings (fix using the correct constant)
- Avoid using versions `@stable` in `composer.json`
- Install scrutinizer/ocular only on travis and PHP 7.1

# Version 1.1.3
## Version 1.1.3

- Fix test were fialing on php 7.0 and 7.1
- class PHPUnit_Framework_TestCase is deprecated
- wait for 0.5 seconds after run the php server

# Version 1.1.2
## Version 1.1.2

- Fix project name in README.md
- Add composer.json tag xmlschema

# Version 1.1.1
## Version 1.1.1

- Remove typo on .travis.yml

# Version 1.1.0
## Version 1.1.0

- This change does not introduce any break with previous versions but add a new interface and objects
to perform the download
- Library
Expand Down Expand Up @@ -83,7 +106,8 @@
- Fix badges
- Drop coveralls

# Version 1.0.0
## Version 1.0.0

- Follow recommendations from sensiolabs
- Project does not depends on zip extension
- Include SensioLabs Insight
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ If any of these do not pass, it will result in a complete build failure.
Before you can run these, be sure to `composer install` or `composer update`.

```shell
vendor/bin/phplint
vendor/bin/phpcs -sp src/ tests/
vendor/bin/php-cs-fixer fix -v --dry-run
vendor/bin/phpunit --coverage-text
vendor/bin/phpstan.phar analyse --level max src/ tests/
vendor/bin/phpunit --testdox
vendor/bin/phpstan analyse --level max src/ tests/
vendor/bin/psalm
```

## web server instance while running tests
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 - 2019 Carlos C Soto
Copyright (c) 2016 - 2020 Carlos C Soto

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# eclipxe13/XmlSchemaValidator
# eclipxe/XmlSchemaValidator

[![Source Code][badge-source]][source]
[![Latest Version][badge-release]][release]
Expand Down Expand Up @@ -80,7 +80,7 @@ and don't forget to take a look in the [TODO][] and [CHANGELOG][] files.

## Copyright and License

The eclipxe13/XmlSchemaValidator library is copyright © [Carlos C Soto](https://eclipxe.com.mx/)
The `eclipxe/XmlSchemaValidator` library is copyright © [Carlos C Soto](https://eclipxe.com.mx/)
and licensed for use under the MIT License (MIT). Please see [LICENSE][] for more information.

[contributing]: https://github.com/eclipxe13/XmlSchemaValidator/blob/master/CONTRIBUTING.md
Expand All @@ -92,15 +92,13 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
[license]: https://github.com/eclipxe13/XmlSchemaValidator/blob/master/LICENSE
[build]: https://travis-ci.org/eclipxe13/XmlSchemaValidator?branch=master
[quality]: https://scrutinizer-ci.com/g/eclipxe13/XmlSchemaValidator/
[sensiolabs]: https://insight.sensiolabs.com/projects/597c21ca-414b-446d-809d-7f940c3ca0a2
[coverage]: https://scrutinizer-ci.com/g/eclipxe13/XmlSchemaValidator/code-structure/master
[downloads]: https://packagist.org/packages/eclipxe/xmlschemavalidator

[badge-source]: http://img.shields.io/badge/source-eclipxe13/XmlSchemaValidator-blue.svg?style=flat-square
[badge-source]: https://img.shields.io/badge/source-eclipxe13/XmlSchemaValidator-blue.svg?style=flat-square
[badge-release]: https://img.shields.io/github/release/eclipxe13/XmlSchemaValidator.svg?style=flat-square
[badge-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[badge-license]: https://img.shields.io/github/license/eclipxe13/XmlSchemaValidator.svg?style=flat-square
[badge-build]: https://img.shields.io/travis/eclipxe13/XmlSchemaValidator/master.svg?style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/eclipxe13/XmlSchemaValidator/master.svg?style=flat-square
[badge-sensiolabs]: https://insight.sensiolabs.com/projects/597c21ca-414b-446d-809d-7f940c3ca0a2/mini.png
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/eclipxe13/XmlSchemaValidator/master.svg?style=flat-square
[badge-downloads]: https://img.shields.io/packagist/dt/eclipxe/xmlschemavalidator.svg?style=flat-square
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# eclipxe13/xmlschemavalidator To Do
# eclipxe/xmlschemavalidator To Do

- [ ] Document usage examples

Expand Down
2 changes: 2 additions & 0 deletions build/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
},
"require-dev": {
"phpunit/phpunit": "^6.2|^7.3",
"overtrue/phplint": "^1.0",
"squizlabs/php_codesniffer": "^3.0",
"friendsofphp/php-cs-fixer": "^2.4",
"phpstan/phpstan-shim": "^0.9|^0.10|^0.11"
"phpstan/phpstan": "^0.9|^0.10|^0.11",
"vimeo/psalm": "^3.8"
},
"autoload": {
"psr-4": {
Expand All @@ -33,11 +33,6 @@
}
},
"scripts": {
"dev:clean": [
"rm -rf build/",
"find . -type f -name .phpunit.result.cache -delete",
"mkdir -p build/"
],
"dev:build": ["@dev:fix-style", "@dev:test"],
"dev:check-style": [
"vendor/bin/php-cs-fixer fix --dry-run --verbose",
Expand All @@ -48,20 +43,20 @@
"vendor/bin/phpcbf --colors -sp src/ tests/"
],
"dev:test": [
"vendor/bin/phplint",
"@dev:check-style",
"vendor/bin/phpunit --testdox --verbose --stop-on-failure",
"vendor/bin/phpstan analyse --no-progress --level max src/ tests/"
"vendor/bin/phpstan analyse --no-progress --level max src/ tests/",
"vendor/bin/psalm --no-progress"
],
"dev:coverage": [
"@php -dzend_extension=xdebug.so vendor/bin/phpunit --coverage-text --coverage-html build/coverage/html/"
]
},
"scripts-descriptions": {
"dev:clean": "DEV: recreate build directory, remove any .phpunit.result.cache files",
"dev:build": "DEV: run dev:fix-style dev:tests and dev:docs, run before pull request",
"dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs",
"dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf",
"dev:test": "DEV: run phplint, phpunit and phpstan",
"dev:test": "DEV: dev:check-style, phpunit and phpstan",
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/"
}
}
19 changes: 19 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>

<issueHandlers>
<LessSpecificReturnType errorLevel="info" />
</issueHandlers>
</psalm>
Loading

0 comments on commit 1a8bd8d

Please sign in to comment.