yiisoft / yii2

Yii 2: The Fast, Secure and Professional PHP Framework
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
14.24k stars 6.9k forks source link

Attach behavior via "as behaviorName" with Closure #20248

Closed timkelty closed 1 month ago

timkelty commented 2 months ago

Allows behaviors attached with the 'as behaviorName' syntax to use a Closure.

In the process of writing a test, I discovered the \yiiunit\framework\base\ComponentTest::testAttachBehavior test was broken (it has assertions that were never reached), so I fixed that as well.

Q A
Is bugfix? ✔️
New feature? ✔️
Breaks BC?
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 64.95%. Comparing base (eb304e7) to head (8724ba3). Report is 7 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #20248 +/- ## ============================================ - Coverage 64.95% 64.95% -0.01% - Complexity 11395 11396 +1 ============================================ Files 430 430 Lines 36923 36925 +2 ============================================ - Hits 23985 23984 -1 - Misses 12938 12941 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

timkelty commented 2 months ago

Added lines #L193 - L194 were not covered by tests

Could you add a test for that.

@schmunk42 the test for that is here. I'm not sure why that warning is showing in the Github diff. It isn't showing here: https://app.codecov.io/gh/yiisoft/yii2/pull/20248

timkelty commented 2 months ago

Can you rollback changes to the two files under db/ ?

@machour Done. CS/lint check will fail, but not from changes in this PR.

mtangoo commented 1 month ago

@timkelty thanks for your time and efforts. Can you please resolve the conflict to enable final review and possibly merging it?

timkelty commented 1 month ago

All set, @mtangoo.

mtangoo commented 1 month ago

All set, @mtangoo.

Thanks for your time and efforts. We will review and merge it if all is good without delay!

mtangoo commented 1 month ago

@timkelty the PR is good. Can you add a line in changelog so that we can merge this?

timkelty commented 1 month ago

@timkelty the PR is good. Can you add a line in changelog so that we can merge this?

Done!

mtangoo commented 1 month ago

@timkelty thanks for your time and efforts