Completed
Push — master ( f4612d...b74f5e )
by Aimeos
02:41
created
admin/jsonadm/tests/TestHelperJadm.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
 	public static function bootstrap()
16 16
 	{
17 17
 		self::getAimeos();
18
-		\Aimeos\MShop\Factory::setCache( false );
19
-		\Aimeos\Admin\JsonAdm\Factory::setCache( false );
18
+		\Aimeos\MShop\Factory::setCache(false);
19
+		\Aimeos\Admin\JsonAdm\Factory::setCache(false);
20 20
 	}
21 21
 
22 22
 
23
-	public static function getContext( $site = 'unittest' )
23
+	public static function getContext($site = 'unittest')
24 24
 	{
25
-		if( !isset( self::$context[$site] ) ) {
26
-			self::$context[$site] = self::createContext( $site );
25
+		if (!isset(self::$context[$site])) {
26
+			self::$context[$site] = self::createContext($site);
27 27
 		}
28 28
 
29 29
 		return clone self::$context[$site];
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
 
33 33
 	public static function getAimeos()
34 34
 	{
35
-		if( !isset( self::$aimeos ) )
35
+		if (!isset(self::$aimeos))
36 36
 		{
37 37
 			require_once 'Bootstrap.php';
38
-			spl_autoload_register( 'Aimeos\\Bootstrap::autoload' );
38
+			spl_autoload_register('Aimeos\\Bootstrap::autoload');
39 39
 
40
-			$extdir = dirname( dirname( dirname( dirname( __FILE__ ) ) ) );
41
-			self::$aimeos = new \Aimeos\Bootstrap( array( $extdir ), false );
40
+			$extdir = dirname(dirname(dirname(dirname(__FILE__))));
41
+			self::$aimeos = new \Aimeos\Bootstrap(array($extdir), false);
42 42
 		}
43 43
 
44 44
 		return self::$aimeos;
@@ -47,79 +47,79 @@  discard block
 block discarded – undo
47 47
 
48 48
 	public static function getJsonadmPaths()
49 49
 	{
50
-		return self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' );
50
+		return self::getAimeos()->getCustomPaths('admin/jsonadm/templates');
51 51
 	}
52 52
 
53 53
 
54
-	private static function createContext( $site )
54
+	private static function createContext($site)
55 55
 	{
56 56
 		$ctx = new \Aimeos\MShop\Context\Item\Standard();
57 57
 		$aimeos = self::getAimeos();
58 58
 
59 59
 
60
-		$paths = $aimeos->getConfigPaths( 'mysql' );
60
+		$paths = $aimeos->getConfigPaths('mysql');
61 61
 		$paths[] = __DIR__ . DIRECTORY_SEPARATOR . 'config';
62 62
 		$file = __DIR__ . DIRECTORY_SEPARATOR . 'confdoc.ser';
63 63
 
64
-		$conf = new \Aimeos\MW\Config\PHPArray( array(), $paths );
65
-		$conf = new \Aimeos\MW\Config\Decorator\Memory( $conf );
66
-		$conf = new \Aimeos\MW\Config\Decorator\Documentor( $conf, $file );
67
-		$ctx->setConfig( $conf );
64
+		$conf = new \Aimeos\MW\Config\PHPArray(array(), $paths);
65
+		$conf = new \Aimeos\MW\Config\Decorator\Memory($conf);
66
+		$conf = new \Aimeos\MW\Config\Decorator\Documentor($conf, $file);
67
+		$ctx->setConfig($conf);
68 68
 
69 69
 
70
-		$dbm = new \Aimeos\MW\DB\Manager\PDO( $conf );
71
-		$ctx->setDatabaseManager( $dbm );
70
+		$dbm = new \Aimeos\MW\DB\Manager\PDO($conf);
71
+		$ctx->setDatabaseManager($dbm);
72 72
 
73 73
 
74
-		$logger = new \Aimeos\MW\Logger\File( $site . '.log', \Aimeos\MW\Logger\Base::DEBUG );
75
-		$ctx->setLogger( $logger );
74
+		$logger = new \Aimeos\MW\Logger\File($site . '.log', \Aimeos\MW\Logger\Base::DEBUG);
75
+		$ctx->setLogger($logger);
76 76
 
77 77
 
78 78
 		$session = new \Aimeos\MW\Session\None();
79
-		$ctx->setSession( $session );
79
+		$ctx->setSession($session);
80 80
 
81 81
 
82
-		$i18n = new \Aimeos\MW\Translation\None( 'de' );
83
-		$ctx->setI18n( array( 'de' => $i18n ) );
82
+		$i18n = new \Aimeos\MW\Translation\None('de');
83
+		$ctx->setI18n(array('de' => $i18n));
84 84
 
85 85
 
86
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $ctx );
87
-		$locale = $localeManager->bootstrap( $site, 'de', '', false );
88
-		$ctx->setLocale( $locale );
86
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($ctx);
87
+		$locale = $localeManager->bootstrap($site, 'de', '', false);
88
+		$ctx->setLocale($locale);
89 89
 
90 90
 
91
-		$view = self::createView( $conf );
92
-		$ctx->setView( $view );
91
+		$view = self::createView($conf);
92
+		$ctx->setView($view);
93 93
 
94 94
 
95
-		$ctx->setEditor( 'core:admin/jsonadm' );
95
+		$ctx->setEditor('core:admin/jsonadm');
96 96
 
97 97
 		return $ctx;
98 98
 	}
99 99
 
100 100
 
101
-	protected static function createView( \Aimeos\MW\Config\Iface $config )
101
+	protected static function createView(\Aimeos\MW\Config\Iface $config)
102 102
 	{
103
-		$tmplpaths = self::getAimeos()->getCustomPaths( 'admin/jsonadm/templates' );
103
+		$tmplpaths = self::getAimeos()->getCustomPaths('admin/jsonadm/templates');
104 104
 
105
-		$view = new \Aimeos\MW\View\Standard( $tmplpaths );
105
+		$view = new \Aimeos\MW\View\Standard($tmplpaths);
106 106
 
107
-		$trans = new \Aimeos\MW\Translation\None( 'de_DE' );
108
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $trans );
109
-		$view->addHelper( 'translate', $helper );
107
+		$trans = new \Aimeos\MW\Translation\None('de_DE');
108
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $trans);
109
+		$view->addHelper('translate', $helper);
110 110
 
111
-		$helper = new \Aimeos\MW\View\Helper\Url\Standard( $view, 'http://baseurl' );
112
-		$view->addHelper( 'url', $helper );
111
+		$helper = new \Aimeos\MW\View\Helper\Url\Standard($view, 'http://baseurl');
112
+		$view->addHelper('url', $helper);
113 113
 
114
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, '.', '' );
115
-		$view->addHelper( 'number', $helper );
114
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, '.', '');
115
+		$view->addHelper('number', $helper);
116 116
 
