Skip to content

Commit 97ce569

Browse files
committed
Upgrade packages
Lock file operations: 0 installs, 14 updates, 4 removals - Removing ocramius/package-versions (2.5.1) - Removing symfony/polyfill-php73 (v1.26.0) - Removing symfony/polyfill-php80 (v1.26.0) - Removing webmozart/path-util (2.3.0) - Upgrading composer/pcre (1.0.1 => 3.0.0) - Upgrading composer/xdebug-handler (2.0.5 => 3.0.3) - Upgrading infection/abstract-testframework-adapter (0.3.1 => 0.5.0) - Upgrading infection/infection (0.23.0 => 0.26.13) - Upgrading lcobucci/coding-standard (7.0.0 => 8.0.0) - Upgrading monolog/monolog (2.8.0 => 3.2.0) - Upgrading ondram/ci-detector (3.5.1 => 4.1.0) - Upgrading psr/log (1.1.4 => 3.0.0) - Upgrading sanmai/pipeline (v5.2.1 => v6.1) - Upgrading symfony/console (v5.4.10 => v6.1.2) - Upgrading symfony/filesystem (v5.4.9 => v6.1.0) - Upgrading symfony/finder (v5.4.8 => v6.1.0) - Upgrading symfony/process (v5.4.8 => v6.1.0) - Upgrading thecodingmachine/safe (v1.3.3 => v2.2.2) Signed-off-by: Luís Cobucci <lcobucci@gmail.com>
1 parent 1613f81 commit 97ce569

File tree

9 files changed

+218
-497
lines changed

9 files changed

+218
-497
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
"require": {
2222
"php-64bit": "^8.1",
2323
"ext-pcntl": "*",
24-
"psr/log": "^1.1",
24+
"psr/log": "^3.0",
2525
"react/socket": "^1.6"
2626
},
2727
"require-dev": {
28-
"infection/infection": "^0.23",
29-
"lcobucci/coding-standard": "^7.0",
30-
"monolog/monolog": "^2.2",
28+
"infection/infection": "^0.26",
29+
"lcobucci/coding-standard": "^8.0",
30+
"monolog/monolog": "^3.2",
3131
"phpstan/extension-installer": "^1.1",
3232
"phpstan/phpstan": "^1.8",
3333
"phpstan/phpstan-deprecation-rules": "^1.0",

composer.lock

Lines changed: 196 additions & 461 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Protocol/Buffer.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ final class Buffer
2727
private const CONVERSION_SHORT = [2 ** 15 - 1, 2 ** 16];
2828
private const CONVERSION_INT = [2 ** 31 - 1, 2 ** 32];
2929

30-
private string $bytes;
31-
private int $length;
3230
private int $position = 0;
3331

34-
private function __construct(string $bytes, int $length)
32+
private function __construct(private string $bytes, private int $length)
3533
{
36-
$this->bytes = $bytes;
37-
$this->length = $length;
3834
}
3935

4036
/**

src/Protocol/Schema/Field.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@
1313
*/
1414
final class Field
1515
{
16-
private string $name;
17-
private Type $type;
18-
19-
public function __construct(string $name, Type $type)
16+
public function __construct(private string $name, private Type $type)
2017
{
21-
$this->name = $name;
22-
$this->type = $type;
2318
}
2419

2520
public function name(): string

src/Protocol/SchemaValidationFailure.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,43 @@ public static function nullValue(string $expectedType): self
2222
public static function incorrectType(mixed $data, string $expectedType): self
2323
{
2424
return new self(
25-
sprintf('%s(%s) does not have expected type: %s', gettype($data), $data, $expectedType)
25+
sprintf('%s(%s) does not have expected type: %s', gettype($data), $data, $expectedType),
2626
);
2727
}
2828

2929
public static function incorrectClass(object $data, string $expectedClass): self
3030
{
3131
return new self(
32-
sprintf('Object (%s) is not an instance of: %s', $data::class, $expectedClass)
32+
sprintf('Object (%s) is not an instance of: %s', $data::class, $expectedClass),
3333
);
3434
}
3535

3636
public static function incorrectRange(int $data, int $lowerBound, int $upperBound): self
3737
{
3838
return new self(
39-
sprintf('%d is not between expected range: [%d, %d]', $data, $lowerBound, $upperBound)
39+
sprintf('%d is not between expected range: [%d, %d]', $data, $lowerBound, $upperBound),
4040
);
4141
}
4242

4343
public static function incorrectLength(int $length, int $maxLength): self
4444
{
4545
return new self(
46-
sprintf('String length (%d) is larger than the maximum length (%d)', $length, $maxLength)
46+
sprintf('String length (%d) is larger than the maximum length (%d)', $length, $maxLength),
4747
);
4848
}
4949

5050
public static function missingField(string $name): self
5151
{
5252
return new self(
53-
sprintf('Field "%s" missing from given structure', $name)
53+
sprintf('Field "%s" missing from given structure', $name),
5454
);
5555
}
5656

5757
public static function invalidValueForField(string $name, SchemaValidationFailure $failure): self
5858
{
5959
return new self(
6060
message: sprintf('Invalid value for field "%s": %s', $name, $failure->getMessage()),
61-
previous: $failure
61+
previous: $failure,
6262
);
6363
}
6464
}

src/Protocol/Type/ArrayOf.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,8 @@
1010

1111
final class ArrayOf extends Type
1212
{
13-
private Type $type;
14-
private bool $nullable;
15-
16-
public function __construct(Type $type, bool $nullable = false)
13+
public function __construct(private Type $type, private bool $nullable = false)
1714
{
18-
$this->type = $type;
19-
$this->nullable = $nullable;
2015
}
2116

2217
public function write(mixed $data, Buffer $buffer): void

src/Protocol/Type/NonNullableBytes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function write(mixed $data, Buffer $buffer): void
3030
public function read(Buffer $buffer): Buffer
3131
{
3232
return Buffer::fromContent(
33-
$buffer->read($buffer->readInt())
33+
$buffer->read($buffer->readInt()),
3434
);
3535
}
3636

src/Protocol/ValueOutOfAllowedRange.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public static function forRange(int $value, int $lowerBound, int $upperBound): s
1717
'Given value (%s) is out of the expected range [%s, %s]',
1818
$value,
1919
$lowerBound,
20-
$upperBound
21-
)
20+
$upperBound,
21+
),
2222
);
2323
}
2424
}

