Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Apply fixes from StyleCI #43

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions src/ShopifyApp/Models/Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

namespace OhMyBrew\ShopifyApp\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use OhMyBrew\ShopifyApp\Facades\ShopifyApp;
use Carbon\Carbon;

class Charge extends Model
{
Expand All @@ -28,6 +27,7 @@ class Charge extends Model
* Scope for latest charge for a shop.
*
* @param \Illuminate\Database\Eloquent\Builder $query The query builder
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeLatest($query)
Expand All @@ -39,7 +39,8 @@ public function scopeLatest($query)
* Scope for latest charge by type for a shop.
*
* @param \Illuminate\Database\Eloquent\Builder $query The query builder
* @param integer $type The type of charge
* @param int $type The type of charge
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeLatestByType($query, int $type)
Expand Down Expand Up @@ -70,7 +71,7 @@ public function isTest()
/**
* Checks if the charge is a type.
*
* @param integer $type The charge type.
* @param int $type The charge type.
*
* @return bool
*/
Expand Down Expand Up @@ -102,12 +103,12 @@ public function isActiveTrial()
/**
* Returns the remaining trial days.
*
* @return integer
* @return int
*/
public function remainingTrialDays()
{
if (!$this->isTrial()) {
return null;
return;
}

return $this->isActiveTrial() ? Carbon::today()->diffInDays($this->trial_ends_on) : 0;
Expand All @@ -116,12 +117,12 @@ public function remainingTrialDays()
/**
* Returns the used trial days.
*
* @return integer|null
* @return int|null
*/
public function usedTrialDays()
{
if (!$this->isTrial()) {
return null;
return;
}

return $this->trial_days - $this->remainingTrialDays();
Expand Down
2 changes: 1 addition & 1 deletion src/ShopifyApp/Traits/BillingControllerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace OhMyBrew\ShopifyApp\Traits;

use Carbon\Carbon;
use OhMyBrew\ShopifyApp\Facades\ShopifyApp;
use OhMyBrew\ShopifyApp\Libraries\BillingPlan;
use OhMyBrew\ShopifyApp\Models\Charge;
use Carbon\Carbon;

trait BillingControllerTrait
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function up()
$table->timestamp('billing_on')->nullable();

// When activation happened
$table->timestamp('activated_on')->nullable();
$table->timestamp('activated_on')->nullable();

// Date the trial period ends
$table->timestamp('trial_ends_on')->nullable();
Expand Down
1 change: 1 addition & 0 deletions tests/Controllers/BillingControllerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OhMyBrew\ShopifyApp\Test\Controllers;

use OhMyBrew\ShopifyApp\Controllers\BillingController;
Expand Down
2 changes: 1 addition & 1 deletion tests/Models/ShopModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function testShopCanSoftDeleteAndBeRestored()
// Test soft delete
$this->assertTrue($shop->trashed());
$this->assertSoftDeleted('shops', [
'id' => $shop->id,
'id' => $shop->id,
'shopify_domain' => $shop->shopify_domain,
]);

Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace OhMyBrew\ShopifyApp\Test;

use OhMyBrew\ShopifyApp\Models\Shop;
use Carbon\Carbon;
use OhMyBrew\ShopifyApp\Models\Charge;
use OhMyBrew\ShopifyApp\Models\Shop;
use OhMyBrew\ShopifyApp\ShopifyAppProvider;
use Orchestra\Database\ConsoleServiceProvider;
use Orchestra\Testbench\TestCase as OrchestraTestCase;
use Carbon\Carbon;

abstract class TestCase extends OrchestraTestCase
{
Expand Down