Skip to content

Commit 19e6a81

Browse files
committed
typos
1 parent 284144a commit 19e6a81

File tree

9 files changed

+37
-17
lines changed

9 files changed

+37
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
![Code size](https://img.shields.io/github/languages/code-size/xrdebug/php?style=flat-square)
99
[![Apache-2.0](https://img.shields.io/github/license/xrdebug/php?style=flat-square)](LICENSE)
1010
[![PHPStan](https://img.shields.io/badge/PHPStan-level%209-blueviolet?style=flat-square)](https://phpstan.org/)
11-
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchevere%2Fxr%2F2.0)](https://dashboard.stryker-mutator.io/reports/github.com/xrdebug/php/2.0)
11+
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat-square&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fxrdebug%2Fphp%2F2.0)](https://dashboard.stryker-mutator.io/reports/github.com/xrdebug/php/2.0)
1212

1313
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=xrdebug_php&metric=alert_status)](https://sonarcloud.io/dashboard?id=xrdebug_php)
1414
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=xrdebug_php&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=xrdebug_php)

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"chevere/filesystem": "^1.0.0",
2525
"chevere/message": "^1.0.0",
2626
"chevere/standard": "^1.0.1",
27-
"chevere/throwable-handler": "^1.0.0",
27+
"chevere/throwable-handler": "^1.0.2",
2828
"chevere/trace": "^2.0.0",
2929
"chevere/var-dump": "^2.0.0",
3030
"phpseclib/phpseclib": "~3.0"
@@ -74,7 +74,9 @@
7474
"vendor/bin/phpunit -c phpunit-coverage.xml"
7575
],
7676
"cs-update": "mkdir -p .ecs && cd .ecs && curl -O https://raw.githubusercontent.com/chevere/code-style/main/.ecs/ecs-chevere.php",
77-
"cs-fix": "vendor/bin/ecs --config='.ecs/ecs.php' check src --fix"
77+
"cs-fix": "vendor/bin/ecs --config='.ecs/ecs.php' check src --fix",
78+
"open-coverage": "open build/logs/html/index.html",
79+
"open-infection": "open build/logs/html/infection.html"
7880
},
7981
"scripts-descriptions": {
8082
"all": "Runs all checks",
@@ -84,6 +86,8 @@
8486
"test": "Run test suite",
8587
"test-coverage": "Run test suite (coverage)",
8688
"cs-update": "Update Chevere code style definition",
87-
"cs-fix": "Update Chevere code style definition"
89+
"cs-fix": "Update Chevere code style definition",
90+
"open-coverage": "Open code coverage report",
91+
"open-infection": "Open infection report"
8892
}
8993
}

src/InspectorNull.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
use Chevere\xrDebug\PHP\Interfaces\InspectorInterface;
1717

18+
/**
19+
* @codeCoverageIgnore
20+
*/
1821
class InspectorNull implements InspectorInterface
1922
{
2023
public function pause(

src/Message.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@ private function handleDumpVars(): void
187187
->withVariables(...$this->vars)
188188
->process($this->writer);
189189
$dump = $this->writer->__toString();
190-
if ($dump === '') {
191-
return;
192-
}
193190
$this->body .= <<<HTML
194191
<div class="xrdebug-dump">{$dump}</div>
195192
HTML;

src/ThrowableParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ private function parse(Throwable $throwable): ?Throwable
115115
? $this->extra
116116
: '',
117117
'%trace%' => $traceDocument->__toString(),
118-
'%trace_count%' => (string) count($trace),
118+
'%trace_count%' => count($trace),
119119
];
120120
$this->appendBodyLine(
121121
strtr(static::ITEM_TEMPLATE, $translate)

src/Xr.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use Chevere\Filesystem\Interfaces\DirectoryInterface;
1717
use Chevere\xrDebug\PHP\Interfaces\ClientInterface;
18-
use Chevere\xrDebug\PHP\Interfaces\CurlInterface;
1918
use Chevere\xrDebug\PHP\Interfaces\XrInterface;
2019
use phpseclib3\Crypt\EC\PrivateKey;
2120
use phpseclib3\Crypt\PublicKeyLoader;
@@ -35,8 +34,6 @@ final class Xr implements XrInterface
3534
*/
3635
private array $configNames = ['xr.php'];
3736

38-
private CurlInterface $curl;
39-
4037
private ?PrivateKey $privateKey = null;
4138

4239
public function __construct(
@@ -45,9 +42,7 @@ public function __construct(
4542
private string $host = 'localhost',
4643
private int $port = 27420,
4744
private string $key = '',
48-
?CurlInterface $curl = null
4945
) {
50-
$this->curl = $curl ?? new Curl();
5146
$this->setClient();
5247
}
5348

@@ -148,7 +143,6 @@ private function setClient(): void
148143
$this->privateKey = $loadKey;
149144
}
150145
$this->client = new Client(
151-
curl: $this->curl,
152146
host: $this->host,
153147
port: $this->port,
154148
isHttps: $this->isHttps,

tests/ClientTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public function testPost(): void
6060
->method('setOptArray')
6161
->with($options);
6262
$client = new Client(curl: $curl, port: $port, host: $host, isHttps: $isHttps);
63+
$this->assertSame($curl, $client->curl());
6364
$client->sendMessage($message);
6465
$this->assertSame($options, $client->options());
6566
$client->sendMessage($message);

tests/ThrowableParserTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace Chevere\Tests;
1515

16+
use Chevere\Tests\src\TestException;
1617
use Chevere\ThrowableHandler\Formats\HtmlFormat;
1718
use Chevere\ThrowableHandler\Formats\PlainFormat;
1819
use Chevere\ThrowableHandler\ThrowableRead;
@@ -26,12 +27,12 @@ final class ThrowableParserTest extends TestCase
2627
{
2728
public function testTopLevel(): void
2829
{
29-
$throwable = new Exception('foo');
30+
$throwable = new TestException('foo');
3031
$read = new ThrowableRead($throwable);
3132
$parser = new ThrowableParser($read);
32-
$this->assertSame(Exception::class, $parser->topic());
33+
$this->assertSame('TestException', $parser->topic());
3334
$this->assertSame(
34-
Exception::class,
35+
$throwable::class,
3536
$parser->throwableRead()->className()
3637
);
3738
$this->assertStringStartsWith(

tests/src/TestException.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/*
4+
* This file is part of Chevere.
5+
*
6+
* (c) Rodolfo Berrios <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
declare(strict_types=1);
13+
14+
namespace Chevere\Tests\src;
15+
16+
use Exception;
17+
18+
class TestException extends Exception
19+
{
20+
}

0 commit comments

Comments
 (0)