Completed
Push — master ( eae1b4...9509a8 )
by Ben
02:36
created
src/Former/Exceptions/InvalidFrameworkException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php namespace Former\Exceptions;
2 2
 
3
-class InvalidFrameworkException extends \RuntimeException{
3
+class InvalidFrameworkException extends \RuntimeException {
4 4
 
5 5
 	/**
6 6
 	 * reference to framework class
Please login to merge, or discard this patch.
src/Former/Helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		//Convert parametrs of old format to new format
128 128
 		if (!is_callable($text)) {
129 129
 			$optionTextValue = $text;
130
-			$text = function ($model) use($optionTextValue) {
130
+			$text = function($model) use($optionTextValue) {
131 131
 				if ($optionTextValue and isset($model->$optionTextValue)) {
132 132
 					return $model->$optionTextValue;
133 133
 				} elseif (method_exists($model, '__toString')) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 					$optionAttributeValue = $modelAttributeName($model);
173 173
 				} elseif ($modelAttributeName and isset($model->$modelAttributeName)) {
174 174
 					$optionAttributeValue = $model->$modelAttributeName;
175
-				} elseif($optionAttributeName === 'value') {
175
+				} elseif ($optionAttributeName === 'value') {
176 176
 					//For backward compatibility
177 177
 					if (method_exists($model, 'getKey')) {
178 178
 						$optionAttributeValue = $model->getKey();
Please login to merge, or discard this patch.
src/Former/Form/Actions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 	 */
52 52
 	public function getContent()
53 53
 	{
54
-		$content = array_map(function ($content) {
54
+		$content = array_map(function($content) {
55 55
 			return method_exists($content, '__toString') ? (string) $content : $content;
56 56
 		}, $this->value);
57 57
 
Please login to merge, or discard this patch.
src/Former/Form/Fields/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 			$this->name .= '[]';
91 91
 		}
92 92
 
93
-		if ( ! $this->value instanceOf \ArrayAccess) {
93
+		if (!$this->value instanceOf \ArrayAccess) {
94 94
 			$this->value = (array) $this->value;
95 95
 		}
96 96
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		foreach ($parent->getChildren() as $child) {
133 133
 			// Search by value
134 134
 
135
-			if ($child->getAttribute('value') === $value || is_numeric($value) && $child->getAttribute('value') === (int)$value ) {
135
+			if ($child->getAttribute('value') === $value || is_numeric($value) && $child->getAttribute('value') === (int) $value) {
136 136
 				$child->selected('selected');
137 137
 			}
138 138
 
Please login to merge, or discard this patch.
src/Former/Form/Form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 		$this->url       = $url;
97 97
 		$this->populator = $populator;
98 98
 
99
-		$this->app->singleton('former.form.framework', function ($app) {
99
+		$this->app->singleton('former.form.framework', function($app) {
100 100
 			return clone $app['former.framework'];
101 101
 		});
102 102
 	}
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 
403 403
 		// If raw form
404 404
 		if ($type == 'raw') {
405
-			$this->app->bind('former.form.framework', function ($app) {
405
+			$this->app->bind('former.form.framework', function($app) {
406 406
 				return $app['former']->getFrameworkInstance('Nude');
407 407
 			});
408 408
 		}
Please login to merge, or discard this patch.
src/Former/Former.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		$this->setOption('framework', $framework);
354 354
 
355 355
 		$framework = $this->getFrameworkInstance($framework);
356
-		$this->app->bind('former.framework', function ($app) use ($framework) {
356
+		$this->app->bind('former.framework', function($app) use ($framework) {
357 357
 			return $framework;
358 358
 		});
359 359
 	}
@@ -373,9 +373,9 @@  discard block
 block discarded – undo
373 373
 		//get interfaces of the given framework
374 374
 		$interfaces = class_exists($framework) ? class_implements($framework) : array();
375 375
 
376
-		if(class_exists($formerClass)) {
376
+		if (class_exists($formerClass)) {
377 377
 			$returnClass = $formerClass;
378
-		} elseif(class_exists($framework) && isset($interfaces['Former\Interfaces\FrameworkInterface'])) {
378
+		} elseif (class_exists($framework) && isset($interfaces['Former\Interfaces\FrameworkInterface'])) {
379 379
 			// We have some outside class, lets return it.
380 380
 			$returnClass = $framework;
381 381
 		} else {
Please login to merge, or discard this patch.
src/Former/Traits/Framework.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 	 */
240 240
 	protected function prependWith($classes, $with)
241 241
 	{
242
-		return array_map(function ($class) use ($with) {
242
+		return array_map(function($class) use ($with) {
243 243
 			return $with.$class;
244 244
 		}, $classes);
245 245
 	}
Please login to merge, or discard this patch.
src/Former/Traits/FormerObject.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 		if (array_key_exists($name, $names)) {
77 77
 			$count = $names[$name] + 1;
78 78
 			$names[$name] = $count;
79
-			return $name . '-' . $count;
79
+			return $name.'-'.$count;
80 80
 		}
81 81
 
82 82
 		$names[$name] = 1;
Please login to merge, or discard this patch.
src/Former/FormerServiceProvider.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -90,15 +90,15 @@  discard block
 block discarded – undo
90 90
 		// Session and request
91 91
 		//////////////////////////////////////////////////////////////////
92 92
 
93
-		$app->bindIf('session.manager', function ($app) {
93
+		$app->bindIf('session.manager', function($app) {
94 94
 			return new SessionManager($app);
95 95
 		});
96 96
 
97
-		$app->bindIf('session', function ($app) {
97
+		$app->bindIf('session', function($app) {
98 98
 			return $app['session.manager']->driver('array');
99 99
 		}, true);
100 100
 
101
-		$app->bindIf('request', function ($app) {
101
+		$app->bindIf('request', function($app) {
102 102
 			$request = Request::createFromGlobals();
103 103
 			if (method_exists($request, 'setSessionStore')) {
104 104
 				$request->setSessionStore($app['session']);
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
 		// Config
113 113
 		//////////////////////////////////////////////////////////////////
114 114
 
115
-		$app->bindIf('path.config', function ($app) {
116
-			return __DIR__ . '/../config/';
115
+		$app->bindIf('path.config', function($app) {
116
+			return __DIR__.'/../config/';
117 117
 		}, true);
118 118
 
119
-		$app->bindIf('config', function ($app) {
119
+		$app->bindIf('config', function($app) {
120 120
 			$config = new Repository;
121 121
 			$this->loadConfigurationFiles($app, $config);
122 122
 			return $config;
@@ -125,11 +125,11 @@  discard block
 block discarded – undo
125 125
 		// Localization
126 126
 		//////////////////////////////////////////////////////////////////
127 127
 
128
-		$app->bindIf('translation.loader', function ($app) {
128
+		$app->bindIf('translation.loader', function($app) {
129 129
 			return new FileLoader($app['files'], 'src/config');
130 130
 		});
131 131
 
132
-		$app->bindIf('translator', function ($app) {
132
+		$app->bindIf('translator', function($app) {
133 133
 			$loader = new FileLoader($app['files'], 'lang');
134 134
 
135 135
 			return new Translator($loader, 'fr');
@@ -181,25 +181,25 @@  discard block
 block discarded – undo
181 181
 	public function bindFormer(Container $app)
182 182
 	{
183 183
 		// Add config namespace
184
-		$configPath = __DIR__ . '/../config/former.php';
184
+		$configPath = __DIR__.'/../config/former.php';
185 185
 		$this->mergeConfigFrom($configPath, 'former');
186
-		$this->publishes([$configPath => $app['path.config'] . '/former.php']);
186
+		$this->publishes([$configPath => $app['path.config'].'/former.php']);
187 187
 		
188 188
 		$framework = $app['config']->get('former.framework');
189 189
 		
190
-		$app->bind('former.framework', function ($app) {
190
+		$app->bind('former.framework', function($app) {
191 191
 			return $app['former']->getFrameworkInstance($app['config']->get('former.framework'));
192 192
 		});
193 193
 
194
-		$app->singleton('former.populator', function ($app) {
194
+		$app->singleton('former.populator', function($app) {
195 195
 			return new Populator();
196 196
 		});
197 197
 
198
-		$app->singleton('former.dispatcher', function ($app) {
198
+		$app->singleton('former.dispatcher', function($app) {
199 199
 			return new MethodDispatcher($app, Former::FIELDSPACE);
200 200
 		});
201 201
 
202
-		$app->singleton('former', function ($app) {
202
+		$app->singleton('former', function($app) {
203 203
 			return new Former($app, $app->make('former.dispatcher'));
204 204
 		});
205 205
 		$app->alias('former', 'Former\Former');
Please login to merge, or discard this patch.