2017 © Pedro Peláez
 

library hcollection

API-compatible Hack collections in PHP

image

appertly/hcollection

API-compatible Hack collections in PHP

  • Friday, February 10, 2017
  • by doublecompile
  • Repository
  • 1 Watchers
  • 1 Stars
  • 329 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

hcollection

This library can be used by projects which either wish to use an API compatible with Hack collections, or by projects which are being converted from Hack into PHP. It should basically be a drop-in replacement., (*1)

Packagist, (*2)

Installation

You can install this library using Composer:, (*3)

$ composer require appertly/hcollection
  • The master branch (version 1.x) of this project requires PHP 7.1 and has no dependencies.

Compliance

Releases of this library will conform to Semantic Versioning., (*4)

Our code is intended to mostly comply with PSR-1 and PSR-2. If you find any issues related to standards compliance, please send a pull request!, (*5)

License

Just like the upstream Hack project, this project is licensed under the 3-clause BSD license., (*6)

Gotchas

As of PHP 7.1, the name iterable is now a reserved word. This causes problems with the HH\Iterable interface. In this library, this interface has been renamed to HH\HackIterable., (*7)

We have also added JsonSerializable to all concrete classes., (*8)

Since PHP wouldn't be able to support curly-brace instantiation, (e.g. Vector{1,2,3}), we instead added a (Google Guava-style) static of method to all the concrete classes:, (*9)

use HH\ImmMap;
use HH\ImmVector;

$map = ImmMap::of(); // would be empty
$vector = ImmVector::of(); // would be empty
$map = ImmMap::of('key1', 'value1', 'key2', 'value2', 'key3'); // value3 would be null
$vector = ImmVector::of(1, 2, 3);

The Versions

10/02 2017

dev-master

9999999-dev https://github.com/appertly/hcollection

API-compatible Hack collections in PHP

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.1

 

The Development Requires

collection hack collections hacklang

10/02 2017

1.0.0

1.0.0.0 https://github.com/appertly/hcollection

API-compatible Hack collections in PHP

  Sources   Download

BSD-3-Clause

The Requires

  • php >=7.1

 

The Development Requires

collection hack collections hacklang