Passed
Push — master ( 1690e8...572929 )
by Aimeos
02:26
created

CustomerAddLaravelTestData::getManager()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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' );
0 ignored issues
show
Bug introduced by
The method setEditor() does not exist on null. ( Ignorable by Annotation )

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

26
		$this->additional->/** @scrutinizer ignore-call */ 
27
                     setEditor( 'ai-laravel:unittest' );

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
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
	 * @return \Aimeos\MShop\Common\Manager\Iface Manager object
37
	 */
38
	protected function getManager()
39
	{
40
		return \Aimeos\MShop\Customer\Manager\Factory::create( $this->additional, 'Laravel' );
0 ignored issues
show
Bug introduced by
It seems like $this->additional can also be of type null; however, parameter $context of Aimeos\MShop\Customer\Manager\Factory::create() does only seem to accept Aimeos\MShop\Context\Item\Iface, maybe add an additional type check? ( Ignorable by Annotation )

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

40
		return \Aimeos\MShop\Customer\Manager\Factory::create( /** @scrutinizer ignore-type */ $this->additional, 'Laravel' );
Loading history...
41
	}
42
}
43