Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make nullable parameters explicity nullable for PHP 8.4 #112

Open
wants to merge 1 commit into
base: php8
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Exception/InvalidQuadException.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class InvalidQuadException extends \RuntimeException
* @param Quad $quad The quad
* @param null|\Exception $previous The previous exception
*/
public function __construct($message, $quad, \Exception $previous = null)
public function __construct($message, $quad, ?\Exception $previous = null)
{
$this->quad = $quad;

Expand Down
2 changes: 1 addition & 1 deletion Exception/JsonLdException.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class JsonLdException extends \RuntimeException
* @param null|string $document The document that triggered the error
* @param null|\Exception $previous The previous exception
*/
public function __construct($code, $message = null, $snippet = null, $document = null, \Exception $previous = null)
public function __construct($code, $message = null, $snippet = null, $document = null, ?\Exception $previous = null)
{
$this->code = $code;
$this->document = $document;
Expand Down
2 changes: 1 addition & 1 deletion Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Graph implements GraphInterface, JsonLdSerializable
*
* @param null|DocumentInterface $document The document the graph belongs to.
*/
public function __construct(DocumentInterface $document = null)
public function __construct(?DocumentInterface $document = null)
{
$this->document = $document;
}
Expand Down
2 changes: 1 addition & 1 deletion Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@ private function elementToRdf(JsonObject $element)
*
* @return IRI Returns the IRI of the head of the list
*/
private function listToRdf(array $entries, array &$quads, IRI $graph = null)
private function listToRdf(array $entries, array &$quads, ?IRI $graph = null)
{
if (0 === count($entries)) {
return new IRI(RdfConstants::RDF_NIL);
Expand Down
4 changes: 2 additions & 2 deletions Quad.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class Quad
*
* @throws InvalidArgumentException If the object parameter has a wrong type
*/
public function __construct(IRI $subject, IRI $property, $object, IRI $graph = null)
public function __construct(IRI $subject, IRI $property, $object, ?IRI $graph = null)
{
$this->subject = $subject;
$this->property = $property;
Expand Down Expand Up @@ -135,7 +135,7 @@ public function getObject()
*
* @param null|IRI $graph The graph
*/
public function setGraph(IRI $graph = null)
public function setGraph(?IRI $graph = null)
{
$this->graph = $graph;
}
Expand Down