Skip to content

Commit 6325985

Browse files
authored
nullable_type_declaration_for_default_null_value (#63)
1 parent e9663ba commit 6325985

8 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎src/AbstractGithubObject.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ abstract class AbstractGithubObject
8888
*
8989
* @since 1.0
9090
*/
91-
public function __construct(Registry $options = null, BaseHttp $client = null)
91+
public function __construct(?Registry $options = null, ?BaseHttp $client = null)
9292
{
9393
$this->options = $options ?: new Registry();
9494
$this->client = $client ?: (new HttpFactory())->getHttp($this->options);

‎src/AbstractPackage.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ abstract class AbstractPackage extends AbstractGithubObject
2727
*
2828
* @since 1.0
2929
*/
30-
public function __construct(Registry $options = null, Http $client = null)
30+
public function __construct(?Registry $options = null, ?Http $client = null)
3131
{
3232
parent::__construct($options, $client);
3333

‎src/Github.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Github
6161
*
6262
* @since 1.0
6363
*/
64-
public function __construct(Registry $options = null, Http $client = null)
64+
public function __construct(?Registry $options = null, ?Http $client = null)
6565
{
6666
$this->options = $options ?: new Registry();
6767

‎src/Package/Activity/Notifications.php‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Notifications extends AbstractPackage
3434
*
3535
* @since 1.0
3636
*/
37-
public function getList($all = true, $participating = true, \DateTimeInterface $since = null, \DateTimeInterface $before = null)
37+
public function getList($all = true, $participating = true, ?\DateTimeInterface $since = null, ?\DateTimeInterface $before = null)
3838
{
3939
// Build the request path.
4040
$path = '/notifications';
@@ -81,8 +81,8 @@ public function getListRepository(
8181
$repo,
8282
$all = true,
8383
$participating = true,
84-
\DateTimeInterface $since = null,
85-
\DateTimeInterface $before = null
84+
?\DateTimeInterface $since = null,
85+
?\DateTimeInterface $before = null
8686
) {
8787
// Build the request path.
8888
$path = '/repos/' . $owner . '/' . $repo . '/notifications';
@@ -116,13 +116,13 @@ public function getListRepository(
116116
* @param boolean $unread Changes the unread status of the threads.
117117
* @param boolean $read Inverse of “unread”.
118118
* @param ?\DateTimeInterface $lastReadAt Describes the last point that notifications were checked.
119-
* Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format.
119+
* Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format.
120120
*
121121
* @return object
122122
*
123123
* @since 1.0
124124
*/
125-
public function markRead($unread = true, $read = true, \DateTimeInterface $lastReadAt = null)
125+
public function markRead($unread = true, $read = true, ?\DateTimeInterface $lastReadAt = null)
126126
{
127127
// Build the request path.
128128
$path = '/notifications';
@@ -152,13 +152,13 @@ public function markRead($unread = true, $read = true, \DateTimeInterface $lastR
152152
* @param boolean $unread Changes the unread status of the threads.
153153
* @param boolean $read Inverse of “unread”.
154154
* @param ?\DateTimeInterface $lastReadAt Describes the last point that notifications were checked.
155-
* Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format.
155+
* Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format.
156156
*
157157
* @return object
158158
*
159159
* @since 1.0
160160
*/
161-
public function markReadRepository($owner, $repo, $unread, $read, \DateTimeInterface $lastReadAt = null)
161+
public function markReadRepository($owner, $repo, $unread, $read, ?\DateTimeInterface $lastReadAt = null)
162162
{
163163
// Build the request path.
164164
$path = '/repos/' . $owner . '/' . $repo . '/notifications';

‎src/Package/Gists.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function getList($page = 0, $limit = 0)
231231
* @since 1.0
232232
* @throws \DomainException
233233
*/
234-
public function getListByUser($user, $page = 0, $limit = 0, \DateTime $since = null)
234+
public function getListByUser($user, $page = 0, $limit = 0, ?\DateTime $since = null)
235235
{
236236
// Build the request path.
237237
$uri = $this->fetchUrl('/users/' . $user . '/gists', $page, $limit);
@@ -256,7 +256,7 @@ public function getListByUser($user, $page = 0, $limit = 0, \DateTime $since = n
256256
* @since 1.0
257257
* @throws \DomainException
258258
*/
259-
public function getListPublic($page = 0, $limit = 0, \DateTime $since = null)
259+
public function getListPublic($page = 0, $limit = 0, ?\DateTime $since = null)
260260
{
261261
// Build the request path.
262262
$uri = $this->fetchUrl('/gists/public', $page, $limit);
@@ -281,7 +281,7 @@ public function getListPublic($page = 0, $limit = 0, \DateTime $since = null)
281281
* @since 1.0
282282
* @throws \DomainException
283283
*/
284-
public function getListStarred($page = 0, $limit = 0, \DateTime $since = null)
284+
public function getListStarred($page = 0, $limit = 0, ?\DateTime $since = null)
285285
{
286286
// Build the request path.
287287
$uri = $this->fetchUrl('/gists/starred', $page, $limit);

‎src/Package/Issues.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ public function getList(
190190
$labels = null,
191191
$sort = null,
192192
$direction = null,
193-
\DateTimeInterface $since = null,
193+
?\DateTimeInterface $since = null,
194194
$page = 0,
195195
$limit = 0
196196
) {
@@ -256,7 +256,7 @@ public function getListByRepository(
256256
$labels = null,
257257
$sort = null,
258258
$direction = null,
259-
\DateTimeInterface $since = null,
259+
?\DateTimeInterface $since = null,
260260
$page = 0,
261261
$limit = 0
262262
) {

‎src/Package/Issues/Comments.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Comments extends AbstractPackage
3838
* @since 1.0
3939
* @throws \DomainException
4040
*/
41-
public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, \DateTimeInterface $since = null)
41+
public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, ?\DateTimeInterface $since = null)
4242
{
4343
// Build the request path.
4444
$path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issueId . '/comments';
@@ -68,7 +68,7 @@ public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, \DateTim
6868
* @throws \UnexpectedValueException
6969
* @throws \DomainException
7070
*/
71-
public function getRepositoryList($owner, $repo, $sort = 'created', $direction = 'asc', \DateTimeInterface $since = null)
71+
public function getRepositoryList($owner, $repo, $sort = 'created', $direction = 'asc', ?\DateTimeInterface $since = null)
7272
{
7373
// Build the request path.
7474
$path = '/repos/' . $owner . '/' . $repo . '/issues/comments';

‎src/Package/Repositories/Commits.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Commits extends AbstractPackage
4242
* @since 1.0
4343
* @throws \DomainException
4444
*/
45-
public function getList($user, $repo, $sha = '', $path = '', $author = '', \DateTimeInterface $since = null, \DateTimeInterface $until = null)
45+
public function getList($user, $repo, $sha = '', $path = '', $author = '', ?\DateTimeInterface $since = null, ?\DateTimeInterface $until = null)
4646
{
4747
// Build the request path.
4848
$rPath = '/repos/' . $user . '/' . $repo . '/commits';

0 commit comments

Comments
 (0)