Skip to content

Configuration defined type validation: Improve error message#5700

Open
staabm wants to merge 3 commits into
phpstan:2.1.xfrom
staabm:fix123
Open

Configuration defined type validation: Improve error message#5700
staabm wants to merge 3 commits into
phpstan:2.1.xfrom
staabm:fix123

Conversation

@staabm
Copy link
Copy Markdown
Contributor

@staabm staabm commented May 18, 2026

Improves the error messages..

before PR

Configuration defined type for constant APP_ROOT (string) does not accept value string.

after PR

Configuration defined type for constant APP_ROOT (non-empty-string) does not accept value string.


followup to #5648

@staabm staabm changed the base branch from 2.2.x to 2.1.x May 18, 2026 15:43
@phpstan phpstan deleted a comment from phpstan-bot May 18, 2026
$constantReflection->getDeclaringClass()->getDisplayName(),
$constantName,
$configuredType->describe(VerbosityLevel::typeOnly()),
$configuredType->describe(VerbosityLevel::precise()),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about value()? precise is generally used only for assertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants