anibalsanchez/create-pattern

A lightweight PHP implementation of the Static Create Pattern using a trait.

Installs: 1 648

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/anibalsanchez/create-pattern

3.0.0 2025-11-08 19:52 UTC

This package is auto-updated.

Last update: 2025-11-08 19:52:56 UTC


README

Description

A lightweight PHP implementation of the Static Create Pattern using a trait.

composer require anibalsanchez/create-pattern

Inspired by byjg/SingletonPatternPHP

Usage

Create your class

require "vendor/autoload.php";

class Example
{
    // You need to use the trait here
    use \Extly\Infrastructure\Creator\CreatorTrait;
    use \Extly\Infrastructure\Creator\SingletonTrait;

    // Put your code below
}

Use your class

$example = Example::create();
$example = Example::getInstance();

Install

Just type: composer require anibalsanchez/create-pattern

References

License

The MIT License (MIT)