-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
renamed
data
namespace to models
and resources
into responses
- Loading branch information
1 parent
f9a9d1d
commit bf0eb53
Showing
18 changed files
with
505 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace YouTube\Data; | ||
namespace YouTube\Models; | ||
|
||
abstract class AbstractModel | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace YouTube\Models; | ||
|
||
class SplitStream extends AbstractModel | ||
{ | ||
/** @var StreamFormat */ | ||
public $video; | ||
/** @var StreamFormat */ | ||
public $audio; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace YouTube\Models; | ||
|
||
use YouTube\Utils\Utils; | ||
|
||
class VideoDetails | ||
{ | ||
protected $videoDetails = array(); | ||
|
||
private function __construct($videoDetails) | ||
{ | ||
$this->videoDetails = $videoDetails; | ||
} | ||
|
||
/** | ||
* From `videoDetails` array that appears inside JSON on /watch or /get_video_info pages | ||
* @param $array | ||
* @return static | ||
*/ | ||
public static function fromPlayerResponseArray($array) | ||
{ | ||
return new static(Utils::arrayGet($array, 'videoDetails')); | ||
} | ||
|
||
public function getId() | ||
{ | ||
return Utils::arrayGet($this->videoDetails, 'videoId'); | ||
} | ||
|
||
public function getTitle() | ||
{ | ||
return Utils::arrayGet($this->videoDetails, 'title'); | ||
} | ||
|
||
public function getKeywords() | ||
{ | ||
return Utils::arrayGet($this->videoDetails, 'keywords'); | ||
} | ||
|
||
public function getShortDescription() | ||
{ | ||
return Utils::arrayGet($this->videoDetails, 'shortDescription'); | ||
} | ||
|
||
public function getViewCount() | ||
{ | ||
return Utils::arrayGet($this->videoDetails, 'viewCount'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/Resources/HttpResponse.php → src/Responses/HttpResponse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace YouTube\Resources; | ||
namespace YouTube\Responses; | ||
|
||
use Curl\Response; | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
src/Resources/VideoPlayerJs.php → src/Responses/VideoPlayerJs.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace YouTube\Resources; | ||
namespace YouTube\Responses; | ||
|
||
class VideoPlayerJs extends HttpResponse | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.