Go to file
R. Eric Wheeler 1e2ba7b2fd 1.x 2022-05-11 20:25:55 +00:00
src/Olivebbs/Map 1.x 2022-05-11 20:25:55 +00:00
tests 1.x 2022-05-11 20:25:55 +00:00
.gitignore Update dependencies 2021-07-29 11:26:29 -07:00
.gitlab-ci.yml 1.x 2022-05-11 20:25:55 +00:00
.php-cs-fixer.php 1.x 2022-05-11 20:25:55 +00:00
LICENSE Initial commit 2021-03-03 13:59:55 -08:00
README.md Initial commit 2021-03-03 13:59:55 -08:00
composer.json 1.x 2022-05-11 20:25:55 +00:00
composer.lock 1.x 2022-05-11 20:25:55 +00:00
header.txt Initial commit 2021-03-03 13:59:55 -08:00
phpunit.xml Initial commit 2021-03-03 13:59:55 -08:00

README.md

olivebbs/map

Very simple typed map class.

Includes IntCharMap and CharMap as examples. It is best to extend Olivebbs\Map\GenericMap for your uses.

Example

use Olivebbs\Map\GenericMap;

final class MyStringMap extends GenericMap 
{
    public function __construct(array $values)
    {
        parent::__construct(GenericMap::STRING, GenericMap::STRING);
        $this->map->putAll($values);
    }
}

or

use Olivebbs\Map\GenericMap;

$myIntMap = new GenericMap(GenericMap::INT, GenericMap::INT); 

Then use it.

$myIntMap[0] = 500;
unset($myIntMap[0]) // null