-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
67 additions
and
2 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
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,40 @@ | ||
<?php | ||
|
||
/** | ||
* @see https://github.com/laminas/laminas-modulemanager for the canonical source repository | ||
* @copyright https://github.com/laminas/laminas-modulemanager/blob/master/COPYRIGHT.md | ||
* @license https://github.com/laminas/laminas-modulemanager/blob/master/LICENSE.md New BSD License | ||
*/ | ||
|
||
namespace Laminas\ModuleManager\Listener\Exception; | ||
|
||
use Brick\VarExporter\ExportException; | ||
use RuntimeException; | ||
use Throwable; | ||
|
||
use function sprintf; | ||
|
||
final class ConfigCannotBeCachedException extends RuntimeException | ||
{ | ||
private function __construct($message = "", $code = 0, ?Throwable $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
} | ||
|
||
/** | ||
* @internal | ||
* | ||
* @return self | ||
*/ | ||
public static function fromExporterException(ExportException $exportException): self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Cannot export config into a cache file. Config contains uncacheable entries: %s', | ||
$exportException->getMessage() | ||
), | ||
$exportException->getCode(), | ||
$exportException | ||
); | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
/** | ||
* @see https://github.com/laminas/laminas-modulemanager for the canonical source repository | ||
* @copyright https://github.com/laminas/laminas-modulemanager/blob/master/COPYRIGHT.md | ||
* @license https://github.com/laminas/laminas-modulemanager/blob/master/LICENSE.md New BSD License | ||
*/ | ||
|
||
return [ | ||
'toUpper' => function ($input) { | ||
return strtoupper($input); | ||
}, | ||
]; |