1. Go to this page and download the library: Download phbsis/kr04-php-lint 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/ */
phbsis / kr04-php-lint example snippets
namespace KR04\Checkers;
use KR04\Checkers\Checker;
use KR04\Files\Loader;
use KR04\Cli\Commands;
class TesteChecker extends Checker
{
public function __construct(Loader $loader, Commands $commands)
{
parent::__construct($loader, $commands);
}
protected function check()
{
/**
* Aqui ficarão suas implementações de checagem das regras
*/
return $this;
}
protected function configure()
{
/**
* Aqui ficarão suas implementações de configurações
* Este método será executado antes do método check()
*/
return $this;
}
}
[
[‘./index.php’] => [
“string” => ‘
echo “isso é um teste”;’,
“array” => [
0 => ‘’,
1 => ‘ echo “isso é um teste”;’
]
]
// mais arquivos...
]
// código omitido
$checkerContainer->setChecker(\KR04\Checkers\PsrChecker::class);
$checkerContainer->setChecker(\KR04\Checkers\ChaordicPatternChecker::class);
// registrando aqui uma classe TesteChecker
$checkerContainer->setChecker(\KR04\Checkers\TesteChecker::class);
// init the verification into the files
new KR04\Linter($checkerContainer, $commands);
// código omitido
// @ignore aqui inicia a tag
var_dum([‘teste’]); // este var_dump será ignorado
var_dum($this); // este var_dump será ignorado
// @endignore fim da tag
var_dum($response); // @ignoreline esta linha será ignorada
return $response;