Skip to content

Commit

Permalink
[ObjectCalisthenics] Remove NoChainMethodCallRule, as more exceptions…
Browse files Browse the repository at this point in the history
… than rules (#50)
  • Loading branch information
TomasVotruba committed May 17, 2023
1 parent 8317152 commit a0967f0
Show file tree
Hide file tree
Showing 19 changed files with 1 addition and 488 deletions.
1 change: 0 additions & 1 deletion config/code-complexity-rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ rules:
- Symplify\PHPStanRules\Rules\Enum\RequireEnumDocBlockOnConstantListPassRule
- Symplify\PHPStanRules\Rules\NoFuncCallInMethodCallRule
- Symplify\PHPStanRules\Rules\NoDynamicNameRule
- Symplify\PHPStanRules\ObjectCalisthenics\Rules\NoChainMethodCallRule
- Symplify\PHPStanRules\Rules\ForbiddenNestedCallInAssertMethodCallRule
- Symplify\PHPStanRules\Rules\Explicit\NoRelativeFilePathRule
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ services:
arguments:
minNameLength: 3
allowedShortNames: ['id', 'to', 'up']

rules:
- Symplify\PHPStanRules\ObjectCalisthenics\Rules\NoChainMethodCallRule
3 changes: 0 additions & 3 deletions config/services/services.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ services:
- Symplify\PHPStanRules\Enum\EnumConstantAnalyzer
- Symplify\PHPStanRules\Formatter\RequiredWithMessageFormatter
- Symplify\PHPStanRules\Location\DirectoryChecker
- Symplify\PHPStanRules\Matcher\ObjectTypeMatcher
- Symplify\PHPStanRules\Matcher\PositionMatcher
- Symplify\PHPStanRules\Matcher\SharedNamePrefixMatcher
- Symplify\PHPStanRules\Naming\BoolishNameAnalyser
Expand Down Expand Up @@ -57,8 +56,6 @@ services:
- Symplify\PHPStanRules\Matcher\Collector\PublicClassMethodMatcher
- Symplify\PHPStanRules\Matcher\ClassMethodCallReferenceResolver
- Symplify\PHPStanRules\Printer\CollectorMetadataPrinter
- Symplify\PHPStanRules\NodeAnalyzer\MethodCall\AllowedChainCallSkipper


-
class: Symplify\PHPStanRules\NodeVisitor\AssignedToPropertyNodeVisitor
Expand Down
45 changes: 1 addition & 44 deletions docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 89 Rules Overview
# 88 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -1143,49 +1143,6 @@ class SomeClass

<br>

## NoChainMethodCallRule

Do not use chained method calls. Put each on separated lines.

:wrench: **configure it!**

- class: [`Symplify\PHPStanRules\ObjectCalisthenics\Rules\NoChainMethodCallRule`](../packages/ObjectCalisthenics/Rules/NoChainMethodCallRule.php)

```yaml
services:
-
class: Symplify\PHPStanRules\ObjectCalisthenics\Rules\NoChainMethodCallRule
tags: [phpstan.rules.rule]
arguments:
allowedChainTypes:
- AllowedFluent
```


```php
$this->runThis()->runThat();

$fluentClass = new AllowedFluent();
$fluentClass->one()->two();
```

:x:

<br>

```php
$this->runThis();
$this->runThat();

$fluentClass = new AllowedFluent();
$fluentClass->one()->two();
```

:+1:

<br>

## NoConstructorInTestRule

Do not use constructor in tests. Move to `setUp()` method
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

96 changes: 0 additions & 96 deletions packages/ObjectCalisthenics/Rules/NoChainMethodCallRule.php

This file was deleted.

0 comments on commit a0967f0

Please sign in to comment.