Skip to content

Commit

Permalink
Merge pull request #1 from mrprompt/development
Browse files Browse the repository at this point in the history
refactory(validators): Remove external validation and using internal …
  • Loading branch information
mrprompt authored Dec 2, 2018
2 parents e7ca7dc + 3d4435b commit 5209503
Show file tree
Hide file tree
Showing 74 changed files with 189 additions and 5,949 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ Descrição dos exemplos
- samples/remessa.php - Geração de arquivo de remessa
- samples/recebido.php - Leitura do arquivo de retorno

## Contribuindo
## Licença

### Instalação
Após baixar o [Composer](http://www.getcomposer.org), basta rodar o *install*

```
composer.phar install --prefer-dist
```
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
],
"require": {
"php": "^7.1",
"respect/validation": "^1.1.12"
"mrprompt/shipmentcommon": "^2.0.2"
},
"require-dev": {
"phpunit/phpunit": "^6.1.3",
Expand Down
130 changes: 32 additions & 98 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="./vendor/autoload.php" colors="true" backupGlobals="false"
backupStaticAttributes="false" verbose="true"
stopOnError="true" stopOnFailure="false" stopOnIncomplete="true" stopOnSkipped="true">
backupStaticAttributes="false" verbose="true">
<php>
<const name="APPLICATION_ENV" value="testing"/>
</php>
Expand All @@ -16,17 +15,12 @@
<testsuite name="Received">
<directory>./tests/Received</directory>
</testsuite>

<testsuite name="Common">
<directory>./tests/Common</directory>
</testsuite>
</testsuites>

<filter>
<blacklist>
<directory suffix=".php">./vendor</directory>
<directory suffix=".php">./samples</directory>
<directory suffix=".php">./src/Common/Base/Type</directory>
</blacklist>

<whitelist processUncoveredFilesFromWhitelist="true">
Expand Down
4 changes: 2 additions & 2 deletions samples/cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @author Thiago Paes <mrprompt@gmail.com>
*/
use MrPrompt\Celesc\Common\Base\Charge;
use MrPrompt\Celesc\Common\Base\Occurrence;
use MrPrompt\ShipmentCommon\Base\Charge;
use MrPrompt\ShipmentCommon\Base\Occurrence;

/* @var $vencimento \DateTime */
$vencimento = (new DateTime())->add(new DateInterval('P30D'));
Expand Down
4 changes: 2 additions & 2 deletions samples/recebido.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
* @author Thiago Paes <mrprompt@gmail.com>
*/
use MrPrompt\Celesc\Received\File;
use MrPrompt\Celesc\Common\Base\Sequence;
use MrPrompt\ShipmentCommon\Base\Sequence;

require __DIR__ . '/bootstrap.php';

/* @var $lista array */
$lista = require __DIR__ . '/cart.php';

try {
/* @var $importer \MrPrompt\Celesc\Common\Base\Sequence */
/* @var $importer \MrPrompt\ShipmentCommon\Base\Sequence */
$sequence = new Sequence('063');

/* @var $importer \MrPrompt\Celesc\Received\File */
Expand Down
14 changes: 7 additions & 7 deletions samples/remessa.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
* @author Thiago Paes <mrprompt@gmail.com>
*/
use MrPrompt\Celesc\Factory;
use MrPrompt\Celesc\Common\Base\Cart;
use MrPrompt\Celesc\Common\Base\Sequence;
use MrPrompt\ShipmentCommon\Base\Cart;
use MrPrompt\ShipmentCommon\Base\Sequence;
use MrPrompt\Celesc\Shipment\File;
use MrPrompt\Celesc\Common\Base\Dealership;
use MrPrompt\ShipmentCommon\Base\Dealership;

require __DIR__ . '/bootstrap.php';

/* @var $today \DateTime */
$today = DateTime::createFromFormat('dmY', '01082016');

/* @var $cart \MrPrompt\Celesc\Common\Base\Cart */
/* @var $cart \MrPrompt\ShipmentCommon\Base\Cart */
$cart = new Cart();

/* @var $lista array */
Expand All @@ -42,13 +42,13 @@
}

try {
/* @var $sequence \MrPrompt\Celesc\Common\Base\Sequence */
/* @var $sequence \MrPrompt\ShipmentCommon\Base\Sequence */
$sequence = new Sequence('0104');

/* @var $customer \MrPrompt\Celesc\Common\Base\Customer */
/* @var $customer \MrPrompt\ShipmentCommon\Base\Customer */
$customer = Factory::createCustomerFromArray(array_shift($lista)['vendedor']);

/* @var $dealership \MrPrompt\Celesc\Common\Base\Dealership */
/* @var $dealership \MrPrompt\ShipmentCommon\Base\Dealership */
$dealership = new Dealership();
$dealership->setCode('0001');

Expand Down
Loading

0 comments on commit 5209503

Please sign in to comment.