Go to file
R. Eric Wheeler 6b37c60dab Add tests for php v8.1, change name from olivebbs/map to olive/map 2022-05-11 09:54:51 -07:00
src/Olivebbs/Map Fix logic when using class or object as value type 2021-03-04 11:16:57 -08:00
tests Fix logic when using class or object as value type 2021-03-04 11:16:57 -08:00
.gitignore Update dependencies 2021-07-29 11:26:29 -07:00
.gitlab-ci.yml Add tests for php v8.1, change name from olivebbs/map to olive/map 2022-05-11 09:54:51 -07:00
.php_cs.dist Initial commit 2021-03-03 13:59:55 -08: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 Add tests for php v8.1, change name from olivebbs/map to olive/map 2022-05-11 09:54:51 -07:00
composer.lock Add tests for php v8.1, change name from olivebbs/map to olive/map 2022-05-11 09:54:51 -07: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