-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged some minor improvements from horstoeko/zugferd
- Loading branch information
HorstOeko
committed
Oct 13, 2024
1 parent
64245e9
commit e427371
Showing
5 changed files
with
180 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
/** | ||
* This file is a part of horstoeko/orderx. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace horstoeko\orderx\exception; | ||
|
||
use Throwable; | ||
|
||
/** | ||
* Class representing an exception for non-readable a file | ||
* | ||
* @category Order-X | ||
* @package Order-X | ||
* @author D. Erling <horstoeko@erling.com.de> | ||
* @license https://opensource.org/licenses/MIT MIT | ||
* @link https://github.com/horstoeko/orderx | ||
*/ | ||
class OrderFileNotReadableException extends Exception | ||
{ | ||
/** | ||
* The context of the type element | ||
* | ||
* @var string | ||
*/ | ||
private $filePath = ""; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param string $filePath | ||
*/ | ||
public function __construct(string $filePath) | ||
{ | ||
$this->filePath = $filePath; | ||
|
||
parent::__construct($this->buildMessage()); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function __toString() | ||
{ | ||
return __CLASS__ . ": [{$this->code}]: {$this->message}\n"; | ||
} | ||
|
||
/** | ||
* Build the message | ||
* | ||
* @return string | ||
*/ | ||
private function buildMessage(): string | ||
{ | ||
return sprintf("The filer %s is not readable", $this->filePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters