Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ForbiddenTestsNamespaceOutsideTestsDirectoryRule as overly detailed #57

Merged
merged 1 commit into from May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.