Use ? to mark parameters as nullable to prevent PHP 8.4 deprecation warning
This commit is contained in:
@@ -85,7 +85,7 @@ class CloudObject {
|
||||
* Get the value of a property as a string.
|
||||
* If the property has multiple values, only the first is returned.
|
||||
*/
|
||||
public function getString($property, string $default = null) : ?string {
|
||||
public function getString($property, ?string $default = null) : ?string {
|
||||
return $this->getReader()->getFirstValueString($this->node, $property, $default);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ class CloudObject {
|
||||
* Get the value of a property as an integer.
|
||||
* If the property has multiple values, only the first is returned.
|
||||
*/
|
||||
public function getInt($property, int $default = null) : ?int {
|
||||
public function getInt($property, ?int $default = null) : ?int {
|
||||
return $this->getReader()->getFirstValueInt($this->node, $property, $default);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class CloudObject {
|
||||
* Get the value of a property as a float.
|
||||
* If the property has multiple values, only the first is returned.
|
||||
*/
|
||||
public function getFloat($property, float $default = null) : ?float {
|
||||
public function getFloat($property, ?float $default = null) : ?float {
|
||||
return $this->getReader()->getFirstValueFloat($this->node, $property, $default);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class CloudObject {
|
||||
* Get the value of a property as a boolean.
|
||||
* If the property has multiple values, only the first is returned.
|
||||
*/
|
||||
public function getBool($property, bool $default = null) : ?bool {
|
||||
public function getBool($property, ?bool $default = null) : ?bool {
|
||||
return $this->getReader()->getFirstValueBool($this->node, $property, $default);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ class CloudObject {
|
||||
* Get the value of a property as an IRI.
|
||||
* If the property has multiple values, only the first is returned.
|
||||
*/
|
||||
public function getIRI($property, IRI $default = null) : ?IRI {
|
||||
public function getIRI($property, ?IRI $default = null) : ?IRI {
|
||||
return $this->getReader()->getFirstValueIRI($this->node, $property, $default);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ class CloudObject {
|
||||
* Get the value of a property as a Node.
|
||||
* If the property has multiple values, only the first is returned.
|
||||
*/
|
||||
public function getNode($property, Node $default = null) : ?Node {
|
||||
public function getNode($property, ?Node $default = null) : ?Node {
|
||||
return $this->getReader()->getFirstValueNode($this->node, $property, $default);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user