0

Has anyone got a cheat sheet style list of the common Magento 2 code quality exclusions?

// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
// phpcs:disable Magento2.Files.LineLength.MaxExceeded

etc

I've search online but I can't find anything

0

Put together something myself

// phpcs:ignoreFile
$stuff = [1,2,3]; // phpcs:ignore
// phpcs:disable Generic,Squiz,Magento2
// phpcs:disable Magento2.Exceptions
// phpcs:disable
$stuff = [1,2,3];
// phpcs:enable
// phpcs:disable Generic.Metrics.NestingLevel
// phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod
// phpcs:disable Generic.WhiteSpace.ScopeIndent
// phpcs:disable Magento2.Classes.AbstractApi
// phpcs:disable Magento2.CodeAnalysis.EmptyBlock
// phpcs:disable Magento2.Exceptions.ThrowCatch
// phpcs:disable Magento2.Exceptions.DirectThrow
// phpcs:disable Magento2.Functions.DiscouragedFunction
// phpcs:disable Magento2.PHP.ShortEchoSyntax.ShortEchoTag
// phpcs:disable Magento2.Security.IncludeFile
// phpcs:disable Magento2.Security.InsecureFunction
// phpcs:disable Magento2.Templates.ThisInTemplate
// phpcs:disable Squiz.Commenting.ClassComment.Missing
// phpcs:disable Squiz.Functions.GlobalFunction
// phpcs:disable Squiz.PHP.GlobalKeyword.NotAllowed
// phpcs:disable Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.