Skip to content

Commit

Permalink
Converted consts to protected PascalCase
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Wright <[email protected]>
  • Loading branch information
betterthanclay committed Aug 21, 2024
1 parent ca60edc commit 7e427ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Converted consts to protected PascalCase

## v0.4.5 (2024-03-34)
* Use Wellspring for the Autoloader
* Made PHP8.1 minimum version
Expand Down
15 changes: 7 additions & 8 deletions src/Exceptional/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use DecodeLabs\Coercion;
use DecodeLabs\Exceptional\Exception as ExceptionInterface;

use Exception as RootException;
use InvalidArgumentException;
use LogicException;
Expand All @@ -23,7 +22,7 @@
*/
class Factory
{
public const STANDARD = [
protected const Standard = [
'Logic' => [
'type' => 'LogicException'
],
Expand Down Expand Up @@ -137,7 +136,7 @@ class Factory
];


public const REWIND = 2;
protected const Rewind = 2;

/**
* @var array<Exception>
Expand All @@ -147,7 +146,7 @@ class Factory
protected ?string $message = null;

/**
* @var array<string, mixed>
* @var array<string,mixed>
*/
protected array $params = [];

Expand Down Expand Up @@ -270,8 +269,8 @@ protected function __construct(
0
);

$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, (int)($rewind + static::REWIND + 1));
$key = $rewind + static::REWIND;
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, (int)($rewind + static::Rewind + 1));
$key = $rewind + static::Rewind;
$lastTrace = $trace[$key - 1];

$this->params['file'] = $file ?? $params['file'] ?? $lastTrace['file'] ?? null;
Expand Down Expand Up @@ -575,7 +574,7 @@ protected function indexInterface(


// Package
if (isset(static::STANDARD[$name])) {
if (isset(static::Standard[$name])) {
$this->indexPackageInterface($name);

// Interface
Expand Down Expand Up @@ -649,7 +648,7 @@ interface_exists($interface)
protected function indexPackageInterface(
string $name
): void {
$standard = static::STANDARD[$name];
$standard = static::Standard[$name];
$prefix = '\\DecodeLabs\\Exceptional\\';
$interface = $prefix . $name . 'Exception';

Expand Down

0 comments on commit 7e427ab

Please sign in to comment.