Passed
Push — master ( 1af92c...cfa70a )
by Gabriel
06:23
created

envVar()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
use Nip\Container\Container;
4
5
define('PROJECT_BASE_PATH', __DIR__.'/..');
6
define('TEST_BASE_PATH', __DIR__);
7
define('TEST_FIXTURE_PATH', __DIR__.DIRECTORY_SEPARATOR.'fixtures');
8
9
if (file_exists(__DIR__.DIRECTORY_SEPARATOR.'.env')) {
10
    $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
11
    $dotenv->load();
12
}
13
14
function envVar($key)
15
{
16
    if (isset($_ENV[$key])) {
17
        return $_ENV[$key];
18
    }
19
    return getenv($key);
20
}
21
22
putenv('PLATIONLINE_PUBLIC_KEY='.gzinflate(base64_decode(envVar('PLATIONLINE_PUBLIC_KEY'))));
23
putenv('PLATIONLINE_PRIVATE_KEY='.gzinflate(base64_decode(envVar('PLATIONLINE_PRIVATE_KEY'))));
24
25
Container::setInstance(new Container());
26
Container::getInstance()->set('inflector', \Nip\Inflector\Inflector::instance());
27
28
$translator = Mockery::mock(\Nip\I18n\Translator::class)->shouldAllowMockingProtectedMethods()->makePartial();
29
$translator->shouldReceive('persistLocale');
30
Container::getInstance()->set('translator', $translator);
31
Container::getInstance()->set('request', new \Nip\Request());
0 ignored issues
show
Deprecated Code introduced by
The class Nip\Request has been deprecated: use \Nip\Http\Request ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

31
Container::getInstance()->set('request', /** @scrutinizer ignore-deprecated */ new \Nip\Request());
Loading history...
32
33
require dirname(__DIR__).'/vendor/autoload.php';
34