@@ -47,7 +47,7 @@ |
||
| 47 | 47 | $event['method'] = 'on'.preg_replace_callback(array( |
| 48 | 48 | '/(?<=\b)[a-z]/i', |
| 49 | 49 | '/[^a-z0-9]/i', |
| 50 | - ), function ($matches) { |
|
| 50 | + ), function($matches) { |
|
| 51 | 51 | return strtoupper($matches[0]); |
| 52 | 52 | }, $event['event']); |
| 53 | 53 | $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | // Default case is we want the user to specify just one |
| 46 | 46 | // path but we can allow for multiple if they want to. |
| 47 | 47 | ->ifString() |
| 48 | - ->then(function ($v) { |
|
| 48 | + ->then(function($v) { |
|
| 49 | 49 | return array($v); |
| 50 | 50 | }) |
| 51 | 51 | ->end() |
@@ -61,14 +61,14 @@ discard block |
||
| 61 | 61 | // Default case is we want the user to specify just one |
| 62 | 62 | // taxonomy but we can allow for multiple if they want to. |
| 63 | 63 | ->ifString() |
| 64 | - ->then(function ($v) { |
|
| 64 | + ->then(function($v) { |
|
| 65 | 65 | return array(array('name' => $v)); |
| 66 | 66 | }) |
| 67 | 67 | ->end() |
| 68 | 68 | ->prototype('array') |
| 69 | 69 | ->beforeNormalization() |
| 70 | 70 | ->ifString() |
| 71 | - ->then(function ($v) { |
|
| 71 | + ->then(function($v) { |
|
| 72 | 72 | return array('name' => $v); |
| 73 | 73 | }) |
| 74 | 74 | ->end() |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | $this->loop = new StreamSelectLoop(); |
| 51 | 51 | $socketServer = new ReactSocketServer($this->loop); |
| 52 | 52 | $httpServer = new ReactHttpServer($socketServer); |
| 53 | - $httpServer->on('request', function ($request, $response) use ($repository, $docroot, $output) { |
|
| 53 | + $httpServer->on('request', function($request, $response) use ($repository, $docroot, $output) { |
|
| 54 | 54 | $path = $docroot.'/'.ltrim(rawurldecode($request->getPath()), '/'); |
| 55 | 55 | if (is_dir($path)) { |
| 56 | 56 | $path .= '/index.html'; |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $matcher = $this->matcher; |
| 69 | 69 | |
| 70 | 70 | return array_map( |
| 71 | - function ($path) use ($matcher) { |
|
| 71 | + function($path) use ($matcher) { |
|
| 72 | 72 | if ($matcher->isPattern($path)) { |
| 73 | 73 | return $path; |
| 74 | 74 | } |
@@ -43,21 +43,21 @@ |
||
| 43 | 43 | */ |
| 44 | 44 | public function __construct($sourceDir, array $sourcePaths, array $paths, array $extensions) |
| 45 | 45 | { |
| 46 | - $mappedSourcePaths = array_map(function ($path) use ($sourceDir) { |
|
| 46 | + $mappedSourcePaths = array_map(function($path) use ($sourceDir) { |
|
| 47 | 47 | return $sourceDir.'/'.$path; |
| 48 | 48 | }, $sourcePaths); |
| 49 | 49 | |
| 50 | 50 | $allPaths = array_merge( |
| 51 | - array_filter($mappedSourcePaths, function ($path) { |
|
| 51 | + array_filter($mappedSourcePaths, function($path) { |
|
| 52 | 52 | return file_exists($path); |
| 53 | 53 | }), |
| 54 | - array_filter($paths, function ($path) { |
|
| 54 | + array_filter($paths, function($path) { |
|
| 55 | 55 | return file_exists($path); |
| 56 | 56 | }) |
| 57 | 57 | ); |
| 58 | 58 | |
| 59 | 59 | $this->filesystemLoader = new FilesystemLoader($allPaths); |
| 60 | - $this->extensions = array_map(function ($ext) { |
|
| 60 | + $this->extensions = array_map(function($ext) { |
|
| 61 | 61 | return $ext ? '.'.$ext : $ext; |
| 62 | 62 | }, $extensions); |
| 63 | 63 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $this->eventDispatcher->dispatch(self::EVENT_BEFORE_RUN, new SourceSetEvent($sourceSet)); |
| 149 | 149 | |
| 150 | - if ($updatedSources = array_filter($sourceSet->updatedSources(), function ($source) { |
|
| 150 | + if ($updatedSources = array_filter($sourceSet->updatedSources(), function($source) { |
|
| 151 | 151 | return !$source->isGenerated(); |
| 152 | 152 | })) { |
| 153 | 153 | if (!$found) { |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | $timer = microtime(true); |
| 164 | 164 | foreach ($updatedSources as $source) { |
| 165 | 165 | $this->generatorManager->generate($source, $sourceSet); |
| 166 | - $io->overwrite(sprintf('%3d%%', 100 * ((++$counter) / $total)), false); |
|
| 166 | + $io->overwrite(sprintf('%3d%%', 100*((++$counter)/$total)), false); |
|
| 167 | 167 | } |
| 168 | 168 | $io->write(sprintf(' (%d sources / %4.2f seconds)', $total, microtime(true) - $timer)); |
| 169 | 169 | } |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | if ($source->canBeFormatted()) { |
| 193 | 193 | $source->data()->set('blocks', $this->formatterManager->formatSourceBlocks($source)); |
| 194 | 194 | } |
| 195 | - $io->overwrite(sprintf('%3d%%', 100 * ((++$counter) / $total)), false); |
|
| 195 | + $io->overwrite(sprintf('%3d%%', 100*((++$counter)/$total)), false); |
|
| 196 | 196 | } |
| 197 | 197 | $io->write(sprintf(' (%d sources / %4.2f seconds)', $total, microtime(true) - $timer)); |
| 198 | 198 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | } else { |
| 216 | 216 | $source->setFormattedContent($source->content()); |
| 217 | 217 | } |
| 218 | - $io->overwrite(sprintf('%3d%%', 100 * ((++$counter) / $total)), false); |
|
| 218 | + $io->overwrite(sprintf('%3d%%', 100*((++$counter)/$total)), false); |
|
| 219 | 219 | } |
| 220 | 220 | $this->eventDispatcher->dispatch(self::EVENT_AFTER_FORMAT, new SourceSetEvent($sourceSet)); |
| 221 | 221 | $io->write(sprintf(' (%d sources / %4.2f seconds)', $total, microtime(true) - $timer)); |