Skip to content

Commit

Permalink
Merge pull request #1 from luft-jetzt/extract
Browse files Browse the repository at this point in the history
Extract package
  • Loading branch information
maltehuebner authored Dec 27, 2020
2 parents 80880cb + 0e2d032 commit 4254861
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 3 deletions.
10 changes: 9 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
"email": "[email protected]"
}
],
"require": {}
"require": {
"php": "^7.4",
"jms/serializer": "^3.10"
},
"autoload": {
"psr-4": {
"Caldera\\LuftModel\\": "src"
}
}
}
2 changes: 1 addition & 1 deletion Station.php → src/Model/Station.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace Caldera\LuftApiBundle\Model;
namespace Caldera\LuftModel\Model;

use JMS\Serializer\Annotation as JMS;

Expand Down
2 changes: 1 addition & 1 deletion Value.php → src/Model/Value.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace Caldera\LuftApiBundle\Model;
namespace Caldera\LuftModel\Model;

use JMS\Serializer\Annotation as JMS;

Expand Down
222 changes: 222 additions & 0 deletions src/Station.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
<?php declare(strict_types=1);

namespace Caldera\LuftModel;

use JMS\Serializer\Annotation as JMS;

/**
* @JMS\ExclusionPolicy("ALL")
*/
class Station
{
/**
* @JMS\Expose()
*/
protected ?string $stationCode = null;

/**
* @JMS\Expose()
*/
protected ?int $ubaStationId = null;

/**
* @JMS\Expose()
*/
protected ?string $title = null;

/**
* @JMS\Expose()
*/
protected ?float $latitude = null;

/**
* @JMS\Expose()
*/
protected ?float $longitude = null;

/**
* @JMS\Expose()
*/
protected ?string $cityName = null;

/**
* @JMS\Expose()
* @JMS\Type("DateTime<'U'>")
*/
protected ?\DateTime $fromDate = null;

/**
* @JMS\Expose()
* @JMS\Type("DateTime<'U'>")
*/
protected ?\DateTime $untilDate = null;

/**
* @JMS\Expose()
*/
protected ?int $altitude = null;

/**
* @JMS\Expose()
*/
protected ?string $stationType = null;

/**
* @JMS\Expose()
*/
protected ?string $areaType = null;

/**
* @JMS\Expose()
*/
protected ?string $provider = null;

/**
* @JMS\Expose()
*/
protected ?string $network = null;

public function getStationCode(): ?string
{
return $this->stationCode;
}

public function setStationCode(string $stationCode): Station
{
$this->stationCode = $stationCode;

return $this;
}

public function getUbaStationId(): ?int
{
return $this->ubaStationId;
}

public function setUbaStationId(int $ubaStationId): Station
{
$this->ubaStationId = $ubaStationId;

return $this;
}

public function getLatitude(): ?float
{
return $this->latitude;
}

public function setLatitude(float $latitude): Station
{
$this->latitude = $latitude;

return $this;
}

public function getLongitude(): ?float
{
return $this->longitude;
}

public function setLongitude(float $longitude): Station
{
$this->longitude = $longitude;

return $this;
}

public function getTitle(): ?string
{
return $this->title;
}

public function setTitle(string $title = null): Station
{
$this->title = $title;

return $this;
}

public function setCity(string $cityName = null): Station
{
$this->cityName = $cityName;

return $this;
}

public function getCity(): ?string
{
return $this->cityName;
}

public function getFromDate(): ?\DateTime
{
return $this->fromDate;
}

public function setFromDate(\DateTime $fromDate = null): Station
{
$this->fromDate = $fromDate;

return $this;
}

public function getUntilDate(): ?\DateTime
{
return $this->untilDate;
}

public function setUntilDate(\DateTime $untilDate = null): Station
{
$this->untilDate = $untilDate;

return $this;
}

public function getAltitude(): ?int
{
return $this->altitude;
}

public function setAltitude(int $altitude): Station
{
$this->altitude = $altitude;

return $this;
}

public function getStationType(): ?string
{
return $this->stationType;
}

public function setStationType(string $stationType = null): Station
{
$this->stationType = $stationType;

return $this;
}

public function getAreaType(): ?string
{
return $this->areaType;
}

public function setAreaType(string $areaType = null): Station
{
$this->areaType = $areaType;

return $this;
}

public function getProvider(): ?string
{
return $this->provider;
}

public function setProvider(string $provider): Station
{
$this->provider = $provider;

return $this;
}
}
88 changes: 88 additions & 0 deletions src/Value.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php declare(strict_types=1);

namespace Caldera\LuftModel;

use JMS\Serializer\Annotation as JMS;

/**
* @JMS\ExclusionPolicy("ALL")
*/
class Value
{
/**
* @JMS\Expose()
* @JMS\Type("string")
*/
protected ?string $stationCode = null;

/**
* @JMS\Expose()
* @JMS\Type("DateTime<'U'>")
*/
protected ?\DateTime $dateTime = null;

/**
* @JMS\Expose()
* @JMS\Type("float")
*/
protected ?float $value = null;

/**
* @JMS\Expose()
* @JMS\Type("string")
*/
protected ?string $pollutant = null;

public function __construct()
{

}

public function getStationCode(): ?string
{
return $this->stationCode;
}

public function setStationCode(string $stationCode): Value
{
$this->stationCode = $stationCode;

return $this;
}

public function getDateTime(): ?\DateTime
{
return $this->dateTime;
}

public function setDateTime(\DateTime $dateTime): Value
{
$this->dateTime = $dateTime;

return $this;
}

public function getValue(): ?float
{
return $this->value;
}

public function setValue(float $value): Value
{
$this->value = $value;

return $this;
}

public function getPollutant(): ?string
{
return $this->pollutant;
}

public function setPollutant(string $pollutant): Value
{
$this->pollutant = $pollutant;

return $this;
}
}

0 comments on commit 4254861

Please sign in to comment.