Giter VIP home page Giter VIP logo

Comments (3)

msmakouz avatar msmakouz commented on July 30, 2024

@lifewcody Hi, I installed a clean installation of spiral/app (in the installer I selected the console application) and added the call to the example console command:

namespace App\Endpoint\Console;

use Spiral\Console\Attribute\AsCommand;
use Spiral\Console\Command;

#[AsCommand(name: 'do-nothing', description: 'The command does nothing.')]
final class DoNothing extends Command
{
    public function perform(): int
    {
        $this->alert('test');  // <----

        return self::SUCCESS;
    }
}

And it worked correctly for me. Screenshot:

22

In the base class, in the execute method on the 87 line, the prepareOutput method is called, which for $this->output creates a SymfonyStyle object that has the desired method:
https://github.com/spiral/framework/blob/3.11.1/src/Console/src/Command.php#L87

Did you make any changes in your console command that might break this? Can you provide an example code for the console command that causes the error?

from framework.

lifewcody avatar lifewcody commented on July 30, 2024

I should have been more specific; It's only when calling confirmToProceed()

But then I'm not sure why alert works but not in confirmToProceed()

if (!$confirmation->confirmToProceed()) {
            return self::FAILURE;
        }

from framework.

butschster avatar butschster commented on July 30, 2024

Hi @lifewcody, thank you for the bug report! Yes, I was able to reproduce the problem. We will fix it soon.

from framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.