CustomerAddLaravelTestData::after()   A
last analyzed

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-2025
6
 */
7
8
9
namespace Aimeos\Upscheme\Task;
10
11
12
/**
13
 * Adds Laravel customer test data.
14
 */
15
class CustomerAddLaravelTestData extends CustomerAddTestData
16
{
17
	/**
18
	 * Returns the list of task names which this task depends on
19
	 *
20
	 * @return string[] List of task names
21
	 */
22
	public function after() : array
23
	{
24
		return ['Customer', 'Text', 'GroupAddTestData', 'ProductAddTestData'];
25
	}
26
27
28
	/**
29
	 * Adds customer test data
30
	 */
31
	public function up()
32
	{
33
		$this->info( 'Adding Laravel customer test data', 'vv' );
34
35
		$this->db( 'db-customer' )->exec( "DELETE FROM users WHERE email LIKE 'test%@example.com'" );
36
37
		$this->context()->setEditor( 'ai-laravel' );
0 ignored issues
show
Bug introduced by
The method context() does not exist on Aimeos\Upscheme\Task\CustomerAddLaravelTestData. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

37
		$this->/** @scrutinizer ignore-call */ 
38
         context()->setEditor( 'ai-laravel' );
Loading history...
38
		$this->process();
39
	}
40
41
42
	/**
43
	 * Returns the manager for the current setup task
44
	 *
45
	 * @param string $domain Domain name of the manager
46
	 * @param string $name Specific manager implemenation
47
	 * @return \Aimeos\MShop\Common\Manager\Iface Manager object
48
	 */
49
	protected function getManager( string $domain, string $name = 'Standard' ) : \Aimeos\MShop\Common\Manager\Iface
50
	{
51
		if( $domain === 'customer' ) {
52
			return parent::getManager( $domain, 'Laravel' );
53
		}
54
55
		return parent::getManager( $domain );
56
	}
57
}
58