@@ -41,7 +41,7 @@ |
||
| 41 | 41 | $this->taskWatch() |
| 42 | 42 | ->monitor( |
| 43 | 43 | $paths, |
| 44 | - function (FilesystemEvent $event) use ($options) { |
|
| 44 | + function(FilesystemEvent $event) use ($options) { |
|
| 45 | 45 | $resource = (string) $event->getResource(); |
| 46 | 46 | if ( |
| 47 | 47 | false !== strpos($resource, 'build') |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function getOutputType(): string |
| 20 | 20 | { |
| 21 | 21 | |
| 22 | - return $this->getTarget() !== 'console' ? static::OUTPUT_FILE:static::OUTPUT_CONSOLE; |
|
| 22 | + return $this->getTarget() !== 'console' ? static::OUTPUT_FILE : static::OUTPUT_CONSOLE; |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function getType(): string |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $target = $this->target; |
| 35 | 35 | |
| 36 | 36 | $output = $reportProcessor->process($coverage); |
| 37 | - if('console' === $target){ |
|
| 37 | + if ('console' === $target) { |
|
| 38 | 38 | $consoleIO->coverageInfo($output); |
| 39 | - }else{ |
|
| 39 | + } else { |
|
| 40 | 40 | file_put_contents($target, $output); |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | public function __construct(array $options = array()) |
| 37 | 37 | { |
| 38 | 38 | $options = array_merge($this->defaultOptions, $options); |
| 39 | - foreach($options as $name => $value){ |
|
| 39 | + foreach ($options as $name => $value) { |
|
| 40 | 40 | $method = 'set'.ucfirst($name); |
| 41 | - if(method_exists($this,$method)){ |
|
| 41 | + if (method_exists($this, $method)) { |
|
| 42 | 42 | unset($options[$name]); |
| 43 | - call_user_func_array([$this,$method],[$value]); |
|
| 43 | + call_user_func_array([$this, $method], [$value]); |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public function process(ProcessorInterface $processor, ConsoleIO $consoleIO) |
| 81 | 81 | { |
| 82 | - try{ |
|
| 82 | + try { |
|
| 83 | 83 | $reportProcessor = $this->processor; |
| 84 | 84 | $reportProcessor->process($processor->getCodeCoverage(), $this->target); |
| 85 | 85 | $info = sprintf( |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $this->getTarget() |
| 89 | 89 | ); |
| 90 | 90 | $consoleIO->coverageInfo($info); |
| 91 | - }catch (\Exception $exception){ |
|
| 91 | + } catch (\Exception $exception) { |
|
| 92 | 92 | $message = sprintf( |
| 93 | 93 | "Failed to generate report type: <comment>%s</comment>. Error message:\n%s", |
| 94 | 94 | $this->getType(), |
@@ -108,18 +108,18 @@ discard block |
||
| 108 | 108 | $r = new \ReflectionClass($this->getProcessorClass()); |
| 109 | 109 | $args = []; |
| 110 | 110 | |
| 111 | - $constructor= $r->getConstructor(); |
|
| 112 | - if( |
|
| 111 | + $constructor = $r->getConstructor(); |
|
| 112 | + if ( |
|
| 113 | 113 | !is_null($constructor) |
| 114 | 114 | && is_array($constructorParams = $constructor->getParameters()) |
| 115 | - ){ |
|
| 116 | - foreach($constructorParams as $parameter){ |
|
| 117 | - if(!$parameter->isDefaultValueAvailable()){ |
|
| 115 | + ) { |
|
| 116 | + foreach ($constructorParams as $parameter) { |
|
| 117 | + if (!$parameter->isDefaultValueAvailable()) { |
|
| 118 | 118 | break; |
| 119 | 119 | } |
| 120 | 120 | $name = $parameter->getName(); |
| 121 | 121 | $value = $parameter->getDefaultValue(); |
| 122 | - if(isset($options[$name])){ |
|
| 122 | + if (isset($options[$name])) { |
|
| 123 | 123 | $value = $options[$name]; |
| 124 | 124 | } |
| 125 | 125 | $args[] = $value; |
@@ -129,11 +129,11 @@ discard block |
||
| 129 | 129 | $outputType = $this->getOutputType(); |
| 130 | 130 | $dir = $this->getTarget(); |
| 131 | 131 | |
| 132 | - if(static::OUTPUT_FILE === $outputType){ |
|
| 132 | + if (static::OUTPUT_FILE === $outputType) { |
|
| 133 | 133 | $dir = dirname($dir); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if(static::OUTPUT_CONSOLE !== $outputType && !is_dir($dir)){ |
|
| 136 | + if (static::OUTPUT_CONSOLE !== $outputType && !is_dir($dir)) { |
|
| 137 | 137 | mkdir($dir, 0775, true); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function addProcessor(ReportProcessorInterface $processor) |
| 32 | 32 | { |
| 33 | 33 | $type = $processor->getType(); |
| 34 | - if(!$this->hasProcessor($type)){ |
|
| 34 | + if (!$this->hasProcessor($type)) { |
|
| 35 | 35 | $this->processors[$type] = $processor; |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $consoleIO->coverageSection('processing code coverage reports'); |
| 50 | 50 | |
| 51 | - foreach($this->processors as $reportProcessor){ |
|
| 51 | + foreach ($this->processors as $reportProcessor) { |
|
| 52 | 52 | $reportProcessor->process($processor, $consoleIO); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $coverageEvent = $this->coverageEvent; |
| 35 | 35 | |
| 36 | - if($coverageEvent->canCollectCodeCoverage()){ |
|
| 36 | + if ($coverageEvent->canCollectCodeCoverage()) { |
|
| 37 | 37 | $coverageEvent->getProcessor()->clear(); |
| 38 | 38 | $this->dispatch($coverageEvent, CoverageEvent::refresh); |
| 39 | 39 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $coverageEvent = $this->coverageEvent; |
| 47 | 47 | |
| 48 | - if($coverageEvent->canCollectCodeCoverage()){ |
|
| 48 | + if ($coverageEvent->canCollectCodeCoverage()) { |
|
| 49 | 49 | $coverageEvent->getProcessor()->start($testCase); |
| 50 | 50 | $this->dispatch($coverageEvent, CoverageEvent::beforeStart); |
| 51 | 51 | $this->dispatch($coverageEvent, CoverageEvent::start); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | public function stop() |
| 58 | 58 | { |
| 59 | 59 | $coverageEvent = $this->coverageEvent; |
| 60 | - if($coverageEvent->canCollectCodeCoverage()){ |
|
| 60 | + if ($coverageEvent->canCollectCodeCoverage()) { |
|
| 61 | 61 | $coverageEvent->getProcessor()->stop(); |
| 62 | 62 | $this->dispatch($coverageEvent, CoverageEvent::stop); |
| 63 | 63 | } |
@@ -70,11 +70,11 @@ discard block |
||
| 70 | 70 | $coverageEvent = $this->coverageEvent; |
| 71 | 71 | $consoleIO = $coverageEvent->getConsoleIO(); |
| 72 | 72 | |
| 73 | - if($coverageEvent->canCollectCodeCoverage()){ |
|
| 73 | + if ($coverageEvent->canCollectCodeCoverage()) { |
|
| 74 | 74 | $coverageEvent->getProcessor()->complete(); |
| 75 | 75 | $this->dispatch($coverageEvent, CoverageEvent::complete); |
| 76 | 76 | $this->dispatch($coverageEvent, CoverageEvent::report); |
| 77 | - }else{ |
|
| 77 | + } else { |
|
| 78 | 78 | $consoleIO->coverageError('Can not create coverage report. No code coverage driver available'); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function setResult(int $result) |
| 85 | 85 | { |
| 86 | 86 | $coverageEvent = $this->coverageEvent; |
| 87 | - if($coverageEvent->canCollectCodeCoverage()){ |
|
| 87 | + if ($coverageEvent->canCollectCodeCoverage()) { |
|
| 88 | 88 | $coverageEvent->getProcessor()->getCurrentTestCase()->setResult($result); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -335,7 +335,7 @@ |
||
| 335 | 335 | $this->addException(new SessionException($e->getMessage())); |
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | - $this->hasStarted = false; |
|
| 338 | + $this->hasStarted = false; |
|
| 339 | 339 | $this->save(); |
| 340 | 340 | } |
| 341 | 341 | |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | return new JsonResponse($data, Response::HTTP_NOT_FOUND); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - $response = new Response($data, Response::HTTP_OK); |
|
| 119 | + $response = new Response($data, Response::HTTP_OK); |
|
| 120 | 120 | $response->headers->set('Content-Type', static::SERIALIZED_OBJECT_CONTENT_TYPE); |
| 121 | 121 | |
| 122 | 122 | return $response; |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct($style, OutputInterface $output = null) |
| 26 | 26 | { |
| 27 | - if($style instanceof InputInterface){ |
|
| 27 | + if ($style instanceof InputInterface) { |
|
| 28 | 28 | $style = new SymfonyStyle($style, $output); |
| 29 | 29 | } |
| 30 | 30 | $this->style = $style; |
@@ -39,8 +39,8 @@ |
||
| 39 | 39 | $driverClass = PHPDBG::class; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - if ($this->hasXdebug()){ |
|
| 43 | - $driverClass = Xdebug::class; |
|
| 42 | + if ($this->hasXdebug()) { |
|
| 43 | + $driverClass = Xdebug::class; |
|
| 44 | 44 | } |
| 45 | 45 | // @codeCoverageIgnoreEnd |
| 46 | 46 | |