No description
Find a file
2025-09-24 08:36:47 -07:00
src/Olivebbs/Map Added rector and moved php-cs-fixer to tools directory 2025-09-22 13:03:58 -07:00
tests Resolve "Change const types to enum" 2022-05-11 23:28:23 +00:00
tools Added rector and moved php-cs-fixer to tools directory 2025-09-22 13:03:58 -07:00
.gitignore Added rector and moved php-cs-fixer to tools directory 2025-09-22 13:03:58 -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
composer.json Change namespace from Olive to Olivebbs drop max php version to 8.3 2025-09-24 08:36:47 -07:00
composer.lock Change namespace from Olive to Olivebbs drop max php version to 8.3 2025-09-24 08:36:47 -07:00
header.txt Initial commit 2021-03-03 13:59:55 -08:00
LICENSE Initial commit 2021-03-03 13:59:55 -08:00
phpunit.xml Update dependencies, bump php version to 8.4 and update phpunit.xml for 12.3 2025-09-22 12:48:28 -07:00
README.md Resolve "Change const types to enum" 2022-05-11 23:28:23 +00:00
rector.php Added rector and moved php-cs-fixer to tools directory 2025-09-22 13:03:58 -07:00

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;
use Olivebbs\Map\Enum\ValueType;
use Olivebbs\Map\Enum\KeyType;

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

or

use Olivebbs\Map\GenericMap;
use Olivebbs\Map\Enum\ValueType;
use Olivebbs\Map\Enum\KeyType;

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

Then use it.

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