Skip to content

Commit 16b6650

Browse files
committed
fixes type linting
fixes type linting fixes type linting fixes type linting
1 parent 1f03c41 commit 16b6650

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+283
-2849
lines changed

.php_cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $config->getFinder()
4343
'docs',
4444
'node_modules',
4545
'temp',
46-
46+
'src/router.php',
4747
'vendor',
4848
'.github',
4949
])

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ psalm:
132132
@if [ -f "vendor/bin/psalm" ]; then \
133133
mkdir -p .build/psalm ;\
134134
${MAKE} disable_xdebug --no-print-directory ;\
135-
vendor/bin/psalm --show-info=false \
135+
vendor/bin/psalm --show-info=true \
136136
--config=psalm.xml \
137137
--set-baseline=.build/psalm/psalm-baseline$(FOLDER_BASENAME).xml \
138138
--shepherd $(folder) ;\

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ Other enhancements are in progress and would be a nice to have:
2727
## Requirements
2828

2929
- PHP 7.1+
30+
- PostgreSQL v9+
3031
- ext-psql
3132
- [Composer](https://getcomposer.org/download/)
3233

33-
(If you're using PHP 5.6+, you can still try versions RC2 and below, but you should really, realy upgrade).
34+
(If you're using PostgreSQL 7.4 or 8.x, or PHP 5.6+, you can still try versions RC2 and below, but you should really, realy upgrade).
3435

3536
---
3637

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@
6262
"php -r \"array_map( 'unlink', array_filter((array) glob('temp/twigcache/**/*.php', GLOB_BRACE)));\"",
6363
"php -r \"array_map( 'rmdir', array_filter((array) glob('temp/twigcache/*', GLOB_BRACE)));\""
6464
],
65-
"phpstan": "phpstan analyse src --memory-limit=2G "
65+
"phpstan": "phpstan analyse src "
6666
}
6767
}

phpstan.neon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ parameters:
5252
message: "#^Result of method PHPPgAdmin\\\\[a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+\\:\\:[a-zA-Z0-9_]+\\(\\) \\(void\\) is used\\.$#"
5353
path: src/*
5454

55-
55+
-
56+
message: "#^Call to static method br2ln\\(\\) on trait PHPPgAdmin\\Traits\\HelperTrait\\.#"
57+
path: src/*
58+
5659
-
5760
message: "#^Constructor of class [a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+\\\\[a-zA-Z0-9_]+ has an unused parameter \\$[a-zA-Z0-9_]+\\.$#"
5861
path: src/*

src/classes/ADONewConnection.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/**
4+
* PHPPgAdmin 6.0.0
5+
*/
6+
7+
namespace PHPPgAdmin;
8+
9+
/**
10+
* @file
11+
* Extends \ADODB_postgres9 to let correct inference on PHPDoc params
12+
*/
13+
14+
/**
15+
* Extends \ADODB_postgres9 to let correct inference on PHPDoc params.
16+
*/
17+
class ADONewConnection extends \ADODB_postgres9
18+
{
19+
}

src/classes/ADORecordSet.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,16 @@ public function count(): int
2323
{
2424
return $this->NumRows();
2525
}
26+
27+
/**
28+
* Returns the recordCount.
29+
*
30+
* @param int $fieldoffset
31+
*
32+
* @return \ADOFieldObject the field
33+
*/
34+
public function fetchField($fieldoffset = -1): \ADOFieldObject
35+
{
36+
return parent::fetchField();
37+
}
2638
}

src/classes/Misc.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace PHPPgAdmin;
88

9+
use PHPPgAdmin\Database\Postgres;
10+
911
/**
1012
* @file
1113
* Class to hold various commonly used functions
@@ -64,6 +66,9 @@ class Misc
6466

6567
private $_reload_browser = false;
6668

69+
/**
70+
* @var Postgres
71+
*/
6772
private $_data;
6873

6974
private $_database;
@@ -279,9 +284,9 @@ public function getErrorMsg()
279284
*
280285
* @internal mixed $plaform placeholder that will receive the value of the platform
281286
*
282-
* @return null|\PHPPgAdmin\Database\ADOdbBase the database accessor instance
287+
* @return null|\PHPPgAdmin\Database\Postgres the database accessor instance
283288
*/
284-
public function getDatabaseAccessor($database = '', $server_id = null): ?\PHPPgAdmin\Database\ADOdbBase
289+
public function getDatabaseAccessor($database = '', $server_id = null): ?\PHPPgAdmin\Database\Postgres
285290
{
286291
$lang = $this->lang;
287292

src/classes/ViewManager.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ class ViewManager extends \Slim\Views\Twig
6060

6161
public $view;
6262

63+
/**
64+
* @var \PHPPgAdmin\Misc
65+
*/
66+
public $misc;
67+
6368
protected $container;
6469

6570
private $_connection;
@@ -101,7 +106,7 @@ public function __construct($path, $settings, \Slim\Container $c)
101106

102107
$this->addExtension(new \Slim\Views\TwigExtension($c['router'], $basePath));
103108

104-
$this->offsetSet('subfolder', $c->subfolder);
109+
$this->offsetSet('subfolder', self::SUBFOLDER);
105110
$this->offsetSet('theme', $this->misc->getConf('theme'));
106111
$this->offsetSet('Favicon', $this->icon('Favicon'));
107112
$this->offsetSet('Introduction', $this->icon('Introduction'));

src/controllers/DataimportController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public function render()
3737
/**
3838
* Character data handler for XML import feature.
3939
*
40-
* @param $parser
41-
* @param $cdata
40+
* @param resource $parser
41+
* @param string $cdata
4242
*/
4343
$_charHandler = static function ($parser, $cdata) use (&$state, &$curr_col_val): void {
4444
if ('COLUMN' === $state) {

0 commit comments

Comments
 (0)