Applied rector suggestions

This commit is contained in:
Jan Böhmer 2024-06-22 00:31:43 +02:00
parent 4106bcef5f
commit 20f32c7f12
170 changed files with 808 additions and 761 deletions

View file

@ -385,7 +385,7 @@ abstract class Attachment extends AbstractNamedDBElement
return null;
}
return parse_url($this->getURL(), PHP_URL_HOST);
return parse_url((string) $this->getURL(), PHP_URL_HOST);
}
/**
@ -477,7 +477,7 @@ abstract class Attachment extends AbstractNamedDBElement
*/
public function setElement(AttachmentContainingDBElement $element): self
{
if (!is_a($element, static::ALLOWED_ELEMENT_CLASS)) {
if (!$element instanceof AttachmentContainingDBElement) {
throw new InvalidArgumentException(sprintf('The element associated with a %s must be a %s!', static::class, static::ALLOWED_ELEMENT_CLASS));
}