Skip to content

Commit 7efb553

Browse files
vjikgithub-actions[bot]
authored andcommitted
Apply PHP CS Fixer and Rector changes (CI)
1 parent cdf773f commit 7efb553

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/Modern/DataResponseFormatter/XmlResponseFormatter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ public function __construct(
3838
private readonly string $encoding = 'UTF-8',
3939
private readonly string $version = '1.0',
4040
private readonly string $rootTag = 'response',
41-
) {
42-
}
41+
) {}
4342

4443
public function format(mixed $data, ResponseInterface $response): ResponseInterface
4544
{

src/Modern/DataStream.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use Psr\Http\Message\StreamInterface;
88
use Yiisoft\DataResponse\Modern\DataFormatter\StringDataFormatter;
99

10+
use const SEEK_SET;
11+
1012
/**
1113
* A lazy stream that formats data only when it's being read.
1214
*
@@ -24,7 +26,11 @@ final class DataStream implements StreamInterface
2426
public function __construct(
2527
private mixed $data,
2628
private DataFormatterInterface $formatter = new StringDataFormatter(),
27-
) {
29+
) {}
30+
31+
public function __toString(): string
32+
{
33+
return (string) $this->getFormatted();
2834
}
2935

3036
/**
@@ -49,11 +55,6 @@ public function changeData(mixed $data): void
4955
$this->resetState();
5056
}
5157

52-
public function __toString(): string
53-
{
54-
return (string) $this->getFormatted();
55-
}
56-
5758
public function close(): void
5859
{
5960
$this->getFormatted()->close();

src/Modern/StringStream.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
use function strlen;
1111

12+
use const SEEK_CUR;
13+
use const SEEK_END;
14+
use const SEEK_SET;
15+
1216
/**
1317
* A read-only stream implementation for string content.
1418
*
@@ -22,8 +26,7 @@ final class StringStream implements StreamInterface
2226

2327
public function __construct(
2428
private readonly string $content,
25-
) {
26-
}
29+
) {}
2730

2831
public function __toString(): string
2932
{
@@ -130,7 +133,7 @@ public function read(int $length): string
130133
public function getContents(): string
131134
{
132135
return $this->read(
133-
$this->getContentSize() - $this->position
136+
$this->getContentSize() - $this->position,
134137
);
135138
}
136139

0 commit comments

Comments
 (0)