Ejemplo n.º 1
0
 /**
  * Remove an object from the storage
  * @param object object
  */
 public function offsetUnset($object)
 {
     if (parent::contains($object)) {
         parent::offsetUnset($object);
         $index = array_search(spl_object_hash($object), $this->map, true);
         unset($this->map[$index]);
     }
 }
 private function unsubscribe(WebSocketConnection $connection)
 {
     /** @var WebSocketObservableTable $table */
     $table = $this->connectionTableMap->offsetGet($connection);
     $table->removeConnection($connection);
     $this->connectionTableMap->offsetUnset($connection);
     $connections = $this->getConnectionsSubscribedToTable($table)->filter(function (WebSocketConnection $c) use($connection) {
         return $c !== $connection;
     });
     if (count($connections)) {
         $this->tableConnectionMap->offsetSet($table, $connections);
     } else {
         $this->tableConnectionMap->offsetUnset($table);
     }
 }
Ejemplo n.º 3
0
 /**
  * Offset to unset
  * @link http://php.net/manual/en/arrayaccess.offsetunset.php
  * @param mixed $offset <p>
  * The offset to unset.
  * </p>
  * @return void
  * @since 5.0.0
  */
 public function offsetUnset($offset)
 {
     if (is_scalar($offset)) {
         unset($this->scalarStore[$offset]);
     } else {
         if (is_object($offset)) {
             $this->objectStore->offsetUnset($offset);
         } else {
             if (is_array($offset)) {
                 $index = array_search($offset, $this->arrayKeys, true);
                 if (false !== $index) {
                     array_splice($this->arrayKeys, $index, 1);
                     array_splice($this->arrayValues, $index, 1);
                 }
             }
         }
     }
 }
Ejemplo n.º 4
0
 public function offsetUnset($index)
 {
     $this->validateIndex($index);
     // Decrement counters when replacing existing item
     if (parent::offsetExists($index)) {
         $oldResult = parent::offsetGet($index);
         if ($oldResult instanceof Success) {
             $this->countSuccess--;
         } elseif ($oldResult instanceof Failure) {
             $this->countFailure--;
         } elseif ($oldResult instanceof Warning) {
             $this->countWarning--;
         } else {
             $this->countUnknown--;
         }
     }
     parent::offsetUnset($index);
 }
 public function offsetUnset($object)
 {
     $this->initialize();
     parent::offsetUnset($object);
 }
Ejemplo n.º 6
0
 /**
  * @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
  */
 public function offsetUnset($object)
 {
     @trigger_error('The ' . __METHOD__ . ' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
     parent::offsetUnset($object);
 }
Ejemplo n.º 7
0
 /**
  * @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
  */
 public function offsetUnset($object)
 {
     $this->triggerDeprecation(__METHOD__);
     parent::offsetUnset($object);
 }
Ejemplo n.º 8
0
 /**
  * @param object $index
  * @link http://php.net/manual/en/splobjectstorage.offsetunset.php
  */
 public function offsetUnset($index)
 {
     $this->validateIndex($index);
     // Decrement counters when replacing existing item
     if (parent::offsetExists($index)) {
         $this->updateCounters(parent::offsetGet($index), -1);
     }
     parent::offsetUnset($index);
 }
Ejemplo n.º 9
0
 /**
  * @param object $offset
  */
 public function offsetUnset($offset)
 {
     $this->list->offsetUnset($offset);
 }