PHP Classes

Nero PHP Simulate Error: Throw fatal errors to test your application

Recommend this page to a friend!
  Info   View files Documentation   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 103 This week: 1All time: 9,738 This week: 571Up
Version License PHP version Categories
nero 1.0.0The PHP License5PHP 5, Debug, Testing
Description 

Author

This package can throw fatal errors to test your application.

It can simulate several types of errors and exceptions as if they were caused by code that has real issues.

Currently it can simulate PHP syntax error and class not found exceptions.

Innovation Award
PHP Programming Innovation award nominee
May 2018
Number 4
One way to verify whether applications are robust is to create tests to verify if they can handle cases that can happen in real world situations.

This package can simulate errors that may happen although they are never desired, like for instance code that has syntax errors or attempts to load missing classes.

Using this package you can avoid to ship to a production environment code that has serious errors that may cause embarrassment even to qualified developers.

Manuel Lemos
Picture of DeGraciaMathieu
  Performance   Level  
Name: DeGraciaMathieu <contact>
Classes: 16 packages by
Country: France France
Age: ???
All time rank: 297081 in France France
Week rank: 420 Up14 in France France Up
Innovation award
Innovation award
Nominee: 11x

Winner: 1x

Documentation

<p align="center"> <img src="https://i62.servimg.com/u/f62/11/13/61/32/nero-010.png" width="250"> </p> <p align="center"> <a class="badge-align" href="https://www.codacy.com/app/DeGraciaMathieu/Nero?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=DeGraciaMathieu/Nero&amp;utm_campaign=Badge_Grade"><img src="https://api.codacy.com/project/badge/Grade/d79b8fc9f4bb44b48af1faf0881d4e73"/></a> <a href="https://scrutinizer-ci.com/g/degraciamathieu/nero/?branch=master"><img src="https://scrutinizer-ci.com/g/DeGraciaMathieu/Nero/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"></a> <a href="https://packagist.org/packages/degraciamathieu/nero"><img src="https://img.shields.io/packagist/v/degraciamathieu/nero.svg?style=flat-square" alt="Latest Version on Packagist"></a> <a href='https://packagist.org/packages/degraciamathieu/nero'><img src='https://img.shields.io/packagist/dt/degraciamathieu/nero.svg?style=flat-square' /></a> </p>

DeGraciaMathieu/Nero

This package allows you to simulate a fatal error in your PHP application

Installation

Run in console below command to download package to your project:

composer require degraciamathieu/nero

How use

There are two possibilities : `Breaker::syntaxError()` and `Breaker::classNotFound()`.

You can pass to these methods several criteria: a file, a specific line and a parameter.

require 'vendor\autoload.php';

use \DeGraciaMathieu\Nero\Breaker;

Breaker::syntaxError($file = null, $line = null, $parameter = null);

By default the method will automatically complete all these criteria.

Basic usage

require 'vendor\autoload.php';

use \DeGraciaMathieu\Nero\Breaker;

Breaker::syntaxError();

Demo

require 'vendor\autoload.php';

use \DeGraciaMathieu\Nero\Breaker;

Breaker::classNotFound();

Demo

Usage with parameters

require 'vendor\autoload.php';

use \DeGraciaMathieu\Nero\Breaker;

Breaker::syntaxError('Website\routes\web.php', 120, ';');

Demo

require 'vendor\autoload.php';

use \DeGraciaMathieu\Nero\Breaker;

Breaker::classNotFound('Website\routes\web.php', 30, 'MySpecificClass');

Demo


  Files folder image Files  
File Role Description
Files folder imagesrc (3 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Breaker.php Class Class source
  Plain text file Errors.php Class Class source
  Plain text file Executor.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:103
This week:1
All time:9,738
This week:571Up