Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ phpunit.xml.dist export-ignore
.travis.yml export-ignore
.codeclimate.yml export-ignore
.styleci.yml export-ignore

# Ignore Github files
CODE_OF_CONDUCT.md export-ignore
CONTRIBUTING.md export-ignore
ISSUE_TEMPLATE.md export-ignore
PULL_REQUEST_TEMPLATE.md export-ignore
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ language: php
matrix:
fast_finish: true
include:
- php: 7.0
- php: 7.1
env:
- EXECUTE_COVERAGE=true
- php: 7.1
- php: 7.2
- php: 7.3

notifications:
email: false
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ $ phpunit
* [PSR-1: Basic Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
* [PSR-2: Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
* [PSR-4: Autoloading Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md)
* [PSR-5: PHPDoc (draft)](https://github.com/phpDocumentor/fig-standards/blob/master/proposed/phpdoc.md)
* Keep the order of class elements: static properties, instance properties, constructor (or setUp for PHPUnit), destructor (or tearDown for PHPUnit), static methods, instance methods, magic static methods, magic instance methods.


Expand Down
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ because often the message and the code are not enough to debug.
Using [Composer](https://getcomposer.org):

```bash
composer require z-ee/exceptions
composer require zeeproject/exceptions
```

## Usage
Expand All @@ -29,27 +29,18 @@ throw new InvalidArgumentException('Something went wrong', [
]);
~~~

Now you can handle this exception, i.q. your error handler may log error details:
Now you can handle this exception, e.q. your error handler may log error details:

~~~php
class ErrorHandler
final class ErrorHandler
{
/**
* @var LoggerInterface
*/
private $logger;

/**
* @param LoggerInterface $logger
*/
public function __construct(LoggerInterface $logger)
public function __construct(Psr\Log\LoggerInterface $logger)
{
$this->logger = $logger;
}

/**
* @param Exception $exception
*/
public function handleException(Exception $exception)
{
if ($exception instanceof Zee\Exceptions\Throwable) {
Expand All @@ -64,11 +55,6 @@ class ErrorHandler
## Testing

```bash
# install required files
composer self-update
composer install

# run the test (from project root)
phpunit
```

Expand All @@ -83,15 +69,15 @@ Contributions are welcome and will be fully credited. Please see [CONTRIBUTING](

## License

The BSD 2-Clause License. Please see [LICENSE][link-license] for more information.
It's [BSD 2-Clause][link-license].

[ico-version]: https://img.shields.io/packagist/v/z-ee/exceptions.svg?style=flat-square
[ico-version]: https://img.shields.io/packagist/v/zeeproject/exceptions.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/License-BSD%202--Clause-blue.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/zee/exceptions/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/zee/exceptions.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/zee/exceptions.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/z-ee/exceptions
[link-packagist]: https://packagist.org/packages/zeeproject/exceptions
[link-license]: LICENSE
[link-travis]: https://travis-ci.org/zee/exceptions
[link-scrutinizer]: https://scrutinizer-ci.com/g/zee/exceptions/code-structure
Expand Down
2 changes: 0 additions & 2 deletions build/.gitignore

This file was deleted.

9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "z-ee/exceptions",
"name": "zeeproject/exceptions",
"description": "Set of the base exceptions",
"license": "BSD-2-Clause",
"keywords": [
Expand All @@ -13,12 +13,11 @@
}
],
"require": {
"php": "^7.0",
"ext-json": "*"
"php": "^7.1"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"scrutinizer/ocular": "~1.1"
"phpunit/phpunit": "^7.5",
"scrutinizer/ocular": "~1.5"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.4/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
failOnRisky="true"
Expand All @@ -24,7 +24,6 @@

<php>
<ini name="error_reporting" value="-1" />

<const name="PHPUNIT_TESTSUITE" value="true"/>
</php>
</phpunit>
14 changes: 2 additions & 12 deletions src/BadFunctionCallException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use BadFunctionCallException as BaseException;

/**
* Class BadFunctionCallException.
*/
class BadFunctionCallException extends BaseException implements Throwable
class BadFunctionCallException extends \BadFunctionCallException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/BadMethodCallException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use BadMethodCallException as BaseException;

/**
* Class BadMethodCallException.
*/
class BadMethodCallException extends BaseException implements Throwable
class BadMethodCallException extends \BadMethodCallException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/DomainException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use DomainException as BaseException;

/**
* Class DomainException.
*/
class DomainException extends BaseException implements Throwable
class DomainException extends \DomainException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/InvalidArgumentException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use InvalidArgumentException as BaseException;

/**
* Class InvalidArgumentException.
*/
class InvalidArgumentException extends BaseException implements Throwable
class InvalidArgumentException extends \InvalidArgumentException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/LengthException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use LengthException as BaseException;

/**
* Class LengthException.
*/
class LengthException extends BaseException implements Throwable
class LengthException extends \LengthException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/LogicException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use LogicException as BaseException;

/**
* Class LogicException.
*/
class LogicException extends BaseException implements Throwable
class LogicException extends \LogicException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/OutOfBoundsException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use OutOfBoundsException as BaseException;

/**
* Class OutOfBoundsException.
*/
class OutOfBoundsException extends BaseException implements Throwable
class OutOfBoundsException extends \OutOfBoundsException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/OutOfRangeException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use OutOfRangeException as BaseException;

/**
* Class OutOfRangeException.
*/
class OutOfRangeException extends BaseException implements Throwable
class OutOfRangeException extends \OutOfRangeException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/OverflowException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use OverflowException as BaseException;

/**
* Class OverflowException.
*/
class OverflowException extends BaseException implements Throwable
class OverflowException extends \OverflowException implements Throwable
{
use ThrowableContextTrait;
}
14 changes: 2 additions & 12 deletions src/RangeException.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
<?php
/**
* This file is part of Zee Project.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @see https://github.com/zee/
* {@see https://github.com/zee/ Zee Project (c)}
*/

namespace Zee\Exceptions;

use RangeException as BaseException;

/**
* Class RangeException.
*/
class RangeException extends BaseException implements Throwable
class RangeException extends \RangeException implements Throwable
{
use ThrowableContextTrait;
}
Loading