Inital commit

This commit is contained in:
2020-11-19 15:36:28 +01:00
parent 71f32f83d3
commit 66ce4ee218
18077 changed files with 2166122 additions and 35184 deletions

View File

@@ -15,9 +15,8 @@ namespace Thelia\Exception;
/**
* Class AdminAccessDenied
* @package Thelia\Exception
* @author Manuel Raynaud <mraynaud@openstudio.fr>
* @author Manuel Raynaud <manu@raynaud.io>
*/
class AdminAccessDenied extends \RuntimeException
{
}

View File

@@ -0,0 +1,38 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Exception;
use Thelia\Core\Translation\Translator;
use Thelia\Log\Tlog;
/**
* Class CouponNotReleaseException
* @package Thelia\Exception
* @author Baixas Alban <abaixas@openstudio.fr>
*/
class CouponNotReleaseException extends \Exception
{
/**
* CouponNotReleaseException thrown when a Coupon is not release
*
* @param string $couponCode Coupon code
*/
public function __construct($couponCode)
{
$message = Translator::getInstance()->trans('Coupon %code is not release.', ['%code' => $couponCode]);
Tlog::getInstance()->addWarning($message);
parent::__construct($message);
}
}

View File

@@ -15,7 +15,7 @@ namespace Thelia\Exception;
/**
* Class CustomerException
* @package Thelia\Exception
* @author Manuel Raynaud <mraynaud@openstudio.fr>
* @author Manuel Raynaud <manu@raynaud.io>
*/
class CustomerException extends \RuntimeException
{

View File

@@ -19,5 +19,4 @@ namespace Thelia\Exception;
*/
class FileNotFoundException extends \ErrorException
{
}

View File

@@ -19,5 +19,4 @@ namespace Thelia\Exception;
*/
class FileNotReadableException extends \Exception
{
}

View File

@@ -19,5 +19,4 @@ namespace Thelia\Exception;
*/
class HttpUrlException extends \Exception
{
}

View File

@@ -0,0 +1,34 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Exception;
use Thelia\Core\Translation\Translator;
use Thelia\Log\Tlog;
/**
* Class InactiveCouponException
* @package Thelia\Exception
* @author Manuel Raynaud <manu@raynaud.io>
*/
class InactiveCouponException extends \RuntimeException
{
public function __construct($couponCode)
{
$message = Translator::getInstance()->trans('Coupon code %code is disabled.', ['%code' => $couponCode ]);
Tlog::getInstance()->addWarning($message);
parent::__construct($message);
}
}

View File

@@ -30,7 +30,6 @@ class InvalidConditionException extends \RuntimeException
*/
public function __construct($className)
{
$message = 'Invalid Condition given to ' . $className;
Tlog::getInstance()->addError($message);

View File

@@ -31,7 +31,6 @@ class InvalidConditionValueException extends \RuntimeException
*/
public function __construct($className, $parameter)
{
$message = 'Invalid Parameter for Condition ' . $className . ' on parameter ' . $parameter;
Tlog::getInstance()->addError($message);

View File

@@ -0,0 +1,50 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Exception;
/**
* Class InvalidModuleException
* @package Thelia\Exception
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
*/
class InvalidModuleException extends \RuntimeException
{
protected $errors = [];
public function __construct(array $errors = [])
{
parent::__construct();
$this->errors = $errors;
}
/**
* @return array
*/
public function getErrors()
{
return $this->errors;
}
public function getErrorsAsString($separator = "\n")
{
$message = '';
/** @var \Exception $error */
foreach ($this->errors as $error) {
$message .= $error->getMessage() . $separator;
}
return rtrim($message, $separator);
}
}

View File

@@ -14,5 +14,4 @@ namespace Thelia\Exception;
class MemberAccessException extends \LogicException
{
}

View File

@@ -23,5 +23,4 @@ use Symfony\Component\DependencyInjection\Exception\BadMethodCallException;
*/
class NotImplementedException extends BadMethodCallException
{
}

View File

@@ -0,0 +1,23 @@
<?php
/*************************************************************************************/
/* This file is part of the Thelia package. */
/* */
/* Copyright (c) OpenStudio */
/* email : dev@thelia.net */
/* web : http://www.thelia.net */
/* */
/* For the full copyright and license information, please view the LICENSE.txt */
/* file that was distributed with this source code. */
/*************************************************************************************/
namespace Thelia\Exception;
/**
* Class UnmatchableConditionException
* UnmatchableConditionException thrown when a condition can't be check (if customer is not connected)
* @package Thelia\Exception
* @author Baixas Alban <abaixas@openstudio.fr>
*/
class UnmatchableConditionException extends \RuntimeException
{
}