Skip to content

Commit 252a2fb

Browse files
authored
Merge pull request #79 from jfredon/update-for-php84-deprecations
Fix PHP 8.4 deprecation notices updating type hints and improving test assertions
2 parents 9077602 + 54d50f2 commit 252a2fb

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"source": "https://github.com/vanderlee/phpSyllable/"
2323
},
2424
"require": {
25-
"php": ">=5.6",
25+
"php": ">=7.1",
2626
"ext-json": "*",
2727
"ext-libxml": "*",
2828
"ext-mbstring": "*",

src/Syllable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function getHyphen()
176176
/**
177177
* @param Cache $cache
178178
*/
179-
public function setCache(Cache $cache = null)
179+
public function setCache(?Cache $cache = null)
180180
{
181181
$this->cache = $cache;
182182
}
@@ -612,8 +612,8 @@ private function parseHtmlText($html)
612612
*/
613613
private function hyphenateHtmlDom(
614614
DOMNode $node,
615-
DOMNodeList $excludeNodes = null,
616-
DOMNodeList $includeNodes = null,
615+
?DOMNodeList $excludeNodes = null,
616+
?DOMNodeList $includeNodes = null,
617617
$split = true
618618
) {
619619
if ($node->hasChildNodes()) {

tests/src/SyllableTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ public function testCache($cacheClass, $language, $cacheDirectory, $cacheFile, $
189189
$this->assertNotEmpty($this->object->getCache()->__get('patterns'));
190190
$this->assertGreaterThan(0, $this->object->getCache()->__get('max_pattern'));
191191
$this->assertNotEmpty($this->object->getCache()->__get('hyphenation'));
192-
$this->assertInternalType('int', $this->object->getCache()->__get('left_min_hyphen'));
193-
$this->assertInternalType('int', $this->object->getCache()->__get('right_min_hyphen'));
192+
$this->assertIsInt($this->object->getCache()->__get('left_min_hyphen'));
193+
$this->assertIsInt($this->object->getCache()->__get('right_min_hyphen'));
194194
}
195195

196196
public function dataCacheVersionMatchesCacheFileVersionIsRelaxed()

0 commit comments

Comments
 (0)