Formatting

Signed-off-by: Adam Engebretson <adam.engebretson@bridgeconx.com>
This commit is contained in:
Adam Engebretson committed 2015-12-01 01:46:08 -06:00
1 parent c772164bff
commit 24d14f259d
6 files changed
+31 -24

No files matched your search

+18 -19
View File
@@ -10,6 +10,7 @@ use Illuminate\Support\Traits\Macroable;
class FormBuilder
{
use Macroable;
/**
@@ -81,8 +82,6 @@ class FormBuilder
* @param \Illuminate\Contracts\Routing\UrlGenerator $url
* @param \Collective\Html\HtmlBuilder $html
* @param string $csrfToken
*
* @return void
*/
public function __construct(HtmlBuilder $html, UrlGenerator $url, $csrfToken)
{
@@ -134,7 +133,7 @@ class FormBuilder
// extra value for the hidden _method field if it's needed for the form.
$attributes = $this->html->attributes($attributes);
return '<form'.$attributes.'>'.$append;
return '<form' . $attributes . '>' . $append;
}
/**
@@ -185,7 +184,7 @@ class FormBuilder
*/
public function token()
{
$token = !empty($this->csrfToken) ? $this->csrfToken : $this->session->getToken();
$token = ! empty($this->csrfToken) ? $this->csrfToken : $this->session->getToken();
return $this->hidden('_token', $token);
}
@@ -207,7 +206,7 @@ class FormBuilder
$value = e($this->formatLabel($name, $value));
return '<label for="'.$name.'"'.$options.'>'.$value.'</label>';
return '<label for="' . $name . '"' . $options . '>' . $value . '</label>';
}
/**
@@ -235,7 +234,7 @@ class FormBuilder
*/
public function input($type, $name, $value = null, $options = [])
{
if (!isset($options['name'])) {
if ( ! isset($options['name'])) {
$options['name'] = $name;
}
@@ -244,7 +243,7 @@ class FormBuilder
// in the model instance if one is set. Otherwise we will just use empty.
$id = $this->getIdAttribute($name, $options);
if (!in_array($type, $this->skipValueTypes)) {
if ( ! in_array($type, $this->skipValueTypes)) {
$value = $this->getValueAttribute($name, $value);
}
@@ -255,7 +254,7 @@ class FormBuilder
$options = array_merge($options, $merge);
return '<input'.$this->html->attributes($options).'>';
return '<input' . $this->html->attributes($options) . '>';
}
/**
@@ -447,7 +446,7 @@ class FormBuilder
*/
public function textarea($name, $value = null, $options = [])
{
if (!isset($options['name'])) {
if ( ! isset($options['name'])) {
$options['name'] = $name;
}
@@ -467,7 +466,7 @@ class FormBuilder
// the element. Then we'll create the final textarea elements HTML for us.
$options = $this->html->attributes($options);
return '<textarea'.$options.'>'.e($value).'</textarea>';
return '<textarea' . $options . '>' . e($value) . '</textarea>';
}
/**
@@ -526,7 +525,7 @@ class FormBuilder
$options['id'] = $this->getIdAttribute($name, $options);
if (!isset($options['name'])) {
if ( ! isset($options['name'])) {
$options['name'] = $name;
}
@@ -644,7 +643,7 @@ class FormBuilder
$html[] = $this->option($display, $value, $selected);
}
return '<optgroup label="'.e($label).'">'.implode('', $html).'</optgroup>';
return '<optgroup label="' . e($label) . '">' . implode('', $html) . '</optgroup>';
}
/**
@@ -662,7 +661,7 @@ class FormBuilder
$options = ['value' => $value, 'selected' => $selected];
return '<option'.$this->html->attributes($options).'>'.e($display).'</option>';
return '<option' . $this->html->attributes($options) . '>' . e($display) . '</option>';
}
/**
@@ -680,7 +679,7 @@ class FormBuilder
$options = compact('selected');
$options['value'] = '';
return '<option'.$this->html->attributes($options).'>'.e($display).'</option>';
return '<option' . $this->html->attributes($options) . '>' . e($display) . '</option>';
}
/**
@@ -791,7 +790,7 @@ class FormBuilder
*/
protected function getCheckboxCheckedState($name, $value, $checked)
{
if (isset($this->session) && !$this->oldInputIsEmpty() && is_null($this->old($name))) {
if (isset($this->session) && ! $this->oldInputIsEmpty() && is_null($this->old($name))) {
return false;
}
@@ -906,11 +905,11 @@ class FormBuilder
*/
public function button($value = null, $options = [])
{
if (!array_key_exists('type', $options)) {
if ( ! array_key_exists('type', $options)) {
$options['type'] = 'button';
}
return '<button'.$this->html->attributes($options).'>'.$value.'</button>';
return '<button' . $this->html->attributes($options) . '>' . $value . '</button>';
}
/**
@@ -1066,11 +1065,11 @@ class FormBuilder
return $value;
}
if (!is_null($this->old($name))) {
if ( ! is_null($this->old($name))) {
return $this->old($name);
}
if (!is_null($value)) {
if ( ! is_null($value)) {
return $value;
}
+1
View File
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Facade;
*/
class FormFacade extends Facade
{
/**
* Get the registered name of the component.
*
+6 -1
View File
@@ -495,6 +495,7 @@ class HtmlBuilder
* @param $name
* @param $view
* @param array $signature
*
* @return void
*/
public static function component($name, $view, array $signature)
@@ -506,6 +507,7 @@ class HtmlBuilder
* Check if a component is registered.
*
* @param $name
*
* @return bool
*/
public static function hasComponent($name)
@@ -518,6 +520,7 @@ class HtmlBuilder
*
* @param $name
* @param array $arguments
*
* @return \Illuminate\Contracts\View\View
*/
protected function renderComponent($name, array $arguments)
@@ -533,6 +536,7 @@ class HtmlBuilder
*
* @param array $signature
* @param array $arguments
*
* @return array
*/
protected function getComponentData(array $signature, array $arguments)
@@ -540,7 +544,7 @@ class HtmlBuilder
$data = [];
$i = 0;
foreach($signature as $variable => $default) {
foreach ($signature as $variable => $default) {
// If the "variable" value is actually a numeric key, we can assume that
// no default had been specified for the component argument and we'll
// just use null instead, so that we can treat them all the same.
@@ -562,6 +566,7 @@ class HtmlBuilder
*
* @param string $method
* @param array $parameters
*
* @return \Illuminate\Contracts\View\View|mixed
*
* @throws \BadMethodCallException
+1
View File
@@ -9,6 +9,7 @@ use Illuminate\Support\Facades\Facade;
*/
class HtmlFacade extends Facade
{
/**
* Get the registered name of the component.
*
+1
View File
@@ -6,6 +6,7 @@ use Illuminate\Support\ServiceProvider;
class HtmlServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
+4 -4
View File
@@ -1,6 +1,6 @@
<?php
if (!function_exists('link_to')) {
if ( ! function_exists('link_to')) {
/**
* Generate a HTML link.
*
@@ -17,7 +17,7 @@ if (!function_exists('link_to')) {
}
}
if (!function_exists('link_to_asset')) {
if ( ! function_exists('link_to_asset')) {
/**
* Generate a HTML link to an asset.
*
@@ -34,7 +34,7 @@ if (!function_exists('link_to_asset')) {
}
}
if (!function_exists('link_to_route')) {
if ( ! function_exists('link_to_route')) {
/**
* Generate a HTML link to a named route.
*
@@ -51,7 +51,7 @@ if (!function_exists('link_to_route')) {
}
}
if (!function_exists('link_to_action')) {
if ( ! function_exists('link_to_action')) {
/**
* Generate a HTML link to a controller action.
*