Skip to content
P

Phpmnd

PHP Magic Number Detector

by povilsFree

#2139in Productivity
0In stores

Description

phpmnd, short for PHP Magic Number Detector, is a tool that helps you find magic numbers in PHP code. A magic number is a numeric literal us…

Highlights

  • Detects magic numbers in PHP code
  • 0 and 1 allowed by default
  • Installs locally or globally with Composer
  • Exclude files, paths or directories
  • Array key mapping option

Ratings & Reviews

No ratings yet

Be the first to rate Phpmnd.

People also visit

P

Phpinsights

Instant PHP quality checks from your console

Productivity
Launch
P

PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files

Productivity
Launch
P

php-best-practices

PHP 8.x modern patterns, PSR standards, and SOLID principles

AI Skills
Get
P

PhpCodeArcheology/PhpCodeArcheology

PHP static analysis: code quality metrics, problem detection

AI Skills
Get
I

Inspector

Inspector: Agentic Application Debugging for the PHP ecosystem

Developer Tools
Launch
M

Mago

Mago is a toolchain for PHP

Developer Tools
Launch

Phpmnd FAQ

What is phpmnd?

A PHP tool that detects magic numbers, which are numeric literals that are usually better as named constants.

How do I install it?

Add it to a project with Composer as a development dependency and run vendor/bin/phpmnd. Or install it globally and add the Composer global bin directory to your PATH.

Are 0 and 1 flagged?

No. By default, 0 and 1 are not considered magic numbers.

How do I skip files or folders?

Use --exclude-file, --exclude-path or --exclude. Each accepts multiple values, and paths are relative to the source.

Does it flag every number?

No. The README says not every literal number is a magic number, and gives an example where 2 is fine.

What are the best Phpmnd alternatives?

Popular alternatives to Phpmnd include Phpinsights, PHP_CodeSniffer and Checkpoint. See all Phpmnd alternatives

Developer Stuff

Badges