magento / magento/magento-coding-standard
Remove PHP `assert()` function from list of forbidden functions
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 375
- Forks
- 165
- PR merge metrics
- No merged PRs in 30d
Description
Description
AFAIK starting from PHP 8.0 the main security issue of assert() function implementation is removed. Thus given the minimum PHP requirement version for the Coding Standards is 8.1 the function should be removed from the list of the forbidden functions.
Expected behavior
No error The use of function assert() is forbidden is shown when checking the standards on Magento code.
Benefits
The function usage is allowed which provides reducing of boilerplate in code base.
Additional information
I'm not a security expert, so I might be wrong on the topic.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the configuration that defines forbidden PHP functions and any tests covering forbidden-function diagnostics. Confirm the PHP 8.1 behavior and update the relevant expectation so Magento code using assert() no longer produces the reported error; done means the focused checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100