Completed
Push — master ( b5caa9...49ddc1 )
by Aimeos
06:08
created
controller/jobs/src/Controller/Jobs/Admin/Log/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/admin/log/name
36 36
 		 * Class name of the used admin log scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.09
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/admin/log/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/admin/log/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Admin\\Log\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Admin\\Log\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Admin\\Log\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/admin/log/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the admin log controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/admin/log/decorators/excludes
155 155
 		 * @see controller/jobs/admin/log/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'admin/log' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'admin/log');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Admin/Log/Standard.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function getName()
31 31
 	{
32
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Log cleanup' );
32
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Log cleanup');
33 33
 	}
34 34
 
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getDescription()
42 42
 	{
43
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Removes the old log entries from the database and archives them (optional)' );
43
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Removes the old log entries from the database and archives them (optional)');
44 44
 	}
45 45
 
46 46
 
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 		 * @see controller/jobs/admin/log/standard/container/format
72 72
 		 * @see controller/jobs/admin/log/standard/container/options
73 73
 		 */
74
-		$limit = $config->get( 'controller/jobs/admin/log/standard/limit-days', 30 );
75
-		$limitDate = date( 'Y-m-d H:i:s', time() - $limit * 86400 );
74
+		$limit = $config->get('controller/jobs/admin/log/standard/limit-days', 30);
75
+		$limitDate = date('Y-m-d H:i:s', time() - $limit * 86400);
76 76
 
77 77
 		/** controller/jobs/admin/log/standard/path
78 78
 		 * Path to a writable directory where the log archive files should be stored
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		 * @see controller/jobs/admin/log/standard/container/options
102 102
 		 * @see controller/jobs/admin/log/standard/limit-days
103 103
 		 */
104
-		if( ( $path = $config->get( 'controller/jobs/admin/log/standard/path', null ) ) !== null )
104
+		if (($path = $config->get('controller/jobs/admin/log/standard/path', null)) !== null)
105 105
 		{
106 106
 			/** controller/jobs/admin/log/standard/container/type
107 107
 			 * Container file type storing all coupon code files to import
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
 			 * @see controller/jobs/admin/log/standard/limit-days
176 176
 			 */
177 177
 
178
-			$type = $config->get( 'controller/jobs/admin/log/standard/container/type', 'Zip' );
179
-			$format = $config->get( 'controller/jobs/admin/log/standard/container/format', 'CSV' );
180
-			$options = $config->get( 'controller/jobs/admin/log/standard/container/options', array() );
178
+			$type = $config->get('controller/jobs/admin/log/standard/container/type', 'Zip');
179
+			$format = $config->get('controller/jobs/admin/log/standard/container/format', 'CSV');
180
+			$options = $config->get('controller/jobs/admin/log/standard/container/options', array());
181 181
 
182
-			$path .= DIRECTORY_SEPARATOR . str_replace( ' ', '_', $limitDate );
183
-			$container = \Aimeos\MW\Container\Factory::getContainer( $path, $type, $format, $options );
182
+			$path .= DIRECTORY_SEPARATOR . str_replace(' ', '_', $limitDate);
183
+			$container = \Aimeos\MW\Container\Factory::getContainer($path, $type, $format, $options);
184 184
 		}
185 185
 
186
-		$manager = \Aimeos\MAdmin\Factory::createManager( $context, 'log' );
186
+		$manager = \Aimeos\MAdmin\Factory::createManager($context, 'log');
187 187
 
188 188
 		$search = $manager->createSearch();
189
-		$search->setConditions( $search->compare( '<=', 'log.timestamp', $limitDate ) );
190
-		$search->setSortations( array( $search->sort( '+', 'log.timestamp' ) ) );
189
+		$search->setConditions($search->compare('<=', 'log.timestamp', $limitDate));
190
+		$search->setSortations(array($search->sort('+', 'log.timestamp')));
191 191
 
192 192
 		$start = 0;
193 193
 		$contents = array();
@@ -195,37 +195,37 @@  discard block
 block discarded – undo
195 195
 		do
196 196
 		{
197 197
 			$ids = array();
198
-			$items = $manager->searchItems( $search );
198
+			$items = $manager->searchItems($search);
199 199
 
200
-			foreach( $items as $id => $item )
200
+			foreach ($items as $id => $item)
201 201
 			{
202
-				if( $container !== null )
202
+				if ($container !== null)
203 203
 				{
204 204
 					$facility = $item->getFacility();
205 205
 
206
-					if( !isset( $contents[$facility] ) ) {
207
-						$contents[$facility] = $container->create( $facility );
206
+					if (!isset($contents[$facility])) {
207
+						$contents[$facility] = $container->create($facility);
208 208
 					}
209 209
 
210
-					$contents[$facility]->add( $item->toArray() );
210
+					$contents[$facility]->add($item->toArray());
211 211
 				}
212 212
 
213 213
 				$ids[] = $id;
214 214
 			}
215 215
 
216
-			$manager->deleteItems( $ids );
216
+			$manager->deleteItems($ids);
217 217
 
218
-			$count = count( $items );
218
+			$count = count($items);
219 219
 			$start += $count;
220
-			$search->setSlice( $start );
220
+			$search->setSlice($start);
221 221
 		}
222
-		while( $count >= $search->getSliceSize() );
222
+		while ($count >= $search->getSliceSize());
223 223
 
224 224
 
225
-		if( $container !== null && !empty( $contents ) )
225
+		if ($container !== null && !empty($contents))
226 226
 		{
227
-			foreach( $contents as $content ) {
228
-				$container->add( $content );
227
+			foreach ($contents as $content) {
228
+				$container->add($content);
229 229
 			}
230 230
 
231 231
 			$container->close();
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Index/Optimize/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/index/optimize/name
36 36
 		 * Class name of the used catalog index optimize scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.03
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/index/optimize/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/index/optimize/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Index\\Optimize\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Index\\Optimize\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Index\\Optimize\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/index/optimize/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the catalog index optimize controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/index/optimize/decorators/excludes
155 155
 		 * @see controller/jobs/index/optimize/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'index/optimize' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'index/optimize');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Index/Optimize/Standard.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function getName()
31 31
 	{
32
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Catalog index optimization' );
32
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Catalog index optimization');
33 33
 	}
34 34
 
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getDescription()
42 42
 	{
43
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Optimizes the catalog index for searching products' );
43
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Optimizes the catalog index for searching products');
44 44
 	}
45 45
 
46 46
 
@@ -51,6 +51,6 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function run()
53 53
 	{
54
-		\Aimeos\MShop\Index\Manager\Factory::createManager( $this->getContext() )->optimize();
54
+		\Aimeos\MShop\Index\Manager\Factory::createManager($this->getContext())->optimize();
55 55
 	}
56 56
 }
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Index/Rebuild/Factory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param string|null $name Name of the controller or "Standard" if null
31 31
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
32 32
 	 */
33
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
33
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
34 34
 	{
35 35
 		/** controller/jobs/index/rebuild/name
36 36
 		 * Class name of the used catalog index rebuild scheduler controller implementation
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		 * @since 2014.03
66 66
 		 * @category Developer
67 67
 		 */
68
-		if( $name === null ) {
69
-			$name = $context->getConfig()->get( 'controller/jobs/index/rebuild/name', 'Standard' );
68
+		if ($name === null) {
69
+			$name = $context->getConfig()->get('controller/jobs/index/rebuild/name', 'Standard');
70 70
 		}
71 71
 
72
-		if( ctype_alnum( $name ) === false )
72
+		if (ctype_alnum($name) === false)
73 73
 		{
74
-			$classname = is_string( $name ) ? '\\Aimeos\\Controller\\Jobs\\Index\\Rebuild\\' . $name : '<not a string>';
75
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Index\\Rebuild\\' . $name : '<not a string>';
75
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
76 76
 		}
77 77
 
78 78
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
79 79
 		$classname = '\\Aimeos\\Controller\\Jobs\\Index\\Rebuild\\' . $name;
80 80
 
81
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
81
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
82 82
 
83 83
 		/** controller/jobs/index/rebuild/decorators/excludes
84 84
 		 * Excludes decorators added by the "common" option from the catalog index rebuild controllers
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/index/rebuild/decorators/excludes
155 155
 		 * @see controller/jobs/index/rebuild/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'index/rebuild' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'index/rebuild');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Index/Rebuild/Standard.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 */
30 30
 	public function getName()
31 31
 	{
32
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Catalog index rebuild' );
32
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Catalog index rebuild');
33 33
 	}
34 34
 
35 35
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function getDescription()
42 42
 	{
43
-		return $this->getContext()->getI18n()->dt( 'controller/jobs', 'Rebuilds the catalog index for searching products' );
43
+		return $this->getContext()->getI18n()->dt('controller/jobs', 'Rebuilds the catalog index for searching products');
44 44
 	}
45 45
 
46 46
 
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function run()
53 53
 	{
54
-		$timestamp = date( 'Y-m-d H:i:s' );
54
+		$timestamp = date('Y-m-d H:i:s');
55 55
 		$context = clone $this->getContext();
56 56
 
57
-		$context->getLocale()->setLanguageId( null );
58
-		$context->getLocale()->setCurrencyId( null );
57
+		$context->getLocale()->setLanguageId(null);
58
+		$context->getLocale()->setCurrencyId(null);
59 59
 
60
-		$manager = \Aimeos\MShop\Index\Manager\Factory::createManager( $context );
60
+		$manager = \Aimeos\MShop\Index\Manager\Factory::createManager($context);
61 61
 
62 62
 		$manager->rebuildIndex();
63
-		$manager->cleanupIndex( $timestamp );
63
+		$manager->cleanupIndex($timestamp);
64 64
 	}
65 65
 }
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Factory.php 2 patches
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -37,35 +37,35 @@  discard block
 block discarded – undo
37 37
 	 * @param string $path Name of the domain
38 38
 	 * @throws \Aimeos\Controller\Jobs\Exception If the given path is invalid or the controllers wasn't found
39 39
 	 */
40
-	static public function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path )
40
+	static public function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $path)
41 41
 	{
42
-		$path = strtolower( trim( $path, "/ \n\t\r\0\x0B" ) );
42
+		$path = strtolower(trim($path, "/ \n\t\r\0\x0B"));
43 43
 
44
-		if( empty( $path ) ) {
45
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Controller path is empty' ) );
44
+		if (empty($path)) {
45
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Controller path is empty'));
46 46
 		}
47 47
 
48
-		$parts = explode( '/', $path );
48
+		$parts = explode('/', $path);
49 49
 
50
-		foreach( $parts as $key => $part )
50
+		foreach ($parts as $key => $part)
51 51
 		{
52
-			if( ctype_alnum( $part ) === false ) {
53
-				throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid controller "%1$s" in "%2$s"', $part, $path ) );
52
+			if (ctype_alnum($part) === false) {
53
+				throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid controller "%1$s" in "%2$s"', $part, $path));
54 54
 			}
55 55
 
56
-			$parts[$key] = ucwords( $part );
56
+			$parts[$key] = ucwords($part);
57 57
 		}
58 58
 
59
-		$factory = '\\Aimeos\\Controller\\Jobs\\' . join( '\\', $parts ) . '\\Factory';
59
+		$factory = '\\Aimeos\\Controller\\Jobs\\' . join('\\', $parts) . '\\Factory';
60 60
 
61
-		if( class_exists( $factory ) === false ) {
62
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Class "%1$s" not found', $factory ) );
61
+		if (class_exists($factory) === false) {
62
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Class "%1$s" not found', $factory));
63 63
 		}
64 64
 
65
-		$controller = call_user_func_array( array( $factory, 'createController' ), array( $context, $aimeos ) );
65
+		$controller = call_user_func_array(array($factory, 'createController'), array($context, $aimeos));
66 66
 
67
-		if( $controller === false ) {
68
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid factory "%1$s"', $factory ) );
67
+		if ($controller === false) {
68
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid factory "%1$s"', $factory));
69 69
 		}
70 70
 
71 71
 		return $controller;
@@ -81,32 +81,32 @@  discard block
 block discarded – undo
81 81
 	 * 	relative job controller paths (core and extensions)
82 82
 	 * @return array Associative list of controller names as key and the class instance as value
83 83
 	 */
84
-	static public function getControllers( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, array $cntlPaths )
84
+	static public function getControllers(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, array $cntlPaths)
85 85
 	{
86 86
 		$cntlList = array();
87
-		$subFolder = trim( str_replace( '\\', DIRECTORY_SEPARATOR, self::$prefix ), '/' );
87
+		$subFolder = trim(str_replace('\\', DIRECTORY_SEPARATOR, self::$prefix), '/');
88 88
 
89
-		if( strncmp( $subFolder, 'Aimeos' . DIRECTORY_SEPARATOR, 7 ) === 0 ) {
90
-			$subFolder = substr( $subFolder, 7 );
89
+		if (strncmp($subFolder, 'Aimeos' . DIRECTORY_SEPARATOR, 7) === 0) {
90
+			$subFolder = substr($subFolder, 7);
91 91
 		}
92 92
 
93
-		foreach( $cntlPaths as $path => $list )
93
+		foreach ($cntlPaths as $path => $list)
94 94
 		{
95
-			foreach( $list as $relpath )
95
+			foreach ($list as $relpath)
96 96
 			{
97 97
 				$path .= DIRECTORY_SEPARATOR . $relpath . DIRECTORY_SEPARATOR . $subFolder;
98 98
 
99
-				if( is_dir( $path ) )
99
+				if (is_dir($path))
100 100
 				{
101
-					$it = new \DirectoryIterator( $path );
102
-					$list = self::createControllers( $it, $context, $aimeos );
101
+					$it = new \DirectoryIterator($path);
102
+					$list = self::createControllers($it, $context, $aimeos);
103 103
 
104
-					$cntlList = array_merge( $cntlList, $list );
104
+					$cntlList = array_merge($cntlList, $list);
105 105
 				}
106 106
 			}
107 107
 		}
108 108
 
109
-		ksort( $cntlList );
109
+		ksort($cntlList);
110 110
 
111 111
 		return $cntlList;
112 112
 	}
@@ -121,26 +121,26 @@  discard block
 block discarded – undo
121 121
 	 * @param string $prefix Part of the class name between "\Aimeos\Controller\Jobs" and "Factory"
122 122
 	 * @throws \Aimeos\Controller\Jobs\Exception If factory name is invalid or if the controller couldn't be instantiated
123 123
 	 */
124
-	static protected function createControllers( \DirectoryIterator $dir, \Aimeos\MShop\Context\Item\Iface $context,
125
-		\Aimeos\Bootstrap $aimeos, $prefix = '' )
124
+	static protected function createControllers(\DirectoryIterator $dir, \Aimeos\MShop\Context\Item\Iface $context,
125
+		\Aimeos\Bootstrap $aimeos, $prefix = '')
126 126
 	{
127 127
 		$list = array();
128 128
 
129
-		foreach( $dir as $entry )
129
+		foreach ($dir as $entry)
130 130
 		{
131
-			if( $entry->getType() === 'dir' && $entry->isDot() === false )
131
+			if ($entry->getType() === 'dir' && $entry->isDot() === false)
132 132
 			{
133
-				$name = strtolower( $entry->getBaseName() );
134
-				$it = new \DirectoryIterator( $entry->getPathName() );
135
-				$pref = ( $prefix !== '' ? $prefix . '/' : '' ) . $name;
136
-				$subList = self::createControllers( $it, $context, $aimeos, $pref );
133
+				$name = strtolower($entry->getBaseName());
134
+				$it = new \DirectoryIterator($entry->getPathName());
135
+				$pref = ($prefix !== '' ? $prefix . '/' : '') . $name;
136
+				$subList = self::createControllers($it, $context, $aimeos, $pref);
137 137
 
138
-				$list = array_merge( $list, $subList );
138
+				$list = array_merge($list, $subList);
139 139
 			}
140
-			else if( $prefix !== '' && $entry->getType() === 'file'
141
-				&& ( $name = $entry->getBaseName( '.php' ) ) === 'Factory' )
140
+			else if ($prefix !== '' && $entry->getType() === 'file'
141
+				&& ($name = $entry->getBaseName('.php')) === 'Factory')
142 142
 			{
143
-				$list[$prefix] = self::createController( $context, $aimeos, $prefix );
143
+				$list[$prefix] = self::createController($context, $aimeos, $prefix);
144 144
 			}
145 145
 		}
146 146
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@
 block discarded – undo
136 136
 				$subList = self::createControllers( $it, $context, $aimeos, $pref );
137 137
 
138 138
 				$list = array_merge( $list, $subList );
139
-			}
140
-			else if( $prefix !== '' && $entry->getType() === 'file'
139
+			} else if( $prefix !== '' && $entry->getType() === 'file'
141 140
 				&& ( $name = $entry->getBaseName( '.php' ) ) === 'Factory' )
142 141
 			{
143 142
 				$list[$prefix] = self::createController( $context, $aimeos, $prefix );
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Product/Export/Factory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param string|null $name Name of the controller or "Standard" if null
30 30
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
31 31
 	 */
32
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
32
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
33 33
 	{
34 34
 		/** controller/jobs/product/export/name
35 35
 		 * Class name of the used product suggestions scheduler controller implementation
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
 		 * @since 2015.01
65 65
 		 * @category Developer
66 66
 		 */
67
-		if ( $name === null ) {
67
+		if ($name === null) {
68 68
 			$name = $context->getConfig()->get('controller/jobs/product/export/name', 'Standard');
69 69
 		}
70 70
 
71
-		if ( ctype_alnum($name) === false )
71
+		if (ctype_alnum($name) === false)
72 72
 		{
73 73
 			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Product\\Export\\' . $name : '<not a string>';
74
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
75 75
 		}
76 76
 
77 77
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
78 78
 		$classname = '\\Aimeos\\Controller\\Jobs\\Product\\Export\\' . $name;
79 79
 
80
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
80
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
81 81
 
82 82
 		/** controller/jobs/product/export/decorators/excludes
83 83
 		 * Excludes decorators added by the "common" option from the product export job controller
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/product/export/decorators/excludes
155 155
 		 * @see controller/jobs/product/export/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'product/export' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'product/export');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.
controller/jobs/src/Controller/Jobs/Product/Export/Sitemap/Factory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param string|null $name Name of the controller or "Standard" if null
30 30
 	 * @return \Aimeos\Controller\Jobs\Iface New controller object
31 31
 	 */
32
-	public static function createController( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null )
32
+	public static function createController(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\Bootstrap $aimeos, $name = null)
33 33
 	{
34 34
 		/** controller/jobs/product/export/sitemap/name
35 35
 		 * Class name of the used product suggestions scheduler controller implementation
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
 		 * @since 2015.01
65 65
 		 * @category Developer
66 66
 		 */
67
-		if ( $name === null ) {
67
+		if ($name === null) {
68 68
 			$name = $context->getConfig()->get('controller/jobs/product/export/sitemap/name', 'Standard');
69 69
 		}
70 70
 
71
-		if ( ctype_alnum($name) === false )
71
+		if (ctype_alnum($name) === false)
72 72
 		{
73 73
 			$classname = is_string($name) ? '\\Aimeos\\Controller\\Jobs\\Product\\Export\\Sitemap\\' . $name : '<not a string>';
74
-			throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'Invalid characters in class name "%1$s"', $classname ) );
74
+			throw new \Aimeos\Controller\Jobs\Exception(sprintf('Invalid characters in class name "%1$s"', $classname));
75 75
 		}
76 76
 
77 77
 		$iface = '\\Aimeos\\Controller\\Jobs\\Iface';
78 78
 		$classname = '\\Aimeos\\Controller\\Jobs\\Product\\Export\\Sitemap\\' . $name;
79 79
 
80
-		$controller = self::createControllerBase( $context, $aimeos, $classname, $iface );
80
+		$controller = self::createControllerBase($context, $aimeos, $classname, $iface);
81 81
 
82 82
 		/** controller/jobs/product/export/sitemap/decorators/excludes
83 83
 		 * Excludes decorators added by the "common" option from the product export sitemap job controller
@@ -154,6 +154,6 @@  discard block
 block discarded – undo
154 154
 		 * @see controller/jobs/product/export/sitemap/export/sitemap/decorators/excludes
155 155
 		 * @see controller/jobs/product/export/sitemap/export/sitemap/decorators/global
156 156
 		 */
157
-		return self::addControllerDecorators( $context, $aimeos, $controller, 'product/export/sitemap' );
157
+		return self::addControllerDecorators($context, $aimeos, $controller, 'product/export/sitemap');
158 158
 	}
159 159
 }
160 160
\ No newline at end of file
Please login to merge, or discard this patch.