Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
NoxxieNl authored and StyleCIBot committed Mar 7, 2019
1 parent 11f47bf commit 53cc6ed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Contracts/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface Order
* Creates a new object for the order.
*
* @param Illuminate\Support\Collection $attributes
* @param bool $directSave
* @param bool $directSave
*
* @return mixed
*/
Expand All @@ -20,7 +20,7 @@ public function create(Collection $attributes, bool $directSave);
* Update an existing order.
*
* @param Illuminate\Support\Collection $attributes
* @param bool $directSave
* @param bool $directSave
*
* @return void
*/
Expand All @@ -30,7 +30,7 @@ public function update(Collection $attributes, bool $directSave);
* Delete an order.
*
* @param Illuminate\Support\Collection $attributes
* @param bool $directSave
* @param bool $directSave
*
* @return void
*/
Expand Down
23 changes: 11 additions & 12 deletions src/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@
use Illuminate\Support\Facades\DB;
use Noxxie\Ptv\Contracts\Order as DefaultOrderContract;
use Noxxie\Ptv\Exceptions\InvalidAttributeException;
use Noxxie\Ptv\Exceptions\InvalidModelException;
use Noxxie\Ptv\Exceptions\ModelValidationException;
use Noxxie\Ptv\Models\Imph_import_header;
use Noxxie\Ptv\Models\Iora_order_actionpoint;
use Noxxie\Ptv\Models\Iorh_order_header;
use Noxxie\Ptv\Traits\defaultAttributes;
use Noxxie\Ptv\Traits\friendlyAttributes;
use Noxxie\Ptv\Exceptions\InvalidModelException;

class Order implements DefaultOrderContract
{
use defaultAttributes, friendlyAttributes;

/**
* Contains the header model when it is valid
* Contains the header model when it is valid.
*
* @var null|\Noxxie\Ptv\Models\Imph_import_header;
*/
public $headerModel = null;

/**
* Contains the order header model when it is valid
* Contains the order header model when it is valid.
*
* @var null|\Noxxie\Ptv\Models\Iorh_order_header;
*/
public $orderHeaderModel = null;

/**
* Contains the order actionpoint header when it is valid
* Contains the order actionpoint header when it is valid.
*
* @var null|\Noxxie\Ptv\Models\Iora_order_actionpoint;
*/
Expand Down Expand Up @@ -73,7 +73,7 @@ public function __construct(string $type = null, Collection $attributes = null)
* Create a new order in the PTV database.
*
* @param \Illuminate\Support\Collection $attributes
* @param bool $directSave
* @param bool $directSave
*
* @return bool
*/
Expand Down Expand Up @@ -143,7 +143,7 @@ public function create(Collection $attributes, bool $directSave = true)
* Update an existing order in PTV.
*
* @param \Illuminate\Support\Collection $attributes
* @param bool $directSave
* @param bool $directSave
*
* @return bool
*/
Expand All @@ -160,7 +160,7 @@ public function update(Collection $attributes, bool $directSave = true)
* Delete an existing order in PTV.
*
* @param \Illuminate\Support\Collection $attributes
* @param bool $directSave
* @param bool $directSave
*
* @return bool
*/
Expand Down Expand Up @@ -225,13 +225,13 @@ protected function fillAttributes(Collection $attributes)

/**
* This allows the insertion of multi records into the transfer database at once this option only works when the save / update or delete method
* option $directSave is set to false
* option $directSave is set to false.
*
* @param \Illuminate\Support\Collection $collection
*
* @return void
*/
static public function massSave(Collection $collection)
public static function massSave(Collection $collection)
{
$models = [
'header' => [],
Expand All @@ -241,10 +241,9 @@ static public function massSave(Collection $collection)

$references = [];

foreach ($collection as $orderInstance)
{
foreach ($collection as $orderInstance) {
// Check if the instance is an order model
if (!$orderInstance instanceof Order) {
if (!$orderInstance instanceof self) {
throw new InvalidModelException('The specified instance is not of the model type "order"');
}

Expand Down

0 comments on commit 53cc6ed

Please sign in to comment.