Compare commits

...

12 Commits

6 changed files with 67 additions and 8 deletions

8
.gitignore vendored
View File

@@ -1,8 +1,4 @@
# ---> Composer
composer.lock
composer.phar
/nbproject/
/vendor/
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2025 Potter
Copyright (c) 2025 Jay Potter
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including

21
composer.json Normal file
View File

@@ -0,0 +1,21 @@
{
"name": "potter/throwable",
"type": "library",
"require": {
"php": "^8.4",
"potter/stringable": "dev-main"
},
"license": "MIT",
"autoload": {
"psr-4": {
"Potter\\Throwable\\": "src/Potter/Throwable/"
}
},
"authors": [
{
"name": "Jay Potter",
"email": "j@ypotter.ca"
}
],
"minimum-stability": "dev"
}

View File

@@ -0,0 +1,13 @@
<?php
declare(strict_types=1);
namespace Potter\Throwable;
use \Throwable as BaseThrowable;
use \Exception;
abstract class AbstractThrowable extends Exception implements ThrowableInterface
{
}

View File

@@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace Potter\Throwable;
abstract class Throwable extends AbstractThrowable
{
}

View File

@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace Potter\Throwable;
use \Throwable as BaseThrowable;
use \Potter\Stringable\StringableInterface;
interface ThrowableInterface extends StringableInterface
{
public function getMessage(): string;
public function getCode();
public function getFile(): string;
public function getLine(): int;
public function getTrace(): array;
public function getTraceAsString(): string;
public function getPrevious(): ?BaseThrowable;
}