2017 © Pedro Peláez
 

library common-exceptions

A PHP library providing common exception classes used by different projects.

image

markenwerk/common-exceptions

A PHP library providing common exception classes used by different projects.

  • Monday, July 18, 2016
  • by bonscho
  • Repository
  • 1 Watchers
  • 2 Stars
  • 2,507 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 13 Versions
  • 13 % Grown

The README.md

PHP Common Exceptions

SensioLabs Insight Code Climate Latest Stable Version Total Downloads License, (*1)

A PHP library providing common exception classes used by different projects., (*2)

Installation

```{json} { "require": { "chroma-x/common-exceptions": "~3.0" } }, (*3)


## Usage ### Autoloading and namesapce ```{php} require_once('path/to/vendor/autoload.php');

Handling exceptions

Catching by concrete class

```{php} try{ // Perform something maybe throwing an exception } catch (ChromaX\CommonException\NetworkException\ConnectionException $exception) { // API is not reachable } catch (ChromaX\CommonException\NetworkException\CurlException $exception) { // Curl failed } catch (ChromaX\CommonException\ApiException\InvalidResponseException $exception) { // API returns an unexpected result } catch (ChromaX\CommonException\ApiException\RequestQuotaException $exception) { // API requests over the allowed limit } catch (ChromaX\CommonException\ApiException\NoResultsException $exception) { // API request had no result } catch (ChromaX\CommonException\IoException\FileWriteException $exception) { // Log file was not writable }, (*4)


#### Catching by parent class ```{php} try{ // Perform something maybe throwing an exception } catch (ChromaX\CommonException\NetworkException\Base\NetworkException $exception) { // Any network exception was thrown } catch (ChromaX\CommonException\ApiException\Base\ApiException $exception) { // Any API exception was thrown } catch (ChromaX\CommonException\IoException\Base\IoException $exception) { // Any IO exception was thrown }

Catching by grand parent class

```{php} try{ // Perform something maybe throwing an exception } catch (ChromaX\CommonException\Base\BaseException $exception) { // Any exception was thrown }, (*5)

```, (*6)

Contribution

Contributing to our projects is always very appreciated.
But: please follow the contribution guidelines written down in the CONTRIBUTING.md document., (*7)

License

PHP Common Exceptions is under the MIT license., (*8)

The Versions

18/07 2016

dev-master

9999999-dev http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

15/07 2016

3.0.1

3.0.1.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

06/07 2016

3.0.0

3.0.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

02/05 2016

2.5.0

2.5.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

29/04 2016

2.4.0

2.4.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

26/04 2016

2.3

2.3.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

26/04 2016

2.3.1

2.3.1.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

26/04 2016

2.2

2.2.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

26/04 2016

2.1

2.1.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

26/04 2016

2.0

2.0.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

25/04 2016

1.2

1.2.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

25/04 2016

1.1

1.1.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions

25/04 2016

1.0

1.0.0.0 http://markenwerk.net/

A PHP library providing common exception classes used by different projects.

  Sources   Download

MIT

The Requires

  • php >=5.3

 

exceptions