117
-		$helper = new \Aimeos\MW\View\Helper\Date\Standard( $view, 'Y-m-d' );
118
-		$view->addHelper( 'date', $helper );
117
+		$helper = new \Aimeos\MW\View\Helper\Date\Standard($view, 'Y-m-d');
118
+		$view->addHelper('date', $helper);
119 119
 
120
-		$config = new \Aimeos\MW\Config\Decorator\Protect( $config, array( 'admin/jsonadm' ) );
121
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
122
-		$view->addHelper( 'config', $helper );
120
+		$config = new \Aimeos\MW\Config\Decorator\Protect($config, array('admin/jsonadm'));
121
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
122
+		$view->addHelper('config', $helper);
123 123
 
124 124
 		return $view;
125 125
 	}
Please login to merge, or discard this patch.
admin/jsonadm/tests/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,15 +7,15 @@
 block discarded – undo
7 7
 
8 8
 
9 9
 error_reporting( -1 );
10
-ini_set( 'display_errors', '1' );
10
+ini_set('display_errors', '1');
11 11
 
12
-date_default_timezone_set( 'UTC' );
12
+date_default_timezone_set('UTC');
13 13
 
14 14
 // Set locale settings to reasonable defaults
15
-setlocale( LC_ALL, 'en_US.UTF-8' );
16
-setlocale( LC_NUMERIC, 'POSIX' );
17
-setlocale( LC_CTYPE, 'en_US.UTF-8' );
18
-setlocale( LC_TIME, 'POSIX' );
15
+setlocale(LC_ALL, 'en_US.UTF-8');
16
+setlocale(LC_NUMERIC, 'POSIX');
17
+setlocale(LC_CTYPE, 'en_US.UTF-8');
18
+setlocale(LC_TIME, 'POSIX');
19 19
 
20 20
 require_once 'TestHelperJadm.php';
21 21
 \TestHelperJadm::bootstrap();
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Product/Standard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -107,20 +107,20 @@  discard block
 block discarded – undo
107 107
 	 * @param array $include List of resource types that should be fetched
108 108
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
109 109
 	 */
110
-	protected function getChildItems( array $items, array $include )
110
+	protected function getChildItems(array $items, array $include)
111 111
 	{
112 112
 		$list = array();
113
-		$prodIds = array_keys( $items );
114
-		$include = array_intersect( $include, array( 'product/property', 'product/stock' ) );
113
+		$prodIds = array_keys($items);
114
+		$include = array_intersect($include, array('product/property', 'product/stock'));
115 115
 
116
-		foreach( $include as $type )
116
+		foreach ($include as $type)
117 117
 		{
118
-			$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type );
118
+			$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type);
119 119
 
