php:make-collection

Generate typed PHP Collection classes from existing entity definitions.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/atournayre/claude-personas --skill php-make-collection
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php:make-collection
Source: https://github.com/atournayre/claude-personas/tree/main/php/skills/make-collection
Command: npx skills add https://github.com/atournayre/claude-personas --skill php-make-collection

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation of strongly-typed Collection classes in PHP, enhancing code maintainability and developer productivity.

Core Features & Use Cases

  • Typed Collections: Generates classes that enforce type safety for collections of specific entities.
  • Boilerplate Reduction: Automates the generation of common collection methods and traits.
  • Use Case: When developing a feature that requires managing a list of Product objects, use this Skill to quickly generate a ProductCollection class with built-in functionalities.

Quick Start

Use the php:make-collection skill to generate a collection for the Product entity.

Frequently Asked Questions about php:make-collection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a typed collection class for a PHP entity?

You can generate a typed PHP collection by running this Skill, which automates the creation of a Collection class with specific traits and interfaces for enforcing type safety for your entity objects.

What do I need to create a typed collection in PHP using code generation?

You need an existing PHP entity definition file at src/Entity/{EntityName}.php and the atournayre/framework package installed in your project to generate the typed collection class.

Why use typed collections for PHP entity management?

Typed collections enforce type safety by restricting the collection to specific entity objects, reducing boilerplate code for common methods and enhancing overall code maintainability during object-oriented development.

Can I generate a collection class without an existing PHP entity definition?

No, you cannot generate a collection class without an existing PHP entity definition, because the Skill requires the entity file at src/Entity/{EntityName}.php to enforce type safety for that specific object.

Does this PHP collection generator work with any PHP framework?

No, this generator requires the atournayre/framework package, as it relies on specific traits and interfaces from that package to provide the enhanced functionality of the generated collection class.

What's the best way to manage lists of domain objects in PHP?

The best way is to use strongly-typed collection classes, which automate boilerplate reduction and enforce that only specific entity instances are added to the list, ensuring structured data management.