diff --git a/composer.json b/composer.json index a6cc9e4..72618c9 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "description" : "Reads and writes JSON to and from various input sources", "keywords": ["module", "xp"], "require" : { - "xp-framework/core": "^12.0 | ^11.0 | ^10.0", + "xp-framework/core": "^12.11 | ^11.11", "php" : ">=7.4.0" }, "require-dev" : { diff --git a/src/main/php/text/json/MultiByteSource.class.php b/src/main/php/text/json/MultiByteSource.class.php index ac2bfbd..fd89975 100755 --- a/src/main/php/text/json/MultiByteSource.class.php +++ b/src/main/php/text/json/MultiByteSource.class.php @@ -1,6 +1,6 @@ in instanceof Seekable) { $this->in->seek($offset, $whence); } else { - throw new IOException('Cannot seek '.$this->in->toString()); + throw new NotSupported('Cannot seek '.$this->in->toString()); } } diff --git a/src/main/php/text/json/StreamInput.class.php b/src/main/php/text/json/StreamInput.class.php index b9d54f4..51b7374 100755 --- a/src/main/php/text/json/StreamInput.class.php +++ b/src/main/php/text/json/StreamInput.class.php @@ -1,6 +1,6 @@ in instanceof Seekable) { @@ -89,7 +89,7 @@ public function reset() { $this->pos= 0; $this->firstToken= null; } else { - throw new IOException('Cannot seek streams of type '.typeof($this->in)->getName()); + throw new NotSupported('Cannot seek streams of type '.typeof($this->in)->getName()); } } diff --git a/src/test/php/text/json/unittest/StreamInputTest.class.php b/src/test/php/text/json/unittest/StreamInputTest.class.php index 9a3de36..4f30a5b 100755 --- a/src/test/php/text/json/unittest/StreamInputTest.class.php +++ b/src/test/php/text/json/unittest/StreamInputTest.class.php @@ -1,6 +1,6 @@ elements()), '#1'); - Assert::throws(IOException::class, function() use($input) { + Assert::throws(NotSupported::class, function() use($input) { $input->reset(); iterator_to_array($input->elements()); });