Skip to content

Commit

Permalink
Merge branch 'release/v0.4.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
betterthanclay committed Aug 21, 2024
2 parents 2583222 + 59e5487 commit ec63381
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ phpstan.neon export-ignore
phpunit.xml.dist export-ignore
docs/ export-ignore
tests/ export-ignore
stubs/ export-ignore
12 changes: 6 additions & 6 deletions .github/workflows/integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ jobs:
ini-values: "post_max_size=256M"

- name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: Install Effigy
run: |
composer global config --no-plugins allow-plugins.phpstan/extension-installer true
composer global require decodelabs/effigy
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
ini-values: "post_max_size=256M"

- name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: Install Effigy
run: |
Expand All @@ -83,7 +83,7 @@ jobs:
run: "composer validate --strict"

- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

Expand All @@ -106,7 +106,7 @@ jobs:
ini-values: "post_max_size=256M"

- name: "Checkout code"
uses: "actions/checkout@v3"
uses: "actions/checkout@v4"

- name: "Check EditorConfig configuration"
run: "test -f .editorconfig"
Expand All @@ -120,7 +120,7 @@ jobs:
composer global require decodelabs/effigy
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "highest"

Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## v0.4.5 (2024-03-34)
## v0.4.6 (2024-08-21)
* Converted consts to protected PascalCase

## v0.4.5 (2024-03-24)
* Use Wellspring for the Autoloader
* Made PHP8.1 minimum version

Expand Down
13 changes: 8 additions & 5 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([__DIR__ . '/src']);
$ecsConfig->sets([SetList::CLEAN_CODE, SetList::PSR_12]);
};
return ECSConfig::configure()
->withPaths([
__DIR__ . '/src'
])
->withPreparedSets(
cleanCode: true,
psr12: true
);
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 ec63381

Please sign in to comment.