diff --git a/.github/ISSUE_TEMPLATE/reportar-um-erro.md b/.github/ISSUE_TEMPLATE/reportar-um-erro.md new file mode 100644 index 0000000..0cd5556 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/reportar-um-erro.md @@ -0,0 +1,32 @@ +--- +name: Reportar um Erro +about: Crie uma issue para reportar um erro/bug encontrado +title: "[BUG]" +labels: '' +assignees: '' + +--- + +**Descreva o erro** +Uma descrição clara e concisa do erro. + +**Como reproduzir** +Etapas para reproduzir o comportamento: +1. Vá para '...' +2. Clique em '....' +3. Navegue até '....' +4. See error + +**Comportamento esperado** +Uma descrição clara e concisa do que você esperava que acontecesse. + +**Screenshots** +Se aplicável, adicione capturas de tela para ajudar a explicar seu problema. + +**Ambiente e versões:** +- Versão do módulo: [ex. 2.0.0] +- Versão do WHMCS: [ex. 8.4] +- Versão do PHP: [ex. 7.4] + +**Contexto adicional** +Adicione qualquer outro contexto sobre o problema aqui. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/solicitar-um-recurso.md b/.github/ISSUE_TEMPLATE/solicitar-um-recurso.md new file mode 100644 index 0000000..8594d06 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/solicitar-um-recurso.md @@ -0,0 +1,20 @@ +--- +name: Solicitar um Recurso +about: Sugira uma ideia para este projeto +title: "[SUGESTÃO]" +labels: enhancement +assignees: '' + +--- + +**Sua solicitação de recurso está relacionada a um problema? Por favor descreva.** +Uma descrição clara e concisa do que é o problema. Ex. Eu sempre fico frustrado quando [...] + +**Descreva a solução que você deseja** +Uma descrição clara e concisa do que você quer que aconteça. + +**Descreva as alternativas que você considerou** +Uma descrição clara e concisa de quaisquer soluções ou recursos alternativos que você considerou. + +**Contexto adicional** +Adicione qualquer outro contexto ou capturas de tela sobre a solicitação de recurso aqui. \ No newline at end of file diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml new file mode 100644 index 0000000..a4a4c6f --- /dev/null +++ b/.github/workflows/php-compatibility.yml @@ -0,0 +1,32 @@ +name: PHP Compatibility + +on: + push: + branches: '*' + pull_request: + branches: '*' + +jobs: + test: + name: Test @ PHP ${{ matrix.php-version }} - x86 - ubuntu-latest + if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.actor != 'dependabot[bot]') + strategy: + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1" + - "8.2" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install Dependencies::PHP${{ matrix.php-version }} + run: | + echo "$HOME/.composer/vendor/bin" >> $GITHUB_PATH + composer global config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true + composer global require dealerdirect/phpcodesniffer-composer-installer roave/security-advisories:dev-master squizlabs/php_codesniffer phpcompatibility/php-compatibility + - name: Check PHP Compatibility + run: phpcs --standard=PHPCompatibility -s -q -n --colors --runtime-set testVersion ${{ matrix.php-version }} --extensions=php,inc,lib --ignore=sdk,node_modules,vendor,templates_c,lang,Legacy,templates,Migrations --severity=3 ./modules/addons/NFEioServiceInvoices + - name: Check PSR12 Standard + run: phpcs --standard=PSR12 -s -q -n --colors --extensions=php,inc,lib --ignore=sdk,node_modules,vendor,templates_c,lang,Legacy,templates,Migrations --severity=3 ./modules/addons/NFEioServiceInvoices \ No newline at end of file diff --git a/.gitignore b/.gitignore index a494781..f8cd337 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ composer.phar rsync-dev1.sh rsync-dev2.sh *.zip -composer.lock +composer.lock.bkp phpreport phpmetrics docs diff --git a/CHANGELOG.md b/CHANGELOG.md index 56b32e8..d729bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## 2.1.7 - 2023-02-08 + +### Correções + +* [BUG] Checagem e criação de webhook + +## 2.1.6 - 2022-10-24 + +### Correções + +* [BUG] Nota Fiscal com status "processando" quando emissão falha #143 +* Melhora a exibição das mensagens de status na interface web para os administradores. + ## 2.1.5 - 2022-09-24 ### Correções diff --git a/composer.json b/composer.json index e9f8cfc..8378c10 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "require": { - "whmcsexpert/whmcsexpert": "dev-dev", + "whmcsexpert/whmcsexpert": "^1.1.7", "plasticbrain/php-flash-messages": "^1", "guzzlehttp/psr7": "^1.8", "ext-curl": "*", @@ -12,7 +12,8 @@ "kint-php/kint": "*", "tracy/tracy": "2.7.6", "phpmetrics/phpmetrics": "^2.7", - "illuminate/database": "v5.8.36" + "illuminate/database": "v5.8.36", + "squizlabs/php_codesniffer": "^3.7" }, "config": { "vendor-dir": "modules/addons/NFEioServiceInvoices/lib/vendor", diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..2bccf72 --- /dev/null +++ b/composer.lock @@ -0,0 +1,3309 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "9897988dffebd0816f5a06a49ad9ddcf", + "packages": [ + { + "name": "guzzlehttp/psr7", + "version": "1.9.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2022-06-20T21:43:03+00:00" + }, + { + "name": "nfe/nfe", + "version": "2.5", + "source": { + "type": "git", + "url": "https://github.com/nfe/client-php.git", + "reference": "eff0d8dc669976b50f00711ee6b8860b079fc3ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nfe/client-php/zipball/eff0d8dc669976b50f00711ee6b8860b079fc3ef", + "reference": "eff0d8dc669976b50f00711ee6b8860b079fc3ef", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "php": ">=5.4" + }, + "require-dev": { + "simpletest/simpletest": "^1.1" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/NFe/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "NFe.io team and contributors", + "homepage": "https://github.com/nfe/client-php/contributors" + }, + { + "name": "Renato Alves", + "homepage": "http://ralv.es/" + } + ], + "description": "NFe.io PHP Library", + "homepage": "https://nfe.io", + "keywords": [ + "api", + "nfe", + "nfe.io", + "nfse", + "nota", + "nota fiscal" + ], + "support": { + "issues": "https://github.com/nfe/client-php/issues", + "source": "https://github.com/nfe/client-php/tree/master" + }, + "time": "2018-04-06T16:32:55+00:00" + }, + { + "name": "plasticbrain/php-flash-messages", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/plasticbrain/PhpFlashMessages.git", + "reference": "b565762619342057ce561de20d0f2f6e14f9aa77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/plasticbrain/PhpFlashMessages/zipball/b565762619342057ce561de20d0f2f6e14f9aa77", + "reference": "b565762619342057ce561de20d0f2f6e14f9aa77", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Plasticbrain\\FlashMessages\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike Everhart", + "email": "mike@plasticbrain.net" + } + ], + "description": "A modern take on PHP session-based flash messages", + "keywords": [ + "bootstrap", + "flash", + "messages", + "session" + ], + "support": { + "issues": "https://github.com/plasticbrain/PhpFlashMessages/issues", + "source": "https://github.com/plasticbrain/PhpFlashMessages/tree/master" + }, + "time": "2016-04-01T08:39:38+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "whmcsexpert/whmcsexpert", + "version": "v1.1.7", + "source": { + "type": "git", + "url": "https://github.com/whmcsexpert/whmcsexpert.git", + "reference": "bea1112fe3974b424fdb7223139cb33dd4cc0856" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/whmcsexpert/whmcsexpert/zipball/bea1112fe3974b424fdb7223139cb33dd4cc0856", + "reference": "bea1112fe3974b424fdb7223139cb33dd4cc0856", + "shasum": "" + }, + "require-dev": { + "illuminate/database": "v5.8.36", + "phpcompatibility/php-compatibility": "^9.3", + "phpdocumentor/phpdocumentor": "2.*", + "phpunit/phpunit": "@stable", + "squizlabs/php_codesniffer": "^3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "WHMCSExpert\\": "src/WHMCSExpert/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andre Bellafronte", + "email": "andre@eunarede.com" + } + ], + "description": "WHMCS Expert Library", + "support": { + "issues": "https://github.com/whmcsexpert/whmcsexpert/issues", + "source": "https://github.com/whmcsexpert/whmcsexpert/tree/v1.1.7" + }, + "time": "2023-03-15T18:58:31+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/inflector", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector", + "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/1.4.4" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2021-04-16T17:34:40+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "illuminate/container", + "version": "v5.8.36", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/b42e5ef939144b77f78130918da0ce2d9ee16574", + "reference": "b42e5ef939144b77f78130918da0ce2d9ee16574", + "shasum": "" + }, + "require": { + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3", + "psr/container": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.8-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2019-08-20T02:00:23+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v5.8.36", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "00fc6afee788fa07c311b0650ad276585f8aef96" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/00fc6afee788fa07c311b0650ad276585f8aef96", + "reference": "00fc6afee788fa07c311b0650ad276585f8aef96", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.8-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2019-07-30T13:57:21+00:00" + }, + { + "name": "illuminate/database", + "version": "v5.8.36", + "source": { + "type": "git", + "url": "https://github.com/illuminate/database.git", + "reference": "ac9ae2d82b8a6137400f17b3eea258be3518daa9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/database/zipball/ac9ae2d82b8a6137400f17b3eea258be3518daa9", + "reference": "ac9ae2d82b8a6137400f17b3eea258be3518daa9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/support": "5.8.*", + "php": "^7.1.3" + }, + "suggest": { + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "fzaninotto/faker": "Required to use the eloquent factory builder (^1.4).", + "illuminate/console": "Required to use the database commands (5.8.*).", + "illuminate/events": "Required to use the observers with Eloquent (5.8.*).", + "illuminate/filesystem": "Required to use the migrations (5.8.*).", + "illuminate/pagination": "Required to paginate the result set (5.8.*)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.8-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Database\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Database package.", + "homepage": "https://laravel.com", + "keywords": [ + "database", + "laravel", + "orm", + "sql" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2019-10-03T16:22:57+00:00" + }, + { + "name": "illuminate/support", + "version": "v5.8.36", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "df4af6a32908f1d89d74348624b57e3233eea247" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/df4af6a32908f1d89d74348624b57e3233eea247", + "reference": "df4af6a32908f1d89d74348624b57e3233eea247", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.1", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/contracts": "5.8.*", + "nesbot/carbon": "^1.26.3 || ^2.0", + "php": "^7.1.3" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (5.8.*).", + "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "ramsey/uuid": "Required to use Str::uuid() (^3.7).", + "symfony/process": "Required to use the composer class (^4.2).", + "symfony/var-dumper": "Required to use the dd function (^4.2).", + "vlucas/phpdotenv": "Required to use the env helper (^3.3)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.8-dev" + } + }, + "autoload": { + "files": [ + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2019-12-12T14:16:47+00:00" + }, + { + "name": "kint-php/kint", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/kint-php/kint.git", + "reference": "1033fc4a5075e15b9b46be20c246069ab44bc243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kint-php/kint/zipball/1033fc4a5075e15b9b46be20c246069ab44bc243", + "reference": "1033fc4a5075e15b9b46be20c246069ab44bc243", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3", + "phpspec/prophecy-phpunit": "^2", + "phpunit/phpunit": "^9", + "seld/phar-utils": "^1", + "symfony/finder": "^4.0 || ^5.0 || ^6.0", + "vimeo/psalm": "^5@dev" + }, + "suggest": { + "kint-php/kint-helpers": "Provides extra helper functions", + "kint-php/kint-twig": "Provides d() and s() functions in twig templates" + }, + "type": "library", + "autoload": { + "files": [ + "init.php" + ], + "psr-4": { + "Kint\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Vollebregt", + "homepage": "https://github.com/jnvsor" + }, + { + "name": "Contributors", + "homepage": "https://github.com/kint-php/kint/graphs/contributors" + } + ], + "description": "Kint - debugging tool for PHP developers", + "homepage": "https://kint-php.github.io/kint/", + "keywords": [ + "debug", + "kint", + "php" + ], + "support": { + "issues": "https://github.com/kint-php/kint/issues", + "source": "https://github.com/kint-php/kint/tree/5.0.5" + }, + "time": "2023-03-08T14:50:41+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.11.1", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3,<3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2023-03-08T13:26:56+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.66.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "496712849902241f04902033b0441b269effe001" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/496712849902241f04902033b0441b269effe001", + "reference": "496712849902241f04902033b0441b269effe001", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" + }, + "require-dev": { + "doctrine/dbal": "^2.0 || ^3.1.4", + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^3.0", + "kylekatarnls/multi-tester": "^2.0", + "ondrejmirtes/better-reflection": "*", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.99 || ^1.7.14", + "phpunit/php-file-iterator": "^2.0.5 || ^3.0.6", + "phpunit/phpunit": "^7.5.20 || ^8.5.26 || ^9.5.20", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.x-dev", + "dev-master": "2.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2023-01-29T18:53:47+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.15.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + }, + "time": "2023-03-05T19:49:14+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, + "time": "2021-07-20T11:28:43+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpmetrics/phpmetrics", + "version": "v2.8.2", + "source": { + "type": "git", + "url": "https://github.com/phpmetrics/PhpMetrics.git", + "reference": "4b77140a11452e63c7a9b98e0648320bf6710090" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/4b77140a11452e63c7a9b98e0648320bf6710090", + "reference": "4b77140a11452e63c7a9b98e0648320bf6710090", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "^3|^4", + "php": ">=5.5" + }, + "replace": { + "halleck45/php-metrics": "*", + "halleck45/phpmetrics": "*" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^3.5", + "symfony/dom-crawler": "^3.0 || ^4.0 || ^5.0" + }, + "bin": [ + "bin/phpmetrics" + ], + "type": "library", + "autoload": { + "files": [ + "./src/functions.php" + ], + "psr-0": { + "Hal\\": "./src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jean-François Lépine", + "email": "lepinejeanfrancois@yahoo.fr", + "homepage": "http://www.lepine.pro", + "role": "Copyright Holder" + } + ], + "description": "Static analyzer tool for PHP : Coupling, Cyclomatic complexity, Maintainability Index, Halstead's metrics... and more !", + "homepage": "http://www.phpmetrics.org", + "keywords": [ + "analysis", + "qa", + "quality", + "testing" + ], + "support": { + "issues": "https://github.com/PhpMetrics/PhpMetrics/issues", + "source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.2" + }, + "time": "2023-03-08T15:03:36+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.26", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.15", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-03-06T12:58:08+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "reference": "86e761949019ae83f49240b2f2123fb5ab3b2fc5", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.5", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^3.2", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.5" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2023-03-09T06:34:10+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T06:03:37+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-14T08:28:10+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2023-02-22T23:07:41+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-01-02T09:53:40+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-11-03T14:55:06+00:00" + }, + { + "name": "symfony/translation", + "version": "v5.4.21", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "6996affeea65705086939894b77110e9a7f80874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/6996affeea65705086939894b77110e9a7f80874", + "reference": "6996affeea65705086939894b77110e9a7f80874", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.16", + "symfony/translation-contracts": "^2.3" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/console": "<5.3", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.3" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/console": "^5.4|^6.0", + "symfony/dependency-injection": "^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/http-client-contracts": "^1.1|^2.0|^3.0", + "symfony/http-kernel": "^5.0|^6.0", + "symfony/intl": "^4.4|^5.0|^6.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/service-contracts": "^1.1.2|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v5.4.21" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-02-21T19:46:44+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.5.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe", + "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.5-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-06-27T16:58:25+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2021-07-28T10:34:58+00:00" + }, + { + "name": "tracy/tracy", + "version": "v2.7.6", + "source": { + "type": "git", + "url": "https://github.com/nette/tracy.git", + "reference": "7e7e73d52c7e9ff0fd29dbd5b1cfdc03f3947942" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/tracy/zipball/7e7e73d52c7e9ff0fd29dbd5b1cfdc03f3947942", + "reference": "7e7e73d52c7e9ff0fd29dbd5b1cfdc03f3947942", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-session": "*", + "php": ">=7.1" + }, + "conflict": { + "nette/di": "<3.0" + }, + "require-dev": { + "latte/latte": "^2.5", + "nette/di": "^3.0", + "nette/mail": "^3.0", + "nette/tester": "^2.2", + "nette/utils": "^3.0", + "phpstan/phpstan": "^0.12", + "psr/log": "^1.0" + }, + "suggest": { + "https://nette.org/donate": "Please support Tracy via a donation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "files": [ + "src/Tracy/shortcuts.php" + ], + "classmap": [ + "src" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.", + "homepage": "https://tracy.nette.org", + "keywords": [ + "Xdebug", + "debug", + "debugger", + "nette", + "profiler" + ], + "support": { + "issues": "https://github.com/nette/tracy/issues", + "source": "https://github.com/nette/tracy/tree/v2.7.6" + }, + "time": "2020-11-02T17:06:27+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "phpunit/phpunit": 0 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "ext-curl": "*", + "php": ">=5.6" + }, + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/modules/addons/NFEioServiceInvoices/Loader.php b/modules/addons/NFEioServiceInvoices/Loader.php index 0bda3be..df467eb 100644 --- a/modules/addons/NFEioServiceInvoices/Loader.php +++ b/modules/addons/NFEioServiceInvoices/Loader.php @@ -1,18 +1,18 @@ isAdmin(true); \NFEioServiceInvoices\Addon::I(false, $vars); diff --git a/modules/addons/NFEioServiceInvoices/callback.php b/modules/addons/NFEioServiceInvoices/callback.php index 9cd728a..cb1cc11 100644 --- a/modules/addons/NFEioServiceInvoices/callback.php +++ b/modules/addons/NFEioServiceInvoices/callback.php @@ -1,9 +1,11 @@ where('nfe_id', '=', $post['id'])->update($new_nfe); logModuleCall('NFEioServiceInvoices', 'callback_success', $post, $save_nfe); - } catch (\Exception $e) { logModuleCall('NFEioServiceInvoices', 'callback_error', "Erro ao atualizar a nota no banco de dados \n\n Nota: \n {$new_nfe} Callback: \n {$post}", $e->getMessage()); } diff --git a/modules/addons/NFEioServiceInvoices/hooks.php b/modules/addons/NFEioServiceInvoices/hooks.php index 15cbeb2..c0c65ce 100644 --- a/modules/addons/NFEioServiceInvoices/hooks.php +++ b/modules/addons/NFEioServiceInvoices/hooks.php @@ -1,4 +1,5 @@ run(); -}); - -add_hook('InvoicePaid', 1, function ($vars) { - $hook = new \NFEioServiceInvoices\Hooks\InvoicePaid($vars); - $hook->run(); -}); - -add_hook('InvoiceCancelled', 1, function ($vars) { - $legacyHooks = new \NFEioServiceInvoices\Legacy\Hooks(); - $legacyHooks->invoicecancelled($vars); -}); - -add_hook('DailyCronJob', 1, function ($vars) { - $hook = new \NFEioServiceInvoices\Hooks\DailyCronJob(); - $hook->run(); -}); - -add_hook('AfterCronJob', 1, function ($vars) { - $hook = new \NFEioServiceInvoices\Hooks\AfterCronJob(); - $hook->run(); -}); - -add_hook('ProductDelete', 1, function ($vars) { - $legacyHooks = new \NFEioServiceInvoices\Legacy\Hooks(); - $legacyHooks->productdelete($vars); -}); - -add_hook('AdminClientProfileTabFieldsSave', 1, function($vars) { - $functions = new \NFEioServiceInvoices\Legacy\Functions(); - $functions->gnfe_save_client_issue_invoice_cond($vars['userid'], $_REQUEST['issue_note_cond']); -}); - -add_hook('AdminClientProfileTabFields', 1, function($vars) { - $legacyHooks = new \NFEioServiceInvoices\Legacy\Hooks(); - return $legacyHooks->customclientissueinvoice($vars); -}); - -add_hook('AdminInvoicesControlsOutput', 1, function ($vars) { - $hook = new \NFEioServiceInvoices\Hooks\AdminInvoicesControlsOutput($vars); - $hook->run(); - -}); - -add_hook('ClientAreaPageViewInvoice', 1, function($vars) { - $hook = new \NFEioServiceInvoices\Hooks\ClientAreaPageViewInvoice($vars); - return $hook->run(); -}); \ No newline at end of file +add_hook( + 'InvoiceCreation', + 1, + function ($vars) { + $hook = new \NFEioServiceInvoices\Hooks\InvoiceCreation($vars); + $hook->run(); + } +); + +add_hook( + 'InvoicePaid', + 1, + function ($vars) { + $hook = new \NFEioServiceInvoices\Hooks\InvoicePaid($vars); + $hook->run(); + } +); + +add_hook( + 'InvoiceCancelled', + 1, + function ($vars) { + $legacyHooks = new \NFEioServiceInvoices\Legacy\Hooks(); + $legacyHooks->invoicecancelled($vars); + } +); + +add_hook( + 'DailyCronJob', + 1, + function ($vars) { + $hook = new \NFEioServiceInvoices\Hooks\DailyCronJob(); + $hook->run(); + } +); + +add_hook( + 'AfterCronJob', + 1, + function ($vars) { + $hook = new \NFEioServiceInvoices\Hooks\AfterCronJob(); + $hook->run(); + } +); + +add_hook( + 'ProductDelete', + 1, + function ($vars) { + $legacyHooks = new \NFEioServiceInvoices\Legacy\Hooks(); + $legacyHooks->productdelete($vars); + } +); + +add_hook( + 'AdminClientProfileTabFieldsSave', + 1, + function ($vars) { + $functions = new \NFEioServiceInvoices\Legacy\Functions(); + $functions->gnfe_save_client_issue_invoice_cond($vars['userid'], $_REQUEST['issue_note_cond']); + } +); + +add_hook( + 'AdminClientProfileTabFields', + 1, + function ($vars) { + $legacyHooks = new \NFEioServiceInvoices\Legacy\Hooks(); + return $legacyHooks->customclientissueinvoice($vars); + } +); + +add_hook( + 'AdminInvoicesControlsOutput', + 1, + function ($vars) { + $hook = new \NFEioServiceInvoices\Hooks\AdminInvoicesControlsOutput($vars); + $hook->run(); + } +); + +add_hook( + 'ClientAreaPageViewInvoice', + 1, + function ($vars) { + $hook = new \NFEioServiceInvoices\Hooks\ClientAreaPageViewInvoice($vars); + return $hook->run(); + } +); diff --git a/modules/addons/NFEioServiceInvoices/lang/english.php b/modules/addons/NFEioServiceInvoices/lang/english.php index c81989a..0cf0ee7 100644 --- a/modules/addons/NFEioServiceInvoices/lang/english.php +++ b/modules/addons/NFEioServiceInvoices/lang/english.php @@ -1,10 +1,12 @@ isAdmin()) { - return $dir.'admin'; + return $dir . 'admin'; } else { $template = $GLOBALS['CONFIG']['Template']; - if (file_exists(__DIR__ . DS .DS.$template)) { - return $dir.'clientarea'.DS.$template; + if (file_exists(__DIR__ . DS . DS . $template)) { + return $dir . 'clientarea' . DS . $template; } else { - return $dir.'clientarea'; + return $dir . 'clientarea'; } } } @@ -92,9 +89,9 @@ public function getCon() public function getAssetsURL() { if ($this->isAdmin()) { - return '../modules/addons/'.self::I()->configuration()->systemName.'/lib/'.self::getModuleTemplatesDir(true).'/assets'; + return '../modules/addons/' . self::I()->configuration()->systemName . '/lib/' . self::getModuleTemplatesDir(true) . '/assets'; } else { - return 'modules/addons/'.self::I()->configuration()->systemName.'/'.self::getModuleTemplatesDir(true).'/assets'; + return 'modules/addons/' . self::I()->configuration()->systemName . '/' . self::getModuleTemplatesDir(true) . '/assets'; } } @@ -108,50 +105,50 @@ public static function getMainDIR() return __DIR__; } - public static function getUrl($page = null, $action=null, $params = array()) + public static function getUrl($page = null, $action = null, $params = array()) { if (self::I()->isAdmin()) { - $url = 'addonmodules.php?module='.self::I()->configuration()->systemName; + $url = 'addonmodules.php?module=' . self::I()->configuration()->systemName; } else { - $url = 'index.php?m='.self::I()->configuration()->systemName; + $url = 'index.php?m=' . self::I()->configuration()->systemName; } if ($page) { - $url .= '&page='.$page; + $url .= '&page=' . $page; if ($action) { - $url .= '&action='.$action; + $url .= '&action=' . $action; } if ($params) { - $url .= '&'.http_build_query($params); + $url .= '&' . http_build_query($params); } } if ($action) { - $url .= '&action='.$action; + $url .= '&action=' . $action; } return $url; } - public static function genCustomPageUrl($page = null, $action=null, $params = array()) + public static function genCustomPageUrl($page = null, $action = null, $params = array()) { if (self::I()->isAdmin()) { - $url = 'addonmodules.php?module='.self::I()->configuration()->systemName.'&customPage=1'; + $url = 'addonmodules.php?module=' . self::I()->configuration()->systemName . '&customPage=1'; } else { - $url = 'index.php?m='.self::I()->configuration()->systemName.'&customPage=1'; + $url = 'index.php?m=' . self::I()->configuration()->systemName . '&customPage=1'; } if ($page) { - $url .= '&mg-page='.$page; + $url .= '&mg-page=' . $page; } if ($action) { - $url .= '&mg-action='.$action; + $url .= '&mg-action=' . $action; } if ($params) { - $url .= '&'.http_build_query($params); + $url .= '&' . http_build_query($params); } return $url; @@ -160,19 +157,20 @@ public static function genCustomPageUrl($page = null, $action=null, $params = ar public static function genJSONUrl($page) { if (self::I()->isAdmin()) { - return 'addonmodules.php?module='.self::I()->configuration()->systemName.'&json=1&mg-page='.$page; + return 'addonmodules.php?module=' . self::I()->configuration()->systemName . '&json=1&mg-page=' . $page; } else { - return 'index.php?m='.self::I()->configuration()->systemName.'&json=1&mg-page='.$page; + return 'index.php?m=' . self::I()->configuration()->systemName . '&json=1&mg-page=' . $page; } } /** * Retorna o caminho absoluto do módulo + * * @return string https://dominio.com/diretorio/modules/addons/modulo/ */ public static function getAddonPath() { - $path = '/modules/addons/'.self::I()->configuration()->systemName.'/'; + $path = '/modules/addons/' . self::I()->configuration()->systemName . '/'; return main\Helper\Helper::getPathUrl($path); } @@ -180,7 +178,7 @@ public static function getAddonPath() public static function getCallBackPath() { $callBackFile = '/callback.php'; - $path = '/modules/addons/'.self::I()->configuration()->systemName.$callBackFile; + $path = '/modules/addons/' . self::I()->configuration()->systemName . $callBackFile; return main\Helper\Helper::getPathUrl($path); } @@ -204,7 +202,7 @@ public static function activate() self::I(true)->configuration()->activate(); return array( - 'status'=>'success' + 'status' => 'success' ); } catch (\Exception $ex) { return array( @@ -220,7 +218,7 @@ public static function deactivate() self::I(true)->configuration()->deactivate(); return array( - 'status'=>'success' + 'status' => 'success' ); } catch (\Exception $ex) { return array( @@ -245,5 +243,4 @@ public static function upgrade($vars) ); } } - } diff --git a/modules/addons/NFEioServiceInvoices/lib/Admin/AdminDispatcher.php b/modules/addons/NFEioServiceInvoices/lib/Admin/AdminDispatcher.php index 9c87841..b9969c1 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Admin/AdminDispatcher.php +++ b/modules/addons/NFEioServiceInvoices/lib/Admin/AdminDispatcher.php @@ -5,13 +5,13 @@ /** * Sample Admin Area Dispatch Handler */ -class AdminDispatcher { - +class AdminDispatcher +{ /** * Dispatch request. * * @param string $action - * @param array $parameters + * @param array $parameters * * @return string */ diff --git a/modules/addons/NFEioServiceInvoices/lib/Admin/Controller.php b/modules/addons/NFEioServiceInvoices/lib/Admin/Controller.php index bc99c3d..a0dcd9d 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Admin/Controller.php +++ b/modules/addons/NFEioServiceInvoices/lib/Admin/Controller.php @@ -2,9 +2,11 @@ namespace NFEioServiceInvoices\Admin; -if (!defined('DS')) define('DS', DIRECTORY_SEPARATOR); +if (!defined('DS')) { + define('DS', DIRECTORY_SEPARATOR); +} -require_once(dirname(dirname(__DIR__)) . DS . 'Loader.php'); +require_once dirname(dirname(__DIR__)) . DS . 'Loader.php'; use NFEioServiceInvoices\CustomFields; use NFEioServiceInvoices\Helpers\Versions; @@ -12,15 +14,14 @@ use WHMCS\Database\Capsule; use Plasticbrain\FlashMessages\FlashMessages; use WHMCSExpert\Template\Template; -use \NFEioServiceInvoices\Addon; +use NFEioServiceInvoices\Addon; /** * Sample Admin Area Controller */ -class Controller { - - +class Controller +{ /** * Index action. * @@ -31,10 +32,9 @@ class Controller { public function index($vars) { try { - $template = new Template(Addon::getModuleTemplatesDir()); $assetsURL = Addon::I()->getAssetsURL(); - $msg = new FlashMessages; + $msg = new FlashMessages(); $config = new \NFEioServiceInvoices\Configuration(); $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); $vars['dtData'] = $serviceInvoicesRepo->dataTable(); @@ -47,8 +47,12 @@ public function index($vars) $oldVersion = Versions::getOldNfeioModuleVersion(); // se tiver registro de versão antiga define mensagem if ($oldVersion) { - $msg->error("Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. -
Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", '', true); + $msg->error( + "Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. +
Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", + '', + true + ); } if ($msg->hasMessages()) { @@ -56,7 +60,6 @@ public function index($vars) } return $template->fetch('index', $vars); - } catch (\Exception $e) { echo $e->getMessage(); } @@ -65,17 +68,16 @@ public function index($vars) /** * Exibe a página de configuração do módulo associando qualquer variável padrão ou personalizada ao tpl. * - * @param $vars array parametros do WHMCS + * @param $vars array parametros do WHMCS * @return string|void template de visualização com parametros */ public function configuration($vars) { try { - - $msg = new FlashMessages; + $msg = new FlashMessages(); $template = new Template(Addon::getModuleTemplatesDir()); $config = new \NFEioServiceInvoices\Configuration(); - $nfe = new \NFEioServiceInvoices\NFEio\Nfe; + $nfe = new \NFEioServiceInvoices\NFEio\Nfe(); // metodo para verificar se existe algum campo obrigatório não preenchido. $config->verifyMandatoryFields($vars); $assetsURL = Addon::I()->getAssetsURL(); @@ -95,8 +97,12 @@ public function configuration($vars) $oldVersion = Versions::getOldNfeioModuleVersion(); // se tiver registro de versão antiga define mensagem if ($oldVersion) { - $msg->error("Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. -
Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", '', true); + $msg->error( + "Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. +
Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", + '', + true + ); } if ($msg->hasMessages()) { @@ -104,7 +110,6 @@ public function configuration($vars) } return $template->fetch('configuration', $vars); - } catch (\Exception $e) { echo $e->getMessage(); } @@ -112,12 +117,13 @@ public function configuration($vars) /** * Salva as configurações do módulo + * * @param $vars array Parametros do WHMCS */ public function configurationSave($vars) { - $msg = new FlashMessages; + $msg = new FlashMessages(); $assetsURL = Addon::I()->getAssetsURL(); $vars['assetsURL'] = $assetsURL; $moduleLink = $vars['modulelink']; @@ -175,33 +181,42 @@ public function configurationSave($vars) // discount_items $storage->set('discount_items', $discount_items); - if ($api_key) { $storage->set('api_key', $api_key); } - if ($company_id) { $storage->set('company_id', $company_id); } - if ($service_code) { $storage->set('service_code', $service_code); } - if ($rps_number) { $storage->set('rps_number', $rps_number); } - if ($issue_note_default_cond) { $storage->set('issue_note_default_cond', $issue_note_default_cond); } - if ($invoice_details) { $storage->set('InvoiceDetails', $invoice_details); } + if ($api_key) { + $storage->set('api_key', $api_key); + } + if ($company_id) { + $storage->set('company_id', $company_id); + } + if ($service_code) { + $storage->set('service_code', $service_code); + } + if ($rps_number) { + $storage->set('rps_number', $rps_number); + } + if ($issue_note_default_cond) { + $storage->set('issue_note_default_cond', $issue_note_default_cond); + } + if ($invoice_details) { + $storage->set('InvoiceDetails', $invoice_details); + } //if ($footer) { $storage->set('footer', $footer); } $msg->success("Informações atualizadas com sucesso!", "{$moduleLink}&action={$action}"); - } catch (\Exception $exception) { $msg->error("Erro {$exception->getCode()} ao atualizar: {$exception->getMessage()}", "{$moduleLink}&action={$action}"); } - } /** * Exibe a página de configuração de código de serviços e seus parametros - * @param $vars parametros do WHMCS + * + * @param $vars parametros do WHMCS * @return string|void template */ public function servicesCode($vars) { try { - - - $msg = new FlashMessages; + $msg = new FlashMessages(); $template = new Template(Addon::getModuleTemplatesDir()); $config = new \NFEioServiceInvoices\Configuration(); $servicesCodeRepo = new \NFEioServiceInvoices\Models\ProductCode\Repository(); @@ -219,8 +234,12 @@ public function servicesCode($vars) $oldVersion = Versions::getOldNfeioModuleVersion(); // se tiver registro de versão antiga define mensagem if ($oldVersion) { - $msg->error("Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. -
Caso você tenha acabado de concluir uma migração para a última versão, desative e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de nptas.", '', true); + $msg->error( + "Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. +
Caso você tenha acabado de concluir uma migração para a última versão, desative e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de nptas.", + '', + true + ); } if ($msg->hasMessages()) { @@ -228,7 +247,6 @@ public function servicesCode($vars) } return $template->fetch('servicescode', $vars); - } catch (\Exception $e) { echo $e->getMessage(); } @@ -236,6 +254,7 @@ public function servicesCode($vars) /** * Salva os códigos de serviços do post + * * @param $vars */ public function servicesCodeSave($vars) @@ -262,15 +281,12 @@ public function servicesCodeSave($vars) if ($post['btnDelete'] === 'true') { $productCodeRepo->delete($post); $msg->warning("Código {$post['service_code']} para {$post['product_name']} removido.", "{$vars['modulelink']}&action=servicesCode"); - } - - - } /** * Funções legadas da area administrativa + * * @param $vars */ public function legacyFunctions($vars) @@ -280,14 +296,15 @@ public function legacyFunctions($vars) $functions = new \NFEioServiceInvoices\Legacy\Functions(); $moduleLink = $vars['modulelink']; $moduleAction = 'index'; - $redirectUrl = $moduleLink.'&action='.$moduleAction; - $nfe = new \NFEioServiceInvoices\NFEio\Nfe; + $redirectUrl = $moduleLink . '&action=' . $moduleAction; + $nfe = new \NFEioServiceInvoices\NFEio\Nfe(); // create if ($_REQUEST['gnfe_create']) { - $invoice = localAPI('GetInvoice', ['invoiceid' => $_REQUEST['invoice_id']], false); - $client = localAPI('GetClientsDetails', ['clientid' => $invoice['userid'], 'stats' => false], false); - $nfe_for_invoice = $functions->gnfe_get_local_nfe($_REQUEST['invoice_id'], ['invoice_id', 'user_id', 'nfe_id', 'status', 'services_amount', 'environment', 'pdf', 'created_at', 'rpsSerialNumber']); + $nfe_for_invoice = $functions->gnfe_get_local_nfe( + $_REQUEST['invoice_id'], + ['invoice_id', 'user_id', 'nfe_id', 'status', 'services_amount', 'environment', 'pdf', 'created_at', 'rpsSerialNumber'] + ); if (!$nfe_for_invoice['id']) { $queue = $functions->gnfe_queue_nfe($_REQUEST['invoice_id'], true); if ($queue !== 'success') { @@ -303,7 +320,7 @@ public function legacyFunctions($vars) } } // reissue - if ($_REQUEST['nfeio_reissue'] AND ( isset($_REQUEST['nfe_id']) AND !empty($_REQUEST['nfe_id']) )) { + if ($_REQUEST['nfeio_reissue'] and ( isset($_REQUEST['nfe_id']) and !empty($_REQUEST['nfe_id']) )) { $nfId = $_REQUEST['nfe_id']; $result = $nfe->reissueNfbyId($nfId); @@ -311,7 +328,6 @@ public function legacyFunctions($vars) $msg->success('NF reemitida com sucesso', $redirectUrl); } else { $msg->error("Erro ao reemitir NF: {$result}", $redirectUrl); - } } @@ -326,11 +342,9 @@ public function legacyFunctions($vars) $msg->warning("Nota fiscal cancelada, mas com aviso: {$delete_nfe->message}", $redirectUrl); } else { - logModuleCall('nfeioserviceinvoices', 'cancel_nf', $_REQUEST['gnfe_cancel'], $delete_nfe); $msg->success("Nota fiscal cancelada com sucesso", $redirectUrl); - } } @@ -349,14 +363,12 @@ public function legacyFunctions($vars) if ($_REQUEST['gnfe_message']) { echo urldecode(base64_decode($_REQUEST['gnfe_message'])); } - } public function aliquots($vars) { try { - - $msg = new FlashMessages; + $msg = new FlashMessages(); $template = new Template(Addon::getModuleTemplatesDir()); $config = new \NFEioServiceInvoices\Configuration(); $servicesCodeRepo = new \NFEioServiceInvoices\Models\ProductCode\Repository(); @@ -375,8 +387,12 @@ public function aliquots($vars) $oldVersion = Versions::getOldNfeioModuleVersion(); // se tiver registro de versão antiga define mensagem if ($oldVersion) { - $msg->error("Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. -
Caso você tenha acabado de concluir uma migração para a última versão, desative e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de nptas.", '', true); + $msg->error( + "Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. +
Caso você tenha acabado de concluir uma migração para a última versão, desative e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de nptas.", + '', + true + ); } if ($msg->hasMessages()) { @@ -384,7 +400,6 @@ public function aliquots($vars) } return $template->fetch('aliquots', $vars); - } catch (\Exception $e) { echo $e->getMessage(); } @@ -414,15 +429,15 @@ public function aliquotsSave($vars) if ($post['btnDelete'] === 'true') { $aliquotsRepo->delete($post); $msg->warning("Alíquota removida com sucesso.", "{$vars['modulelink']}&action=aliquots"); - } } /** * Reemite as notas fiscais para uma determinada fatura + * * @version 2.1 - * @author Andre Bellafronte - * @param $vars array variáveis do WHMCS + * @author Andre Bellafronte + * @param $vars array variáveis do WHMCS */ public function reissueNf($vars) { @@ -432,7 +447,7 @@ public function reissueNf($vars) $invoiceId = $get['invoice_id']; $moduleLink = $vars['modulelink']; $moduleAction = 'index'; - $redirectUrl = $moduleLink.'&action='.$moduleAction; + $redirectUrl = $moduleLink . '&action=' . $moduleAction; $response = $nfe->reissueNfSeriesByInvoiceId($invoiceId); @@ -441,7 +456,6 @@ public function reissueNf($vars) } else { $msg->info("Nota fiscal enviada para processamento.", $redirectUrl); } - } public function cancelNf($vars) @@ -452,7 +466,7 @@ public function cancelNf($vars) $invoiceId = $get['invoice_id']; $moduleLink = $vars['modulelink']; $moduleAction = 'index'; - $redirectUrl = $moduleLink.'&action='.$moduleAction; + $redirectUrl = $moduleLink . '&action=' . $moduleAction; $response = $nfe->cancelNfSeriesByInvoiceId($invoiceId); @@ -473,18 +487,21 @@ public function cancelNf($vars) public function support($vars) { try { - Addon::I()->isAdmin(true); $template = new Template(Addon::getModuleTemplatesDir()); $assetsURL = Addon::I()->getAssetsURL(); - $msg = new FlashMessages; + $msg = new FlashMessages(); // procuro pelo registro de versão da estrutura legada para avisar o admin para não rodar duas versões $oldVersion = Versions::getOldNfeioModuleVersion(); // se tiver registro de versão antiga define mensagem if ($oldVersion) { - $msg->error("Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. -
Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", '', true); + $msg->error( + "Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo com uma nova versão. +
Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", + '', + true + ); } if ($msg->hasMessages()) { @@ -495,7 +512,6 @@ public function support($vars) return $template->fetch('support', $vars); - } catch (\Exception $e) { echo $e->getMessage(); } @@ -507,14 +523,18 @@ public function about($vars) $template = new Template(Addon::getModuleTemplatesDir()); $assetsURL = Addon::I()->getAssetsURL(); - $msg = new FlashMessages; + $msg = new FlashMessages(); // procuro pelo registro de versão da estrutura legada para avisar o admin para não rodar duas versões $oldVersion = Versions::getOldNfeioModuleVersion(); // se tiver registro de versão antiga define mensagem if ($oldVersion) { - $msg->error("Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo a uma nova versão. - Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", '', true); + $msg->error( + "Atenção: Você está rodando uma versão antiga do módulo ({$oldVersion}) em paralelo a uma nova versão. + Caso você tenha acabado de concluir uma migração para a última versão, desative a versão anterior e remova o antigo diretório addons/gofasnfe imediatamente para evitar duplicidade na geração de notas.", + '', + true + ); } if ($msg->hasMessages()) { @@ -524,6 +544,5 @@ public function about($vars) $vars['assetsURL'] = $assetsURL; return $template->fetch('about', $vars); - } } diff --git a/modules/addons/NFEioServiceInvoices/lib/Client/ClientDispatcher.php b/modules/addons/NFEioServiceInvoices/lib/Client/ClientDispatcher.php index bc5d5e5..fc57996 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Client/ClientDispatcher.php +++ b/modules/addons/NFEioServiceInvoices/lib/Client/ClientDispatcher.php @@ -5,13 +5,13 @@ /** * Sample Client Area Dispatch Handler */ -class ClientDispatcher { - +class ClientDispatcher +{ /** * Dispatch request. * * @param string $action - * @param array $parameters + * @param array $parameters * * @return array */ diff --git a/modules/addons/NFEioServiceInvoices/lib/Client/Controller.php b/modules/addons/NFEioServiceInvoices/lib/Client/Controller.php index a4a111d..514f1f5 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Client/Controller.php +++ b/modules/addons/NFEioServiceInvoices/lib/Client/Controller.php @@ -1,29 +1,32 @@ client(); if ($client) { $nfId = $_GET['nfid']; @@ -32,31 +35,30 @@ public function downloadNfPdf($vars) exit(); } else { http_response_code(401); - } } /** * Método para download da NF em XML na area do cliente. + * * @version 2.1 - * @author Andre Bellafronte - * @param $vars array variável WHMCS - * @return void XML + * @author Andre Bellafronte + * @param $vars array variável WHMCS + * @return void XML */ public function downloadNfXml($vars) { - $currentUser = new \WHMCS\Authentication\CurrentUser; + $currentUser = new \WHMCS\Authentication\CurrentUser(); $client = $currentUser->client(); - if($client) { + if ($client) { $nfId = $_GET['nfid']; $legacyFunctions = new \NFEioServiceInvoices\Legacy\Functions(); header('Content-type: application/xml'); - header("Content-Disposition: attachment; filename=".$nfId.".xml"); + header("Content-Disposition: attachment; filename=" . $nfId . ".xml"); echo $legacyFunctions->gnfe_xml_nfe($nfId); exit(); } else { http_response_code(401); } - } } diff --git a/modules/addons/NFEioServiceInvoices/lib/Configuration.php b/modules/addons/NFEioServiceInvoices/lib/Configuration.php index 3a9275c..48ea63e 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Configuration.php +++ b/modules/addons/NFEioServiceInvoices/lib/Configuration.php @@ -2,7 +2,6 @@ namespace NFEioServiceInvoices; - use Plasticbrain\FlashMessages\FlashMessages; final class Configuration extends \WHMCSExpert\mtLibs\process\AbstractConfiguration @@ -39,7 +38,6 @@ public function __construct() $this->setClientAreaName($this->clientAreaName); $this->setVersion($this->version); $this->setTablePrefix($this->tablePrefix); - } /** @@ -185,10 +183,8 @@ public function verifyMandatoryFields($vars, $returnMissingFields = false, $redi $msg = new FlashMessages(); if ($redirect) { $msg->warning("Você foi redirecionado para o menu Configurações", "{$vars['modulelink']}&action=Configuration"); - } else { foreach ($missingFields as $key => $value) { - $msg->error("Campo obrigatório {$value['label']} está ausente.", null, true); /*if ($redirect && $returnMissingFields === false) { @@ -197,18 +193,13 @@ public function verifyMandatoryFields($vars, $returnMissingFields = false, $redi $msg->warning("Você foi redirecionado para o menu Configurações", "{$vars['modulelink']}&action=Configuration"); } }*/ - } } - } if ($returnMissingFields) { return $missingFields; } - - - } /** @@ -252,8 +243,6 @@ public function activate() $moduleConfigurationRepo = new Models\ModuleConfiguration\Repository(); // inicia os valores padrões nas configurações do módulo $moduleConfigurationRepo->initDefaultValues(); - - } public function deactivate() @@ -269,7 +258,6 @@ public function deactivate() $clientConfigurationRepo = new \NFEioServiceInvoices\Models\ClientConfiguration\Repository(); // não derruba a tabela com configurações persoanlizadas de emissão por segurança // $clientConfigurationRepo->dropProductCodeTable(); - } public function upgrade($vars) @@ -296,5 +284,4 @@ public function upgrade($vars) */ } } - } diff --git a/modules/addons/NFEioServiceInvoices/lib/CustomFields.php b/modules/addons/NFEioServiceInvoices/lib/CustomFields.php index 2c511c9..b226417 100644 --- a/modules/addons/NFEioServiceInvoices/lib/CustomFields.php +++ b/modules/addons/NFEioServiceInvoices/lib/CustomFields.php @@ -2,15 +2,13 @@ namespace NFEioServiceInvoices; -use \WHMCS\Database\Capsule; +use WHMCS\Database\Capsule; class CustomFields { - private static function queryCF(array $select, array $where) { return Capsule::table('tblcustomfields')->select($select)->where($where)->get(); - } public static function getClientFields() @@ -40,6 +38,4 @@ public static function getClientFieldsAsKeys() return $fields; } - - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Helpers/Invoices.php b/modules/addons/NFEioServiceInvoices/lib/Helpers/Invoices.php index ef5da20..bd2f8f6 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Helpers/Invoices.php +++ b/modules/addons/NFEioServiceInvoices/lib/Helpers/Invoices.php @@ -3,12 +3,10 @@ namespace NFEioServiceInvoices\Helpers; use NFEioServiceInvoices\Helpers\Invoices as InvoicesHelper; -use \WHMCS\Database\Capsule; - +use WHMCS\Database\Capsule; class Invoices { - public static function getInvoiceStatus($id) { return Capsule::table('tblinvoices')->where('id', '=', $id)->value('status'); @@ -48,14 +46,13 @@ public static function generateNfServiceDescription($invoiceId, $description) } return $description; - - } /** * Calcula o valor de retenção para o ISS - * @param $amount - * @param $issHeld + * + * @param $amount + * @param $issHeld * @return float */ public static function getIssHeldAmount($amount, $issHeld) @@ -67,8 +64,9 @@ public static function getIssHeldAmount($amount, $issHeld) /** * Verifica se uma determinada fatura existe no banco de dados com base no seu ID. - * @param $invoiceId integer ID da fatura - * @return bool true se tiver false se não existir + * + * @param $invoiceId integer ID da fatura + * @return bool true se tiver false se não existir * @version 2.1 */ public static function hasInvoice($invoiceId) @@ -81,5 +79,4 @@ public static function hasInvoice($invoiceId) return false; } } - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Helpers/Versions.php b/modules/addons/NFEioServiceInvoices/lib/Helpers/Versions.php index 1c909b2..96aad2a 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Helpers/Versions.php +++ b/modules/addons/NFEioServiceInvoices/lib/Helpers/Versions.php @@ -2,7 +2,7 @@ namespace NFEioServiceInvoices\Helpers; -use \WHMCS\Database\Capsule; +use WHMCS\Database\Capsule; /** * Classe de ajuda com métodos para verificações e comparações de versões utilizadas no módulo @@ -67,5 +67,4 @@ public static function getOldNfeioModuleVersion() { return Capsule::table('tbladdonmodules')->where([['module', '=', 'gofasnfeio'], ['setting', '=', 'version']])->value('value'); } - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Hooks/AdminInvoicesControlsOutput.php b/modules/addons/NFEioServiceInvoices/lib/Hooks/AdminInvoicesControlsOutput.php index 390bb68..4a90b2a 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Hooks/AdminInvoicesControlsOutput.php +++ b/modules/addons/NFEioServiceInvoices/lib/Hooks/AdminInvoicesControlsOutput.php @@ -2,10 +2,8 @@ namespace NFEioServiceInvoices\Hooks; - class AdminInvoicesControlsOutput { - private $invoiceId; public function __construct(array $vars) @@ -24,7 +22,7 @@ public function run() $post = $_POST; $request = $post['nfeiosi']; //$request = $whmcs->get_req_var("nfeiosi"); - $msg = new \Plasticbrain\FlashMessages\FlashMessages; + $msg = new \Plasticbrain\FlashMessages\FlashMessages(); $config = new \NFEioServiceInvoices\Configuration(); $storage = new \WHMCSExpert\Addon\Storage($config->getStorageKey()); $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); @@ -48,7 +46,7 @@ public function run() if ($request === 'create' && $totalServiceInvoices == 0) { $queue = $nfe->queue($this->invoiceId); - if($queue['success']) { + if ($queue['success']) { $msg->success('Nota adicionada a fila de emissão.'); } else { $msg->error("Problemas ao tentar criar a nota: {$queue['message']}"); @@ -57,7 +55,7 @@ public function run() if ($request === 'reissue') { $result = $nfe->queue($this->invoiceId, true); - if($result['success']) { + if ($result['success']) { $msg->success('Nota adicionada a fila para reemissão.'); } else { $msg->error("Problemas ao tentar reemitir a nota: {$result['message']}"); @@ -78,7 +76,6 @@ public function run() $result = $legacyFunctions->gnfe_email_nfe($nfeId); if (!$result->message) { $msg->info("Nota enviada por e-mail com sucesso."); - } else { $msg->error("Problemas ao enviar e-mail: {$result->message}."); } @@ -90,9 +87,5 @@ public function run() } return $template->display('admininvoicescontrolsoutput', $vars); - - } - - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Hooks/AfterCronJob.php b/modules/addons/NFEioServiceInvoices/lib/Hooks/AfterCronJob.php index 658ad18..36871cf 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Hooks/AfterCronJob.php +++ b/modules/addons/NFEioServiceInvoices/lib/Hooks/AfterCronJob.php @@ -2,17 +2,17 @@ namespace NFEioServiceInvoices\Hooks; -use \WHMCS\Database\Capsule; +use WHMCS\Database\Capsule; /** * Classe com execução das rotinas para o gatilho aftercronjob - * @see https://developers.whmcs.com/hooks-reference/cron/#aftercronjob - * @author Andre Bellafronte + * + * @see https://developers.whmcs.com/hooks-reference/cron/#aftercronjob + * @author Andre Bellafronte * @version 2.1.0 */ class AfterCronJob { - /** * @var \NFEioServiceInvoices\Configuration */ @@ -32,7 +32,7 @@ public function __construct() $this->serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); $this->nf = new \NFEioServiceInvoices\NFEio\Nfe(); } - + public function run() { $storageKey = $this->config->getStorageKey(); @@ -46,32 +46,35 @@ public function run() $storage->set('last_cron', $dataAtual); $hasNfWaiting = Capsule::table($serviceInvoicesTable)->whereBetween('created_at', [$initialDate, $dataAtual])->where('status', '=', 'Waiting')->count(); - logModuleCall('NFEioServiceInvoices', 'Hook - AfterCronJob', "{$hasNfWaiting} notas a serem geradas", array( + logModuleCall( + 'NFEioServiceInvoices', + 'Hook - AfterCronJob', + "{$hasNfWaiting} notas a serem geradas", + array( [ 'total de notas' => $hasNfWaiting, 'data atual' => $dataAtual, 'data inicial' => $initialDate, ] - )); + ) + ); if ($hasNfWaiting) { - $queryNf = Capsule::table($serviceInvoicesTable)->orderBy('id', 'desc')->whereBetween('created_at', [$initialDate, $dataAtual])->where('status', '=', 'Waiting')->get(); foreach ($queryNf as $invoice) { - //$getQuery = Capsule::table('tblinvoices')->where('id', '=', $waiting->invoice_id)->get(['id', 'userid', 'total']); $this->nf->emit($invoice); - /**foreach ($getQuery as $invoices) { + /** +* foreach ($getQuery as $invoices) { $this->nf->emit($invoices, $waiting); - }*/ - + } +*/ } logModuleCall('NFEioServiceInvoices', 'Hook - AfterCronJob', "{$hasNfWaiting} notas a serem geradas", $queryNf); } } - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Hooks/ClientAreaPageViewInvoice.php b/modules/addons/NFEioServiceInvoices/lib/Hooks/ClientAreaPageViewInvoice.php index 5dd4cb8..9f9be6b 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Hooks/ClientAreaPageViewInvoice.php +++ b/modules/addons/NFEioServiceInvoices/lib/Hooks/ClientAreaPageViewInvoice.php @@ -2,11 +2,10 @@ namespace NFEioServiceInvoices\Hooks; -use \WHMCS\Database\Capsule; +use WHMCS\Database\Capsule; class ClientAreaPageViewInvoice { - /** * @var \NFEioServiceInvoices\Configuration */ @@ -52,5 +51,4 @@ public function run() return $vars; } - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Hooks/DailyCronJob.php b/modules/addons/NFEioServiceInvoices/lib/Hooks/DailyCronJob.php index e7831a6..cb117cc 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Hooks/DailyCronJob.php +++ b/modules/addons/NFEioServiceInvoices/lib/Hooks/DailyCronJob.php @@ -2,17 +2,17 @@ namespace NFEioServiceInvoices\Hooks; -use \WHMCS\Database\Capsule; +use WHMCS\Database\Capsule; /** * Classe com execução das rotinas para o gatilho dailycronjob - * @see https://developers.whmcs.com/hooks-reference/cron/#dailycronjob - * @author Andre Bellafronte + * + * @see https://developers.whmcs.com/hooks-reference/cron/#dailycronjob + * @author Andre Bellafronte * @version 2.1.0 */ class DailyCronJob { - /** * @var \NFEioServiceInvoices\Models\ServiceInvoices\Repository */ @@ -41,7 +41,6 @@ public function run() // condição que se certifica da existência de configuração para emissão de NF X dias após pgto da fatura if (isset($issueNfAfter) && (int)$issueNfAfter > 0) { - $todayDate = date("Y-m-d"); // qtd de dias configurado para gerar nf apos pgto $issueNoteAfterDays = $issueNfAfter; @@ -83,12 +82,8 @@ public function run() foreach ($invoicesIdToGenerateNF as $invoice) { $queue = $this->nf->queue($invoice); logModuleCall('NFEioServiceInvoices', 'Hook - DailyCronJob', $invoice, $queue); - } } - } - } - -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoiceCreation.php b/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoiceCreation.php index 71d8a3b..fdb70bc 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoiceCreation.php +++ b/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoiceCreation.php @@ -2,6 +2,13 @@ namespace NFEioServiceInvoices\Hooks; +/** + * Class InvoiceCreation + * Classe responsável por executar ações quando uma fatura é criada. + * + * @author Andre Bellafronte + * @package NFEioServiceInvoices\Hooks + */ class InvoiceCreation { private $invoiceId; @@ -21,8 +28,8 @@ public function run() { $nfe = new \NFEioServiceInvoices\NFEio\Nfe(); $storage = new \WHMCSExpert\Addon\Storage($this->config->getStorageKey()); - $invoiceData = localAPI('GetInvoice', array('invoiceid' => $this->invoiceId)); - $userId = $invoiceData['userid']; + $invoiceData = \WHMCS\Billing\Invoice::find($this->invoiceId); + $userId = $invoiceData->userid; $clientRepository = new \NFEioServiceInvoices\Models\ClientConfiguration\Repository(); $clientIssueCondition = $clientRepository->getClientIssueCondition($userId); $moduleIssueCondition = strtolower($storage->get('issue_note_default_cond')); @@ -30,7 +37,7 @@ public function run() $generateTaxBill = false; $generateTaxBillWhen = 'quando a fatura é gerada'; - if ($invoiceData['total'] > 0.00 AND (!$issueNoteAfter OR $issueNoteAfter == 0) AND $this->invoiceStatus != 'Draft' ) { + if ($invoiceData->total > 0.00 and (!$issueNoteAfter or $issueNoteAfter == 0) and $this->invoiceStatus != 'Draft') { $generateTaxBill = true; } @@ -39,20 +46,19 @@ public function run() 'invoiceData' => $invoiceData, 'userID' => $userId, 'clientIssueCondition' => $clientIssueCondition, - 'moduleIssueCondition' =>$moduleIssueCondition, + 'moduleIssueCondition' => $moduleIssueCondition, 'issueNoteAfter' => $issueNoteAfter, 'generateTaxBill' => $generateTaxBill, 'generateTaxBillWhen' => $generateTaxBillWhen ]; - if ($clientIssueCondition == 'seguir configuração do módulo nfe.io' AND $moduleIssueCondition == $generateTaxBillWhen AND $generateTaxBill) { + if ($clientIssueCondition == 'seguir configuração do módulo nfe.io' and $moduleIssueCondition == $generateTaxBillWhen and $generateTaxBill) { $queue = $nfe->queue($this->invoiceId); logModuleCall('NFEioServiceInvoices', __CLASS__ . __FUNCTION__, $data, $queue); } - if ($clientIssueCondition == $generateTaxBillWhen AND $generateTaxBill) { + if ($clientIssueCondition == $generateTaxBillWhen and $generateTaxBill) { $queue = $nfe->queue($this->invoiceId); logModuleCall('NFEioServiceInvoices', __CLASS__ . __FUNCTION__, $data, $queue); } - } -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoicePaid.php b/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoicePaid.php index 3624606..674db8d 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoicePaid.php +++ b/modules/addons/NFEioServiceInvoices/lib/Hooks/InvoicePaid.php @@ -17,10 +17,10 @@ public function run() { $nfe = new \NFEioServiceInvoices\NFEio\Nfe(); $storage = new \WHMCSExpert\Addon\Storage($this->config->getStorageKey()); - $invoiceData = localAPI('GetInvoice', array('invoiceid' => $this->invoiceId)); - $invoiceStatus = $invoiceData['status']; - $invoiceTotal = $invoiceData['total']; - $userId = $invoiceData['userid']; + $invoiceData = \WHMCS\Billing\Invoice::find($this->invoiceId); + $invoiceStatus = $invoiceData->status; + $invoiceTotal = $invoiceData->total; + $userId = $invoiceData->userid; $clientRepository = new \NFEioServiceInvoices\Models\ClientConfiguration\Repository(); $clientIssueCondition = $clientRepository->getClientIssueCondition($userId); $moduleIssueCondition = strtolower($storage->get('issue_note_default_cond')); @@ -28,7 +28,7 @@ public function run() $generateTaxBill = false; $generateTaxBillWhen = 'quando a fatura é paga'; - if ($invoiceTotal > 0.00 AND (!$issueNoteAfter OR $issueNoteAfter == 0) AND $invoiceStatus == 'Paid' ) { + if ($invoiceTotal > 0.00 and (!$issueNoteAfter or $issueNoteAfter == 0) and $invoiceStatus == 'Paid') { $generateTaxBill = true; } @@ -37,21 +37,20 @@ public function run() 'invoiceStatus' => $invoiceStatus, 'userID' => $userId, 'clientIssueCondition' => $clientIssueCondition, - 'moduleIssueCondition' =>$moduleIssueCondition, + 'moduleIssueCondition' => $moduleIssueCondition, 'issueNoteAfter' => $issueNoteAfter, 'generateTaxBill' => $generateTaxBill, 'generateTaxBillWhen' => $generateTaxBillWhen, 'invoiceData' => $invoiceData, ]; - if ($clientIssueCondition == 'seguir configuração do módulo nfe.io' AND $moduleIssueCondition == $generateTaxBillWhen AND $generateTaxBill) { + if ($clientIssueCondition == 'seguir configuração do módulo nfe.io' and $moduleIssueCondition == $generateTaxBillWhen and $generateTaxBill) { $queue = $nfe->queue($this->invoiceId); logModuleCall('NFEioServiceInvoices', __CLASS__ . __FUNCTION__, $data, $queue); } - if ($clientIssueCondition == $generateTaxBillWhen AND $generateTaxBill) { + if ($clientIssueCondition == $generateTaxBillWhen and $generateTaxBill) { $queue = $nfe->queue($this->invoiceId); logModuleCall('NFEioServiceInvoices', __CLASS__ . __FUNCTION__, $data, $queue); } - } -} \ No newline at end of file +} diff --git a/modules/addons/NFEioServiceInvoices/lib/Legacy/Functions.php b/modules/addons/NFEioServiceInvoices/lib/Legacy/Functions.php index 45c2dd4..d14bfd7 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Legacy/Functions.php +++ b/modules/addons/NFEioServiceInvoices/lib/Legacy/Functions.php @@ -2,13 +2,14 @@ namespace NFEioServiceInvoices\Legacy; -use \WHMCS\Database\Capsule; +use WHMCS\Database\Capsule; use NFEioServiceInvoices\Addon; use WHMCSExpert\Addon\Storage; class Functions { - function gnfe_config($set = false) { + function gnfe_config($set = false) + { $_storageKey = Addon::I()->configuration()->storageKey; @@ -28,7 +29,8 @@ function gnfe_config($set = false) { } } - function gnfe_customer($user_id, $client) { + function gnfe_customer($user_id, $client) + { //Determine custom fields id $CPF_id = $this->gnfe_config('cpf_camp'); $CNPJ_id = $this->gnfe_config('cnpj_camp'); @@ -53,9 +55,9 @@ function gnfe_customer($user_id, $client) { $cnpj_customfield_value = preg_replace('/[^0-9]/', '', $customfieldvalue->value); } } - logModuleCall('NFEioServiceInvoices', 'gnfe_customer-cpf', $cpf_customfield_value, '','', ''); - logModuleCall('NFEioServiceInvoices', 'gnfe_customer-cnpj', $cnpj_customfield_value, '','', ''); - logModuleCall('NFEioServiceInvoices', 'gnfe_customer-municipal', $insc_customfield_value, '','', ''); + logModuleCall('NFEioServiceInvoices', 'gnfe_customer-cpf', $cpf_customfield_value, '', '', ''); + logModuleCall('NFEioServiceInvoices', 'gnfe_customer-cnpj', $cnpj_customfield_value, '', '', ''); + logModuleCall('NFEioServiceInvoices', 'gnfe_customer-municipal', $insc_customfield_value, '', '', ''); // Cliente possui CPF e CNPJ // CPF com 1 nº a menos, adiciona 0 antes do documento @@ -95,15 +97,15 @@ function gnfe_customer($user_id, $client) { if (($cpf and $cnpj) or (!$cpf and $cnpj)) { $custumer['doc_type'] = 2; $custumer['document'] = $cnpj; - if ($client['companyname']) { - $custumer['name'] = $client['companyname']; - } elseif (!$client['companyname']) { - $custumer['name'] = $client['firstname'] . ' ' . $client['lastname']; + if ($client->companyname) { + $custumer['name'] = $client->companyname; + } elseif (!$client->companyname) { + $custumer['name'] = $client->firstname . ' ' . $client->lastname; } } elseif ($cpf and !$cnpj) { $custumer['doc_type'] = 1; $custumer['document'] = $cpf; - $custumer['name'] = $client['firstname'] . ' ' . $client['lastname']; + $custumer['name'] = $client->firstname . ' ' . $client->lastname; } if ($insc_customfield_value != 'NF') { $custumer['insc_municipal'] = $insc_customfield_value; @@ -119,7 +121,8 @@ function gnfe_customer($user_id, $client) { } } - function gnfe_customfields() { + function gnfe_customfields() + { //Determine custom fields id $customfields = []; foreach (Capsule::table('tblcustomfields')->where('type', '=', 'client')->get(['fieldname', 'id']) as $customfield) { @@ -131,7 +134,8 @@ function gnfe_customfields() { return $customfields; } - function gnfe_customfields_dropdow() { + function gnfe_customfields_dropdow() + { //Determine custom fields id $customfields_array = []; foreach (Capsule::table('tblcustomfields')->where('type', '=', 'client')->get(['fieldname', 'id']) as $customfield) { @@ -152,13 +156,15 @@ function gnfe_customfields_dropdow() { return $dropFieldArray; } - function gnfe_country_code($country) { + function gnfe_country_code($country) + { $array = ['BD' => 'BGD', 'BE' => 'BEL', 'BF' => 'BFA', 'BG' => 'BGR', 'BA' => 'BIH', 'BB' => 'BRB', 'WF' => 'WLF', 'BL' => 'BLM', 'BM' => 'BMU', 'BN' => 'BRN', 'BO' => 'BOL', 'BH' => 'BHR', 'BI' => 'BDI', 'BJ' => 'BEN', 'BT' => 'BTN', 'JM' => 'JAM', 'BV' => 'BVT', 'BW' => 'BWA', 'WS' => 'WSM', 'BQ' => 'BES', 'BR' => 'BRA', 'BS' => 'BHS', 'JE' => 'JEY', 'BY' => 'BLR', 'BZ' => 'BLZ', 'RU' => 'RUS', 'RW' => 'RWA', 'RS' => 'SRB', 'TL' => 'TLS', 'RE' => 'REU', 'TM' => 'TKM', 'TJ' => 'TJK', 'RO' => 'ROU', 'TK' => 'TKL', 'GW' => 'GNB', 'GU' => 'GUM', 'GT' => 'GTM', 'GS' => 'SGS', 'GR' => 'GRC', 'GQ' => 'GNQ', 'GP' => 'GLP', 'JP' => 'JPN', 'GY' => 'GUY', 'GG' => 'GGY', 'GF' => 'GUF', 'GE' => 'GEO', 'GD' => 'GRD', 'GB' => 'GBR', 'GA' => 'GAB', 'SV' => 'SLV', 'GN' => 'GIN', 'GM' => 'GMB', 'GL' => 'GRL', 'GI' => 'GIB', 'GH' => 'GHA', 'OM' => 'OMN', 'TN' => 'TUN', 'JO' => 'JOR', 'HR' => 'HRV', 'HT' => 'HTI', 'HU' => 'HUN', 'HK' => 'HKG', 'HN' => 'HND', 'HM' => 'HMD', 'VE' => 'VEN', 'PR' => 'PRI', 'PS' => 'PSE', 'PW' => 'PLW', 'PT' => 'PRT', 'SJ' => 'SJM', 'PY' => 'PRY', 'IQ' => 'IRQ', 'PA' => 'PAN', 'PF' => 'PYF', 'PG' => 'PNG', 'PE' => 'PER', 'PK' => 'PAK', 'PH' => 'PHL', 'PN' => 'PCN', 'PL' => 'POL', 'PM' => 'SPM', 'ZM' => 'ZMB', 'EH' => 'ESH', 'EE' => 'EST', 'EG' => 'EGY', 'ZA' => 'ZAF', 'EC' => 'ECU', 'IT' => 'ITA', 'VN' => 'VNM', 'SB' => 'SLB', 'ET' => 'ETH', 'SO' => 'SOM', 'ZW' => 'ZWE', 'SA' => 'SAU', 'ES' => 'ESP', 'ER' => 'ERI', 'ME' => 'MNE', 'MD' => 'MDA', 'MG' => 'MDG', 'MF' => 'MAF', 'MA' => 'MAR', 'MC' => 'MCO', 'UZ' => 'UZB', 'MM' => 'MMR', 'ML' => 'MLI', 'MO' => 'MAC', 'MN' => 'MNG', 'MH' => 'MHL', 'MK' => 'MKD', 'MU' => 'MUS', 'MT' => 'MLT', 'MW' => 'MWI', 'MV' => 'MDV', 'MQ' => 'MTQ', 'MP' => 'MNP', 'MS' => 'MSR', 'MR' => 'MRT', 'IM' => 'IMN', 'UG' => 'UGA', 'TZ' => 'TZA', 'MY' => 'MYS', 'MX' => 'MEX', 'IL' => 'ISR', 'FR' => 'FRA', 'IO' => 'IOT', 'SH' => 'SHN', 'FI' => 'FIN', 'FJ' => 'FJI', 'FK' => 'FLK', 'FM' => 'FSM', 'FO' => 'FRO', 'NI' => 'NIC', 'NL' => 'NLD', 'NO' => 'NOR', 'NA' => 'NAM', 'VU' => 'VUT', 'NC' => 'NCL', 'NE' => 'NER', 'NF' => 'NFK', 'NG' => 'NGA', 'NZ' => 'NZL', 'NP' => 'NPL', 'NR' => 'NRU', 'NU' => 'NIU', 'CK' => 'COK', 'XK' => 'XKX', 'CI' => 'CIV', 'CH' => 'CHE', 'CO' => 'COL', 'CN' => 'CHN', 'CM' => 'CMR', 'CL' => 'CHL', 'CC' => 'CCK', 'CA' => 'CAN', 'CG' => 'COG', 'CF' => 'CAF', 'CD' => 'COD', 'CZ' => 'CZE', 'CY' => 'CYP', 'CX' => 'CXR', 'CR' => 'CRI', 'CW' => 'CUW', 'CV' => 'CPV', 'CU' => 'CUB', 'SZ' => 'SWZ', 'SY' => 'SYR', 'SX' => 'SXM', 'KG' => 'KGZ', 'KE' => 'KEN', 'SS' => 'SSD', 'SR' => 'SUR', 'KI' => 'KIR', 'KH' => 'KHM', 'KN' => 'KNA', 'KM' => 'COM', 'ST' => 'STP', 'SK' => 'SVK', 'KR' => 'KOR', 'SI' => 'SVN', 'KP' => 'PRK', 'KW' => 'KWT', 'SN' => 'SEN', 'SM' => 'SMR', 'SL' => 'SLE', 'SC' => 'SYC', 'KZ' => 'KAZ', 'KY' => 'CYM', 'SG' => 'SGP', 'SE' => 'SWE', 'SD' => 'SDN', 'DO' => 'DOM', 'DM' => 'DMA', 'DJ' => 'DJI', 'DK' => 'DNK', 'VG' => 'VGB', 'DE' => 'DEU', 'YE' => 'YEM', 'DZ' => 'DZA', 'US' => 'USA', 'UY' => 'URY', 'YT' => 'MYT', 'UM' => 'UMI', 'LB' => 'LBN', 'LC' => 'LCA', 'LA' => 'LAO', 'TV' => 'TUV', 'TW' => 'TWN', 'TT' => 'TTO', 'TR' => 'TUR', 'LK' => 'LKA', 'LI' => 'LIE', 'LV' => 'LVA', 'TO' => 'TON', 'LT' => 'LTU', 'LU' => 'LUX', 'LR' => 'LBR', 'LS' => 'LSO', 'TH' => 'THA', 'TF' => 'ATF', 'TG' => 'TGO', 'TD' => 'TCD', 'TC' => 'TCA', 'LY' => 'LBY', 'VA' => 'VAT', 'VC' => 'VCT', 'AE' => 'ARE', 'AD' => 'AND', 'AG' => 'ATG', 'AF' => 'AFG', 'AI' => 'AIA', 'VI' => 'VIR', 'IS' => 'ISL', 'IR' => 'IRN', 'AM' => 'ARM', 'AL' => 'ALB', 'AO' => 'AGO', 'AQ' => 'ATA', 'AS' => 'ASM', 'AR' => 'ARG', 'AU' => 'AUS', 'AT' => 'AUT', 'AW' => 'ABW', 'IN' => 'IND', 'AX' => 'ALA', 'AZ' => 'AZE', 'IE' => 'IRL', 'ID' => 'IDN', 'UA' => 'UKR', 'QA' => 'QAT', 'MZ' => 'MOZ']; return $array[$country]; } - function gnfe_ibge($zip) { + function gnfe_ibge($zip) + { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://open.nfe.io/v1/cities/' . $zip . '/postalcode'); curl_setopt($curl, CURLOPT_TIMEOUT, 30); @@ -170,15 +176,16 @@ function gnfe_ibge($zip) { $city = json_decode(json_encode(json_decode($response))); if ($city->message || $err) { - logModuleCall('NFEioServiceInvoices', 'gnfe_ibge', $zip, $city->message, 'ERROR', ''); + logModuleCall('NFEioServiceInvoices', 'gnfe_ibge', $zip, $response, 'ERROR', ''); return 'ERROR'; } else { return $city->city->code; } } - function gnfe_queue_nfe($invoice_id, $create_all = false) { - $invoice = localAPI('GetInvoice', ['invoiceid' => $invoice_id], false); + function gnfe_queue_nfe($invoice_id, $create_all = false) + { + $invoice = \WHMCS\Billing\Invoice::find($invoice_id); $itens = $this->get_product_invoice($invoice_id); $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); $_tableName = $serviceInvoicesRepo->tableName(); @@ -186,7 +193,7 @@ function gnfe_queue_nfe($invoice_id, $create_all = false) { foreach ($itens as $item) { $data = [ 'invoice_id' => $invoice_id, - 'user_id' => $invoice['userid'], + 'user_id' => $invoice->userid, 'nfe_id' => 'waiting', 'status' => 'Waiting', 'services_amount' => $item['amount'], @@ -203,7 +210,7 @@ function gnfe_queue_nfe($invoice_id, $create_all = false) { if (!$nfe_for_invoice['status'] || $create_all) { $create_all = true; try { - $service_code_row = Capsule::table($_tableName)->where('service_code', '=', $item['code_service'])->where('invoice_id', '=', $invoice_id)->where('status','=','waiting')->get(['id', 'services_amount']); + $service_code_row = Capsule::table($_tableName)->where('service_code', '=', $item['code_service'])->where('invoice_id', '=', $invoice_id)->where('status', '=', 'waiting')->get(['id', 'services_amount']); if (count($service_code_row) == 1) { $mountDB = floatval($service_code_row[0]->services_amount); @@ -222,43 +229,8 @@ function gnfe_queue_nfe($invoice_id, $create_all = false) { return 'success'; } - function gnfe_queue_nfe_edit($invoice_id, $gofasnfeio_id) { - $invoice = localAPI('GetInvoice', ['invoiceid' => $invoice_id], false); - $itens = $this->get_product_invoice($invoice_id); - $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); - $_tableName = $serviceInvoicesRepo->tableName(); - - foreach ($itens as $item) { - $data = [ - 'invoice_id' => $invoice_id, - 'user_id' => $invoice['userid'], - 'nfe_id' => 'waiting', - 'status' => 'Waiting', - 'services_amount' => $item['amount'], - 'environment' => 'waiting', - 'flow_status' => 'waiting', - 'pdf' => 'waiting', - 'created_at' => date('Y-m-d H:i:s'), - 'updated_at' => 'waiting', - 'rpsSerialNumber' => 'waiting', - 'service_code' => $item['code_service'], - ]; - - $nfe_for_invoice = $this->gnfe_get_local_nfe($invoice_id, ['status']); - - if ((string) $nfe_for_invoice['status'] === (string) 'Cancelled' or (string) $nfe_for_invoice['status'] === (string) 'Error') { - try { - $update_nfe = Capsule::table($_tableName)->where('invoice_id', '=', $invoice_id)->where('id', '=', $gofasnfeio_id)->update($data); - } catch (\Exception $e) { - return $e->getMessage(); - } - } - } - - return 'success'; - } - - function gnfe_issue_nfe($postfields) { + function gnfe_issue_nfe($postfields) + { $webhook_url = Addon::getCallBackPath(); $gnfe_webhook_id = $this->gnfe_config('webhook_id'); $_storageKey = Addon::I()->configuration()->storageKey; @@ -266,14 +238,12 @@ function gnfe_issue_nfe($postfields) { if ($gnfe_webhook_id) { $check_webhook = $this->gnfe_check_webhook($gnfe_webhook_id); - - if ($check_webhook == null) - { + + if ($check_webhook == null) { return (object) ['message' => 'Erro ao checar a existência de um webhook já cadastrado']; } - - if ($check_webhook == "ERRO 400" || $check_webhook == "ERRO 404") - { + + if ($check_webhook == "ERRO 400" || $check_webhook == "ERRO 404") { $gnfe_webhook_id = null; } } @@ -281,8 +251,7 @@ function gnfe_issue_nfe($postfields) { if ($gnfe_webhook_id and (string) $check_webhook['hooks']['url'] !== (string) $webhook_url) { $delete_webhook = $this->gnfe_delete_webhook($gnfe_webhook_id); - if ($delete_webhook == null) - { + if ($delete_webhook == null) { return (object) ['message' => 'Erro ao deletar webhook que estava com a url divergente']; } @@ -291,16 +260,14 @@ function gnfe_issue_nfe($postfields) { if (!$gnfe_webhook_id) { $create_webhook = $this->gnfe_create_webhook($webhook_url); - + logModuleCall('NFEioServiceInvoices', 'gnfe_issue_nfe - gnfe_create_webhook', $create_webhook, $webhook_url); - if ($create_webhook == null) - { + if ($create_webhook == null) { return (object) ['message' => 'Erro ao criar novo webhook']; } if ($create_webhook['hooks']['id']) { - $storage->set('webhook_id', $create_webhook['hooks']['id']); $storage->set('webhook_secret', $create_webhook['hooks']['secret']); } @@ -318,6 +285,7 @@ function gnfe_issue_nfe($postfields) { $info = curl_getinfo($curl); curl_close($curl); + $error = $err ? $err : $response; logModuleCall('NFEioServiceInvoices', 'gnfe_issue_nfe - curl_init', $error, $info, '', ''); logModuleCall('NFEioServiceInvoices', 'gnfe_issue_nfe - CURLOPT_POSTFIELDS', json_encode($postfields), '', '', ''); @@ -328,26 +296,18 @@ function gnfe_issue_nfe($postfields) { } } - function gnfe_get_nfe($nf) { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices/' . $nf); - curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: text/json', 'Accept: application/json', 'Authorization: ' . $this->gnfe_config('api_key')]); - curl_setopt($curl, CURLOPT_TIMEOUT, 30); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - $response = curl_exec($curl); - curl_close($curl); - - return json_decode($response); - } /** * Retorna os dados da compahia na NFE. * * @return array */ - function gnfe_get_company_info($set = false) { + function gnfe_get_company_info($set = false) + { $curl = curl_init(); - curl_setopt_array($curl, [ + curl_setopt_array( + $curl, + [ CURLOPT_URL => 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id'), CURLOPT_TIMEOUT => 30, CURLOPT_RETURNTRANSFER => true, @@ -356,7 +316,8 @@ function gnfe_get_company_info($set = false) { 'Accept: application/json', 'Authorization: ' . $this->gnfe_config('api_key') ] - ]); + ] + ); $response = json_decode(curl_exec($curl), true); $response = $response['companies']; @@ -376,56 +337,14 @@ function gnfe_get_company_info($set = false) { } } + /** - * Responsável por enviar o último RPS para a NFe. + * Testa a conexão com a API da NFE. * - * @param int $rpsNumber - * - * @return void + * @return mixed */ - function gnfe_put_rps($company, $rpsNumber) { - $company['rpsNumber'] = intval($rpsNumber) + 1; - $requestBody = json_encode($company); - - $curl = curl_init(); - curl_setopt_array($curl, [ - CURLOPT_URL => 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id'), - CURLOPT_TIMEOUT => 30, - CURLOPT_CUSTOMREQUEST => 'PUT', - CURLOPT_POSTFIELDS => $requestBody, - CURLOPT_HTTPHEADER => [ - 'Content-Type: application/json', - 'Accept: application/json', - 'Authorization: ' . $this->gnfe_config('api_key') - ] - ]); - $response = json_decode(curl_exec($curl), true); - $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - curl_close($curl); - - if ($httpCode !== 200) { - $response = - ' Http code: ' . $httpCode . '|' . - ' Resposta: ' . $response . '|' . - ' Consulte: https://nfe.io/docs/desenvolvedores/rest-api/nota-fiscal-de-servico-v1/#/Companies/Companies_Put'; - logModuleCall('NFEioServiceInvoices', 'gnfe_put_rps', $requestBody, $response, '', ''); - } else { - $nfe_rps = intval($this->gnfe_get_company_info('rpsNumber')); - $whmcs_rps = intval($this->gnfe_config('rps_number')); - - // Verifica se o RPS na NFe é maior ou igual ao RPS no WHMCS para garantir que a ação foi efetivada. - if ($nfe_rps >= $whmcs_rps) { - Capsule::table('tbladdonmodules') - ->where('module', '=', 'gofasnfeio') - ->where('setting', '=', 'rps_number') - ->update(['value' => 'RPS administrado pela NFe.']); - } else { - logModuleCall('NFEioServiceInvoices', 'gnfe_put_rps', $requestBody, 'Erro ao tentar passar tratativa de RPS para NFe. ' . $response, '', ''); - } - } - } - - function gnfe_test_connection() { + function gnfe_test_connection() + { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices'); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: text/json', 'Accept: application/json', 'Authorization: ' . $this->gnfe_config('api_key')]); @@ -440,45 +359,8 @@ function gnfe_test_connection() { return $info; } - /** - * Pega o JSON da última nota fiscal emitida do banco de dados da NFe. - * - * @return array; - */ - function gnfe_get_nfes() { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices?pageCount=1&pageIndex=1'); - curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: text/json', 'Accept: application/json', 'Authorization: ' . $this->gnfe_config('api_key')]); - curl_setopt($curl, CURLOPT_TIMEOUT, 30); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - $response = curl_exec($curl); - curl_close($curl); - return json_decode($response, true)['serviceInvoices']['0']; - } - - function gnfe_get_invoice_nfes($invoice_id) { - $nfes = []; - $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); - $_tableName = $serviceInvoicesRepo->tableName(); - // foreach( Capsule::table('tbladdonmodules') -> where( 'module', '=', 'gofasnfeio' ) -> get( array( 'setting', 'value') ) as $settings ) { - foreach (Capsule::table($_tableName)->where('invoice_id', '=', $invoice_id)->get(['invoice_id', 'user_id', 'nfe_id', 'status', 'services_amount', 'environment', 'flow_status', 'pdf', 'created_at', 'updated_at', 'rpsSerialNumber', 'rpsNumber']) as $nfe) { - $nfes = $nfe; - } - - $checkfields = json_decode(json_encode($nfes), true); - - if (!$checkfields) { - $fieldArray = ['status' => 'error', 'message' => 'database error']; - } elseif (count($checkfields) >= 1) { - $fieldArray = ['status' => 'success', 'result' => $checkfields]; - } else { - $fieldArray = ['status' => 'error', 'message' => 'nothing to show']; - } - - return $fieldArray; - } - - function gnfe_delete_nfe($nf) { + function gnfe_delete_nfe($nf) + { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices/' . $nf); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: text/json', 'Accept: application/json', 'Authorization: ' . $this->gnfe_config('api_key')]); @@ -491,7 +373,8 @@ function gnfe_delete_nfe($nf) { return json_decode($response); } - function gnfe_email_nfe($nf) { + function gnfe_email_nfe($nf) + { if ('on' == $this->gnfe_config('gnfe_email_nfe_config')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices/' . $nf . '/sendemail'); @@ -506,7 +389,8 @@ function gnfe_email_nfe($nf) { } } - function gnfe_pdf_nfe($nf) { + function gnfe_pdf_nfe($nf) + { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices/' . $nf . '/pdf'); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-type: text/json', 'Authorization: ' . $this->gnfe_config('api_key')]); @@ -519,12 +403,13 @@ function gnfe_pdf_nfe($nf) { $result = curl_exec($curl); curl_close($curl); header('Content-type: application/pdf'); - header("Content-Disposition: attachment; filename=".$nf.".pdf"); + header("Content-Disposition: attachment; filename=" . $nf . ".pdf"); echo $result; } - function gnfe_xml_nfe($nf) { + function gnfe_xml_nfe($nf) + { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices/' . $nf . '/xml'); curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: text/json', 'Authorization: ' . $this->gnfe_config('api_key')]); @@ -543,85 +428,8 @@ function gnfe_xml_nfe($nf) { return $result; } - function gnfe_whmcs_url() { - foreach (Capsule::table('tblconfiguration')->where('setting', '=', 'gnfewhmcsurl')->get(['value']) as $gnfewhmcsurl_) { - $gnfewhmcsurl = $gnfewhmcsurl_->value; - } - - return $gnfewhmcsurl; - } - - /** - * função duplicada - */ - /*function gnfe_xml_nfe($nf) { - $curl = curl_init(); - - curl_setopt_array($curl, [ - CURLOPT_URL => 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id') . '/serviceinvoices/' . $nf . '/xml', - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => [ - 'Content-Type: text/json', - 'Accept: application/json', - 'Authorization:' . $this->gnfe_config('api_key'), - ], - ]); - - $response = curl_exec($curl); - - curl_close($curl); - - return $response; - }*/ - - // TODO: adaptar para a URL do admin sem depender da tabela tblconfiguration - function gnfe_whmcs_admin_url() { - foreach (Capsule::table('tblconfiguration')->where('setting', '=', 'gnfewhmcsadminurl')->get(['value']) as $gnfewhmcsadminurl_) { - $gnfewhmcsadminurl = $gnfewhmcsadminurl_->value; - } - - return $gnfewhmcsadminurl; - } - - function gnfe_save_nfe($nfe, $user_id, $invoice_id, $pdf, $created_at, $updated_at) { - if ($nfe->servicesAmount == -1) { - return; - } - - $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); - $_tableName = $serviceInvoicesRepo->tableName(); - - $data = [ - 'invoice_id' => $invoice_id, - 'user_id' => $user_id, - 'nfe_id' => $nfe->id, - 'status' => $nfe->status, - 'services_amount' => $nfe->servicesAmount, - 'environment' => $nfe->environment, - 'flow_status' => $nfe->flowStatus, - 'pdf' => $pdf, - 'created_at' => $created_at, - 'updated_at' => $updated_at, - 'rpsSerialNumber' => $nfe->rpsSerialNumber, - 'rpsNumber' => $nfe->rpsNumber, - ]; - - try { - $save_nfe = Capsule::table($_tableName)->insert($data); - - return 'success'; - } catch (\Exception $e) { - return $e->getMessage(); - } - } - - function gnfe_update_nfe($nfe, $user_id, $invoice_id, $pdf, $created_at, $updated_at, $id_gofasnfeio = false) { + function gnfe_update_nfe($nfe, $user_id, $invoice_id, $pdf, $created_at, $updated_at, $id_gofasnfeio = false) + { $data = [ 'invoice_id' => $invoice_id, 'user_id' => $user_id, @@ -638,7 +446,6 @@ function gnfe_update_nfe($nfe, $user_id, $invoice_id, $pdf, $created_at, $update ]; try { - $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); $_tableName = $serviceInvoicesRepo->tableName(); @@ -659,11 +466,13 @@ function gnfe_update_nfe($nfe, $user_id, $invoice_id, $pdf, $created_at, $update /** * Returns the data of a invoice from the local WHMCS database. - * @var $invoice_id - * @var $values + * + * @var $invoice_id + * @var $values * @return string */ - function gnfe_get_local_nfe($invoice_id, $values) { + function gnfe_get_local_nfe($invoice_id, $values) + { $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); $_tableName = $serviceInvoicesRepo->tableName(); @@ -674,7 +483,8 @@ function gnfe_get_local_nfe($invoice_id, $values) { return $nfe_for_invoice['0']; } - function gnfe_check_webhook($id) { + function gnfe_check_webhook($id) + { try { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/hooks/' . $id); @@ -685,18 +495,13 @@ function gnfe_check_webhook($id) { $info = curl_getinfo($curl); curl_close($curl); - if(!curl_errno($curl)) - { - if ($info['http_code'] == 200) - { + if (!curl_errno($curl)) { + if ($info['http_code'] == 200) { return json_decode($response, true); - } - elseif ($info['http_code'] == 400 || $info['http_code'] == 404) - { + } elseif ($info['http_code'] == 400 || $info['http_code'] == 404) { logModuleCall('NFEioServiceInvoices', 'gnfe_check_webhook', $id, "ERRO " . $info['http_code']); return "ERRO " . $info['http_code']; - } - else { + } else { logModuleCall('NFEioServiceInvoices', 'gnfe_check_webhook', $id, $info['http_code']); } } @@ -707,7 +512,8 @@ function gnfe_check_webhook($id) { return null; } - function gnfe_create_webhook($url) { + function gnfe_create_webhook($url) + { try { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/hooks'); @@ -720,13 +526,10 @@ function gnfe_create_webhook($url) { $info = curl_getinfo($curl); curl_close($curl); - if(!curl_errno($curl)) - { - if ($info['http_code'] == 201) - { + if (!curl_errno($curl)) { + if ($info['http_code'] == 201) { return json_decode($response, true); - } - else { + } else { logModuleCall('NFEioServiceInvoices', 'gnfe_create_webhook', $url, $info['http_code']); } } @@ -737,7 +540,8 @@ function gnfe_create_webhook($url) { return null; } - function gnfe_delete_webhook($id) { + function gnfe_delete_webhook($id) + { try { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/hooks/' . $id); @@ -749,13 +553,10 @@ function gnfe_delete_webhook($id) { $info = curl_getinfo($curl); curl_close($curl); - if(!curl_errno($curl)) - { - if ($info['http_code'] == 200) - { + if (!curl_errno($curl)) { + if ($info['http_code'] == 200) { return json_decode($response, true); - } - else { + } else { logModuleCall('NFEioServiceInvoices', 'gnfe_delete_webhook', $id, $info['http_code']); } } @@ -771,10 +572,11 @@ function gnfe_delete_webhook($id) { * Possible values: * CancelFailed, IssueFailed, Issued, Cancelled, PullFromCityHall, WaitingCalculateTaxes, * WaitingDefineRpsNumber, WaitingSend, WaitingSendCancel, WaitingReturn, WaitingDownload - * @param $flowStatus - * @return string + * @param $flowStatus + * @return string */ - function gnfe_nfe_flowStatus($flowStatus) { + function gnfe_nfe_flowStatus($flowStatus) + { if ($flowStatus === 'CancelFailed') { $status = 'Cancelado por Erro'; } @@ -812,30 +614,8 @@ function gnfe_nfe_flowStatus($flowStatus) { return $status; } - function gnfe_get_company() { - $curl = curl_init(); - curl_setopt($curl, CURLOPT_URL, 'https://api.nfe.io/v1/companies/' . $this->gnfe_config('company_id')); - curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: text/json', 'Accept: application/json', 'Authorization: ' . $this->gnfe_config('api_key')]); - curl_setopt($curl, CURLOPT_TIMEOUT, 30); - curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); - $response = curl_exec($curl); - curl_close($curl); - - return json_decode($response, true); - } - - function gnfe_customer_service_code($item_id) { - $customfields = []; - foreach (Capsule::table('tblcustomfields')->where('type', '=', 'product')->where('fieldname', '=', 'Código de Serviço')->get(['fieldname', 'id']) as $customfield) { - $customfield_id = $customfield->id; - $insc_customfield_value = 'NF'; - foreach (Capsule::table('tblcustomfieldsvalues')->where('fieldid', '=', $customfield_id)->where('relid', '=', $item_id)->get(['value']) as $customfieldvalue) { - return $customfieldvalue->value; - } - } - } - - function get_product_invoice($invoice_id) { + function get_product_invoice($invoice_id) + { $query = 'SELECT tblinvoiceitems.invoiceid ,tblinvoiceitems.type ,tblinvoiceitems.relid, tblinvoiceitems.description,tblinvoiceitems.amount FROM tblinvoiceitems WHERE tblinvoiceitems.invoiceid = :INVOICEID'; @@ -885,66 +665,36 @@ function get_product_invoice($invoice_id) { return $products_details; } - function dowload_doc_log() { - $days = 5; - - $configs = []; - foreach (Capsule::table('tbladdonmodules')->where('module','=','gofasnfeio')->get(['setting', 'value']) as $row) { - $configs[$row->setting] = $row->value; - } - - $lastCron = Capsule::table('tbladdonmodules')->where('setting', '=' ,'last_cron')->get(['value'])[0]; - - $results = localAPI('WhmcsDetails'); - $v = $results['whmcs']['version']; - $actual_link = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; - - $text = '-|date' . PHP_EOL . '-|action' . PHP_EOL . '-|request' . PHP_EOL . '-|response' . PHP_EOL . '-|status' . PHP_EOL; - $text .= 'version =' . $v . PHP_EOL . 'date emission =' . date('Y-m-d H:i:s') . PHP_EOL . 'url =' . $actual_link . PHP_EOL . 'conf_module = ' . json_encode($configs) . PHP_EOL . 'last_cron = ' . $lastCron->value . PHP_EOL; - - $dataAtual = toMySQLDate(getTodaysDate(false)) . ' 23:59:59'; - $dataAnterior = date('Y-m-d',mktime (0, 0, 0, date('m'), date('d') - $days, date('Y'))) . ' 23:59:59'; - - foreach (Capsule::table('tblmodulelog')->where('module','=','NFEioServiceInvoices')->orderBy('date')->whereBetween('date', [$dataAnterior, $dataAtual])->get(['date', 'action', 'request', 'response', 'arrdata']) as $log) { - $text .= PHP_EOL . '==========================================================================================================================================' . PHP_EOL; - $text .= '-|date = ' . $log->date . PHP_EOL . '-|action = ' . $log->action . PHP_EOL . '-|request = ' . ($log->request) . PHP_EOL . '-|response = ' . ($log->response) . PHP_EOL . '-|status = ' . ($log->arrdata); - } - $text .= PHP_EOL . '====================================================================FIM DO ARQUIVO======================================================================' . PHP_EOL; - - header('Content-type: text/plain'); - header('Content-Disposition: attachment; filename="default-filename.txt"'); - print $text; - exit(); - } - - function update_status_nfe($invoice_id,$status) { + function update_status_nfe($invoice_id, $status) + { $serviceInvoicesRepo = new \NFEioServiceInvoices\Models\ServiceInvoices\Repository(); $_tableName = $serviceInvoicesRepo->tableName(); try { - $return = Capsule::table($_tableName)->where('invoice_id','=',$invoice_id)->update(['status' => $status]); + $return = Capsule::table($_tableName)->where('invoice_id', '=', $invoice_id)->update(['status' => $status]); return $return; } catch (Exception $e) { return $e->getMessage(); } } -// ------------------------------------------------- NOVAS FUNÇÕES /** - * @var $vars vem do arquivo hooks.php. + * @var string $invoiceId vem do arquivo hooks.php. * @return string */ - function gnfe_get_client_issue_invoice_cond_from_invoice_id($invoiceId) { + function gnfe_get_client_issue_invoice_cond_from_invoice_id($invoiceId) + { $clientConfigurationRepo = new \NFEioServiceInvoices\Models\ClientConfiguration\Repository(); $_table = $clientConfigurationRepo->tableName(); - $clientInvoiceId = localAPI('GetInvoice', ['invoiceid' => $invoiceId])['userid']; + + $clientId = \WHMCS\Billing\Invoice::find($invoiceId)->client->id; $clientCond = Capsule::table($_table) - ->where('client_id', '=', $clientInvoiceId) + ->where('client_id', '=', $clientId) ->where('key', '=', 'issue_nfe_cond') ->get(['value'])[0]->value; $clientCond = strtolower($clientCond); @@ -959,10 +709,12 @@ function gnfe_get_client_issue_invoice_cond_from_invoice_id($invoiceId) { /** * Returns a