Skip to content

Commit e86af35

Browse files
committed
CS + PHPStan
1 parent 44d809c commit e86af35

File tree

95 files changed

+299
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+299
-287
lines changed

tests/SpameriTests/Data/Entity/Person.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php declare(strict_types=1);
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity;
44

@@ -78,7 +78,7 @@ public function __construct(
7878

7979
public function entityVariables() : array
8080
{
81-
return get_object_vars($this);
81+
return \get_object_vars($this);
8282
}
8383

8484

tests/SpameriTests/Data/Entity/Person/Character.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Person;
44

@@ -57,7 +57,7 @@ public function __construct(
5757

5858
public function entityVariables() : array
5959
{
60-
return get_object_vars($this);
60+
return \get_object_vars($this);
6161
}
6262

6363

tests/SpameriTests/Data/Entity/Person/CharacterCollectionElastic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Person;
44

tests/SpameriTests/Data/Entity/Person/Job.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Job implements \Spameri\Elastic\Entity\IEntity
2828
private $description;
2929

3030
/**
31-
* @var \SpameriTests\Data\Entity\Property\ImdbId
31+
* @var \SpameriTests\Data\Entity\Property\ImdbId|NULL
3232
*/
3333
private $episode;
3434

@@ -49,7 +49,7 @@ public function __construct(
4949

5050
public function entityVariables() : array
5151
{
52-
return get_object_vars($this);
52+
return \get_object_vars($this);
5353
}
5454

5555

tests/SpameriTests/Data/Entity/Person/JobCollectionElastic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Person;
44

@@ -16,7 +16,7 @@ public function job(
1616
if ($episode) {
1717
if (
1818
$job->id()->value() === $imdbId->value()
19-
&& $job->episode()
19+
&& $job->episode() instanceof \SpameriTests\Data\Entity\Property\ImdbId
2020
&& $job->episode()->value() === $episode->value()
2121
) {
2222
return $job;

tests/SpameriTests/Data/Entity/Property/CountryShort.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Property;
44

tests/SpameriTests/Data/Entity/Property/Description.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Property;
44

tests/SpameriTests/Data/Entity/Property/ElasticIdCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Property;
44

@@ -7,7 +7,7 @@ class ElasticIdCollection implements \Spameri\Elastic\Entity\IValueCollection
77
{
88

99
/**
10-
* @var \Spameri\Elastic\Entity\Property\IElasticId[]
10+
* @var array<\Spameri\Elastic\Entity\Property\IElasticId>
1111
*/
1212
private $collection;
1313

tests/SpameriTests/Data/Entity/Property/ImdbId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Property;
44

tests/SpameriTests/Data/Entity/Property/ImdbIdCollection.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php declare(strict_types = 1);
22

33
namespace SpameriTests\Data\Entity\Property;
44

@@ -7,7 +7,7 @@ class ImdbIdCollection implements \Spameri\Elastic\Entity\IValueCollection
77
{
88

99
/**
10-
* @var \SpameriTests\Data\Entity\Property\ImdbId[]
10+
* @var array<\SpameriTests\Data\Entity\Property\ImdbId>
1111
*/
1212
private $collection;
1313

@@ -53,7 +53,13 @@ public function keys() : array
5353

5454
public function first() : ?ImdbId
5555
{
56-
return \reset($this->collection);
56+
$first = \reset($this->collection);
57+
58+
if ($first === FALSE) {
59+
throw new \Nette\InvalidStateException();
60+
}
61+
62+
return $first;
5763
}
5864

5965

0 commit comments

Comments
 (0)