ECG phpcs complience change: get rid of count() in a loop