Back to directory

Magento Coding Standard

Magento Coding Standard is a set of PHP_CodeSniffer rules that check Magento 2 code against Magento's coding conventions, usable via Composer in a Magento project or as a standalone tool.

Magento Coding Standard

Magento Coding Standard defines a Magento2 ruleset for the PHP_CodeSniffer static-analysis tool, letting a Magento 2 project check its code, typically an extension, against Magento's own coding conventions. It installs as a Composer dev dependency, with post-install and post-update scripts that register the ruleset's path with phpcs automatically, or as a standalone application cloned directly or created with composer create-project.

Once installed, running phpcs -i confirms the Magento2 standard is registered, and phpcs --standard=Magento2 checks a given extension's code, printing any rule violations. A companion phpcbf command automatically fixes the subset of violations marked as fixable. Contribution paths include documenting existing rules, fixing bugs, and proposing or building new PHP_CodeSniffer rules for the standard.

More in Code quality

See all 94
  • Critic

    critic.run

    A code-change viewer, backed by Y Combinator, built for reviewing work written by coding agents, presenting a plain-language narrative of each change alongside the diff and a running conversation with the agent.

  • GitIntel

    hoangsonww.github.io

    An MCP server that computes git repository analytics such as hotspots, churn, temporal coupling, knowledge maps and risk scoring entirely from local commit history, for AI coding agents like Claude Code and Codex.

  • Axint

    axint.ai

    A verification layer for AI coding agents working on Apple projects: it runs real Xcode builds and tests against the Swift an agent wrote, reconciles static analysis findings against that evidence, and returns a signed proof with the exact repairs still needed.