Summer was back in Zurich, and the Liip Arena helped to keep the temperatures cool while hosting the second Symfony user group Zurich event.
Appetizers and drinks were ready at the opening, and we served ice cream at the end of the presentations.

Attendance was good despite the summer holidays. More than 20 people listened to Pablo introduce "Automating PHP Code Style with Gitlab CI and ECS-Fixer", and Adam tell us about their journey as a PHP core developer with "How I started contributing to php-src"

Automating PHP Code Style with Gitlab CI and ECS-Fixer

Pablo introduced the pipelines their team implemented on top of GitLab to run ECS-Fixer and have the standard coding-styles directly corrected and committed to the developer's branch.

Their code-base spans multiple files and thousands of lines of code, and finding a way to have all developers use the same way to run the coding styles was a hard challenge.
They abandoned the Git hooks approach, together with the IDE Auto-Formatting options and local setups.

Their final solution was a GitLab CI pipeline step where ECS-Fixer is running on each merge request. The pipeline not only fixes the code to apply to the standards but also commits the changed files and pushes them to the current branch, triggering the CI again to validate if any of the changes broke anything.
Their developer experience improved a lot, and each developer can get the automated fix directly in their GIT branch.

Their "fixing" process spans over 75 ECS-Fixer rules and includes fixes not just for their PHP code base, but also for their Twig templates (thanks to Twig-CS-Fixer) and JS files (with ESLint) in their pipelines.

Pablo's presentation triggered multiple questions and discussions, with interesting proposals and people sharing their experiences with CI pipelines and PHP coding style fixers.

Some takeaways:

  • Start small, and iterate by adding more rules from the CS fixer sets.
  • How do you decide which set of rules to use? Pablo applied a "benevolent-dictator" strategy, according to the GIT commits on the rules of their project.
Pablo presenting at the Liip Arena, slides on the big screen on the left
Pablo presenting their talk about Automating PHP Code Style with Gitlab CI and ECS-Fixer

How I started contributing to php-src

Adam presented how they got into contributing to the main source code of the PHP language.
After introducing the PHP process of proposing and handing in a change in the language via the PHP internals mailing list discussions, Adam presented their first contribution to the PHP-src code base.

Their quest started with checking the PHP round() function's documentation, where the most-voted comment was asking to provide a few more rounding modes.
Adam accepted the challenge and, armed with an "it should not be that hard" badge, started the implementation journey by:

  • proposing the language change to the PHP language maintainers via an RFC;
  • handling the voting and comment rounds on the RCF;
  • finally implementing the new rounding modes!

The code changes will be included in the next PHP v8.4 release.

Adam presented more ways to contribute to the PHP language such as fixing bugs, testing new features, or working on the documentation and its translations.

Adam presenting at the Liip Arena
Adam presenting their journey to contribute to PHP-src

What's next?

More interesting discussions happened after the two presentations mentioned above, with more ideas for new talks being proposed!

The presentations of this event are available online in our GitHub repository, while new topics for the next events can be added to the repository's discussions page!

Looking forward to the next event with new talks and chats about PHP, Symfony, and all the surrounding applications!
See you there!