for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class ImageFixer
{
public function makeImageProper($matches, ?string $prefix = '')
$prefix
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function makeImageProper($matches, /** @scrutinizer ignore-unused */ ?string $prefix = '')
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$matches
public function makeImageProper(/** @scrutinizer ignore-unused */ $matches, ?string $prefix = '')
// print_r($matches);
}
public function replaceContentAlt($contents)
$contents
public function replaceContentAlt(/** @scrutinizer ignore-unused */ $contents)
// return preg_replace_callback("#(<img[^>]*src *= *[\"']?)([^\"']*)#i", function ($matches, ?string $prefix) {
// return $this->makeImageProper($matches, $prefix);
// }, $contents);
public function replaceContent()
// libxml_use_internal_errors(true);
// $dom = new \DOMDocument();
// $dom->loadHTML($html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
// foreach ($dom->getElementsByTagName('img') as $img) {
// $src = $iframe->getAttribute('src');
// $image = Image::get()->filter(['Name' => $src])->first();
// // if($image) {
// }
// echo $dom->saveHTML();
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.