Skip to content

Commit

Permalink
Check to see if the file handler is a resource before trying to call …
Browse files Browse the repository at this point in the history
…fclose. This was causing a warning and making the CsvTest.php fail
  • Loading branch information
dmanners committed Jan 27, 2017
1 parent 02e1c6b commit 7d42e36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup/src/Magento/Setup/Module/I18n/Dictionary/Writer/Csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,18 @@ public function write(Phrase $phrase)
*/
public function __destructor()
{
fclose($this->_fileHandler);
if (is_resource($this->_fileHandler)) {
fclose($this->_fileHandler);
}
}

/**
* Destructor for closing file handler
*/
public function __destruct()
{
fclose($this->_fileHandler);
if (is_resource($this->_fileHandler)) {
fclose($this->_fileHandler);
}
}
}

0 comments on commit 7d42e36

Please sign in to comment.