-
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 1) no need for this if not used
-
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 1) I guess you still need to return something that "makes sense".
Any code can call this function and should know what to do with the result. Here there is nothing.
Maybe the comment of the interface function should be updated as well to explain the behavior -
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultTest.php (Diff revision 1) This is not how mocks are supposed to be created.
You either use the mock builder for PHPUnit to automatically create a mock of the class you want.
Or you define manually a mock class yourself if really needed (this happens rarely)
Here you seem to mix things
-
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 1) This could be even shorter by just returning the boolean result.
return ($this->error_number == self::DEADLOCK_ERR_CODE);
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 1) The newer php array syntax is prefered.
[]
overarray()
-
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultResultTest.php (Diff revision 1) This is not needed if you call the set up method
setUp()
in SQLite3QueryResultTest -
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultResultTest.php (Diff revision 1) The LunrBaseTest class has a function for this:
get_accessible_reflection_property($property)
And in this case you could even use the
assertPropertySame($property, $expected)
function. -
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultResultTest.php (Diff revision 1) LunrBaseTests
set_reflection_property_value
is an easy replacement for this. -
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultResultTest.php (Diff revision 1) assertEquals
tests only the value of the parameters whileassertSame
tests the type as well. Saves you some lines. -
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultTest.php (Diff revision 1) this needs to be
setUp()
or it wont be run :(
Change Summary:
Added four new test classes for SQLite3QueryResult and improved the existing classes for SQLite3QueryResult
Change Summary:
Changed the DatabaseQueryResultInterface so SQLite3QueryResult is not forced to use number_of_rows() which is not supported.
Diff: |
Revision 3 (-17) |
---|
Change Summary:
Corrected the diff.
Diff: |
Revision 4 (+1189 -8)
|
---|
Change Summary:
Applied the M2mobi coding standards to the classes.
Diff: |
Revision 5 (+1234 -8)
|
---|
-
The rest looks fine
-
src/Lunr/Gravity/Database/DatabaseQueryResultInterface.php (Diff revision 5) this can't be removed like that
some projects most likely already use it -
-
tests/phpunit.xml (Diff revision 5) If this was missing before, don't make it part of this review but create another one
This is confusing if you mix different unrelated things in a same review
Diff: |
Revision 6 (+1248 -4)
|
---|
-
-
src/Lunr/Gravity/Database/DatabaseQueryResultInterface.php (Diff revision 6) This does not mean what you think it means. A query might have rows, but it's just string formatting depending on where in the query I set a line-break, and even that only when I type it manually ;)
The query we generate only has one row. -
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 6) what about SQLiteResult->numRows()?
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 6) pls use [] instead of array()
-
Make sure you check the other files for the comment changes as well. Didn't mark all of them.
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 6) This is not in tests though (no big deal but i'm nitpicking anyways)
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 6) Usually has email address (yay, nitpicking)
-
src/Lunr/Gravity/Database/SQLite3/SQLite3QueryResult.php (Diff revision 6) No need for
? TRUE : FALSE
($this->error_number == self::DEADLOCK_ERR_CODE)
will already return a boolean. -
-
-
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultBaseTest.php (Diff revision 6) We don't generally define the Tests part of the namespace in the package. (again no big deal)
-
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultBaseTest.php (Diff revision 6) Many of the functions here are missing an
@covers
annotation. -
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultFailedTest.php (Diff revision 6) See previous comments
-
src/Lunr/Gravity/Database/SQLite3/Tests/SQLite3QueryResultFailedTest.php (Diff revision 6) See previous comments
Change Summary:
Changed the number_of_rows function and did some small fixes to the comments.
Diff: |
Revision 7 (+1288 -4)
|
---|
Change Summary:
Removed some cover annotations for properties.
Diff: |
Revision 8 (+53 -31)
|
---|
Change Summary:
Added a test for number of rows.
Diff: |
Revision 9 (+52 -29)
|
---|