PHPackages                             hhpack/package - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hhpack/package

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hhpack/package
==============

Package utility library for vendor

1.5.0(6y ago)0174[2 issues](https://github.com/hhpack/package/issues)2MITShell

Since Oct 5Pushed 6y agoCompare

[ Source](https://github.com/hhpack/package)[ Packagist](https://packagist.org/packages/hhpack/package)[ RSS](/packages/hhpack-package/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (38)Used By (2)

package
=======

[](#package)

Package utility library for vendor.
Easily and quickly, and you can find a class or interface.

[![Latest Stable Version](https://camo.githubusercontent.com/66ad263a7e8a342338db0618b4dc7abfdb919d93a187166a58341aab96e29057/68747470733a2f2f706f7365722e707567782e6f72672f68687061636b2f7061636b6167652f762f737461626c65)](https://packagist.org/packages/hhpack/package)[![CircleCI](https://camo.githubusercontent.com/dee9d84c66a55d361a7ab3bf12f41b9cc02cf8dfc85609d7d5dda1a8cd6c13b7/68747470733a2f2f636972636c6563692e636f6d2f67682f68687061636b2f7061636b6167652f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/hhpack/package/tree/master)[![Dependency Status](https://camo.githubusercontent.com/7f5a423992f9a5c409acf71bf2537247569701fc728837b02b4ff548c14dbd79/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536313065343238613139333334303031353030303030392f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/5610e428a193340015000009)[![License](https://camo.githubusercontent.com/ce8a8946da380bf961b8a90dae9bff04bd13f14c3d1b93a6d8e05c0df055f642/68747470733a2f2f706f7365722e707567782e6f72672f68687061636b2f7061636b6167652f6c6963656e7365)](https://packagist.org/packages/hhpack/package)

Basic usage
-----------

[](#basic-usage)

Find the source file from the package.

```
use HHPack\Package\VendorPackage;

$sources = VendorPackage::fromItems([
    Pair { 'package\\examples\\classes\\', realpath(__DIR__ . '/src') }
])->sources();

foreach ($sources as $source) {
	var_dump($source->name()); // /path/to/example.hh
	var_dump($source->directory()); // /path/to
}
```

Selection of elements
---------------------

[](#selection-of-elements)

You can select the elements in the following function.

- HHPack\\Package\\implementsInterface
- HHPack\\Package\\subclassOf
- HHPack\\Package\\classes
- HHPack\\Package\\abstractClasses
- HHPack\\Package\\traits
- HHPack\\Package\\interfaces
- HHPack\\Package\\instantiable
- HHPack\\Package\\startsWith
- HHPack\\Package\\endsWith

In the following we are looking for a interface and traits.

```
use HHPack\Package as package;
use HHPack\Package\VendorPackage;

$interfaces = VendorPackage::fromItems([
    Pair { 'Package\\Examples\\Classes\\', realpath(__DIR__ . '/src') }
])->classes(package\interfaces());

foreach ($interfaces as $interface) {
    var_dump($interface->name()); // interface
}

$traits = VendorPackage::fromItems([
    Pair { 'Package\\Examples\\Classes\\', realpath(__DIR__ . '/src') }
])->classes(package\traits());

foreach ($traits as $trait) {
    var_dump($trait->getName()); // trait
}
```

Instantiation of class
----------------------

[](#instantiation-of-class)

Get an instance from the source files

```
use HHPack\Package\VendorPackage;

$instances = VendorPackage::fromItems([
    Pair { 'Package\\Examples\\Classes\\', realpath(__DIR__ . '/src') }
])->classes()->map(($class) ==> $class->instantiate());

foreach ($instances as $instance) {
    var_dump($instance);
}
```

Pipeline of stream
------------------

[](#pipeline-of-stream)

You can build a pipeline.
You can achieve when implement the interface **Middleware** and **Stream**.

Please look at the **example/pipeline.hh** for details.

```
use HHPack\Package\VendorPackage;
use HHPack\Package\Examples\Classes\FileStatTransformer;
use HHPack\Package\Examples\Classes\FileStatOutput;

$package = VendorPackage::fromItems([
    Pair { 'Package\\Examples\\Classes\\', realpath(__DIR__ . '/src') }
]);

$package->sources()
    ->pipeTo(new FileStatTransformer())
    ->pipeTo(new FileStatOutput());
```

Run the test
------------

[](#run-the-test)

```
composer install
composer test

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Recently: every ~86 days

Total

32

Last Release

2462d ago

Major Versions

0.12.0 → 1.0.02017-01-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/70c299d6d6015ee714954aa05e4d0e9c7b1d31318a5d7db5e9bb4e1f70f78afc?d=identicon)[holyshared](/maintainers/holyshared)

---

Top Contributors

[![holyshared](https://avatars.githubusercontent.com/u/167190?v=4)](https://github.com/holyshared "holyshared (197 commits)")

---

Tags

hacklanghhvmloaderselectorstreampackagehhvmhackfile collector

### Embed Badge

![Health badge](/badges/hhpack-package/health.svg)

```
[![Health](https://phpackages.com/badges/hhpack-package/health.svg)](https://phpackages.com/packages/hhpack-package)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
