1. Go to this page and download the library: Download friendsoftwig/twigcs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
friendsoftwig / twigcs example snippets
// ~/.twig_cs.dist.php
declare(strict_types=1);
use FriendsOfTwig\Twigcs;
return Twigcs\Config\Config::create()
->setName('my-config')
->setSeverity('warning')
->setReporter('json')
->setRuleSet(Twigcs\Ruleset\Official::class)
->setSpecificRuleSets([ // Every file matching the pattern will use a different ruleset.
'*/template.html.twig' => Acme\Project\CustomRuleset::class,
])
;