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.
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace jrosset\ArrayClasses;
|
|
|
|
/**
|
|
* Interface for array classes
|
|
*
|
|
* @see IImmutableArrayClass Immutable version
|
|
*/
|
|
interface IArrayClass extends IImmutableArrayClass {
|
|
/**
|
|
* Create or replace a cell
|
|
*
|
|
* @param mixed $cellName The cell name/offset
|
|
* @param mixed $cellValue The cell new value
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function set ($cellName, $cellValue): self;
|
|
/**
|
|
* Add a cell (at the end)
|
|
*
|
|
* @param mixed $cellValue The cell new value
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function push ($cellValue): self;
|
|
/**
|
|
* Remove a cell
|
|
*
|
|
* @param mixed $cellName The cell name/offset
|
|
* @param bool $throwsForNonExistentElement Throws an exception for nonexistent elements ?
|
|
*
|
|
* @return $this
|
|
*/
|
|
public function del ($cellName, ?bool $throwsForNonExistentElement = null): self;
|
|
|
|
/**
|
|
* Create an immutable copy
|
|
*
|
|
* @return IImmutableArrayClass The immutable copy
|
|
*/
|
|
public function toImmutable (): IImmutableArrayClass;
|
|
} |