Passed
Branch master (ee1eb5)
by Sebastian
08:07 queued 04:25
created

vendorPath()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
nc 3
nop 0
dl 0
loc 9
rs 10
c 3
b 0
f 0
1
<?php
2
/*
1 ignored issue
show
Coding Style introduced by
You must use "/**" style comments for a file comment
Loading history...
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
    /**
1 ignored issue
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
12
     * @return bool|string returns path of composer vendor folder, and false if folder does not exist
13
     */
14
    function vendorPath() {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on a new line
Loading history...
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
}