Skip to content

Commit

Permalink
Prepare version 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipxe13 committed Apr 5, 2020
2 parents 28930dc + 10d4336 commit 7683a64
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## Version 2.1.2 2020-04-05

- Internal change to split namespace and xsd location using `preg_split`.
- Introduce deprecation notice on version `2.x`.
- Update travis badges and link.

## Version 2.1.1 2020-01-08

- Improve testing, 100% code coverage, each test class uses cover related class.
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ issues: Validate an XML file and store locally a copy of the XSD files.
Version 2.x breaks this problem and give this library only one propose:
Validate an XML file against its multiple XSD files, it does not matter where are located.

Also, version 2.x uses PHP 7 with scalar type declarations, so it no longer compatible with PHP 5.6.
## Version 2.x is deprecated

Version 2.x was compatible with PHP 7 and was deprecated on 2020-04-05.

A branch `2.x` has been created, it might be installable using `composer require eclipxe/xmlschemavalidator:2.x-dev`,
but it will not be active maintained and you should change your dependency as soon as possible.

## Contributing

Expand All @@ -90,15 +95,15 @@ and licensed for use under the MIT License (MIT). Please see [LICENSE][] for mor
[source]: https://github.com/eclipxe13/XmlSchemaValidator
[release]: https://github.com/eclipxe13/XmlSchemaValidator/releases
[license]: https://github.com/eclipxe13/XmlSchemaValidator/blob/master/LICENSE
[build]: https://travis-ci.org/eclipxe13/XmlSchemaValidator?branch=master
[build]: https://travis-ci.com/eclipxe13/XmlSchemaValidator?branch=master
[quality]: https://scrutinizer-ci.com/g/eclipxe13/XmlSchemaValidator/
[coverage]: https://scrutinizer-ci.com/g/eclipxe13/XmlSchemaValidator/code-structure/master
[downloads]: https://packagist.org/packages/eclipxe/xmlschemavalidator

[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/github/license/eclipxe13/XmlSchemaValidator.svg?style=flat-square
[badge-build]: https://img.shields.io/travis/eclipxe13/XmlSchemaValidator/master.svg?style=flat-square
[badge-build]: https://img.shields.io/travis/com/eclipxe13/XmlSchemaValidator/master.svg?style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/eclipxe13/XmlSchemaValidator/master.svg?style=flat-square
[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
8 changes: 1 addition & 7 deletions src/XmlSchemaValidator/SchemaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,8 @@ public function buildSchemas(): Schemas
foreach ($schemasList as $node) {
// get the node content
$content = $node->nodeValue;

// get parts without inner spaces
// $parts = array_values(array_filter(explode(' ', $content)));

// 2020-04-03 DDW - use preg_split to handle all types of whitespace? not necessary! $xpath-query appears to remove
// vertical whitespace and convert tabs to spaces. But preg_split is a little more elegant.....
$parts = preg_split('/[\s]+/', $content);

$parts = preg_split('/\s+/', $content) ?: [];
$partsCount = count($parts);
// check that the list count is an even number
if (0 !== $partsCount % 2) {
Expand Down
3 changes: 2 additions & 1 deletion tests/XmlSchemaValidatorTests/SchemaValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public function testValidateWithNoSchema()
);
}

public function testValidateWithVariousWhitespaceInSchemaDeclaration() {
public function testValidateWithVariousWhitespaceInSchemaDeclaration()
{
$validator = $this->utilCreateValidator('books-valid-with-extra-whitespace-in-schema-declaration.xml');
$this->assertTrue($validator->validate());
}
Expand Down

0 comments on commit 7683a64

Please sign in to comment.