Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
101 views
in Technique[技术] by (71.8m points)

php - Symfony error: Argument 1 passed to SymfonyComponentStopwatchStopwatch::stopSection()

When I updated from Symfony 3.4 to 4 and displayed it in the browser, the following error is displayed on the toolbar, and the toolbar is not working properly. Of course, I haven't changed the code myself. I hope someone can help me. Please let me know if you have any missing information.

Error message

//toolbar
An error occurred while loading the web debug toolbar.   
Open the web profiler.
//web profiler
Argument 1 passed to SymfonyComponentStopwatchStopwatch::stopSection() must be of the type string, null given,   
called in /home/Symfony/vendor/symfony/http-kernel/Debug/TraceableEventDispatcher.php on line 69

Stopwatch.php

    /**
     * Starts an event.
     *
     * @param string $name     The event name
     * @param string $category The event category
     *
     * @return StopwatchEvent A StopwatchEvent instance
     */
    public function start($name, $category = null)
    {
        return end($this->activeSections)->startEvent($name, $category);
    }

TraceableEventDispatcher.php

    /**
     * Constructor.
     *
     * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
     * @param Stopwatch                $stopwatch  A Stopwatch instance
     * @param LoggerInterface          $logger     A LoggerInterface instance
     */
    public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null)
    {
        $this->dispatcher = $dispatcher;
        $this->stopwatch = $stopwatch;
        $this->logger = $logger;
        $this->called = array();
        $this->wrappedListeners = array();
        $this->firstCalledEvent = array();
    }

    /**
     * Sets the profiler.
     *
     * @param Profiler|null $profiler A Profiler instance
     */
    public function setProfiler(Profiler $profiler = null)
    {
        $this->profiler = $profiler;
    }

Version
Symfony4.0
symfony/stopwatch (v5.2.1)

question from:https://stackoverflow.com/questions/65895283/symfony-error-argument-1-passed-to-symfony-component-stopwatch-stopwatchstops

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...