120 120
 			$search = $manager->createSearch();
121
-			$search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $prodIds ) );
121
+			$search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $prodIds));
122 122
 
123
-			$list = array_merge( $list, $manager->searchItems( $search ) );
123
+			$list = array_merge($list, $manager->searchItems($search));
124 124
 		}
125 125
 
126 126
 		return $list;
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 	 * @param array $include List of resource types that should be fetched
135 135
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface
136 136
 	 */
137
-	protected function getListItems( array $items, array $include )
137
+	protected function getListItems(array $items, array $include)
138 138
 	{
139
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'product/lists' );
139
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'product/lists');
140 140
 
141 141
 		$search = $manager->createSearch();
142 142
 		$expr = array(
143
-			$search->compare( '==', 'product.lists.parentid', array_keys( $items ) ),
144
-			$search->compare( '==', 'product.lists.domain', $include ),
143
+			$search->compare('==', 'product.lists.parentid', array_keys($items)),
144
+			$search->compare('==', 'product.lists.domain', $include),
145 145
 		);
146
-		$search->setConditions( $search->combine( '&&', $expr ) );
146
+		$search->setConditions($search->combine('&&', $expr));
147 147
 
148
-		return $manager->searchItems( $search );
148
+		return $manager->searchItems($search);
149 149
 	}
150 150
 }
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Iface.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @param integer &$status Variable which contains the HTTP status afterwards
28 28
 	 * @return string Content for response body
29 29
 	 */
30
-	public function delete( $body, array &$header, &$status );
30
+	public function delete($body, array &$header, &$status);
31 31
 
32 32
 
33 33
 	/**
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 * @param integer &$status Variable which contains the HTTP status afterwards
39 39
 	 * @return string Content for response body
40 40
 	 */
41
-	public function get( $body, array &$header, &$status );
41
+	public function get($body, array &$header, &$status);
42 42
 
43 43
 
44 44
 	/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @param integer &$status Variable which contains the HTTP status afterwards
50 50
 	 * @return string Content for response body
51 51
 	 */
52
-	public function patch( $body, array &$header, &$status );
52
+	public function patch($body, array &$header, &$status);
53 53
 
54 54
 
55 55
 	/**
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @param integer &$status Variable which contains the HTTP status afterwards
61 61
 	 * @return string Content for response body
62 62
 	 */
63
-	public function post( $body, array &$header, &$status );
63
+	public function post($body, array &$header, &$status);
64 64
 
65 65
 
66 66
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 * @param integer &$status Variable which contains the HTTP status afterwards
72 72
 	 * @return string Content for response body
73 73
 	 */
74
-	public function put( $body, array &$header, &$status );
74
+	public function put($body, array &$header, &$status);
75 75
 
76 76
 
77 77
 	/**
@@ -82,5 +82,5 @@  discard block
 block discarded – undo
82 82
 	 * @param integer &$status Variable which contains the HTTP status afterwards
83 83
 	 * @return string Content for response body
84 84
 	 */
85
-	public function options( $body, array &$header, &$status );
85
+	public function options($body, array &$header, &$status);
86 86
 }
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Coupon/Standard.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -107,20 +107,20 @@
 block discarded – undo
107 107
 	 * @param array $include List of resource types that should be fetched
108 108
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
109 109
 	 */
110
-	protected function getChildItems( array $items, array $include )
110
+	protected function getChildItems(array $items, array $include)
111 111
 	{
112 112
 		$list = array();
113
-		$ids = array_keys( $items );
114
-		$include = array_intersect( $include, array( 'coupon/code' ) );
113
+		$ids = array_keys($items);
114
+		$include = array_intersect($include, array('coupon/code'));
115 115
 
116
-		foreach( $include as $type )
116
+		foreach ($include as $type)
117 117
 		{
118
-			$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type );
118
+			$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type);
119 119
 
120 120
 			$search = $manager->createSearch();
121
-			$search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $ids ) );
121
+			$search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $ids));
122 122
 
123
-			$list = array_merge( $list, $manager->searchItems( $search ) );
123
+			$list = array_merge($list, $manager->searchItems($search));
124 124
 		}
125 125
 
126 126
 		return $list;
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Customer/Standard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -107,20 +107,20 @@  discard block
 block discarded – undo
107 107
 	 * @param array $include List of resource types that should be fetched
108 108
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
109 109
 	 */
110
-	protected function getChildItems( array $items, array $include )
110
+	protected function getChildItems(array $items, array $include)
111 111
 	{
112 112
 		$list = array();
113
-		$refIds = array_keys( $items );
114
-		$include = array_intersect( $include, array( 'customer/address' ) );
113
+		$refIds = array_keys($items);
114
+		$include = array_intersect($include, array('customer/address'));
115 115
 
116
-		foreach( $include as $type )
116
+		foreach ($include as $type)
117 117
 		{
118
-			$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type );
118
+			$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type);
119 119
 
