From 5d2388af77265ca27644400d0f4a0e80dcba5472 Mon Sep 17 00:00:00 2001 From: wernerkrauss Date: Tue, 22 Oct 2024 14:48:24 +0000 Subject: [PATCH] [DOCS] Generate documentation Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- docs/all_rectors_overview.md | 46 +++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/docs/all_rectors_overview.md b/docs/all_rectors_overview.md index 94151cb..f4ff22f 100644 --- a/docs/all_rectors_overview.md +++ b/docs/all_rectors_overview.md @@ -1,6 +1,16 @@ # 3 Rules Overview -## AddConfigPropertiesRector +
+ +## Categories + +- [Rector](#rector) (3) + +
+ +## Rector + +### AddConfigPropertiesRector Adds `@config` property to predefined private statics, e.g. `$db` or `$allowed_actions` @@ -8,20 +18,50 @@ Adds `@config` property to predefined private statics, e.g. `$db` or `$allowed_a - class: [`Netwerkstatt\SilverstripeRector\Rector\Misc\AddConfigPropertiesRector`](../src/Rector/Misc/AddConfigPropertiesRector.php) +```diff + class SomeClass extends \SilverStripe\ORM\DataObject + { ++ /** ++ * @config ++ */ + private static $db = []; + } +``` +
-## EnsureTableNameIsSetRector +### EnsureTableNameIsSetRector DataObject subclasses must have "$table_name" defined - class: [`Netwerkstatt\SilverstripeRector\Rector\DataObject\EnsureTableNameIsSetRector`](../src/Rector/DataObject/EnsureTableNameIsSetRector.php) +```diff + class SomeClass extends \SilverStripe\ORM\DataObject + { ++ private static $table_name = 'SomeClass'; ++ + private static $db = []; + } +``` +
-## UseCreateRector +### UseCreateRector Change new Object to static call for classes that use Injectable trait - class: [`Netwerkstatt\SilverstripeRector\Rector\Injector\UseCreateRector`](../src/Rector/Injector/UseCreateRector.php) +```diff + class SomeClass + { + public function run() + { +- new InjectableClass($name); ++ InjectableClass::create($name); + } + } +``` +