package updates

This commit is contained in:
2018-12-19 23:27:43 -06:00
parent aa1da4d4fb
commit 1ffd21369f
1181 changed files with 51194 additions and 11046 deletions

View File

@@ -43,7 +43,7 @@ abstract class AbstractNode implements \Countable
public function __construct(string $name, self $parent = null)
{
if (\substr($name, -1) == '/') {
if (\substr($name, -1) == \DIRECTORY_SEPARATOR) {
$name = \substr($name, 0, -1);
}
@@ -83,7 +83,7 @@ abstract class AbstractNode implements \Countable
if ($this->parent === null || $this->parent->getPath() === null || $this->parent->getPath() === false) {
$this->path = $this->name;
} else {
$this->path = $this->parent->getPath() . '/' . $this->name;
$this->path = $this->parent->getPath() . \DIRECTORY_SEPARATOR . $this->name;
}
}

View File

@@ -93,7 +93,7 @@ final class Builder
$result = [];
foreach ($files as $path => $file) {
$path = \explode('/', $path);
$path = \explode(\DIRECTORY_SEPARATOR, $path);
$pointer = &$result;
$max = \count($path);
@@ -160,7 +160,7 @@ final class Builder
$paths = \array_keys($files);
if (\count($files) === 1) {
$commonPath = \dirname($paths[0]) . '/';
$commonPath = \dirname($paths[0]) . \DIRECTORY_SEPARATOR;
$files[\basename($paths[0])] = $files[$paths[0]];
unset($files[$paths[0]]);
@@ -214,7 +214,7 @@ final class Builder
$max = \count($original);
for ($i = 0; $i < $max; $i++) {
$files[\implode('/', $paths[$i])] = $files[$original[$i]];
$files[\implode(\DIRECTORY_SEPARATOR, $paths[$i])] = $files[$original[$i]];
unset($files[$original[$i]]);
}

View File

@@ -341,9 +341,14 @@ final class File extends AbstractNode
$this->codeUnitsByLine[$lineNumber] = [];
}
$this->processClasses($tokens);
$this->processTraits($tokens);
$this->processFunctions($tokens);
try {
$this->processClasses($tokens);
$this->processTraits($tokens);
$this->processFunctions($tokens);
} catch (\OutOfBoundsException $e) {
// This can happen with PHP_Token_Stream if the file is syntactically invalid,
// and probably affects a file that wasn't executed.
}
unset($tokens);
foreach (\range(1, $this->linesOfCode['loc']) as $lineNumber) {