No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
d7ca56f
... +8 ...
e9404d2
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
20 | 20 | use GuzzleHttp\Middleware; |
|
21 | 21 | use Psr\Http\Message\ResponseInterface; |
|
22 | 22 | use Symfony\Component\Console\Logger\ConsoleLogger; |
|
23 | + | use Symfony\Component\Console\Output\ConsoleOutput; |
|
23 | 24 | ||
24 | 25 | /** |
|
25 | 26 | * A HTTP request task. |
150 | 151 | } |
|
151 | 152 | ||
152 | 153 | if ($this->verbose) { |
|
153 | - | self::getHandlerStack()->push(Middleware::log(new ConsoleLogger(), new \GuzzleHttp\MessageFormatter())); |
|
154 | + | self::getHandlerStack()->push(Middleware::log(new ConsoleLogger(new ConsoleOutput()), new \GuzzleHttp\MessageFormatter())); |
|
154 | 155 | } |
|
155 | 156 | ||
156 | 157 | return parent::request($options); |
39 | 39 | ||
40 | 40 | switch ($type) { |
|
41 | 41 | case "xml": |
|
42 | - | include_once 'phing/tasks/ext/phploc/PHPLocXMLFormatter.php'; |
|
43 | 42 | $formatter = new PHPLocXMLFormatter(); |
|
44 | 43 | break; |
|
44 | + | case "json": |
|
45 | + | $formatter = new PHPLocJSONFormatter(); |
|
46 | + | break; |
|
45 | 47 | case "csv": |
|
46 | - | include_once 'phing/tasks/ext/phploc/PHPLocCSVFormatter.php'; |
|
47 | 48 | $formatter = new PHPLocCSVFormatter(); |
|
48 | 49 | break; |
|
49 | 50 | case "txt": |
|
50 | 51 | case "cli": |
|
51 | - | include_once 'phing/tasks/ext/phploc/PHPLocTextFormatter.php'; |
|
52 | 52 | $formatter = new PHPLocTextFormatter(); |
|
53 | 53 | break; |
|
54 | 54 | default: |
35 | 35 | /** |
|
36 | 36 | * @var array |
|
37 | 37 | */ |
|
38 | - | protected $acceptedReportTypes = ['cli', 'txt', 'xml', 'csv']; |
|
38 | + | protected $acceptedReportTypes = ['cli', 'txt', 'xml', 'csv', 'json']; |
|
39 | 39 | ||
40 | 40 | /** |
|
41 | 41 | * @var null |
302 | 302 | ||
303 | 303 | if (count($this->filesToCheck) > 0) { |
|
304 | 304 | foreach ($this->filesToCheck as $file) { |
|
305 | - | $files[] = new SplFileInfo($file); |
|
305 | + | $files[] = (new SplFileInfo($file))->getRealPath(); |
|
306 | 306 | } |
|
307 | 307 | } elseif ($this->fileToCheck !== null) { |
|
308 | - | $files = [new SplFileInfo($this->fileToCheck)]; |
|
308 | + | $files = [(new SplFileInfo($this->fileToCheck))->getRealPath()]; |
|
309 | 309 | } |
|
310 | 310 | ||
311 | 311 | return $files; |
25 | 25 | { |
|
26 | 26 | public function printResult(array $count, $countTests = false) |
|
27 | 27 | { |
|
28 | - | if (class_exists('\\SebastianBergmann\\PHPLOC\\Log\\XML')) { |
|
29 | - | $printer = new SebastianBergmann\PHPLOC\Log\XML(); |
|
30 | - | } elseif (class_exists('\\SebastianBergmann\\PHPLOC\\Log\\Xml')) { |
|
28 | + | if (class_exists('\\SebastianBergmann\\PHPLOC\\Log\\Xml')) { |
|
31 | 29 | $printer = new SebastianBergmann\PHPLOC\Log\Xml(); |
|
32 | 30 | } else { |
|
33 | 31 | throw new BuildException('Not supported PHPLOC version used.'); |
1 | + | <?php |
|
2 | + | /** |
|
3 | + | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
4 | + | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
5 | + | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
6 | + | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
7 | + | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
8 | + | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
9 | + | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
10 | + | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
11 | + | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
12 | + | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
13 | + | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
14 | + | * |
|
15 | + | * This software consists of voluntary contributions made by many individuals |
|
16 | + | * and is licensed under the LGPL. For more information please see |
|
17 | + | * <http://phing.info>. |
|
18 | + | */ |
|
19 | + | ||
20 | + | /** |
|
21 | + | * @author Siad Ardroumli <siad.ardroumli@gmail.com> |
|
22 | + | * @package phing.tasks.ext.phploc |
|
23 | + | */ |
|
24 | + | class PHPLocJSONFormatter extends AbstractPHPLocFormatter |
|
25 | + | { |
|
26 | + | public function printResult(array $count, $countTests = false) |
|
27 | + | { |
|
28 | + | if (class_exists('\\SebastianBergmann\\PHPLOC\\Log\\Json')) { |
|
29 | + | $printer = new SebastianBergmann\PHPLOC\Log\Json(); |
|
30 | + | } else { |
|
31 | + | throw new BuildException('Not supported PHPLOC version used.'); |
|
32 | + | } |
|
33 | + | $printer->printResult($this->getToDir() . DIRECTORY_SEPARATOR . $this->getOutfile(), $count); |
|
34 | + | } |
|
35 | + | } |
Learn more Showing 7 files with coverage changes found.
classes/phing/tasks/ext/phploc/PHPLocJSONFormatter.php
classes/phing/tasks/ext/phploc/PHPLocXMLFormatter.php
classes/phing/tasks/ext/phploc/PHPLocFormatterFactory.php
classes/phing/tasks/ext/phploc/PHPLocTask.php
classes/phing/tasks/ext/phploc/PHPLocCSVFormatter.php
classes/phing/tasks/ext/phploc/AbstractPHPLocFormatter.php
classes/phing/tasks/ext/phploc/PHPLocFormatterElement.php
Files | Complexity | Coverage |
---|---|---|
classes/phing | ø | 0.58% 53.07% |
Project Totals (477 files) | 9309 | 53.07% |
#1389
e9404d2
8a6a501
2ef28b4
86b802b
869a00b
70f11a6
c1c4556
ba72dd2
a819dbe
d7ca56f