Skip to content

Notice: Event 'notFound' has been overridden! #541

@samuel-bolle

Description

@samuel-bolle

Hello,

First of all, thank you for taking such an active role in the project. It's very cool that new life has been breathed into it.

I have a problem. If I overwrite the "notFound" method via Map, as it is written in the docu (https://docs.flightphp.com/learn/extending), I get the error message "Notice: Event 'notFound' has been overridden!" which came in due to the changes for 3.4. Is this intentional? How should I proceed if I want to overwrite "notFound"? The error message breaks the output of the endpoint.

<?php
include './app/vendor/autoload.php';

Flight::map('notFound', function () {
    Flight::json([], 404);
});

Flight::route('/', function () {
    echo 'hello world!';
});

Flight::start();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions