Go to file
R. Eric Wheeler 8fad32638e Merge branch '1-create-1-x-branch-with-support-for-enumerations-available-in-php-8-1' into '1.x'
Resolve "Create 1.x branch with support for enumerations available in php >= 8.1"

See merge request olive/PHP/map!3
2022-05-11 20:17:07 +00:00
src/Olivebbs/Map Resolve "Create 1.x branch with support for enumerations available in php >= 8.1" 2022-05-11 20:17:06 +00:00
tests Resolve "Create 1.x branch with support for enumerations available in php >= 8.1" 2022-05-11 20:17:06 +00:00
.gitignore Update dependencies 2021-07-29 11:26:29 -07:00
.gitlab-ci.yml Resolve "Create 1.x branch with support for enumerations available in php >= 8.1" 2022-05-11 20:17:06 +00:00
.php-cs-fixer.php Resolve "Create 1.x branch with support for enumerations available in php >= 8.1" 2022-05-11 20:17:06 +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 Resolve "Create 1.x branch with support for enumerations available in php >= 8.1" 2022-05-11 20:17:06 +00:00
composer.lock Resolve "Create 1.x branch with support for enumerations available in php >= 8.1" 2022-05-11 20:17:06 +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