Skip to content

Commit

Permalink
[#14696] - Corrections to tests and value manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Jan 11, 2020
1 parent ea9d760 commit a6081fa
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion phalcon/Html/Helper/Base.zep
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Base extends AbstractHelper
* @return string
* @throws Exception
*/
public function __invoke(string href, array attributes = []) -> string
public function __invoke(string href = null, array attributes = []) -> string
{
var overrides = [];

Expand Down
2 changes: 1 addition & 1 deletion phalcon/Html/Helper/Close.zep
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class Close extends AbstractHelper
*/
public function __invoke(string tag, bool raw = false) -> string
{
return $this->close(tag, raw);
return this->close(tag, raw);
}
}
4 changes: 2 additions & 2 deletions phalcon/Html/Helper/Input/AbstractInput.zep
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class AbstractInput extends AbstractHelper
let this->attributes["id"] = name;
}

this->setValue($value);
this->setValue(value);

let this->attributes = array_merge(this->attributes, attributes);

Expand Down Expand Up @@ -87,7 +87,7 @@ abstract class AbstractInput extends AbstractHelper
*/
public function setValue(string value = null) -> <AbstractInput>
{
if !empty value {
if is_numeric(value) || !empty(value) {
let this->attributes["value"] = value;
}

Expand Down
6 changes: 3 additions & 3 deletions phalcon/Html/Helper/Input/Checkbox.zep
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

namespace Phalcon\Html\Helper\Input;

use Phalcon\Escaper\EscaperInterface;
use Phalcon\Helper\Arr;
use Phalcon\Html\Escaper;

/**
* Class Checkbox
Expand All @@ -33,7 +33,7 @@ class Checkbox extends AbstractInput
/**
* AbstractHelper constructor.
*
* @param Escaper $escaper
* @param EscaperInterface $escaper
*/
public function __construct(<EscaperInterface> escaper)
{
Expand All @@ -57,7 +57,7 @@ class Checkbox extends AbstractInput

this->processChecked();

let unchecked = $this->processUnchecked(),
let unchecked = this->processUnchecked(),
element = parent::__toString(),
label = this->label,
this->label = [
Expand Down
14 changes: 7 additions & 7 deletions phalcon/Html/Helper/Input/Select.zep
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ class Select extends AbstractList
*/
public function addPlaceholder(
string text,
string value = null,
var value = null,
array attributes = [],
bool raw = false
) -> <Select> {
if !empty value {
let attributes["value"] = value;
if null !== value {
let attributes["value"] = (string) value;
}

let this->store[] = [
Expand Down Expand Up @@ -129,13 +129,13 @@ class Select extends AbstractList
this->store[] = [
"optGroupEnd",
[],
$this->indent()
this->indent()
];
}

let this->inOptGroup = !this->inOptGroup;

return $this;
return this;
}

/**
Expand Down Expand Up @@ -192,9 +192,9 @@ class Select extends AbstractList
*/
private function processValue(
array attributes,
string value = null
var value = null
) -> array {
if !empty value {
if is_numeric(value) || !empty(value) {
let attributes["value"] = value;
if !empty this->selected && value === this->selected {
let attributes["selected"] = "selected";
Expand Down

0 comments on commit a6081fa

Please sign in to comment.