1717use Bitbucket \HttpClient \Message \ResponseMediator ;
1818use Bitbucket \HttpClient \Util \JsonArray ;
1919use Bitbucket \HttpClient \Util \QueryStringBuilder ;
20- use ValueError ;
2120
2221/**
2322 * @author Joseph Bielawski <stloyd@gmail.com>
2423 * @author Graham Campbell <graham@alt-three.com>
2524 */
26- abstract class AbstractApi implements ApiInterface
25+ abstract class AbstractApi
2726{
2827 /**
2928 * The URI prefix.
@@ -49,19 +48,13 @@ abstract class AbstractApi implements ApiInterface
4948 /**
5049 * Create a new API instance.
5150 *
52- * @param Client $client
53- * @param int|null $perPage
51+ * @param Client $client
5452 *
5553 * @return void
5654 */
57- public function __construct (Client $ client, int $ perPage = null )
55+ public function __construct (Client $ client )
5856 {
59- if (null !== $ perPage && ($ perPage < 1 || $ perPage > 100 )) {
60- throw new ValueError (\sprintf ('%s::__construct(): Argument #2 ($perPage) must be between 1 and 100, or null ' , self ::class));
61- }
62-
6357 $ this ->client = $ client ;
64- $ this ->perPage = $ perPage ;
6558 }
6659
6760 /**
@@ -74,38 +67,6 @@ protected function getClient()
7467 return $ this ->client ;
7568 }
7669
77- /**
78- * Get the number of values to fetch per page.
79- *
80- * @return int|null
81- */
82- protected function getPerPage ()
83- {
84- return $ this ->perPage ;
85- }
86-
87- /**
88- * Create a new instance with the given page parameter.
89- *
90- * This must be an integer between 1 and 100.
91- *
92- * @param int|null $perPage
93- *
94- * @return static
95- */
96- public function perPage (int $ perPage = null )
97- {
98- if (null !== $ perPage && ($ perPage < 1 || $ perPage > 100 )) {
99- throw new ValueError (\sprintf ('%s::perPage(): Argument #1 ($perPage) must be between 1 and 100, or null ' , self ::class));
100- }
101-
102- $ copy = clone $ this ;
103-
104- $ copy ->perPage = $ perPage ;
105-
106- return $ copy ;
107- }
108-
10970 /**
11071 * Send a GET request with query params and return the raw response.
11172 *
0 commit comments