remove includes from modification
This commit is contained in:
parent
847870f29f
commit
ceb3ab077c
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Stripe;
|
namespace Stripe;
|
||||||
|
|
||||||
use Traversable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Collection.
|
* Class Collection.
|
||||||
*
|
*
|
||||||
@ -49,7 +47,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
|||||||
$this->filters = $filters;
|
$this->filters = $filters;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($k): mixed
|
public function offsetGet($k)
|
||||||
{
|
{
|
||||||
if (\is_string($k)) {
|
if (\is_string($k)) {
|
||||||
return parent::offsetGet($k);
|
return parent::offsetGet($k);
|
||||||
@ -109,7 +107,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
|||||||
/**
|
/**
|
||||||
* @return int the number of objects in the current page
|
* @return int the number of objects in the current page
|
||||||
*/
|
*/
|
||||||
public function count(): int
|
public function count()
|
||||||
{
|
{
|
||||||
return \count($this->data);
|
return \count($this->data);
|
||||||
}
|
}
|
||||||
@ -118,7 +116,7 @@ class Collection extends StripeObject implements \Countable, \IteratorAggregate
|
|||||||
* @return \ArrayIterator an iterator that can be used to iterate
|
* @return \ArrayIterator an iterator that can be used to iterate
|
||||||
* across objects in the current page
|
* across objects in the current page
|
||||||
*/
|
*/
|
||||||
public function getIterator(): Traversable
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return new \ArrayIterator($this->data);
|
return new \ArrayIterator($this->data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -194,28 +194,28 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ArrayAccess methods
|
// ArrayAccess methods
|
||||||
public function offsetSet($k, $v): void
|
public function offsetSet($k, $v)
|
||||||
{
|
{
|
||||||
$this->{$k} = $v;
|
$this->{$k} = $v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetExists($k): bool
|
public function offsetExists($k)
|
||||||
{
|
{
|
||||||
return \array_key_exists($k, $this->_values);
|
return \array_key_exists($k, $this->_values);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetUnset($k): void
|
public function offsetUnset($k)
|
||||||
{
|
{
|
||||||
unset($this->{$k});
|
unset($this->{$k});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($k): mixed
|
public function offsetGet($k)
|
||||||
{
|
{
|
||||||
return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null;
|
return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Countable method
|
// Countable method
|
||||||
public function count(): int
|
public function count()
|
||||||
{
|
{
|
||||||
return \count($this->_values);
|
return \count($this->_values);
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ class StripeObject implements \ArrayAccess, \Countable, \JsonSerializable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function jsonSerialize(): mixed
|
public function jsonSerialize()
|
||||||
{
|
{
|
||||||
return $this->toArray();
|
return $this->toArray();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Stripe\Util;
|
namespace Stripe\Util;
|
||||||
|
|
||||||
use Traversable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CaseInsensitiveArray is an array-like class that ignores case for keys.
|
* CaseInsensitiveArray is an array-like class that ignores case for keys.
|
||||||
*
|
*
|
||||||
@ -23,17 +21,17 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega
|
|||||||
$this->container = \array_change_key_case($initial_array, \CASE_LOWER);
|
$this->container = \array_change_key_case($initial_array, \CASE_LOWER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function count(): int
|
public function count()
|
||||||
{
|
{
|
||||||
return \count($this->container);
|
return \count($this->container);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIterator(): Traversable
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return new \ArrayIterator($this->container);
|
return new \ArrayIterator($this->container);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetSet($offset, $value): void
|
public function offsetSet($offset, $value)
|
||||||
{
|
{
|
||||||
$offset = static::maybeLowercase($offset);
|
$offset = static::maybeLowercase($offset);
|
||||||
if (null === $offset) {
|
if (null === $offset) {
|
||||||
@ -43,20 +41,20 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \IteratorAggrega
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetExists($offset): bool
|
public function offsetExists($offset)
|
||||||
{
|
{
|
||||||
$offset = static::maybeLowercase($offset);
|
$offset = static::maybeLowercase($offset);
|
||||||
|
|
||||||
return isset($this->container[$offset]);
|
return isset($this->container[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetUnset($offset): void
|
public function offsetUnset($offset)
|
||||||
{
|
{
|
||||||
$offset = static::maybeLowercase($offset);
|
$offset = static::maybeLowercase($offset);
|
||||||
unset($this->container[$offset]);
|
unset($this->container[$offset]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function offsetGet($offset): mixed
|
public function offsetGet($offset)
|
||||||
{
|
{
|
||||||
$offset = static::maybeLowercase($offset);
|
$offset = static::maybeLowercase($offset);
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ namespace Stripe\Util;
|
|||||||
|
|
||||||
use ArrayIterator;
|
use ArrayIterator;
|
||||||
use IteratorAggregate;
|
use IteratorAggregate;
|
||||||
use Traversable;
|
|
||||||
|
|
||||||
class Set implements IteratorAggregate
|
class Set implements IteratorAggregate
|
||||||
{
|
{
|
||||||
@ -38,7 +37,7 @@ class Set implements IteratorAggregate
|
|||||||
return \array_keys($this->_elts);
|
return \array_keys($this->_elts);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIterator(): Traversable
|
public function getIterator()
|
||||||
{
|
{
|
||||||
return new ArrayIterator($this->toArray());
|
return new ArrayIterator($this->toArray());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user