mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-14 01:24:06 -08:00
638a7b2d91
* Extract method/cleanup * Remove apiStore method that is unusued since api controllers. * Use proper model exception * Remove old user importer. This is now supported by the general importer framework. * Refactor AssetsController methods. This is a giant diff without many functional changes, mostly cosmetic. I've pulled a number of methods out of assetscontroller, preferring instead to create some more targetted controllers for related actions. I think this cleans up the file some, and suggests some places for future targetted improvement. Fix weird missing things. * Fix Unit test failing after date changes. * Pass valid string to be translated. * Some method cleanup for codacy. * Extract trait for common checkout uses and codacy fixes.
22 lines
441 B
PHP
22 lines
441 B
PHP
<?php
|
|
|
|
namespace App\Exceptions;
|
|
|
|
use Exception;
|
|
class CheckoutNotAllowed extends Exception
|
|
{
|
|
|
|
private $errorMessage;
|
|
|
|
function __construct($errorMessage = null)
|
|
{
|
|
$this->errorMessage = $errorMessage;
|
|
|
|
parent::__construct($errorMessage);
|
|
}
|
|
public function __toString()
|
|
{
|
|
return is_null($this->errorMessage) ? "A checkout is not allowed under these circumstances" : $this->errorMessage;
|
|
}
|
|
}
|