Skip to content

Commit da858f4

Browse files
committed
Replace deprecated string interpolation usage
1 parent 1df7e98 commit da858f4

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/voku/helper/SimpleHtmlDom.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ public function firstChild()
505505
*/
506506
public function getElementByClass(string $class): SimpleHtmlDomNodeInterface
507507
{
508-
return $this->findMulti(".${class}");
508+
return $this->findMulti(".{$class}");
509509
}
510510

511511
/**
@@ -517,7 +517,7 @@ public function getElementByClass(string $class): SimpleHtmlDomNodeInterface
517517
*/
518518
public function getElementById(string $id): SimpleHtmlDomInterface
519519
{
520-
return $this->findOne("#${id}");
520+
return $this->findOne("#{$id}");
521521
}
522522

523523
/**
@@ -552,7 +552,7 @@ public function getElementByTagName(string $name): SimpleHtmlDomInterface
552552
*/
553553
public function getElementsById(string $id, $idx = null)
554554
{
555-
return $this->find("#${id}", $idx);
555+
return $this->find("#{$id}", $idx);
556556
}
557557

558558
/**

src/voku/helper/SimpleXmlDom.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public function firstChild()
455455
*/
456456
public function getElementByClass(string $class): SimpleXmlDomNodeInterface
457457
{
458-
return $this->findMulti(".${class}");
458+
return $this->findMulti(".{$class}");
459459
}
460460

461461
/**
@@ -467,7 +467,7 @@ public function getElementByClass(string $class): SimpleXmlDomNodeInterface
467467
*/
468468
public function getElementById(string $id): SimpleXmlDomInterface
469469
{
470-
return $this->findOne("#${id}");
470+
return $this->findOne("#{$id}");
471471
}
472472

473473
/**
@@ -502,7 +502,7 @@ public function getElementByTagName(string $name): SimpleXmlDomInterface
502502
*/
503503
public function getElementsById(string $id, $idx = null)
504504
{
505-
return $this->find("#${id}", $idx);
505+
return $this->find("#{$id}", $idx);
506506
}
507507

508508
/**

src/voku/helper/XmlDomParser.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public function fixHtmlOutput(
389389
*/
390390
public function getElementByClass(string $class): SimpleXmlDomNodeInterface
391391
{
392-
return $this->findMulti(".${class}");
392+
return $this->findMulti(".{$class}");
393393
}
394394

395395
/**
@@ -401,7 +401,7 @@ public function getElementByClass(string $class): SimpleXmlDomNodeInterface
401401
*/
402402
public function getElementById(string $id): SimpleXmlDomInterface
403403
{
404-
return $this->findOne("#${id}");
404+
return $this->findOne("#{$id}");
405405
}
406406

407407
/**
@@ -432,7 +432,7 @@ public function getElementByTagName(string $name): SimpleXmlDomInterface
432432
*/
433433
public function getElementsById(string $id, $idx = null)
434434
{
435-
return $this->find("#${id}", $idx);
435+
return $this->find("#{$id}", $idx);
436436
}
437437

438438
/**
@@ -526,7 +526,7 @@ public function loadHtmlFile(string $filePath, $libXMLExtraOptions = null): DomP
526526
&&
527527
!\file_exists($filePath)
528528
) {
529-
throw new \RuntimeException("File ${filePath} not found");
529+
throw new \RuntimeException("File {$filePath} not found");
530530
}
531531

532532
try {
@@ -536,11 +536,11 @@ public function loadHtmlFile(string $filePath, $libXMLExtraOptions = null): DomP
536536
$html = \file_get_contents($filePath);
537537
}
538538
} catch (\Exception $e) {
539-
throw new \RuntimeException("Could not load file ${filePath}");
539+
throw new \RuntimeException("Could not load file {$filePath}");
540540
}
541541

542542
if ($html === false) {
543-
throw new \RuntimeException("Could not load file ${filePath}");
543+
throw new \RuntimeException("Could not load file {$filePath}");
544544
}
545545

546546
return $this->loadHtml($html, $libXMLExtraOptions);
@@ -603,7 +603,7 @@ public function loadXmlFile(string $filePath, $libXMLExtraOptions = null): self
603603
&&
604604
!\file_exists($filePath)
605605
) {
606-
throw new \RuntimeException("File ${filePath} not found");
606+
throw new \RuntimeException("File {$filePath} not found");
607607
}
608608

609609
try {
@@ -613,11 +613,11 @@ public function loadXmlFile(string $filePath, $libXMLExtraOptions = null): self
613613
$xml = \file_get_contents($filePath);
614614
}
615615
} catch (\Exception $e) {
616-
throw new \RuntimeException("Could not load file ${filePath}");
616+
throw new \RuntimeException("Could not load file {$filePath}");
617617
}
618618

619619
if ($xml === false) {
620-
throw new \RuntimeException("Could not load file ${filePath}");
620+
throw new \RuntimeException("Could not load file {$filePath}");
621621
}
622622

623623
return $this->loadXml($xml, $libXMLExtraOptions);

tests/HTML5DOMDocumentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ public function testClassListEntries()
6464
$text = '';
6565
$html = $dom->findOne('html');
6666
foreach ($html->classList->entries() as $class) {
67-
$text .= "[${class}]";
67+
$text .= "[{$class}]";
6868
}
6969
static::assertSame('', $text);
7070

7171
$text = '';
7272
$body = $dom->findOne('body');
7373
foreach ($body->classList->entries() as $class) {
74-
$text .= "[${class}]";
74+
$text .= "[{$class}]";
7575
}
7676
static::assertSame('[a][b][c]', $text);
7777
}

0 commit comments

Comments
 (0)