Conversation
| return isset($this->filesystems[$name]); | ||
| } | ||
|
|
||
| /** @return array<string> */ |
There was a problem hiding this comment.
Moved to the interface.
|
|
||
| if (is_array($path)) { | ||
| return self::fromParts($path); | ||
| } | ||
|
|
||
| if ($path instanceof SplFileInfo) { | ||
| return self::fromSplFileInfo($path); | ||
| } | ||
|
|
||
| throw new RuntimeException(sprintf( | ||
| 'Do not know how to create FilePath from "%s"', | ||
| is_object($path) ? get_class($path) : gettype($path) | ||
| )); |
There was a problem hiding this comment.
Those were only used in tests. The rest of the code already uses the correct function.
There was a problem hiding this comment.
they were used by tests though, removing this changes the purpose of the function (fromUnknown)
There was a problem hiding this comment.
can rename to fromFilePathOrString for clarity
There was a problem hiding this comment.
Yes, I mean most other function that deal with paths also except both.
There was a problem hiding this comment.
If possible I would like to remove those kinds of methods entirely and reduce the amount of "unknown"s from phpactor. :D
| /** | ||
| * @return Generator<string,array{string,string,Closure(ReflectionTrait): void}> | ||
| */ | ||
| public function provideReflectionTrait(): Generator |
There was a problem hiding this comment.
This function was partly returning an array and partly generator. So now there are more tests at the end that now also get executed.
692b8b7 to
d9ed777
Compare
|
thanks |
Using phpactor to generate return types for phpactor code.
What is in here:
isClassandisInterfacecalls from the code and replaced them with instanceof calls.