Passed
Push — master ( f602a9...185df8 )
by Aimeos
02:35
created

setup/unittest/CustomerAddLaravelTestData.php (1 issue)

Severity
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
The call to Aimeos\MW\Setup\Task\Cus...dTestData::getManager() has too many arguments starting with $domain. ( Ignorable by Annotation )

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

45
		return parent::/** @scrutinizer ignore-call */ getManager( $domain );

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...
46
	}
47
}
48