Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit def74f7

Browse filesBrowse files
Minor refactor of WireArray::__toString() method
1 parent 7a85039 commit def74f7
Copy full SHA for def74f7

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed

‎wire/core/WireArray.php

Copy file name to clipboardExpand all lines: wire/core/WireArray.php
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1934,13 +1934,15 @@ public function offsetExists($offset) {
19341934
*
19351935
*/
19361936
public function __toString() {
1937-
$s = '';
1938-
foreach($this as $value) {
1937+
$values = array();
1938+
foreach($this->data as $value) {
19391939
if(is_array($value)) $value = "array(" . count($value) . ")";
1940-
$s .= "$value|";
1940+
$value = (string) $value;
1941+
if(!strlen($value)) continue;
1942+
if(strpos($value, '|') !== false) $value = str_replace('|', ' ', $value);
1943+
$values[] = $value;
19411944
}
1942-
$s = rtrim($s, '|');
1943-
return $s;
1945+
return implode('|', $values);
19441946
}
19451947

19461948
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.