There are no commands defined in the "customplugin" namespace - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Friday, June 11, 2021

There are no commands defined in the "customplugin" namespace

I am trying to create custom command for vendor package for Mautic. I am getting this error "There are no commands defined in the "customplugin" namespace. Following as per Symfony documentation for creating custom command. https://symfony.com/doc/4.4/console.html any help here ?

PHP: 7.4 Mautic version : 4.0.0 Composer.json :

"require-dev": {
    "symfony/web-profiler-bundle": "~4.4.0",
    "symfony/var-dumper": "~4.4.0",
    "symfony/browser-kit": "~4.4.0",
    "symfony/dom-crawler": "~4.4.0",
    "mautic/transifex": "^4.0",
    "http-interop/http-factory-guzzle": "^1.0",
    "webfactory/exceptions-bundle": "~4.3",
    "friendsofphp/php-cs-fixer": "~2.16.1",
    "liip/test-fixtures-bundle": "^1.6",
    "phpstan/phpstan": "0.12.25",
    "rector/rector-prefixed": "^0.6.13",
    "symfony/phpunit-bridge": "~5.1.0",
    "phpunit/phpunit": "^9.5",
    "liip/functional-test-bundle": "^4.2",
    "php-http/mock-client": "^1.4", 
  } 

Command/PluginCommand.php

<?php

// src/Command/PluginCommand.php
namespace Aviboy2006\MauticPluginCreator\Command;


use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class PluginCommand extends Command
{
    
 
    // the name of the command (the part after "bin/console")
    protected static $defaultName = 'customplugin:create';

    protected function configure(): void
    {
        // ...
    }

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        // ... put here the code to create the user

        // this method must return an integer number with the "exit status code"
        // of the command.

        // return this if there was no problem running the command
        return 0;

        // or return this if some error happened during the execution
        // return 1;
    }
}

Tried clearing cache but nothing is working.



source https://stackoverflow.com/questions/67926757/there-are-no-commands-defined-in-the-customplugin-namespace

No comments:

Post a Comment