Skip to content

Commit

Permalink
strict types update III
Browse files Browse the repository at this point in the history
  • Loading branch information
Vítězslav Dvořák committed Sep 13, 2024
1 parent 3cfe611 commit 3d6a62e
Show file tree
Hide file tree
Showing 20 changed files with 5,367 additions and 1,194 deletions.
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,16 @@ DB_PORT=1433
DB_DATABASE=StwPh_12345678_2023
DB_USERNAME=sa
DB_PASSWORD=XXXXX
DB_SETTINGS=encrypt=false

POHODA_DOCS='C:\Program Files (x86)\STORMWARE\POHODA SQL\Dokumenty'
DOWNLOAD_LINK_PREFIX=https://spojenetsro.sharepoint.com/:w:/r/sites/Vvojasystmy/Sdilene%20dokumenty/Banky/

OFFICE365_USERNAME=vitezslav.dvorak@spojenet.cz
OFFICE365_PASSWORD=*************
OFFICE365_CLIENTID=00000000-0000-0000-0000-000000000000
OFFICE365_SECRET=00000000-0000-0000-0000-000000000000
OFFICE365_CLSECRET=00000~00000-000000~0000000000000000.Ucb2
OFFICE365_TENANT=spojenetsro
OFFICE365_SITE=Vvojasystmy
OFFICE365_PATH='Sdilene dokumenty/Banky/'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ output.xml
/debian/multiflexi-pohoda-raiffeisenbank/
/debian/multiflexi-pohoda-raiffeisenbank.debhelper.log
/debian/pohoda-raiffeisenbank.debhelper.log
/.build/
105 changes: 105 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?php

declare(strict_types=1);

/**
* This file is part of the PohodaRaiffeisenbank package
*
* https://github.com/Spoje-NET/pohoda-raiffeisenbank
*
* (c) Spoje.Net IT s.r.o. <https://spojenet.cz>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Ergebnis\PhpCsFixer\Config\Factory;
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet\Php74;

$header = <<<'HEADER'
This file is part of the PohodaRaiffeisenbank package
https://github.com/Spoje-NET/pohoda-raiffeisenbank
(c) Spoje.Net IT s.r.o. <https://spojenet.cz>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
HEADER;

$ruleSet = Php74::create()->withHeader($header)->withRules(Rules::fromArray([
'blank_line_before_statement' => [
'statements' => [
'break',
'continue',
'declare',
'default',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
],
],
'concat_space' => [
'spacing' => 'none',
],
'date_time_immutable' => false,
'error_suppression' => false,
'final_class' => false,
'mb_str_functions' => false,
'native_function_invocation' => [
'exclude' => [
'sprintf',
],
'include' => [
'@compiler_optimized',
],
'scope' => 'all',
'strict' => false,
],
'php_unit_internal_class' => false,
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'php_unit_test_class_requires_covers' => false,
'return_to_yield_from' => false,
'phpdoc_array_type' => false,
'phpdoc_list_type' => false,
'attribute_empty_parentheses' => false,
'final_public_method_for_abstract_class' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'only_if_meta',
'property' => 'only_if_meta',
'trait_import' => 'none',
'case' => 'none',
],
],
'yoda_style' => false,
'php_unit_test_case_static_method_calls' => false,
]));

$config = Factory::fromRuleSet($ruleSet);

$config->getFinder()
->append([
__DIR__.'/.php-cs-fixer.dist.php',
])
->in('src')
->in('tests');

$config->setCacheFile(__DIR__.'/.build/php-cs-fixer/.php-cs-fixer.cache');

return $config;
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# vim: set tabstop=8 softtabstop=8 noexpandtab:
.PHONY: help
help: ## Displays this list of targets with descriptions
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
vendor/bin/phpstan analyse --configuration=phpstan-default.neon.dist --memory-limit=-1

.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: check-symfony vendor ## Generates a baseline for static code analysis with phpstan/phpstan
vendor/bin/phpstan analyze --configuration=phpstan-default.neon.dist --generate-baseline=phpstan-default-baseline.neon --memory-limit=-1

.PHONY: tests
tests: vendor
vendor/bin/phpunit tests

.PHONY: vendor
vendor: composer.json composer.lock ## Installs composer dependencies
composer install

.PHONY: cs
cs: ## Update Coding Standards
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --verbose

# Use phpcs to reformat code to PSR12
codingstandards:
phpcbf --colors --standard=PSR12 --extensions=php --ignore=vendor/ src/

28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,24 @@ Please use the .deb packages. The repository is availble:

Po instalaci balíku jsou v systému k dispozici tyto nové příkazy:

* **abraflexi-raiffeisenbank-setup** - check and/or prepare Bank account setup in AbraFlexi
* **abraflexi-raiffeisenbank-transactions** - Import transactions. From latest imported or within the given scope
* **abraflexi-raiffeisenbank-statements** - Import transactions from Account Statements.
* **abraflexi-raiffeisenbank-xml-statement** - Import transactions from XML Statements file.
* **pohoda-raiffeisenbank-setup** - check and/or prepare Bank account setup in Pohoda
* **pohoda-raiffeisenbank-transactions** - Import transactions. From latest imported or within the given scope
* **pohoda-raiffeisenbank-statements** - Import transactions from Account Statements.
* **pohoda-raiffeisenbank-xml-statement** - Import transactions from XML Statements file.


Setup command
-------------

Check certificate presence yet.

Transactions tool
-----------------

Import Bank movements from RaiffeisenBank (using [getTransactionList](https://developers.rb.cz/premium/documentation/01rbczpremiumapi#/Get%20Transaction%20List/getTransactionList) as source)
to Pohoda using mServer

![Transactions](transactions.png?raw=true)

Configuration
-------------
Expand Down Expand Up @@ -107,6 +121,12 @@ Powered by
* https://github.com/Spoje-NET/PohodaSQL
* https://github.com/VitexSoftware/PHP-Pohoda-Connector

See also
--------

* https://github.com/Spoje-NET/pohoda-client-checker
* https://github.com/Spoje-NET/raiffeisenbank-statement-tools

MultiFlexi
----------

Expand Down
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vitexsoftware/pohoda-raiffeisenbank",
"name": "spojenet/pohoda-raiffeisenbank",
"description": "raiffeisenbank bank statement downloader for Stormware Pohoda",
"license": "MIT",
"authors": [
Expand Down Expand Up @@ -28,6 +28,15 @@
}
},
"require-dev": {
"phpunit/phpunit": "^9"
"phpunit/phpunit": "*",
"phpstan/phpstan": "*",
"friendsofphp/php-cs-fixer": "^3.61",
"ergebnis/composer-normalize": "^2.43",
"ergebnis/php-cs-fixer-config": "^6.34"
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
}
}
}
Loading

0 comments on commit 3d6a62e

Please sign in to comment.