Skip to content

Commit

Permalink
Merge pull request #12 from vinicciusguedes/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
vinicciusguedes authored Jul 22, 2024
2 parents 11d8dc4 + 54141d3 commit 86c4f85
Show file tree
Hide file tree
Showing 320 changed files with 20,655 additions and 6,388 deletions.
160 changes: 160 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
'operators' => ['=>' => 'align_single_space_minimal'],
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_statement' => [
'statements' => ['return'],
],
'single_space_around_construct' => true,
'cast_spaces' => true,
'class_attributes_separation' => [
'elements' => [
'const' => 'none',
'method' => 'one',
'property' => 'one',
'trait_import' => 'none',
],
],
'class_definition' => [
'multi_line_extends_each_single_line' => true,
'single_item_single_line' => true,
'single_line' => true,
],
'concat_space' => [
'spacing' => 'one',
],
'constant_case' => ['case' => 'lower'],
'declare_equal_normalize' => true,
'elseif' => true,
'encoding' => true,
'full_opening_tag' => true,
'fully_qualified_strict_types' => true, // added by Shift
'function_declaration' => true,
'type_declaration_spaces' => true,
'general_phpdoc_tag_rename' => true,
'heredoc_to_nowdoc' => true,
'include' => true,
'increment_style' => ['style' => 'post'],
'indentation_type' => true,
'linebreak_after_opening_tag' => true,
'line_ending' => true,
'lowercase_cast' => true,
'lowercase_keywords' => true,
'lowercase_static_reference' => true, // added from Symfony
'magic_method_casing' => true, // added from Symfony
'magic_constant_casing' => true,
'method_argument_space' => [
'on_multiline' => 'ignore',
],
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'native_function_casing' => true,
// 'no_alias_functions' => true,
'no_extra_blank_lines' => [
'tokens' => [
'extra',
'throw',
'use',
],
],
'no_blank_lines_after_class_opening' => true,
'no_blank_lines_after_phpdoc' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_mixed_echo_print' => [
'use' => 'echo',
],
'no_multiline_whitespace_around_double_arrow' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_after_function_name' => true,
'no_spaces_around_offset' => [
'positions' => ['inside', 'outside'],
],
'spaces_inside_parentheses' => true,
'no_trailing_comma_in_singleline' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_unneeded_control_parentheses' => [
'statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield'],
],
// 'no_unreachable_default_argument_value' => true,
'no_useless_return' => true,
'no_unused_imports' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => ['sort_algorithm' => 'length', 'imports_order' => ['class', 'function', 'const']],
// 'psr_autoloading' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_no_access' => true,
'phpdoc_no_package' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_scalar' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => false,
'phpdoc_to_comment' => false, // override to preserve user preference
'phpdoc_tag_type' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
// 'self_accessor' => true,
'short_scalar_cast' => true,
'simplified_null_return' => false, // disabled as "risky"
'single_blank_line_at_eof' => true,
'blank_lines_before_namespace' => true,
'single_class_element_per_statement' => [
'elements' => ['const', 'property'],
],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'single_line_comment_style' => [
'comment_types' => ['hash'],
],
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'ternary_operator_spaces' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'visibility_required' => [
'elements' => ['method', 'property'],
],
'whitespace_after_comma_in_array' => true,
];

$finder = Finder::create()
->in([
__DIR__.'/src',
__DIR__.'/exemplos',
])
->name('*.php')
->notName('*.blade.php')
->notName('*.js')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new Config())
->setFinder($finder)
->setRules($rules)
->setRiskyAllowed(false)
->setUsingCache(false);
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Ou, coloque em seu arquivo composer.json:

## Doações

**Estamos em busca de *doadores* e *patrocinadores* para ajudar a financiar parte do desenvolvimento deste pacote**
**Estamos em busca de *doadores* e *patrocinadores* para ajudar a financiar parte do desenvolvimento deste pacote**

Este é um projeto totalmente *OpenSource*, para usa-lo, copia-lo e modifica-lo você não paga absolutamente nada. Porém para continuarmos a mante-lo de forma adequada é necessária alguma contribuição seja feita, seja auxiliando na codificação, na documentação, na realização de testes e identificação de falhas e BUGs.

Expand Down
27 changes: 17 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@
}
],
"require": {
"php": ">5.5.0",
"ext-intl": "*",
"ext-mbstring": "*",
"laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"php": ">5.5.0",
"ext-intl": "*",
"ext-mbstring": "*",
"laravel/framework": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"neitanod/forceutf8": "^2.0",
"setasign/fpdf": "^1.8",
"ext-curl": "*",
"ext-json": "*",
"ext-openssl": "*"
"setasign/fpdf": "^1.8",
"ext-curl": "*",
"ext-json": "*",
"ext-openssl": "*",
"eduardokum/laravel-mail-auto-embed": "dev-master",
"chillerlan/php-qrcode": "^3.0|^4.0|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"orchestra/testbench": "^3.0|^4.0|^5.0|^6.0|^7.0|^8.0|^9.0"
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0",
"friendsofphp/php-cs-fixer": "*"
},
"autoload": {
"psr-4": {
Expand All @@ -40,5 +43,9 @@
},
"config": {
"allow-plugins": true
},
"scripts": {
"php-cs-fixer-check": "vendor/bin/php-cs-fixer fix --diff --verbose --dry-run",
"php-cs-fixer": "vendor/bin/php-cs-fixer fix --verbose"
}
}
}
5 changes: 4 additions & 1 deletion exemplos/arquivos/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
!*.ret
*
!.gitignore
!*.ret
!template.blade.php
9 changes: 9 additions & 0 deletions exemplos/arquivos/btg.ret
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
20800000 230306294000145006375766049310430530000100000001100983 EMPRESA CEDENTE BANCO BTG PACTUAL 21506202113034700001410301600
20800001T01 020 2030306294000145006375766049310430530000100000001100983 EMPRESA CEDENTE 15062021
2080001300001T 020000100000001100783 000000000000000002681196/1-1 150620210000000000800002080000100000695800000001285 09052843212000818 EMPRESA SACADO EXEMPLO 00000000000000000000000 0000000000
2080001300002U 020000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000 15062021 000015062021000000000000000 000
2080001300003T 060000100000001100783 000000000000000002681196/1-1 150620210000000000800002080000100000695800000001285 09052843212000818 EMPRESA SACADO EXEMPLO 00000000000000000000000 0000000000
2080001300004U 060000000000000000000000000000000000000000800000000000000000000000000000800000000000000800000000000000000000000000000000 1506202115062021000015062021000000000080000 000
20800015 000001000001000000000080000 000000000000000000000 00000000000000000000000000000000000000000000 00000000
20899999 000001000001000000

