Skip to content

Commit

Permalink
minor #4762 Rename simple_lambda_call to regular_callable_call (julie…
Browse files Browse the repository at this point in the history
…nfalque)

This PR was merged into the 2.17-dev branch.

Discussion
----------

Rename simple_lambda_call to regular_callable_call

Reasoning:
* not all callables are lambdas;
* _simple_ is confusing IMO.

Commits
-------

204eb15 Rename simple_lambda_call to regular_callable_call
  • Loading branch information
SpacePossum committed Jan 28, 2020
2 parents a0db2be + 204eb15 commit 73a632c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,12 @@ Choose from the list of available rules:
ones; defaults to ``['getrandmax' => 'mt_getrandmax', 'rand' =>
'mt_rand', 'srand' => 'mt_srand']``

* **regular_callable_call**

Callables must be called without using ``call_user_func*`` when possible.

*Risky rule: risky when the ``call_user_func`` or ``call_user_func_array`` function is overridden.*

* **return_assignment** [@PhpCsFixer]

Local, dynamic and directly referenced variables should not be assigned
Expand Down Expand Up @@ -1836,12 +1842,6 @@ Choose from the list of available rules:

*Risky rule: silencing of deprecation errors might cause changes to code behaviour.*

* **simple_lambda_call**

Calling lambdas without using ``call_user_func*``, when possible.

*Risky rule: risky when the ``call_user_func`` or ``call_user_func_array`` function is overridden.*

* **simple_to_complex_string_variable** [@PhpCsFixer]

Converts explicit variables in double-quoted strings and heredoc syntax
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
/**
* @author Dariusz Rumiński <[email protected]>
*/
final class SimpleLambdaCallFixer extends AbstractFixer
final class RegularCallableCallFixer extends AbstractFixer
{
/**
* {@inheritdoc}
*/
public function getDefinition()
{
return new FixerDefinition(
'Calling lambdas without using `call_user_func*`, when possible.',
'Callables must be called without using `call_user_func*` when possible.',
[
new CodeSample(
'<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*
* @internal
*
* @covers \PhpCsFixer\Fixer\FunctionNotation\SimpleLambdaCallFixer
* @covers \PhpCsFixer\Fixer\FunctionNotation\RegularCallableCallFixer
*/
final class SimpleLambdaCallFixerTest extends AbstractFixerTestCase
final class RegularCallableCallFixerTest extends AbstractFixerTestCase
{
/**
* @param string $expected
Expand Down

0 comments on commit 73a632c

Please sign in to comment.