Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

[Feature Request] Add new option to module:create: --namespace=NAMESPACE #66

@adamturcsan

Description

@adamturcsan

Would be nice to have this feature to work with arbitrary namespacing for more complex projects.

Something like

composer expressive module:create --namespace=Vendor\Project ModuleName

Resulting with a module in the default src folder with a folder name ModuleName and a namespace Vendor\Project\ModuleName and a ConfigProvider like the following:

<?php

declare(strict_types=1);

namespace Vendor\Project\ModuleName;

/**
 * The configuration provider for the ModuleName module
 *
 * @see https://docs.zendframework.com/zend-component-installer/
 */
class ConfigProvider
{
    /**
     * Returns the configuration array
     *
     * To add a bit of a structure, each section is defined in a separate
     * method which returns an array with its configuration.
     */
    public function __invoke() : array
    {
        return [
            'dependencies' => $this->getDependencies(),
            'templates'    => $this->getTemplates(),
        ];
    }

    /**
     * Returns the container dependencies
     */
    public function getDependencies() : array
    {
        return [
            'invokables' => [
            ],
            'factories'  => [
            ],
        ];
    }

    /**
     * Returns the templates configuration
     */
    public function getTemplates() : array
    {
        return [
            'paths' => [
                'modulename'    => [__DIR__ . '/../templates/'],
            ],
        ];
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions