Skip to content

Commit d81114a

Browse files
committed
Require arrow functions where possible
1 parent 61c0711 commit d81114a

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

phpcs.xml.dist

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,13 @@
7878
</rule>
7979

8080

81-
<!-- ***************************************************** -->
81+
<!-- **************************************** -->
82+
<!-- Enable rules not enforced by Doctrine CS -->
83+
<!-- **************************************** -->
84+
85+
<!-- Require arrow functions where possible -->
86+
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
8287
<!-- Forbid fully qualified names even for colliding names -->
83-
<!-- ***************************************************** -->
8488
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
8589
<properties>
8690
<property name="allowFallbackGlobalConstants" value="false"/>
@@ -109,7 +113,6 @@
109113

110114
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification" />
111115
</rule>
112-
113116
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
114117
<properties>
115118
<!-- Requires PHP 8.0 -->
@@ -120,7 +123,6 @@
120123

121124
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingTraversableTypeHintSpecification" />
122125
</rule>
123-
124126
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
125127
<properties>
126128
<!-- Requires PHP 8.0 -->

tests/PedantryTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ public function testMethodsAreOrderedAlphabeticallyByVisibility($className): voi
3232

3333
$methods = array_filter(
3434
$methods,
35-
function (ReflectionMethod $method) use ($class) {
36-
return $method->getDeclaringClass() == $class // Exclude inherited methods
37-
&& $method->getFileName() === $class->getFileName(); // Exclude methods inherited from traits
38-
},
35+
fn (ReflectionMethod $method) => $method->getDeclaringClass() == $class // Exclude inherited methods
36+
&& $method->getFileName() === $class->getFileName(), // Exclude methods inherited from traits
3937
);
4038

4139
$getSortValue = function (ReflectionMethod $method) {

0 commit comments

Comments
 (0)