Skip to content

Commit

Permalink
Version 2.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipxe13 committed Sep 11, 2019
2 parents cc6c1a7 + f8ac9d7 commit 7726eff
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 68 deletions.
6 changes: 6 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
languages:
PHP: true
exclude_paths:
- "tests/"
- "vendor/"
- "build/"
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
root = true

[*]
indent_style: space
indent_size: 4
end_of_line: lf
indent_style = space
indent_size = 4
end_of_line = lf

[**.{php,md,xml,yml,json,dist}]
charset = utf-8
trim_trailing_whitespace: true
trim_trailing_whitespace = true
insert_final_newline = true
9 changes: 7 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@

# Do not put this files on a distribution package
/tests/ export-ignore
/.appveyor.xml export-ignore
/.codeclimate.yml export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.markdownlint.json export-ignore
/.php_cs.dist export-ignore
/.phplint.yml export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/mkdocs.yml export-ignore
/package.json export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/mkdocs.yml export-ignore
/.markdownlint.json export-ignore

3 changes: 0 additions & 3 deletions .symfony.insight.yaml

This file was deleted.

98 changes: 60 additions & 38 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,83 @@ language: php

# php compatibility
php:
- 7.0
- 7.1
- 7.2
- 7.3
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4snapshot"

matrix:
allow_failures:
- php: "7.4snapshot"

branches:
except:
- appveyor # exclude appveyor branch
except:
- appveyor

before_install:
- nvm install 8
- nvm install 8

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

addons:
apt:
packages:
- libsaxonb-java
apt:
packages:
- libsaxonb-java

env:
- FULL_BUILD_PHP_VERSION="7.3"
global:
- FULL_BUILD_PHP_VERSION="7.3"
- COVERAGE_FILE=build/logs/clover.xml
- CC_TEST_REPORTER_ID="0b951d76fee5711d19cd5fa1e2b80b8b2aa20ac583b4597533ef310635a9b64a"
- GIT_COMMITTED_AT=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then git log -1 --pretty=format:%ct; else git log -1 --skip 1 --pretty=format:%ct; fi)

before_script:
- travis_retry composer install --no-interaction --prefer-dist
- travis_retry npm install
- travis_retry pip install --user mkdocs
- phpenv config-rm xdebug.ini
- phpenv config-rm xdebug.ini || true
- travis_retry composer install --no-interaction --prefer-dist
- travis_retry npm install
- travis_retry pip install --user mkdocs
- | # codeclimate
if [[ "$TRAVIS_PHP_VERSION" == "$FULL_BUILD_PHP_VERSION" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
wget -O ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
echo "CodeClimate before build status: $?"
fi
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 --verbose --coverage-text --coverage-clover=build/tests/coverage.xml
else
vendor/bin/phpunit --verbose
fi
- |
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
vendor/bin/phpstan.phar --no-progress analyse --level max src/ tests/
fi
- node node_modules/markdownlint-cli/markdownlint.js *.md docs/
- ~/.local/bin/mkdocs build --strict --site-dir build/docs
- mkdir -p build/
- vendor/bin/phplint
- vendor/bin/phpcs -sp src/ tests/
- vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
- | # create code coverage file
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
mkdir -p "$(dirname "$COVERAGE_FILE")"
php -dzend_extension=xdebug.so vendor/bin/phpunit --verbose --coverage-text --coverage-clover="$COVERAGE_FILE"
else
vendor/bin/phpunit --verbose
fi
- | # only check phpstan on FULL_BUILD_PHP_VERSION
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
vendor/bin/phpstan.phar --no-progress analyse --level max src/ tests/
fi
- node node_modules/markdownlint-cli/markdownlint.js *.md docs/
- ~/.local/bin/mkdocs build --strict --site-dir build/docs

after_script:
# upload test covegare to scrutinizer
- |
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
- | # upload test covegare to scrutinizer
if [[ -e "$COVERAGE_FILE" ]]; then
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover "$COVERAGE_FILE"
echo "Scrutinizer code coverage upload status: $?"
fi
- | # upload test covegare to codeclimate
if [[ -e "$COVERAGE_FILE" ]]; then
./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT
echo "CodeClimate after build status: $?"
fi
notifications:
email: false
email: false
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
],
"dev:test": [
"vendor/bin/phplint",
"@dev:check-style",
"vendor/bin/phpunit --testdox --verbose --stop-on-failure",
"vendor/bin/phpstan.phar analyse --no-progress --level max src/ tests/"
],
Expand All @@ -89,7 +90,7 @@
"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:docs": "DEV: search for code style errors unsing markdownlint and build docs using mkdocs",
"dev:test": "DEV: run phplint, phpunit and phpstan",
"dev:test": "DEV: run phplint, dev:check-style, phpunit and phpstan",
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/"
}
}
14 changes: 14 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@
- Change visibility of `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()` to private.


