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.

DatabaseTransactions   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 8 1
1
<?php
2
3
namespace Joselfonseca\LaravelTactician\Middleware;
4
5
use DB;
6
use League\Tactician\Middleware;
7
8
/**
9
 * Run the command in a database transaction.
10
 * @package Joselfonseca\LaravelTactician\Middleware
11
 */
12
class DatabaseTransactions implements Middleware
13
{
14
15
    /**
16
     * @param object $command
17
     * @param callable $next
18
     * @return null
19
     * @codeCoverageIgnore
20
     */
21
    public function execute($command, callable $next)
22
    {
23
        $pipeline = null;
24
        DB::transaction(function () use ($next, $command, &$pipeline) {
25
            $pipeline = $next($command);
26
        });
27
        return $pipeline;
28
    }
29
}
30