2017 © Pedro Peláez
 

library tissue

Create Github issues from your Exceptions

image

bouiboui/tissue

Create Github issues from your Exceptions

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

tissue

Latest Version on Packagist ![License][ico-license] SensioLabsInsight, (*1)

Create Github issues from your catch {} blocks. I was heavily inspired by ohCrash., (*2)

When you call Tissue::create, a Github issue is created in the repo of your choice and a "bug" label is automatically applied. Duplicates are detected, to a certain extent., (*3)

The name comes from "Throw ISSUE" — genius, I know., (*4)

Install

``` bash $ composer require bouiboui/tissue, (*5)


Create a local ``config/config.yaml`` file from the template in [``config/config.yaml.dist``](https://github.com/bouiboui/tissue/blob/master/config/config.yaml.dist) ## Usage **The easy way: `bindUncaughtExceptionHandler`** ``` php // Not shown: include composer's autoload.php use bouiboui\Tissue\Tissue; // All uncaught exceptions will trigger the creation of a Github issue Tissue::bindUncaughtExceptionHandler();

The catch-block-specific way: createFromException ``` php // Not shown: include composer's autoload.php use bouiboui\Tissue\Tissue;, (*6)

try {, (*7)

throw new ErrorException('This is your issue title and message.');

} catch (\ErrorException $e) {, (*8)

// Only exceptions caught by this block will create Github issues
$result = Tissue::createFromException($e);

}, (*9)


**The "customized output" way: `create`** ``` php // Not shown: include composer's autoload.php use bouiboui\Tissue\Tissue; try { throw new ErrorException('This is your issue title and message.'); } catch (\ErrorException $e) { // Set any parameter to null if you don't want to display it in the issue $result = Tissue::create( $e->getMessage(), $e->getCode(), $e->getSeverity(), $e->getFile(), $e->getLine(), $e->getTraceAsString() ); var_dump($result); }

Creates the following issue:, (*10)

Something like this Something like this, (*11)

And outputs the following:, (*12)

php array(3) { ["duplicate"]=> bool(false) ["number"]=> int(35) ["url"]=> string(50) "https://api.github.com/repos/author/name/issues/35" }, (*13)

For security purposes, if your Github repository is public you should at the very least disable the trace parameter, unless you want strangers on the Internet to know the full path to the files on your server. You may also want to read this., (*14)

Credits

License

Unlicense. Public domain, basically. Please treat it kindly. See License File for more information., (*15)

This project uses the following open source projects - knplabs/github-api by KnpLabsLicense. - symfony/yaml by Fabien PotencierLicense. - phpunit/phpunit by Sebastian BergmannLicense., (*16)

The Versions

23/02 2016

dev-master

9999999-dev

Create Github issues from your Exceptions

  Sources   Download

Unlicense

The Requires

 

The Development Requires

exception github error issue

23/02 2016

v0.0.3

0.0.3.0

Create Github issues from your Exceptions

  Sources   Download

Unlicense

The Requires

 

The Development Requires

exception github error issue

21/02 2016

v0.0.2

0.0.2.0

Create Github issues from your Exceptions

  Sources   Download

Unlicense

The Requires

 

The Development Requires

exception github error issue

21/02 2016

v0.0.1

0.0.1.0

Create Github issues from your Exceptions

  Sources   Download

Unlicense

The Requires

 

The Development Requires

exception github error issue