This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes #66 * rename and added some classes * added displayer | changed make to create * Added config trait | added uuid | added tests | refator handler * update to http-status v2 * added test for ExceptionInfo * fixed contract and class * adding handler tests * remove shouldReport * Added more tests * Scrutinizer Auto-Fixes (#295) This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com * added more tests * Added filter * Scrutinizer Auto-Fixes (#296) This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com * added more test | add CommandLineTransformer * rename test to tests * Scrutinizer Auto-Fixes (#297) This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com * update tests * added more tests * update phpdoc | changed classes
- Loading branch information
Showing
86 changed files
with
2,450 additions
and
1,186 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
namespace Viserio\Config\Test; | ||
namespace Viserio\Config\Tests; | ||
|
||
use Viserio\Config\Repository; | ||
|
||
|
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,18 @@ | ||
<?php | ||
namespace Viserio\Config\Tests\Traits; | ||
|
||
use Viserio\Config\Manager as ConfigManager; | ||
use Viserio\Config\Repository; | ||
use Viserio\Config\Traits\ConfigAwareTrait; | ||
|
||
class ConfigAwareTraitTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
use ConfigAwareTrait; | ||
|
||
public function testSetAndGetConfig() | ||
{ | ||
$this->setConfig(new ConfigManager(new Repository())); | ||
|
||
$this->assertInstanceOf(ConfigManager::class, $this->getConfig()); | ||
} | ||
} |
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,45 @@ | ||
<?php | ||
namespace Viserio\Config\Traits; | ||
|
||
use RuntimeException; | ||
use Viserio\Contracts\Config\Manager as ConfigManagerContract; | ||
|
||
trait ConfigAwareTrait | ||
{ | ||
/** | ||
* The config instance. | ||
* | ||
* @var \Viserio\Contracts\Config\Manager | ||
*/ | ||
protected $config; | ||
|
||
/** | ||
* Set a config instance. | ||
* | ||
* @param \Viserio\Contracts\Config\Manager $config | ||
* | ||
* @return self | ||
*/ | ||
public function setConfig(ConfigManagerContract $config): self | ||
{ | ||
$this->config = $config; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get the config. | ||
* | ||
* @throws \RuntimeException | ||
* | ||
* @return \Viserio\Contracts\Config\Manager | ||
*/ | ||
public function getConfig(): ConfigManagerContract | ||
{ | ||
if (! $this->config) { | ||
throw new RuntimeException('Config is not set up.'); | ||
} | ||
|
||
return $this->config; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
namespace Viserio\Container\Test; | ||
namespace Viserio\Container\Tests; | ||
|
||
use Viserio\Container\Container; | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
namespace Viserio\Container\Test; | ||
namespace Viserio\Container\Tests; | ||
|
||
use Viserio\Container\Container; | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,45 @@ | ||
<?php | ||
namespace Viserio\Contracts\Exception; | ||
|
||
use Psr\Http\Message\ResponseInterface; | ||
use Throwable; | ||
|
||
interface Displayer | ||
{ | ||
/** | ||
* Display the given exception. | ||
* | ||
* @param \Throwable $exception | ||
* @param string $id | ||
* @param int $code | ||
* @param string[] $headers | ||
* | ||
* @return \Psr\Http\Message\ResponseInterface | ||
*/ | ||
public function display(Throwable $exception, string $id, int $code, array $headers): ResponseInterface; | ||
|
||
/** | ||
* Get the supported content type. | ||
* | ||
* @return string | ||
*/ | ||
public function contentType(): string; | ||
|
||
/** | ||
* Can we display the exception? | ||
* | ||
* @param \Throwable $original | ||
* @param \Throwable $transformed | ||
* @param int $code | ||
* | ||
* @return bool | ||
*/ | ||
public function canDisplay(Throwable $original, Throwable $transformed, int $code): bool; | ||
|
||
/** | ||
* Do we provide verbose information about the exception? | ||
* | ||
* @return bool | ||
*/ | ||
public function isVerbose(): bool; | ||
} |
Oops, something went wrong.