PhpCSFixer-Custom-Fixers icon indicating copy to clipboard operation
PhpCSFixer-Custom-Fixers copied to clipboard

Feature: override static_lambda in specs

Open TamasSzigeti opened this issue 4 years ago • 4 comments

Thanks for this package!

Given static lambdas do not work with phpspec, how about adding this to the phpspec rules, to drop the static from lambdas in the spec files, similar to how visibility is dropped?

TIA

TamasSzigeti avatar Feb 12 '21 07:02 TamasSzigeti

@TamasSzigeti can you give me an example ?

PedroTroller avatar May 31 '21 19:05 PedroTroller

Sorry for the lack of details. What I meant is that when you pass a callback to will() and cs-fixer adds static to it, then it failed with

warning: Cannot bind an instance to a static closure in vendor/phpspec/prophecy/src/Prophecy/Promise/CallbackPromise.php line 61

Interestingly, I can't reproduce it anymore, the static is not being added, so I guess it was fixed somewhere along the way. Closing this, thank you though!

TamasSzigeti avatar May 31 '21 20:05 TamasSzigeti

Ah sorry it does reproduce, I was looking at the wrong place. So it would be nice if we could use static_lambda and this package would override it for spec files.

Shall I provide full example or this is clear enough?

TamasSzigeti avatar May 31 '21 20:05 TamasSzigeti

Looks clear. I will try to find a solution ;)

PedroTroller avatar May 31 '21 21:05 PedroTroller

:tada: This issue has been resolved in version 2.31.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

PedroTroller avatar Mar 08 '23 12:03 PedroTroller

Thanks @TamasSzigeti :wink:

PedroTroller avatar Mar 08 '23 12:03 PedroTroller