Skip to content

Running In Console method in Application work incorrectly [HTTP mode] #148

Open
@koraga

Description

@koraga

Describe the bug

Method runningInConsole in Application work incorrectly when worker mode is HTTP

Expected behaviour

<?php

declare(strict_types=1);

namespace App\HelloWorld\UI\API\Controllers;

use Illuminate\Contracts\Foundation\Application;

final readonly class Service
{
    public function appRunningInConsole(Application $app): bool
    {
        return $app->runningInConsole(); // FALSE
    }
}

Actual behaviour

<?php

declare(strict_types=1);

namespace App\HelloWorld\UI\API\Controllers;

use Illuminate\Contracts\Foundation\Application;

final readonly class Service
{
    public function appRunningInConsole(Application $app): bool
    {
        return $app->runningInConsole(); // TRUE (is wrong!)
    }
}

System information

Key Value
PHP version 8.4.7
Current package version 6.0.1
RoadRunner version 2024.3.5
Environment all

Maybe need return this code https://github.com/roadrunner-php/laravel-bridge/pull/88/files#diff-3d0a396f5187f797d1a15769f87ca59d586cf126e06fbf87b9965dfc5185d6b7

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions