Skip to content

Commit 7726eff

Browse files
committed
Version 2.12.1
2 parents cc6c1a7 + f8ac9d7 commit 7726eff

File tree

10 files changed

+116
-68
lines changed

10 files changed

+116
-68
lines changed

.codeclimate.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
languages:
2+
PHP: true
3+
exclude_paths:
4+
- "tests/"
5+
- "vendor/"
6+
- "build/"

.editorconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
root = true
33

44
[*]
5-
indent_style: space
6-
indent_size: 4
7-
end_of_line: lf
5+
indent_style = space
6+
indent_size = 4
7+
end_of_line = lf
88

99
[**.{php,md,xml,yml,json,dist}]
1010
charset = utf-8
11-
trim_trailing_whitespace: true
11+
trim_trailing_whitespace = true
1212
insert_final_newline = true

.gitattributes

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@
1414

1515
# Do not put this files on a distribution package
1616
/tests/ export-ignore
17+
/.appveyor.xml export-ignore
18+
/.codeclimate.yml export-ignore
19+
/.editorconfig export-ignore
1720
/.gitattributes export-ignore
1821
/.gitignore export-ignore
22+
/.markdownlint.json export-ignore
1923
/.php_cs.dist export-ignore
2024
/.phplint.yml export-ignore
2125
/.scrutinizer.yml export-ignore
2226
/.travis.yml export-ignore
27+
/mkdocs.yml export-ignore
28+
/package.json export-ignore
2329
/phpcs.xml.dist export-ignore
30+
/phpstan.neon.dist export-ignore
2431
/phpunit.xml.dist export-ignore
25-
/mkdocs.yml export-ignore
26-
/.markdownlint.json export-ignore
2732

.symfony.insight.yaml

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

.travis.yml

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,61 +2,83 @@ language: php
22

33
# php compatibility
44
php:
5-
- 7.0
6-
- 7.1
7-
- 7.2
8-
- 7.3
5+
- "7.0"
6+
- "7.1"
7+
- "7.2"
8+
- "7.3"
9+
- "7.4snapshot"
10+
11+
matrix:
12+
allow_failures:
13+
- php: "7.4snapshot"
914

1015
branches:
11-
except:
12-
- appveyor # exclude appveyor branch
16+
except:
17+
- appveyor
1318

1419
before_install:
15-
- nvm install 8
20+
- nvm install 8
1621

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

2126
addons:
22-
apt:
23-
packages:
24-
- libsaxonb-java
27+
apt:
28+
packages:
29+
- libsaxonb-java
2530

2631
env:
27-
- FULL_BUILD_PHP_VERSION="7.3"
32+
global:
33+
- FULL_BUILD_PHP_VERSION="7.3"
34+
- COVERAGE_FILE=build/logs/clover.xml
35+
- CC_TEST_REPORTER_ID="0b951d76fee5711d19cd5fa1e2b80b8b2aa20ac583b4597533ef310635a9b64a"
36+
- 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)
2837

