X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FFormOptions.php;h=5e5e8d4011a0d02765e525a80ec2969594e7c37c;hb=2873ccba9464db79bc7d6b0e5cd330703b919235;hp=079267a246827126f9b1ae61060782a438e1fe05;hpb=2b8254b2b5f5d1a698f298204410f22a393ab9fb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/FormOptions.php b/includes/FormOptions.php index 079267a246..5e5e8d4011 100644 --- a/includes/FormOptions.php +++ b/includes/FormOptions.php @@ -64,7 +64,7 @@ class FormOptions implements ArrayAccess { * consumeValue() or consumeValues() * - 'type' - one of the type constants (but never AUTO) */ - protected $options = array(); + protected $options = []; # Setting up @@ -76,7 +76,7 @@ class FormOptions implements ArrayAccess { * @param int $type One of the type constants (optional, defaults to AUTO) */ public function add( $name, $default, $type = self::AUTO ) { - $option = array(); + $option = []; $option['default'] = $default; $option['value'] = null; $option['consumed'] = false; @@ -228,7 +228,7 @@ class FormOptions implements ArrayAccess { * @return array Array of option values, or the default values if they are null */ public function consumeValues( $names ) { - $out = array(); + $out = []; foreach ( $names as $name ) { $this->validateName( $name, true ); @@ -278,7 +278,7 @@ class FormOptions implements ArrayAccess { * @return array */ public function getUnconsumedValues( $all = false ) { - $values = array(); + $values = []; foreach ( $this->options as $name => $data ) { if ( !$data['consumed'] ) { @@ -296,7 +296,7 @@ class FormOptions implements ArrayAccess { * @return array */ public function getChangedValues() { - $values = array(); + $values = []; foreach ( $this->options as $name => $data ) { if ( $data['value'] !== null ) { @@ -312,7 +312,7 @@ class FormOptions implements ArrayAccess { * @return array */ public function getAllValues() { - $values = array(); + $values = []; foreach ( $this->options as $name => $data ) { $values[$name] = $this->getValueReal( $data ); @@ -375,6 +375,7 @@ class FormOptions implements ArrayAccess { /* @{ */ /** * Whether the option exists. + * @param string $name * @return bool */ public function offsetExists( $name ) { @@ -383,6 +384,7 @@ class FormOptions implements ArrayAccess { /** * Retrieve an option value. + * @param string $name * @return mixed */ public function offsetGet( $name ) { @@ -391,6 +393,8 @@ class FormOptions implements ArrayAccess { /** * Set an option to given value. + * @param string $name + * @param mixed $value */ public function offsetSet( $name, $value ) { $this->setValue( $name, $value ); @@ -398,6 +402,7 @@ class FormOptions implements ArrayAccess { /** * Delete the option. + * @param string $name */ public function offsetUnset( $name ) { $this->delete( $name );