What problem would the enhancement address for VIP?
Because of the container-based infrastructure, VIP does not recommend using the function filemtime() to populate a value for versioning; each time a container is created, it would result in a different value. It would be great to warn developers of this using the coding standards and have the bot notify in pull requests.
We provide this information in the docs for file concatenation and minification, but a CS sniff would be a better way to widely share that information.
Describe the solution you'd like
A warning on the use of filemtime() due to the container-based infrastructure.
Other PHP functions return a time based on when an action was taken against a file in the file system. It would be worth considering if this sniff should apply to these too:
Given the response in p9zhOE-3lX-p2 (internal), it seems the documentation is incorrect, and filemtime() does not change per autoscaling pod; only new deploys update the filemtime() and others.
What problem would the enhancement address for VIP?
Because of the container-based infrastructure, VIP does not recommend using the function
filemtime()
to populate a value for versioning; each time a container is created, it would result in a different value. It would be great to warn developers of this using the coding standards and have the bot notify in pull requests.We provide this information in the docs for file concatenation and minification, but a CS sniff would be a better way to widely share that information.
Describe the solution you'd like
A warning on the use of
filemtime()
due to the container-based infrastructure.Other PHP functions return a time based on when an action was taken against a file in the file system. It would be worth considering if this sniff should apply to these too:
What code should be reported as a violation?
What code should not be reported as a violation?
None. Even using
filemtime()
outside of the context of enqueuing could be problematic.