Skip to content

Commit 418e925

Browse files
committed
Remove exportVar and printVars methods
1 parent 5678164 commit 418e925

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

src/Helper/Php.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -100,37 +100,6 @@ public static function callArray($callback, array $args)
100100
return self::call($callback, ...$args);
101101
}
102102

103-
/**
104-
* Print variables
105-
* @param mixed ...$vars
106-
* @return string
107-
*/
108-
public static function printVars(...$vars): string
109-
{
110-
$string = '';
111-
foreach ($vars as $var) {
112-
$string .= print_r($var, true) . PHP_EOL;
113-
}
114-
115-
return (string) preg_replace("/Array\n\s+\(/", 'Array (', $string);
116-
}
117-
118-
/**
119-
* Export variable
120-
* @param mixed $var
121-
* @return string
122-
*/
123-
public static function exportVar($var): string
124-
{
125-
$string = var_export($var, true);
126-
127-
return (string) preg_replace(
128-
'/=>\s+\n\s+array \(/',
129-
'=> array (',
130-
$string
131-
);
132-
}
133-
134103
/**
135104
* Convert an Exception to string
136105
* @param Throwable $err

tests/Helper/PhpTest.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,6 @@ public function testExceptionToArrayDebug(): void
6161
$this->assertEquals(sprintf('at %s line %d', __FILE__, $execptionLine), $res['file']);
6262
}
6363

64-
public function testPrint(): void
65-
{
66-
$expected = 'Array
67-
(
68-
[0] => 1
69-
[1] => 2
70-
[2] => 3
71-
)
72-
' . PHP_EOL;
73-
$this->assertEquals($expected, Php::printVars(...[[1, 2, 3]]));
74-
}
7564

7665
/**
7766
* Data provider for "testCommonMethods"
@@ -124,22 +113,6 @@ public function commonDataProvider(): array
124113
[],
125114
'foobar'
126115
],
127-
[
128-
'exportVar',
129-
[[1, 2, 3]],
130-
[],
131-
'array (
132-
0 => 1,
133-
1 => 2,
134-
2 => 3,
135-
)'
136-
],
137-
[
138-
'exportVar',
139-
[1],
140-
[],
141-
'1'
142-
],
143116
[
144117
'exceptionToString',
145118
[new Exception('Foo Exception', 101)],

0 commit comments

Comments
 (0)