3 ms·
Others have explained how PHP can be statically typed. Here's how to enforce it: Set up a linting rule that every project PHP file (with some exceptions, like
by TheCapeGreek 4y ago
Others have explained how PHP can be statically typed. Here's how to enforce it:
Set up a linting rule that every project PHP file (with some exceptions, like templating files) needs to have the `declare(strict_types=1);` directive. Then you can also have PHPCS fix it or just generally have linting checks on PRs.
For large legacy apps you can still add exceptions.