master

laravel/framework

Last updated at: 29/12/2023 09:24

BackedEnumCaseNotFoundException.php

TLDR

This file contains the BackedEnumCaseNotFoundException class definition, which is a subclass of the RuntimeException class. This class is used to throw an exception when a specific case is not found on a backed enum.

Classes

BackedEnumCaseNotFoundException

This class extends the RuntimeException class and is responsible for throwing an exception when a specific case is not found on a backed enum. It takes two arguments in its constructor: $backedEnumClass and $case, and generates an exception message stating that the specified case was not found on the specified backed enum.

<?php

namespace Illuminate\Routing\Exceptions;

use RuntimeException;

class BackedEnumCaseNotFoundException extends RuntimeException
{
    /**
     * Create a new exception instance.
     *
     * @param  string  $backedEnumClass
     * @param  string  $case
     * @return void
     */
    public function __construct($backedEnumClass, $case)
    {
        parent::__construct("Case [{$case}] not found on Backed Enum [{$backedEnumClass}].");
    }
}