Conversation
irgendwr
requested changes
Oct 13, 2018
src/Folder.php
Outdated
| /** | ||
| * shouldContainsChildren checks if the given file should be | ||
| * | ||
| * @return string folder UUID |
Member
There was a problem hiding this comment.
Wrong return type & description
src/API.php
Outdated
| } | ||
| } | ||
| } | ||
| if (sizeof($todo) !== 0) { |
Member
There was a problem hiding this comment.
I'd use count instead of sizeof
src/File.php
Outdated
| /** | ||
| * Class File | src/File.php | ||
| * | ||
| * A single File with his available actions |
Member
There was a problem hiding this comment.
"his" should be "it's" since a file is not human and can't have a gender. 😄 This also occurs in other files.
src/API.php
Outdated
| } | ||
| } | ||
| if (sizeof($todo) !== 0) { | ||
| throw new Exception('Inconsistent data...'); |
Member
There was a problem hiding this comment.
Maybe 'Invalid parent' would be a more clear error.
src/API.php
Outdated
| } | ||
| } | ||
|
|
||
| $todo = array_filter($files, function ($file) { |
Member
There was a problem hiding this comment.
Instead of calling array_filter twice and foreach twice you could also do the same thing with two foreach loops.
In the first one you can check if $file["parent"] === "", array_push it as Folder or File to $parents, if not you can add it to $items and loop over them in a second foreach like you did below.
9c2d2c9 to
013bbe3
Compare
irgendwr
approved these changes
Oct 13, 2018
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.
This pull request integrates the Track and Folder class. So that the handling with these often used objects is more easier.
Fix: #11
Fix: #12