Skip to content

Commit

Permalink
Check if variable is countable before usage
Browse files Browse the repository at this point in the history
  • Loading branch information
asumaran committed Nov 6, 2023
1 parent 59483a7 commit a5c4ea0
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -146,8 +146,9 @@ public function import( $file ) {
if ( false !== $handle ) {

$header = fgetcsv( $handle, 0, $this->delimiter );
$count = is_countable( $header ) ? count( $header ) : 0;

if ( 10 === count( $header ) ) {
if ( 10 === $count ) {

$row = fgetcsv( $handle, 0, $this->delimiter );

Expand Down

0 comments on commit a5c4ea0

Please sign in to comment.