@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | foreach ($this->included as $exp) { |
| 44 | 44 | try { |
| 45 | 45 | $this->computePath($included, $this->processIncludePath($exp, $file), $file); |
| 46 | - } catch(InvalidArgumentException $x) { |
|
| 46 | + } catch (InvalidArgumentException $x) { |
|
| 47 | 47 | var_dump($x->getMessage()); |
| 48 | 48 | } |
| 49 | 49 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | private function computePath(array &$included, string $path, string $self) |
| 60 | 60 | { |
| 61 | 61 | if (!preg_match('#^([A-Z]:)?/#i', str_replace('\\', '/', $path))) { |
| 62 | - $path = dirname($self).'/'.$path; |
|
| 62 | + $path = dirname($self) . '/' . $path; |
|
| 63 | 63 | } |
| 64 | 64 | if (false === strpos($path, '{var}')) { |
| 65 | 65 | $included[] = $path; |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | $parts = explode('{var}', $path); |
| 69 | 69 | $regex = []; |
| 70 | - foreach($parts as $part) { |
|
| 70 | + foreach ($parts as $part) { |
|
| 71 | 71 | $regex[] = preg_quote(str_replace('\\', '/', $part), '/'); |
| 72 | 72 | } |
| 73 | - $regex = '/^'.implode('.+', $regex).'$/'; |
|
| 73 | + $regex = '/^' . implode('.+', $regex) . '$/'; |
|
| 74 | 74 | $self = str_replace('\\', '/', $self); |
| 75 | 75 | foreach (new RecursiveIteratorIterator( |
| 76 | 76 | new RecursiveDirectoryIterator( |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | return $exp; |
| 98 | 98 | } |
| 99 | 99 | if ($exp instanceof Concat) { |
| 100 | - return $this->processIncludePath($exp->left, $file).$this->processIncludePath($exp->right, $file); |
|
| 100 | + return $this->processIncludePath($exp->left, $file) . $this->processIncludePath($exp->right, $file); |
|
| 101 | 101 | } |
| 102 | 102 | if ($exp instanceof Dir) { |
| 103 | 103 | return dirname($file); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | if ($exp instanceof Variable || $exp instanceof ConstFetch) { |
| 115 | 115 | return '{var}'; |
| 116 | 116 | } |
| 117 | - throw new InvalidArgumentException('can\'t yet handle '.$exp->getType()); |
|
| 117 | + throw new InvalidArgumentException('can\'t yet handle ' . $exp->getType()); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |