Remove unused variable assignments
This commit is contained in:
parent
80fd164439
commit
ac9b12618d
|
@ -107,9 +107,8 @@ final class MDErrorReporter {
|
||||||
$msg .= \sprintf("%-{$longestKey}s :: %s", $key, (string)$value) . PHP_EOL;
|
$msg .= \sprintf("%-{$longestKey}s :: %s", $key, (string)$value) . PHP_EOL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$msg .= PHP_EOL;
|
|
||||||
|
|
||||||
return $msg;
|
return $msg . PHP_EOL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,15 +119,13 @@ final class MDErrorReporter {
|
||||||
*/
|
*/
|
||||||
public function getAdditionalDebuggingInfo():array {
|
public function getAdditionalDebuggingInfo():array {
|
||||||
|
|
||||||
$output = [
|
return [
|
||||||
"Current memory usage" => $this->human_filesize(\memory_get_usage()),
|
"Current memory usage" => $this->human_filesize(\memory_get_usage()),
|
||||||
"Peak memory usage" => $this->human_filesize(\memory_get_peak_usage()),
|
"Peak memory usage" => $this->human_filesize(\memory_get_peak_usage()),
|
||||||
"Included / required files" => \get_included_files(),
|
"Included / required files" => \get_included_files(),
|
||||||
# "Allowed memory usage" => $this->human_filesize((int)ini_get("memory_limit")),
|
# "Allowed memory usage" => $this->human_filesize((int)ini_get("memory_limit")),
|
||||||
];
|
];
|
||||||
|
|
||||||
return $output;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom exception class for invalid page parameters.
|
* Custom exception class to throw when users attempt to access a page without necessary permissions.
|
||||||
*/
|
*/
|
||||||
final class MDAccessDeniedException extends MDExpectedException {
|
final class MDAccessDeniedException extends MDExpectedException {
|
||||||
/**
|
/**
|
||||||
|
@ -12,8 +12,7 @@ final class MDAccessDeniedException extends MDExpectedException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
|
return 'Access denied: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ final class MDConfigCannotBeLoadedException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Could not connect to databse. Please try again later.';
|
return 'Could not connect to databse. Please try again later.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ class MDExpectedException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
|
return 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,7 @@ final class MDFileDoesNotExist extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'This file does not exist: ' . $this->getMessage();
|
return 'This file does not exist: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,7 @@ final class MDFileIsNotReadable extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'This file does not exist: ' . $this->getMessage();
|
return 'This file does not exist: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ final class MDInaccessiblePropertyException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Property is inaccessible';
|
return 'Property is inaccessible';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDInputTooLongException extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Input string is too long';
|
return 'Input string is too long';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ final class MDInvalidColorCode extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Input color code is invalid';
|
return 'Input color code is invalid';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDInvalidEmail extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Input URL is invalid';
|
return 'Input URL is invalid';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,7 @@ final class MDInvalidEmptyInputException extends MDgenericInvalidInputsException
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'A value needs to be provided: ' . $this->getMessage();
|
return 'A value needs to be provided: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDInvalidUrl extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Input URL is invalid';
|
return 'Input URL is invalid';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,7 @@ final class MDOutputBufferNotStarted extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Output buffer has not yet been started, is to be used: ' . $this->getMessage();
|
return 'Output buffer has not yet been started, is to be used: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ final class MDRequiredConfigNotSet extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Could not connect to databse. Please try again later.';
|
return 'Could not connect to databse. Please try again later.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDWrongCsrfTokenException extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Input URL is invalid';
|
return 'Input URL is invalid';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ class MDgenericInvalidInputsException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Inputs are not valid.';
|
return 'Inputs are not valid.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDhttpFailedException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Inputs are not valid.';
|
return 'Inputs are not valid.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDmainEntityNotExistentException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Could not connect to databse. Please try again later.';
|
return 'Could not connect to databse. Please try again later.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDpageParameterNotFromListException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Invalid parameter: <b>' . $this->getMessage() . '</b>.';
|
return 'Invalid parameter: <b>' . $this->getMessage() . '</b>.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDPageNotInAggregatedException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'There is no entity to be shown here (id: <b>' . $this->getMessage() . '</b>).';
|
return 'There is no entity to be shown here (id: <b>' . $this->getMessage() . '</b>).';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDmainEntityNotPublicException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'There is no entity to be shown here (id: <b>' . $this->getMessage() . '</b>).';
|
return 'There is no entity to be shown here (id: <b>' . $this->getMessage() . '</b>).';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ final class MDpageParameterMissingException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is required but missing.';
|
return 'Parameter: <b>' . $this->getMessage() . '</b> is required but missing.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ final class MDpageParameterNotNumericException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
|
return 'Parameter: <b>' . $this->getMessage() . '</b> is not a valid, numeric values.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,7 @@ final class MDDuplicateLinkException extends Exception {
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
|
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Duplicate link exception: ' . $this->getMessage() . '.';
|
return 'Duplicate link exception: ' . $this->getMessage() . '.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,7 @@ final class MDFileIsNotWritable extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'This file or directory cannot be written: ' . $this->getMessage();
|
return 'This file or directory cannot be written: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDFileUploadNotAcceptedException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = $this->getMessage();
|
return $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ final class MDInvalidCurrency extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'The following currency is not available: ' . $this->getMessage();
|
return 'The following currency is not available: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ final class MDInvalidInputDate extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'The following currency is not available: ' . $this->getMessage();
|
return 'The following currency is not available: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ final class MDInvalidLengthUnit extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'The following length unit is not available: ' . $this->getMessage();
|
return 'The following length unit is not available: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ final class MDInvalidLicense extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'The following license is not available: ' . $this->getMessage();
|
return 'The following license is not available: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ final class MDInvalidObjectPublicationBackground extends MDgenericInvalidInputsE
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'The following object publication type is not available: ' . $this->getMessage();
|
return 'The following object publication type is not available: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ final class MDInvalidWeightUnit extends MDgenericInvalidInputsException {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'The following weight unit is not available: ' . $this->getMessage();
|
return 'The following weight unit is not available: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDNoUpdateVarSetException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'No update variable has been set.';
|
return 'No update variable has been set.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,7 @@ final class MDTooManyFilesUploadException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'This file\'s extension or mimetype is incorrect: ' . $this->getMessage();
|
return 'This file\'s extension or mimetype is incorrect: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,7 @@ final class MDWrongFileType extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'This file\'s extension or mimetype is incorrect: ' . $this->getMessage();
|
return 'This file\'s extension or mimetype is incorrect: ' . $this->getMessage();
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown in case the main entity of a page (e.g. an object, an institution etc.)
|
* Exception thrown in case an update failed.
|
||||||
* are not set public.
|
|
||||||
*/
|
*/
|
||||||
final class MDcouldNotSaveException extends Exception {
|
final class MDcouldNotSaveException extends Exception {
|
||||||
/**
|
/**
|
||||||
|
@ -13,8 +12,7 @@ final class MDcouldNotSaveException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Could not save.';
|
return 'Could not save.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ declare(strict_types = 1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown in case the main entity of a page (e.g. an object, an institution etc.)
|
* Exception thrown in case the main entity of a page (e.g. an object, an institution etc.)
|
||||||
* are not set public.
|
* could not be set public.
|
||||||
*/
|
*/
|
||||||
final class MDcouldNotSetPublic extends Exception {
|
final class MDcouldNotSetPublic extends Exception {
|
||||||
/**
|
/**
|
||||||
|
@ -13,8 +13,7 @@ final class MDcouldNotSetPublic extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'Could not set this to public.';
|
return 'Could not set this to public.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@ final class MDwriteAccessDeniedException extends Exception {
|
||||||
*/
|
*/
|
||||||
public function errorMessage() {
|
public function errorMessage() {
|
||||||
//error message
|
//error message
|
||||||
$errorMsg = 'You have no permission to write this.';
|
return 'You have no permission to write this.';
|
||||||
return $errorMsg;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user