Skip to content

Commit

Permalink
Remove sebastian/exporter dependency.
Browse files Browse the repository at this point in the history
  • Loading branch information
rotimi committed Oct 17, 2022
1 parent 51b6ffc commit 6c742ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=7.4.0",
"sebastian/exporter": "^4.0"
"php": ">=7.4.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
Expand Down
10 changes: 9 additions & 1 deletion src/helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,16 @@ function random_array_keys(array $array, int $number_of_random_keys = 1): array
*
*/
function var_to_string($var): string {

// Start capturing the output
ob_start();

return (new Exporter())->export($var);
var_dump($var);

// Get the captured output, close the buffer & return the captured output
$output = ob_get_clean();

return ($output === false) ? '' : $output;
}

/**
Expand Down

0 comments on commit 6c742ab

Please sign in to comment.