A few days ago, we released a batch of 20 new checks relative to PHP and Symfony applications in SymfonyInsight. Here is an overview of what they cover:
- Removing unused code
Three new rules relative to unused local variables, private members and constructuor parameters now warn you when you declare PHP symbols that can be removed.
Removing unecessary code is a quick way to decrease technical debt as it naturally decreases the difficulty of reading code and understanding what is actually used.
- Removing duplicate code
Two new checks now ensure your project doesn't duplicate code, which may be a source of bugs. For example, SymfonyInsight will now warn you if you define two values with the same key in an array or if you declare a constant/property/method twice.
- Fixing invalid instanciations
A series of new rules now check class constructors calls in order to check they are valid (number of arguments, references, ...). This check will prevent your project from creating invalid objects and thus prevent bugs.
- Improved type checking
Symfonyinsight now betters understanding typing and is able to warn you about misuses of typed variables. For instance, it now warns you if you use a non-iterable variable inside a foreach, if you declare an invalid typehint, if you pass wrong data to a typed method, etc.
- Fixing invalid inheritance architecture
Finally, our engine is now able to better alert your regarding problems in your inheritance architecture: if a class implements another class, if an interface extends a class, if a class/interface is used as a trait, etc. It is also now able to better resolve declared symbols in order to check for their existence everywhere in your code.
Get started on https://insight.symfony.com/!
Sponsor the Symfony project.
http://feedproxy.google.com/~r/symfony/blog/~3/bF8Q3-F1Wfc/adding-20-new-checks-in-symfonyinsight
Connectez-vous pour ajouter un commentaire
Autres messages de ce groupe

This week, development activity mostly focused on dealing with the deprecation of sleep/wakeup methods in PHP 8.5 and their replacement by serialize/unserialize methods. In addition, we published more

It’s been only in July that we published symfony/ai and kicked off our AI initiative, but the repository has been busy since day one. Over 500 stars, more than 200 pull requests & issues, trending

🎤 Take the stage at SymfonyCon Amsterdam 2025, on your own terms!
The Unconference track is back and more dynamic than ever!
This unique, participant-driven format invites attendees to shape

This week, Symfony completed the migration to PHPUnit 12 in the 7.4 branch, which required many changes during the past weeks, such as replacing annotations with attributes. In addition, we updated th

🧑💻HACKDAY IS COMING!
Get ready to code, collaborate, and contribute, Symfony Hackday is back!
Join us in Amsterdam on Saturday, November 29th, for a hands-on hackathon designed to bring the

This week, Symfony released the maintenance versions 6.4.24, 7.2.9, and 7.3.2. Meanwhile, we began deprecating the XML configuration format in some components, enhanced the YAML configuration format t

Symfony 6.4.24 has just been released. Read the Symfony upgrade guide to learn more about upgrading Symfony and use the SymfonyInsight upgrade reports to detect the code you will need to change in you