La méthode self::errors() n'est pas appelée dans le else (ligne 6) alors qu'elle est bien appelée par la méthode UtilFct::debug qui est un enrobage de var_dump :
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 UtilFct::debug("parser 148 errors ",self::errors()); if (empty($this->errors)) { self::detectCSVType(); // UtilFct::debug("parser 150 cvstype",self::CSVType()); } else { self::errors(); UtilFct::debug("parser 153 errors ",self::errors()); //return; }
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 static public function debug($location, $var) { echo "<br/>".(is_string($location))?$location:''."<br/><pre>"; var_dump($var); echo "</pre><br/>"; }
self::errors() :
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 public function errors(): array { return $this->errors; }
Quelqu'un comprend-il pourquoi ?parser 148 errors array(1) { [0]=> string(66) "Unable to detect the CSV text enclosure or this file has no header" }
parser 153 errors array(1) { [0]=> string(66) "Unable to detect the CSV text enclosure or this file has no header" }









Répondre avec citation
Partager