Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate when debugger is present #53

Open
nenads opened this issue Oct 29, 2020 · 0 comments
Open

Can't generate when debugger is present #53

nenads opened this issue Oct 29, 2020 · 0 comments

Comments

@nenads
Copy link

nenads commented Oct 29, 2020

When you install debuger

public function __construct(string $middleware issue is signature if you change

namespace Mtrajano\LaravelSwagger\DataObjects;

class Middleware
{
private $name;
private $parameters;

public function __construct($middleware)
{
    if (!is_string($middleware)) {
        dd($middleware);
    }
    $tokens = explode(':', $middleware, 2);
    $this->name = $tokens[0];
    $this->parameters = isset($tokens[1]) ? explode(',', $tokens[1]) : [];
}

Closure($request, $next)^ {#2297
class: "Barryvdh\Debugbar\Controllers\BaseController"
this: Barryvdh\Debugbar\Controllers\OpenHandlerController {#2296 …}
file: "./vendor/barryvdh/laravel-debugbar/src/Controllers/BaseController.php"
line: "25 to 30"
}

and what is caousing issue

<?php

namespace Barryvdh\Debugbar\Controllers;

use Barryvdh\Debugbar\LaravelDebugbar;
use Illuminate\Routing\Controller;
use Illuminate\Http\Request;
use Laravel\Telescope\Telescope;

// phpcs:ignoreFile
if (class_exists('Illuminate\Routing\Controller')) {

    class BaseController extends Controller
    {
        protected $debugbar;

        public function __construct(Request $request, LaravelDebugbar $debugbar)
        {
            $this->debugbar = $debugbar;

            if ($request->hasSession()) {
                $request->session()->reflash();
            }

            **$this->middleware(function ($request, $next) {**
                if (class_exists(Telescope::class)) {
                    Telescope::stopRecording();
                }
                return $next($request);
            });
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant