@@ -86,9 +86,12 @@ |
||
| 86 | 86 | { |
| 87 | 87 | $localeManager = \Aimeos\MShop::create( $context, 'locale' ); |
| 88 | 88 | |
| 89 | - try { |
|
| 89 | + try |
|
| 90 | + { |
|
| 90 | 91 | $localeItem = $localeManager->bootstrap( $site, '', '', false, null, true ); |
| 91 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 92 | + } |
|
| 93 | + catch( \Aimeos\MShop\Exception $e ) |
|
| 94 | + { |
|
| 92 | 95 | $localeItem = $localeManager->create(); |
| 93 | 96 | } |
| 94 | 97 | |
@@ -44,13 +44,14 @@ |
||
| 44 | 44 | { |
| 45 | 45 | \Composer\Factory::createHttpDownloader( $event->getIO(), $config ) |
| 46 | 46 | ->get( 'https://api.github.com/graphql', $options ); |
| 47 | - } |
|
| 48 | - else |
|
| 47 | + } else |
|
| 49 | 48 | { |
| 50 | 49 | \Composer\Factory::createRemoteFilesystem( $event->getIO(), $config ) |
| 51 | 50 | ->getContents( 'github.com', 'https://api.github.com/graphql', false, $options ); |
| 52 | 51 | } |
| 53 | 52 | } |
| 54 | - catch( \Exception $e ) {} |
|
| 53 | + catch( \Exception $e ) |
|
| 54 | + { |
|
| 55 | +} |
|
| 55 | 56 | } |
| 56 | 57 | } |
@@ -16,7 +16,8 @@ |
||
| 16 | 16 | /** |
| 17 | 17 | * Aimeos shop service provider for Laravel |
| 18 | 18 | */ |
| 19 | -class ShopServiceProvider extends ServiceProvider { |
|
| 19 | +class ShopServiceProvider extends ServiceProvider |
|
| 20 | +{ |
|
| 20 | 21 | |
| 21 | 22 | /** |
| 22 | 23 | * Indicates if loading of the provider is deferred. |
@@ -68,9 +68,12 @@ |
||
| 68 | 68 | |
| 69 | 69 | $manager = \Aimeos\MShop::create( $context, 'customer' ); |
| 70 | 70 | |
| 71 | - try { |
|
| 71 | + try |
|
| 72 | + { |
|
| 72 | 73 | $item = $manager->find( $email ); |
| 73 | - } catch( \Aimeos\MShop\Exception $e ) { |
|
| 74 | + } |
|
| 75 | + catch( \Aimeos\MShop\Exception $e ) |
|
| 76 | + { |
|
| 74 | 77 | $item = $manager->create(); |
| 75 | 78 | } |
| 76 | 79 | |
@@ -48,8 +48,7 @@ |
||
| 48 | 48 | $jobs = $this->argument( 'jobs' ); |
| 49 | 49 | $jobs = !is_array( $jobs ) ? explode( ' ', (string) $jobs ) : $jobs; |
| 50 | 50 | |
| 51 | - $fcn = function( \Aimeos\MShop\ContextIface $lcontext, \Aimeos\Bootstrap $aimeos ) use ( $jobs ) |
|
| 52 | - { |
|
| 51 | + $fcn = function( \Aimeos\MShop\ContextIface $lcontext, \Aimeos\Bootstrap $aimeos ) use ( $jobs ) { |
|
| 53 | 52 | $jobfcn = function( $context, $aimeos, $jobname ) { |
| 54 | 53 | \Aimeos\Controller\Jobs::create( $context, $aimeos, $jobname )->run(); |
| 55 | 54 | }; |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -switch( config( 'database.default', 'mysql' ) ) { |
|
| 3 | +switch( config( 'database.default', 'mysql' ) ) |
|
| 4 | +{ |
|
| 4 | 5 | case 'pgsql': $aimeosIndexManagerName = 'PgSQL'; break; |
| 5 | 6 | case 'sqlsrv': $aimeosIndexManagerName = 'SQLSrv'; break; |
| 6 | 7 | default: $aimeosIndexManagerName = 'MySQL'; |
@@ -95,8 +95,7 @@ discard block |
||
| 95 | 95 | || ( ( $user = \Illuminate\Support\Facades\Auth::user() ) !== null && $user->superuser ) |
| 96 | 96 | ) { |
| 97 | 97 | $helper = new \Aimeos\Base\View\Helper\Access\All( $view ); |
| 98 | - } |
|
| 99 | - else |
|
| 98 | + } else |
|
| 100 | 99 | { |
| 101 | 100 | $helper = new \Aimeos\Base\View\Helper\Access\Standard( $view, function() use ( $context ) { |
| 102 | 101 | return $context->groups(); |
@@ -156,8 +155,7 @@ discard block |
||
| 156 | 155 | { |
| 157 | 156 | $pattern = $config->get( 'client/html/common/format/pattern' ); |
| 158 | 157 | $helper = new \Aimeos\Base\View\Helper\Number\Locale( $view, $locale, $pattern ); |
| 159 | - } |
|
| 160 | - else |
|
| 158 | + } else |
|
| 161 | 159 | { |
| 162 | 160 | $sep1000 = $config->get( 'client/html/common/format/separator1000', '' ); |
| 163 | 161 | $decsep = $config->get( 'client/html/common/format/separatorDecimal', '.' ); |
@@ -243,8 +241,7 @@ discard block |
||
| 243 | 241 | { |
| 244 | 242 | $i18n = $this->i18n->get( array( $locale ) ); |
| 245 | 243 | $translation = $i18n[$locale]; |
| 246 | - } |
|
| 247 | - else |
|
| 244 | + } else |
|
| 248 | 245 | { |
| 249 | 246 | $translation = new \Aimeos\Base\Translation\None( 'en' ); |
| 250 | 247 | } |
@@ -67,10 +67,15 @@ |
||
| 67 | 67 | |
| 68 | 68 | foreach( array_reverse( self::$fcn ) as $name => $fcn ) |
| 69 | 69 | { |
| 70 | - try { |
|
| 70 | + try |
|
| 71 | + { |
|
| 71 | 72 | return call_user_func_array( $fcn->bindTo( $this, static::class ), [$context, $path] ); |
| 72 | - } catch( \Exception $e ) { |
|
| 73 | - if( $e->getCode() !== 404 ) throw $e; |
|
| 73 | + } |
|
| 74 | + catch( \Exception $e ) |
|
| 75 | + { |
|
| 76 | + if( $e->getCode() !== 404 ) { |
|
| 77 | + throw $e; |
|
| 78 | + } |
|
| 74 | 79 | } |
| 75 | 80 | } |
| 76 | 81 | |
@@ -283,9 +283,13 @@ discard block |
||
| 283 | 283 | if( ( $guard = Auth::guard( $gname ) ) && ( $userid = $guard->id() ) ) |
| 284 | 284 | { |
| 285 | 285 | $context->setUser( function() use ( $context, $userid ) { |
| 286 | - try { |
|
| 286 | + try |
|
| 287 | + { |
|
| 287 | 288 | return \Aimeos\MShop::create( $context, 'customer' )->get( $userid, ['group'] ); |
| 288 | - } catch( \Aimeos\MShop\Exception $e ) { // avoid errors if user is assigned to another site |
|
| 289 | + } |
|
| 290 | + catch( \Aimeos\MShop\Exception $e ) |
|
| 291 | + { |
|
| 292 | +// avoid errors if user is assigned to another site |
|
| 289 | 293 | return null; |
| 290 | 294 | } |
| 291 | 295 | } ); |
@@ -295,8 +299,7 @@ discard block |
||
| 295 | 299 | } ); |
| 296 | 300 | |
| 297 | 301 | $context->setEditor( $guard->user()?->email ?: \Request::ip() ); |
| 298 | - } |
|
| 299 | - elseif( $ip = \Request::ip() ) |
|
| 302 | + } elseif( $ip = \Request::ip() ) |
|
| 300 | 303 | { |
| 301 | 304 | $context->setEditor( $ip ); |
| 302 | 305 | } |