Skip to content

Commit b215525

Browse files
committed
updated tests (may not work yet)
1 parent f4864e5 commit b215525

68 files changed

Lines changed: 162 additions & 733 deletions

Some content is hidden

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class CharacterCollectionElastic extends \Spameri\Elastic\Entity\Collection\Abst
77

88
public function character(
99
\SpameriTests\Elastic\Data\Entity\Property\ImdbId $id,
10-
\SpameriTests\Elastic\Data\Entity\Property\ImdbId|null $episode = NULL,
10+
\SpameriTests\Elastic\Data\Entity\Property\ImdbId|null $episode = null,
1111
): Character
1212
{
1313
/** @var \SpameriTests\Elastic\Data\Entity\Person\Character $character */

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

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,19 @@ class Job implements \Spameri\Elastic\Entity\EntityInterface
1212
public const VIDEO_WRITER = "Writing Credits\n  ";
1313
public const SERIES_WRITER = "Series Writing Credits\n  ";
1414

15-
/**
16-
* @var \SpameriTests\Elastic\Data\Entity\Property\ImdbId
17-
*/
18-
private $id;
19-
20-
/**
21-
* @var \SpameriTests\Elastic\Data\Entity\Property\Name
22-
*/
23-
private $name;
24-
25-
/**
26-
* @var \SpameriTests\Elastic\Data\Entity\Property\Description
27-
*/
28-
private $description;
29-
3015
/**
3116
* @var \SpameriTests\Elastic\Data\Entity\Property\ImdbId|NULL
3217
*/
33-
private $episode;
18+
private ?\SpameriTests\Elastic\Data\Entity\Property\ImdbId $episode = null;
3419

3520

3621
public function __construct(
37-
\SpameriTests\Elastic\Data\Entity\Property\ImdbId $id,
38-
\SpameriTests\Elastic\Data\Entity\Property\Name $name,
39-
\SpameriTests\Elastic\Data\Entity\Property\Description $description,
22+
private \SpameriTests\Elastic\Data\Entity\Property\ImdbId $id,
23+
private \SpameriTests\Elastic\Data\Entity\Property\Name $name,
24+
private \SpameriTests\Elastic\Data\Entity\Property\Description $description,
4025
\SpameriTests\Elastic\Data\Entity\Property\ImdbId|null $episode,
4126
)
4227
{
43-
$this->id = $id;
44-
$this->name = $name;
45-
$this->description = $description;
4628
$this->episode = $episode;
4729
}
4830

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class JobCollectionElastic extends \Spameri\Elastic\Entity\Collection\AbstractEn
77

88
public function job(
99
\SpameriTests\Elastic\Data\Entity\Property\ImdbId $imdbId,
10-
\SpameriTests\Elastic\Data\Entity\Property\ImdbId|null $episode = NULL,
10+
\SpameriTests\Elastic\Data\Entity\Property\ImdbId|null $episode = null,
1111
): Job
1212
{
1313
/** @var \SpameriTests\Elastic\Data\Entity\Person\Job $job */

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
class CountryShort implements \Spameri\Elastic\Entity\ValueInterface
66
{
77

8-
/**
9-
* @var string
10-
*/
11-
private $value;
8+
private string $value;
129

1310

1411
public function __construct(
1512
string|null $value,
1613
)
1714
{
18-
if ($value === '' || $value === NULL) {
15+
if ($value === '' || $value === null) {
1916
throw new \InvalidArgumentException();
2017
}
2118

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
class Description implements \Spameri\Elastic\Entity\ValueInterface
66
{
77

8-
/**
9-
* @var ?string
10-
*/
11-
private $value;
8+
private ?string $value = null;
129

1310

1411
public function __construct(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ElasticIdCollection implements \Spameri\Elastic\Entity\ValueCollectionInte
88
/**
99
* @var array<\Spameri\Elastic\Entity\Property\ElasticIdInterface>
1010
*/
11-
private $collection;
11+
private array $collection;
1212

1313

1414
public function __construct(

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class ImdbIdCollection implements \Spameri\Elastic\Entity\ValueCollectionInterfa
88
/**
99
* @var array<\SpameriTests\Elastic\Data\Entity\Property\ImdbId>
1010
*/
11-
private $collection;
11+
private array $collection;
1212

1313

1414
public function __construct(
@@ -40,7 +40,7 @@ public function find(
4040
}
4141
}
4242

43-
return NULL;
43+
return null;
4444
}
4545

4646

@@ -54,7 +54,7 @@ public function first(): ImdbId|null
5454
{
5555
$first = \reset($this->collection);
5656

57-
if ($first === FALSE) {
57+
if ($first === false) {
5858
throw new \Nette\InvalidStateException();
5959
}
6060

tests/SpameriTests/Elastic/Data/Entity/Property/Name.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
class Name implements \Spameri\Elastic\Entity\ValueInterface
66
{
77

8-
/**
9-
* @var string
10-
*/
11-
private $value;
8+
private string $value;
129

1310

1411
public function __construct(

tests/SpameriTests/Elastic/Data/Entity/Property/Text.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,10 @@
55
class Text implements \Spameri\Elastic\Entity\ValueInterface
66
{
77

8-
/**
9-
* @var string
10-
*/
11-
private $value;
12-
13-
148
public function __construct(
15-
string $value,
9+
private string $value,
1610
)
1711
{
18-
$this->value = $value;
1912
}
2013

2114

tests/SpameriTests/Elastic/Data/Entity/Property/Url.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,14 @@
55
class Url implements \Spameri\Elastic\Entity\ValueInterface
66
{
77

8-
/**
9-
* @var string
10-
*/
11-
private $value;
12-
13-
148
public function __construct(
15-
string $value,
9+
private string $value,
1610
)
1711
{
1812
if ( ! \Nette\Utils\Validators::isUrl($value)) {
1913
throw new \InvalidArgumentException();
2014
}
2115

22-
$this->value = $value;
2316
}
2417

2518

0 commit comments

Comments
 (0)