@@ -12,116 +12,116 @@ |
||
| 12 | 12 | class References extends AbstractGitData |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Get a Reference |
|
| 17 | - * |
|
| 18 | - * @link https://developer.github.com/v3/git/refs/#get-a-reference |
|
| 19 | - * |
|
| 20 | - * @param string $branch |
|
| 21 | - * |
|
| 22 | - * @return array |
|
| 23 | - * @throws \Exception |
|
| 24 | - */ |
|
| 25 | - public function get(string $branch): array |
|
| 26 | - { |
|
| 27 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
| 28 | - '/repos/:owner/:repo/git/refs/heads/:branch', |
|
| 29 | - $this->getGitData()->getOwner(), |
|
| 30 | - $this->getGitData()->getRepo(), |
|
| 31 | - $branch |
|
| 32 | - )); |
|
| 33 | - } |
|
| 15 | + /** |
|
| 16 | + * Get a Reference |
|
| 17 | + * |
|
| 18 | + * @link https://developer.github.com/v3/git/refs/#get-a-reference |
|
| 19 | + * |
|
| 20 | + * @param string $branch |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + * @throws \Exception |
|
| 24 | + */ |
|
| 25 | + public function get(string $branch): array |
|
| 26 | + { |
|
| 27 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
| 28 | + '/repos/:owner/:repo/git/refs/heads/:branch', |
|
| 29 | + $this->getGitData()->getOwner(), |
|
| 30 | + $this->getGitData()->getRepo(), |
|
| 31 | + $branch |
|
| 32 | + )); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Get all References |
|
| 37 | - * |
|
| 38 | - * @link https://developer.github.com/v3/git/refs/#get-all-references |
|
| 39 | - * @return array |
|
| 40 | - * @throws \Exception |
|
| 41 | - */ |
|
| 42 | - public function getAll(): array |
|
| 43 | - { |
|
| 44 | - return $this->getApi()->request($this->getApi() |
|
| 45 | - ->sprintf( |
|
| 46 | - '/repos/:owner/:repo/git/refs', |
|
| 47 | - $this->getGitData()->getOwner(), |
|
| 48 | - $this->getGitData()->getRepo() |
|
| 49 | - )); |
|
| 50 | - } |
|
| 35 | + /** |
|
| 36 | + * Get all References |
|
| 37 | + * |
|
| 38 | + * @link https://developer.github.com/v3/git/refs/#get-all-references |
|
| 39 | + * @return array |
|
| 40 | + * @throws \Exception |
|
| 41 | + */ |
|
| 42 | + public function getAll(): array |
|
| 43 | + { |
|
| 44 | + return $this->getApi()->request($this->getApi() |
|
| 45 | + ->sprintf( |
|
| 46 | + '/repos/:owner/:repo/git/refs', |
|
| 47 | + $this->getGitData()->getOwner(), |
|
| 48 | + $this->getGitData()->getRepo() |
|
| 49 | + )); |
|
| 50 | + } |
|
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Create a Reference |
|
| 54 | - * |
|
| 55 | - * @link https://developer.github.com/v3/git/refs/#create-a-reference |
|
| 56 | - * |
|
| 57 | - * @param string $ref |
|
| 58 | - * @param string $sha |
|
| 59 | - * |
|
| 60 | - * @return array |
|
| 61 | - * @throws \Exception |
|
| 62 | - */ |
|
| 63 | - public function create(string $ref, string $sha): array |
|
| 64 | - { |
|
| 65 | - return $this->getApi()->request($this->getApi() |
|
| 66 | - ->sprintf( |
|
| 67 | - '/repos/:owner/:repo/git/refs', |
|
| 68 | - $this->getGitData()->getOwner(), |
|
| 69 | - $this->getGitData()->getRepo() |
|
| 70 | - ), Request::METHOD_POST, [ |
|
| 71 | - 'ref' => $ref, |
|
| 72 | - 'sha' => $sha |
|
| 73 | - ]); |
|
| 74 | - } |
|
| 52 | + /** |
|
| 53 | + * Create a Reference |
|
| 54 | + * |
|
| 55 | + * @link https://developer.github.com/v3/git/refs/#create-a-reference |
|
| 56 | + * |
|
| 57 | + * @param string $ref |
|
| 58 | + * @param string $sha |
|
| 59 | + * |
|
| 60 | + * @return array |
|
| 61 | + * @throws \Exception |
|
| 62 | + */ |
|
| 63 | + public function create(string $ref, string $sha): array |
|
| 64 | + { |
|
| 65 | + return $this->getApi()->request($this->getApi() |
|
| 66 | + ->sprintf( |
|
| 67 | + '/repos/:owner/:repo/git/refs', |
|
| 68 | + $this->getGitData()->getOwner(), |
|
| 69 | + $this->getGitData()->getRepo() |
|
| 70 | + ), Request::METHOD_POST, [ |
|
| 71 | + 'ref' => $ref, |
|
| 72 | + 'sha' => $sha |
|
| 73 | + ]); |
|
| 74 | + } |
|
| 75 | 75 | |
| 76 | - /** |
|
| 77 | - * Update a Reference |
|
| 78 | - * |
|
| 79 | - * @link https://developer.github.com/v3/git/refs/#update-a-reference |
|
| 80 | - * |
|
| 81 | - * @param string $ref |
|
| 82 | - * @param string $sha |
|
| 83 | - * @param bool $force |
|
| 84 | - * |
|
| 85 | - * @return array |
|
| 86 | - * @throws \Exception |
|
| 87 | - */ |
|
| 88 | - public function update(string $ref, string $sha, bool $force = false): array |
|
| 89 | - { |
|
| 90 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
| 91 | - '/repos/:owner/:repo/git/refs/:ref', |
|
| 92 | - $this->getGitData()->getOwner(), |
|
| 93 | - $this->getGitData()->getRepo(), |
|
| 94 | - $ref |
|
| 95 | - ), Request::METHOD_POST, [ |
|
| 96 | - 'sha' => $sha, |
|
| 97 | - 'force' => $force |
|
| 98 | - ]); |
|
| 99 | - } |
|
| 76 | + /** |
|
| 77 | + * Update a Reference |
|
| 78 | + * |
|
| 79 | + * @link https://developer.github.com/v3/git/refs/#update-a-reference |
|
| 80 | + * |
|
| 81 | + * @param string $ref |
|
| 82 | + * @param string $sha |
|
| 83 | + * @param bool $force |
|
| 84 | + * |
|
| 85 | + * @return array |
|
| 86 | + * @throws \Exception |
|
| 87 | + */ |
|
| 88 | + public function update(string $ref, string $sha, bool $force = false): array |
|
| 89 | + { |
|
| 90 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
| 91 | + '/repos/:owner/:repo/git/refs/:ref', |
|
| 92 | + $this->getGitData()->getOwner(), |
|
| 93 | + $this->getGitData()->getRepo(), |
|
| 94 | + $ref |
|
| 95 | + ), Request::METHOD_POST, [ |
|
| 96 | + 'sha' => $sha, |
|
| 97 | + 'force' => $force |
|
| 98 | + ]); |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - /** |
|
| 102 | - * Delete a Reference |
|
| 103 | - * |
|
| 104 | - * @link https://developer.github.com/v3/git/refs/#delete-a-reference |
|
| 105 | - * |
|
| 106 | - * @param string $ref |
|
| 107 | - * |
|
| 108 | - * @return bool |
|
| 109 | - * @throws \Exception |
|
| 110 | - */ |
|
| 111 | - public function delete(string $ref): bool |
|
| 112 | - { |
|
| 113 | - $this->getApi()->request($this->getApi() |
|
| 114 | - ->sprintf( |
|
| 115 | - '/repos/:owner/:repo/git/refs/:ref', |
|
| 116 | - $this->getGitData()->getOwner(), |
|
| 117 | - $this->getGitData()->getRepo(), |
|
| 118 | - $ref |
|
| 119 | - ), Request::METHOD_DELETE); |
|
| 101 | + /** |
|
| 102 | + * Delete a Reference |
|
| 103 | + * |
|
| 104 | + * @link https://developer.github.com/v3/git/refs/#delete-a-reference |
|
| 105 | + * |
|
| 106 | + * @param string $ref |
|
| 107 | + * |
|
| 108 | + * @return bool |
|
| 109 | + * @throws \Exception |
|
| 110 | + */ |
|
| 111 | + public function delete(string $ref): bool |
|
| 112 | + { |
|
| 113 | + $this->getApi()->request($this->getApi() |
|
| 114 | + ->sprintf( |
|
| 115 | + '/repos/:owner/:repo/git/refs/:ref', |
|
| 116 | + $this->getGitData()->getOwner(), |
|
| 117 | + $this->getGitData()->getRepo(), |
|
| 118 | + $ref |
|
| 119 | + ), Request::METHOD_DELETE); |
|
| 120 | 120 | |
| 121 | - if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
| 122 | - return true; |
|
| 123 | - } |
|
| 121 | + if ($this->getApi()->getHeaders()['Status'] == '204 No Content') { |
|
| 122 | + return true; |
|
| 123 | + } |
|
| 124 | 124 | |
| 125 | - return false; |
|
| 126 | - } |
|
| 125 | + return false; |
|
| 126 | + } |
|
| 127 | 127 | } |
@@ -12,53 +12,53 @@ |
||
| 12 | 12 | class Tags extends AbstractGitData |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Get a Tag |
|
| 17 | - * |
|
| 18 | - * @link https://developer.github.com/v3/git/tags/#get-a-tag |
|
| 19 | - * |
|
| 20 | - * @param string $sha |
|
| 21 | - * |
|
| 22 | - * @return array |
|
| 23 | - * @throws \Exception |
|
| 24 | - */ |
|
| 25 | - public function get(string $sha): array |
|
| 26 | - { |
|
| 27 | - return $this->getApi()->request($this->getApi()->sprintf( |
|
| 28 | - '/repos/:owner/:repo/git/tags/:sha', |
|
| 29 | - $this->getGitData()->getOwner(), |
|
| 30 | - $this->getGitData()->getRepo(), |
|
| 31 | - $sha |
|
| 32 | - )); |
|
| 33 | - } |
|
| 15 | + /** |
|
| 16 | + * Get a Tag |
|
| 17 | + * |
|
| 18 | + * @link https://developer.github.com/v3/git/tags/#get-a-tag |
|
| 19 | + * |
|
| 20 | + * @param string $sha |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + * @throws \Exception |
|
| 24 | + */ |
|
| 25 | + public function get(string $sha): array |
|
| 26 | + { |
|
| 27 | + return $this->getApi()->request($this->getApi()->sprintf( |
|
| 28 | + '/repos/:owner/:repo/git/tags/:sha', |
|
| 29 | + $this->getGitData()->getOwner(), |
|
| 30 | + $this->getGitData()->getRepo(), |
|
| 31 | + $sha |
|
| 32 | + )); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Create a Tag Object |
|
| 37 | - * |
|
| 38 | - * @link https://developer.github.com/v3/git/tags/#create-a-tag-object |
|
| 39 | - * |
|
| 40 | - * @param string $tag |
|
| 41 | - * @param string $message |
|
| 42 | - * @param string $object |
|
| 43 | - * @param string $type |
|
| 44 | - * @param array $tagger |
|
| 45 | - * |
|
| 46 | - * @return array |
|
| 47 | - * @throws \Exception |
|
| 48 | - */ |
|
| 49 | - public function create(string $tag, string $message, string $object, string $type, array $tagger = []): array |
|
| 50 | - { |
|
| 51 | - return $this->getApi()->request($this->getApi() |
|
| 52 | - ->sprintf( |
|
| 53 | - '/repos/:owner/:repo/git/tags', |
|
| 54 | - $this->getGitData()->getOwner(), |
|
| 55 | - $this->getGitData()->getRepo() |
|
| 56 | - ), Request::METHOD_POST, [ |
|
| 57 | - 'tag' => $tag, |
|
| 58 | - 'message' => $message, |
|
| 59 | - 'object' => $object, |
|
| 60 | - 'type' => $type, |
|
| 61 | - 'tagger' => $tagger |
|
| 62 | - ]); |
|
| 63 | - } |
|
| 35 | + /** |
|
| 36 | + * Create a Tag Object |
|
| 37 | + * |
|
| 38 | + * @link https://developer.github.com/v3/git/tags/#create-a-tag-object |
|
| 39 | + * |
|
| 40 | + * @param string $tag |
|
| 41 | + * @param string $message |
|
| 42 | + * @param string $object |
|
| 43 | + * @param string $type |
|
| 44 | + * @param array $tagger |
|
| 45 | + * |
|
| 46 | + * @return array |
|
| 47 | + * @throws \Exception |
|
| 48 | + */ |
|
| 49 | + public function create(string $tag, string $message, string $object, string $type, array $tagger = []): array |
|
| 50 | + { |
|
| 51 | + return $this->getApi()->request($this->getApi() |
|
| 52 | + ->sprintf( |
|
| 53 | + '/repos/:owner/:repo/git/tags', |
|
| 54 | + $this->getGitData()->getOwner(), |
|
| 55 | + $this->getGitData()->getRepo() |
|
| 56 | + ), Request::METHOD_POST, [ |
|
| 57 | + 'tag' => $tag, |
|
| 58 | + 'message' => $message, |
|
| 59 | + 'object' => $object, |
|
| 60 | + 'type' => $type, |
|
| 61 | + 'tagger' => $tagger |
|
| 62 | + ]); |
|
| 63 | + } |
|
| 64 | 64 | } |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | class Miscellaneous extends AbstractReceiver |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - /** Available sub-Receiver */ |
|
| 14 | - const EMOJIS = 'Emojis'; |
|
| 15 | - const GITIGNORE = 'Gitignore'; |
|
| 16 | - const MARKDOWN = 'Markdown'; |
|
| 17 | - const META = 'Meta'; |
|
| 18 | - const RATE_LIMIT = 'RateLimit'; |
|
| 19 | - const LICENSES = 'Licenses'; |
|
| 13 | + /** Available sub-Receiver */ |
|
| 14 | + const EMOJIS = 'Emojis'; |
|
| 15 | + const GITIGNORE = 'Gitignore'; |
|
| 16 | + const MARKDOWN = 'Markdown'; |
|
| 17 | + const META = 'Meta'; |
|
| 18 | + const RATE_LIMIT = 'RateLimit'; |
|
| 19 | + const LICENSES = 'Licenses'; |
|
| 20 | 20 | } |
@@ -12,24 +12,24 @@ |
||
| 12 | 12 | class WebHook extends AbstractApi |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** Constants */ |
|
| 16 | - const PAYLOAD = 'Payload'; |
|
| 15 | + /** Constants */ |
|
| 16 | + const PAYLOAD = 'Payload'; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Returns Event object |
|
| 20 | - * |
|
| 21 | - * @param string $event |
|
| 22 | - * |
|
| 23 | - * @return null|EventInterface |
|
| 24 | - */ |
|
| 25 | - public function getEvent(string $event) |
|
| 26 | - { |
|
| 27 | - $class = (string)$this->sprintf(':namespace\Event\:event', __NAMESPACE__, $event); |
|
| 18 | + /** |
|
| 19 | + * Returns Event object |
|
| 20 | + * |
|
| 21 | + * @param string $event |
|
| 22 | + * |
|
| 23 | + * @return null|EventInterface |
|
| 24 | + */ |
|
| 25 | + public function getEvent(string $event) |
|
| 26 | + { |
|
| 27 | + $class = (string)$this->sprintf(':namespace\Event\:event', __NAMESPACE__, $event); |
|
| 28 | 28 | |
| 29 | - if (class_exists($class)) { |
|
| 30 | - return new $class($this); |
|
| 31 | - } |
|
| 29 | + if (class_exists($class)) { |
|
| 30 | + return new $class($this); |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | - return null; |
|
| 34 | - } |
|
| 33 | + return null; |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -12,34 +12,34 @@ |
||
| 12 | 12 | class Client extends AbstractApi |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** Receiver constants */ |
|
| 16 | - const ACTIVITY = 'Activity'; |
|
| 17 | - const ENTERPRISE = 'Enterprise'; |
|
| 18 | - const GISTS = 'Gists'; |
|
| 19 | - const GIT_DATA = 'GitData'; |
|
| 20 | - const ISSUES = 'Issues'; |
|
| 21 | - const MISCELLANEOUS = 'Miscellaneous'; |
|
| 22 | - const ORGANIZATIONS = 'Organizations'; |
|
| 23 | - const PULL_REQUESTS = 'PullRequests'; |
|
| 24 | - const REPOSITORIES = 'Repositories'; |
|
| 25 | - const SEARCH = 'Search'; |
|
| 26 | - const USERS = 'Users'; |
|
| 15 | + /** Receiver constants */ |
|
| 16 | + const ACTIVITY = 'Activity'; |
|
| 17 | + const ENTERPRISE = 'Enterprise'; |
|
| 18 | + const GISTS = 'Gists'; |
|
| 19 | + const GIT_DATA = 'GitData'; |
|
| 20 | + const ISSUES = 'Issues'; |
|
| 21 | + const MISCELLANEOUS = 'Miscellaneous'; |
|
| 22 | + const ORGANIZATIONS = 'Organizations'; |
|
| 23 | + const PULL_REQUESTS = 'PullRequests'; |
|
| 24 | + const REPOSITORIES = 'Repositories'; |
|
| 25 | + const SEARCH = 'Search'; |
|
| 26 | + const USERS = 'Users'; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Returns receiver object |
|
| 30 | - * |
|
| 31 | - * @param string $receiver |
|
| 32 | - * |
|
| 33 | - * @return null|AbstractReceiver |
|
| 34 | - */ |
|
| 35 | - public function getReceiver(string $receiver) |
|
| 36 | - { |
|
| 37 | - $class = (string)$this->sprintf(':namespace\Receiver\:receiver', __NAMESPACE__, $receiver); |
|
| 28 | + /** |
|
| 29 | + * Returns receiver object |
|
| 30 | + * |
|
| 31 | + * @param string $receiver |
|
| 32 | + * |
|
| 33 | + * @return null|AbstractReceiver |
|
| 34 | + */ |
|
| 35 | + public function getReceiver(string $receiver) |
|
| 36 | + { |
|
| 37 | + $class = (string)$this->sprintf(':namespace\Receiver\:receiver', __NAMESPACE__, $receiver); |
|
| 38 | 38 | |
| 39 | - if (class_exists($class)) { |
|
| 40 | - return new $class($this); |
|
| 41 | - } |
|
| 39 | + if (class_exists($class)) { |
|
| 40 | + return new $class($this); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - return null; |
|
| 44 | - } |
|
| 43 | + return null; |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -12,77 +12,77 @@ |
||
| 12 | 12 | class Pagination |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Specify further pages. |
|
| 17 | - * |
|
| 18 | - * @var int|null |
|
| 19 | - */ |
|
| 20 | - protected $page = null; |
|
| 15 | + /** |
|
| 16 | + * Specify further pages. |
|
| 17 | + * |
|
| 18 | + * @var int|null |
|
| 19 | + */ |
|
| 20 | + protected $page = null; |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Set a custom page size up to 100. |
|
| 24 | - * |
|
| 25 | - * @var int|null |
|
| 26 | - */ |
|
| 27 | - protected $limit = null; |
|
| 22 | + /** |
|
| 23 | + * Set a custom page size up to 100. |
|
| 24 | + * |
|
| 25 | + * @var int|null |
|
| 26 | + */ |
|
| 27 | + protected $limit = null; |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Pagination constructor. |
|
| 31 | - * |
|
| 32 | - * @param int|null $page |
|
| 33 | - * @param int|null $limit |
|
| 34 | - */ |
|
| 35 | - public function __construct(int $page = null, int $limit = null) |
|
| 36 | - { |
|
| 37 | - $this->page = $page; |
|
| 38 | - $this->limit = $limit; |
|
| 39 | - } |
|
| 29 | + /** |
|
| 30 | + * Pagination constructor. |
|
| 31 | + * |
|
| 32 | + * @param int|null $page |
|
| 33 | + * @param int|null $limit |
|
| 34 | + */ |
|
| 35 | + public function __construct(int $page = null, int $limit = null) |
|
| 36 | + { |
|
| 37 | + $this->page = $page; |
|
| 38 | + $this->limit = $limit; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Get page |
|
| 43 | - * |
|
| 44 | - * @return int|null |
|
| 45 | - */ |
|
| 46 | - public function getPage() |
|
| 47 | - { |
|
| 48 | - return $this->page; |
|
| 49 | - } |
|
| 41 | + /** |
|
| 42 | + * Get page |
|
| 43 | + * |
|
| 44 | + * @return int|null |
|
| 45 | + */ |
|
| 46 | + public function getPage() |
|
| 47 | + { |
|
| 48 | + return $this->page; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Set page |
|
| 53 | - * |
|
| 54 | - * @param int|null $page |
|
| 55 | - * |
|
| 56 | - * @return Pagination |
|
| 57 | - */ |
|
| 58 | - public function setPage($page): Pagination |
|
| 59 | - { |
|
| 60 | - $this->page = $page; |
|
| 51 | + /** |
|
| 52 | + * Set page |
|
| 53 | + * |
|
| 54 | + * @param int|null $page |
|
| 55 | + * |
|
| 56 | + * @return Pagination |
|
| 57 | + */ |
|
| 58 | + public function setPage($page): Pagination |
|
| 59 | + { |
|
| 60 | + $this->page = $page; |
|
| 61 | 61 | |
| 62 | - return $this; |
|
| 63 | - } |
|
| 62 | + return $this; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * Get limit |
|
| 67 | - * |
|
| 68 | - * @return int|null |
|
| 69 | - */ |
|
| 70 | - public function getLimit() |
|
| 71 | - { |
|
| 72 | - return $this->limit; |
|
| 73 | - } |
|
| 65 | + /** |
|
| 66 | + * Get limit |
|
| 67 | + * |
|
| 68 | + * @return int|null |
|
| 69 | + */ |
|
| 70 | + public function getLimit() |
|
| 71 | + { |
|
| 72 | + return $this->limit; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Set limit |
|
| 77 | - * |
|
| 78 | - * @param int|null $limit |
|
| 79 | - * |
|
| 80 | - * @return Pagination |
|
| 81 | - */ |
|
| 82 | - public function setLimit($limit): Pagination |
|
| 83 | - { |
|
| 84 | - $this->limit = $limit; |
|
| 75 | + /** |
|
| 76 | + * Set limit |
|
| 77 | + * |
|
| 78 | + * @param int|null $limit |
|
| 79 | + * |
|
| 80 | + * @return Pagination |
|
| 81 | + */ |
|
| 82 | + public function setLimit($limit): Pagination |
|
| 83 | + { |
|
| 84 | + $this->limit = $limit; |
|
| 85 | 85 | |
| 86 | - return $this; |
|
| 87 | - } |
|
| 86 | + return $this; |
|
| 87 | + } |
|
| 88 | 88 | } |
@@ -14,38 +14,38 @@ |
||
| 14 | 14 | class PaginationTest extends AbstractClientTest |
| 15 | 15 | { |
| 16 | 16 | |
| 17 | - /** @var Pagination */ |
|
| 18 | - protected $pagination; |
|
| 19 | - |
|
| 20 | - public function setUp() |
|
| 21 | - { |
|
| 22 | - $this->pagination = new Pagination(); |
|
| 23 | - $this->client->setPagination($this->pagination); |
|
| 24 | - } |
|
| 25 | - |
|
| 26 | - public function testInstanceOf() |
|
| 27 | - { |
|
| 28 | - self::assertInstanceOf(Pagination::class, $this->pagination); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - public function testPage() |
|
| 32 | - { |
|
| 33 | - $this->pagination->setLimit(10); |
|
| 34 | - $this->pagination->setPage(2); |
|
| 35 | - self::assertEquals(2, $this->pagination->getPage()); |
|
| 36 | - |
|
| 37 | - $activity = $this->client->getReceiver(Client::ACTIVITY); |
|
| 38 | - $events = $activity->getReceiver(Activity::EVENTS); |
|
| 39 | - self::assertCount(10, $events->listPublicEvents()); |
|
| 40 | - } |
|
| 41 | - |
|
| 42 | - public function testLimit() |
|
| 43 | - { |
|
| 44 | - $this->pagination->setLimit(10); |
|
| 45 | - self::assertEquals(10, $this->pagination->getLimit()); |
|
| 46 | - |
|
| 47 | - $activity = $this->client->getReceiver(Client::ACTIVITY); |
|
| 48 | - $events = $activity->getReceiver(Activity::EVENTS); |
|
| 49 | - self::assertCount(10, $events->listPublicEvents()); |
|
| 50 | - } |
|
| 17 | + /** @var Pagination */ |
|
| 18 | + protected $pagination; |
|
| 19 | + |
|
| 20 | + public function setUp() |
|
| 21 | + { |
|
| 22 | + $this->pagination = new Pagination(); |
|
| 23 | + $this->client->setPagination($this->pagination); |
|
| 24 | + } |
|
| 25 | + |
|
| 26 | + public function testInstanceOf() |
|
| 27 | + { |
|
| 28 | + self::assertInstanceOf(Pagination::class, $this->pagination); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + public function testPage() |
|
| 32 | + { |
|
| 33 | + $this->pagination->setLimit(10); |
|
| 34 | + $this->pagination->setPage(2); |
|
| 35 | + self::assertEquals(2, $this->pagination->getPage()); |
|
| 36 | + |
|
| 37 | + $activity = $this->client->getReceiver(Client::ACTIVITY); |
|
| 38 | + $events = $activity->getReceiver(Activity::EVENTS); |
|
| 39 | + self::assertCount(10, $events->listPublicEvents()); |
|
| 40 | + } |
|
| 41 | + |
|
| 42 | + public function testLimit() |
|
| 43 | + { |
|
| 44 | + $this->pagination->setLimit(10); |
|
| 45 | + self::assertEquals(10, $this->pagination->getLimit()); |
|
| 46 | + |
|
| 47 | + $activity = $this->client->getReceiver(Client::ACTIVITY); |
|
| 48 | + $events = $activity->getReceiver(Activity::EVENTS); |
|
| 49 | + self::assertCount(10, $events->listPublicEvents()); |
|
| 50 | + } |
|
| 51 | 51 | } |
@@ -11,19 +11,19 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class WebHookTest extends AbstractWebHookTest |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * Test instance of WebHook's class |
|
| 16 | - */ |
|
| 17 | - public function testWebHook() |
|
| 18 | - { |
|
| 19 | - $this->assertInstanceOf(WebHook::class, $this->webHook); |
|
| 20 | - } |
|
| 14 | + /** |
|
| 15 | + * Test instance of WebHook's class |
|
| 16 | + */ |
|
| 17 | + public function testWebHook() |
|
| 18 | + { |
|
| 19 | + $this->assertInstanceOf(WebHook::class, $this->webHook); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Test instance of Payload's class |
|
| 24 | - */ |
|
| 25 | - public function testPayload() |
|
| 26 | - { |
|
| 27 | - $this->assertInstanceOf(Payload::class, $this->payload); |
|
| 28 | - } |
|
| 22 | + /** |
|
| 23 | + * Test instance of Payload's class |
|
| 24 | + */ |
|
| 25 | + public function testPayload() |
|
| 26 | + { |
|
| 27 | + $this->assertInstanceOf(Payload::class, $this->payload); |
|
| 28 | + } |
|
| 29 | 29 | } |
@@ -10,16 +10,16 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class PayloadTest extends AbstractWebHookTest |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Test setting a secret |
|
| 15 | - */ |
|
| 16 | - public function testSecret() |
|
| 17 | - { |
|
| 18 | - $this->payload->setSecret('your-secret'); |
|
| 13 | + /** |
|
| 14 | + * Test setting a secret |
|
| 15 | + */ |
|
| 16 | + public function testSecret() |
|
| 17 | + { |
|
| 18 | + $this->payload->setSecret('your-secret'); |
|
| 19 | 19 | |
| 20 | - $this->assertEquals( |
|
| 21 | - hash_hmac('sha1', $this->payload->getRawData(), 'your-secret'), |
|
| 22 | - $this->payload->getSecret() |
|
| 23 | - ); |
|
| 24 | - } |
|
| 20 | + $this->assertEquals( |
|
| 21 | + hash_hmac('sha1', $this->payload->getRawData(), 'your-secret'), |
|
| 22 | + $this->payload->getSecret() |
|
| 23 | + ); |
|
| 24 | + } |
|
| 25 | 25 | } |