You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PhpCollections/src/ArrayClasses/IImmutableArrayClass.php

41 lines
1.0 KiB
PHP

<?php
namespace jrosset\ArrayClasses;
use ArrayAccess;
use Countable;
use IteratorAggregate;
use JsonSerializable;
use Serializable;
/**
* Interface for immutable array classes
*
* @see IArrayClass Mutable version
*/
interface IImmutableArrayClass extends IteratorAggregate, JsonSerializable, Serializable, Countable, ArrayAccess, IArrayCast {
/**
* Check if a cell exists
*
* @param mixed $cellName The cell name/offset
*
* @return bool Is the cell exists ?
*/
public function has ($cellName): bool;
/**
* Get the value of a cell
*
* @param mixed $cellName The cell name/offset
* @param bool $throwsForNonExistentElement Throws an exception for nonexistent elements ?
*
* @return mixed The cell value
*/
public function get ($cellName, ?bool $throwsForNonExistentElement = null);
/**
* Create a mutable copy
*
* @return IArrayClass The mutable copy
*/
public function toMutable (): IArrayClass;
}