Commit ad14938c authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #760 from cviebrock/develop

Fix whitespace issues in laravel/form.php
parents ba088022 1cc33dea
...@@ -8,7 +8,7 @@ class Form { ...@@ -8,7 +8,7 @@ class Form {
* @var array * @var array
*/ */
public static $labels = array(); public static $labels = array();
/** /**
* The registered custom macros. * The registered custom macros.
* *
...@@ -16,13 +16,13 @@ class Form { ...@@ -16,13 +16,13 @@ class Form {
*/ */
public static $macros = array(); public static $macros = array();
/** /**
* Registers a custom macro. * Registers a custom macro.
* *
* @param string $name * @param string $name
* @param Closure $input * @param Closure $input
* @return void * @return void
*/ */
public static function macro($name, $macro) public static function macro($name, $macro)
{ {
static::$macros[$name] = $macro; static::$macros[$name] = $macro;
...@@ -56,7 +56,7 @@ class Form { ...@@ -56,7 +56,7 @@ class Form {
$method = strtoupper($method); $method = strtoupper($method);
$attributes['method'] = static::method($method); $attributes['method'] = static::method($method);
$attributes['action'] = static::action($action, $https); $attributes['action'] = static::action($action, $https);
// If a character encoding has not been specified in the attributes, we will // If a character encoding has not been specified in the attributes, we will
...@@ -128,7 +128,7 @@ class Form { ...@@ -128,7 +128,7 @@ class Form {
* @param array $attributes * @param array $attributes
* @param bool $https * @param bool $https
* @return string * @return string
*/ */
public static function open_for_files($action = null, $method = 'POST', $attributes = array(), $https = null) public static function open_for_files($action = null, $method = 'POST', $attributes = array(), $https = null)
{ {
$attributes['enctype'] = 'multipart/form-data'; $attributes['enctype'] = 'multipart/form-data';
...@@ -143,7 +143,7 @@ class Form { ...@@ -143,7 +143,7 @@ class Form {
* @param string $method * @param string $method
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function open_secure_for_files($action = null, $method = 'POST', $attributes = array()) public static function open_secure_for_files($action = null, $method = 'POST', $attributes = array())
{ {
return static::open_for_files($action, $method, $attributes, true); return static::open_for_files($action, $method, $attributes, true);
...@@ -181,7 +181,7 @@ class Form { ...@@ -181,7 +181,7 @@ class Form {
* @param string $value * @param string $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function label($name, $value, $attributes = array()) public static function label($name, $value, $attributes = array())
{ {
static::$labels[] = $name; static::$labels[] = $name;
...@@ -209,7 +209,7 @@ class Form { ...@@ -209,7 +209,7 @@ class Form {
* @param mixed $value * @param mixed $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function input($type, $name, $value = null, $attributes = array()) public static function input($type, $name, $value = null, $attributes = array())
{ {
$name = (isset($attributes['name'])) ? $attributes['name'] : $name; $name = (isset($attributes['name'])) ? $attributes['name'] : $name;
...@@ -240,7 +240,7 @@ class Form { ...@@ -240,7 +240,7 @@ class Form {
* @param string $name * @param string $name
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function password($name, $attributes = array()) public static function password($name, $attributes = array())
{ {
return static::input('password', $name, null, $attributes); return static::input('password', $name, null, $attributes);
...@@ -266,7 +266,7 @@ class Form { ...@@ -266,7 +266,7 @@ class Form {
* @param string $value * @param string $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function search($name, $value = null, $attributes = array()) public static function search($name, $value = null, $attributes = array())
{ {
return static::input('search', $name, $value, $attributes); return static::input('search', $name, $value, $attributes);
...@@ -279,7 +279,7 @@ class Form { ...@@ -279,7 +279,7 @@ class Form {
* @param string $value * @param string $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function email($name, $value = null, $attributes = array()) public static function email($name, $value = null, $attributes = array())
{ {
return static::input('email', $name, $value, $attributes); return static::input('email', $name, $value, $attributes);
...@@ -305,7 +305,7 @@ class Form { ...@@ -305,7 +305,7 @@ class Form {
* @param string $value * @param string $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function url($name, $value = null, $attributes = array()) public static function url($name, $value = null, $attributes = array())
{ {
return static::input('url', $name, $value, $attributes); return static::input('url', $name, $value, $attributes);
...@@ -318,12 +318,12 @@ class Form { ...@@ -318,12 +318,12 @@ class Form {
* @param string $value * @param string $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function number($name, $value = null, $attributes = array()) public static function number($name, $value = null, $attributes = array())
{ {
return static::input('number', $name, $value, $attributes); return static::input('number', $name, $value, $attributes);
} }
/** /**
* Create a HTML date input element. * Create a HTML date input element.
* *
...@@ -331,7 +331,7 @@ class Form { ...@@ -331,7 +331,7 @@ class Form {
* @param string $value * @param string $value
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function date($name, $value = null, $attributes = array()) public static function date($name, $value = null, $attributes = array())
{ {
return static::input('date', $name, $value, $attributes); return static::input('date', $name, $value, $attributes);
...@@ -343,7 +343,7 @@ class Form { ...@@ -343,7 +343,7 @@ class Form {
* @param string $name * @param string $name
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function file($name, $attributes = array()) public static function file($name, $attributes = array())
{ {
return static::input('file', $name, null, $attributes); return static::input('file', $name, null, $attributes);
...@@ -386,18 +386,18 @@ class Form { ...@@ -386,18 +386,18 @@ class Form {
* @param string $selected * @param string $selected
* @param array $attributes * @param array $attributes
* @return string * @return string
*/ */
public static function select($name, $options = array(), $selected = null, $attributes = array()) public static function select($name, $options = array(), $selected = null, $attributes = array())
{ {
$attributes['id'] = static::id($name, $attributes); $attributes['id'] = static::id($name, $attributes);
$attributes['name'] = $name; $attributes['name'] = $name;
$html = array(); $html = array();
foreach ($options as $value => $display) foreach ($options as $value => $display)
{ {
if (is_array($display)) if (is_array($display))
{ {
$html[] = static::optgroup($display, $value, $selected); $html[] = static::optgroup($display, $value, $selected);
} }
...@@ -607,12 +607,12 @@ class Form { ...@@ -607,12 +607,12 @@ class Form {
*/ */
public static function __callStatic($method, $parameters) public static function __callStatic($method, $parameters)
{ {
if (isset(static::$macros[$method])) if (isset(static::$macros[$method]))
{ {
return call_user_func_array(static::$macros[$method], $parameters); return call_user_func_array(static::$macros[$method], $parameters);
} }
throw new \Exception("Method [$method] does not exist."); throw new \Exception("Method [$method] does not exist.");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment