chevere/throwable-handler

Throwable handler for multiple contexts

0.9.0 2022-12-14 16:42 UTC

README

🔔 Subscribe to the newsletter to don't miss any update regarding Chevere.

Chevere

Build Code size Apache-2.0 PHPStan

Quality Gate Status Maintainability Rating Reliability Rating Security Rating Coverage Technical Debt CodeFactor Codacy Badge

ThrowableHandler

Quick start

Install ThrowableHandler using Composer.

composer require chevere/throwable-handler

Register ThrowableHandler to handle all errors.

use Chevere\ThrowableHandler\ThrowableHandler;

set_error_handler(ThrowableHandler::ERROR_AS_EXCEPTION);
register_shutdown_function(ThrowableHandler::SHUTDOWN_ERROR_AS_EXCEPTION);

Register your exception handler, you can choose:

  • ThrowableHandler::PLAIN
  • ThrowableHandler::CONSOLE
  • ThrowableHandler::HTML
use Chevere\ThrowableHandler\ThrowableHandler;

set_exception_handler(ThrowableHandler::PLAIN);

Demo

HTML demo

Documentation

Documentation is available at chevere.org.

License

Copyright 2022 Rodolfo Berrios A.

Chevere is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.