Completed
Push — master ( 9eb8da...393642 )
by
unknown
01:34
created
src/Routing/HasRoutesTrait.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	 * @param RouteInterface  $route
31 31
 	 * @return RouteInterface
32 32
 	 */
33
-	public function addRoute( $route ) {
33
+	public function addRoute($route) {
34 34
 		$this->routes[] = $route;
35 35
 		return $route;
36 36
 	}
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	 * @param  string|Closure $handler
44 44
 	 * @return RouteInterface
45 45
 	 */
46
-	public function route( $methods, $target, $handler ) {
47
-		$route = new Route( $methods, $target, $handler );
48
-		return $this->addRoute( $route );
46
+	public function route($methods, $target, $handler) {
47
+		$route = new Route($methods, $target, $handler);
48
+		return $this->addRoute($route);
49 49
 	}
50 50
 
51 51
 	/**
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
 	 * @param  Closure        $callable
56 56
 	 * @return RouteInterface
57 57
 	 */
58
-	public function group( $target, Closure $callable ) {
59
-		$routeGroup = new RouteGroup( $target, $callable );
60
-		return $this->addRoute( $routeGroup );
58
+	public function group($target, Closure $callable) {
59
+		$routeGroup = new RouteGroup($target, $callable);
60
+		return $this->addRoute($routeGroup);
61 61
 	}
62 62
 
63 63
 	/**
@@ -67,8 +67,8 @@  discard block
 block discarded – undo
67 67
 	 * @param  string|Closure $handler
68 68
 	 * @return RouteInterface
69 69
 	 */
70
-	public function get( $target, $handler ) {
71
-		return $this->route( ['GET', 'HEAD'], $target, $handler );
70
+	public function get($target, $handler) {
71
+		return $this->route(['GET', 'HEAD'], $target, $handler);
72 72
 	}
73 73
 
74 74
 	/**
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 	 * @param  string|Closure $handler
79 79
 	 * @return RouteInterface
80 80
 	 */
81
-	public function post( $target, $handler ) {
82
-		return $this->route( ['POST'], $target, $handler );
81
+	public function post($target, $handler) {
82
+		return $this->route(['POST'], $target, $handler);
83 83
 	}
84 84
 
85 85
 	/**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 	 * @param  string|Closure $handler
90 90
 	 * @return RouteInterface
91 91
 	 */
92
-	public function put( $target, $handler ) {
93
-		return $this->route( ['PUT'], $target, $handler );
92
+	public function put($target, $handler) {
93
+		return $this->route(['PUT'], $target, $handler);
94 94
 	}
95 95
 
96 96
 	/**
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 	 * @param  string|Closure $handler
101 101
 	 * @return RouteInterface
102 102
 	 */
103
-	public function patch( $target, $handler ) {
104
-		return $this->route( ['PATCH'], $target, $handler );
103
+	public function patch($target, $handler) {
104
+		return $this->route(['PATCH'], $target, $handler);
105 105
 	}
106 106
 
107 107
 	/**
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 	 * @param  string|Closure $handler
112 112
 	 * @return RouteInterface
113 113
 	 */
114
-	public function delete( $target, $handler ) {
115
-		return $this->route( ['DELETE'], $target, $handler );
114
+	public function delete($target, $handler) {
115
+		return $this->route(['DELETE'], $target, $handler);
116 116
 	}
117 117
 
118 118
 	/**
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 	 * @param  string|Closure $handler
123 123
 	 * @return RouteInterface
124 124
 	 */
125
-	public function options( $target, $handler ) {
126
-		return $this->route( ['OPTIONS'], $target, $handler );
125
+	public function options($target, $handler) {
126
+		return $this->route(['OPTIONS'], $target, $handler);
127 127
 	}
128 128
 
129 129
 	/**
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @param  string|Closure $handler
134 134
 	 * @return RouteInterface
135 135
 	 */
136
-	public function any( $target, $handler ) {
137
-		return $this->route( ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $target, $handler );
136
+	public function any($target, $handler) {
137
+		return $this->route(['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'], $target, $handler);
138 138
 	}
139 139
 }
Please login to merge, or discard this patch.
src/Routing/HasRoutesInterface.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * @param RouteInterface  $route
22 22
 	 * @return RouteInterface
23 23
 	 */
24
-	public function addRoute( $route );
24
+	public function addRoute($route);
25 25
 
26 26
 	/**
27 27
 	 * Create and add a new route
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	 * @param  string|Closure $handler
32 32
 	 * @return RouteInterface
33 33
 	 */
34
-	public function route( $methods, $target, $handler );
34
+	public function route($methods, $target, $handler);
35 35
 
36 36
 	/**
37 37
 	 * Create and add a route group
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param  Closure        $callable
41 41
 	 * @return RouteInterface
42 42
 	 */
43
-	public function group( $target, Closure $callable );
43
+	public function group($target, Closure $callable);
44 44
 
45 45
 	/**
46 46
 	 * Create and add a route for the GET and HEAD methods
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @param  string|Closure $handler
50 50
 	 * @return RouteInterface
51 51
 	 */
52
-	public function get( $target, $handler );
52
+	public function get($target, $handler);
53 53
 
54 54
 	/**
55 55
 	 * Create and add a route for the POST method
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 	 * @param  string|Closure $handler
59 59
 	 * @return RouteInterface
60 60
 	 */
61
-	public function post( $target, $handler );
61
+	public function post($target, $handler);
62 62
 
63 63
 	/**
64 64
 	 * Create and add a route for the PUT method
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param  string|Closure $handler
68 68
 	 * @return RouteInterface
69 69
 	 */
70
-	public function put( $target, $handler );
70
+	public function put($target, $handler);
71 71
 
72 72
 	/**
73 73
 	 * Create and add a route for the PATCH method
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @param  string|Closure $handler
77 77
 	 * @return RouteInterface
78 78
 	 */
79
-	public function patch( $target, $handler );
79
+	public function patch($target, $handler);
80 80
 
81 81
 	/**
82 82
 	 * Create and add a route for the DELETE method
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 * @param  string|Closure $handler
86 86
 	 * @return RouteInterface
87 87
 	 */
88
-	public function delete( $target, $handler );
88
+	public function delete($target, $handler);
89 89
 
90 90
 	/**
91 91
 	 * Create and add a route for the OPTIONS method
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 * @param  string|Closure $handler
95 95
 	 * @return RouteInterface
96 96
 	 */
97
-	public function options( $target, $handler );
97
+	public function options($target, $handler);
98 98
 
99 99
 	/**
100 100
 	 * Create and add a route for all supported methods
@@ -103,5 +103,5 @@  discard block
 block discarded – undo
103 103
 	 * @param  string|Closure $handler
104 104
 	 * @return RouteInterface
105 105
 	 */
106
-	public function any( $target, $handler );
106
+	public function any($target, $handler);
107 107
 }
Please login to merge, or discard this patch.
src/ServiceProviders/Templating.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	/**
12 12
 	 * {@inheritDoc}
13 13
 	 */
14
-	public function register( $container ) {
14
+	public function register($container) {
15 15
 		$container['framework.templating.engine'] = function() {
16 16
 			return new \CarbonFramework\Templating\Php();
17 17
 		};
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	/**
21 21
 	 * {@inheritDoc}
22 22
 	 */
23
-	public function boot( $container ) {
23
+	public function boot($container) {
24 24
 		// nothing to boot
25 25
 	}
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Request.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @return Request
57 57
 	 */
58 58
 	public static function fromGlobals() {
59
-		return new static( stripslashes_deep( $_GET ), stripslashes_deep( $_POST ), $_COOKIE, $_FILES, $_SERVER, getallheaders() );
59
+		return new static(stripslashes_deep($_GET), stripslashes_deep($_POST), $_COOKIE, $_FILES, $_SERVER, getallheaders());
60 60
 	}
61 61
 
62 62
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 * @param array $server
70 70
 	 * @param array $headers
71 71
 	 */
72
-	public function __construct( $get, $post, $cookie, $files, $server, $headers ) {
72
+	public function __construct($get, $post, $cookie, $files, $server, $headers) {
73 73
 		$this->get = $get;
74 74
 		$this->post = $post;
75 75
 		$this->cookie = $cookie;
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 	 * @return string
85 85
 	 */
86 86
 	public function getMethod() {
87
-		$method = (string) Arr::get( $this->server, 'REQUEST_METHOD', 'GET' );
87
+		$method = (string) Arr::get($this->server, 'REQUEST_METHOD', 'GET');
88 88
 		
89
-		$override = (string) Arr::get( $this->headers, 'X-HTTP-METHOD-OVERRIDE' );
90
-		if ( $method === 'POST' && $override ) {
89
+		$override = (string) Arr::get($this->headers, 'X-HTTP-METHOD-OVERRIDE');
90
+		if ($method === 'POST' && $override) {
91 91
 			$method = $override;
92 92
 		}
93 93
 
94
-		return strtoupper( $method );
94
+		return strtoupper($method);
95 95
 	}
96 96
 
97 97
 	/**
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 	 * @return string
101 101
 	 */
102 102
 	public function getUrl() {
103
-		$https = Arr::get( $this->server, 'HTTPS' );
103
+		$https = Arr::get($this->server, 'HTTPS');
104 104
 
105 105
 		$protocol = $https ? 'https' : 'http';
106
-		$host = (string) Arr::get( $this->server, 'HTTP_HOST', '' );
107
-		$uri = (string) Arr::get( $this->server, 'REQUEST_URI', '' );
106
+		$host = (string) Arr::get($this->server, 'HTTP_HOST', '');
107
+		$uri = (string) Arr::get($this->server, 'REQUEST_URI', '');
108 108
 
109 109
 		return $protocol . '://' . $host . $uri;
110 110
 	}
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
 		$args = func_get_args();
119 119
 		$source = $this->{$args[0]};
120 120
 
121
-		if ( count( $args ) === 1 ) {
121
+		if (count($args) === 1) {
122 122
 			return $source;
123 123
 		}
124 124
 
125 125
 		$args[0] = $source;
126
-		return call_user_func_array( [Arr::class, 'get'], $args );
126
+		return call_user_func_array([Arr::class, 'get'], $args);
127 127
 	}
128 128
 
129 129
 	/**
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	 * @return mixed
133 133
 	 */
134 134
 	public function get() {
135
-		return call_user_func_array( [$this, 'input'], array_merge( ['get'], func_get_args() ) );
135
+		return call_user_func_array([$this, 'input'], array_merge(['get'], func_get_args()));
136 136
 	}
137 137
 
138 138
 	/**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 	 * @return mixed
142 142
 	 */
143 143
 	public function post() {
144
-		return call_user_func_array( [$this, 'input'], array_merge( ['post'], func_get_args() ) );
144
+		return call_user_func_array([$this, 'input'], array_merge(['post'], func_get_args()));
145 145
 	}
146 146
 
147 147
 	/**
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	 * @return mixed
151 151
 	 */
152 152
 	public function cookie() {
153
-		return call_user_func_array( [$this, 'input'], array_merge( ['cookie'], func_get_args() ) );
153
+		return call_user_func_array([$this, 'input'], array_merge(['cookie'], func_get_args()));
154 154
 	}
155 155
 
156 156
 	/**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 	 * @return mixed
160 160
 	 */
161 161
 	public function files() {
162
-		return call_user_func_array( [$this, 'input'], array_merge( ['files'], func_get_args() ) );
162
+		return call_user_func_array([$this, 'input'], array_merge(['files'], func_get_args()));
163 163
 	}
164 164
 
165 165
 	/**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 	 * @return mixed
169 169
 	 */
170 170
 	public function server() {
171
-		return call_user_func_array( [$this, 'input'], array_merge( ['server'], func_get_args() ) );
171
+		return call_user_func_array([$this, 'input'], array_merge(['server'], func_get_args()));
172 172
 	}
173 173
 
174 174
 	/**
@@ -177,6 +177,6 @@  discard block
 block discarded – undo
177 177
 	 * @return mixed
178 178
 	 */
179 179
 	public function headers() {
180
-		return call_user_func_array( [$this, 'input'], array_merge( ['headers'], func_get_args() ) );
180
+		return call_user_func_array([$this, 'input'], array_merge(['headers'], func_get_args()));
181 181
 	}
182 182
 }
Please login to merge, or discard this patch.
src/Controllers/Controller.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@
 block discarded – undo
19 19
 	/**
20 20
 	 * @see Response::output()
21 21
 	 */
22
-	protected function output( $output ) {
23
-		return Response::output( $this->response(), $output );
22
+	protected function output($output) {
23
+		return Response::output($this->response(), $output);
24 24
 	}
25 25
 
26 26
 	/**
27 27
 	 * @see Response::template()
28 28
 	 */
29
-	protected function template( $templates, $context = array() ) {
30
-		return Response::template( $this->response(), $templates, $context );
29
+	protected function template($templates, $context = array()) {
30
+		return Response::template($this->response(), $templates, $context);
31 31
 	}
32 32
 
33 33
 	/**
34 34
 	 * @see Response::json()
35 35
 	 */
36
-	protected function json( $data ) {
37
-		return Response::json( $this->response(), $data );
36
+	protected function json($data) {
37
+		return Response::json($this->response(), $data);
38 38
 	}
39 39
 
40 40
 	/**
41 41
 	 * @see Response::redirect()
42 42
 	 */
43
-	protected function redirect( $url, $status = 302 ) {
44
-		return Response::redirect( $this->response(), $url, $status );
43
+	protected function redirect($url, $status = 302) {
44
+		return Response::redirect($this->response(), $url, $status);
45 45
 	}
46 46
 
47 47
 	/**
48 48
 	 * @see Response::error()
49 49
 	 */
50
-	protected function error( $code ) {
51
-		return Response::error( $this->response(), $code );
50
+	protected function error($code) {
51
+		return Response::error($this->response(), $code);
52 52
 	}
53 53
 }
Please login to merge, or discard this patch.
src/Routing/Middleware/HasMiddlewareTrait.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
 	 * @param  mixed   $middleware
24 24
 	 * @return boolean
25 25
 	 */
26
-	protected function isMiddleware( $middleware ) {
27
-		if ( is_callable( $middleware ) ) {
26
+	protected function isMiddleware($middleware) {
27
+		if (is_callable($middleware)) {
28 28
 			return true;
29 29
 		}
30 30
 		
31
-		if ( is_a( $middleware, MiddlewareInterface::class, true ) ) {
31
+		if (is_a($middleware, MiddlewareInterface::class, true)) {
32 32
 			return true;
33 33
 		}
34 34
 
@@ -50,16 +50,16 @@  discard block
 block discarded – undo
50 50
 	 * @param  string|callable|\CarbonFramework\Routing\Middleware\MiddlewareInterface|array $middleware
51 51
 	 * @return object
52 52
 	 */
53
-	public function addMiddleware( $middleware ) {
54
-		$middleware = is_array( $middleware ) ? $middleware : [$middleware];
53
+	public function addMiddleware($middleware) {
54
+		$middleware = is_array($middleware) ? $middleware : [$middleware];
55 55
 
56
-		foreach ( $middleware as $item ) {
57
-			if ( ! $this->isMiddleware( $item ) ) {
58
-				throw new Exception( 'Passed middleware must be a callable or the name of a class which implements the ' . MiddlewareInterface::class . ' interface.' );
56
+		foreach ($middleware as $item) {
57
+			if ( ! $this->isMiddleware($item)) {
58
+				throw new Exception('Passed middleware must be a callable or the name of a class which implements the ' . MiddlewareInterface::class . ' interface.');
59 59
 			}
60 60
 		}
61 61
 
62
-		$this->middleware = array_merge( $this->getMiddleware(), $middleware );
62
+		$this->middleware = array_merge($this->getMiddleware(), $middleware);
63 63
 		return $this;
64 64
 	}
65 65
 
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
 	 * @param  string|callable|\CarbonFramework\Routing\Middleware\MiddlewareInterface|array $middleware
70 70
 	 * @return object
71 71
 	 */
72
-	public function add( $middleware ) {
73
-		return $this->addMiddleware( $middleware );
72
+	public function add($middleware) {
73
+		return $this->addMiddleware($middleware);
74 74
 	}
75 75
 
76 76
 	/**
@@ -81,22 +81,22 @@  discard block
 block discarded – undo
81 81
 	 * @param  Closure                                                   $next
82 82
 	 * @return ResponseInterface
83 83
 	 */
84
-	public function executeMiddleware( $middleware, $request, Closure $next ) {
85
-		$top_middleware = array_pop( $middleware );
84
+	public function executeMiddleware($middleware, $request, Closure $next) {
85
+		$top_middleware = array_pop($middleware);
86 86
 
87
-		if ( $top_middleware === null ) {
88
-			return $next( $request );
87
+		if ($top_middleware === null) {
88
+			return $next($request);
89 89
 		}
90 90
 
91
-		$top_middleware_next = function( $request ) use ( $middleware, $next ) {
92
-			return $this->executeMiddleware( $middleware, $request, $next );
91
+		$top_middleware_next = function($request) use ($middleware, $next) {
92
+			return $this->executeMiddleware($middleware, $request, $next);
93 93
 		};
94 94
 
95
-		if ( is_callable( $top_middleware ) ) {
96
-			return call_user_func( $top_middleware, $request, $top_middleware_next );
95
+		if (is_callable($top_middleware)) {
96
+			return call_user_func($top_middleware, $request, $top_middleware_next);
97 97
 		}
98 98
 
99 99
 		$instance = new $top_middleware();
100
-		return $instance->handle( $request, $top_middleware_next );
100
+		return $instance->handle($request, $top_middleware_next);
101 101
 	}
102 102
 }
Please login to merge, or discard this patch.
src/Flash/Flash.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 	 * 
27 27
 	 * @param array|\ArrayAccess $storage
28 28
 	 */
29
-	public function __construct( &$storage ) {
30
-		if ( $this->isValidStorage( $storage ) ) {
31
-			if ( ! isset( $storage[ $this->storage_key ] ) ) {
32
-				$storage[ $this->storage_key ] = [];
29
+	public function __construct(&$storage) {
30
+		if ($this->isValidStorage($storage)) {
31
+			if ( ! isset($storage[$this->storage_key])) {
32
+				$storage[$this->storage_key] = [];
33 33
 			}
34
-			$this->storage = &$storage[ $this->storage_key ];
34
+			$this->storage = &$storage[$this->storage_key];
35 35
 		}
36 36
 	}
37 37
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @param  mixed   $storage
42 42
 	 * @return boolean
43 43
 	 */
44
-	protected function isValidStorage( $storage ) {
44
+	protected function isValidStorage($storage) {
45 45
 		return $storage !== null;
46 46
 	}
47 47
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 	 * @return null
53 53
 	 */
54 54
 	protected function validateStorage() {
55
-		if ( ! $this->isValidStorage( $this->storage ) ) {
56
-			throw new Exception( 'Attempted to use Flash without an active session. Did you forget to call session_start()?' );
55
+		if ( ! $this->isValidStorage($this->storage)) {
56
+			throw new Exception('Attempted to use Flash without an active session. Did you forget to call session_start()?');
57 57
 		}
58 58
 	}
59 59
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return boolean
64 64
 	 */
65 65
 	public function enabled() {
66
-		return $this->isValidStorage( $this->storage );
66
+		return $this->isValidStorage($this->storage);
67 67
 	}
68 68
 
69 69
 	/**
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 	 * @param  string|null $key
73 73
 	 * @return array|\ArrayAccess
74 74
 	 */
75
-	public function get( $key = null ) {
75
+	public function get($key = null) {
76 76
 		$this->validateStorage();
77 77
 
78
-		$items = $this->peek( $key );
79
-		$this->clear( $key );
78
+		$items = $this->peek($key);
79
+		$this->clear($key);
80 80
 		return $items;
81 81
 	}
82 82
 
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
 	 * @param  string|null $key
87 87
 	 * @return array|\ArrayAccess
88 88
 	 */
89
-	public function peek( $key = null ) {
89
+	public function peek($key = null) {
90 90
 		$this->validateStorage();
91 91
 		
92
-		if ( $key === null ) {
92
+		if ($key === null) {
93 93
 			return $this->storage;
94 94
 		}
95 95
 		
96
-		if ( isset( $this->storage[ $key ] ) ) {
97
-			return $this->storage[ $key ];
96
+		if (isset($this->storage[$key])) {
97
+			return $this->storage[$key];
98 98
 		}
99 99
 
100 100
 		return [];
@@ -106,18 +106,18 @@  discard block
 block discarded – undo
106 106
 	 * @param string $key
107 107
 	 * @param mixed  $new_items
108 108
 	 */
109
-	public function add( $key, $new_items ) {
109
+	public function add($key, $new_items) {
110 110
 		$this->validateStorage();
111 111
 		
112
-		$new_items = is_array( $new_items ) ? $new_items : [$new_items];
112
+		$new_items = is_array($new_items) ? $new_items : [$new_items];
113 113
 
114
-		$items = (array) $this->peek( $key );
115
-		$items = array_merge( $items, $new_items );
114
+		$items = (array) $this->peek($key);
115
+		$items = array_merge($items, $new_items);
116 116
 		
117
-		if ( $key === null ) {
117
+		if ($key === null) {
118 118
 			$this->storage = $items;
119 119
 		} else {
120
-			$this->storage[ $key ] = $items;
120
+			$this->storage[$key] = $items;
121 121
 		}
122 122
 	}
123 123
 
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
 	 * @param  string|null $key
128 128
 	 * @return null
129 129
 	 */
130
-	public function clear( $key = null ) {
130
+	public function clear($key = null) {
131 131
 		$this->validateStorage();
132 132
 		
133
-		if ( $key === null ) {
133
+		if ($key === null) {
134 134
 			$this->storage = [];
135 135
 		} else {
136
-			$this->storage[ $key ] = [];
136
+			$this->storage[$key] = [];
137 137
 		}
138 138
 	}
139 139
 }
140 140
\ No newline at end of file
Please login to merge, or discard this patch.
src/Routing/Handler.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 	 * 
23 23
 	 * @param string|Closure $handler
24 24
 	 */
25
-	public function __construct( $handler ) {
26
-		$this->set( $handler );
25
+	public function __construct($handler) {
26
+		$this->set($handler);
27 27
 	}
28 28
 
29 29
 	/**
@@ -32,15 +32,15 @@  discard block
 block discarded – undo
32 32
 	 * @param  string|Closure      $handler
33 33
 	 * @return callable|array|null
34 34
 	 */
35
-	protected function parse( $handler ) {
36
-		if ( $handler instanceof Closure ) {
35
+	protected function parse($handler) {
36
+		if ($handler instanceof Closure) {
37 37
 			return $handler;
38 38
 		}
39 39
 
40
-		if ( is_string( $handler ) )  {
41
-			$handlerPieces = preg_split( '/@|::/', $handler, 2 );
42
-			if ( count( $handlerPieces ) === 1 ) {
43
-				if ( is_callable( $handlerPieces[0] ) ) {
40
+		if (is_string($handler)) {
41
+			$handlerPieces = preg_split('/@|::/', $handler, 2);
42
+			if (count($handlerPieces) === 1) {
43
+				if (is_callable($handlerPieces[0])) {
44 44
 					return $handlerPieces[0];
45 45
 				}
46 46
 				return null;
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 	 * @param  string|Closure $new_handler
61 61
 	 * @return null
62 62
 	 */
63
-	public function set( $new_handler ) {
64
-		$handler = $this->parse( $new_handler );
63
+	public function set($new_handler) {
64
+		$handler = $this->parse($new_handler);
65 65
 
66
-		if ( $handler === null ) {
67
-			throw new Exception( 'No or invalid handler provided.' );
66
+		if ($handler === null) {
67
+			throw new Exception('No or invalid handler provided.');
68 68
 		}
69 69
 
70 70
 		$this->handler = $handler;
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function execute() {
79 79
 		$arguments = func_get_args();
80
-		if ( is_callable( $this->handler ) ) {
81
-			return call_user_func_array( $this->handler, $arguments );
80
+		if (is_callable($this->handler)) {
81
+			return call_user_func_array($this->handler, $arguments);
82 82
 		}
83 83
 
84 84
 		$class = $this->handler['class'];
85 85
 		$method = $this->handler['method'];
86 86
 
87
-		$controller = Framework::instantiate( $class );
88
-		return call_user_func_array( [$controller, $method], $arguments );
87
+		$controller = Framework::instantiate($class);
88
+		return call_user_func_array([$controller, $method], $arguments);
89 89
 	}
90 90
 }
Please login to merge, or discard this patch.
src/Routing/Conditions/PostSlug.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,22 +20,22 @@
 block discarded – undo
20 20
 	 * 
21 21
 	 * @param string $post_slug
22 22
 	 */
23
-	public function __construct( $post_slug ) {
23
+	public function __construct($post_slug) {
24 24
 		$this->post_slug = $post_slug;
25 25
 	}
26 26
 
27 27
 	/**
28 28
 	 * {@inheritDoc}
29 29
 	 */
30
-	public function satisfied( Request $request ) {
30
+	public function satisfied(Request $request) {
31 31
 		$post = get_post();
32
-		return ( $post && $this->post_slug === $post->post_name );
32
+		return ($post && $this->post_slug === $post->post_name);
33 33
 	}
34 34
 
35 35
 	/**
36 36
 	 * {@inheritDoc}
37 37
 	 */
38
-	public function getArguments( Request $request ) {
38
+	public function getArguments(Request $request) {
39 39
 		return [$this->post_slug];
40 40
 	}
41 41
 }
Please login to merge, or discard this patch.