
Branch: refs/heads/master Home: https://github.com/phpmyadmin/phpmyadmin Commit: dea4c972afce6ba8d7bc904d2706924befc503de https://github.com/phpmyadmin/phpmyadmin/commit/dea4c972afce6ba8d7bc904d2706... Author: Kamil Tekiela <tekiela246@gmail.com> Date: 2021-12-02 (Thu, 12 December 2021) -03:00 Changed paths: M libraries/classes/Relation.php M psalm-baseline.xml Log Message: ----------- Refactor relations.php (#17210) * Refactor getComments() Use early return and remove redundant if statement. Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Fix indentation Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Remove temporary variable Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Remove redundant code Remove redundant if statement. Break at the end of the loop. elseif when there is no other choice. Redundant ! empty(). Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Collapse if statement into an elvis operator Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Better type hinting for return array We can tell Psalm what to expect, but we should declare the variables first. Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Remove dead code Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Use array_keys instead of unused variable Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Add type declaration and psalm-return Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Add psalm-return to checkChildForeignReferences() Also added type declaration, and simplified the code Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Refactor getChildReferences() Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Improve type inference for foreignDropdown Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * [bugfix] Cast the value to a string to avoid type mismatch. Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Add proper string type declaration to $foreign_filter Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>