Skip to content

Commit

Permalink
refactor: use required annotation for model setters
Browse files Browse the repository at this point in the history
  • Loading branch information
Orkuncakilkaya committed Aug 15, 2024
1 parent 950a318 commit e7627df
Show file tree
Hide file tree
Showing 47 changed files with 139 additions and 139 deletions.
4 changes: 2 additions & 2 deletions scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ fi
(
# Model file fix
if [ "$platform" = "Darwin" ]; then
sed -i '' 's/public function setData(RawDeviceAttributesResult $data): self/public function setData(array $data): self/' ./src/Model/SignalResponseRawDeviceAttributes.php
sed -i '' 's/public function setData(?RawDeviceAttributesResult $data): self/public function setData(?array $data): self/' ./src/Model/SignalResponseRawDeviceAttributes.php
sed -i '' 's/public function getData(): ?RawDeviceAttributesResult/public function getData(): array/' ./src/Model/SignalResponseRawDeviceAttributes.php
else
sed -i 's/public function setData(RawDeviceAttributesResult $data): self/public function setData(array $data): self/' ./src/Model/SignalResponseRawDeviceAttributes.php
sed -i 's/public function setData(?RawDeviceAttributesResult $data): self/public function setData(?array $data): self/' ./src/Model/SignalResponseRawDeviceAttributes.php
sed -i 's/public function getData(): ?RawDeviceAttributesResult/public function getData(): array/' ./src/Model/SignalResponseRawDeviceAttributes.php
fi
)
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ASN.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public function getName(): ?string
*
* @return $this
*/
public function setName(string $name): self
public function setName(?string $name): self
{
$this->container['name'] = $name;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/BotdDetectionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public function getType(): ?string
*
* @return $this
*/
public function setType(string $type): self
public function setType(?string $type): self
{
$this->container['type'] = $type;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/BotdResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function getLinkedId(): ?string
*
* @return $this
*/
public function setLinkedId(string $linked_id): self
public function setLinkedId(?string $linked_id): self
{
$this->container['linked_id'] = $linked_id;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/BrowserDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public function getBotProbability(): ?int
*
* @return $this
*/
public function setBotProbability(int $bot_probability): self
public function setBotProbability(?int $bot_probability): self
{
$this->container['bot_probability'] = $bot_probability;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/DataCenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function getName(): ?string
*
* @return $this
*/
public function setName(string $name): self
public function setName(?string $name): self
{
$this->container['name'] = $name;

Expand Down
18 changes: 9 additions & 9 deletions src/Model/DeprecatedIPLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function getAccuracyRadius(): ?int
*
* @return $this
*/
public function setAccuracyRadius(int $accuracy_radius): self
public function setAccuracyRadius(?int $accuracy_radius): self
{
$this->container['accuracy_radius'] = $accuracy_radius;

Expand All @@ -276,7 +276,7 @@ public function getLatitude(): ?float
*
* @return $this
*/
public function setLatitude(float $latitude): self
public function setLatitude(?float $latitude): self
{
$this->container['latitude'] = $latitude;

Expand All @@ -298,7 +298,7 @@ public function getLongitude(): ?float
*
* @return $this
*/
public function setLongitude(float $longitude): self
public function setLongitude(?float $longitude): self
{
$this->container['longitude'] = $longitude;

Expand All @@ -320,7 +320,7 @@ public function getPostalCode(): ?string
*
* @return $this
*/
public function setPostalCode(string $postal_code): self
public function setPostalCode(?string $postal_code): self
{
$this->container['postal_code'] = $postal_code;

Expand All @@ -342,7 +342,7 @@ public function getTimezone(): ?string
*
* @return $this
*/
public function setTimezone(string $timezone): self
public function setTimezone(?string $timezone): self
{
$this->container['timezone'] = $timezone;

Expand All @@ -364,7 +364,7 @@ public function getCity(): ?DeprecatedIPLocationCity
*
* @return $this
*/
public function setCity(DeprecatedIPLocationCity $city): self
public function setCity(?DeprecatedIPLocationCity $city): self
{
$this->container['city'] = $city;

Expand All @@ -386,7 +386,7 @@ public function getCountry(): ?Location
*
* @return $this
*/
public function setCountry(Location $country): self
public function setCountry(?Location $country): self
{
$this->container['country'] = $country;

Expand All @@ -408,7 +408,7 @@ public function getContinent(): ?Location
*
* @return $this
*/
public function setContinent(Location $continent): self
public function setContinent(?Location $continent): self
{
$this->container['continent'] = $continent;

Expand All @@ -432,7 +432,7 @@ public function getSubdivisions(): ?array
*
* @return $this
*/
public function setSubdivisions(array $subdivisions): self
public function setSubdivisions(?array $subdivisions): self
{
$this->container['subdivisions'] = $subdivisions;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/DeprecatedIPLocationCity.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function getName(): ?string
*
* @return $this
*/
public function setName(string $name): self
public function setName(?string $name): self
{
$this->container['name'] = $name;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/ErrorEvent403Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function getError(): ?ErrorEvent403ResponseError
*
* @return $this
*/
public function setError(ErrorEvent403ResponseError $error): self
public function setError(?ErrorEvent403ResponseError $error): self
{
$this->container['error'] = $error;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/ErrorEvent404Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function getError(): ?ErrorEvent404ResponseError
*
* @return $this
*/
public function setError(ErrorEvent404ResponseError $error): self
public function setError(?ErrorEvent404ResponseError $error): self
{
$this->container['error'] = $error;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/EventResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function getError(): ?ProductError
*
* @return $this
*/
public function setError(ProductError $error): self
public function setError(?ProductError $error): self
{
$this->container['error'] = $error;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/HighActivityResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function getDailyRequests(): ?float
*
* @return $this
*/
public function setDailyRequests(float $daily_requests): self
public function setDailyRequests(?float $daily_requests): self
{
$this->container['daily_requests'] = $daily_requests;

Expand Down
18 changes: 9 additions & 9 deletions src/Model/IPLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public function getAccuracyRadius(): ?int
*
* @return $this
*/
public function setAccuracyRadius(int $accuracy_radius): self
public function setAccuracyRadius(?int $accuracy_radius): self
{
$this->container['accuracy_radius'] = $accuracy_radius;

Expand All @@ -274,7 +274,7 @@ public function getLatitude(): ?float
*
* @return $this
*/
public function setLatitude(float $latitude): self
public function setLatitude(?float $latitude): self
{
$this->container['latitude'] = $latitude;

Expand All @@ -296,7 +296,7 @@ public function getLongitude(): ?float
*
* @return $this
*/
public function setLongitude(float $longitude): self
public function setLongitude(?float $longitude): self
{
$this->container['longitude'] = $longitude;

Expand All @@ -318,7 +318,7 @@ public function getPostalCode(): ?string
*
* @return $this
*/
public function setPostalCode(string $postal_code): self
public function setPostalCode(?string $postal_code): self
{
$this->container['postal_code'] = $postal_code;

Expand All @@ -340,7 +340,7 @@ public function getTimezone(): ?string
*
* @return $this
*/
public function setTimezone(string $timezone): self
public function setTimezone(?string $timezone): self
{
$this->container['timezone'] = $timezone;

Expand All @@ -362,7 +362,7 @@ public function getCity(): ?IPLocationCity
*
* @return $this
*/
public function setCity(IPLocationCity $city): self
public function setCity(?IPLocationCity $city): self
{
$this->container['city'] = $city;

Expand All @@ -384,7 +384,7 @@ public function getCountry(): ?Location
*
* @return $this
*/
public function setCountry(Location $country): self
public function setCountry(?Location $country): self
{
$this->container['country'] = $country;

Expand All @@ -406,7 +406,7 @@ public function getContinent(): ?Location
*
* @return $this
*/
public function setContinent(Location $continent): self
public function setContinent(?Location $continent): self
{
$this->container['continent'] = $continent;

Expand All @@ -430,7 +430,7 @@ public function getSubdivisions(): ?array
*
* @return $this
*/
public function setSubdivisions(array $subdivisions): self
public function setSubdivisions(?array $subdivisions): self
{
$this->container['subdivisions'] = $subdivisions;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/IPLocationCity.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function getName(): ?string
*
* @return $this
*/
public function setName(string $name): self
public function setName(?string $name): self
{
$this->container['name'] = $name;

Expand Down
4 changes: 2 additions & 2 deletions src/Model/IpInfoResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function getV4(): ?IpInfoResultV4
*
* @return $this
*/
public function setV4(IpInfoResultV4 $v4): self
public function setV4(?IpInfoResultV4 $v4): self
{
$this->container['v4'] = $v4;

Expand All @@ -234,7 +234,7 @@ public function getV6(): ?IpInfoResultV6
*
* @return $this
*/
public function setV6(IpInfoResultV6 $v6): self
public function setV6(?IpInfoResultV6 $v6): self
{
$this->container['v6'] = $v6;

Expand Down
4 changes: 2 additions & 2 deletions src/Model/IpInfoResultV4.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function getAsn(): ?ASN
*
* @return $this
*/
public function setAsn(ASN $asn): self
public function setAsn(?ASN $asn): self
{
$this->container['asn'] = $asn;

Expand All @@ -297,7 +297,7 @@ public function getDatacenter(): ?DataCenter
*
* @return $this
*/
public function setDatacenter(DataCenter $datacenter): self
public function setDatacenter(?DataCenter $datacenter): self
{
$this->container['datacenter'] = $datacenter;

Expand Down
4 changes: 2 additions & 2 deletions src/Model/IpInfoResultV6.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function getAsn(): ?ASN
*
* @return $this
*/
public function setAsn(ASN $asn): self
public function setAsn(?ASN $asn): self
{
$this->container['asn'] = $asn;

Expand All @@ -297,7 +297,7 @@ public function getDatacenter(): ?DataCenter
*
* @return $this
*/
public function setDatacenter(DataCenter $datacenter): self
public function setDatacenter(?DataCenter $datacenter): self
{
$this->container['datacenter'] = $datacenter;

Expand Down
Loading

0 comments on commit e7627df

Please sign in to comment.