120 120
 			$search = $manager->createSearch();
121
-			$search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $refIds ) );
121
+			$search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $refIds));
122 122
 
123
-			$list = array_merge( $list, $manager->searchItems( $search ) );
123
+			$list = array_merge($list, $manager->searchItems($search));
124 124
 		}
125 125
 
126 126
 		return $list;
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 	 * @param array $include List of resource types that should be fetched
135 135
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface
136 136
 	 */
137
-	protected function getListItems( array $items, array $include )
137
+	protected function getListItems(array $items, array $include)
138 138
 	{
139
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
139
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
140 140
 
141 141
 		$search = $manager->createSearch();
142 142
 		$expr = array(
143
-			$search->compare( '==', 'customer.lists.parentid', array_keys( $items ) ),
144
-			$search->compare( '==', 'customer.lists.domain', $include ),
143
+			$search->compare('==', 'customer.lists.parentid', array_keys($items)),
144
+			$search->compare('==', 'customer.lists.domain', $include),
145 145
 		);
146
-		$search->setConditions( $search->combine( '&&', $expr ) );
146
+		$search->setConditions($search->combine('&&', $expr));
147 147
 
148
-		return $manager->searchItems( $search );
148
+		return $manager->searchItems($search);
149 149
 	}
150 150
 }
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Supplier/Standard.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -107,20 +107,20 @@  discard block
 block discarded – undo
107 107
 	 * @param array $include List of resource types that should be fetched
108 108
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Iface
109 109
 	 */
110
-	protected function getChildItems( array $items, array $include )
110
+	protected function getChildItems(array $items, array $include)
111 111
 	{
112 112
 		$list = array();
113
-		$refIds = array_keys( $items );
114
-		$include = array_intersect( $include, array( 'supplier/address' ) );
113
+		$refIds = array_keys($items);
114
+		$include = array_intersect($include, array('supplier/address'));
115 115
 
116
-		foreach( $include as $type )
116
+		foreach ($include as $type)
117 117
 		{
118
-			$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), $type );
118
+			$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), $type);
119 119
 
120 120
 			$search = $manager->createSearch();
121
-			$search->setConditions( $search->compare( '==', str_replace( '/', '.', $type ) . '.parentid', $refIds ) );
121
+			$search->setConditions($search->compare('==', str_replace('/', '.', $type) . '.parentid', $refIds));
122 122
 
123
-			$list = array_merge( $list, $manager->searchItems( $search ) );
123
+			$list = array_merge($list, $manager->searchItems($search));
124 124
 		}
125 125
 
126 126
 		return $list;
@@ -134,17 +134,17 @@  discard block
 block discarded – undo
134 134
 	 * @param array $include List of resource types that should be fetched
135 135
 	 * @return array List of items implementing \Aimeos\MShop\Common\Item\Lists\Iface
136 136
 	 */
137
-	protected function getListItems( array $items, array $include )
137
+	protected function getListItems(array $items, array $include)
138 138
 	{
139
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'supplier/lists' );
139
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'supplier/lists');
140 140
 
141 141
 		$search = $manager->createSearch();
142 142
 		$expr = array(
143
-			$search->compare( '==', 'supplier.lists.parentid', array_keys( $items ) ),
144
-			$search->compare( '==', 'supplier.lists.domain', $include ),
143
+			$search->compare('==', 'supplier.lists.parentid', array_keys($items)),
144
+			$search->compare('==', 'supplier.lists.domain', $include),
145 145
 		);
146
-		$search->setConditions( $search->combine( '&&', $expr ) );
146
+		$search->setConditions($search->combine('&&', $expr));
147 147
 
148
-		return $manager->searchItems( $search );
148
+		return $manager->searchItems($search);
149 149
 	}
150 150
 }
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Common/Iface.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,6 +29,6 @@
 block discarded – undo
29 29
 	 * @param string $path Name of the client separated by slashes, e.g "product/stock"
30 30
 	 * @return void
31 31
 	 */
32
-	public function __construct( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view,
33
-		array $templatePaths, $path );
32
+	public function __construct(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MW\View\Iface $view,
33
+		array $templatePaths, $path);
34 34
 }
Please login to merge, or discard this patch.
admin/jsonadm/src/Admin/JsonAdm/Common/Factory/Iface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,5 +28,5 @@
 block discarded – undo
28 28
 	 * @param string|null $name Name of the client implementation ("Standard" if null)
29 29
 	 * @return Aimeos\Admin\JsonAdm\Iface Client Interface
30 30
 	 */
31
-	public static function createClient( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $path, $name = null );
31
+	public static function createClient(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $path, $name = null);
32 32
 }
33 33
\ No newline at end of file
Please login to merge, or discard this patch.