Skip to content

Commit

Permalink
[docs] add note about new find-rule page (#6224)
Browse files Browse the repository at this point in the history
* cs

* [docs] add note about new find-rule page

* update link in README

* [ci] add validate rules docs check
  • Loading branch information
TomasVotruba authored Aug 8, 2024
1 parent 59585ae commit 67238d8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
name: 'Commented Code'
run: vendor/bin/swiss-knife check-commented-code src rules tests rules-tests --line-limit 5 --ansi

-
name: "Validate docs"
run: vendor/bin/rule-doc-generator validate rules

-
name: 'Active Classes'
run: |
Expand Down
2 changes: 1 addition & 1 deletion build/target-repository/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ vendor/bin/rector process src
## Documentation

* Find [full documentation here](https://getrector.com/documentation/).
* [Explore Rector Rules](/docs/rector_rules_overview.md)
* [Explore Rector Rules](https://getrector.com/find-rule)

<br>

Expand Down
4 changes: 4 additions & 0 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 382 Rules Overview

**This overview is deprecated and replaced by more advanced web search. There you can search and filter by nodes, copy-paste configs for configurable rules and more.**

Use https://getrector.com/find-rule instead!

<br>

## Categories
Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"symplify/easy-coding-standard": "^12.3",
"symplify/phpstan-extensions": "^11.4",
"symplify/phpstan-rules": "^13.0",
"symplify/rule-doc-generator": "^12.2.2",
"symplify/rule-doc-generator": "^12.2.5",
"symplify/vendor-patches": "^11.3",
"tomasvotruba/class-leak": "^0.2.15",
"tomasvotruba/unused-public": "^0.3.10",
Expand Down Expand Up @@ -110,10 +110,7 @@
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify --memory-limit=512M",
"docs": [
"vendor/bin/rule-doc-generator generate rules --output-file build/rector_rules_overview.md --ansi --categorize 3",
"mv build/rector_rules_overview.md build/target-repository/docs/rector_rules_overview.md"
],
"docs": "vendor/bin/rule-doc-generator validate rules",
"rector": "bin/rector process --ansi",
"preload": "php build/build-preload.php .",
"release": " vendor/bin/rng --from-commit X --to-commit Y --remote-repository rectorphp/rector-symfony --remote-repository rectorphp/rector-doctrine --remote-repository rectorphp/rector-phpunit"
Expand Down
4 changes: 3 additions & 1 deletion rules/CodeQuality/Rector/Foreach_/ForeachToInArrayRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ private function shouldSkipForeach(Foreach_ $foreach): bool
return true;
}

return ! $this->nodeTypeResolver->getNativeType($foreach->expr)->isArray()->yes();
return ! $this->nodeTypeResolver->getNativeType($foreach->expr)
->isArray()
->yes();
}

private function shouldSkipIf(If_ $if): bool
Expand Down

0 comments on commit 67238d8

Please sign in to comment.