GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

WalletPlusServiceProvider::boot()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace CoreProc\WalletPlus;
4
5
use Illuminate\Filesystem\Filesystem;
6
use Illuminate\Support\Collection;
7
use Illuminate\Support\ServiceProvider;
8
9
class WalletPlusServiceProvider extends ServiceProvider
10
{
11
    /**
12
     * Bootstrap the application services.
13
     */
14
    public function boot(Filesystem $filesystem)
15
    {
16
        $this->publishes([
17
            __DIR__ . '/../database/migrations/create_wallet_plus_tables.php.stub' =>
18
                $this->getMigrationFileName($filesystem),
19
        ], 'migrations');
20
    }
21
22
    /**
23
     * Register the application services.
24
     */
25
    public function register()
26
    {
27
        // $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'wallet-plus');
28
    }
29
30
    protected function getMigrationFileName(Filesystem $filesystem)
31
    {
32
        $timestamp = date('Y_m_d_His');
33
34
        return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR)
35
            ->flatMap(function ($path) use ($filesystem) {
36
                return $filesystem->glob($path . '*_create_wallet_plus_tables.php');
37
            })->push($this->app->databasePath() . "/migrations/{$timestamp}_create_wallet_plus_tables.php")
38
            ->first();
39
    }
40
}
41