PHP code example of blumilksoftware / codestyle

1. Go to this page and download the library: Download blumilksoftware/codestyle 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/ */

    

blumilksoftware / codestyle example snippets




declare(strict_types=1);

use Blumilk\Codestyle\Config;

return new Config();



declare(strict_types=1);

use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;

$paths = new LaravelPaths();

$config = new Config(
    paths: $paths->filter("app", "tests")->add("src"),
);

return $config->config();



declare(strict_types=1);

use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\LaravelPaths;

$config = new Config(
    paths: new LaravelPaths(LaravelPaths::LARAVEL_8_PATHS),
);

return $config->config();



declare(strict_types=1);

use Blumilk\Codestyle\Config;
use Blumilk\Codestyle\Configuration\Defaults\Paths;

$config = new Config(
    paths: new Paths("src"),
);

return $config->config();

return $config->withoutRiskyFixers()->config();

return $config->ignoreMarkedFiles()->config();
json
{
  "scripts": {
    "cs": "./vendor/bin/php-cs-fixer fix --dry-run --diff --config codestyle.php",
    "csf": "./vendor/bin/php-cs-fixer fix --diff --config codestyle.php"
  }
}
shell
docker compose up -d
docker compose exec php php -v
docker compose exec php composer -V