diff --git a/src/AbstractGithubObject.php b/src/AbstractGithubObject.php index b283fce4..9b9d59d8 100644 --- a/src/AbstractGithubObject.php +++ b/src/AbstractGithubObject.php @@ -88,7 +88,7 @@ abstract class AbstractGithubObject * * @since 1.0 */ - public function __construct(Registry $options = null, BaseHttp $client = null) + public function __construct(?Registry $options = null, ?BaseHttp $client = null) { $this->options = $options ?: new Registry(); $this->client = $client ?: (new HttpFactory())->getHttp($this->options); diff --git a/src/AbstractPackage.php b/src/AbstractPackage.php index 71266b7c..83ee080c 100644 --- a/src/AbstractPackage.php +++ b/src/AbstractPackage.php @@ -27,7 +27,7 @@ abstract class AbstractPackage extends AbstractGithubObject * * @since 1.0 */ - public function __construct(Registry $options = null, Http $client = null) + public function __construct(?Registry $options = null, ?Http $client = null) { parent::__construct($options, $client); diff --git a/src/Github.php b/src/Github.php index 632c54e4..d38b6b29 100644 --- a/src/Github.php +++ b/src/Github.php @@ -61,7 +61,7 @@ class Github * * @since 1.0 */ - public function __construct(Registry $options = null, Http $client = null) + public function __construct(?Registry $options = null, ?Http $client = null) { $this->options = $options ?: new Registry(); diff --git a/src/Package/Activity/Notifications.php b/src/Package/Activity/Notifications.php index 7b228b2f..55a7df0c 100644 --- a/src/Package/Activity/Notifications.php +++ b/src/Package/Activity/Notifications.php @@ -34,7 +34,7 @@ class Notifications extends AbstractPackage * * @since 1.0 */ - public function getList($all = true, $participating = true, \DateTimeInterface $since = null, \DateTimeInterface $before = null) + public function getList($all = true, $participating = true, ?\DateTimeInterface $since = null, ?\DateTimeInterface $before = null) { // Build the request path. $path = '/notifications'; @@ -81,8 +81,8 @@ public function getListRepository( $repo, $all = true, $participating = true, - \DateTimeInterface $since = null, - \DateTimeInterface $before = null + ?\DateTimeInterface $since = null, + ?\DateTimeInterface $before = null ) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/notifications'; @@ -116,13 +116,13 @@ public function getListRepository( * @param boolean $unread Changes the unread status of the threads. * @param boolean $read Inverse of “unread”. * @param ?\DateTimeInterface $lastReadAt Describes the last point that notifications were checked. - * Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format. + * Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format. * * @return object * * @since 1.0 */ - public function markRead($unread = true, $read = true, \DateTimeInterface $lastReadAt = null) + public function markRead($unread = true, $read = true, ?\DateTimeInterface $lastReadAt = null) { // Build the request path. $path = '/notifications'; @@ -152,13 +152,13 @@ public function markRead($unread = true, $read = true, \DateTimeInterface $lastR * @param boolean $unread Changes the unread status of the threads. * @param boolean $read Inverse of “unread”. * @param ?\DateTimeInterface $lastReadAt Describes the last point that notifications were checked. - * Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format. + * Anything updated since this time will not be updated. Default: Now. Expected in ISO 8601 format. * * @return object * * @since 1.0 */ - public function markReadRepository($owner, $repo, $unread, $read, \DateTimeInterface $lastReadAt = null) + public function markReadRepository($owner, $repo, $unread, $read, ?\DateTimeInterface $lastReadAt = null) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/notifications'; diff --git a/src/Package/Gists.php b/src/Package/Gists.php index 6b4473ba..0a4640de 100644 --- a/src/Package/Gists.php +++ b/src/Package/Gists.php @@ -231,7 +231,7 @@ public function getList($page = 0, $limit = 0) * @since 1.0 * @throws \DomainException */ - public function getListByUser($user, $page = 0, $limit = 0, \DateTime $since = null) + public function getListByUser($user, $page = 0, $limit = 0, ?\DateTime $since = null) { // Build the request path. $uri = $this->fetchUrl('/users/' . $user . '/gists', $page, $limit); @@ -256,7 +256,7 @@ public function getListByUser($user, $page = 0, $limit = 0, \DateTime $since = n * @since 1.0 * @throws \DomainException */ - public function getListPublic($page = 0, $limit = 0, \DateTime $since = null) + public function getListPublic($page = 0, $limit = 0, ?\DateTime $since = null) { // Build the request path. $uri = $this->fetchUrl('/gists/public', $page, $limit); @@ -281,7 +281,7 @@ public function getListPublic($page = 0, $limit = 0, \DateTime $since = null) * @since 1.0 * @throws \DomainException */ - public function getListStarred($page = 0, $limit = 0, \DateTime $since = null) + public function getListStarred($page = 0, $limit = 0, ?\DateTime $since = null) { // Build the request path. $uri = $this->fetchUrl('/gists/starred', $page, $limit); diff --git a/src/Package/Issues.php b/src/Package/Issues.php index a82d2235..963af9da 100644 --- a/src/Package/Issues.php +++ b/src/Package/Issues.php @@ -190,7 +190,7 @@ public function getList( $labels = null, $sort = null, $direction = null, - \DateTimeInterface $since = null, + ?\DateTimeInterface $since = null, $page = 0, $limit = 0 ) { @@ -256,7 +256,7 @@ public function getListByRepository( $labels = null, $sort = null, $direction = null, - \DateTimeInterface $since = null, + ?\DateTimeInterface $since = null, $page = 0, $limit = 0 ) { diff --git a/src/Package/Issues/Comments.php b/src/Package/Issues/Comments.php index 81ed9f8c..5d3471e4 100644 --- a/src/Package/Issues/Comments.php +++ b/src/Package/Issues/Comments.php @@ -38,7 +38,7 @@ class Comments extends AbstractPackage * @since 1.0 * @throws \DomainException */ - public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, \DateTimeInterface $since = null) + public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, ?\DateTimeInterface $since = null) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/' . (int) $issueId . '/comments'; @@ -68,7 +68,7 @@ public function getList($owner, $repo, $issueId, $page = 0, $limit = 0, \DateTim * @throws \UnexpectedValueException * @throws \DomainException */ - public function getRepositoryList($owner, $repo, $sort = 'created', $direction = 'asc', \DateTimeInterface $since = null) + public function getRepositoryList($owner, $repo, $sort = 'created', $direction = 'asc', ?\DateTimeInterface $since = null) { // Build the request path. $path = '/repos/' . $owner . '/' . $repo . '/issues/comments'; diff --git a/src/Package/Repositories/Commits.php b/src/Package/Repositories/Commits.php index 2e1dc50d..593c93e9 100644 --- a/src/Package/Repositories/Commits.php +++ b/src/Package/Repositories/Commits.php @@ -42,7 +42,7 @@ class Commits extends AbstractPackage * @since 1.0 * @throws \DomainException */ - public function getList($user, $repo, $sha = '', $path = '', $author = '', \DateTimeInterface $since = null, \DateTimeInterface $until = null) + public function getList($user, $repo, $sha = '', $path = '', $author = '', ?\DateTimeInterface $since = null, ?\DateTimeInterface $until = null) { // Build the request path. $rPath = '/repos/' . $user . '/' . $repo . '/commits';