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
Enable phan and phpstan #28
Conversation
['a8', decoct((int) str_pad($this->uid, 7, '0', STR_PAD_LEFT))], | ||
['a8', decoct((int) str_pad($this->gid, 7, '0', STR_PAD_LEFT))], |
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.
phan
correctly complains that an decoct
must be passed an int
* @return string unsigned checksum | ||
* @return float|int unsigned checksum |
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.
This function does actually return a number (usually an int, but if the number is big, then it could end up being a float.
@@ -149,7 +149,7 @@ public function finalize() { | |||
* Initialize a file stream | |||
* | |||
* @param string $name file path or just name | |||
* @param int $type type of the item | |||
* @param int|string $type type of the item |
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.
Some code passes an int
"magic number", other code passes a single char like "x"
* @link http://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current tar / PAX spec | ||
*/ | ||
protected function paxGenerate($fields) { | ||
$lines = ''; | ||
foreach ($fields as $name => $value) { | ||
// build the line and the size | ||
$line = ' ' . $name . '=' . $value . "\n"; | ||
$size = \strlen(\strlen($line)) + \strlen($line); | ||
$size = \strlen((string) \strlen($line)) + \strlen($line); |
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.
strlen
needs to be passed a string - added an explicit cast otherwise phan complains.
https://drone.owncloud.com/owncloud/TarStreamer/23/3/3 |
No description provided.