-
Notifications
You must be signed in to change notification settings - Fork 16
/
OutputCleaner.php
21 lines (18 loc) 路 995 Bytes
/
OutputCleaner.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
namespace Castor\Tests\Helper;
final class OutputCleaner
{
public static function cleanOutput(string $string): string
{
$string = str_replace("\r\n", "\n", $string);
// In the bash completion script 脳2
$string = str_replace('_sf_castor.linux-amd64.phar', '_sf_castor', $string);
$string = str_replace('castor.linux-amd64.phar', 'castor', $string);
$string = preg_replace('{In functions.php line \d+:}m', 'In functions.php line XXXX:', $string);
$string = preg_replace('{In Process.php line \d+:}m', 'In Process.php line XXXX:', $string);
$string = preg_replace('{In ContextRegistry.php line \d+:}m', 'In ContextRegistry.php line XXXX:', $string);
$string = preg_replace('{you are using v\d+.\d+.\d+.}m', 'you are using vX.Y.Z.', $string);
$string = preg_replace('{you are using v\d+.\d+.\d+.}m', 'you are using vX.Y.Z.', $string);
return str_replace(\dirname(__DIR__, 2), '...', $string);
}
}