Skip to content
Snippets Groups Projects
Commit da5b78f7 authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Fix phpdoc comments for SimpleSAML_Error_Exception.

parent f1a4a2f0
No related branches found
No related tags found
No related merge requests found
<?php <?php
/** /**
* Baseclass for simpleSAML Exceptions * Base class for SimpleSAMLphp Exceptions
* *
* This class tries to make sure that every exception is serializable. * This class tries to make sure that every exception is serializable.
* *
* @author Thomas Graff <thomas.graff@uninett.no> * @author Thomas Graff <thomas.graff@uninett.no>
* @package simpleSAMLphp_base * @package SimpleSAMLphp
*/ */
class SimpleSAML_Error_Exception extends Exception { class SimpleSAML_Error_Exception extends Exception {
...@@ -32,12 +32,12 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -32,12 +32,12 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Constructor for this error. * Constructor for this error.
* *
* Note that the cause will be converted to a SimpleSAML_Error_UnserializableException * Note that the cause will be converted to a SimpleSAML_Error_UnserializableException unless it is a subclass of
* unless it is a subclass of SimpleSAML_Error_Exception. * SimpleSAML_Error_Exception.
* *
* @param string $message Exception message * @param string $message Exception message
* @param int $code Error code * @param int $code Error code
* @param Exception|NULL $cause The cause of this exception. * @param Exception|null $cause The cause of this exception.
*/ */
public function __construct($message, $code = 0, Exception $cause = NULL) { public function __construct($message, $code = 0, Exception $cause = NULL) {
assert('is_string($message)'); assert('is_string($message)');
...@@ -56,8 +56,8 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -56,8 +56,8 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Convert any exception into a SimpleSAML_Error_Exception. * Convert any exception into a SimpleSAML_Error_Exception.
* *
* @param Exception $e The exception. * @param Exception $e The exception.
* @return SimpleSAML_Error_Exception The new exception. * @return SimpleSAML_Error_Exception The new exception.
*/ */
public static function fromException(Exception $e) { public static function fromException(Exception $e) {
...@@ -71,7 +71,7 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -71,7 +71,7 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Load the backtrace from the given exception. * Load the backtrace from the given exception.
* *
* @param Exception $exception The exception we should fetch the backtrace from. * @param Exception $exception The exception we should fetch the backtrace from.
*/ */
protected function initBacktrace(Exception $exception) { protected function initBacktrace(Exception $exception) {
...@@ -103,7 +103,7 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -103,7 +103,7 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Retrieve the backtrace. * Retrieve the backtrace.
* *
* @return array An array where each function call is a single item. * @return array An array where each function call is a single item.
*/ */
public function getBacktrace() { public function getBacktrace() {
return $this->backtrace; return $this->backtrace;
...@@ -113,7 +113,7 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -113,7 +113,7 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Retrieve the cause of this exception. * Retrieve the cause of this exception.
* *
* @return SimpleSAML_Error_Exception|NULL The cause of this exception. * @return SimpleSAML_Error_Exception|null The cause of this exception.
*/ */
public function getCause() { public function getCause() {
return $this->cause; return $this->cause;
...@@ -123,7 +123,7 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -123,7 +123,7 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Retrieve the class of this exception. * Retrieve the class of this exception.
* *
* @return string The classname. * @return string The name of the class.
*/ */
public function getClass() { public function getClass() {
return get_class($this); return get_class($this);
...@@ -133,9 +133,9 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -133,9 +133,9 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Format this exception for logging. * Format this exception for logging.
* *
* Create an array with lines for logging. * Create an array of lines for logging.
* *
* @return array Log lines which should be written out. * @return array Log lines that should be written out.
*/ */
public function format() { public function format() {
...@@ -223,15 +223,13 @@ class SimpleSAML_Error_Exception extends Exception { ...@@ -223,15 +223,13 @@ class SimpleSAML_Error_Exception extends Exception {
/** /**
* Function for serialization. * Function for serialization.
* *
* This function builds a list of all variables which should be serialized. * This function builds a list of all variables which should be serialized. It will serialize all variables except
* It will serialize all variables except the Exception::trace variable. * the Exception::trace variable.
* *
* @return array Array with the variables which should be serialized. * @return array Array with the variables that should be serialized.
*/ */
public function __sleep() { public function __sleep() {
$ret = array();
$ret = array_keys((array)$this); $ret = array_keys((array)$this);
foreach ($ret as $i => $e) { foreach ($ret as $i => $e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment