Issues (103)

Examples/ObjectChaining.php (2 issues)

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
The call to FlexiPeeHP\Adresar::__construct() has too many arguments starting with array('offline' => true). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
$adresarBankovniUcet = /** @scrutinizer ignore-call */ new \FlexiPeeHP\Adresar(['iban' => 'CZ9501000000001234567899',

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.

Loading history...
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);
0 ignored issues
show
Deprecated Code introduced by
The function FlexiPeeHP\RW::insertToFlexiBee() has been deprecated: since version 2.0 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

45
echo "\nFlexiBee Response:\n".var_export(/** @scrutinizer ignore-deprecated */ $adresar->insertToFlexiBee(), true);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
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