Skip to content

Commit 37ea94e

Browse files
glennjacobsStyleCIBot
authored andcommitted
Apply fixes from StyleCI
1 parent c1332b5 commit 37ea94e

File tree

106 files changed

+580
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+580
-445
lines changed

config/payments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'types' => [
77
'cash-in-hand' => [
8-
'driver' => 'offline',
8+
'driver' => 'offline',
99
'authorized' => 'payment-offline',
1010
],
1111
],

database/factories/OrderFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function definition(): array
2626
'tax_breakdown' => [
2727
[
2828
'description' => 'VAT',
29-
'total' => 200,
30-
'percentage' => 20,
29+
'total' => 200,
30+
'percentage' => 20,
3131
],
3232
],
3333
'tax_total' => $taxTotal,

database/factories/OrderLineFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public function definition(): array
3030
'tax_breakdown' => [
3131
[
3232
'description' => 'VAT',
33-
'total' => 200,
34-
'percentage' => 20,
33+
'total' => 200,
34+
'percentage' => 20,
3535
],
3636
],
3737
'tax_total' => $this->faker->numberBetween(1, 5000),

database/migrations/2021_08_10_101547_create_media_table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CreateMediaTable extends Migration
88
{
99
public function up()
1010
{
11-
if (! Schema::hasTable('media')) {
11+
if (!Schema::hasTable('media')) {
1212
Schema::create('media', function (Blueprint $table) {
1313
$table->bigIncrements('id');
1414

database/migrations/2021_08_17_142630_create_activity_log_table.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public function up()
1010
{
1111
$tableName = config('activitylog.table_name');
1212

13-
if (! Schema::hasTable($tableName)) {
13+
if (!Schema::hasTable($tableName)) {
1414
Schema::create($tableName, function (Blueprint $table) {
1515
$table->bigIncrements('id');
1616
$table->string('log_name')->nullable();

database/state/ConvertProductTypeAttributesToProducts.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function run()
1313
{
1414
$prefix = config('getcandy.database.table_prefix');
1515

16-
if (! $this->canRun()) {
16+
if (!$this->canRun()) {
1717
return;
1818
}
1919

database/state/EnsureDefaultTaxClassExists.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class EnsureDefaultTaxClassExists
99
{
1010
public function run()
1111
{
12-
if (! $this->canRun() || ! $this->shouldRun()) {
12+
if (!$this->canRun() || !$this->shouldRun()) {
1313
return;
1414
}
1515

@@ -32,6 +32,6 @@ protected function canRun()
3232

3333
protected function shouldRun()
3434
{
35-
return ! TaxClass::whereDefault(true)->count();
35+
return !TaxClass::whereDefault(true)->count();
3636
}
3737
}

database/state/EnsureUserOrdersHaveACustomer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class EnsureUserOrdersHaveACustomer
1010
{
1111
public function run()
1212
{
13-
if (! $this->canRun()) {
13+
if (!$this->canRun()) {
1414
return;
1515
}
1616

src/Actions/Carts/CalculateLine.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ class CalculateLine
1414
/**
1515
* Execute the action.
1616
*
17-
* @param \GetCandy\Models\CartLine $cartLine
18-
* @param \Illuminate\Database\Eloquent\Collection $customerGroups
17+
* @param \GetCandy\Models\CartLine $cartLine
18+
* @param \Illuminate\Database\Eloquent\Collection $customerGroups
19+
*
1920
* @return \GetCandy\Models\CartLine
2021
*/
2122
public function execute(
@@ -29,7 +30,7 @@ public function execute(
2930
$unitQuantity = $purchasable->getUnitQuantity();
3031

3132
// we check if any cart line modifiers have already specified a unit price in their calculating() method
32-
if (! ($price = $cartLine->unitPrice) instanceof Price) {
33+
if (!($price = $cartLine->unitPrice) instanceof Price) {
3334
$priceResponse = Pricing::currency($cart->currency)
3435
->qty($cartLine->quantity)
3536
->currency($cart->currency)

src/Actions/Carts/CreateOrder.php

+11-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public function __construct(OrderReferenceGeneratorInterface $generator)
2323
/**
2424
* Execute the action.
2525
*
26-
* @param \GetCandy\Models\Cart $cart
26+
* @param \GetCandy\Models\Cart $cart
27+
*
2728
* @return void
2829
*/
2930
public function execute(
@@ -56,9 +57,9 @@ public function execute(
5657
'tax_breakdown' => $cart->taxBreakdown->map(function ($tax) {
5758
return [
5859
'description' => $tax['description'],
59-
'identifier' => $tax['identifier'],
60-
'percentage' => $tax['amounts']->sum('percentage'),
61-
'total' => $tax['total']->value,
60+
'identifier' => $tax['identifier'],
61+
'percentage' => $tax['amounts']->sum('percentage'),
62+
'total' => $tax['total']->value,
6263
];
6364
})->values(),
6465
'tax_total' => $cart->taxTotal->value,
@@ -87,9 +88,9 @@ public function execute(
8788
'tax_breakdown' => $line->taxBreakdown->amounts->map(function ($amount) {
8889
return [
8990
'description' => $amount->description,
90-
'identifier' => $amount->identifier,
91-
'percentage' => $amount->percentage,
92-
'total' => $amount->price->value,
91+
'identifier' => $amount->identifier,
92+
'percentage' => $amount->percentage,
93+
'total' => $amount->price->value,
9394
];
9495
})->values(),
9596
'tax_total' => $line->taxAmount->value,
@@ -127,9 +128,9 @@ public function execute(
127128
'tax_breakdown' => $shippingAddress->taxBreakdown->amounts->map(function ($amount) {
128129
return [
129130
'description' => $amount->description,
130-
'identifier' => $amount->identifier,
131-
'percentage' => $amount->percentage,
132-
'total' => $amount->price->value,
131+
'identifier' => $amount->identifier,
132+
'percentage' => $amount->percentage,
133+
'total' => $amount->price->value,
133134
];
134135
})->values(),
135136
'tax_total' => $shippingAddress->shippingTaxTotal->value,

src/Actions/Carts/MergeCart.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ class MergeCart
1010
/**
1111
* Execute the action.
1212
*
13-
* @param \GetCandy\Models\Cart $target
14-
* @param \GetCandy\Models\Cart $source
13+
* @param \GetCandy\Models\Cart $target
14+
* @param \GetCandy\Models\Cart $source
15+
*
1516
* @return \GetCandy\Models\Cart
1617
*/
1718
public function execute(Cart $target, Cart $source)

src/Actions/Carts/ValidateCartForOrder.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ class ValidateCartForOrder
1616
/**
1717
* Execute the action.
1818
*
19-
* @param \GetCandy\Models\Cart $cart
19+
* @param \GetCandy\Models\Cart $cart
20+
*
2021
* @return void
2122
*/
2223
public function execute(
@@ -31,7 +32,7 @@ public function execute(
3132
}
3233

3334
// Do we have a billing address?
34-
if (! $cart->billingAddress) {
35+
if (!$cart->billingAddress) {
3536
throw new BillingAddressMissingException(
3637
__('getcandy::exceptions.carts.billing_missing')
3738
);
@@ -48,7 +49,7 @@ public function execute(
4849

4950
// Is this cart shippable and if so, does it have a shipping address.
5051
if ($cart->getManager()->isShippable()) {
51-
if (! $cart->shippingAddress) {
52+
if (!$cart->shippingAddress) {
5253
throw new ShippingAddressMissingException(
5354
__('getcandy::exceptions.carts.shipping_missing')
5455
);
@@ -64,7 +65,7 @@ public function execute(
6465
}
6566

6667
// Do we have a shipping option applied?
67-
if (! $cart->getManager()->getShippingOption()) {
68+
if (!$cart->getManager()->getShippingOption()) {
6869
throw new ShippingOptionMissingException();
6970
}
7071
}

src/Actions/Collections/SortProducts.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class SortProducts
1010
/**
1111
* Execute the action.
1212
*
13-
* @param \GetCandy\Models\Collection $collection
13+
* @param \GetCandy\Models\Collection $collection
14+
*
1415
* @return void
1516
*/
1617
public function execute(Collection $collection)

src/Actions/Collections/SortProductsByPrice.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ class SortProductsByPrice
1111
/**
1212
* Execute the action.
1313
*
14-
* @param \Illuminate\Support\Collection $products
15-
* @param \GetCandy\Models\Currency $currency
16-
* @param string $direction
14+
* @param \Illuminate\Support\Collection $products
15+
* @param \GetCandy\Models\Currency $currency
16+
* @param string $direction
17+
*
1718
* @return void
1819
*/
1920
public function execute(Collection $products, Currency $currency, $direction = 'asc')

src/Actions/Collections/SortProductsBySku.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ class SortProductsBySku
99
/**
1010
* Execute the action.
1111
*
12-
* @param \Illuminate\Support\Collection $products
13-
* @param string $direction
12+
* @param \Illuminate\Support\Collection $products
13+
* @param string $direction
14+
*
1415
* @return \Illuminate\Support\Collection
1516
*/
1617
public function execute(Collection $products, $direction = 'asc')

src/Actions/Taxes/GetTaxZonePostcode.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class GetTaxZonePostcode
99
/**
1010
* Execute the action.
1111
*
12-
* @param string $postcode
12+
* @param string $postcode
13+
*
1314
* @return null|\GetCandy\Models\TaxZonePostcode
1415
*/
1516
public function execute($postcode)
@@ -20,7 +21,7 @@ public function execute($postcode)
2021
return $postcodeZone;
2122
}
2223

23-
if (! $postcodeZone) {
24+
if (!$postcodeZone) {
2425
return null;
2526
}
2627

@@ -32,7 +33,7 @@ public function execute($postcode)
3233
})->sort(fn ($current, $next) => $current['matches'] < $next['matches'])->first();
3334

3435
// Give up, use default...
35-
if (! $match) {
36+
if (!$match) {
3637
return null;
3738
}
3839

@@ -42,7 +43,8 @@ public function execute($postcode)
4243
/**
4344
* Return the zone or zones which match this postcode.
4445
*
45-
* @param string $postcode
46+
* @param string $postcode
47+
*
4648
* @return \GetCandy\Models\TaxZonePostcode|\Illuminate\Support\Collection
4749
*/
4850
protected function getZoneMatches($postcode)
@@ -59,8 +61,9 @@ protected function getZoneMatches($postcode)
5961
/**
6062
* Match wildcard postcodes and return number of matches.
6163
*
62-
* @param string $wildcard
63-
* @param string $haystack
64+
* @param string $wildcard
65+
* @param string $haystack
66+
*
6467
* @return int
6568
*/
6669
private function matchWildcard($wildcard, $haystack)

src/Addons/Manifest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ public function build()
4343
/**
4444
* Format a given composer package into our addon format.
4545
*
46-
* @param array $package
46+
* @param array $package
47+
*
4748
* @return void|array
4849
*/
4950
protected function formatPackage($package)
5051
{
51-
if (! $provider = $package['extra']['laravel']['providers'][0] ?? null) {
52+
if (!$provider = $package['extra']['laravel']['providers'][0] ?? null) {
5253
return;
5354
}
5455

src/Base/AttributeManifestInterface.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ interface AttributeManifestInterface
99
/**
1010
* Add an attribute type.
1111
*
12-
* @param string $classname
12+
* @param string $classname
13+
*
1314
* @return void
1415
*/
1516
public function addType($classname);
@@ -24,7 +25,8 @@ public function getTypes(): Collection;
2425
/**
2526
* Return an attribute type by it's key.
2627
*
27-
* @param string $handle
28+
* @param string $handle
29+
*
2830
* @return string|null
2931
*/
3032
public function getType($handle);

src/Base/BaseModel.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ abstract class BaseModel extends Model
1414
/**
1515
* Create a new instance of the Model.
1616
*
17-
* @param array $attributes
17+
* @param array $attributes
1818
*/
1919
public function __construct(array $attributes = [])
2020
{
@@ -30,8 +30,9 @@ public function __construct(array $attributes = [])
3030
/**
3131
* Handle dynamic method calls into the model.
3232
*
33-
* @param string $method
34-
* @param array $parameters
33+
* @param string $method
34+
* @param array $parameters
35+
*
3536
* @return mixed
3637
*/
3738
public function __call($method, $parameters)
@@ -46,8 +47,9 @@ public function __call($method, $parameters)
4647
/**
4748
* Handle dynamic static method calls into the model.
4849
*
49-
* @param string $method
50-
* @param array $parameters
50+
* @param string $method
51+
* @param array $parameters
52+
*
5153
* @return mixed
5254
*/
5355
public static function __callStatic($method, $parameters)

0 commit comments

Comments
 (0)