2938
before_script:
30-
- travis_retry composer install --no-interaction --prefer-dist
31-
- travis_retry npm install
32-
- travis_retry pip install --user mkdocs
33-
- phpenv config-rm xdebug.ini
39+
- phpenv config-rm xdebug.ini || true
40+
- travis_retry composer install --no-interaction --prefer-dist
41+
- travis_retry npm install
42+
- travis_retry pip install --user mkdocs
43+
- | # codeclimate
44+
if [[ "$TRAVIS_PHP_VERSION" == "$FULL_BUILD_PHP_VERSION" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
45+
wget -O ./cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
46+
chmod +x ./cc-test-reporter
47+
./cc-test-reporter before-build
48+
echo "CodeClimate before build status: $?"
49+
fi
3450
3551
script:
36-
- mkdir -p build/tests/
37-
- vendor/bin/phplint
38-
- vendor/bin/phpcs -sp src/ tests/
39-
- vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
40-
- |
41-
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
42-
php -dzend_extension=xdebug.so vendor/bin/phpunit --verbose --coverage-text --coverage-clover=build/tests/coverage.xml
43-
else
44-
vendor/bin/phpunit --verbose
45-
fi
46-
- |
47-
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
48-
vendor/bin/phpstan.phar --no-progress analyse --level max src/ tests/
49-
fi
50-
- node node_modules/markdownlint-cli/markdownlint.js *.md docs/
51-
- ~/.local/bin/mkdocs build --strict --site-dir build/docs
52+
- mkdir -p build/
53+
- vendor/bin/phplint
54+
- vendor/bin/phpcs -sp src/ tests/
55+
- vendor/bin/php-cs-fixer fix --using-cache=no --dry-run --verbose
56+
- | # create code coverage file
57+
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
58+
mkdir -p "$(dirname "$COVERAGE_FILE")"
59+
php -dzend_extension=xdebug.so vendor/bin/phpunit --verbose --coverage-text --coverage-clover="$COVERAGE_FILE"
60+
else
61+
vendor/bin/phpunit --verbose
62+
fi
63+
- | # only check phpstan on FULL_BUILD_PHP_VERSION
64+
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
65+
vendor/bin/phpstan.phar --no-progress analyse --level max src/ tests/
66+
fi
67+
- node node_modules/markdownlint-cli/markdownlint.js *.md docs/
68+
- ~/.local/bin/mkdocs build --strict --site-dir build/docs
5269

5370
after_script:
54-
# upload test covegare to scrutinizer
55-
- |
56-
if [[ $TRAVIS_PHP_VERSION == $FULL_BUILD_PHP_VERSION ]]; then
57-
wget https://scrutinizer-ci.com/ocular.phar
58-
php ocular.phar code-coverage:upload --format=php-clover build/tests/coverage.xml
59-
fi
71+
- | # upload test covegare to scrutinizer
72+
if [[ -e "$COVERAGE_FILE" ]]; then
73+
wget https://scrutinizer-ci.com/ocular.phar
74+
php ocular.phar code-coverage:upload --format=php-clover "$COVERAGE_FILE"
75+
echo "Scrutinizer code coverage upload status: $?"
76+
fi
77+
- | # upload test covegare to codeclimate
78+
if [[ -e "$COVERAGE_FILE" ]]; then
79+
./cc-test-reporter after-build --coverage-input-type clover --exit-code $TRAVIS_TEST_RESULT
80+
echo "CodeClimate after build status: $?"
81+
fi
6082
6183
notifications:
62-
email: false
84+
email: false

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
],
7878
"dev:test": [
7979
"vendor/bin/phplint",
80+
"@dev:check-style",
8081
"vendor/bin/phpunit --testdox --verbose --stop-on-failure",
8182
"vendor/bin/phpstan.phar analyse --no-progress --level max src/ tests/"
8283
],
@@ -89,7 +90,7 @@
8990
"dev:check-style": "DEV: search for code style errors using php-cs-fixer and phpcs",
9091
"dev:fix-style": "DEV: fix code style errors using php-cs-fixer and phpcbf",
9192
"dev:docs": "DEV: search for code style errors unsing markdownlint and build docs using mkdocs",
92-
"dev:test": "DEV: run phplint, phpunit and phpstan",
93+
"dev:test": "DEV: run phplint, dev:check-style, phpunit and phpstan",
9394
"dev:coverage": "DEV: run phpunit with xdebug and storage coverage in build/coverage/html/"
9495
}
9596
}

docs/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@
2828
- Change visibility of `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()` to private.
2929

3030

31+
## Version 2.12.1 2019-09-11
32+
33+
- Trigger E_USER_DEPRECATED on `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()`
34+
- Trigger E_USER_DEPRECATED on `CfdiUtils\Certificado\SerialNumber#baseConvert()`
35+
- Improvements on docs/index
36+
- Remove several development files from final package
37+
- Development:
38+
- Fix `.editorconfig`
39+
- Integrate codeclimate, evaluate for a while to consider a replacement for scrutinizer
40+
- Add PHP 7.4snapshot
41+
- Remove Symfony Insight config file
42+
- On `composer dev:build` it also calls `composer dev:check-style`
43+
44+
3145
## Version 2.12.0 2019-09-03
3246

3347
- Add `CfdiCreator33::moveSatDefinitionsToComprobante()` method to move xml definitions

docs/index.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CfdiUtils
1+
# eclipxe/CfdiUtils
22

33
[![Source Code][badge-source]][source]
44
[![Discord][badge-discord]][discord]
@@ -10,7 +10,6 @@
1010
[![Scrutinizer][badge-quality]][quality]
1111
[![Coverage Status][badge-coverage]][coverage]
1212
[![Total Downloads][badge-downloads]][downloads]
13-
[![SensioLabsInsight][badge-sensiolabs]][sensiolabs]
1413

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

3231

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

