Completed
Push — master ( 237cde...6c20d5 )
by Aimeos
15:06
created
src/Bootstrap.php 1 patch
Spacing   +31 added lines, -31 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,52 +71,52 @@  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
 		$container = $this->app->getContainer();
77 77
 
78
-		$container['router'] = function( $c ) {
78
+		$container['router'] = function($c) {
79 79
 			return new \Aimeos\Slim\Router();
80 80
 		};
81 81
 
82
-		$container['mailer'] = function( $c ) {
83
-			return new \Swift_Mailer( new \Swift_SendmailTransport() );
82
+		$container['mailer'] = function($c) {
83
+			return new \Swift_Mailer(new \Swift_SendmailTransport());
84 84
 		};
85 85
 
86 86
 
87
-		$default = require __DIR__ . DIRECTORY_SEPARATOR . 'aimeos-default.php';
88
-		$settings = array_replace_recursive( $default, $this->settings );
87
+		$default = require __DIR__.DIRECTORY_SEPARATOR.'aimeos-default.php';
88
+		$settings = array_replace_recursive($default, $this->settings);
89 89
 
90
-		$container['aimeos'] = function( $c ) use ( $extdir ) {
91
-			return new \Aimeos\Bootstrap( (array) $extdir, false );
90
+		$container['aimeos'] = function($c) use ($extdir) {
91
+			return new \Aimeos\Bootstrap((array) $extdir, false);
92 92
 		};
93 93
 
94
-		$container['aimeos_config'] = function( $c ) use ( $settings ) {
95
-			return new \Aimeos\Slim\Base\Config( $c, $settings );
94
+		$container['aimeos_config'] = function($c) use ($settings) {
95
+			return new \Aimeos\Slim\Base\Config($c, $settings);
96 96
 		};
97 97
 
98
-		$container['aimeos_context'] = function( $c ) {
99
-			return new \Aimeos\Slim\Base\Context( $c );
98
+		$container['aimeos_context'] = function($c) {
99
+			return new \Aimeos\Slim\Base\Context($c);
100 100
 		};
101 101
 
102
-		$container['aimeos_i18n'] = function( $c ) {
103
-			return new \Aimeos\Slim\Base\I18n( $c );
102
+		$container['aimeos_i18n'] = function($c) {
103
+			return new \Aimeos\Slim\Base\I18n($c);
104 104
 		};
105 105
 
106
-		$container['aimeos_locale'] = function( $c ) {
107
-			return new \Aimeos\Slim\Base\Locale( $c );
106
+		$container['aimeos_locale'] = function($c) {
107
+			return new \Aimeos\Slim\Base\Locale($c);
108 108
 		};
109 109
 
110
-		$container['aimeos_page'] = function( $c ) {
111
-			return new \Aimeos\Slim\Base\Page( $c );
110
+		$container['aimeos_page'] = function($c) {
111
+			return new \Aimeos\Slim\Base\Page($c);
112 112
 		};
113 113
 
114
-		$container['aimeos_view'] = function( $c ) {
115
-			return new \Aimeos\Slim\Base\View( $c );
114
+		$container['aimeos_view'] = function($c) {
115
+			return new \Aimeos\Slim\Base\View($c);
116 116
 		};
117 117
 
118 118
 		// add client IP address to requests
119
-		$this->app->add( new \RKA\Middleware\IpAddress( true, [] ) );
119
+		$this->app->add(new \RKA\Middleware\IpAddress(true, []));
120 120
 
121 121
 		return $this;
122 122
 	}
@@ -129,14 +129,14 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public static function getVersion()
131 131
 	{
132
-		$basedir = dirname( dirname( dirname( dirname( __DIR__ ) ) ) ) . DIRECTORY_SEPARATOR;
132
+		$basedir = dirname(dirname(dirname(dirname(__DIR__)))).DIRECTORY_SEPARATOR;
133 133
 
134
-		if( ( $content = @file_get_contents( $basedir . 'composer.lock' ) ) !== false
135
-			&& ( $content = json_decode( $content, true ) ) !== null && isset( $content['packages'] )
134
+		if (($content = @file_get_contents($basedir.'composer.lock')) !== false
135
+			&& ($content = json_decode($content, true)) !== null && isset($content['packages'])
136 136
 		) {
137
-			foreach( (array) $content['packages'] as $item )
137
+			foreach ((array) $content['packages'] as $item)
138 138
 			{
139
-				if( $item['name'] === 'aimeos/aimeos-slim' ) {
139
+				if ($item['name'] === 'aimeos/aimeos-slim') {
140 140
 					return $item['version'];
141 141
 				}
142 142
 			}
Please login to merge, or discard this patch.