Checksum and reliability : some (a bit offensive) notes on code exploration and refactorization#2
Open
Checksum and reliability : some (a bit offensive) notes on code exploration and refactorization#2
Conversation
| // handle https://www.php.net/manual/fr/function.hash-algos.php automatically | ||
| $headers["x-file-md5"]; | ||
| $context = hash_init('md5'); | ||
| hash_update_stream($context, $this->stream, $length); |
Check failure
Code scanning / Psalm
UndefinedThisPropertyFetch
| // handle https://www.php.net/manual/fr/function.hash-algos.php automatically | ||
| $headers["x-file-md5"]; | ||
| $context = hash_init('md5'); | ||
| hash_update_stream($context, $this->stream, $length); |
Check failure
Code scanning / Psalm
UndefinedVariable
| $headers["x-file-md5"]; | ||
| $context = hash_init('md5'); | ||
| hash_update_stream($context, $this->stream, $length); | ||
| fseek($this->stream, -$length, SEEK_CUR); |
Check failure
Code scanning / Psalm
UndefinedVariable
| $server->on('method:POST', [$this, 'httpPost'], 10); | ||
| } | ||
|
|
||
| private function checkHashes($content, $headers) { |
Check notice
Code scanning / Psalm
MissingReturnType
| $server->on('method:POST', [$this, 'httpPost'], 10); | ||
| } | ||
|
|
||
| private function checkHashes($content, $headers) { |
Check notice
Code scanning / Psalm
MissingParamType
| $server->on('method:POST', [$this, 'httpPost'], 10); | ||
| } | ||
|
|
||
| private function checkHashes($content, $headers) { |
Check notice
Code scanning / Psalm
MissingParamType
|
|
||
| if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) { | ||
| // TODO: add setting to disable this : we don't want to loose file modification atomicity inadvertedly | ||
| if (!$view->isCreatable($partFilePath) && $view->isUpdatable($this->path)) { // If we cant create part but can update existing, don't use part |
Check notice
Code scanning / Psalm
PossiblyNullReference
| try { | ||
| $count = $partStorage->writeStream($internalPartPath, $wrappedData); | ||
| // TODO: write then move ? At this point we dont know if writting to a final file or a part file | ||
| $count = $partStorage->writeStream($internalPartPath, $wrappedData); // stream able storage, lets write as stream |
Check notice
Code scanning / Psalm
PossiblyFalseArgument
d909bb5 to
5e3d670
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An exploration PR meant to be trashed.
Mostly a tool for code exploration.
Don't mind the tone that is a bit aggressive in comments, I'm in a mood of "let yourself be surprised". Obviously the final goal is to understand the rational behind implementations and I know things are the way they are for good reasons :)