Skip to content

Commit 0666ece

Browse files
committed
Fixing tests and checking model
1 parent 9061157 commit 0666ece

File tree

147 files changed

+1498
-482
lines changed

Some content is hidden

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

147 files changed

+1498
-482
lines changed

.formatter.yml

-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ header: |
1515
* Feel free to edit as you please, and have fun.
1616
*
1717
* @author Marc Morera <[email protected]>
18-
* @author PuntMig Technologies
1918
*/

App/AppRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

App/AppRepositoryBucket.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

App/HttpAppRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

App/InMemoryAppRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

App/MockAppRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Config/BoostClause.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Config/Campaign.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Config/Campaigns.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Config/Config.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Config/ImmutableConfig.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Config/Synonym.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Event/Event.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Event/EventRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Event/EventRepositoryBucket.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Event/HttpEventRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Event/InMemoryEventRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Event/MockEventRepository.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Exception/ConnectionException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Exception/CoordinateException.php

-33
This file was deleted.

Exception/EventException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Exception/ExporterFormatNotImplementedException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Exception/ExporterNotAvailableException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Exception/ForbiddenException.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);
@@ -58,6 +57,6 @@ public static function createIndexIsRequiredException(): self
5857
*/
5958
public static function createTokenIsRequiredException(): self
6059
{
61-
return new self('Index query parameter MUST be defined with a valid value');
60+
return new self('Token query parameter MUST be defined with a valid value');
6261
}
6362
}

Exception/InvalidFormatException.php

+57-14
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);
@@ -34,25 +33,47 @@ public static function getTransportableHTTPError(): int
3433
/**
3534
* Items representation format not valid.
3635
*
37-
* @param mixed $itemsBeforeHydration
36+
* @param mixed $itemBeforeHydration
3837
*
3938
* @return InvalidFormatException
4039
*/
41-
public static function itemsRepresentationNotValid($itemsBeforeHydration): self
40+
public static function itemRepresentationNotValid($itemBeforeHydration): self
4241
{
43-
return new static(sprintf('Items representation not valid. Expecting Item array serialized but found malformed data'));
42+
return new static('Items representation not valid. Expecting Item array serialized but found malformed data');
4443
}
4544

4645
/**
4746
* Items UUID representation format not valid.
4847
*
49-
* @param mixed $itemsUUIDBeforeHydration
48+
* @param mixed $itemUUIDBeforeHydration
5049
*
5150
* @return InvalidFormatException
5251
*/
53-
public static function itemsUUIDRepresentationNotValid($itemsUUIDBeforeHydration): self
52+
public static function itemUUIDRepresentationNotValid($itemUUIDBeforeHydration): self
5453
{
55-
return new static(sprintf('Items UUID representation not valid. Expecting UUID array serialized but found malformed data'));
54+
return new static('Item UUID representation not valid. Expecting UUID array serialized but found malformed data');
55+
}
56+
57+
/**
58+
* Create Composed UUID bad format.
59+
*
60+
* @param string $composedUUID
61+
*
62+
* @return InvalidFormatException
63+
*/
64+
public static function composedItemUUIDNotValid($composedUUID): self
65+
{
66+
return new static('A composed UUID should always follow this format: {id}~{type}.');
67+
}
68+
69+
/**
70+
* Create Query sorted by distance without coordinate.
71+
*
72+
* @return InvalidFormatException
73+
*/
74+
public static function querySortedByDistanceWithoutCoordinate(): self
75+
{
76+
return new static('In order to be able to sort by coordinates, you need to create a Query by using Query::createLocated() instead of Query::create()');
5677
}
5778

5879
/**
@@ -64,7 +85,17 @@ public static function itemsUUIDRepresentationNotValid($itemsUUIDBeforeHydration
6485
*/
6586
public static function queryFormatNotValid($queryBeforeHydration): self
6687
{
67-
return new static(sprintf('Query Format not valid. Expecting a Query serialized but found malformed data'));
88+
return new static('Query Format not valid. Expecting a Query serialized but found malformed data');
89+
}
90+
91+
/**
92+
* Coordinate format not valid.
93+
*
94+
* @return InvalidFormatException
95+
*/
96+
public static function coordinateFormatNotValid(): self
97+
{
98+
return new static('A Coordinate should always contain a lat (Latitude) and a lon (Longitude)');
6899
}
69100

70101
/**
@@ -76,7 +107,7 @@ public static function queryFormatNotValid($queryBeforeHydration): self
76107
*/
77108
public static function configFormatNotValid($configBeforeHydration): self
78109
{
79-
return new static(sprintf('Config Format not valid. Expecting a Config serialized but found malformed data'));
110+
return new static('Config Format not valid. Expecting a Config serialized but found malformed data');
80111
}
81112

82113
/**
@@ -88,7 +119,7 @@ public static function configFormatNotValid($configBeforeHydration): self
88119
*/
89120
public static function tokenFormatNotValid($tokenBeforeHydration): self
90121
{
91-
return new static(sprintf('Token Format not valid. Expecting a Token serialized but found malformed data'));
122+
return new static('Token Format not valid. Expecting a Token serialized but found malformed data');
92123
}
93124

94125
/**
@@ -100,7 +131,7 @@ public static function tokenFormatNotValid($tokenBeforeHydration): self
100131
*/
101132
public static function campaignFormatNotValid($campaignBeforeHydration): self
102133
{
103-
return new static(sprintf('Campaign Format not valid. Expecting a Campaign serialized but found malformed data'));
134+
return new static('Campaign Format not valid. Expecting a Campaign serialized but found malformed data');
104135
}
105136

106137
/**
@@ -112,7 +143,7 @@ public static function campaignFormatNotValid($campaignBeforeHydration): self
112143
*/
113144
public static function changesFormatNotValid($changesBeforeHydration): self
114145
{
115-
return new static(sprintf('Changes Format not valid. Expecting a Changes serialized but found malformed data'));
146+
return new static('Changes Format not valid. Expecting a Changes serialized but found malformed data');
116147
}
117148

118149
/**
@@ -124,7 +155,7 @@ public static function changesFormatNotValid($changesBeforeHydration): self
124155
*/
125156
public static function boostClauseFormatNotValid($boostClauseBeforeHydration): self
126157
{
127-
return new static(sprintf('Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data'));
158+
return new static('Boost clause Format not valid. Expecting a Boost clause serialized but found malformed data');
128159
}
129160

130161
/**
@@ -136,6 +167,18 @@ public static function boostClauseFormatNotValid($boostClauseBeforeHydration): s
136167
*/
137168
public static function tokenUUIDFormatNotValid($tokenUUIDBeforeHydration): self
138169
{
139-
return new static(sprintf('Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data'));
170+
return new static('Token UUID Format not valid. Expecting a TokenUUID serialized but found malformed data');
171+
}
172+
173+
/**
174+
* User format not valid.
175+
*
176+
* @param mixed $userBeforeHydration
177+
*
178+
* @return InvalidFormatException
179+
*/
180+
public static function userFormatNotValid($userBeforeHydration): self
181+
{
182+
return new static('User Format not valid. Expecting a User serialized but found malformed data');
140183
}
141184
}

Exception/InvalidTokenException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

Exception/MockException.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
* Feel free to edit as you please, and have fun.
1010
*
1111
* @author Marc Morera <[email protected]>
12-
* @author PuntMig Technologies
1312
*/
1413

1514
declare(strict_types=1);

0 commit comments

Comments
 (0)