Completed
Push — master ( b45c76...c88acf )
by Saurabh
01:03
created

Scripts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A devOnly() 0 6 2
1
<?php
2
3
namespace Sausin\LaravelOvh\Composer;
4
5
class Scripts
6
{
7
    /*
8
     * Stops propagation of Composer event if isn't on development environment
9
     *
10
     * This is useful to prevent running scripts for third-party packages
11
     * without the need to intercept previous event scripts that should be run
12
     * during non-development environments as well.
13
     */
14
    public static function devOnly($event)
15
    {
16
        if (!$event->isDevMode()) {
17
            $event->stopPropagation();
18
        }
19
    }
20
}
21