Prado\Web\THttpCookieCollection::removeAt PHP Méthode

removeAt() public méthode

This overrides the parent implementation by performing additional cleanup work when removing a TCookie object.
public removeAt ( $index ) : mixed
Résultat mixed the removed item.
    public function removeAt($index)
    {
        $item = parent::removeAt($index);
        if ($this->_o instanceof THttpResponse) {
            $this->_o->removeCookie($item);
        }
        return $item;
    }

Usage Example

 public function testRemoveAt()
 {
     $coll = new THttpCookieCollection();
     try {
         $coll->removeAt(0);
         self::fail('Invalid Value exception not raised');
     } catch (TInvalidDataValueException $e) {
     }
     $coll->insertAt(0, new THttpCookie('name', 'value'));
     self::assertEquals('value', $coll->removeAt(0)->getValue());
 }