Skip to content

Creating a new AppFactory for alternative creation approach#58

Merged
JustSteveKing merged 1 commit into
mainfrom
feature/app-factory
May 2, 2023
Merged

Creating a new AppFactory for alternative creation approach#58
JustSteveKing merged 1 commit into
mainfrom
feature/app-factory

Conversation

@JustSteveKing

Copy link
Copy Markdown
Collaborator

This PR adds a new class AppFactory which will allow an alternative syntax for creating a Minicli application.

Currently, to create an app you need to:

$app = new App(
    config: [
        'app_path' => [
        __DIR__ . '/app/Command',
    ],
    'theme' => '\Unicorn', 
    'debug' => false,
    ],
);

You will now be able to use this approach and get the same result:

$app = AppFactory::make(
    config: [
        'app_path' => [
        __DIR__ . '/app/Command',
    ],
    'theme' => '\Unicorn', 
    'debug' => false,
    ],
);

This approach is more of a Developer Experience improvement than an actual improvement to the library.

@JustSteveKing JustSteveKing self-assigned this May 1, 2023
@JustSteveKing JustSteveKing requested a review from erikaheidi May 1, 2023 20:16
@JustSteveKing JustSteveKing added the enhancement New feature or request label May 1, 2023

@erikaheidi erikaheidi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏼

@JustSteveKing JustSteveKing merged commit 5ca78e0 into main May 2, 2023
@JustSteveKing JustSteveKing deleted the feature/app-factory branch May 2, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants