Completed
Push — master ( 275acc...26f065 )
by Aimeos
19:24 queued 16:52
created
src/Aimeos/Shop/Base/View.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -32,55 +32,55 @@  discard block
 block discarded – undo
32 32
 	 * @param string|null $locale Code of the current language or null for no translation
33 33
 	 * @return \Aimeos\MW\View\Iface View object
34 34
 	 */
35
-	public function create( \Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null )
35
+	public function create(\Aimeos\MShop\Context\Item\Iface $context, array $templatePaths, $locale = null)
36 36
 	{
37 37
 		$params = $fixed = array();
38 38
 
39
-		if( $locale !== null )
39
+		if ($locale !== null)
40 40
 		{
41 41
 			$params = Route::current()->parameters() + Input::all();
42 42
 			$fixed = $this->getFixedParams();
43 43
 
44
-			$i18n = app('\Aimeos\Shop\Base\I18n')->get( array( $locale ) );
44
+			$i18n = app('\Aimeos\Shop\Base\I18n')->get(array($locale));
45 45
 			$translation = $i18n[$locale];
46 46
 		}
47 47
 		else
48 48
 		{
49
-			$translation = new \Aimeos\MW\Translation\None( 'en' );
49
+			$translation = new \Aimeos\MW\Translation\None('en');
50 50
 		}
51 51
 
52 52
 
53
-		$view = new \Aimeos\MW\View\Standard( $templatePaths );
53
+		$view = new \Aimeos\MW\View\Standard($templatePaths);
54 54
 
55
-		$helper = new \Aimeos\MW\View\Helper\Translate\Standard( $view, $translation );
56
-		$view->addHelper( 'translate', $helper );
55
+		$helper = new \Aimeos\MW\View\Helper\Translate\Standard($view, $translation);
56
+		$view->addHelper('translate', $helper);
57 57
 
58
-		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5( $view, app('url'), $fixed );
59
-		$view->addHelper( 'url', $helper );
58
+		$helper = new \Aimeos\MW\View\Helper\Url\Laravel5($view, app('url'), $fixed);
59
+		$view->addHelper('url', $helper);
60 60
 
61
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $view, $params );
62
-		$view->addHelper( 'param', $helper );
61
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($view, $params);
62
+		$view->addHelper('param', $helper);
63 63
 
64
-		$config = new \Aimeos\MW\Config\Decorator\Protect( clone $context->getConfig(), array( 'admin', 'client' ) );
65
-		$helper = new \Aimeos\MW\View\Helper\Config\Standard( $view, $config );
66
-		$view->addHelper( 'config', $helper );
64
+		$config = new \Aimeos\MW\Config\Decorator\Protect(clone $context->getConfig(), array('admin', 'client'));
65
+		$helper = new \Aimeos\MW\View\Helper\Config\Standard($view, $config);
66
+		$view->addHelper('config', $helper);
67 67
 
68
-		$sepDec = $config->get( 'client/html/common/format/seperatorDecimal', '.' );
69
-		$sep1000 = $config->get( 'client/html/common/format/seperator1000', ' ' );
70
-		$helper = new \Aimeos\MW\View\Helper\Number\Standard( $view, $sepDec, $sep1000 );
71
-		$view->addHelper( 'number', $helper );
68
+		$sepDec = $config->get('client/html/common/format/seperatorDecimal', '.');
69
+		$sep1000 = $config->get('client/html/common/format/seperator1000', ' ');
70
+		$helper = new \Aimeos\MW\View\Helper\Number\Standard($view, $sepDec, $sep1000);
71
+		$view->addHelper('number', $helper);
72 72
 
73
-		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5( $view, Request::instance() );
74
-		$view->addHelper( 'request', $helper );
73
+		$helper = new \Aimeos\MW\View\Helper\Request\Laravel5($view, Request::instance());
74
+		$view->addHelper('request', $helper);
75 75
 
76
-		$helper = new \Aimeos\MW\View\Helper\Response\Laravel5( $view );
77
-		$view->addHelper( 'response', $helper );
76
+		$helper = new \Aimeos\MW\View\Helper\Response\Laravel5($view);
77
+		$view->addHelper('response', $helper);
78 78
 
79
-		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard( $view, '_token', csrf_token() );
80
-		$view->addHelper( 'csrf', $helper );
79
+		$helper = new \Aimeos\MW\View\Helper\Csrf\Standard($view, '_token', csrf_token());
80
+		$view->addHelper('csrf', $helper);
81 81
 
82
-		$helper = new \Aimeos\MW\View\Helper\Access\Standard( $view, $this->getGroups( $context ) );
83
-		$view->addHelper( 'access', $helper );
82
+		$helper = new \Aimeos\MW\View\Helper\Access\Standard($view, $this->getGroups($context));
83
+		$view->addHelper('access', $helper);
84 84
 
85 85
 		return $view;
86 86
 	}
@@ -92,17 +92,17 @@  discard block
 block discarded – undo
92 92
 	 * @param \Aimeos\MShop\Context\Item\Iface $context Context object
93 93
 	 * @return \Closure Function which returns the user group codes
94 94
 	 */
95
-	protected function getGroups( \Aimeos\MShop\Context\Item\Iface $context )
95
+	protected function getGroups(\Aimeos\MShop\Context\Item\Iface $context)
96 96
 	{
97
-		return function() use ( $context )
97
+		return function() use ($context)
98 98
 		{
99 99
 			$list = array();
100
-			$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/group' );
100
+			$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/group');
101 101
 
102 102
 			$search = $manager->createSearch();
103
-			$search->setConditions( $search->compare( '==', 'customer.group.id', $context->getGroupIds() ) );
103
+			$search->setConditions($search->compare('==', 'customer.group.id', $context->getGroupIds()));
104 104
 
105
-			foreach( $manager->searchItems( $search ) as $item ) {
105
+			foreach ($manager->searchItems($search) as $item) {
106 106
 				$list[] = $item->getCode();
107 107
 			}
108 108
 
@@ -120,15 +120,15 @@  discard block
 block discarded – undo
120 120
 	{
121 121
 		$fixed = array();
122 122
 
123
-		if( ( $value = Route::input( 'site' ) ) !== null ) {
123
+		if (($value = Route::input('site')) !== null) {
124 124
 			$fixed['site'] = $value;
125 125
 		}
126 126
 
127
-		if( ( $value = Route::input( 'locale' ) ) !== null ) {
127
+		if (($value = Route::input('locale')) !== null) {
128 128
 			$fixed['locale'] = $value;
129 129
 		}
130 130
 
131
-		if( ( $value = Route::input( 'currency' ) ) !== null ) {
131
+		if (($value = Route::input('currency')) !== null) {
132 132
 			$fixed['currency'] = $value;
133 133
 		}
134 134
 
Please login to merge, or discard this patch.
src/Aimeos/Shop/Command/AccountCommand.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -43,25 +43,25 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function fire()
45 45
 	{
46
-		$code = $this->argument( 'email' );
47
-		if( ( $password = $this->option( 'password' ) ) === null ) {
48
-			$password = $this->secret( 'Password' );
46
+		$code = $this->argument('email');
47
+		if (($password = $this->option('password')) === null) {
48
+			$password = $this->secret('Password');
49 49
 		}
50 50
 
51
-		$context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false );
52
-		$context->setEditor( 'aimeos:account' );
51
+		$context = $this->getLaravel()->make('Aimeos\Shop\Base\Context')->get(false);
52
+		$context->setEditor('aimeos:account');
53 53
 
54
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
55
-		$context->setLocale( $localeManager->createItem() );
54
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
55
+		$context->setLocale($localeManager->createItem());
56 56
 
57
-		$user = $this->createCustomerItem( $context, $code, $password );
57
+		$user = $this->createCustomerItem($context, $code, $password);
58 58
 
59
-		if( $this->option( 'admin' ) ) {
60
-			$this->addGroup( $context, $user, 'admin' );
59
+		if ($this->option('admin')) {
60
+			$this->addGroup($context, $user, 'admin');
61 61
 		}
62 62
 
63
-		if( $this->option( 'editor' ) ) {
64
-			$this->addGroup( $context, $user, 'editor' );
63
+		if ($this->option('editor')) {
64
+			$this->addGroup($context, $user, 'editor');
65 65
 		}
66 66
 	}
67 67
 
@@ -73,31 +73,31 @@  discard block
 block discarded – undo
73 73
 	 * @param string $userid Unique user ID
74 74
 	 * @param string $groupid Unique group ID
75 75
 	 */
76
-	protected function addListItem( \Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid )
76
+	protected function addListItem(\Aimeos\MShop\Context\Item\Iface $context, $userid, $groupid)
77 77
 	{
78
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'lists' );
79
-		$typeid = $manager->getSubmanager( 'type' )->findItem( 'default', array(), 'customer/group' )->getId();
78
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('lists');
79
+		$typeid = $manager->getSubmanager('type')->findItem('default', array(), 'customer/group')->getId();
80 80
 
81 81
 		$search = $manager->createSearch();
82 82
 		$expr = array(
83
-			$search->compare( '==', 'customer.lists.parentid', $userid ),
84
-			$search->compare( '==', 'customer.lists.refid', $groupid ),
85
-			$search->compare( '==', 'customer.lists.domain', 'customer/group' ),
86
-			$search->compare( '==', 'customer.lists.typeid', $typeid ),
83
+			$search->compare('==', 'customer.lists.parentid', $userid),
84
+			$search->compare('==', 'customer.lists.refid', $groupid),
85
+			$search->compare('==', 'customer.lists.domain', 'customer/group'),
86
+			$search->compare('==', 'customer.lists.typeid', $typeid),
87 87
 		);
88
-		$search->setConditions( $search->combine( '&&', $expr ) );
89
-		$search->setSlice( 0, 1 );
88
+		$search->setConditions($search->combine('&&', $expr));
89
+		$search->setSlice(0, 1);
90 90
 
91
-		if( count( $manager->searchItems( $search ) ) === 0 )
91
+		if (count($manager->searchItems($search)) === 0)
92 92
 		{
93 93
 			$item = $manager->createItem();
94
-			$item->setDomain( 'customer/group' );
95
-			$item->setParentId( $userid );
96
-			$item->setTypeId( $typeid );
97
-			$item->setRefId( $groupid );
98
-			$item->setStatus( 1 );
94
+			$item->setDomain('customer/group');
95
+			$item->setParentId($userid);
96
+			$item->setTypeId($typeid);
97
+			$item->setRefId($groupid);
98
+			$item->setStatus(1);
99 99
 
100
-			$manager->saveItem( $item, false );
100
+			$manager->saveItem($item, false);
101 101
 		}
102 102
 	}
103 103
 
@@ -109,23 +109,23 @@  discard block
 block discarded – undo
109 109
 	 * @param \Aimeos\MShop\Customer\Item\Iface $user Aimeos customer object
110 110
 	 * @param string $group Unique customer group code
111 111
 	 */
112
-	protected function addGroup( \Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group )
112
+	protected function addGroup(\Aimeos\MShop\Context\Item\Iface $context, \Aimeos\MShop\Customer\Item\Iface $user, $group)
113 113
 	{
114
-		$this->info( sprintf( 'Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode() ) );
114
+		$this->info(sprintf('Add "%1$s" group to user "%2$s" for sites', $group, $user->getCode()));
115 115
 
116
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
116
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
117 117
 
118
-		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
118
+		foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem)
119 119
 		{
120
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );
120
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), '', '', false);
121 121
 
122 122
 			$lcontext = clone $context;
123
-			$lcontext->setLocale( $localeItem );
123
+			$lcontext->setLocale($localeItem);
124 124
 
125
-			$this->info( '- ' . $siteItem->getCode() );
125
+			$this->info('- '.$siteItem->getCode());
126 126
 
127
-			$groupItem = $this->getGroupItem( $lcontext, $group );
128
-			$this->addListItem( $lcontext, $user->getId(), $groupItem->getId() );
127
+			$groupItem = $this->getGroupItem($lcontext, $group);
128
+			$this->addListItem($lcontext, $user->getId(), $groupItem->getId());
129 129
 		}
130 130
 	}
131 131
 
@@ -140,21 +140,21 @@  discard block
 block discarded – undo
140 140
 	 * @param string $password New user password
141 141
 	 * @return \Aimeos\MShop\Customer\Item\Iface Aimeos customer item object
142 142
 	 */
143
-	protected function createCustomerItem( \Aimeos\MShop\Context\Item\Iface $context, $email, $password )
143
+	protected function createCustomerItem(\Aimeos\MShop\Context\Item\Iface $context, $email, $password)
144 144
 	{
145
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer' );
145
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer');
146 146
 
147 147
 		try {
148
-			$item = $manager->findItem( $email );
149
-		} catch( \Aimeos\MShop\Exception $e ) {
148
+			$item = $manager->findItem($email);
149
+		} catch (\Aimeos\MShop\Exception $e) {
150 150
 			$item = $manager->createItem();
151 151
 		}
152 152
 
153
-		$item->setCode( $email );
154
-		$item->getPaymentAddress()->setEmail( $email );
155
-		$item->setPassword( $password );
153
+		$item->setCode($email);
154
+		$item->getPaymentAddress()->setEmail($email);
155
+		$item->setPassword($password);
156 156
 
157
-		$manager->saveItem( $item );
157
+		$manager->saveItem($item);
158 158
 
159 159
 		return $item;
160 160
 	}
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
 	protected function getArguments()
169 169
 	{
170 170
 		return array(
171
-			array( 'email', InputArgument::REQUIRED, 'E-mail address of the account that should be created' ),
172
-			array( 'site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)' ),
171
+			array('email', InputArgument::REQUIRED, 'E-mail address of the account that should be created'),
172
+			array('site', InputArgument::OPTIONAL, 'Site codes to create accounts for like "default unittest" (none for all)'),
173 173
 		);
174 174
 	}
175 175
 
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
 	 * @param string $code Unique customer group code
182 182
 	 * @return \Aimeos\MShop\Customer\Item\Group\Iface Aimeos customer group item object
183 183
 	 */
184
-	protected function getGroupItem( \Aimeos\MShop\Context\Item\Iface $context, $code )
184
+	protected function getGroupItem(\Aimeos\MShop\Context\Item\Iface $context, $code)
185 185
 	{
186
-		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager( $context )->getSubmanager( 'group' );
186
+		$manager = \Aimeos\MShop\Customer\Manager\Factory::createManager($context)->getSubmanager('group');
187 187
 
188 188
 		try
189 189
 		{
190
-			$item = $manager->findItem( $code );
190
+			$item = $manager->findItem($code);
191 191
 		}
192
-		catch( \Aimeos\MShop\Exception $e )
192
+		catch (\Aimeos\MShop\Exception $e)
193 193
 		{
194 194
 			$item = $manager->createItem();
195
-			$item->setLabel( $code );
196
-			$item->setCode( $code );
195
+			$item->setLabel($code);
196
+			$item->setCode($code);
197 197
 
198
-			$manager->saveItem( $item );
198
+			$manager->saveItem($item);
199 199
 		}
200 200
 
201 201
 		return $item;
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
 	protected function getOptions()
211 211
 	{
212 212
 		return array(
213
-			array( 'password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)' ),
214
-			array( 'admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges' ),
215
-			array( 'editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges' ),
213
+			array('password', null, InputOption::VALUE_REQUIRED, 'Optional password for the account (will ask for if not given)'),
214
+			array('admin', null, InputOption::VALUE_NONE, 'If account should have administrator privileges'),
215
+			array('editor', null, InputOption::VALUE_NONE, 'If account should have limited editor privileges'),
216 216
 		);
217 217
 	}
218 218
 }
Please login to merge, or discard this patch.
src/Aimeos/Shop/Command/JobsCommand.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -43,21 +43,21 @@  discard block
 block discarded – undo
43 43
 	 */
44 44
 	public function fire()
45 45
 	{
46
-		$aimeos = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get();
46
+		$aimeos = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get();
47 47
 		$context = $this->getContext();
48 48
 
49
-		$jobs = explode( ' ', $this->argument( 'jobs' ) );
50
-		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context );
49
+		$jobs = explode(' ', $this->argument('jobs'));
50
+		$localeManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context);
51 51
 
52
-		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
52
+		foreach ($this->getSiteItems($context, $this->argument('site')) as $siteItem)
53 53
 		{
54
-			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), 'en', '', false );
55
-			$context->setLocale( $localeItem );
54
+			$localeItem = $localeManager->bootstrap($siteItem->getCode(), 'en', '', false);
55
+			$context->setLocale($localeItem);
56 56
 
57
-			$this->info( sprintf( 'Executing the Aimeos jobs for "%s"', $siteItem->getCode() ) );
57
+			$this->info(sprintf('Executing the Aimeos jobs for "%s"', $siteItem->getCode()));
58 58
 
59
-			foreach( $jobs as $jobname ) {
60
-				\Aimeos\Controller\Jobs\Factory::createController( $context, $aimeos, $jobname )->run();
59
+			foreach ($jobs as $jobname) {
60
+				\Aimeos\Controller\Jobs\Factory::createController($context, $aimeos, $jobname)->run();
61 61
 			}
62 62
 		}
63 63
 	}
@@ -71,8 +71,8 @@  discard block
 block discarded – undo
71 71
 	protected function getArguments()
72 72
 	{
73 73
 		return array(
74
-			array( 'jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"' ),
75
-			array( 'site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)' ),
74
+			array('jobs', InputArgument::REQUIRED, 'One or more job controller names like "admin/job customer/email/watch"'),
75
+			array('site', InputArgument::OPTIONAL, 'Site codes to execute the jobs for like "default unittest" (none for all)'),
76 76
 		);
77 77
 	}
78 78
 
@@ -95,19 +95,19 @@  discard block
 block discarded – undo
95 95
 	protected function getContext()
96 96
 	{
97 97
 		$lv = $this->getLaravel();
98
-		$aimeos = $lv->make( '\Aimeos\Shop\Base\Aimeos' )->get();
99
-		$context = $lv->make( '\Aimeos\Shop\Base\Context' )->get( false );
98
+		$aimeos = $lv->make('\Aimeos\Shop\Base\Aimeos')->get();
99
+		$context = $lv->make('\Aimeos\Shop\Base\Context')->get(false);
100 100
 
101
-		$tmplPaths = $aimeos->getCustomPaths( 'controller/jobs/templates' );
102
-		$view = $lv->make( '\Aimeos\Shop\Base\View' )->create( $context, $tmplPaths );
101
+		$tmplPaths = $aimeos->getCustomPaths('controller/jobs/templates');
102
+		$view = $lv->make('\Aimeos\Shop\Base\View')->create($context, $tmplPaths);
103 103
 
104
-		$langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager( $context )->getSubManager( 'language' );
105
-		$langids = array_keys( $langManager->searchItems( $langManager->createSearch( true ) ) );
106
-		$i18n = $lv->make( '\Aimeos\Shop\Base\I18n' )->get( $langids );
104
+		$langManager = \Aimeos\MShop\Locale\Manager\Factory::createManager($context)->getSubManager('language');
105
+		$langids = array_keys($langManager->searchItems($langManager->createSearch(true)));
106
+		$i18n = $lv->make('\Aimeos\Shop\Base\I18n')->get($langids);
107 107
 
108
-		$context->setEditor( 'aimeos:jobs' );
109
-		$context->setView( $view );
110
-		$context->setI18n( $i18n );
108
+		$context->setEditor('aimeos:jobs');
109
+		$context->setView($view);
110
+		$context->setI18n($i18n);
111 111
 
112 112
 		return $context;
113 113
 	}
Please login to merge, or discard this patch.
src/Aimeos/Shop/Command/SetupCommand.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 	 * @param string $classname Name of the setup task class
43 43
 	 * @return boolean True if class is found, false if not
44 44
 	 */
45
-	public static function autoload( $classname )
45
+	public static function autoload($classname)
46 46
 	{
47
-		if( strncmp( $classname, 'Aimeos\\MW\\Setup\\Task\\', 21 ) === 0 )
47
+		if (strncmp($classname, 'Aimeos\\MW\\Setup\\Task\\', 21) === 0)
48 48
 		{
49
-			$fileName = substr( $classname, 21 ) . '.php';
50
-			$paths = explode( PATH_SEPARATOR, get_include_path() );
49
+			$fileName = substr($classname, 21).'.php';
50
+			$paths = explode(PATH_SEPARATOR, get_include_path());
51 51
 
52
-			foreach( $paths as $path )
52
+			foreach ($paths as $path)
53 53
 			{
54
-				$file = $path . DIRECTORY_SEPARATOR . $fileName;
54
+				$file = $path.DIRECTORY_SEPARATOR.$fileName;
55 55
 
56
-				if( file_exists( $file ) === true && ( include_once $file ) !== false ) {
56
+				if (file_exists($file) === true && (include_once $file) !== false) {
57 57
 					return true;
58 58
 				}
59 59
 			}
@@ -70,49 +70,49 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public function fire()
72 72
 	{
73
-		$ctx = $this->getLaravel()->make( '\Aimeos\Shop\Base\Context' )->get( false );
74
-		$ctx->setEditor( 'aimeos:setup' );
73
+		$ctx = $this->getLaravel()->make('\Aimeos\Shop\Base\Context')->get(false);
74
+		$ctx->setEditor('aimeos:setup');
75 75
 
76 76
 		$config = $ctx->getConfig();
77
-		$site = $this->argument( 'site' );
78
-		$template = $this->argument( 'tplsite' );
77
+		$site = $this->argument('site');
78
+		$template = $this->argument('tplsite');
79 79
 
80
-		$config->set( 'setup/site', $site );
81
-		$dbconfig = $this->getDbConfig( $config );
82
-		$this->setOptions( $config );
80
+		$config->set('setup/site', $site);
81
+		$dbconfig = $this->getDbConfig($config);
82
+		$this->setOptions($config);
83 83
 
84
-		$taskPaths = $this->getLaravel()->make( '\Aimeos\Shop\Base\Aimeos' )->get()->getSetupPaths( $template );
84
+		$taskPaths = $this->getLaravel()->make('\Aimeos\Shop\Base\Aimeos')->get()->getSetupPaths($template);
85 85
 
86 86
 		$includePaths = $taskPaths;
87 87
 		$includePaths[] = get_include_path();
88 88
 
89
-		if( set_include_path( implode( PATH_SEPARATOR, $includePaths ) ) === false ) {
90
-			throw new \Exception( 'Unable to extend include path' );
89
+		if (set_include_path(implode(PATH_SEPARATOR, $includePaths)) === false) {
90
+			throw new \Exception('Unable to extend include path');
91 91
 		}
92 92
 
93
-		spl_autoload_register( '\Aimeos\Shop\Command\SetupCommand::autoload', true );
93
+		spl_autoload_register('\Aimeos\Shop\Command\SetupCommand::autoload', true);
94 94
 
95
-		$manager = new \Aimeos\MW\Setup\Manager\Multiple( $ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx );
95
+		$manager = new \Aimeos\MW\Setup\Manager\Multiple($ctx->getDatabaseManager(), $dbconfig, $taskPaths, $ctx);
96 96
 
97
-		$this->info( sprintf( 'Initializing or updating the Aimeos database tables for site "%1$s"', $site ) );
97
+		$this->info(sprintf('Initializing or updating the Aimeos database tables for site "%1$s"', $site));
98 98
 
99
-		if( ( $task = $this->option( 'task' ) ) && is_array( $task ) ) {
100
-			$task = reset( $task );
99
+		if (($task = $this->option('task')) && is_array($task)) {
100
+			$task = reset($task);
101 101
 		}
102 102
 
103
-		switch( $this->option( 'action' ) )
103
+		switch ($this->option('action'))
104 104
 		{
105 105
 			case 'migrate':
106
-				$manager->migrate( $task );
106
+				$manager->migrate($task);
107 107
 				break;
108 108
 			case 'rollback':
109
-				$manager->rollback( $task );
109
+				$manager->rollback($task);
110 110
 				break;
111 111
 			case 'clean':
112
-				$manager->clean( $task );
112
+				$manager->clean($task);
113 113
 				break;
114 114
 			default:
115
-				throw new \Exception( sprintf( 'Invalid setup action "%1$s"', $this->option( 'action' ) ) );
115
+				throw new \Exception(sprintf('Invalid setup action "%1$s"', $this->option('action')));
116 116
 		}
117 117
 	}
118 118
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 	protected function getArguments()
126 126
 	{
127 127
 		return array(
128
-			array( 'site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default' ),
129
-			array( 'tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default' ),
128
+			array('site', InputArgument::OPTIONAL, 'Site for updating database entries', 'default'),
129
+			array('tplsite', InputArgument::OPTIONAL, 'Site used as template for creating the new one', 'default'),
130 130
 		);
131 131
 	}
132 132
 
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 	protected function getOptions()
140 140
 	{
141 141
 		return array(
142
-			array( 'option', null, InputOption::VALUE_REQUIRED, 'Setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array() ),
143
-			array( 'action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate' ),
144
-			array( 'task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null ),
142
+			array('option', null, InputOption::VALUE_REQUIRED, 'Setup configuration, name and value are separated by ":" like "setup/default/demo:1"', array()),
143
+			array('action', null, InputOption::VALUE_REQUIRED, 'Action name that should be executed, i.e. "migrate", "rollback", "clean"', 'migrate'),
144
+			array('task', null, InputOption::VALUE_REQUIRED, 'Name of the setup task that should be executed', null),
145 145
 		);
146 146
 	}
147 147
 
@@ -152,14 +152,14 @@  discard block
 block discarded – undo
152 152
 	 * @param \Aimeos\MW\Config\Iface $conf Config object
153 153
 	 * @return array Multi-dimensional associative list of database configuration parameters
154 154
 	 */
155
-	protected function getDbConfig( \Aimeos\MW\Config\Iface $conf )
155
+	protected function getDbConfig(\Aimeos\MW\Config\Iface $conf)
156 156
 	{
157
-		$dbconfig = $conf->get( 'resource', array() );
157
+		$dbconfig = $conf->get('resource', array());
158 158
 
159
-		foreach( $dbconfig as $rname => $dbconf )
159
+		foreach ($dbconfig as $rname => $dbconf)
160 160
 		{
161
-			if( strncmp( $rname, 'db', 2 ) !== 0 ) {
162
-				unset( $dbconfig[$rname] );
161
+			if (strncmp($rname, 'db', 2) !== 0) {
162
+				unset($dbconfig[$rname]);
163 163
 			}
164 164
 		}
165 165
 
@@ -174,12 +174,12 @@  discard block
 block discarded – undo
174 174
 	 * @param array Associative list of database configurations
175 175
 	 * @throws \RuntimeException If the format of the options is invalid
176 176
 	 */
177
-	protected function setOptions( \Aimeos\MW\Config\Iface $conf )
177
+	protected function setOptions(\Aimeos\MW\Config\Iface $conf)
178 178
 	{
179
-		foreach( (array) $this->option( 'option' ) as $option )
179
+		foreach ((array) $this->option('option') as $option)
180 180
 		{
181
-			list( $name, $value ) = explode( ':', $option );
182
-			$conf->set( $name, $value );
181
+			list($name, $value) = explode(':', $option);
182
+			$conf->set($name, $value);
183 183
 		}
184 184
 	}
185 185
 }
Please login to merge, or discard this patch.