You are here

private static function ClassCollectionLoader::compressCode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/class-loader/ClassCollectionLoader.php \Symfony\Component\ClassLoader\ClassCollectionLoader::compressCode()

Strips leading & trailing ws, multiple EOL, multiple ws.

Parameters

string $code Original PHP code:

Return value

string compressed code

1 call to ClassCollectionLoader::compressCode()
ClassCollectionLoader::fixNamespaceDeclarations in vendor/symfony/class-loader/ClassCollectionLoader.php
Adds brackets around each namespace if it's not already the case.

File

vendor/symfony/class-loader/ClassCollectionLoader.php, line 213

Class

ClassCollectionLoader
ClassCollectionLoader.

Namespace

Symfony\Component\ClassLoader

Code

private static function compressCode($code) {
  return preg_replace(array(
    '/^\\s+/m',
    '/\\s+$/m',
    '/([\\n\\r]+ *[\\n\\r]+)+/',
    '/[ \\t]+/',
  ), array(
    '',
    '',
    "\n",
    ' ',
  ), $code);
}