Sitemap

Member-only story

My own PHP CS Fixer setup: A practical example

3 min readMar 6, 2025

--

Photo by Steve Johnson on Unsplash

In my previous article, PHP CS Fixer: A Complete Guide to Installation, Usage, and Integration, I covered the fundamentals of PHP CS Fixer, including installation, usage, IDE integration, and GitLab CI/CD setup. Now, I want to share my personal PHP CS Fixer configuration, which ensures clean and consistent code across my private Symfony project.

🔓 Not a Medium member yet? Click here to access this article for FREE!

My PHP CS Fixer Configuration

Here’s the .php-cs-fixer.php configuration file I use in my Symfony projects:

<?php

$finder = PhpCsFixer\Finder::create()->in([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/migrations'
]);

return (new PhpCsFixer\Config())
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setRules([
'@Symfony' => true,
'@PSR12' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'single_quote' => true…

--

--

Roman Huliak
Roman Huliak

Written by Roman Huliak

Full Stack Developer with 15 years of experience in ERP systems, skilled in leadership, analysis, and end-to-end development.

Responses (1)