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

Scripts::devOnly()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
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