## Version 2.12.1 2019-09-11

- Trigger E_USER_DEPRECATED on `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()`
- Trigger E_USER_DEPRECATED on `CfdiUtils\Certificado\SerialNumber#baseConvert()`
- Improvements on docs/index
- Remove several development files from final package
- Development:
- Fix `.editorconfig`
- Integrate codeclimate, evaluate for a while to consider a replacement for scrutinizer
- Add PHP 7.4snapshot
- Remove Symfony Insight config file
- On `composer dev:build` it also calls `composer dev:check-style`


## Version 2.12.0 2019-09-03

- Add `CfdiCreator33::moveSatDefinitionsToComprobante()` method to move xml definitions
Expand Down
33 changes: 15 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CfdiUtils
# eclipxe/CfdiUtils

[![Source Code][badge-source]][source]
[![Discord][badge-discord]][discord]
Expand All @@ -10,7 +10,6 @@
[![Scrutinizer][badge-quality]][quality]
[![Coverage Status][badge-coverage]][coverage]
[![Total Downloads][badge-downloads]][downloads]
[![SensioLabsInsight][badge-sensiolabs]][sensiolabs]

[`eclipxe/CfdiUtils`](https://github.com/eclipxe13/CfdiUtils)
es una librería de PHP para leer, validar y crear CFDI 3.3.
Expand All @@ -27,7 +26,7 @@ México, en proyectos privados o proyectos libres como el futuro "BuzonCFDI".
Esta librería se ha liberado como software libre para ayudar a otros desarrolladores a
trabajar con CFDI y también para obtener su ayuda, todo lo que la comunidad pueda
contribuir será bien apreciado. Tenemos una comunidad activa y dinámica, nos puedes
encontrar en el [canal #phpcfdi de discord](https://discord.gg/aFGYXvX).
encontrar en el [canal #phpcfdi de discord][discord].


## Lectura de CFDI
Expand Down Expand Up @@ -112,20 +111,18 @@ Consulte el archivo [LICENSE][] para más información.
[release]: https://github.com/eclipxe13/CfdiUtils/releases
[license]: https://github.com/eclipxe13/CfdiUtils/blob/master/LICENSE
[build]: https://travis-ci.org/eclipxe13/CfdiUtils?branch=master
[appveyor]: https://ci.appveyor.com/project/eclipxe13/cfdiutils
[quality]: https://scrutinizer-ci.com/g/eclipxe13/CfdiUtils/
[sensiolabs]: https://insight.sensiolabs.com/projects/87975c73-2f3b-480a-8cce-e78b15986d7b
[coverage]: https://scrutinizer-ci.com/g/eclipxe13/CfdiUtils/code-structure/master/code-coverage
[appveyor]: https://ci.appveyor.com/project/eclipxe13/cfdiutils/branch/master
[quality]: https://scrutinizer-ci.com/g/eclipxe13/CfdiUtils/?branch=master
[coverage]: https://scrutinizer-ci.com/g/eclipxe13/CfdiUtils/code-structure/master/code-coverage/src/CfdiUtils/
[downloads]: https://packagist.org/packages/eclipxe/CfdiUtils

[badge-source]: http://img.shields.io/badge/source-eclipxe13/CfdiUtils-blue.svg?logo=github&style=flat-square
[badge-documentation]: https://img.shields.io/readthedocs/cfdiutils/stable.svg?logo=read-the-docs&style=flat-square
[badge-discord]: https://img.shields.io/discord/459860554090283019.svg?logo=discord&style=flat-square
[badge-release]: https://img.shields.io/github/release/eclipxe13/CfdiUtils.svg?style=flat-square
[badge-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[badge-build]: https://img.shields.io/travis/eclipxe13/CfdiUtils/master.svg?logo=travis&style=flat-square
[badge-appveyor]: https://img.shields.io/appveyor/ci/eclipxe13/cfdiutils/master.svg?logo=appveyor&style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/eclipxe13/CfdiUtils/master.svg?logo=scrutinizer-ci&style=flat-square
[badge-sensiolabs]: https://insight.sensiolabs.com/projects/87975c73-2f3b-480a-8cce-e78b15986d7b/mini.png
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/eclipxe13/CfdiUtils/master.svg?logo=scrutinizer-ci&style=flat-square
[badge-downloads]: https://img.shields.io/packagist/dt/eclipxe/CfdiUtils.svg?style=flat-square
[badge-source]: http://img.shields.io/badge/source-eclipxe13/CfdiUtils-blue?logo=github&style=flat-square
[badge-documentation]: https://img.shields.io/readthedocs/cfdiutils/stable?logo=read-the-docs&style=flat-square
[badge-discord]: https://img.shields.io/discord/459860554090283019?logo=discord&style=flat-square
[badge-release]: https://img.shields.io/github/release/eclipxe13/CfdiUtils?style=flat-square
[badge-license]: https://img.shields.io/github/license/eclipxe13/CfdiUtils?style=flat-square
[badge-build]: https://img.shields.io/travis/eclipxe13/CfdiUtils/master?logo=travis&style=flat-square
[badge-appveyor]: https://img.shields.io/appveyor/ci/eclipxe13/cfdiutils/master?logo=appveyor&style=flat-square
[badge-quality]: https://img.shields.io/scrutinizer/g/eclipxe13/CfdiUtils/master?logo=scrutinizer-ci&style=flat-square
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/eclipxe13/CfdiUtils/master?logo=scrutinizer-ci&style=flat-square
[badge-downloads]: https://img.shields.io/packagist/dt/eclipxe/CfdiUtils?style=flat-square
2 changes: 1 addition & 1 deletion src/CfdiUtils/Certificado/SerialNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function asciiToHex(string $input): string
*/
public function baseConvert(string $number, int $frombase, int $tobase): string
{
trigger_error('This method is deprecated, should not be used from outside this class');
trigger_error('This method is deprecated, should not be used from outside this class', E_USER_DEPRECATED);
return BaseConverter::createBase36()->convert($number, $frombase, $tobase);
}
}
8 changes: 7 additions & 1 deletion src/CfdiUtils/Cleaner/Cleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public function removeAddenda()
public function removeIncompleteSchemaLocations()
{
foreach ($this->obtainXsiSchemaLocations() as $element) {
$element->nodeValue = $this->removeIncompleteSchemaLocation($element->nodeValue);
$element->nodeValue = $this->removeIncompleteSchemaLocationPrivate($element->nodeValue);
}
}

Expand All @@ -167,6 +167,12 @@ public function removeIncompleteSchemaLocations()
* @internal
*/
public function removeIncompleteSchemaLocation(string $source): string
{
trigger_error('This method is deprecated, should not be used from outside this class', E_USER_DEPRECATED);
return $this->removeIncompleteSchemaLocationPrivate($source);
}

private function removeIncompleteSchemaLocationPrivate(string $source): string
{
$schemaLocations = SchemaLocations::fromStingStrictXsd($source);
foreach ($schemaLocations->getNamespacesWithoutLocation() as $namespace) {
Expand Down

0 comments on commit 7726eff

Please sign in to comment.