diff --git a/composer.json b/composer.json index 9c2fdf9..c223113 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "source": "https://github.com/vanderlee/phpSyllable/" }, "require": { - "php": ">=5.6", + "php": ">=7.1", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", diff --git a/src/Syllable.php b/src/Syllable.php index 0132910..02a71f4 100644 --- a/src/Syllable.php +++ b/src/Syllable.php @@ -162,7 +162,7 @@ public function getHyphen() /** * @param Cache $cache */ - public function setCache(Cache $cache = null) + public function setCache(?Cache $cache = null) { $this->cache = $cache; } @@ -598,8 +598,8 @@ private function parseHtmlText($html) */ private function hyphenateHtmlDom( DOMNode $node, - DOMNodeList $excludeNodes = null, - DOMNodeList $includeNodes = null, + ?DOMNodeList $excludeNodes = null, + ?DOMNodeList $includeNodes = null, $split = true ) { if ($node->hasChildNodes()) { diff --git a/tests/src/SyllableTest.php b/tests/src/SyllableTest.php index 52ecc16..1781b76 100644 --- a/tests/src/SyllableTest.php +++ b/tests/src/SyllableTest.php @@ -171,8 +171,8 @@ public function testCache($cacheClass, $language, $cacheDirectory, $cacheFile, $ $this->assertNotEmpty($this->object->getCache()->__get('patterns')); $this->assertGreaterThan(0, $this->object->getCache()->__get('max_pattern')); $this->assertNotEmpty($this->object->getCache()->__get('hyphenation')); - $this->assertInternalType('int', $this->object->getCache()->__get('left_min_hyphen')); - $this->assertInternalType('int', $this->object->getCache()->__get('right_min_hyphen')); + $this->assertIsInt($this->object->getCache()->__get('left_min_hyphen')); + $this->assertIsInt($this->object->getCache()->__get('right_min_hyphen')); } public function dataCacheVersionMatchesCacheFileVersionIsRelaxed()