1 | <?php |
||
2 | |||
3 | /** |
||
4 | * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
||
5 | * @copyright Aimeos (aimeos.org), 2014-2018 |
||
6 | */ |
||
7 | |||
8 | |||
9 | namespace Aimeos\MW\Setup\Task; |
||
10 | |||
11 | |||
12 | /** |
||
13 | * Adds Laravel customer test data. |
||
14 | */ |
||
15 | class CustomerAddLaravelTestData extends \Aimeos\MW\Setup\Task\CustomerAddTestData |
||
16 | { |
||
17 | /** |
||
18 | * Adds customer test data |
||
19 | */ |
||
20 | public function migrate() |
||
21 | { |
||
22 | \Aimeos\MW\Common\Base::checkClass( \Aimeos\MShop\Context\Item\Iface::class, $this->additional ); |
||
23 | |||
24 | $this->msg( 'Adding Laravel customer test data', 0 ); |
||
25 | |||
26 | $this->additional->setEditor( 'ai-laravel:unittest' ); |
||
27 | $this->process( __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'customer.php' ); |
||
28 | |||
29 | $this->status( 'done' ); |
||
30 | } |
||
31 | |||
32 | |||
33 | /** |
||
34 | * Returns the manager for the current setup task |
||
35 | * |
||
36 | * @param string $domain Domain name of the manager |
||
37 | * @return \Aimeos\MShop\Common\Manager\Iface Manager object |
||
38 | */ |
||
39 | protected function getManager( $domain ) |
||
40 | { |
||
41 | if( $domain === 'customer' ) { |
||
42 | return \Aimeos\MShop\Customer\Manager\Factory::create( $this->additional, 'Laravel' ); |
||
43 | } |
||
44 | |||
45 | return parent::getManager( $domain ); |
||
0 ignored issues
–
show
|
|||
46 | } |
||
47 | } |
||
48 |
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.