Skip to content

Commit 65b3e6a

Browse files
committed
Mark as final and use contructor initialization in example in README
1 parent 8220514 commit 65b3e6a

File tree

1 file changed

+11
-37
lines changed

1 file changed

+11
-37
lines changed

README.md

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -186,44 +186,18 @@ namespace MyCompany\CodingStandards\Ruleset;
186186

187187
use Nexus\CsConfig\Ruleset\AbstractRuleset;
188188

189-
class MyCompany extends AbstractRuleset
189+
final class MyCompany extends AbstractRuleset
190190
{
191-
/**
192-
* Name of this ruleset
193-
*
194-
* @var string
195-
*/
196-
protected $name = 'My Company';
197-
198-
/**
199-
* Your list of rules
200-
*
201-
* @var array
202-
*/
203-
protected $rules = [
204-
'@PSR2' => true,
205-
...
206-
];
207-
208-
/**
209-
* PHP_VERSION_ID that this ruleset is targeting.
210-
*
211-
* @var int
212-
*/
213-
protected $requiredPHPVersion = 70400;
214-
215-
/**
216-
* Does this ruleset have risky rules?
217-
*
218-
* If yes and `PhpCsFixer\Config` has the `$isRiskyAllowed`
219-
* flag set to `false`, those risky rules won't be run.
220-
*
221-
* Set this flag to `true` to automatically setup
222-
* the `$isRiskyAllowed` flag.
223-
*
224-
* @var bool
225-
*/
226-
protected $autoActivateIsRiskyAllowed = false;
191+
public function __construct()
192+
{
193+
$this->name = 'My Company';
194+
$this->rules = [
195+
'@PSR2' => true,
196+
...
197+
];
198+
$this->requiredPHPVersion = 70400;
199+
$this->autoActivateIsRiskyAllowed = true;
200+
}
227201
}
228202

229203
```

0 commit comments

Comments
 (0)