New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added more tests and scrutnizer fixes #107
Conversation
@@ -40,7 +40,7 @@ | |||
/** @var bool */ | |||
private $moved = false; | |||
|
|||
/** @var int|null */ | |||
/** @var int */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually impossible to create an UploadedFile with $size = null
src/UploadedFile.php
Outdated
* | ||
* @throws \RuntimeException on error | ||
*/ | ||
private function copyToStream(StreamInterface $source, StreamInterface $dest, $maxLen = -1): void | ||
private function copyToStream(StreamInterface $source, StreamInterface $dest): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are never using the third parameter, That is why I could remove the dead code
@@ -19,7 +19,7 @@ public function testConstructorInitializesProperties() | |||
$this->assertTrue($stream->isWritable()); | |||
$this->assertTrue($stream->isSeekable()); | |||
$this->assertEquals('php://temp', $stream->getMetadata('uri')); | |||
$this->assertInternalType('array', $stream->getMetadata()); | |||
$this->assertIsArray($stream->getMetadata()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertInternalType
is deprecated
Im done with this PR now. |
I don’t understand the Travis error on this one… It seems to complain about I haven’t used PHPStan before so this will be interesting to check out. Overall all the code changes look good to me! |
PHPStan is pretty cool. We do get a few false negatives but that is fine. I added the docs on It is not an actual BC break for two reasons:
Thank you for the review |
No description provided.