Blame view

vendor/nikic/php-parser/test/bootstrap.php 347 Bytes
6c4edfa3   Alexandre   First Commit LabI...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

namespace PhpParser;

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)));
}