php-parser/test/bootstrap.php

17 lines
347 B
PHP
Raw Normal View History

<?php
namespace PhpParser;
2015-09-16 15:00:44 +02:00
require __DIR__ . '/../vendor/autoload.php';
function canonicalize($str) {
// trim from both sides
$str = trim($str);
// normalize EOL to \n
$str = str_replace(array("\r\n", "\r"), "\n", $str);
// trim right side of all lines
return implode("\n", array_map('rtrim', explode("\n", $str)));
}