laminas / laminas-cli

Console command runner, exposing commands written in Laminas MVC and Mezzio components and applications
https://docs.laminas.dev/laminas-cli
BSD 3-Clause "New" or "Revised" License
55 stars 22 forks source link

Since upgrade to 1.1.0: Command works without parameter, but not with parameter anymore #74

Closed finn-matti closed 3 years ago

finn-matti commented 3 years ago

BC Break Report

Q A
Version 1.1.0

Summary

(I'm not sure what BC stand for, but the template description made it seem that this is the right one for my issue.)

Since the update today my command has stopped working. When executing the command without the parameter I get the expected message:

./vendor/bin/laminas app:publish

Not enough arguments (missing: "message"). 

If I add the message I get this error:

./vendor/bin/laminas app:publish foo

There are no commands defined in the "app" namespace.

Previous behavior

The command works as expected.

Current behavior

The command doesn't work.

How to reproduce

I don't have a unit test because I still try to get more comfortable with laminas-cli. Here's the module.config.php:

<?php

/**
 * @see       https://github.com/laminas/laminas-mvc-skeleton for the canonical source repository
 *
 * @copyright https://github.com/laminas/laminas-mvc-skeleton/blob/master/COPYRIGHT.md
 * @license   https://github.com/laminas/laminas-mvc-skeleton/blob/master/LICENSE.md New BSD License
 */

declare(strict_types=1);

namespace Worker;

use Laminas\ServiceManager\Factory\InvokableFactory;
use Worker\Command\HelloCommand;
use Worker\Command\PublishCommand;

return [
    'laminas-cli'     => [
        'commands' => [
            'app:hello'   => HelloCommand::class,
            'app:publish' => PublishCommand::class,
        ],
    ],
    'service_manager' => [
        'factories' => [
            HelloCommand::class    => InvokableFactory::class,
            PublishCommand::class  => InvokableFactory::class,
        ],
    ],
];
boesing commented 3 years ago

Thanks for reporting this. Gonna try to create a test for that later on.

boesing commented 3 years ago

@finn-matti might want to try #75?

finn-matti commented 3 years ago

Thanks @boesing! I'll try to do so later today.

boesing commented 3 years ago

@finn-matti maybe give #76 the first try as I guess due to simplicity, that will be the final solution.

finn-matti commented 3 years ago

@boesing FYI: Both #75 and #76 worked for me.

weierophinney commented 3 years ago

Fixed with #76; release of 1.1.1 coming shortly.