Passed
Push — 2024.04 ( bb183f...4b3bde )
by Aimeos
05:52 queued 03:26
created

CmsAddTypeTestData::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 14
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, https://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2024
6
 */
7
8
9
namespace Aimeos\Upscheme\Task;
10
11
12
/**
13
 * Adds CMS records to tables.
14
 */
15
class CmsAddTypeTestData extends MShopAddTypeData
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 ['Cms', 'MShopSetLocale', 'MShopAddTypeData'];
25
	}
26
27
28
	/**
29
	 * Executes the task for adding CMS records to tables.
30
	 */
31
	public function up()
32
	{
33
		$ds = DIRECTORY_SEPARATOR;
34
		$context = $this->context();
0 ignored issues
show
Bug introduced by
The method context() does not exist on Aimeos\Upscheme\Task\CmsAddTypeTestData. 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

34
		/** @scrutinizer ignore-call */ 
35
  $context = $this->context();
Loading history...
35
		$editor = $context->editor();
36
		$sitecode = $this->context()->locale()->getSiteItem()->getCode();
37
38
		$this->info( sprintf( 'Adding CMS type data for site "%1$s"', $sitecode ), 'vv' );
39
40
		$context->setEditor( 'ai-cms-grapesjs' );
41
42
		$this->add( __DIR__ . $ds . 'data' . $ds .  'type.php' );
43
44
		$context->setEditor( $editor );
45
	}
46
}
47