Skip to content

Commit f3f6787

Browse files
committed
remove string trimming after typecasting #7
1 parent 3ee08b9 commit f3f6787

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

src/Traits/ParamTrait.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -74,33 +74,8 @@ private function castOutputValues(array $outputs, array $result): array
7474
foreach ($outputs as $output) {
7575
$key = $output->getName();
7676
$value = $output->cast($result[$key]);
77-
$type = $output->getType();
78-
if (
79-
$type === IElement::TYPE_STRING
80-
|| $type === IArray::TYPE_ARRAY
81-
) {
82-
$value = $this->rtrimStrings($value);
83-
}
8477
$return[$key] = $value;
8578
}
8679
return $return;
8780
}
88-
89-
/**
90-
* Trim all trailing spaces, newlines and null-bytes from strings.
91-
* @param mixed $return
92-
* @return mixed
93-
*/
94-
private function rtrimStrings($return)
95-
{
96-
if (is_string($return)) {
97-
return rtrim($return);
98-
}
99-
if (is_array($return)) {
100-
foreach ($return as $key => $value) {
101-
$return[$key] = $this->rtrimStrings($value);
102-
}
103-
}
104-
return $return;
105-
}
10681
}

0 commit comments

Comments
 (0)