Completed
Branch master (d79e68)
by Ben
02:17
created
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/Checkable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -411,7 +411,7 @@
 block discarded – undo
411 411
 		$this->app['former']->labels[] = $name;
412 412
 
413 413
 		// Count number of fields with the same ID
414
-		$where  = array_filter($this->app['former']->labels, function ($label) use ($name) {
414
+		$where  = array_filter($this->app['former']->labels, function($label) use ($name) {
415 415
 			return $label == $name;
416 416
 		});
417 417
 		$unique = sizeof($where);
Please login to merge, or discard this patch.
src/Former/Traits/Field.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -258,49 +258,49 @@
 block discarded – undo
258 258
 		return $this;
259 259
 	}
260 260
 
261
-    /**
262
-     * Apply multiple rules passed as a string.
263
-     *
264
-     * @param $rules
265
-     * @return $this
266
-     */
267
-    public function rules($rules)
268
-    {
269
-        if (!is_array($rules)) {
270
-            $rules = explode('|', $rules);
271
-        }
272
-
273
-        foreach ($rules as $rule) {
274
-            $parameters = null;
275
-
276
-            // If we have a rule with a value
277
-            if (($colon = strpos($rule, ':')) !== false) {
278
-                $rulename = substr($rule, 0, $colon) ;
279
-
280
-                /**
281
-                * Regular expressions may contain commas and should not be divided by str_getcsv.
282
-                * For regular expressions we are just using the complete expression as a parameter.
283
-                */
284
-                if ($rulename !== 'regex') {
285
-                    $parameters = str_getcsv(substr($rule, $colon + 1));
286
-                } else {
287
-                    $parameters = [substr($rule, $colon + 1)];
288
-                }
289
-            }
290
-
291
-            // Exclude unsupported rules
292
-            $rule = is_numeric($colon) ? substr($rule, 0, $colon) : $rule;
293
-
294
-            // Store processed rule in Former's array
295
-            if (!isset($parameters)) {
296
-                $parameters = array();
297
-            }
298
-
299
-            call_user_func_array([$this, 'rule'], array_merge([$rule], $parameters));
300
-        }
301
-
302
-        return $this;
303
-    }
261
+	/**
262
+	 * Apply multiple rules passed as a string.
263
+	 *
264
+	 * @param $rules
265
+	 * @return $this
266
+	 */
267
+	public function rules($rules)
268
+	{
269
+		if (!is_array($rules)) {
270
+			$rules = explode('|', $rules);
271
+		}
272
+
273
+		foreach ($rules as $rule) {
274
+			$parameters = null;
275
+
276
+			// If we have a rule with a value
277
+			if (($colon = strpos($rule, ':')) !== false) {
278
+				$rulename = substr($rule, 0, $colon) ;
279
+
280
+				/**
281
+				 * Regular expressions may contain commas and should not be divided by str_getcsv.
282
+				 * For regular expressions we are just using the complete expression as a parameter.
283
+				 */
284
+				if ($rulename !== 'regex') {
285
+					$parameters = str_getcsv(substr($rule, $colon + 1));
286
+				} else {
287
+					$parameters = [substr($rule, $colon + 1)];
288
+				}
289
+			}
290
+
291
+			// Exclude unsupported rules
292
+			$rule = is_numeric($colon) ? substr($rule, 0, $colon) : $rule;
293
+
294
+			// Store processed rule in Former's array
295
+			if (!isset($parameters)) {
296
+				$parameters = array();
297
+			}
298
+
299
+			call_user_func_array([$this, 'rule'], array_merge([$rule], $parameters));
300
+		}
301
+
302
+		return $this;
303
+	}
304 304
 
305 305
 	/**
306 306
 	 * Adds a label to the group/field
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@
 block discarded – undo
275 275
 
276 276
             // If we have a rule with a value
277 277
             if (($colon = strpos($rule, ':')) !== false) {
278
-                $rulename = substr($rule, 0, $colon) ;
278
+                $rulename = substr($rule, 0, $colon);
279 279
 
280 280
                 /**
281 281
                 * Regular expressions may contain commas and should not be divided by str_getcsv.
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/Framework/TwitterBootstrap3.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@
 block discarded – undo
139 139
 		$classes = array_intersect($classes, $this->fields);
140 140
 
141 141
 		// Prepend field type
142
-		$classes = array_map(function ($class) {
142
+		$classes = array_map(function($class) {
143 143
 			return Str::startsWith($class, 'col') ? $class : 'input-'.$class;
144 144
 		}, $classes);
145 145
 
Please login to merge, or discard this patch.
src/Former/Framework/TwitterBootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
 		$classes = array_intersect($classes, $this->fields);
125 125
 
126 126
 		// Prepend field type
127
-		$classes = array_map(function ($class) {
127
+		$classes = array_map(function($class) {
128 128
 			return Str::startsWith($class, 'span') ? $class : 'input-'.$class;
129 129
 		}, $classes);
130 130
 
Please login to merge, or discard this patch.
src/Former/Framework/ZurbFoundation.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
 	 *
127 127
 	 * @param Field $field
128 128
 	 *
129
-	 * @return Element
129
+	 * @return Input
130 130
 	 */
131 131
 	public function createPlainTextField(Field $field)
132 132
 	{
Please login to merge, or discard this patch.
src/Former/Framework/ZurbFoundation4.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
 	 *
127 127
 	 * @param Field $field
128 128
 	 *
129
-	 * @return Element
129
+	 * @return Input
130 130
 	 */
131 131
 	public function createPlainTextField(Field $field)
132 132
 	{
Please login to merge, or discard this patch.