Skip to content

Commit 974bcc0

Browse files
committed
#1341 - Fix psalm errors
1 parent 646a74a commit 974bcc0

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

bootstrap/autoload.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
declare(strict_types=1);
23

34
/**
45
* This file is part of the Phalcon Developer Tools.
@@ -32,7 +33,7 @@
3233
/**
3334
* @const PTOOLSPATH The path to the Phalcon Developers Tools.
3435
*/
35-
defined('PTOOLSPATH') || define('PTOOLSPATH', rtrim(trim(getenv('PTOOLSPATH'), '\"\'') ?: dirname(dirname(__FILE__)), '\\/'));
36+
defined('PTOOLSPATH') || define('PTOOLSPATH', rtrim(trim((string)getenv('PTOOLSPATH'), '\"\'') ?: dirname(dirname(__FILE__)), '\\/'));
3637

3738
/**
3839
* Check for old versions
@@ -102,7 +103,7 @@
102103
PTOOLSPATH . DS . 'src' . DS
103104
])
104105
->registerNamespaces([
105-
'Phalcon\DevTools' => PTOOLSPATH . DS . 'src' . DS . 'Phalcon' . DS,
106+
'Phalcon\DevTools' => PTOOLSPATH . DS . 'src' . DS,
106107
'WebTools\Controllers' => PTOOLSPATH . DS . str_replace('/', DS, 'src/Web/Tools/Controllers') . DS,
107108
])
108109
->register();
@@ -116,6 +117,8 @@
116117

117118
/**
118119
* Register the custom loader (if any)
120+
*
121+
* @psalm-suppress MissingFile
119122
*/
120123
if (file_exists('.phalcon' . DS . 'autoload.php')) {
121124
require_once '.phalcon' . DS . 'autoload.php';

psalm.xml.dist

+2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
>
1010
<projectFiles>
1111
<directory name="src/" />
12+
<file name="bootstrap/autoload.php" />
1213
<file name="phalcon" />
14+
<file name="webtools.php" />
1315
<ignoreFiles>
1416
<directory name="vendor" />
1517
</ignoreFiles>

webtools.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@
1111

1212
use Phalcon\DevTools\Bootstrap;
1313

14+
/**
15+
* @psalm-suppress MissingFile
16+
*/
1417
include 'webtools.config.php';
1518
include PTOOLSPATH . '/bootstrap/autoload.php';
1619

20+
/**
21+
* @psalm-suppress UndefinedConstant
22+
*/
1723
$bootstrap = new Bootstrap([
1824
'ptools_path' => PTOOLSPATH,
1925
'ptools_ip' => PTOOLS_IP,

0 commit comments

Comments
 (0)