-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Follow base api 1.0 #8
Open
Nek-
wants to merge
23
commits into
master
Choose a base branch
from
1.0
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b55f894
Updated composer.json & api factory
Nek- a0450fe
Added more adaptations for base api
Nek- 9b2de71
Fixed api factory
Nek- 8fbe5f7
Added youtube api namespace for auth strategies
Nek- 6aa3271
Fixed auths
Nek- baa0db9
Switched to phpspec
Nek- 2c6d708
Started fixed service auth
Nek- c3dcdf7
Adapt auths
Nek- 5047a8b
Added service class
Nek- 43f2286
Removed old tests and add transformers
Nek- 3b5df98
Added Model Transformer
Nek- 5de8794
Added new models
Nek- 3d9a751
Fixed bug on hydrator and added channel model
Nek- a64dd08
Added ChannelSection model
Nek- 788151c
Il8n models
Nek- a355c03
Added PlaylistItem and Search models
Nek- 8d34ac7
Added Subscription , VideoCategory model
Nek- 270984f
Added Watermark model
Nek- a28a52d
Fixed Video Model
Nek- 6461bc9
Added Channels APIs
Nek- 03e4361
Added GuideCategoryApi
Nek- cb484fd
Some fixes
Nek- 074fef8
Update LICENCE
Nek- File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,16 @@ | ||
1.0.0 (2014-09-XX) | ||
================== | ||
|
||
Most changes are because of the new base api release. | ||
|
||
New features | ||
------------ | ||
|
||
* Compatibility with HHVM | ||
|
||
Changes | ||
----------- | ||
|
||
* Configuring authentication is now possible by using the method `useAuthentication` | ||
* Getting API classes is done via getter, before: `->api('videos')`, now: `->getVideosApi()` this method is IDE-friendly | ||
* Authentication can now use the same client as the api itself |
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,21 +1,26 @@ | ||
{ | ||
"name": "nekland/youtube-api", | ||
"type": "library", | ||
"description": "Simple library you can build you're api upon.", | ||
"keywords": ["nekland", "api", "base"], | ||
"description": "Youtube API made easy !", | ||
"keywords": ["nekland", "api", "youtube"], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Maxime Veber", | ||
"email": "nekland@gmail.com", | ||
"email": "nek.dev@gmail.com", | ||
"homepage": "http://nekland.fr" | ||
}, | ||
{ | ||
"name": "Nekland Team", | ||
"email": "[email protected]", | ||
"homepage": "http://team.nekland.fr" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.4", | ||
"guzzle/guzzle": ">=3.7", | ||
"nekland/base-api": "~0.0.1", | ||
"namshi/jose": "~1.2" | ||
"php": ">=5.4", | ||
"guzzlehttp/guzzle": "~4.0", | ||
"nekland/base-api": "~1.0", | ||
"namshi/jose": "~1.2" | ||
}, | ||
"suggest": { | ||
"nekland/soundcloud-api": "Soundcloud API made easy !" | ||
|
@@ -24,6 +29,12 @@ | |
"psr-0": { "Nekland\\": "lib/" } | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": ">=3.7" | ||
"phpspec/phpspec": "~2.0" | ||
}, | ||
"minimum-stability": "dev", | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.x-dev" | ||
} | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
/** | ||
* This file is a part of nekland youtube api package | ||
* | ||
* (c) Nekland <[email protected]> | ||
* | ||
* For the full license, take a look to the LICENSE file | ||
* on the root directory of this project | ||
*/ | ||
|
||
namespace Nekland\YoutubeApi\Api; | ||
|
||
use Nekland\BaseApi\Api\AbstractApi; | ||
use Nekland\YoutubeApi\Api\Behavior\ListTrait; | ||
|
||
/** | ||
* Class Activities | ||
* | ||
* Note about the "parts" array: it can take the following values: | ||
* id, contentDetails, snippet. | ||
* | ||
* @see https://developers.google.com/youtube/v3/docs/activities/list for more information about paramaters | ||
* @see https://developers.google.com/youtube/v3/docs/activities#resource for more information about json format | ||
*/ | ||
class Activities extends AbstractApi | ||
{ | ||
use ListTrait; | ||
|
||
public function getUrl() | ||
{ | ||
return 'youtube/v3/activities'; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return 'activity'; | ||
} | ||
} |
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,35 @@ | ||
<?php | ||
|
||
/** | ||
* This file is a part of nekland youtube api package | ||
* | ||
* (c) Nekland <[email protected]> | ||
* | ||
* For the full license, take a look to the LICENSE file | ||
* on the root directory of this project | ||
*/ | ||
|
||
namespace Nekland\YoutubeApi\Api; | ||
|
||
|
||
use Nekland\BaseApi\Api\AbstractApi; | ||
use Nekland\YoutubeApi\Api\Behavior\ListTrait; | ||
|
||
/** | ||
* Class ChannelSections | ||
* | ||
* Note about the "parts" array: it can take the following values: | ||
* id, contentDetails, snippet. | ||
* | ||
* @see https://developers.google.com/youtube/v3/docs/channelSections/list for more information about paramaters | ||
* @see https://developers.google.com/youtube/v3/docs/channelSections#resource for more information about json format | ||
*/ | ||
class ChannelSections extends AbstractApi | ||
{ | ||
use ListTrait; | ||
|
||
public function getUrl() | ||
{ | ||
return 'youtube/v3/channelSections'; | ||
} | ||
} |
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,41 @@ | ||
<?php | ||
|
||
/** | ||
* This file is a part of nekland youtube api package | ||
* | ||
* (c) Nekland <[email protected]> | ||
* | ||
* For the full license, take a look to the LICENSE file | ||
* on the root directory of this project | ||
*/ | ||
|
||
namespace Nekland\YoutubeApi\Api; | ||
|
||
|
||
use Nekland\BaseApi\Api\AbstractApi; | ||
use Nekland\YoutubeApi\Api\Behavior\ListTrait; | ||
|
||
/** | ||
* Class Channels | ||
* | ||
* Note about the "parts" array: it can take the following values: | ||
* id, contentDetails, snippet, brandingSettings, auditDetails, | ||
* contentOwnerDetails, invideoPromotion, statistics, status, topicDetails. | ||
* | ||
* @see https://developers.google.com/youtube/v3/docs/channels/list for more information about paramaters | ||
* @see https://developers.google.com/youtube/v3/docs/channels#resource for more information about json format | ||
*/ | ||
class Channels extends AbstractApi | ||
{ | ||
use ListTrait; | ||
|
||
public function getUrl() | ||
{ | ||
return 'youtube/v3/channels'; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return 'channel'; | ||
} | ||
} |
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,35 @@ | ||
<?php | ||
|
||
/** | ||
* This file is a part of nekland youtube api package | ||
* | ||
* (c) Nekland <[email protected]> | ||
* | ||
* For the full license, take a look to the LICENSE file | ||
* on the root directory of this project | ||
*/ | ||
|
||
namespace Nekland\YoutubeApi\Api; | ||
|
||
|
||
use Nekland\BaseApi\Api\AbstractApi; | ||
use Nekland\YoutubeApi\Api\Behavior\ListTrait; | ||
|
||
/** | ||
* Class GuideCategories | ||
* | ||
* Note about the "parts" array: it can take the following values: | ||
* snippet | ||
* | ||
* @see https://developers.google.com/youtube/v3/docs/guideCategories/list for more information about paramaters | ||
* @see https://developers.google.com/youtube/v3/docs/guideCategories#resource for more information about json format | ||
*/ | ||
class GuideCategories extends AbstractApi | ||
{ | ||
use ListTrait; | ||
|
||
public function getUrl() | ||
{ | ||
return 'youtube/v3/guideCategories'; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -10,10 +10,10 @@ | |
*/ | ||
|
||
namespace Nekland\YoutubeApi\Api; | ||
|
||
use Nekland\BaseApi\Api\AbstractApi; | ||
use Nekland\YoutubeApi\Api\Behavior\ListTrait; | ||
|
||
|
||
/** | ||
* Class Videos | ||
* | ||
|
@@ -26,7 +26,15 @@ | |
*/ | ||
class Videos extends AbstractApi | ||
{ | ||
const URL = 'youtube/v3/videos'; | ||
|
||
use ListTrait; | ||
|
||
public function getUrl() | ||
{ | ||
return 'youtube/v3/videos'; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return 'video'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. best practice in constant |
||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To force a user extending AbstractApi to define theses methods.
He don't have to if they are just consts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and with return self::URL; ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see the interest of having 2 way to get the information