Spoje-NET /
php-flexibee
| 1 | #!/usr/bin/php -f |
||
| 2 | <?php |
||
| 3 | /** |
||
| 4 | * FlexiPeeHP - Example |
||
| 5 | * |
||
| 6 | * @author Vítězslav Dvořák <[email protected]> |
||
| 7 | * @copyright (G) 2018 Vitex Software |
||
| 8 | */ |
||
| 9 | |||
| 10 | namespace Example\FlexiPeeHP; |
||
| 11 | |||
| 12 | include_once './config.php'; |
||
| 13 | include_once '../vendor/autoload.php'; |
||
| 14 | |||
| 15 | $adresar = new \FlexiPeeHP\Adresar(['id' => 'EXT:APP:100', 'nazev' => 'FirmaAB', |
||
| 16 | ], ['atomic' => 'false']); //Atomic Transaction: https://www.flexibee.eu/api/dokumentace/ref/tx/ |
||
| 17 | |||
| 18 | $adresar2 = new \FlexiPeeHP\Adresar(['id' => 'EXT:APP:200', 'nazev' => 'FirmaCD'], |
||
| 19 | ['offline' => true]); |
||
| 20 | $adresar3 = new \FlexiPeeHP\Adresar(['id' => 'EXT:APP:300', 'nazev' => 'FirmaEF'], |
||
| 21 | ['offline' => true]); |
||
| 22 | $adresar4 = new \FlexiPeeHP\Adresar(['id' => 'EXT:APP:400', 'nazev' => 'FirmaGH'], |
||
| 23 | ['offline' => true]); |
||
| 24 | |||
| 25 | $banka = new \FlexiPeeHP\Banka(['id' => 'EXT:APP:500', 'typDokl' => 'code:STANDARD', |
||
| 26 | 'banka' => 'code:BANKOVNÍ ÚČET'], ['offline' => true]); |
||
| 27 | |||
| 28 | $adresarBankovniUcet = new \FlexiPeeHP\Adresar(['iban' => 'CZ9501000000001234567899', |
||
| 29 | 'bic' => 'KOMBCZPP', 'firma' => 'EXT:APP:300'], |
||
| 30 | ['evidence' => 'adresar-bankovni-ucet'], ['offline' => true]); |
||
|
0 ignored issues
–
show
|
|||
| 31 | |||
| 32 | $adresar->join($banka); |
||
| 33 | |||
| 34 | $adresarBankovniUcet->join($adresar2); |
||
| 35 | |||
| 36 | $adresar3->join($adresar4); |
||
| 37 | |||
| 38 | $adresarBankovniUcet->join($adresar3); |
||
| 39 | |||
| 40 | $adresar->join($adresarBankovniUcet); |
||
| 41 | |||
| 42 | |||
| 43 | echo "Request Sent to FlexiBee:\n". $adresar->getJsonizedData(null, JSON_PRETTY_PRINT); |
||
| 44 | |||
| 45 | echo "\nFlexiBee Response:\n".var_export($adresar->insertToFlexiBee(), true); |
||
| 46 | |||
| 47 | echo "\nResultIDs was pushed to its source objects:\n". |
||
| 48 | '$banka: '.$banka->getMyKey()."\n". |
||
| 49 | '$adresar: '.$adresar->getMyKey()."\n". |
||
| 50 | '$adresar2: '.$adresar2->getMyKey()."\n". |
||
| 51 | '$adresar3: '.$adresar3->getMyKey()."\n". |
||
| 52 | '$adresar4: '.$adresar4->getMyKey()."\n". |
||
| 53 | '$adresarBankovniUcet: '.$adresarBankovniUcet->getMyKey()."\n"; |
||
| 54 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.