121-
[badge-source]: http://img.shields.io/badge/source-eclipxe13/CfdiUtils-blue.svg?logo=github&style=flat-square
122-
[badge-documentation]: https://img.shields.io/readthedocs/cfdiutils/stable.svg?logo=read-the-docs&style=flat-square
123-
[badge-discord]: https://img.shields.io/discord/459860554090283019.svg?logo=discord&style=flat-square
124-
[badge-release]: https://img.shields.io/github/release/eclipxe13/CfdiUtils.svg?style=flat-square
125-
[badge-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
126-
[badge-build]: https://img.shields.io/travis/eclipxe13/CfdiUtils/master.svg?logo=travis&style=flat-square
127-
[badge-appveyor]: https://img.shields.io/appveyor/ci/eclipxe13/cfdiutils/master.svg?logo=appveyor&style=flat-square
128-
[badge-quality]: https://img.shields.io/scrutinizer/g/eclipxe13/CfdiUtils/master.svg?logo=scrutinizer-ci&style=flat-square
129-
[badge-sensiolabs]: https://insight.sensiolabs.com/projects/87975c73-2f3b-480a-8cce-e78b15986d7b/mini.png
130-
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/eclipxe13/CfdiUtils/master.svg?logo=scrutinizer-ci&style=flat-square
131-
[badge-downloads]: https://img.shields.io/packagist/dt/eclipxe/CfdiUtils.svg?style=flat-square
119+
[badge-source]: http://img.shields.io/badge/source-eclipxe13/CfdiUtils-blue?logo=github&style=flat-square
120+
[badge-documentation]: https://img.shields.io/readthedocs/cfdiutils/stable?logo=read-the-docs&style=flat-square
121+
[badge-discord]: https://img.shields.io/discord/459860554090283019?logo=discord&style=flat-square
122+
[badge-release]: https://img.shields.io/github/release/eclipxe13/CfdiUtils?style=flat-square
123+
[badge-license]: https://img.shields.io/github/license/eclipxe13/CfdiUtils?style=flat-square
124+
[badge-build]: https://img.shields.io/travis/eclipxe13/CfdiUtils/master?logo=travis&style=flat-square
125+
[badge-appveyor]: https://img.shields.io/appveyor/ci/eclipxe13/cfdiutils/master?logo=appveyor&style=flat-square
126+
[badge-quality]: https://img.shields.io/scrutinizer/g/eclipxe13/CfdiUtils/master?logo=scrutinizer-ci&style=flat-square
127+
[badge-coverage]: https://img.shields.io/scrutinizer/coverage/g/eclipxe13/CfdiUtils/master?logo=scrutinizer-ci&style=flat-square
128+
[badge-downloads]: https://img.shields.io/packagist/dt/eclipxe/CfdiUtils?style=flat-square

src/CfdiUtils/Certificado/SerialNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function asciiToHex(string $input): string
7979
*/
8080
public function baseConvert(string $number, int $frombase, int $tobase): string
8181
{
82-
trigger_error('This method is deprecated, should not be used from outside this class');
82+
trigger_error('This method is deprecated, should not be used from outside this class', E_USER_DEPRECATED);
8383
return BaseConverter::createBase36()->convert($number, $frombase, $tobase);
8484
}
8585
}

src/CfdiUtils/Cleaner/Cleaner.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function removeAddenda()
156156
public function removeIncompleteSchemaLocations()
157157
{
158158
foreach ($this->obtainXsiSchemaLocations() as $element) {
159-
$element->nodeValue = $this->removeIncompleteSchemaLocation($element->nodeValue);
159+
$element->nodeValue = $this->removeIncompleteSchemaLocationPrivate($element->nodeValue);
160160
}
161161
}
162162

@@ -167,6 +167,12 @@ public function removeIncompleteSchemaLocations()
167167
* @internal
168168
*/
169169
public function removeIncompleteSchemaLocation(string $source): string
170+
{
171+
trigger_error('This method is deprecated, should not be used from outside this class', E_USER_DEPRECATED);
172+
return $this->removeIncompleteSchemaLocationPrivate($source);
173+
}
174+
175+
private function removeIncompleteSchemaLocationPrivate(string $source): string
170176
{
171177
$schemaLocations = SchemaLocations::fromStingStrictXsd($source);
172178
foreach ($schemaLocations->getNamespacesWithoutLocation() as $namespace) {

0 commit comments

Comments
 (0)