Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Config.php « src « composer-bin-plugin « bamarni « vendor - github.com/nextcloud/updater.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4e98a6515a76a57fc980c2d7c802ce6620f48fd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php

namespace Bamarni\Composer\Bin;

use Composer\Composer;

final class Config
{
    private $config;

    public function __construct(Composer $composer)
    {
        $extra = $composer->getPackage()->getExtra();
        $this->config = array_merge(
            [
                'bin-links' => true,
                'target-directory' => 'vendor-bin',
                'forward-command' => false,
            ],
            isset($extra['bamarni-bin']) ? $extra['bamarni-bin'] : []
        );
    }

    /**
     * @return bool
     */
    public function binLinksAreEnabled()
    {
        return true === $this->config['bin-links'];
    }

    /**
     * @return string
     */
    public function getTargetDirectory()
    {
        return $this->config['target-directory'];
    }

    /**
     * @return bool
     */
    public function isCommandForwarded()
    {
        return $this->config['forward-command'];
    }
}