tests/Unit/Protocol/SchemaTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function readShouldUseFieldDataToParseMessage(): void
5858
$buffer = Buffer::fromContent(pack('c2', 1, 10));
5959
$schema = new Schema(
6060
new Schema\Field('test1', new Int8()),
61-
new Schema\Field('test2', new Int8())
61+
new Schema\Field('test2', new Int8()),
6262
);
6363

6464
self::assertSame(['test1' => 1, 'test2' => 10], $schema->read($buffer));
@@ -80,7 +80,7 @@ public function sizeOfShouldReturnTheNumberOfBytesNeededForEveryFieldInSchema():
8080
{
8181
$schema = new Schema(
8282
new Schema\Field('test1', new Int8()),
83-
new Schema\Field('test2', new NonNullableString())
83+
new Schema\Field('test2', new NonNullableString()),
8484
);
8585

8686
self::assertSame(7, $schema->sizeOf(['test1' => 1, 'test2' => 'test']));
@@ -102,7 +102,7 @@ public function validateShouldNotRaiseExceptionWhenValueIsAnArrayWithAllRequired
102102
{
103103
$schema = new Schema(
104104
new Schema\Field('test1', new Int8()),
105-
new Schema\Field('test2', new NullableString())
105+
new Schema\Field('test2', new NullableString()),
106106
);
107107

108108
$schema->validate(['test1' => 1, 'test2' => 'test']);
@@ -127,7 +127,7 @@ public function validateShouldRaiseExceptionWhenValueIsNull(): void
127127
{
128128
$schema = new Schema(
129129
new Schema\Field('test1', new Int8()),
130-
new Schema\Field('test2', new Int8())
130+
new Schema\Field('test2', new Int8()),
131131
);
132132

133133
$this->expectException(SchemaValidationFailure::class);
@@ -151,7 +151,7 @@ public function validateShouldRaiseExceptionWhenValueIsNotAnArray(): void
151151
{
152152
$schema = new Schema(
153153
new Schema\Field('test1', new Int8()),
154-
new Schema\Field('test2', new Int8())
154+
new Schema\Field('test2', new Int8()),
155155
);
156156

157157
$this->expectException(SchemaValidationFailure::class);
@@ -177,7 +177,7 @@ public function validateShouldRaiseExceptionWhenValueOfOneOfTheFieldsIsInvalid()
177177
{
178178
$schema = new Schema(
179179
new Schema\Field('test1', new Int8()),
180-
new Schema\Field('test2', new Int8())
180+
new Schema\Field('test2', new Int8()),
181181
);
182182

183183
$this->expectException(SchemaValidationFailure::class);

0 commit comments

Comments
 (0)