code: public function remove($key, $default = null)
      {
          Deprecated::method(1.1, MutableBag::class);
  
          if (!$this->has($key)) {
              return $default;
          }
  
          $removed = $this->items[$key];
          unset($this->items[$key]);
  
          return $removed;
      }
docs: Removes and returns the item at the specified `$key` from the bag.
  
  @param string|int $key     The key of the item to remove
  @param mixed|null $default The default value to return if the key is not found
  
  @return mixed The removed item or `$default`, if the bag did not contain the item
  
  @deprecated since 1.1 and will be removed in 2.0. Use {@see MutableBag} instead.