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
Zaloguj się, aby dodać komentarz
Inne posty w tej grupie

This week, the upcoming Symfony 7.3 version improved the AsAlias attribute by adding a new argument, introduced Clock support for UriSigner, and refined the return type of the ContainerInterface::get(

SymfonyOnline June 2025 is almost here, starting in almost 2 months on:
June 10-11: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings. June 12-13: Online confe

SymfonyLive Paris 2025 took place three weeks ago — a big thank you to everyone who joined us! The conference was held entirely in French, and now you can relive the best moments: replays, hig

This week, Symfony 7.3 entered its "feature freeze" period in preparation for its release at the end of May 2025. Development activity focused on refining and polishing its new features, including a n

SymfonyOnline June 2025 is almost here, starting in almost 2 months on:
June 10-11: Workshop days. It is possible to attend 1 two-day training or 2 one-day trainings. June 12-13: Online confe

The international Symfony conference of the year, SymfonyCon Amsterdam 2025, will take place in the Netherlands on November 27 & 28, 2025!
⏳ Early bird registration ends this Wednesday! D

This week, the upcoming Symfony 7.3 version entered its feature freeze period to tweak and polish its new features before releasing it at the end of May 2025. In addition, we celebrated the SymfonyLiv