Completed
Push — master ( 3b85bc...368c58 )
by CodexShaper
03:21
created

ComposerScripts   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 39
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A postInstall() 0 4 1
A postUpdate() 0 4 1
A postAutoloadDump() 0 8 1
1
<?php
2
3
namespace CodexShaper\WP;
4
5
use Composer\Script\Event;
6
7
class ComposerScripts
8
{
9
    /**
10
     * Handle the post-install Composer event.
11
     *
12
     * @param  \Composer\Script\Event  $event
13
     * @return void
14
     */
15
    public static function postInstall(Event $event)
16
    {
17
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
18
    }
19
20
    /**
21
     * Handle the post-update Composer event.
22
     *
23
     * @param  \Composer\Script\Event  $event
24
     * @return void
25
     */
26
    public static function postUpdate(Event $event)
27
    {
28
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
29
    }
30
31
    /**
32
     * Handle the post-autoload-dump Composer event.
33
     *
34
     * @param  \Composer\Script\Event  $event
35
     * @return void
36
     */
37
    public static function postAutoloadDump(Event $event)
38
    {
39
        require_once $event->getComposer()->getConfig()->get('vendor-dir').'/autoload.php';
40
41
        $dir = $event->getComposer()->getConfig()->get('vendor-dir');
42
43
        rename($dir.'../wpb.php', $dir.'../hello.php');
44
    }
45
}
46