Skip to content

Commit

Permalink
Add SplObjectStorage stub
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Aug 16, 2020
1 parent ad7dce2 commit 33b89cb
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 21 deletions.
21 changes: 0 additions & 21 deletions resources/functionMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11349,27 +11349,6 @@
'spliti' => ['array', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'],
'SplMaxHeap::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'],
'SplMinHeap::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'],
'SplObjectStorage::addAll' => ['void', 'os'=>'splobjectstorage'],
'SplObjectStorage::attach' => ['void', 'obj'=>'object', 'inf='=>'mixed'],
'SplObjectStorage::contains' => ['bool', 'obj'=>'object'],
'SplObjectStorage::count' => ['int'],
'SplObjectStorage::current' => ['object'],
'SplObjectStorage::detach' => ['void', 'obj'=>'object'],
'SplObjectStorage::getHash' => ['string', 'obj'=>'object'],
'SplObjectStorage::getInfo' => ['mixed'],
'SplObjectStorage::key' => ['int'],
'SplObjectStorage::next' => ['void'],
'SplObjectStorage::offsetExists' => ['bool', 'object'=>'object'],
'SplObjectStorage::offsetGet' => ['mixed', 'obj'=>'object'],
'SplObjectStorage::offsetSet' => ['object', 'object'=>'object', 'data='=>'mixed'],
'SplObjectStorage::offsetUnset' => ['object', 'object'=>'object'],
'SplObjectStorage::removeAll' => ['void', 'os'=>'splobjectstorage'],
'SplObjectStorage::removeAllExcept' => ['void', 'os'=>'splobjectstorage'],
'SplObjectStorage::rewind' => ['void'],
'SplObjectStorage::serialize' => ['string'],
'SplObjectStorage::setInfo' => ['void', 'inf'=>'mixed'],
'SplObjectStorage::unserialize' => ['void', 'serialized'=>'string'],
'SplObjectStorage::valid' => ['bool'],
'SplObserver::update' => ['void', 'subject'=>'splsubject'],
'SplPriorityQueue::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'],
'SplPriorityQueue::count' => ['int'],
Expand Down
62 changes: 62 additions & 0 deletions stubs/ArrayObject.stub
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,65 @@ class SplFixedArray implements Iterator, ArrayAccess, Countable
*/
public function toArray(): array { }
}

/**
* @template TKey of object
* @template TValue
*
* @template-implements Iterator<TKey, TValue>
* @template-implements ArrayAccess<TKey, TValue>
*/
interface SplObjectStorage implements Countable, Iterator, Serializable, ArrayAccess
{

/**
* @param \SplObjectStorage<TKey, TValue> $storage
*/
public function addAll(SplObjectStorage $storage): void;

/**
* @param TKey $object
* @param TValue $data
*/
public function attach(object $object, $data = null): void;

/**
* @param TKey $object
*/
public function contains(object $object): bool;

/**
* @param TKey $object
*/
public function detach(object $object): void;

/**
* @param TKey $object
*/
public function detach(object $object): void;

/**
* @param TKey $object
*/
public function getHash(object $object): string;

/**
* @return TValue
*/
public function getInfo();

/**
* @param \SplObjectStorage<object, mixed> $storage
*/
public function removeAll(SplObjectStorage $storage): void;

/**
* @param \SplObjectStorage<object, mixed> $storage
*/
public function removeAllExcept(SplObjectStorage $storage): void;

/**
* @param TValue $data
*/
public function setInfo($data): void;
}

0 comments on commit 33b89cb

Please sign in to comment.