Depending on the size of a code base, the amount of sniffs run and the memory_limit set for PHP, PHPCS can run out of memory.
Depending on the point at which it runs out of memory, it may show the PHP native "out of memory" error or it may exit without any further information (seen that a number of times as well).
Catching out of memory errors and displaying a user-friendly error message isn't straight-forward, as one can't allocate anymore memory in PHP by that time.
However, my friend @schlessera has worked out a way to do it for another CLI tool and shared the code with me.
@gsherwood Would you be interested in me implementing a user friendly error message for out of memory errors for PHPCS ?
Depending on the size of a code base, the amount of sniffs run and the
memory_limit
set for PHP, PHPCS can run out of memory.Depending on the point at which it runs out of memory, it may show the PHP native "out of memory" error or it may exit without any further information (seen that a number of times as well).
Catching out of memory errors and displaying a user-friendly error message isn't straight-forward, as one can't allocate anymore memory in PHP by that time.
However, my friend @schlessera has worked out a way to do it for another CLI tool and shared the code with me.
@gsherwood Would you be interested in me implementing a user friendly error message for out of memory errors for PHPCS ?