Skip to content

Commit

Permalink
added abstract DTO
Browse files Browse the repository at this point in the history
  • Loading branch information
Spamercz committed Mar 9, 2017
1 parent e4ea951 commit 7e0276a
Show file tree
Hide file tree
Showing 17 changed files with 276 additions and 171 deletions.
2 changes: 1 addition & 1 deletion src/IMDB/DTO/Alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MovieParser\IMDB\DTO;

class Alias
class Alias extends Dto
{
/** @var string */
private $country;
Expand Down
21 changes: 1 addition & 20 deletions src/IMDB/DTO/Character.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,12 @@

namespace MovieParser\IMDB\DTO;

class Character
class Character extends Dto
{
/** @var int */
private $id;
/** @var string */
private $name;


/**
* @return int
*/
public function getId()
{
return $this->id;
}


/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}


/**
* @return string
Expand Down
22 changes: 1 addition & 21 deletions src/IMDB/DTO/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
namespace MovieParser\IMDB\DTO;


class Company
class Company extends Dto
{
/** @var string */
private $id;
/** @var string */
private $name;

Expand All @@ -18,24 +16,6 @@ public function __construct($data)
}


/**
* @return string
*/
public function getId()
{
return $this->id;
}


/**
* @param string $id
*/
public function setId($id)
{
$this->id = $id;
}


/**
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/IMDB/DTO/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace MovieParser\IMDB\DTO;


class Connection
class Connection extends Dto
{
/** @var string */
private $connection;
Expand Down
23 changes: 1 addition & 22 deletions src/IMDB/DTO/CrazyCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

namespace MovieParser\IMDB\DTO;

class CrazyCredit
class CrazyCredit extends Dto
{

/** @var string */
private $id;
/** @var string */
private $video;
/** @var string */
Expand Down Expand Up @@ -67,22 +64,4 @@ public function setVideo($video)
{
$this->video = $video;
}


/**
* @return string
*/
public function getId()
{
return $this->id;
}


/**
* @param string $id
*/
public function setId($id)
{
$this->id = $id;
}
}
2 changes: 1 addition & 1 deletion src/IMDB/DTO/Credit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MovieParser\IMDB\DTO;

class Credit
class Credit extends Dto
{
/** @var Company */
private $company;
Expand Down
27 changes: 27 additions & 0 deletions src/IMDB/DTO/Dto.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace MovieParser\IMDB\DTO;

abstract class Dto
{
/** @var int */
private $id;


/**
* @return int
*/
public function getId()
{
return $this->id;
}


/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
}
2 changes: 1 addition & 1 deletion src/IMDB/DTO/Episode.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MovieParser\IMDB\DTO;

class Episode
class Episode extends Dto
{
/** @var int */
private $id;
Expand Down
23 changes: 1 addition & 22 deletions src/IMDB/DTO/Goof.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

namespace MovieParser\IMDB\DTO;

class Goof
class Goof extends Dto
{

/** @var string */
private $id;
/** @var string */
private $video;
/** @var string */
Expand Down Expand Up @@ -67,22 +64,4 @@ public function setVideo($video)
{
$this->video = $video;
}


/**
* @return string
*/
public function getId()
{
return $this->id;
}


/**
* @param string $id
*/
public function setId($id)
{
$this->id = $id;
}
}
Loading

0 comments on commit 7e0276a

Please sign in to comment.