From 9e7af9bcdcd7820078c3130de50c1ecab32dec4b Mon Sep 17 00:00:00 2001 From: Hassan Khan Date: Wed, 16 Mar 2016 17:46:27 +0000 Subject: [PATCH] Updated `CHANGELOG.md` and generated documentation --- CHANGELOG.md | 8 +++++ docs/Larabros/Elogram/Client.rst | 24 +++++++------- .../Elogram/Entities/AbstractEntity.rst | 20 ------------ docs/Larabros/Elogram/Entities/index.rst | 15 --------- .../Elogram/Helpers/RedirectLoginHelper.rst | 6 ++-- .../Middleware/SecureRequestMiddleware.rst | 32 ++++++++++++++----- .../AdapterInterface.rst} | 10 +++--- .../LeagueAdapter.rst} | 12 +++---- .../Elogram/Http/OAuth2/Providers/index.rst | 10 ++++++ docs/Larabros/Elogram/Http/OAuth2/index.rst | 10 ------ docs/Larabros/Elogram/Http/UrlParserTrait.rst | 30 +++++++++++++++++ docs/Larabros/Elogram/Http/index.rst | 1 + .../Repositories/AbstractRepository.rst | 20 ++++++++++++ .../CommentsRepository.rst} | 16 +++++----- .../LikesRepository.rst} | 14 ++++---- .../LocationsRepository.rst} | 14 ++++---- .../MediaRepository.rst} | 16 +++++----- .../TagsRepository.rst} | 14 ++++---- .../UsersRepository.rst} | 14 ++++---- docs/Larabros/Elogram/Repositories/index.rst | 15 +++++++++ docs/Larabros/Elogram/index.rst | 2 +- 21 files changed, 179 insertions(+), 124 deletions(-) delete mode 100644 docs/Larabros/Elogram/Entities/AbstractEntity.rst delete mode 100644 docs/Larabros/Elogram/Entities/index.rst rename docs/Larabros/Elogram/Http/OAuth2/{ProviderInterface.rst => Providers/AdapterInterface.rst} (59%) rename docs/Larabros/Elogram/Http/OAuth2/{LeagueProvider.rst => Providers/LeagueAdapter.rst} (53%) create mode 100644 docs/Larabros/Elogram/Http/OAuth2/Providers/index.rst delete mode 100644 docs/Larabros/Elogram/Http/OAuth2/index.rst create mode 100644 docs/Larabros/Elogram/Http/UrlParserTrait.rst create mode 100644 docs/Larabros/Elogram/Repositories/AbstractRepository.rst rename docs/Larabros/Elogram/{Entities/Comment.rst => Repositories/CommentsRepository.rst} (78%) rename docs/Larabros/Elogram/{Entities/LikeRepository.rst => Repositories/LikesRepository.rst} (71%) rename docs/Larabros/Elogram/{Entities/Location.rst => Repositories/LocationsRepository.rst} (83%) rename docs/Larabros/Elogram/{Entities/Media.rst => Repositories/MediaRepository.rst} (77%) rename docs/Larabros/Elogram/{Entities/Tag.rst => Repositories/TagsRepository.rst} (74%) rename docs/Larabros/Elogram/{Entities/User.rst => Repositories/UsersRepository.rst} (89%) create mode 100644 docs/Larabros/Elogram/Repositories/index.rst diff --git a/CHANGELOG.md b/CHANGELOG.md index 041f696..4e87c32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,14 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ### Security - Nothing +## 1.1.8 - 2016-03-16 + +### Added +- Created `Http\UrlParserTrait` and moved methods `SecureRequestMiddleware::getPath()` and `SecureRequestMiddleware::getParams()` to it. + +### Fixed +- Changed namespace `Entities` to `Repositories`. + ## 1.1.7 - 2016-03-15 ### Fixed diff --git a/docs/Larabros/Elogram/Client.rst b/docs/Larabros/Elogram/Client.rst index 8a22400..d6447ca 100644 --- a/docs/Larabros/Elogram/Client.rst +++ b/docs/Larabros/Elogram/Client.rst @@ -38,39 +38,39 @@ Larabros\\Elogram\\Client .. php:method:: users() - Returns the current instance of :php:class:`User`. + Returns the current instance of :php:class:`UsersRepository`. - :returns: User + :returns: UsersRepository .. php:method:: media() - Returns the current instance of :php:class:`Media`. + Returns the current instance of :php:class:`MediaRepository`. - :returns: Media + :returns: MediaRepository .. php:method:: comments() - Returns the current instance of :php:class:`Comment`. + Returns the current instance of :php:class:`CommentsRepository`. - :returns: Comment + :returns: CommentsRepository .. php:method:: likes() - Returns the current instance of :php:class:`LikeRepository`. + Returns the current instance of :php:class:`LikesRepository`. - :returns: LikeRepository + :returns: LikesRepository .. php:method:: tags() - Returns the current instance of :php:class:`Tag`. + Returns the current instance of :php:class:`TagsRepository`. - :returns: Tag + :returns: TagsRepository .. php:method:: locations() - Returns the current instance of :php:class:`Location`. + Returns the current instance of :php:class:`LocationsRepository`. - :returns: Location + :returns: LocationsRepository .. php:method:: request($method, $uri, $parameters = []) diff --git a/docs/Larabros/Elogram/Entities/AbstractEntity.rst b/docs/Larabros/Elogram/Entities/AbstractEntity.rst deleted file mode 100644 index 05ae574..0000000 --- a/docs/Larabros/Elogram/Entities/AbstractEntity.rst +++ /dev/null @@ -1,20 +0,0 @@ -------------------------------------------- -Larabros\\Elogram\\Entities\\AbstractEntity -------------------------------------------- - -.. php:namespace: Larabros\\Elogram\\Entities - -.. php:class:: AbstractEntity - - An abstract entity class. Any new endpoints should extend this class. - - .. php:attr:: client - - protected AdapterInterface - - .. php:method:: __construct(AdapterInterface $client) - - Creates a new instance of :php:class:`AbstractEntity`. - - :type $client: AdapterInterface - :param $client: diff --git a/docs/Larabros/Elogram/Entities/index.rst b/docs/Larabros/Elogram/Entities/index.rst deleted file mode 100644 index 55b9b3b..0000000 --- a/docs/Larabros/Elogram/Entities/index.rst +++ /dev/null @@ -1,15 +0,0 @@ -''''''''''''''''''''''''''' -Larabros\\Elogram\\Entities -''''''''''''''''''''''''''' - -.. php:namespace: Larabros\\Elogram\\Entities - -.. toctree:: - - AbstractEntity - Comment - LikeRepository - Location - Media - Tag - User diff --git a/docs/Larabros/Elogram/Helpers/RedirectLoginHelper.rst b/docs/Larabros/Elogram/Helpers/RedirectLoginHelper.rst index 9b0e3b4..eead268 100644 --- a/docs/Larabros/Elogram/Helpers/RedirectLoginHelper.rst +++ b/docs/Larabros/Elogram/Helpers/RedirectLoginHelper.rst @@ -10,17 +10,17 @@ Larabros\\Elogram\\Helpers\\RedirectLoginHelper .. php:attr:: provider - protected ProviderInterface + protected AdapterInterface .. php:attr:: store protected DataStoreInterface - .. php:method:: __construct(ProviderInterface $provider, DataStoreInterface $store) + .. php:method:: __construct(AdapterInterface $provider, DataStoreInterface $store) Creates an instance of :php:class:`RedirectLoginHelper`. - :type $provider: ProviderInterface + :type $provider: AdapterInterface :param $provider: :type $store: DataStoreInterface :param $store: diff --git a/docs/Larabros/Elogram/Http/Middleware/SecureRequestMiddleware.rst b/docs/Larabros/Elogram/Http/Middleware/SecureRequestMiddleware.rst index f2940b5..fe9df07 100644 --- a/docs/Larabros/Elogram/Http/Middleware/SecureRequestMiddleware.rst +++ b/docs/Larabros/Elogram/Http/Middleware/SecureRequestMiddleware.rst @@ -28,19 +28,14 @@ Larabros\\Elogram\\Http\\Middleware\\SecureRequestMiddleware :param $request: :param $options: - .. php:method:: getPath($path) - - :param $path: - - .. php:method:: getParams($query) - - :param $query: - .. php:method:: generateSig($endpoint, $params, $secret) + Generates a ``sig`` value for a request. + :param $endpoint: :param $params: :param $secret: + :returns: string .. php:method:: create(ConfigInterface $config) @@ -50,6 +45,27 @@ Larabros\\Elogram\\Http\\Middleware\\SecureRequestMiddleware :param $config: :returns: Closure + .. php:method:: getPath(UriInterface $uri) + + Gets the path from a ``UriInterface`` instance after removing the version + prefix. + + :type $uri: UriInterface + :param $uri: + :returns: string + + .. php:method:: getQueryParams(UriInterface $uri, $exclude = ['sig'], $params = []) + + Gets the query parameters as an array from a ``UriInterface`` instance. + + :type $uri: UriInterface + :param $uri: + :type $exclude: array + :param $exclude: + :type $params: array + :param $params: + :returns: array + .. php:method:: __construct($nextHandler, ConfigInterface $config) Creates an instance of :php:class:`AbstractMiddleware`. diff --git a/docs/Larabros/Elogram/Http/OAuth2/ProviderInterface.rst b/docs/Larabros/Elogram/Http/OAuth2/Providers/AdapterInterface.rst similarity index 59% rename from docs/Larabros/Elogram/Http/OAuth2/ProviderInterface.rst rename to docs/Larabros/Elogram/Http/OAuth2/Providers/AdapterInterface.rst index 5c7c50a..ee69300 100644 --- a/docs/Larabros/Elogram/Http/OAuth2/ProviderInterface.rst +++ b/docs/Larabros/Elogram/Http/OAuth2/Providers/AdapterInterface.rst @@ -1,10 +1,10 @@ --------------------------------------------------- -Larabros\\Elogram\\Http\\OAuth2\\ProviderInterface --------------------------------------------------- +------------------------------------------------------------ +Larabros\\Elogram\\Http\\OAuth2\\Providers\\AdapterInterface +------------------------------------------------------------ -.. php:namespace: Larabros\\Elogram\\Http\\OAuth2 +.. php:namespace: Larabros\\Elogram\\Http\\OAuth2\\Providers -.. php:interface:: ProviderInterface +.. php:interface:: AdapterInterface An interface for OAuth2 providers. diff --git a/docs/Larabros/Elogram/Http/OAuth2/LeagueProvider.rst b/docs/Larabros/Elogram/Http/OAuth2/Providers/LeagueAdapter.rst similarity index 53% rename from docs/Larabros/Elogram/Http/OAuth2/LeagueProvider.rst rename to docs/Larabros/Elogram/Http/OAuth2/Providers/LeagueAdapter.rst index c54ada7..1f6eb93 100644 --- a/docs/Larabros/Elogram/Http/OAuth2/LeagueProvider.rst +++ b/docs/Larabros/Elogram/Http/OAuth2/Providers/LeagueAdapter.rst @@ -1,12 +1,12 @@ ------------------------------------------------ -Larabros\\Elogram\\Http\\OAuth2\\LeagueProvider ------------------------------------------------ +--------------------------------------------------------- +Larabros\\Elogram\\Http\\OAuth2\\Providers\\LeagueAdapter +--------------------------------------------------------- -.. php:namespace: Larabros\\Elogram\\Http\\OAuth2 +.. php:namespace: Larabros\\Elogram\\Http\\OAuth2\\Providers -.. php:class:: LeagueProvider +.. php:class:: LeagueAdapter - An OAuth2 provider for the League OAuth2 package. + An OAuth2 provider for the League Instagram OAuth2 package. .. php:method:: getAuthorizationUrl($options = []) diff --git a/docs/Larabros/Elogram/Http/OAuth2/Providers/index.rst b/docs/Larabros/Elogram/Http/OAuth2/Providers/index.rst new file mode 100644 index 0000000..776f4c4 --- /dev/null +++ b/docs/Larabros/Elogram/Http/OAuth2/Providers/index.rst @@ -0,0 +1,10 @@ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Larabros\\Elogram\\Http\\OAuth2\\Providers +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. php:namespace: Larabros\\Elogram\\Http\\OAuth2\\Providers + +.. toctree:: + + AdapterInterface + LeagueAdapter diff --git a/docs/Larabros/Elogram/Http/OAuth2/index.rst b/docs/Larabros/Elogram/Http/OAuth2/index.rst deleted file mode 100644 index 89ab245..0000000 --- a/docs/Larabros/Elogram/Http/OAuth2/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -""""""""""""""""""""""""""""""" -Larabros\\Elogram\\Http\\OAuth2 -""""""""""""""""""""""""""""""" - -.. php:namespace: Larabros\\Elogram\\Http\\OAuth2 - -.. toctree:: - - LeagueProvider - ProviderInterface diff --git a/docs/Larabros/Elogram/Http/UrlParserTrait.rst b/docs/Larabros/Elogram/Http/UrlParserTrait.rst new file mode 100644 index 0000000..b512808 --- /dev/null +++ b/docs/Larabros/Elogram/Http/UrlParserTrait.rst @@ -0,0 +1,30 @@ +--------------------------------------- +Larabros\\Elogram\\Http\\UrlParserTrait +--------------------------------------- + +.. php:namespace: Larabros\\Elogram\\Http + +.. php:trait:: UrlParserTrait + + Adds utility classes for parsing parts of a URL. + + .. php:method:: getPath(UriInterface $uri) + + Gets the path from a ``UriInterface`` instance after removing the version + prefix. + + :type $uri: UriInterface + :param $uri: + :returns: string + + .. php:method:: getQueryParams(UriInterface $uri, $exclude = ['sig'], $params = []) + + Gets the query parameters as an array from a ``UriInterface`` instance. + + :type $uri: UriInterface + :param $uri: + :type $exclude: array + :param $exclude: + :type $params: array + :param $params: + :returns: array diff --git a/docs/Larabros/Elogram/Http/index.rst b/docs/Larabros/Elogram/Http/index.rst index c1386f1..8f1f0db 100644 --- a/docs/Larabros/Elogram/Http/index.rst +++ b/docs/Larabros/Elogram/Http/index.rst @@ -11,3 +11,4 @@ Larabros\\Elogram\\Http OAuth2/index Response Sessions/index + UrlParserTrait diff --git a/docs/Larabros/Elogram/Repositories/AbstractRepository.rst b/docs/Larabros/Elogram/Repositories/AbstractRepository.rst new file mode 100644 index 0000000..1b89583 --- /dev/null +++ b/docs/Larabros/Elogram/Repositories/AbstractRepository.rst @@ -0,0 +1,20 @@ +--------------------------------------------------- +Larabros\\Elogram\\Repositories\\AbstractRepository +--------------------------------------------------- + +.. php:namespace: Larabros\\Elogram\\Repositories + +.. php:class:: AbstractRepository + + An abstract repository class. Any new endpoints should extend this class. + + .. php:attr:: client + + protected AdapterInterface + + .. php:method:: __construct(AdapterInterface $client) + + Creates a new instance of :php:class:`AbstractRepository`. + + :type $client: AdapterInterface + :param $client: diff --git a/docs/Larabros/Elogram/Entities/Comment.rst b/docs/Larabros/Elogram/Repositories/CommentsRepository.rst similarity index 78% rename from docs/Larabros/Elogram/Entities/Comment.rst rename to docs/Larabros/Elogram/Repositories/CommentsRepository.rst index 972da81..7ccaed3 100644 --- a/docs/Larabros/Elogram/Entities/Comment.rst +++ b/docs/Larabros/Elogram/Repositories/CommentsRepository.rst @@ -1,12 +1,12 @@ ------------------------------------- -Larabros\\Elogram\\Entities\\Comment ------------------------------------- +--------------------------------------------------- +Larabros\\Elogram\\Repositories\\CommentsRepository +--------------------------------------------------- -.. php:namespace: Larabros\\Elogram\\Entities +.. php:namespace: Larabros\\Elogram\\Repositories -.. php:class:: Comment +.. php:class:: CommentsRepository - Comment + CommentsRepository .. php:attr:: client @@ -31,7 +31,7 @@ Larabros\\Elogram\\Entities\\Comment :param $mediaId: :type $text: string - :param $text: Text to post as a comment on the media object as specified by `$mediaId` + :param $text: Text to post as a comment on the media object :returns: Response .. php:method:: delete($mediaId, $commentId) @@ -46,7 +46,7 @@ Larabros\\Elogram\\Entities\\Comment .. php:method:: __construct(AdapterInterface $client) - Creates a new instance of :php:class:`AbstractEntity`. + Creates a new instance of :php:class:`AbstractRepository`. :type $client: AdapterInterface :param $client: diff --git a/docs/Larabros/Elogram/Entities/LikeRepository.rst b/docs/Larabros/Elogram/Repositories/LikesRepository.rst similarity index 71% rename from docs/Larabros/Elogram/Entities/LikeRepository.rst rename to docs/Larabros/Elogram/Repositories/LikesRepository.rst index a32d6be..586b385 100644 --- a/docs/Larabros/Elogram/Entities/LikeRepository.rst +++ b/docs/Larabros/Elogram/Repositories/LikesRepository.rst @@ -1,12 +1,12 @@ -------------------------------------------- -Larabros\\Elogram\\Entities\\LikeRepository -------------------------------------------- +------------------------------------------------ +Larabros\\Elogram\\Repositories\\LikesRepository +------------------------------------------------ -.. php:namespace: Larabros\\Elogram\\Entities +.. php:namespace: Larabros\\Elogram\\Repositories -.. php:class:: LikeRepository +.. php:class:: LikesRepository - LikeRepository class. + LikesRepository class. .. php:attr:: client @@ -38,7 +38,7 @@ Larabros\\Elogram\\Entities\\LikeRepository .. php:method:: __construct(AdapterInterface $client) - Creates a new instance of :php:class:`AbstractEntity`. + Creates a new instance of :php:class:`AbstractRepository`. :type $client: AdapterInterface :param $client: diff --git a/docs/Larabros/Elogram/Entities/Location.rst b/docs/Larabros/Elogram/Repositories/LocationsRepository.rst similarity index 83% rename from docs/Larabros/Elogram/Entities/Location.rst rename to docs/Larabros/Elogram/Repositories/LocationsRepository.rst index 2037536..4bd698c 100644 --- a/docs/Larabros/Elogram/Entities/Location.rst +++ b/docs/Larabros/Elogram/Repositories/LocationsRepository.rst @@ -1,12 +1,12 @@ -------------------------------------- -Larabros\\Elogram\\Entities\\Location -------------------------------------- +---------------------------------------------------- +Larabros\\Elogram\\Repositories\\LocationsRepository +---------------------------------------------------- -.. php:namespace: Larabros\\Elogram\\Entities +.. php:namespace: Larabros\\Elogram\\Repositories -.. php:class:: Location +.. php:class:: LocationsRepository - Location + LocationsRepository .. php:attr:: client @@ -61,7 +61,7 @@ Larabros\\Elogram\\Entities\\Location .. php:method:: __construct(AdapterInterface $client) - Creates a new instance of :php:class:`AbstractEntity`. + Creates a new instance of :php:class:`AbstractRepository`. :type $client: AdapterInterface :param $client: diff --git a/docs/Larabros/Elogram/Entities/Media.rst b/docs/Larabros/Elogram/Repositories/MediaRepository.rst similarity index 77% rename from docs/Larabros/Elogram/Entities/Media.rst rename to docs/Larabros/Elogram/Repositories/MediaRepository.rst index b8e6e01..4ae4c9c 100644 --- a/docs/Larabros/Elogram/Entities/Media.rst +++ b/docs/Larabros/Elogram/Repositories/MediaRepository.rst @@ -1,12 +1,12 @@ ----------------------------------- -Larabros\\Elogram\\Entities\\Media ----------------------------------- +------------------------------------------------ +Larabros\\Elogram\\Repositories\\MediaRepository +------------------------------------------------ -.. php:namespace: Larabros\\Elogram\\Entities +.. php:namespace: Larabros\\Elogram\\Repositories -.. php:class:: Media +.. php:class:: MediaRepository - Media + MediaRepository .. php:attr:: client @@ -22,7 +22,7 @@ Larabros\\Elogram\\Entities\\Media .. php:method:: getByShortcode($shortcode) - This method returns the same response as :php:meth:`Media::get` + This method returns the same response as :php:meth:`MediaRepository::get` :type $shortcode: string :param $shortcode: The shortcode of the media object @@ -42,7 +42,7 @@ Larabros\\Elogram\\Entities\\Media .. php:method:: __construct(AdapterInterface $client) - Creates a new instance of :php:class:`AbstractEntity`. + Creates a new instance of :php:class:`AbstractRepository`. :type $client: AdapterInterface :param $client: diff --git a/docs/Larabros/Elogram/Entities/Tag.rst b/docs/Larabros/Elogram/Repositories/TagsRepository.rst similarity index 74% rename from docs/Larabros/Elogram/Entities/Tag.rst rename to docs/Larabros/Elogram/Repositories/TagsRepository.rst index edf3b9a..565a96b 100644 --- a/docs/Larabros/Elogram/Entities/Tag.rst +++ b/docs/Larabros/Elogram/Repositories/TagsRepository.rst @@ -1,12 +1,12 @@ --------------------------------- -Larabros\\Elogram\\Entities\\Tag --------------------------------- +----------------------------------------------- +Larabros\\Elogram\\Repositories\\TagsRepository +----------------------------------------------- -.. php:namespace: Larabros\\Elogram\\Entities +.. php:namespace: Larabros\\Elogram\\Repositories -.. php:class:: Tag +.. php:class:: TagsRepository - Tag + TagsRepository .. php:attr:: client @@ -42,7 +42,7 @@ Larabros\\Elogram\\Entities\\Tag .. php:method:: __construct(AdapterInterface $client) - Creates a new instance of :php:class:`AbstractEntity`. + Creates a new instance of :php:class:`AbstractRepository`. :type $client: AdapterInterface :param $client: diff --git a/docs/Larabros/Elogram/Entities/User.rst b/docs/Larabros/Elogram/Repositories/UsersRepository.rst similarity index 89% rename from docs/Larabros/Elogram/Entities/User.rst rename to docs/Larabros/Elogram/Repositories/UsersRepository.rst index 85cdf09..570800d 100644 --- a/docs/Larabros/Elogram/Entities/User.rst +++ b/docs/Larabros/Elogram/Repositories/UsersRepository.rst @@ -1,12 +1,12 @@ ---------------------------------- -Larabros\\Elogram\\Entities\\User ---------------------------------- +------------------------------------------------ +Larabros\\Elogram\\Repositories\\UsersRepository +------------------------------------------------ -.. php:namespace: Larabros\\Elogram\\Entities +.. php:namespace: Larabros\\Elogram\\Repositories -.. php:class:: User +.. php:class:: UsersRepository - User + UsersRepository .. php:attr:: client @@ -100,7 +100,7 @@ Larabros\\Elogram\\Entities\\User .. php:method:: __construct(AdapterInterface $client) - Creates a new instance of :php:class:`AbstractEntity`. + Creates a new instance of :php:class:`AbstractRepository`. :type $client: AdapterInterface :param $client: diff --git a/docs/Larabros/Elogram/Repositories/index.rst b/docs/Larabros/Elogram/Repositories/index.rst new file mode 100644 index 0000000..34d6d7a --- /dev/null +++ b/docs/Larabros/Elogram/Repositories/index.rst @@ -0,0 +1,15 @@ +''''''''''''''''''''''''''''''' +Larabros\\Elogram\\Repositories +''''''''''''''''''''''''''''''' + +.. php:namespace: Larabros\\Elogram\\Repositories + +.. toctree:: + + AbstractRepository + CommentsRepository + LikesRepository + LocationsRepository + MediaRepository + TagsRepository + UsersRepository diff --git a/docs/Larabros/Elogram/index.rst b/docs/Larabros/Elogram/index.rst index 4a70d21..dd25094 100644 --- a/docs/Larabros/Elogram/index.rst +++ b/docs/Larabros/Elogram/index.rst @@ -9,8 +9,8 @@ API Reference Client Config Container/index - Entities/index Exceptions/index Helpers/index Http/index Providers/index + Repositories/index