Skip to content
Open
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
38 changes: 19 additions & 19 deletions Entity/Listener/PersistentRelatedEntitiesCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(ManagerRegistry $registry, Job $job)
*
* @return array<object> The PHP array representation of this collection.
*/
public function toArray()
public function toArray(): array
{
$this->initialize();

Expand Down Expand Up @@ -135,7 +135,7 @@ public function removeElement($element)
* @param mixed $offset
* @return bool
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
$this->initialize();

Expand All @@ -150,7 +150,7 @@ public function offsetExists($offset)
* @param mixed $offset
* @return mixed
*/
public function offsetGet($offset)
public function offsetGet($offset): mixed
{
$this->initialize();

Expand All @@ -167,7 +167,7 @@ public function offsetGet($offset)
* @param mixed $value
* @return bool
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
throw new \LogicException('Adding new related entities is not supported after initial creation.');
}
Expand All @@ -180,7 +180,7 @@ public function offsetSet($offset, $value)
* @param mixed $offset
* @return mixed
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
throw new \LogicException('unset() is not supported.');
}
Expand All @@ -191,7 +191,7 @@ public function offsetUnset($offset)
* @param mixed $key The key to check for.
* @return boolean TRUE if the given key/index exists, FALSE otherwise.
*/
public function containsKey($key)
public function containsKey($key): bool
{
$this->initialize();

Expand All @@ -208,7 +208,7 @@ public function containsKey($key)
* @return boolean TRUE if the given element is contained in the collection,
* FALSE otherwise.
*/
public function contains($element)
public function contains($element): bool
{
$this->initialize();

Expand All @@ -227,7 +227,7 @@ public function contains($element)
* @param Closure $p The predicate.
* @return boolean TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
*/
public function exists(Closure $p)
public function exists(Closure $p): bool
{
$this->initialize();

Expand All @@ -248,7 +248,7 @@ public function exists(Closure $p)
* @param mixed $element The element to search for.
* @return mixed The key/index of the element or FALSE if the element was not found.
*/
public function indexOf($element)
public function indexOf($element): mixed
{
$this->initialize();

Expand All @@ -261,7 +261,7 @@ public function indexOf($element)
* @param mixed $key The key.
* @return mixed The element or NULL, if no element exists for the given key.
*/
public function get($key)
public function get($key): mixed
{
$this->initialize();

Expand All @@ -276,7 +276,7 @@ public function get($key)
*
* @return array
*/
public function getKeys()
public function getKeys(): array
{
$this->initialize();

Expand All @@ -288,7 +288,7 @@ public function getKeys()
*
* @return array
*/
public function getValues()
public function getValues(): array
{
$this->initialize();

Expand All @@ -302,7 +302,7 @@ public function getValues()
*
* @return integer The number of elements in the collection.
*/
public function count()
public function count(): int
{
$this->initialize();

Expand All @@ -318,7 +318,7 @@ public function count()
* @param mixed $key
* @param mixed $value
*/
public function set($key, $value)
public function set($key, $value): void
{
throw new \LogicException('set() is not supported.');
}
Expand All @@ -329,7 +329,7 @@ public function set($key, $value)
* @param mixed $value
* @return boolean Always TRUE.
*/
public function add($value)
public function add($value): bool
{
throw new \LogicException('Adding new entities is not supported after creation.');
}
Expand All @@ -341,7 +341,7 @@ public function add($value)
*
* @return boolean TRUE if the collection is empty, FALSE otherwise.
*/
public function isEmpty()
public function isEmpty(): bool
{
$this->initialize();

Expand All @@ -353,7 +353,7 @@ public function isEmpty()
*
* @return ArrayIterator
*/
public function getIterator()
public function getIterator(): ArrayIterator
{
$this->initialize();

Expand Down Expand Up @@ -395,7 +395,7 @@ public function filter(Closure $p)
* @param Closure $p The predicate.
* @return boolean TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
*/
public function forAll(Closure $p)
public function forAll(Closure $p): bool
{
$this->initialize();

Expand Down Expand Up @@ -445,7 +445,7 @@ public function __toString()
/**
* Clears the collection.
*/
public function clear()
public function clear(): void
{
throw new \LogicException('clear() is not supported.');
}
Expand Down