2017 © Pedro Peláez
 

library php-object-maps

ObjectMap structures for PHP

image

pinepain/php-object-maps

ObjectMap structures for PHP

  • Wednesday, April 25, 2018
  • by pinepain
  • Repository
  • 2 Watchers
  • 6 Stars
  • 177 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 7 Versions
  • 1 % Grown

The README.md

I'm moving away from PHP world and all my PHP projects going to be abandoned too. Abandoning this project too as I have no intent to continue working on it unless there would be strong request from community and commercial interest. No more updates or documentation will be made. If someone is interested, feels free to contact me using email specified in my GitHub profile., (*1)

Weak-referenced data structures for PHP based on Ref php extension

Build Status Code Coverage, (*2)

PLEASE READ:

Maintaining this project takes significant amount of time and efforts. If you like my work and want to show your appreciation, please consider supporting me at https://www.patreon.com/pinepain., (*3)

Requirements

  • PHP >= 7.2
  • (optional, required only for maps weak behavior) php-ref extension

Installation:

composer require pinepain/php-object-maps

Docs:

This library offers two main classes: ObjectMap and ObjectBiMap. They are what their name is - classic object maps which map object keys to object values., (*4)

The key difference between ObjectMap and ObjectBiMap is that ObjectBiMap require all values to be unique and it offers you to get mirrored ObjectBiMap map with keys and values from source map flipped. Note, that flipped map will still maintain connection to the original one and thus any modification to any ObjectBiMap in a chain will be reflected on all chain., (*5)

Maps behavior

Both ObjectMap and ObjectBiMap offers weak variations (php-ref extension required) which could be specified by passing one of ObjectMapInterface::{WEAK_KEY,WEAK_VALUE,WEAK_KEY_VALUE} constants to the constructor. By default no weakness enabled. Note, that when weak behavior enable on key or/and value, their refcount won't be incremented by map internals and thus it is possible that they will be destructed without a need be purged from map., (*6)

WEAK_KEY means that key-value pair will be removed as long as key will be destructed. WEAK_VALUE is the same for value and WEAK_KEY_VALUE will trigger removal when key or value will be destructed., (*7)

For more details see tests., (*8)

License

php-object-maps PHP library is licensed under the MIT license., (*9)

The Versions

25/04 2018

dev-master

9999999-dev

ObjectMap structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.2

 

The Development Requires

map bimap object map object bimap weak object map weak object bimap

08/03 2018

v0.4.0

0.4.0.0

ObjectMap structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.2

 

The Development Requires

map bimap object map object bimap weak object map weak object bimap

01/09 2017

dev-drop-php71-support

dev-drop-php71-support

ObjectMap structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

map bimap object map object bimap weak object map weak object bimap

27/08 2017

v0.3.0

0.3.0.0

ObjectMap structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

map bimap object map object bimap weak object map weak object bimap

10/08 2016

v0.2.1

0.2.1.0

Weak-referenced data structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.0
  • ext-ref *

 

The Development Requires

data structure php-ref reference weak weakref weakreference weak data types

20/01 2016

v0.2.0

0.2.0.0

Weak-referenced data structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.0
  • ext-weak ~0.2.2

 

The Development Requires

data structure reference weak weakref weakreference weak data types php-weak

11/01 2016

v0.1.0

0.1.0.0

Weak-referenced data structures for PHP

  Sources   Download

MIT

The Requires

  • php ~7.0
  • ext-weak ~0.1.0

 

The Development Requires

data structure reference weak weakref weakreference weak data types php-weak