Skip to content

Commit

Permalink
All exceptions inherit RuntimeException
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Nov 18, 2018
1 parent aa052ae commit 2ef840f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 31 deletions.
23 changes: 0 additions & 23 deletions src/Exception/Exception.php

This file was deleted.

7 changes: 6 additions & 1 deletion src/Exception/UnableToCreateTransliteratorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@

namespace Sunrise\Slugger\Exception;

/**
* Import classes
*/
use RuntimeException;

/**
* UnableToCreateTransliteratorException
*/
class UnableToCreateTransliteratorException extends Exception
class UnableToCreateTransliteratorException extends RuntimeException
{}
7 changes: 6 additions & 1 deletion src/Exception/UnableToTransliterateException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@

namespace Sunrise\Slugger\Exception;

/**
* Import classes
*/
use RuntimeException;

/**
* UnableToTransliterateException
*/
class UnableToTransliterateException extends Exception
class UnableToTransliterateException extends RuntimeException
{}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@

namespace Sunrise\Slugger\Exception;

/**
* Import classes
*/
use RuntimeException;

/**
* UnsupportedTransliteratorIdentifierException
*/
class UnsupportedTransliteratorIdentifierException extends Exception
class UnsupportedTransliteratorIdentifierException extends RuntimeException
{}
8 changes: 3 additions & 5 deletions tests/SluggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Sunrise\Slugger\Tests;

use PHPUnit\Framework\TestCase;
use Sunrise\Slugger\Exception\Exception;
use Sunrise\Slugger\Exception\UnableToCreateTransliteratorException;
use Sunrise\Slugger\Exception\UnableToTransliterateException;
use Sunrise\Slugger\Exception\UnsupportedTransliteratorIdentifierException;
Expand Down Expand Up @@ -137,9 +136,8 @@ public function testTransliterateWithInvalidCompound()

public function testExceptions()
{
$this->assertInstanceOf(\RuntimeException::class, new Exception(''));
$this->assertInstanceOf(Exception::class, new UnableToCreateTransliteratorException(''));
$this->assertInstanceOf(Exception::class, new UnableToTransliterateException(''));
$this->assertInstanceOf(Exception::class, new UnsupportedTransliteratorIdentifierException(''));
$this->assertInstanceOf(\RuntimeException::class, new UnableToCreateTransliteratorException(''));
$this->assertInstanceOf(\RuntimeException::class, new UnableToTransliterateException(''));
$this->assertInstanceOf(\RuntimeException::class, new UnsupportedTransliteratorIdentifierException(''));
}
}

0 comments on commit 2ef840f

Please sign in to comment.