diff --git a/.gitignore b/.gitignore index aadd369..1b6f326 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor composer.lock build +.phpunit.result.cache \ No newline at end of file diff --git a/composer.json b/composer.json index fcbf9d1..0b30ea4 100644 --- a/composer.json +++ b/composer.json @@ -16,10 +16,10 @@ } ], "require": { - "php": "^5.6 || ^7.0" + "php": "^5.6 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^5.7 || ^8.0" }, "autoload": { "psr-4": { diff --git a/src/Encoding.php b/src/Encoding.php index c23e4fe..0e3003c 100644 --- a/src/Encoding.php +++ b/src/Encoding.php @@ -42,8 +42,8 @@ public function encodeFile($file, $encoding_to = 'UTF-8', $encodings_detected = } else { return false; } - } catch (Exception $e) { - if (file_exits($fileW)) { + } catch (\Exception $e) { + if (file_exists($fileW)) { unlink($fileW); } diff --git a/tests/FileEncodingTest.php b/tests/FileEncodingTest.php index dc084f6..4bd77fe 100644 --- a/tests/FileEncodingTest.php +++ b/tests/FileEncodingTest.php @@ -7,7 +7,7 @@ class FileEncodingTest extends TestCase { - public function setUp() + public function setUp() : void { parent::setUp(); copy(__DIR__.'/files/test_iso-8859-1.txt', __DIR__.'/files/iso88591.txt');