Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Move LoggerHelper exeptions to Tracy namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrtak-CZ committed Jan 3, 2016
1 parent 4c0e9f3 commit 4cb461a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* please view the file LICENSE.md that was distributed with this source code.
*/

namespace Nella\MonologTracy;
namespace Nella\MonologTracy\Tracy;

class InvalidLogDirectoryException extends \LogicException implements \Nella\MonologTracy\Exception
class InvalidLogDirectoryException extends \LogicException implements \Nella\MonologTracy\Tracy\Exception
{

/** @var string */
Expand Down
12 changes: 6 additions & 6 deletions src/Tracy/LoggerHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct($directory, BlueScreen $blueScreen)
{
$logDirectoryRealPath = realpath($directory);
if ($logDirectoryRealPath === FALSE || !is_dir($directory)) {
throw new \Nella\MonologTracy\InvalidLogDirectoryException(sprintf(
throw new \Nella\MonologTracy\Tracy\InvalidLogDirectoryException(sprintf(
'Tracy log directory "%s" not found or is not a directory.',
$directory
));
Expand Down Expand Up @@ -71,7 +71,7 @@ public function getExceptionFile($exception, DateTimeInterface $datetime = NULL)
*/
public function log($message, $priority = self::INFO)
{
throw new \Nella\MonologTracy\NotSupportedException('LoggerHelper::log is not supported.');
throw new \Nella\MonologTracy\Tracy\NotSupportedException('LoggerHelper::log is not supported.');
}

/**
Expand All @@ -81,7 +81,7 @@ public function log($message, $priority = self::INFO)
*/
protected function formatMessage($message)
{
throw new \Nella\MonologTracy\NotSupportedException('LoggerHelper::formatMessage is not supported.');
throw new \Nella\MonologTracy\Tracy\NotSupportedException('LoggerHelper::formatMessage is not supported.');
}

/**
Expand All @@ -92,7 +92,7 @@ protected function formatMessage($message)
*/
protected function formatLogLine($message, $exceptionFile = NULL)
{
throw new \Nella\MonologTracy\NotSupportedException('LoggerHelper::formatLogLine is not supported.');
throw new \Nella\MonologTracy\Tracy\NotSupportedException('LoggerHelper::formatLogLine is not supported.');
}

/**
Expand All @@ -102,7 +102,7 @@ protected function formatLogLine($message, $exceptionFile = NULL)
*/
protected function sendEmail($message)
{
throw new \Nella\MonologTracy\NotSupportedException('LoggerHelper::sendEmail is not supported.');
throw new \Nella\MonologTracy\Tracy\NotSupportedException('LoggerHelper::sendEmail is not supported.');
}

/**
Expand All @@ -112,7 +112,7 @@ protected function sendEmail($message)
*/
public function defaultMailer($message, $email)
{
throw new \Nella\MonologTracy\NotSupportedException('LoggerHelper::defaultMailer is not supported.');
throw new \Nella\MonologTracy\Tracy\NotSupportedException('LoggerHelper::defaultMailer is not supported.');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* please view the file LICENSE.md that was distributed with this source code.
*/

namespace Nella\MonologTracy;
namespace Nella\MonologTracy\Tracy;

class NotSupportedException extends \LogicException implements \Nella\MonologTracy\Exception
class NotSupportedException extends \LogicException implements \Nella\MonologTracy\Tracy\Exception
{

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Tracy/LoggerHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ public function testRenderToFile()
}

/**
* @expectedException \Nella\MonologTracy\NotSupportedException
* @expectedException \Nella\MonologTracy\Tracy\NotSupportedException
*/
public function testLog()
{
$this->loggerHelper->log('Test');
}

/**
* @expectedException \Nella\MonologTracy\NotSupportedException
* @expectedException \Nella\MonologTracy\Tracy\NotSupportedException
*/
public function testDefaultMailer()
{
$this->loggerHelper->defaultMailer('Test', 'email@example.com');
}

/**
* @expectedException \Nella\MonologTracy\InvalidLogDirectoryException
* @expectedException \Nella\MonologTracy\Tracy\InvalidLogDirectoryException
*/
public function testInvalidLogDirectory()
{
Expand Down

0 comments on commit 4cb461a

Please sign in to comment.