PHP Classes

File: vendor/nikic/php-parser/test/bootstrap.php

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   Laravel Blogging Platform   vendor/nikic/php-parser/test/bootstrap.php   Download  
File: vendor/nikic/php-parser/test/bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Laravel Blogging Platform
Manage blog posts using Laravel and Bootstrap
Author: By
Last change:
Date: 4 years ago
Size: 446 bytes
 

Contents

Class file image Download
<?php

namespace PhpParser;

require
__DIR__ . '/../vendor/autoload.php';

function
canonicalize($str) {
   
// normalize EOL style
   
$str = str_replace("\r\n", "\n", $str);

   
// trim newlines at end
   
$str = rtrim($str, "\n");

   
// remove trailing whitespace on all lines
   
$lines = explode("\n", $str);
   
$lines = array_map(function($line) {
        return
rtrim($line, " \t");
    },
$lines);
    return
implode("\n", $lines);
}