Go to file
R. Eric Wheeler 521dd9b609 Merge branch '0.x' into 'master'
Merge 0.x into master

See merge request olive/PHP/map!1
2021-03-04 21:16:36 +00:00
src/Olivebbs/Map Merge 0.x into master 2021-03-04 21:16:36 +00:00
tests Merge 0.x into master 2021-03-04 21:16:36 +00:00
.gitignore Initial commit 2021-03-03 13:59:55 -08:00
.gitlab-ci.yml Merge 0.x into master 2021-03-04 21:16:36 +00: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 Initial commit 2021-03-03 13:59:55 -08:00
composer.lock Merge 0.x into master 2021-03-04 21:16:36 +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