Skip to content
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

Refactor ArrayExpressionBuilder.php #300

Merged
merged 12 commits into from
Jul 28, 2023

Conversation

Tigrov
Copy link
Member

@Tigrov Tigrov commented Jul 25, 2023

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues -

@what-the-diff
Copy link

what-the-diff bot commented Jul 25, 2023

PR Summary

  • Refactor ArrayExpressionBuilder.php
    This PR features refinements to ArrayExpressionBuilder.php. Import of Traversable was removed and replaced with is_iterable. The build method was slightly altered to utilize ArrayExpression instead of ExpressionInterface, ensuring more specific use.

  • Increase Code Encapsulation
    In an effort to enhance the encapsulation and increase the maintainability of the code, the visibility of several methods - buildPlaceholders, getTypeHint, buildSubqueryArray, and typecastValue were changed from protected to private. This adjustment restricts external access to these methods, ensuring they can only be called within the class itself.

  • New Test Case for ArrayExpressionBuilder Class
    A new file ArrayExpressionBuilderTest.php was included. This file contains a new test case specifically written for the typecastValue method. This increases the code's test coverage, enabling more reliable and stable features for our end-users.

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.01% ⚠️

Comparison is base (e5de2fc) 99.83% compared to head (6188744) 99.83%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #300      +/-   ##
============================================
- Coverage     99.83%   99.83%   -0.01%     
+ Complexity      201      200       -1     
============================================
  Files            13       13              
  Lines           599      596       -3     
============================================
- Hits            598      595       -3     
  Misses            1        1              
Files Changed Coverage Δ
src/Builder/ArrayExpressionBuilder.php 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Tigrov Tigrov marked this pull request as ready for review July 25, 2023 06:11
@terabytesoftw
Copy link
Member

Hi, i really don't like the change, why change the interface for the implementation?

@Tigrov
Copy link
Member Author

Tigrov commented Jul 25, 2023

@Tigrov
Copy link
Member Author

Tigrov commented Jul 25, 2023

And ExpressionInterface does not have getValue() and getType() and getDimension() methods

@terabytesoftw terabytesoftw requested a review from darkdef July 25, 2023 18:29
Copy link
Member

@vjik vjik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need changelog.

src/Builder/ArrayExpressionBuilder.php Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@vjik vjik merged commit 16c4eee into yiisoft:master Jul 28, 2023
@vjik
Copy link
Member

vjik commented Jul 28, 2023

@Tigrov Thanks 👍

@Tigrov Tigrov deleted the refactor_array_expression_builder branch July 28, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants