functions_internal.php ➔ findBaseDir()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace Composed\Internal;
3
4
function findVendorDir()
5
{
6
    $packagePath = dirname(__DIR__);
7
8
    if (is_dir($packagePath . DIRECTORY_SEPARATOR . 'vendor')) {
9
        return $packagePath . DIRECTORY_SEPARATOR . 'vendor';
10
    }
11
12
    return dirname(dirname(dirname(__DIR__)));
13
}
14
15
function findBaseDir($vendorDir)
16
{
17
    require "$vendorDir/composer/autoload_files.php";
18
    return $baseDir;
0 ignored issues
show
Bug introduced by
The variable $baseDir does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
19
}
20