Skip to content

Commit

Permalink
Add Pure attribute to Closure and WeakReference/WeakMap classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored and isfedorov committed Nov 24, 2023
1 parent 9e181bd commit 1d50414
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Core/Core_c.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ public function __invoke(...$_) {}
* This determines the visibility of protected and private methods of the bound object.
* @return Closure|null Returns the newly created Closure object or null on failure
*/
#[Pure]
public function bindTo(?object $newThis, object|string|null $newScope = 'static'): ?Closure {}

/**
Expand All @@ -668,6 +669,7 @@ public function bindTo(?object $newThis, object|string|null $newScope = 'static'
* This determines the visibility of protected and private methods of the bound object.
* @return Closure|null Returns the newly created Closure object or null on failure
*/
#[Pure]
public static function bind(Closure $closure, ?object $newThis, object|string|null $newScope = 'static'): ?Closure {}

/**
Expand Down Expand Up @@ -732,6 +734,7 @@ public function __construct() {}
* @return WeakReference<TIn> The freshly instantiated object.
* @since 7.4
*/
#[Pure]
public static function create(object $object): WeakReference {}

/**
Expand Down Expand Up @@ -765,6 +768,7 @@ final class WeakMap implements ArrayAccess, Countable, IteratorAggregate
* @param TKey $object Any object
* @return bool
*/
#[Pure]
public function offsetExists($object): bool {}

/**
Expand All @@ -773,6 +777,7 @@ public function offsetExists($object): bool {}
* @param TKey $object Any object
* @return TValue Value associated with the key object
*/
#[Pure]
public function offsetGet($object): mixed {}

/**
Expand All @@ -797,13 +802,15 @@ public function offsetUnset($object): void {}
*
* @return Iterator<TKey, TValue>
*/
#[Pure]
public function getIterator(): Iterator {}

/**
* Returns the number of items in the {@see WeakMap} instance.
*
* @return int<0,max>
*/
#[Pure]
public function count(): int {}
}

Expand Down

0 comments on commit 1d50414

Please sign in to comment.