cs and phpstan fixes

This commit is contained in:
Dennis Eichhorn 2020-10-24 17:52:23 +02:00
parent e3414b1e3d
commit abdc4704a6
3 changed files with 5 additions and 3 deletions

View File

@ -140,7 +140,7 @@ class Collection extends Media implements \Iterator
/**
* {@inheritdoc}
*/
public function valid()
public function valid() : bool
{
return \current($this->sources) !== false;
}

View File

@ -257,7 +257,9 @@ class Media implements \JsonSerializable
*/
public function setPassword(?string $password) : void
{
$this->password = \password_hash($password, \PASSWORD_DEFAULT);
$temp = $password === null ? null : \password_hash($password, \PASSWORD_DEFAULT);
$this->password = $temp === false ? null : $temp;
}
/**

View File

@ -56,7 +56,7 @@ class MediaMapper extends DataMapperAbstract
/**
* Belongs to.
*
* @var array<string, array{mapper:string, self:string}>
* @var array<string, array{mapper:string, external:string}>
* @since 1.0.0
*/
protected static array $belongsTo = [