Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
[PHPStanRules] Remove NoMaskWithoutSprintfRule, might be useful to us…
Browse files Browse the repository at this point in the history
…e mask sometimes
  • Loading branch information
TomasVotruba committed Feb 20, 2022
1 parent 9f70dfd commit 8615230
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 309 deletions.
4 changes: 0 additions & 4 deletions packages/phpstan-rules/config/static-rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ services:
class: Symplify\PHPStanRules\Rules\NoSuffixValueObjectClassRule
tags: [phpstan.rules.rule]

-
class: Symplify\PHPStanRules\Rules\NoMaskWithoutSprintfRule
tags: [phpstan.rules.rule]

-
class: Symplify\PHPStanRules\Rules\RequireThisOnParentMethodCallRule
tags: [phpstan.rules.rule]
Expand Down
87 changes: 1 addition & 86 deletions packages/phpstan-rules/docs/rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 132 Rules Overview
# 130 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -1435,69 +1435,6 @@ final class SomeRector implements RectorInterface

<br>

## ForbiddenPrivateMethodByTypeRule

Private method in is not allowed here - it should only delegate to others. Decouple the private method to a new service class

:wrench: **configure it!**

- class: [`Symplify\PHPStanRules\Rules\ForbiddenPrivateMethodByTypeRule`](../src/Rules/ForbiddenPrivateMethodByTypeRule.php)

```yaml
services:
-
class: Symplify\PHPStanRules\Rules\ForbiddenPrivateMethodByTypeRule
tags: [phpstan.rules.rule]
arguments:
forbiddenTypes:
- Command
```
```php
class SomeCommand extends Command
{
public function run()
{
$this->somePrivateMethod();
}

private function somePrivateMethod()
{
// ...
}
}
```

:x:

<br>

```php
class SomeCommand extends Command
{
/**
* @var ExternalService
*/
private $externalService;

public function __construct(ExternalService $externalService)
{
$this->externalService = $externalService;
}

public function run()
{
$this->externalService->someMethod();
}
}
```

:+1:

<br>

## ForbiddenProtectedPropertyRule

Property with protected modifier is not allowed. Use interface contract method instead
Expand Down Expand Up @@ -2694,28 +2631,6 @@ final class HelpfulName

<br>

## NoMaskWithoutSprintfRule

Missing `sprintf()` function for a mask

- class: [`Symplify\PHPStanRules\Rules\NoMaskWithoutSprintfRule`](../src/Rules/NoMaskWithoutSprintfRule.php)

```php
return 'Hey %s';
```

:x:

<br>

```php
return sprintf('Hey %s', 'Matthias');
```

:+1:

<br>

## NoMethodTagInClassDocblockRule

Do not use `@method` tag in class docblock
Expand Down
114 changes: 0 additions & 114 deletions packages/phpstan-rules/src/Rules/NoMaskWithoutSprintfRule.php

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.

0 comments on commit 8615230

Please sign in to comment.