Test Failed
Push — master ( 0d729d...0caf32 )
by Sebastian
05:03
created

vendorPath.php ➔ vendorPath()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 8
nc 3
nop 0
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/*
3
 * citeproc-php
4
 *
5
 * @link        http://github.com/seboettg/citeproc-php for the source repository
6
 * @copyright   Copyright (c) 2017 Sebastian Böttger.
7
 * @license     https://opensource.org/licenses/MIT
8
 */
9
10
if (!function_exists('vendorPath')) {
11
    /**
12
     * @return bool|string returns path of composer vendor folder, and false if folder does not exist
13
     */
14
    function vendorPath() {
15
16
        if (file_exists(__DIR__ . '/vendor/')) {
17
            return __DIR__ . '/vendor';
18
        } else {
19
            if (!file_exists(__DIR__ . '/../../')) {
20
                return false;
21
            } else {
22
                return __DIR__ . '/../..';
23
            }
24
        }
25
    }
26
}