Skip to content

Commit e0da986

Browse files
committed
style: $ composer fix
Signed-off-by: Jack Cherng <jfcherng@gmail.com>
1 parent 5b70504 commit e0da986

29 files changed

+49
-118
lines changed

src/DiffHelper.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ final class DiffHelper
1212
/**
1313
* The constructor.
1414
*/
15-
private function __construct()
16-
{
17-
}
15+
private function __construct() {}
1816

1917
/**
2018
* Get the absolute path of the project root directory.
@@ -38,7 +36,7 @@ public static function getRenderersInfo(): array
3836
}
3937

4038
$glob = implode(\DIRECTORY_SEPARATOR, [
41-
static::getProjectDirectory(),
39+
self::getProjectDirectory(),
4240
'src',
4341
'Renderer',
4442
'{' . implode(',', RendererConstant::RENDERER_TYPES) . '}',
@@ -94,7 +92,7 @@ public static function getStyleSheet(): string
9492
return $fileContent;
9593
}
9694

97-
$filePath = static::getProjectDirectory() . '/example/diff-table.css';
95+
$filePath = self::getProjectDirectory() . '/example/diff-table.css';
9896

9997
$file = new \SplFileObject($filePath, 'r');
10098

@@ -170,7 +168,7 @@ public static function calculateFiles(
170168
$oldFile = new \SplFileObject($old, 'r');
171169
$newFile = new \SplFileObject($new, 'r');
172170

173-
return static::calculate(
171+
return self::calculate(
174172
// fread() requires the length > 0 hence we plus 1 for empty files
175173
$oldFile->fread($oldFile->getSize() + 1),
176174
$newFile->fread($newFile->getSize() + 1),

src/Differ.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function setNew(array $new): self
177177
*/
178178
public function setOptions(array $options): self
179179
{
180-
$mergedOptions = $options + static::$defaultOptions;
180+
$mergedOptions = $options + self::$defaultOptions;
181181

182182
if ($this->options !== $mergedOptions) {
183183
$this->options = $mergedOptions;
@@ -196,7 +196,7 @@ public function setOptions(array $options): self
196196
*
197197
* @return string[] array of all of the lines between the specified range
198198
*/
199-
public function getOld(int $start = 0, ?int $end = null): array
199+
public function getOld(int $start = 0, int $end = null): array
200200
{
201201
return Arr::getPartialByIndex($this->old, $start, $end);
202202
}
@@ -210,7 +210,7 @@ public function getOld(int $start = 0, ?int $end = null): array
210210
*
211211
* @return string[] array of all of the lines between the specified range
212212
*/
213-
public function getNew(int $start = 0, ?int $end = null): array
213+
public function getNew(int $start = 0, int $end = null): array
214214
{
215215
return Arr::getPartialByIndex($this->new, $start, $end);
216216
}
@@ -260,7 +260,7 @@ public static function getInstance(): self
260260
{
261261
static $singleton;
262262

263-
return $singleton ??= new static([], []);
263+
return $singleton ??= new self([], []);
264264
}
265265

266266
/**
@@ -491,7 +491,7 @@ private function finalize(): self
491491
*/
492492
private function resetCachedResults(): self
493493
{
494-
foreach (static::CACHED_PROPERTIES as $property => $value) {
494+
foreach (self::CACHED_PROPERTIES as $property => $value) {
495495
$this->{$property} = $value;
496496
}
497497

src/Factory/LineRendererFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ final class LineRendererFactory
1919
/**
2020
* The constructor.
2121
*/
22-
private function __construct()
23-
{
24-
}
22+
private function __construct() {}
2523

2624
/**
2725
* Get the singleton of a line renderer.

src/Factory/RendererFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ final class RendererFactory
1919
/**
2020
* The constructor.
2121
*/
22-
private function __construct()
23-
{
24-
}
22+
private function __construct() {}
2523

2624
/**
2725
* Get the singleton of a renderer.

src/Renderer/AbstractRenderer.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,6 @@ public function getOptions(): array
154154
}
155155

156156
/**
157-
* {@inheritdoc}
158-
*
159157
* @final
160158
*
161159
* @todo mark this method with "final" in the next major release
@@ -178,21 +176,16 @@ public function getResultForIdenticals(): string
178176
*/
179177
abstract public function getResultForIdenticalsDefault(): string;
180178

181-
/**
182-
* {@inheritdoc}
183-
*/
184179
final public function render(Differ $differ): string
185180
{
186181
$this->changesAreRaw = true;
182+
187183
// the "no difference" situation may happen frequently
188184
return $differ->getOldNewComparison() === 0
189185
? $this->getResultForIdenticals()
190186
: $this->renderWorker($differ);
191187
}
192188

193-
/**
194-
* {@inheritdoc}
195-
*/
196189
final public function renderArray(array $differArray): string
197190
{
198191
$this->changesAreRaw = false;

src/Renderer/Html/AbstractHtml.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ abstract class AbstractHtml extends AbstractRenderer
4444
*/
4545
public const AUTO_FORMAT_CHANGES = true;
4646

47-
/**
48-
* {@inheritdoc}
49-
*/
5047
public function getResultForIdenticalsDefault(): string
5148
{
5249
return '';
@@ -105,19 +102,13 @@ public function getChanges(Differ $differ): array
105102
return $changes;
106103
}
107104

108-
/**
109-
* {@inheritdoc}
110-
*/
111105
protected function renderWorker(Differ $differ): string
112106
{
113107
$rendered = $this->redererChanges($this->getChanges($differ));
114108

115109
return $this->cleanUpDummyHtmlClosures($rendered);
116110
}
117111

118-
/**
119-
* {@inheritdoc}
120-
*/
121112
protected function renderArrayWorker(array $differArray): string
122113
{
123114
$this->ensureChangesUseIntTag($differArray);

src/Renderer/Html/Combined.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ final class Combined extends AbstractHtml
3030
*/
3131
public const AUTO_FORMAT_CHANGES = false;
3232

33-
/**
34-
* {@inheritdoc}
35-
*/
3633
protected function redererChanges(array $changes): string
3734
{
3835
if (empty($changes)) {

src/Renderer/Html/Inline.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ final class Inline extends AbstractHtml
1919
'type' => 'Html',
2020
];
2121

22-
/**
23-
* {@inheritdoc}
24-
*/
2522
protected function redererChanges(array $changes): string
2623
{
2724
if (empty($changes)) {

src/Renderer/Html/Json.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@
99
*
1010
* @deprecated 6.8.0 Use the "JsonHtml" renderer instead.
1111
*/
12-
final class Json extends JsonHtml
13-
{
14-
}
12+
final class Json extends JsonHtml {}

src/Renderer/Html/JsonHtml.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,11 @@ class JsonHtml extends AbstractHtml
2424
*/
2525
public const IS_TEXT_RENDERER = true;
2626

27-
/**
28-
* {@inheritdoc}
29-
*/
3027
public function getResultForIdenticalsDefault(): string
3128
{
3229
return '[]';
3330
}
3431

35-
/**
36-
* {@inheritdoc}
37-
*/
3832
protected function redererChanges(array $changes): string
3933
{
4034
if ($this->options['outputTagAsString']) {
@@ -58,9 +52,6 @@ protected function convertTagToString(array &$changes): void
5852
}
5953
}
6054

61-
/**
62-
* {@inheritdoc}
63-
*/
6455
protected function formatStringFromLines(string $string): string
6556
{
6657
return $this->htmlSafe($string);

0 commit comments

Comments
 (0)