| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/dansnotreville-fr/nice/libraries/CBLib/Imagine/Image/Metadata/ |
Upload File : |
<?php
/*
* This file is part of the Imagine package.
*
* (c) Bulat Shakirzyanov <mallluhuct@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Imagine\Image\Metadata;
/**
* The container of the data extracted from metadata.
*/
class MetadataBag implements \ArrayAccess, \IteratorAggregate, \Countable
{
/**
* @var array
*/
private $data;
/**
* @param array $data
*/
public function __construct(array $data = array())
{
$this->data = $data;
}
/**
* Returns the metadata key, default value if it does not exist.
*
* @param string $key
* @param mixed|null $default
*
* @return mixed
*/
public function get($key, $default = null)
{
return array_key_exists($key, $this->data) ? $this->data[$key] : $default;
}
/**
* {@inheritdoc}
*
* @see \Countable::count()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->data);
}
/**
* {@inheritdoc}
*
* @see \IteratorAggregate::getIterator()
*
* @return \ArrayIterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new \ArrayIterator($this->data);
}
/**
* {@inheritdoc}
*
* @see \ArrayAccess::offsetExists()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return array_key_exists($offset, $this->data);
}
/**
* {@inheritdoc}
*
* @see \ArrayAccess::offsetSet()
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->data[$offset] = $value;
}
/**
* {@inheritdoc}
*
* @see \ArrayAccess::offsetUnset()
*
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->data[$offset]);
}
/**
* {@inheritdoc}
*
* @see \ArrayAccess::offsetGet()
*
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->get($offset);
}
/**
* Returns metadata as an associative array.
*
* @return array
*/
public function toArray()
{
return $this->data;
}
}