PHPackages                             lullabot/ph\_tools - 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. lullabot/ph\_tools

AbandonedArchivedDrupal-module[Utility &amp; Helpers](/categories/utility)

lullabot/ph\_tools
==================

AProvides utility services and helper classes for Placeholder projects, including robust entity extraction from route contexts.

1.0.0-alpha2(10mo ago)01[1 issues](https://github.com/Lullabot/ph_tools/issues)proprietaryPHP

Since Jul 5Pushed 10mo agoCompare

[ Source](https://github.com/Lullabot/ph_tools)[ Packagist](https://packagist.org/packages/lullabot/ph_tools)[ RSS](/packages/lullabot-ph-tools/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

Placeholder Tools
=================

[](#placeholder-tools)

Useful tools to share across Placeholder projects.

Overview
--------

[](#overview)

The `ph_tools` module provides utility services and helper classes designed to simplify common development tasks across Placeholder Drupal projects. The module aims to provide robust, reusable components that handle edge cases and follow modern PHP and Drupal best practices.

Features
--------

[](#features)

- **Page Service**: Robust entity extraction from current route context
- **Exception Handling**: Custom exception classes for better error handling

Architecture
------------

[](#architecture)

### PageService

[](#pageservice)

The `PageService` class provides methods to reliably extract entities from the current route context.

#### Key Methods

[](#key-methods)

- `getNodeFromCurrentRoute()`: Specifically extracts node entities from the current route
- `getEntityFromCurrentRoute()`: Generic method for extracting any entity type from the current route

#### Supported Route Contexts

[](#supported-route-contexts)

The PageService handles multiple route contexts:

1. **Standard Entity Routes**: Routes with automatically upcasted entity parameters
2. **Preview Routes**: Entity preview pages (e.g., `node_preview`)
3. **Revision Routes**: Entity revision pages with revision ID parameters
4. **UUID Routes**: Routes that reference entities by UUID

### Exception Handling

[](#exception-handling)

The module includes custom exception classes for better error handling:

- `InvalidContextException`: Thrown when the route context is invalid for entity extraction

Future Enhancements
-------------------

[](#future-enhancements)

- **Hook System**: Convert entity parameter detection into a plugin/hook system

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance54

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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 ~1 days

Total

2

Last Release

316d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f2b22c5ce2b0ee6b619c41efe1ddb93ac84d910f59539363009b76810469c72?d=identicon)[lullabot](/maintainers/lullabot)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/lullabot-ph-tools/health.svg)

```
[![Health](https://phpackages.com/badges/lullabot-ph-tools/health.svg)](https://phpackages.com/packages/lullabot-ph-tools)
```

PHPackages © 2026

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