8000 Casting TableCell value to string. by jaydiablo · Pull Request #21430 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Casting TableCell value to string. #21430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moving cast to constructor, updating docblock
  • Loading branch information
jaydiablo committed Jan 27, 2017
commit f5187c58257c436690463cdc020821a05cf83b14
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Helper/TableCell.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class TableCell
);

/**
* @param string $value
* @param string|int|float $value
* @param array $options
*/
public function __construct($value = '', array $options = array())
{
$this->value = $value;
$this->value = (string) $value;

// check option names
if ($diff = array_diff(array_keys($options), array_keys($this->options))) {
Expand All @@ -52,7 +52,7 @@ public function __construct($value = '', array $options = array())
*/
public function __toString()
{
return (string) $this->value;
return $this->value;
}

/**
Expand Down
0