Skip to content

Commit

Permalink
Remove ForbiddenTestsNamespaceOutsideTestsDirectoryRule as overly det…
Browse files Browse the repository at this point in the history
…ailed
  • Loading branch information
TomasVotruba committed May 19, 2023
1 parent 96b9ff3 commit caeb9cd
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 203 deletions.
36 changes: 1 addition & 35 deletions docs/rules_overview.md
@@ -1,4 +1,4 @@
# 83 Rules Overview
# 82 Rules Overview

## AnnotateRegexClassConstWithRegexLinkRule

Expand Down Expand Up @@ -849,40 +849,6 @@ $message = sprintf('%s', $firstValue, $secondValue);

<br>

## ForbiddenTestsNamespaceOutsideTestsDirectoryRule

"Tests" namespace can be only in "/tests" directory

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

```php
// file path: "src/SomeClass.php"

namespace App\Tests;

class SomeClass
{
}
```

:x:

<br>

```php
// file path: "tests/SomeClass.php"

namespace App\Tests;

class SomeClass
{
}
```

:+1:

<br>

## ForbiddenThisArgumentRule

`$this` as argument is not allowed. Refactor method to service composition
Expand Down
14 changes: 0 additions & 14 deletions src/Location/DirectoryChecker.php
Expand Up @@ -8,20 +8,6 @@

final class DirectoryChecker
{
/**
* @param string[] $directoryNames
*/
public function isInDirectoryNames(Scope $scope, array $directoryNames): bool
{
foreach ($directoryNames as $directoryName) {
if ($this->isInDirectoryNamed($scope, $directoryName)) {
return true;
}
}

return false;
}

public function isInDirectoryNamed(Scope $scope, string $directoryName): bool
{
$normalized = $this->normalizePath($directoryName);
Expand Down
95 changes: 0 additions & 95 deletions src/Rules/ForbiddenTestsNamespaceOutsideTestsDirectoryRule.php

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit caeb9cd

Please sign in to comment.