__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Slim Framework (https://slimframework.com)
*
* @license https://github.com/slimphp/Slim/blob/3.x/LICENSE.md (MIT License)
*/
namespace Slim;
use ArrayIterator;
use Slim\Interfaces\CollectionInterface;
/**
* Collection
*
* This class provides a common interface used by many other
* classes in a Slim application that manage "collections"
* of data that must be inspected and/or manipulated
*/
class Collection implements CollectionInterface
{
/**
* The source data
*
* @var array
*/
protected $data = [];
/**
* @param array $items Pre-populate collection with this key-value array
*/
public function __construct(array $items = [])
{
$this->replace($items);
}
/**
* {@inheritdoc}
*/
public function set($key, $value)
{
$this->data[$key] = $value;
}
/**
* {@inheritdoc}
*/
public function get($key, $default = null)
{
return $this->has($key) ? $this->data[$key] : $default;
}
/**
* {@inheritdoc}
*/
public function replace(array $items)
{
foreach ($items as $key => $value) {
$this->set($key, $value);
}
}
/**
* {@inheritdoc}
*/
public function all()
{
return $this->data;
}
/**
* Get collection keys
*
* @return array The collection's source data keys
*/
public function keys()
{
return array_keys($this->data);
}
/**
* {@inheritdoc}
*/
public function has($key)
{
return array_key_exists($key, $this->data);
}
/**
* {@inheritdoc}
*/
public function remove($key)
{
unset($this->data[$key]);
}
/**
* {@inheritdoc}
*/
public function clear()
{
$this->data = [];
}
/**
* Does this collection have a given key?
*
* @param string $key The data key
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($key)
{
return $this->has($key);
}
/**
* Get collection item for key
*
* @param string $key The data key
*
* @return mixed The key's value, or the default value
*/
#[\ReturnTypeWillChange]
public function offsetGet($key)
{
return $this->get($key);
}
/**
* Set collection item
*
* @param string $key The data key
* @param mixed $value The data value
*/
#[\ReturnTypeWillChange]
public function offsetSet($key, $value)
{
$this->set($key, $value);
}
/**
* Remove item from collection
*
* @param string $key The data key
*/
#[\ReturnTypeWillChange]
public function offsetUnset($key)
{
$this->remove($key);
}
/**
* Get number of items in collection
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->data);
}
/**
* Get collection iterator
*
* @return ArrayIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->data);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Exception | Folder | 0750 |
|
|
| Handlers | Folder | 0750 |
|
|
| Http | Folder | 0750 |
|
|
| Interfaces | Folder | 0750 |
|
|
| App.php | File | 23.45 KB | 0640 |
|
| CallableResolver.php | File | 3.08 KB | 0640 |
|
| CallableResolverAwareTrait.php | File | 1.11 KB | 0640 |
|
| Collection.php | File | 3.16 KB | 0640 |
|
| Container.php | File | 5.77 KB | 0640 |
|
| DefaultServicesProvider.php | File | 6.26 KB | 0640 |
|
| DeferredCallable.php | File | 1.14 KB | 0640 |
|
| MiddlewareAwareTrait.php | File | 3.35 KB | 0640 |
|
| Routable.php | File | 1.94 KB | 0640 |
|
| Route.php | File | 6.59 KB | 0640 |
|
| RouteGroup.php | File | 585 B | 0640 |
|
| Router.php | File | 11.7 KB | 0640 |
|