44
55use Github \Client ;
66use Github \HttpClient \Message \ResponseMediator ;
7- use ValueError ;
87
98/**
109 * @author Joseph Bielawski <[email protected] > 1110 * @author Graham Campbell <[email protected] > 1211 */
13- abstract class AbstractApi implements ApiInterface
12+ abstract class AbstractApi
1413{
1514 /**
1615 * The client instance.
@@ -29,19 +28,13 @@ abstract class AbstractApi implements ApiInterface
2928 /**
3029 * Create a new API instance.
3130 *
32- * @param Client $client
33- * @param int|null $perPage
31+ * @param Client $client
3432 *
3533 * @return void
3634 */
37- public function __construct (Client $ client, int $ perPage = null )
35+ public function __construct (Client $ client )
3836 {
39- if (null !== $ perPage && ($ perPage < 1 || $ perPage > 100 )) {
40- throw new ValueError (sprintf ('%s::__construct(): Argument #2 ($perPage) must be between 1 and 100, or null ' , self ::class));
41- }
42-
4337 $ this ->client = $ client ;
44- $ this ->perPage = $ perPage ;
4538 }
4639
4740 /**
@@ -64,38 +57,6 @@ protected function getApiVersion()
6457 return $ this ->client ->getApiVersion ();
6558 }
6659
67- /**
68- * Get the number of values to fetch per page.
69- *
70- * @return int|null
71- */
72- protected function getPerPage ()
73- {
74- return $ this ->perPage ;
75- }
76-
77- /**
78- * Create a new instance with the given page parameter.
79- *
80- * This must be an integer between 1 and 100.
81- *
82- * @param int|null $perPage
83- *
84- * @return static
85- */
86- public function perPage (?int $ perPage )
87- {
88- if (null !== $ perPage && ($ perPage < 1 || $ perPage > 100 )) {
89- throw new ValueError (sprintf ('%s::perPage(): Argument #1 ($perPage) must be between 1 and 100, or null ' , self ::class));
90- }
91-
92- $ copy = clone $ this ;
93-
94- $ copy ->perPage = $ perPage ;
95-
96- return $ copy ;
97- }
98-
9960 public function configure ()
10061 {
10162 }
0 commit comments