Skip to content

Commit 30fe1eb

Browse files
committed
Added and remove php cs fixer until it gets proper php 8.4 support
1 parent ae9c7de commit 30fe1eb

17 files changed

+45
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ vendor/
33
coverage.xml
44
coverage-html/
55
.phpunit/
6+
/.php-cs-fixer.cache

phpunit.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
<testsuite name="unit">
1919
<directory suffix="Test.php">tests/Unit</directory>
2020
</testsuite>
21+
22+
<testsuite name="ci">
23+
<directory suffix="Test.php">tests/Unit</directory>
24+
</testsuite>
2125
</testsuites>
2226

2327
<source>
@@ -31,7 +35,6 @@
3135

3236
<coverage>
3337
<report>
34-
<clover outputFile="coverage.xml"/>
3538
<html outputDirectory="coverage-html"/>
3639
</report>
3740
</coverage>

src/Attributes/PropertyAttributes/ArrayOfBackedEnums.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ class ArrayOfBackedEnums
1414
private static array $_enumReflections = [];
1515

1616
/** @var list<class-string<BackedEnum>> $enums */
17-
private(set) array $enums;
17+
private(set) public array $enums;
1818

1919
/** @var array<string, ReflectionEnum<BackedEnum>> */
20-
private(set) array $resolvedBackedEnumReflections = [];
20+
private(set) public array $resolvedBackedEnumReflections = [];
2121

2222
/**
2323
* @param class-string<BackedEnum>|list<class-string<BackedEnum>> $enums

src/Attributes/PropertyAttributes/ArrayOfData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class ArrayOfData
1616
private static array $_dataReflections = [];
1717

1818
/** @var list<class-string<Data>> */
19-
private(set) array $dataClasses;
19+
private(set) public array $dataClasses;
2020

2121
/** @var array<string, ReflectionClass<Data>> */
22-
private(set) array $resolvedDataReflections = [];
22+
private(set) public array $resolvedDataReflections = [];
2323

2424
/**
2525
* @param class-string<Data>|list<class-string<Data>> $dataClasses

src/Attributes/PropertyAttributes/ArrayOfDateTimes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class ArrayOfDateTimes
1717
private static array $_dateTimeReflections = [];
1818

1919
/** @var list<class-string<DateTime|DateTimeImmutable>> */
20-
private(set) array $dateTimes;
20+
private(set) public array $dateTimes;
2121

2222
/** @var array<string, ReflectionClass<DateTime|DateTimeImmutable>> */
23-
private(set) array $resolvedDateTimeReflections = [];
23+
private(set) public array $resolvedDateTimeReflections = [];
2424

2525
/**
2626
* @param class-string<DateTime|DateTimeImmutable>|list<class-string<DateTime|DateTimeImmutable>> $dateTimes
@@ -59,7 +59,7 @@ public function __construct(
5959
}
6060

6161
$this->dateTimes = is_array($dateTimes) ? $dateTimes : [$dateTimes];
62-
} catch(Exception) {
62+
} catch (Exception) {
6363
throw new InvalidArgumentException(
6464
'Invalid DateTime or DateTimeImmutable passed to ArrayOfDateTimes'
6565
);

src/Attributes/PropertyAttributes/ArrayOfScalarTypes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class ArrayOfScalarTypes
1111
{
1212
/** @var list<Type> $types */
13-
private(set) array $types;
13+
private(set) public array $types;
1414

1515
/**
1616
* @param Type|list<Type> $types

src/Concerns/BaseData.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ final public static function from(mixed $value): static
5151
$propertyDeserialized = true;
5252

5353
break;
54-
} catch (DeserializeException) {}
54+
} catch (DeserializeException) {
55+
}
5556
}
5657

5758
if (!$propertyDeserialized) {
@@ -97,7 +98,8 @@ final public function jsonSerialize(): array
9798
$propertySerialized = true;
9899

99100
break;
100-
} catch (SerializeException) {}
101+
} catch (SerializeException) {
102+
}
101103
}
102104

103105
if (!$propertySerialized) {

src/Concerns/SerializesArrayOfItems.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function serializeArrayOfItems(
2828
is_null($value) && $property->isNullable => null,
2929

3030
is_array($value) => array_map(
31-
fn(mixed $item) => $this->serializeItem($item, $property, $object),
31+
fn (mixed $item) => $this->serializeItem($item, $property, $object),
3232
$value
3333
),
3434

@@ -49,7 +49,7 @@ public function deserializeArrayOfItems(
4949
array $data
5050
): ?array {
5151
return array_map(
52-
fn(mixed $item) => $this->deserializeItem($item, $property),
52+
fn (mixed $item) => $this->deserializeItem($item, $property),
5353
$data
5454
);
5555
}

src/Contexts/TypeContext.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static function getInstances(ReflectionProperty $property): array
7070
$instances = [];
7171

7272
foreach ($reflectionTypes as $type) {
73-
switch(true) {
73+
switch (true) {
7474
case in_array($type, ['double', 'float']):
7575
$instances[] = new static(Type::FLOAT);
7676
break;
@@ -159,7 +159,8 @@ private static function resolvesDateTime(string $type): ?ReflectionClass
159159
}
160160
}
161161
// @codeCoverageIgnoreStart
162-
} catch (Exception) {}
162+
} catch (Exception) {
163+
}
163164
// @codeCoverageIgnoreEnd
164165

165166
return null;
@@ -182,7 +183,8 @@ private static function resolvesData(string $type): ?ReflectionClass
182183
return $reflection;
183184
}
184185
}
185-
} catch (Exception) {}
186+
} catch (Exception) {
187+
}
186188

187189
return null;
188190
}
@@ -200,7 +202,7 @@ private static function getPropertyStringTypes(ReflectionProperty $property): ar
200202
$type->getName(),
201203
],
202204
$type instanceof ReflectionUnionType => array_values(array_map(
203-
static fn(ReflectionType $type): string => $type instanceof ReflectionNamedType
205+
static fn (ReflectionType $type): string => $type instanceof ReflectionNamedType
204206
? $type->getName()
205207
: '',
206208
$type->getTypes()

src/Normalizers/Normalizer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
final public function __construct(
1313
protected mixed $value,
1414
protected string $class,
15-
) {}
15+
) {
16+
}
1617

1718
/**
1819
* @return array<string, mixed>|false

0 commit comments

Comments
 (0)