Skip to content

Commit aaeedce

Browse files
committed
remove string trimming after typecasting #7
1 parent 40368aa commit aaeedce

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
@@ -80,33 +80,8 @@ private function castOutputValues(array $outputs, array $result): array
8080
foreach ($outputs as $output) {
8181
$key = $output->getName();
8282
$value = $output->cast($result[$key]);
83-
$type = $output->getType();
84-
if ($type === IElement::TYPE_STRING
85-
|| $type === IStruct::TYPE_STRUCT
86-
|| $type === ITable::TYPE_TABLE
87-
) {
88-
$value = $this->rtrimStrings($value);
89-
}
9083
$return[$key] = $value;
9184
}
9285
return $return;
9386
}
94-
95-
/**
96-
* Trim all trailing spaces, newlines and null-bytes from strings.
97-
* @param mixed $return
98-
* @return mixed
99-
*/
100-
private function rtrimStrings($return)
101-
{
102-
if (is_string($return)) {
103-
return rtrim($return);
104-
}
105-
if (is_array($return)) {
106-
foreach ($return as $key => $value) {
107-
$return[$key] = $this->rtrimStrings($value);
108-
}
109-
}
110-
return $return;
111-
}
11287
}

0 commit comments

Comments
 (0)