PHP code example of trayto-com / php-coding-standards

1. Go to this page and download the library: Download trayto-com/php-coding-standards 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/ */

    

trayto-com / php-coding-standards example snippets


 declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $configurator): void {
    // make sure you import correct file
	$configurator->import(__DIR__ . '/vendor/trayto-com/php-coding-standards/definitions/ecs-default.php');

	$services = $configurator->services();
	// ... customise your services

	$parameters = $configurator->parameters();
	// .. customise your parameters

	$parameters->set(
		Option::CACHE_DIRECTORY,
		__DIR__ . '/temp/ecs'
	);
};

vendor/bin/ecs check src tests --config vendor/trayto-com/php-coding-standards/definitions/ecs-default.php