Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pipeline {
stages {
stage('Install Composer Dependencies') {
steps {
sh 'rm -rf composer.lock vendor/'
sh 'rm -rf vendor/'
sh 'composer install'
}
}
Expand Down
10 changes: 9 additions & 1 deletion Swat/SwatError.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* trace parameters. See the class-level documentation of SwatException for
* details on how this works.
*
* @copyright 2006-2016 silverorange
* @copyright 2006-2025 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*/
class SwatError
Expand Down Expand Up @@ -80,6 +80,14 @@ class SwatError
*/
protected static $fatal_severity = E_USER_ERROR;

/**
* Clears all the configured SwatError loggers.
*/
public static function clearLoggers()
{
self::$loggers = [];
}

/**
* Sets the object that logs SwatError objects when they are processed.
*
Expand Down
19 changes: 19 additions & 0 deletions Swat/SwatNullErrorLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* An implementation of SwatErrorLogger that does not log anywhere.
*
* This logger can be used to avoid conditional statements in your code.
*
* @copyright 2025 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @see SwatErrorLogger
*/
class SwatNullErrorLogger extends SwatErrorLogger
{
/**
* {@inheritDoc}
*/
public function log(SwatError $e) {}
}
19 changes: 19 additions & 0 deletions Swat/SwatNullExceptionLogger.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* An implementation of SwatExceptionLogger that does not log anywhere.
*
* This logger can be used to avoid conditional statements in your code.
*
* @copyright 2025 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @see SwatExceptionLogger
*/
class SwatNullExceptionLogger extends SwatExceptionLogger
{
/**
* {@inheritDoc}
*/
public function log(SwatException $e) {}
}
10 changes: 9 additions & 1 deletion Swat/exceptions/SwatException.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* only filter one parameter. Use multiple <i>@sensitive</i> documentation tags
* to filter multiple parameters in a single method.
*
* @copyright 2004-2016 silverorange
* @copyright 2004-2025 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*/
class SwatException extends Exception
Expand All @@ -57,6 +57,14 @@ class SwatException extends Exception
*/
private $handled = false;

/**
* Clears all the configured SwatException loggers.
*/
public static function clearLoggers()
{
self::$loggers = [];
}

/**
* Sets the object that logs SwatException objects when they are processed.
*
Expand Down
Loading
Loading