Is there a way to enforce the use of class constants as parameters in PHP functions to improve code readability?

Using class constants as parameters in PHP functions can improve code readability and maintainability by providing clear and meaningful values. To enforce the use of class constants, you can define the function parameter type as the class name and use the class constants as arguments when calling the function.

class Status {
    const ACTIVE = 1;
    const INACTIVE = 0;
}

function setStatus(int $status) {
    // Function implementation
}

// Calling the function with class constants
setStatus(Status::ACTIVE);