CashierServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 14
c 0
b 0
f 0
dl 0
loc 21
ccs 15
cts 15
cp 1
rs 9.7998
cc 1
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file implements Laravel Cashier Service Provider.
4
 *
5
 * @author    Justin Hartman <[email protected]>
6
 * @copyright 2019 22 Digital
7
 * @since     v0.1
8
 */
9
10
namespace TwentyTwoDigital\CashierFastspring;
11
12
use Illuminate\Support\ServiceProvider;
13
14
/**
15
 * This class describes the Laravel Cashier Service Provider.
16
 *
17
 * {@inheritdoc}
18
 */
19
class CashierServiceProvider extends ServiceProvider
20
{
21
    /**
22
     * Bootstrap the application events.
23
     *
24
     * @return void
25
     */
26 1
    public function boot()
27
    {
28 1
        $time = time();
29
30
        // publish migrations
31 1
        $this->publishes([
32 1
            __DIR__ . '/../resources/migrations/create_subscriptions_table_for_cashier_fastspring.php' => sprintf(
33 1
                database_path('migrations') . '/%s_create_subscriptions_table_for_cashier_fastspring.php',
34 1
                date('Y_m_d_His', $time)
35
            ),
36 1
            __DIR__ . '/../resources/migrations/upgrade_user_table_for_cashier_fastspring.php' => sprintf(
37 1
                database_path('migrations') . '/%s_upgrade_user_table_for_cashier_fastspring.php',
38 1
                date('Y_m_d_His', ++$time)
39
            ),
40 1
            __DIR__ . '/../resources/migrations/create_invoices_table_for_cashier_fastspring.php' => sprintf(
41 1
                database_path('migrations') . '/%s_create_invoices_table_for_cashier_fastspring.php',
42 1
                date('Y_m_d_His', ++$time)
43
            ),
44 1
            __DIR__ . '/../resources/migrations/create_subscription_periods_table_for_cashier_fastspring.php' => sprintf(
45 1
                database_path('migrations') . '/%s_create_subscription_periods_table_for_cashier_fastspring.php',
46 1
                date('Y_m_d_His', ++$time)
47
            ),
48
        ]);
49 1
    }
50
51
    /**
52
     * Register the service provider.
53
     *
54
     * @return void
55
     */
56 1
    public function register()
57
    {
58
        //
59 1
    }
60
}
61