Revert "1.0.7"

This reverts commit 4a312a37e2.
This commit is contained in:
Joel Male
2024-08-30 10:08:27 +10:00
parent 4a312a37e2
commit 313a4f7aa2
25 changed files with 70 additions and 70 deletions
+11 -11
View File
@@ -1,12 +1,12 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Pixeldigital\Cart\Helpers\Helpers;
use Pixeldigital\Cart\Validators\CartItemValidator;
use Pixeldigital\Cart\Exceptions\InvalidItemException;
use Pixeldigital\Cart\Exceptions\UnknownModelException;
use Pixeldigital\Cart\Exceptions\InvalidConditionException;
use Wearepixel\Cart\Helpers\Helpers;
use Wearepixel\Cart\Validators\CartItemValidator;
use Wearepixel\Cart\Exceptions\InvalidItemException;
use Wearepixel\Cart\Exceptions\UnknownModelException;
use Wearepixel\Cart\Exceptions\InvalidConditionException;
class Cart
{
@@ -270,11 +270,11 @@ public function setConfig($config)
public function addItemCondition($productId, $itemCondition)
{
if ($product = $this->get($productId)) {
$conditionInstance = '\\Pixeldigital\\Cart\\CartCondition';
$conditionInstance = '\\Wearepixel\\Cart\\CartCondition';
if ($itemCondition instanceof $conditionInstance) {
// we need to copy first to a temporary variable to hold the conditions
// to avoid hitting this error "Indirect modification of overloaded element of Pixeldigital\Cart\ItemCollection has no effect"
// to avoid hitting this error "Indirect modification of overloaded element of Wearepixel\Cart\ItemCollection has no effect"
// this is due to laravel Collection instance that implements Array Access
// // see link for more info: http://stackoverflow.com/questions/20053269/indirect-modification-of-overloaded-element-of-splfixedarray-has-no-effect
$itemConditionTempHolder = $product['conditions'];
@@ -353,7 +353,7 @@ public function condition(array|CartCondition $condition): self
}
if (! $condition instanceof CartCondition) {
throw new InvalidConditionException('Argument 1 must be an instance of \'Pixeldigital\Cart\CartCondition\'');
throw new InvalidConditionException('Argument 1 must be an instance of \'Wearepixel\Cart\CartCondition\'');
}
$conditions = $this->getConditions();
@@ -479,7 +479,7 @@ public function removeItemCondition($itemId, $conditionName)
// on the given condition name the user wants to remove, if so,
// lets just make $item['conditions'] an empty array as there's just 1 condition on it anyway
else {
$conditionInstance = 'Pixeldigital\\Cart\\CartCondition';
$conditionInstance = 'Wearepixel\\Cart\\CartCondition';
if ($item['conditions'] instanceof $conditionInstance) {
if ($tempConditionsHolder->getName() == $conditionName) {
@@ -776,7 +776,7 @@ protected function itemHasConditions($item)
return count($item['conditions']) > 0;
}
$conditionInstance = 'Pixeldigital\\Cart\\CartCondition';
$conditionInstance = 'Wearepixel\\Cart\\CartCondition';
if ($item['conditions'] instanceof $conditionInstance) {
return true;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Illuminate\Support\Collection;
+4 -4
View File
@@ -1,10 +1,10 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Pixeldigital\Cart\Helpers\Helpers;
use Pixeldigital\Cart\Validators\CartConditionValidator;
use Pixeldigital\Cart\Exceptions\InvalidConditionException;
use Wearepixel\Cart\Helpers\Helpers;
use Wearepixel\Cart\Validators\CartConditionValidator;
use Wearepixel\Cart\Exceptions\InvalidConditionException;
class CartCondition
{
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Illuminate\Support\Collection;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Illuminate\Support\ServiceProvider;
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
namespace Pixeldigital\Cart\Exceptions;
namespace Wearepixel\Cart\Exceptions;
class InvalidConditionException extends \Exception {}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
namespace Pixeldigital\Cart\Exceptions;
namespace Wearepixel\Cart\Exceptions;
class InvalidItemException extends \Exception {}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
namespace Pixeldigital\Cart\Exceptions;
namespace Wearepixel\Cart\Exceptions;
class UnknownModelException extends \Exception {}
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart\Facades;
namespace Wearepixel\Cart\Facades;
use Illuminate\Support\Facades\Facade;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart\Helpers;
namespace Wearepixel\Cart\Helpers;
class Helpers
{
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Illuminate\Support\Collection;
+3 -3
View File
@@ -1,9 +1,9 @@
<?php
namespace Pixeldigital\Cart;
namespace Wearepixel\Cart;
use Illuminate\Support\Collection;
use Pixeldigital\Cart\Helpers\Helpers;
use Wearepixel\Cart\Helpers\Helpers;
class ItemCollection extends Collection
{
@@ -72,7 +72,7 @@ public function hasConditions()
if (is_array($this['conditions'])) {
return count($this['conditions']) > 0;
}
$conditionInstance = 'Pixeldigital\\Cart\\CartCondition';
$conditionInstance = 'Wearepixel\\Cart\\CartCondition';
if ($this['conditions'] instanceof $conditionInstance) {
return true;
}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
namespace Pixeldigital\Cart\Validators;
namespace Wearepixel\Cart\Validators;
class CartConditionValidator extends Validator {}
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
namespace Pixeldigital\Cart\Validators;
namespace Wearepixel\Cart\Validators;
class CartItemValidator extends Validator {}
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
namespace Pixeldigital\Cart\Validators;
namespace Wearepixel\Cart\Validators;
use Illuminate\Validation\Factory;
use Illuminate\Filesystem\Filesystem;