Skip to content

Commit

Permalink
Прописала в Data конкретные реализации вместо интерфейсов
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaKrasheninnikova committed Mar 17, 2021
1 parent 4088af9 commit 4f141bf
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 57 deletions.
10 changes: 5 additions & 5 deletions HomeappData/Registry/Dto/Address/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\Address;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\Address\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\Address\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -20,15 +20,15 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\Address\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

/**
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\Address\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships)
{
parent::__construct($id, EntityNameEnum::ADDRESS);
$this->attributes = $attributes;
Expand Down
10 changes: 5 additions & 5 deletions HomeappData/Registry/Dto/AddressBti/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\AddressBti;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Dto\AddressBti\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\AddressBti\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -19,15 +19,15 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\AddressBti\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

/**
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\AddressBti\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships = null)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships = null)
{
parent::__construct($id, EntityNameEnum::ADDRESS_BTI);
$this->attributes = $attributes;
Expand Down
10 changes: 5 additions & 5 deletions HomeappData/Registry/Dto/AddressMetroDistance/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\AddressMetroDistance;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\AddressMetroDistance\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\AddressMetroDistance\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -20,15 +20,15 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\AddressMetroDistance\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

/**
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\AddressMetroDistance\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships)
{
parent::__construct($id, EntityNameEnum::ADDRESS_METRO_DIST);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/CityArea/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Homeapp\HomeappData\Registry\Dto\CityArea;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\CityArea\Attributes as Attributes;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -18,9 +18,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\CityArea\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

public function __construct(?string $id, ?AttributesInterface $attributes)
public function __construct(?string $id, ?Attributes $attributes)
{
parent::__construct($id, EntityNameEnum::CITY_AREA);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/Complex/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Homeapp\HomeappData\Registry\Dto\Complex;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\Complex\Attributes as Attributes;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -18,9 +18,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\Complex\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

public function __construct(?string $id, ?AttributesInterface $attributes)
public function __construct(?string $id, ?Attributes $attributes)
{
parent::__construct($id, EntityNameEnum::COMPLEX);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/District/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Homeapp\HomeappData\Registry\Dto\District;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\District\Attributes as Attributes;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -18,9 +18,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\District\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

public function __construct(?string $id, ?AttributesInterface $attributes)
public function __construct(?string $id, ?Attributes $attributes)
{
parent::__construct($id, EntityNameEnum::DISTRICT);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/Highway/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Homeapp\HomeappData\Registry\Dto\Highway;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\Highway\Attributes as Attributes;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -18,9 +18,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\Highway\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

public function __construct(?string $id, ?AttributesInterface $attributes)
public function __construct(?string $id, ?Attributes $attributes)
{
parent::__construct($id, EntityNameEnum::HIGHWAY);
$this->attributes = $attributes;
Expand Down
10 changes: 5 additions & 5 deletions HomeappData/Registry/Dto/HouseHighwayDistance/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\HouseHighwayDistance;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\HouseHighwayDistance\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\HouseHighwayDistance\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -20,15 +20,15 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\HouseHighwayDistance\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

/**
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\HouseHighwayDistance\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships)
{
parent::__construct($id, EntityNameEnum::HOUSE_HIGHWAY_DISTANCE);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/Image/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Homeapp\HomeappData\Registry\Dto\Image;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\Image\Attributes as Attributes;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -18,9 +18,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\Image\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

public function __construct(?string $id, ?AttributesInterface $attributes)
public function __construct(?string $id, ?Attributes $attributes)
{
parent::__construct($id, EntityNameEnum::IMAGE);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/MetroStation/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace Homeapp\HomeappData\Registry\Dto\MetroStation;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\MetroStation\Attributes as Attributes;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -18,9 +18,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\MetroStation\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

public function __construct(?string $id, ?AttributesInterface $attributes)
public function __construct(?string $id, ?Attributes $attributes)
{
parent::__construct($id, EntityNameEnum::METRO_STATION);
$this->attributes = $attributes;
Expand Down
8 changes: 4 additions & 4 deletions HomeappData/Registry/Dto/Realty/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\Realty;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\Realty\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\Realty\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -26,9 +26,9 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\Realty\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships)
{
parent::__construct($id, EntityNameEnum::REALTY);
$this->attributes = $attributes;
Expand Down
10 changes: 5 additions & 5 deletions HomeappData/Registry/Dto/RealtyImage/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\RealtyImage;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\RealtyImage\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\RealtyImage\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -20,15 +20,15 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\RealtyImage\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

/**
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\RealtyImage\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships)
{
parent::__construct($id, EntityNameEnum::REALTY_IMAGE);
$this->attributes = $attributes;
Expand Down
6 changes: 3 additions & 3 deletions HomeappData/Registry/Dto/RealtyMetroDistance/Attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ class Attributes implements AttributesInterface
* @Serializer\Type("int")
* @Serializer\Groups({"API"})
*/
public int $distance;
public ?int $distance = null;

/**
* @Serializer\Type("int")
* @Serializer\Groups({"API"})
*/
public int $time;
public ?int $time = null;

/**
* @Serializer\Type("string")
* @Serializer\Groups({"API"})
*/
public string $method;
public ?string $method = null;

public function __construct(int $distance, int $time, string $method)
{
Expand Down
10 changes: 5 additions & 5 deletions HomeappData/Registry/Dto/RealtyMetroDistance/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Homeapp\HomeappData\Registry\Dto\RealtyMetroDistance;

use Homeapp\HomeappData\Registry\Dto\ResourceObject;
use Homeapp\JsonApi\Attributes\AttributesInterface;
use Homeapp\JsonApi\Relationships\RelationshipsInterface;
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum;
use Homeapp\HomeappData\Registry\Dto\RealtyMetroDistance\Attributes as Attributes;
use Homeapp\HomeappData\Registry\Dto\RealtyMetroDistance\Relationships as Relationships;
use JMS\Serializer\Annotation as Serializer;

/**
Expand All @@ -20,15 +20,15 @@ class Data extends ResourceObject
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\RealtyMetroDistance\Attributes")
* @Serializer\Groups({"API"})
*/
public ?AttributesInterface $attributes = null;
public ?Attributes $attributes = null;

/**
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\RealtyMetroDistance\Relationships")
* @Serializer\Groups({"API"})
*/
public ?RelationshipsInterface $relationships = null;
public ?Relationships $relationships = null;

public function __construct(?string $id, ?AttributesInterface $attributes, ?RelationshipsInterface $relationships)
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships)
{
parent::__construct($id, EntityNameEnum::REALTY_METRO_DIST);
$this->attributes = $attributes;
Expand Down
4 changes: 2 additions & 2 deletions JsonApi/ResourceIdentifierObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class ResourceIdentifierObject implements ResourceInterface
* @Serializer\Type("string")
* @Serializer\Groups({"API"})
*/
public string $id;
public ?string $id = null;

/**
* @Serializer\Type("string")
* @Serializer\Groups({"API"})
*/
public string $type;
public ?string $type = null;

/**
* @param string $id
Expand Down

0 comments on commit 4f141bf

Please sign in to comment.