Skip to content

Commit 78d7747

Browse files
committed
Don't break when property types are removed
1 parent ba8958f commit 78d7747

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/Exercise/PhpGetsAPromotion.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private function getPropertyType(\ReflectionProperty $prop): string
178178
$type = $prop->getType();
179179

180180
if (null === $type || !$type instanceof \ReflectionNamedType) {
181-
throw new \RuntimeException(sprintf('Invalid property "%s"', $prop->getName()));
181+
return '';
182182
}
183183
/** @var \ReflectionNamedType $type */
184184
return $type->getName();
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
class RowVisitorTypeMutated
4+
{
5+
protected string $basePath;
6+
7+
public function __construct(
8+
private \Closure $visitor,
9+
private \Stringable $key,
10+
array $config = []
11+
) {
12+
$this->basePath = $config['basePath'] ?? '';
13+
}
14+
15+
public function readCsv(string $filePath)
16+
{
17+
// noop
18+
}
19+
}

0 commit comments

Comments
 (0)