Skip to content
This repository has been archived by the owner on Jun 11, 2021. It is now read-only.

Commit

Permalink
Apply fixes from StyleCI (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Oct 12, 2019
1 parent 109fad0 commit 57eb1d7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/LaravelShoppingCart/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Cart
public function __construct(SessionManager $session, Dispatcher $event)
{
$this->session = $session;
$this->event = $event;
$this->event = $event;
}

public function dispatchEvent($event, $payload = [], $halt = false)
Expand All @@ -75,7 +75,7 @@ public function dispatchEvent($event, $payload = [], $halt = false)
*/
public function name($name)
{
$this->name = 'shopping_cart.' . $name;
$this->name = 'shopping_cart.'.$name;

return $this;
}
Expand Down Expand Up @@ -199,7 +199,7 @@ public function get($rawId)
{
$row = $this->getCart()->get($rawId);

return $row === null ? null : new Item($row);
return null === $row ? null : new Item($row);
}

/**
Expand Down Expand Up @@ -396,7 +396,7 @@ protected function generateRawId($id, $attributes)
{
ksort($attributes);

return md5($id . serialize($attributes));
return md5($id.serialize($attributes));
}

/**
Expand Down Expand Up @@ -493,12 +493,12 @@ protected function makeRow($rawId, $id, $name, $qty, $price, array $attributes =
{
return new Item(array_merge([
'__raw_id' => $rawId,
'id' => $id,
'name' => $name,
'qty' => $qty,
'price' => $price,
'total' => $qty * $price,
'__model' => $this->model,
'id' => $id,
'name' => $name,
'qty' => $qty,
'price' => $price,
'total' => $qty * $price,
'__model' => $this->model,
], $attributes));
}

Expand Down

0 comments on commit 57eb1d7

Please sign in to comment.