Fix warnings and errors reported by Scrutinizer

This commit is contained in:
Stéphane Goetz
2019-11-30 22:24:10 +01:00
parent abaf36bec6
commit 688de1d5b9
15 changed files with 56 additions and 56 deletions

View File

@ -38,15 +38,8 @@ class LinkRenderer implements InlineRendererInterface, ConfigurationAwareInterfa
*/
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer)
{
// This can't be in the method type as
// the method is an abstract and should
// have the same interface
if (!$inline instanceof Link) {
throw new \RuntimeException(
'Wrong type passed to ' . __CLASS__ . '::' . __METHOD__ .
" the expected type was 'League\\CommonMark\\Inline\\Element\\Link' but '" .
get_class($inline) . "' was provided"
);
if (!($inline instanceof Link)) {
throw new \InvalidArgumentException('Incompatible inline type: ' . \get_class($inline));
}
$element = $this->parent->render($inline, $htmlRenderer);