Skip to content

Commit

Permalink
Put debug functionality in its own packages
Browse files Browse the repository at this point in the history
squirrelphp/debug is now used for all exception and debug
functionality, so we do not need to replicate it for every
squirrel component.
  • Loading branch information
iquito committed Jul 10, 2019
1 parent 5ba4a90 commit 44f77e6
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 369 deletions.
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@
}
],
"require": {
"php": "^7.2"
"php": "^7.2",
"ext-mbstring": "*",
"squirrelphp/debug": "^0.5"
},
"require-dev": {
"ext-intl": "*",
"ext-mbstring": "*",
"captainhook/plugin-composer": "^4.0",
"diablomedia/phpunit-pretty-printer": "^4.0",
"mockery/mockery": "^1.0",
"phpstan/phpstan": "^0.11.5",
"phpunit/phpunit": "^8.0",
"slevomat/coding-standard": "^5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Common/InvalidValueExceptionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Squirrel\Strings\Common;

use Squirrel\Debug\Debug;
use Squirrel\Strings\Annotation\StringFilterExtension;
use Squirrel\Strings\Annotation\StringFilterProcessor;
use Squirrel\Strings\CondenseNumberInterface;
use Squirrel\Strings\Debug;
use Squirrel\Strings\Exception\InvalidValueException;
use Squirrel\Strings\RandomStringGeneratorInterface;
use Squirrel\Strings\RandomStringGeneratorSelectInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Common/RegexExceptionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Squirrel\Strings\Common;

use Squirrel\Debug\Debug;
use Squirrel\Strings\Annotation\StringFilterExtension;
use Squirrel\Strings\Annotation\StringFilterProcessor;
use Squirrel\Strings\CondenseNumberInterface;
use Squirrel\Strings\Debug;
use Squirrel\Strings\Exception\RegexException;
use Squirrel\Strings\RandomStringGeneratorInterface;
use Squirrel\Strings\RandomStringGeneratorSelectInterface;
Expand Down
170 changes: 0 additions & 170 deletions src/Debug.php

This file was deleted.

65 changes: 3 additions & 62 deletions src/Exception/StringException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,8 @@

namespace Squirrel\Strings\Exception;

class StringException extends \Exception
{
/**
* @var string Original call which lead to the exception
*/
private $originCall = '';

/**
* @var string File in which the problem originated
*/
private $originFile = '';

/**
* @var string Line on which the problem originated
*/
private $originLine = '';

/**
* @param string $originCall Original call which lead to the exception
* @param string $originFile File in which the problem originated
* @param string $originLine Line on which the problem originated
* @param string $message
* @param int $code
* @param \Throwable|null $previous
*/
public function __construct(
string $originCall,
string $originFile,
string $originLine,
$message = "",
$code = 0,
\Throwable $previous = null
) {
parent::__construct($message, $code, $previous);
use Squirrel\Debug\OriginException;

$this->originCall = $originCall;
$this->originFile = $originFile;
$this->originLine = $originLine;
}

/**
* @return string
*/
public function getOriginCall(): string
{
return $this->originCall;
}

/**
* @return string
*/
public function getOriginFile(): string
{
return $this->originFile;
}

/**
* @return string
*/
public function getOriginLine(): string
{
return $this->originLine;
}
class StringException extends OriginException
{
}
1 change: 1 addition & 0 deletions src/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Squirrel\Strings;

use Squirrel\Debug\Debug;
use Squirrel\Strings\Exception\UrlException;

class Url
Expand Down
105 changes: 0 additions & 105 deletions tests/DebugTest.php

This file was deleted.

Loading

0 comments on commit 44f77e6

Please sign in to comment.