Style fixes. Replaced == with ===.

This commit is contained in:
Drew committed 2017-09-18 16:28:31 -07:00
1 parent f380cdc14d
commit b4c0a3e26d
3 files changed
+17 -17

No files matched your search

+1 -1
View File
@@ -87,7 +87,7 @@ trait FormAccessible
$mutator = collect($methods) $mutator = collect($methods)
->first(function (ReflectionMethod $method) use ($key) { ->first(function (ReflectionMethod $method) use ($key) {
return $method->getName() == 'form' . Str::studly($key) . 'Attribute'; return $method->getName() === 'form' . Str::studly($key) . 'Attribute';
}); });
return (bool) $mutator; return (bool) $mutator;
+14 -14
View File
@@ -775,7 +775,7 @@ class FormBuilder
return $selected->contains($value) ? 'selected' : null; return $selected->contains($value) ? 'selected' : null;
} }
return ((string) $value == (string) $selected) ? 'selected' : null; return ((string) $value === (string) $selected) ? 'selected' : null;
} }
/** /**
@@ -856,7 +856,7 @@ class FormBuilder
return $this->getRadioCheckedState($name, $value, $checked); return $this->getRadioCheckedState($name, $value, $checked);
default: default:
return $this->getValueAttribute($name) == $value; return $this->getValueAttribute($name) === $value;
} }
} }
@@ -909,7 +909,7 @@ class FormBuilder
return $checked; return $checked;
} }
return $this->getValueAttribute($name) == $value; return $this->getValueAttribute($name) === $value;
} }
/** /**
@@ -1008,7 +1008,7 @@ class FormBuilder
{ {
$method = strtoupper($method); $method = strtoupper($method);
return $method != 'GET' ? 'POST' : $method; return $method !== 'GET' ? 'POST' : $method;
} }
/** /**
@@ -1110,7 +1110,7 @@ class FormBuilder
// If the method is something other than GET we will go ahead and attach the // If the method is something other than GET we will go ahead and attach the
// CSRF token to the form, as this can't hurt and is convenient to simply // CSRF token to the form, as this can't hurt and is convenient to simply
// always have available on every form the developers creates for them. // always have available on every form the developers creates for them.
if ($method != 'GET') { if ($method !== 'GET') {
$appendage .= $this->token(); $appendage .= $this->token();
} }
@@ -1152,7 +1152,7 @@ class FormBuilder
$old = $this->old($name); $old = $this->old($name);
if (! is_null($old) && $name != '_method') { if (! is_null($old) && $name !== '_method') {
return $old; return $old;
} }
@@ -1163,7 +1163,7 @@ class FormBuilder
if ($hasNullMiddleware if ($hasNullMiddleware
&& is_null($old) && is_null($old)
&& is_null($value) && is_null($value)
&& !is_null($this->view->shared('errors')) && ! is_null($this->view->shared('errors'))
&& count($this->view->shared('errors')) > 0 && count($this->view->shared('errors')) > 0
) { ) {
return null; return null;
@@ -1171,7 +1171,7 @@ class FormBuilder
} }
$request = $this->request($name); $request = $this->request($name);
if (!is_null($request)) { if (! is_null($request)) {
return $request; return $request;
} }
@@ -1191,7 +1191,7 @@ class FormBuilder
*/ */
protected function request($name) protected function request($name)
{ {
if (!isset($this->request)) { if (! isset($this->request)) {
return null; return null;
} }
@@ -1229,16 +1229,16 @@ class FormBuilder
$key = $this->transformKey($name); $key = $this->transformKey($name);
$payload = $this->session->getOldInput($key); $payload = $this->session->getOldInput($key);
if (!is_array($payload)) { if (! is_array($payload)) {
return $payload; return $payload;
} }
if (!in_array($this->type, ['select', 'checkbox'])) { if (! in_array($this->type, ['select', 'checkbox'])) {
if (!isset($this->payload[$key])) { if (! isset($this->payload[$key])) {
$this->payload[$key] = collect($payload); $this->payload[$key] = collect($payload);
} }
if (!empty($this->payload[$key])) { if (! empty($this->payload[$key])) {
$value = $this->payload[$key]->shift(); $value = $this->payload[$key]->shift();
return $value; return $value;
} }
@@ -1255,7 +1255,7 @@ class FormBuilder
*/ */
public function oldInputIsEmpty() public function oldInputIsEmpty()
{ {
return (isset($this->session) && count($this->session->getOldInput()) == 0); return (isset($this->session) && count($this->session->getOldInput()) === 0);
} }
/** /**
+2 -2
View File
@@ -357,7 +357,7 @@ class HtmlBuilder
{ {
$html = ''; $html = '';
if (count($list) == 0) { if (count($list) === 0) {
return $html; return $html;
} }
@@ -451,7 +451,7 @@ class HtmlBuilder
} }
// Treat boolean attributes as HTML properties // Treat boolean attributes as HTML properties
if (is_bool($value) && $key != 'value') { if (is_bool($value) && $key !== 'value') {
return $value ? $key : ''; return $value ? $key : '';
} }