Skip to content

Commit

Permalink
Merge pull request #5 from NoxxieNl/analysis-X0jZ3M
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
NoxxieNl authored Mar 10, 2019
2 parents 9252160 + a3d0aad commit 525e83d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 23 deletions.
15 changes: 8 additions & 7 deletions src/Exceptions/ModelValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@
class ModelValidationException extends Exception
{
/**
* Holds the defined errors
* Holds the defined errors.
*
* @var array
*/
protected $errors = [];

/**
* Create the exception instance with custom data
* Create the exception instance with custom data.
*
* @param mixed $message
* @param int $code
* @param mixed $message
* @param int $code
* @param \Exception $previous
*/
public function __construct($message = null, $code = 0, Exception $previous = null) {
public function __construct($message = null, $code = 0, Exception $previous = null)
{
if ($message instanceof MessageBag) {
foreach ($message->getMessages() as $column => $reason) {
$this->errors = [
'column' => $column,
'reason' => $reason
'reason' => $reason,
];
}
}
Expand All @@ -36,7 +37,7 @@ public function __construct($message = null, $code = 0, Exception $previous = nu
}

/**
* Get the setted errors
* Get the setted errors.
*
* @return void
*/
Expand Down
5 changes: 3 additions & 2 deletions src/Facades/Order.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace Noxxie\Ptv\Facades;

use Illuminate\Support\Facades\Facade;

class Order extends Facade
{

/**
* @see \Noxxie\Ptv\Contracts\Order
*/
protected static function getFacadeAccessor() {
protected static function getFacadeAccessor()
{
return 'order';
}
}
5 changes: 3 additions & 2 deletions src/Facades/Route.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace Noxxie\Ptv\Facades;

use Illuminate\Support\Facades\Facade;

class Route extends Facade
{

/**
* @see \Noxxie\Ptv\Contracts\Route
*/
protected static function getFacadeAccessor() {
protected static function getFacadeAccessor()
{
return 'route';
}
}
2 changes: 1 addition & 1 deletion src/Helpers/TableColumnDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use Illuminate\Support\Facades\Schema;
use Noxxie\Ptv\Models\Imph_import_header;
use Noxxie\Ptv\Models\Iorh_order_header;
use Noxxie\Ptv\Models\Iora_order_actionpoint;
use Noxxie\Ptv\Models\Iorh_order_header;

class TableColumnDefinitions
{
Expand Down
19 changes: 10 additions & 9 deletions src/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Order implements DefaultOrderContract
use defaultAttributes, friendlyAttributes;

/**
* Contains all the validated orders that are ready for insertion
* Contains all the validated orders that are ready for insertion.
*
* @var array
*/
Expand Down Expand Up @@ -53,13 +53,14 @@ public function __construct(string $type = null, array $attributes = null)

// Execute the method call
$method = call_user_func([$this, $type], $attributes);

return $method->save();
}

/**
* Create a new order in the PTV database.
*
* @param array $attributes
* @param array $attributes
*
* @return bool
*/
Expand All @@ -71,7 +72,7 @@ public function create(array $attributes)
// Check if a multidimensional array was specified if not convert the single one that it looks like a multidimensional array
if (!$attributes->has(0)) {
$attributes = collect([
$attributes->toArray()
$attributes->toArray(),
]);
}

Expand Down Expand Up @@ -109,9 +110,9 @@ public function create(array $attributes)

// And we are done
$this->preparedOrders[] = [
'header' => $header,
'orderheader' => $orderHeader,
'orderactionpoint' => $orderActionpoint
'header' => $header,
'orderheader' => $orderHeader,
'orderactionpoint' => $orderActionpoint,
];
}

Expand Down Expand Up @@ -158,7 +159,7 @@ public function delete(array $attributes)
// Check if a multidimensional array was specified if not convert the single one that it looks like a multidimensional array
if (!$attributes->has(0)) {
$attributes = collect([
$attributes->toArray()
$attributes->toArray(),
]);
}

Expand All @@ -183,7 +184,7 @@ public function delete(array $attributes)

// And we are done
$this->preparedOrders[] = [
'header' => $header
'header' => $header,
];
}

Expand Down Expand Up @@ -221,7 +222,7 @@ protected function fillAttributes(Collection $attributes)
}

/**
* Save the prepared orders (Does not mather if it is a create, update or delete. The different methods may be combined into one save)
* Save the prepared orders (Does not mather if it is a create, update or delete. The different methods may be combined into one save).
*
* @return void
*/
Expand Down
1 change: 0 additions & 1 deletion src/PtvServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Noxxie\Ptv;

use Illuminate\Support\Collection;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/defaultAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ trait defaultAttributes
protected $unique_id;

/**
* Holds the bool if the unique ID generation must be done again when then generate method is called
* Holds the bool if the unique ID generation must be done again when then generate method is called.
*
* @var bool
*/
Expand Down

0 comments on commit 525e83d

Please sign in to comment.