4 changes: 4 additions & 0 deletions exemplos/arquivos/santander_pix.ret
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
02RETORNO0000000000000000011110000000009999999000000000000000000000000000000033000000000000000201016000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
10000000000000000000000000000000000000000000000000000000000000000000190000000000000000000000000000000000000002201016 10000000000000000000020101600000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000099000000000000002
25 39a1178e-db6b-4407-bc7b-b674390acf5f id-da-transcao-pix 000003
9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004
10 changes: 10 additions & 0 deletions exemplos/arquivos/template.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
<body>
<img src="{{ $logo }}"/>
<h1>{{ $empresa }}</h1></body>
<p>Olá cliente {{ $boleto['pagador']['nome'] }}</p>
</html>
17 changes: 9 additions & 8 deletions exemplos/autoload.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
if(file_exists(realpath(__DIR__ . '/../../../') . DIRECTORY_SEPARATOR . 'autoload.php')) {
require 'autoload.php';
} elseif (file_exists(realpath(__DIR__ . '/../vendor/') . DIRECTORY_SEPARATOR . 'autoload.php')) {
require realpath(__DIR__ . '/../vendor/') . DIRECTORY_SEPARATOR . 'autoload.php';
} else {
trigger_error('autoload.php não localizado');
}
<?php

if (file_exists(realpath(__DIR__ . '/../../../') . DIRECTORY_SEPARATOR . 'autoload.php')) {
require 'autoload.php';
} elseif (file_exists(realpath(__DIR__ . '/../vendor/') . DIRECTORY_SEPARATOR . 'autoload.php')) {
require realpath(__DIR__ . '/../vendor/') . DIRECTORY_SEPARATOR . 'autoload.php';
} else {
trigger_error('autoload.php não localizado');
}
79 changes: 37 additions & 42 deletions exemplos/bancoob_boleto.php
Original file line number Diff line number Diff line change
@@ -1,49 +1,44 @@
<?php

require 'autoload.php';
$beneficiario = new \VinicciusGuedes\LaravelCnab\Pessoa(
[
'nome' => 'ACME',
'endereco' => 'Rua um, 123',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '99.999.999/9999-99',
]
);
$beneficiario = new VinicciusGuedes\LaravelCnab\Pessoa([
'nome' => 'ACME',
'endereco' => 'Rua um, 123',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '99.999.999/9999-99',
]);

$pagador = new \VinicciusGuedes\LaravelCnab\Pessoa(
[
'nome' => 'Cliente',
'endereco' => 'Rua um, 123',
'bairro' => 'Bairro',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '999.999.999-99',
]
);
$pagador = new VinicciusGuedes\LaravelCnab\Pessoa([
'nome' => 'Cliente',
'endereco' => 'Rua um, 123',
'bairro' => 'Bairro',
'cep' => '99999-999',
'uf' => 'UF',
'cidade' => 'CIDADE',
'documento' => '999.999.999-99',
]);

$boleto = new VinicciusGuedes\LaravelCnab\Boleto\Banco\Bancoob(
[
'logo' => realpath(__DIR__ . '/../logos/') . DIRECTORY_SEPARATOR . '756.png',
'dataVencimento' => new \Carbon\Carbon(),
'valor' => 100,
'multa' => false,
'juros' => false,
'numero' => 1,
'numeroDocumento' => 1,
'pagador' => $pagador,
'beneficiario' => $beneficiario,
'carteira' => 1,
'agencia' => 1111,
'convenio' => 123123,
'conta' => 22222,
'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'],
'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'],
'aceite' => 'S',
'especieDoc' => 'DM',
]
);
$boleto = new VinicciusGuedes\LaravelCnab\Boleto\Banco\Bancoob([
'logo' => realpath(__DIR__ . '/../logos/') . DIRECTORY_SEPARATOR . '756.png',
'dataVencimento' => new Carbon\Carbon(),
'valor' => 100,
'multa' => false,
'juros' => false,
'numero' => 1,
'numeroDocumento' => 1,
'pagador' => $pagador,
'beneficiario' => $beneficiario,
'carteira' => 1,
'agencia' => 1111,
'convenio' => 123123,
'conta' => 22222,
'descricaoDemonstrativo' => ['demonstrativo 1', 'demonstrativo 2', 'demonstrativo 3'],
'instrucoes' => ['instrucao 1', 'instrucao 2', 'instrucao 3'],
'aceite' => 'S',
'especieDoc' => 'DM',
]);

$pdf = new VinicciusGuedes\LaravelCnab\Boleto\Render\Pdf();
$pdf->addBoleto($boleto);
Expand Down
Loading

0 comments on commit 86c4f85

Please sign in to comment.