-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfe4db5
commit d3b9efc
Showing
3 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
class Category | ||
{ | ||
const DIGITAL_GOODS = "DIGITAL_GOODS"; | ||
const PHYSICAL_GOODS = "PHYSICAL_GOODS"; | ||
const DONATION = "DONATION"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
|
||
namespace PrestaShop\Module\PrestashopCheckout\Product\Exception; | ||
|
||
use PrestaShop\Module\PrestashopCheckout\Exception\PsCheckoutException; | ||
|
||
class ProductException extends PsCheckoutException | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
<?php | ||
/** | ||
* Copyright since 2007 PrestaShop SA and Contributors | ||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA | ||
* | ||
* NOTICE OF LICENSE | ||
* | ||
* This source file is subject to the Academic Free License version 3.0 | ||
* that is bundled with this package in the file LICENSE.md. | ||
* It is also available through the world-wide-web at this URL: | ||
* https://opensource.org/licenses/AFL-3.0 | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @author PrestaShop SA and Contributors <[email protected]> | ||
* @copyright Since 2007 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 | ||
*/ | ||
|
||
namespace PrestaShop\Module\PrestashopCheckout\Product; | ||
|
||
use PrestaShop\Module\PrestashopCheckout\Amount\Amount; | ||
|
||
class Product | ||
{ | ||
/** @var string */ | ||
private $name; | ||
|
||
/** @var Amount */ | ||
private $unitPrice; | ||
|
||
/** @var int */ | ||
private $quantity; | ||
|
||
/** @var boolean */ | ||
private $isInStock; | ||
|
||
/** @var boolean */ | ||
private $isAvailableForOrder; | ||
|
||
/** @var string */ | ||
private $sku; | ||
|
||
/** @var string */ | ||
private $category; | ||
|
||
/** @var Amount */ | ||
private $tax; | ||
|
||
public function __construct($name, $unitPrice, $quantity, $isInStock, $isAvailableForOrder, $sku = '', $category = '', $tax = null) | ||
{ | ||
$this->name = $name; | ||
$this->unitPrice = $unitPrice; | ||
$this->quantity = $quantity; | ||
$this->isInStock = $isInStock; | ||
$this->isAvailableForOrder = $isAvailableForOrder; | ||
$this->sku = $sku; | ||
$this->category = $category; | ||
$this->tax = $tax; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* @return Amount | ||
*/ | ||
public function getUnitPrice() | ||
{ | ||
return $this->unitPrice; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getQuantity() | ||
{ | ||
return $this->quantity; | ||
Check failure on line 84 in src/Product/Product.php GitHub Actions / PHPStan (8.0.0)
|
||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isInStock() | ||
{ | ||
return $this->isInStock; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isAvailableForOrder() | ||
{ | ||
return $this->isAvailableForOrder; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSku() | ||
{ | ||
return $this->sku; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCategory() | ||
{ | ||
return $this->category; | ||
} | ||
|
||
/** | ||
* @return Amount | ||
*/ | ||
public function getTax() | ||
{ | ||
return $this->tax; | ||
} | ||
} |