Skip to content

Commit

Permalink
Type-hint to{String,Array} methods
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberiaResurrection committed May 25, 2020
1 parent 67d5914 commit 8e60505
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/MetadataV3/Edm/EntityType/NavigationPropertyHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function offsetUnset($offset): void
unset($this->property[$offset]);
}

public function __toArray()
public function __toArray(): array
{
return $this->property;
}
Expand Down
2 changes: 1 addition & 1 deletion src/MetadataV3/Edm/EntityType/PropertyHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function offsetUnset($offset): void
unset($this->property[$offset]);
}

public function __toArray()
public function __toArray(): array
{
return $this->property;
}
Expand Down
2 changes: 1 addition & 1 deletion src/MetadataV3/Edm/Expressions/Constant/ConstantBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract class ConstantBase extends ExpressionBase implements IAttribute
*
* @return string
*/
public function __toString()
public function __toString(): string
{
return strval($this->__value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function value(DateTime $value = null): DateTime
*
* @return string
*/
public function __toString()
public function __toString(): string
{
// xsd:dateTime is the same as RFCRFC3339
return $this->__value->format(DateTime::RFC3339);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function value(DateTime $value = null): DateTime
*
* @return string
*/
public function __toString()
public function __toString(): string
{
// xsd:dateTime is the same as RFCRFC3339
return $this->__value->format(DateTime::RFC3339);
Expand Down
2 changes: 1 addition & 1 deletion src/MetadataV3/Edm/Expressions/Constant/TimeConstant.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function value(DateTime $value = null): DateTime
*
* @return string
*/
public function __toString()
public function __toString(): string
{
// xsd:dateTime is the same as RFCRFC3339
return $this->__value->format(DateTime::RFC3339);
Expand Down
5 changes: 4 additions & 1 deletion src/MetadataV3/Edm/OtherTypeConstructs/ReferenceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ public function isAttribute(): bool
return $this->getDocumentation() === null;
}

public function __toString()
/**
* @return string
*/
public function __toString(): string
{
return sprintf('Ref(%s)', $this->getType()->getName());
}
Expand Down
6 changes: 5 additions & 1 deletion src/MetadataV3/Edm/TextType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ public function __construct(string $name, string $value)
$this->name = $name;
}

public function __toString()
/**
* @return string
*/
public function __toString(): string
{
return $this->__value;
}

public function getTextContent(): ?string
{
return strval($this);
Expand Down

0 comments on commit 8e60505

Please sign in to comment.