Completed
Push — master ( 89068a...af6c70 )
by Aimeos
02:40
created
src/Bootstrap.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @param \Slim\App $app Slim application
28 28
 	 * @param array $settings Multi-dimensional array of configuration settings
29 29
 	 */
30
-	public function __construct( \Slim\App $app, array $settings )
30
+	public function __construct(\Slim\App $app, array $settings)
31 31
 	{
32 32
 		$this->app = $app;
33 33
 		$this->settings = $settings;
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
 	 * @param string $path Absolute or relative path to the Aimeos route file
41 41
 	 * @return \Aimeos\Slim\Bootstrap Self instance
42 42
 	 */
43
-	public function routes( $path )
43
+	public function routes($path)
44 44
 	{
45 45
 		$app = $this->app;
46 46
 		$settings = $this->settings;
47 47
 
48
-		$config = function( $key, $default ) use ( $settings )
48
+		$config = function($key, $default) use ($settings)
49 49
 		{
50
-			foreach( explode( '/', trim( $key, '/' ) ) as $part )
50
+			foreach (explode('/', trim($key, '/')) as $part)
51 51
 			{
52
-				if( isset( $settings[$part] ) ) {
52
+				if (isset($settings[$part])) {
53 53
 					$settings = $settings[$part];
54 54
 				} else {
55 55
 					return $default;
@@ -71,47 +71,47 @@  discard block
 block discarded – undo
71 71
 	 * @param string $extdir Absolute or relative path to the Aimeos extension directory
72 72
 	 * @return \Aimeos\Slim\Bootstrap Self instance
73 73
 	 */
74
-	public function setup( $extdir = '../ext' )
74
+	public function setup($extdir = '../ext')
75 75
 	{
76 76
 		$default = require __DIR__ . DIRECTORY_SEPARATOR . 'aimeos-default.php';
77
-		$settings = array_replace_recursive( $default, $this->settings );
77
+		$settings = array_replace_recursive($default, $this->settings);
78 78
 		$container = $this->app->getContainer();
79 79
 
80
-		$container['aimeos'] = function( $c ) use ( $extdir ) {
81
-			return new \Aimeos\Bootstrap( (array) $extdir, false );
80
+		$container['aimeos'] = function($c) use ($extdir) {
81
+			return new \Aimeos\Bootstrap((array) $extdir, false);
82 82
 		};
83 83
 
84
-		$container['aimeos_context'] = function( $c ) {
85
-			return new \Aimeos\Slim\Base\Context( $c );
84
+		$container['aimeos_context'] = function($c) {
85
+			return new \Aimeos\Slim\Base\Context($c);
86 86
 		};
87 87
 
88
-		$container['aimeos_i18n'] = function( $c ) {
89
-			return new \Aimeos\Slim\Base\I18n( $c );
88
+		$container['aimeos_i18n'] = function($c) {
89
+			return new \Aimeos\Slim\Base\I18n($c);
90 90
 		};
91 91
 
92
-		$container['aimeos_page'] = function( $c ) {
93
-			return new \Aimeos\Slim\Base\Page( $c );
92
+		$container['aimeos_page'] = function($c) {
93
+			return new \Aimeos\Slim\Base\Page($c);
94 94
 		};
95 95
 
96
-		$container['aimeos_view'] = function( $c ) {
97
-			return new \Aimeos\Slim\Base\View( $c );
96
+		$container['aimeos_view'] = function($c) {
97
+			return new \Aimeos\Slim\Base\View($c);
98 98
 		};
99 99
 
100 100
 
101
-		$container['aimeos_config'] = function( $c ) use ( $settings ) {
101
+		$container['aimeos_config'] = function($c) use ($settings) {
102 102
 
103
-			$config = new \Aimeos\MW\Config\PHPArray( $settings, $c['aimeos']->getConfigPaths() );
103
+			$config = new \Aimeos\MW\Config\PHPArray($settings, $c['aimeos']->getConfigPaths());
104 104
 
105
-			if( function_exists( 'apc_store' ) === true && $config->get( 'apc_enabled', false ) == true ) {
106
-				$config = new \Aimeos\MW\Config\Decorator\APC( $config, $config->get( 'apc_prefix', 'slim:' ) );
105
+			if (function_exists('apc_store') === true && $config->get('apc_enabled', false) == true) {
106
+				$config = new \Aimeos\MW\Config\Decorator\APC($config, $config->get('apc_prefix', 'slim:'));
107 107
 			}
108 108
 
109 109
 			return $config;
110 110
 		};
111 111
 
112 112
 
113
-		$container['mailer'] = function( $c ) {
114
-			return \Swift_Mailer::newInstance( \Swift_SendmailTransport::newInstance() );
113
+		$container['mailer'] = function($c) {
114
+			return \Swift_Mailer::newInstance(\Swift_SendmailTransport::newInstance());
115 115
 		};
116 116
 
117 117
 		return $this;
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
 	 */
126 126
 	public static function getVersion()
127 127
 	{
128
-		$basedir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . DIRECTORY_SEPARATOR;
128
+		$basedir = dirname(dirname(dirname(dirname(__DIR__)))) . DIRECTORY_SEPARATOR;
129 129
 
130
-		if( ( $content = @file_get_contents( $basedir . 'composer.lock' ) ) !== false
131
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
130
+		if (($content = @file_get_contents($basedir . 'composer.lock')) !== false
131
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
132 132
 		) {
133
-			foreach( (array) $content['packages'] as $item )
133
+			foreach ((array) $content['packages'] as $item)
134 134
 			{
135
-				if( $item['name'] === 'aimeos/aimeos-slim' ) {
135
+				if ($item['name'] === 'aimeos/aimeos-slim') {
136 136
 					return $item['version'];
137 137
 				}
138 138
 			}
Please login to merge, or discard this patch.