diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | composer.json | 1 | ||||
-rw-r--r-- | composer.lock | 307 | ||||
-rw-r--r-- | mk_linters.mk | 58 | ||||
-rw-r--r-- | src/classes/CheckStyleRenderer.php | 123 | ||||
-rw-r--r-- | src/controllers/BaseController.php | 2 | ||||
-rw-r--r-- | src/controllers/DatabaseController.php | 7 | ||||
-rw-r--r-- | src/controllers/DbexportController.php | 2 | ||||
-rw-r--r-- | src/controllers/DisplayController.php | 24 | ||||
-rw-r--r-- | src/controllers/FulltextController.php | 4 | ||||
-rw-r--r-- | src/controllers/FunctionsController.php | 3 | ||||
-rw-r--r-- | src/controllers/SqlController.php | 2 | ||||
-rw-r--r-- | src/controllers/TblpropertiesController.php | 13 | ||||
-rw-r--r-- | src/controllers/TreeController.php | 1 | ||||
-rw-r--r-- | tests/unit/ContainerTest.php | 7 |
15 files changed, 513 insertions, 44 deletions
@@ -64,3 +64,6 @@ tools/phpmd_checkstyle .phive tools/reviewdog + +temp/*.checkstyle* + diff --git a/composer.json b/composer.json index f0711d33..6aedb29f 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "friendsofphp/php-cs-fixer": "^2.16", "kint-php/kint": "~3.3", "php-parallel-lint/php-parallel-lint": "^1.2", + "phpmd/phpmd": "^2.9", "phpstan/phpstan": "^0.12.64", "rector/rector-prefixed": "^0.9", "simpletest/simpletest": "^1.2", diff --git a/composer.lock b/composer.lock index f49394e0..6da8c93f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "481ffafa3136ff0e1e2b1372ef20f300", + "content-hash": "9bb8bf233306d98032ae2d7008494e2e", "packages": [ { "name": "adodb/adodb-php", @@ -2922,6 +2922,63 @@ "time": "2020-10-15T08:29:30+00:00" }, { + "name": "pdepend/pdepend", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/pdepend/pdepend.git", + "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", + "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", + "shasum": "" + }, + "require": { + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3|^4|^5", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5", + "symfony/filesystem": "^2.3.0|^3|^4|^5" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0 || ^1.2.3", + "gregwar/rst": "^1.0", + "phpunit/phpunit": "^4.8.35|^5.7", + "squizlabs/php_codesniffer": "^2.0.0" + }, + "bin": [ + "src/bin/pdepend" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Official version of pdepend to be handled with Composer", + "support": { + "issues": "https://github.com/pdepend/pdepend/issues", + "source": "https://github.com/pdepend/pdepend/tree/master" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" + } + ], + "time": "2020-06-20T10:53:13+00:00" + }, + { "name": "phar-io/manifest", "version": "2.0.1", "source": { @@ -3303,6 +3360,89 @@ "time": "2020-09-17T18:55:26+00:00" }, { + "name": "phpmd/phpmd", + "version": "2.9.1", + "source": { + "type": "git", + "url": "https://github.com/phpmd/phpmd.git", + "reference": "ce10831d4ddc2686c1348a98069771dd314534a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/ce10831d4ddc2686c1348a98069771dd314534a8", + "reference": "ce10831d4ddc2686c1348a98069771dd314534a8", + "shasum": "" + }, + "require": { + "composer/xdebug-handler": "^1.0", + "ext-xml": "*", + "pdepend/pdepend": "^2.7.1", + "php": ">=5.3.9" + }, + "require-dev": { + "easy-doc/easy-doc": "0.0.0 || ^1.3.2", + "ext-json": "*", + "ext-simplexml": "*", + "gregwar/rst": "^1.0", + "mikey179/vfsstream": "^1.6.4", + "phpunit/phpunit": "^4.8.36 || ^5.7.27", + "squizlabs/php_codesniffer": "^2.0" + }, + "bin": [ + "src/bin/phpmd" + ], + "type": "library", + "autoload": { + "psr-0": { + "PHPMD\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" + }, + { + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" + } + ], + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "https://phpmd.org/", + "keywords": [ + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "support": { + "irc": "irc://irc.freenode.org/phpmd", + "issues": "https://github.com/phpmd/phpmd/issues", + "source": "https://github.com/phpmd/phpmd/tree/2.9.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } + ], + "time": "2020-09-23T22:06:32+00:00" + }, + { "name": "phpspec/prophecy", "version": "1.12.1", "source": { @@ -5113,6 +5253,84 @@ "time": "2020-09-26T11:36:44+00:00" }, { + "name": "symfony/config", + "version": "v5.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "d0a82d965296083fe463d655a3644cbe49cbaa80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/d0a82d965296083fe463d655a3644cbe49cbaa80", + "reference": "d0a82d965296083fe463d655a3644cbe49cbaa80", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/filesystem": "^4.4|^5.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "symfony/finder": "<4.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/yaml": "^4.4|^5.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Config Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-12-09T18:54:12+00:00" + }, + { "name": "symfony/console", "version": "v5.1.7", "source": { @@ -5279,6 +5497,93 @@ "time": "2020-05-20T17:43:50+00:00" }, { + "name": "symfony/dependency-injection", + "version": "v5.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "7f8a9e9eff0581a33e20f6c5d41096fe22832d25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7f8a9e9eff0581a33e20f6c5d41096fe22832d25", + "reference": "7f8a9e9eff0581a33e20f6c5d41096fe22832d25", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.1", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "symfony/config": "<5.1", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0" + }, + "require-dev": { + "symfony/config": "^5.1", + "symfony/expression-language": "^4.4|^5.0", + "symfony/yaml": "^4.4|^5.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony DependencyInjection Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v5.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-12-18T08:03:05+00:00" + }, + { "name": "symfony/event-dispatcher", "version": "v5.1.7", "source": { diff --git a/mk_linters.mk b/mk_linters.mk index faa2b816..e4cc0ff2 100644 --- a/mk_linters.mk +++ b/mk_linters.mk @@ -61,26 +61,29 @@ update_baselines: .PHONY:abort_suggesting_composer check_executable_or_exit_with_phive update_baselines -phpmd: package_name:=phpmd -phpmd: executable:=tools/phpmd -phpmd: - @${MAKE} check_executable_or_exit_with_phive executable=$(executable) package_name=$(package_name) --no-print-directory - @$(executable) src text .phpmd.xml --exclude=src/help/*,src/translations/* - +phpmd: + $(eval executable:=vendor/bin/phpmd) + $(eval package_name:=phpmd/phpmd) +ifeq (,$(reportformat)) + $(eval reportformat='ansi') +endif + @${MAKE} abort_suggesting_composer executable=$(executable) package_name=$(package_name) --no-print-directory + @$(executable) src $(reportformat) .phpmd.xml --exclude=src/help/*,src/translations/* -phpmd_checkstyle: package_name:=phpmd -phpmd_checkstyle: executable:=$(shell command -v phpmd 2> /dev/null) phpmd_checkstyle: - @$(executable) src json .phpmd.xml --exclude=src/help/*,src/translations/* > temp/phpmd.report.json ;\ - echo -e "$(GREEN)Finished PHPMD$(WHITE): waiting 1s" - @sleep 1 ;\ - php tools/phpmd_checkstyle ;\ + $(eval executable:=vendor/bin/phpmd) + $(eval package_name:=phpmd/phpmd) +ifeq (,$(reportformat)) + $(eval reportformat='ansi') +endif + @${MAKE} abort_suggesting_composer executable=$(executable) package_name=$(package_name) --no-print-directory + @$(executable) src PHPPgAdmin\\\CheckStyleRenderer .phpmd.xml --exclude=src/help/*,src/translations/* | vendor/bin/cs2pr --colorize ;\ echo -e "$(GREEN)Formatted PHPMD$(WHITE): as checkStyle" - cat temp/phpmd.checkstyle.xml | vendor/bin/cs2pr + -csfixer: package_name:=friendsofphp/php-cs-fixer -csfixer: executable:=vendor/bin/php-cs-fixer csfixer: + $(eval executable:=vendor/bin/php-cs-fixer) + $(eval package_name:=friendsofphp/php-cs-fixer) ifeq (,$(reportformat)) $(eval reportformat='txt') endif @@ -96,24 +99,27 @@ csfixer_checkstyle: csfixer_dry: @${MAKE} csfixer dry_run='--dry-run' --no-print-directory - -phpcs: package_name=phpcs -phpcs: executable:= $(shell command -v phpcs 2> /dev/null) +PHPCS_SENTENCE:=--standard=.phpcs.xml --parallel=2 --cache=.build/phpcs/php-cs.cache src + +phpcs_reqs: + $(eval executable:=tools/phpcs) + $(eval package_name:=phpcs) + @${MAKE} check_executable_or_exit_with_phive executable=$(executable) package_name=$(package_name) --no-print-directory + +phpcs: phpcs_reqs phpcs: ifeq (,$(reportformat)) $(eval reportformat='diff') endif - @${MAKE} check_executable_or_exit_with_phive executable=$(executable) package_name=$(package_name) --no-print-directory - @mkdir -p .build/phpcs && touch .build/phpcs/php-cs.cache - $(executable) --standard=.phpcs.xml --parallel=2 --cache=.build/phpcs/php-cs.cache --report=$(reportformat) src/* - + @mkdir -p .build/phpcs && touch .build/phpcs/php-cs.cache ;\ + echo wait... ;\ + $(executable) --report=$(reportformat) $(PHPCS_SENTENCE) +phpcs_checkstyle: phpcs_reqs phpcs_checkstyle: - @${MAKE} phpcs reportformat=checkstyle --no-print-directory > temp/phpcs.checkstyle.xml ;\ - echo -e "Finished $(GREEN)phpcs$(WHITE): waiting 1s" - @sleep 1 ;\ - cat temp/phpcs.checkstyle.xml | vendor/bin/cs2pr + $(eval reportformat='checkstyle') + @$(executable) --report=$(reportformat) $(PHPCS_SENTENCE) | grep '<' > temp/phpcs.checkstyle.xml 2>&1; vendor/bin/cs2pr < temp/phpcs.checkstyle.xml psalm: diff --git a/src/classes/CheckStyleRenderer.php b/src/classes/CheckStyleRenderer.php new file mode 100644 index 00000000..8d3dc2c2 --- /dev/null +++ b/src/classes/CheckStyleRenderer.php @@ -0,0 +1,123 @@ +<?php + +/** + * PHPPgAdmin 6.1.3 + */ +namespace PHPPgAdmin; + +use PHPMD\PHPMD; +use PHPMD\Report; +use PHPMD\Renderer\XMLRenderer; + +/** + * This class will render a Java-checkstyle compatible xml-report. + * for use with cs2pr and others + */ +class CheckStyleRenderer extends XMLRenderer +{ + /** + * Temporary property that holds the name of the last rendered file, it is + * used to detect the next processed file. + * + * @var string + */ + private $fileName; + + /** + * Get a violation severity level according to the priority + * of the rule that's being broken + * @see https://checkstyle.sourceforge.io/version/4.4/property_types.html#severity + * - priority 1 maps to error level severity + * - priority 2 maps to warning level severity + * - priority > 2 maps to info level severity + * + * @param integer $priority priority of the broken rule + * @return string either error, warning or info + */ + protected function mapPriorityToSeverity($priority) + { + if ($priority>2) { + return 'info'; + } + return $priority===2? 'warning':'error'; + } + /** + * This method will be called when the engine has finished the source analysis + * phase. + * + * @param \PHPMD\Report $report + */ + public function renderReport(Report $report) + { + $writer = $this->getWriter(); + $writer->write('<checkstyle>'); + $writer->write(\PHP_EOL); + + foreach ($report->getRuleViolations() as $violation) { + $fileName = $violation->getFileName(); + + if ($this->fileName !== $fileName) { + // Not first file + if (null !== $this->fileName) { + $writer->write(' </file>' . \PHP_EOL); + } + // Store current file name + $this->fileName = $fileName; + + $writer->write(' <file name="' . $fileName . '">' . \PHP_EOL); + } + + $rule = $violation->getRule(); + + $writer->write(' <error'); + $writer->write(' line="' . $violation->getBeginLine() . '"'); + $writer->write(' endline="' . $violation->getEndLine() . '"'); + $writer->write(\sprintf(' severity="%s"', $this->mapPriorityToSeverity($rule->getPriority()))); + $writer->write(\sprintf( + ' message="%s (%s, %s) "', + \htmlspecialchars($violation->getDescription()), + $rule->getName(), + $rule->getRuleSetName() + )); + + $this->maybeAdd('package', $violation->getNamespaceName()); + $this->maybeAdd('externalInfoUrl', $rule->getExternalInfoUrl()); + $this->maybeAdd('function', $violation->getFunctionName()); + $this->maybeAdd('class', $violation->getClassName()); + $this->maybeAdd('method', $violation->getMethodName()); + //$this->_maybeAdd('variable', $violation->getVariableName()); + + $writer->write(' />' . \PHP_EOL); + } + + // Last file and at least one violation + if (null !== $this->fileName) { + $writer->write(' </file>' . \PHP_EOL); + } + + foreach ($report->getErrors() as $error) { + $writer->write(' <file name="' . $error->getFile() . '">'); + $writer->write($error->getFile()); + $writer->write('<error msg="'); + $writer->write(\htmlspecialchars($error->getMessage())); + $writer->write(' severity="error" />' . \PHP_EOL); + } + + $writer->write('</checkstyle>' . \PHP_EOL); + } + /** + * This method will write a xml attribute named <b>$attr</b> to the output + * when the given <b>$value</b> is not an empty string and is not <b>null</b>. + * + * @param string $attr The xml attribute name. + * @param string $value The attribute value. + * @return void + */ + protected function maybeAdd($attr, $value) + { + if ($value === null || trim($value) === '') { + return; + } + $this->getWriter()->write(' ' . $attr . '="' . $value . '"'); + } +}
\ No newline at end of file diff --git a/src/controllers/BaseController.php b/src/controllers/BaseController.php index 110516a9..22d8d373 100644 --- a/src/controllers/BaseController.php +++ b/src/controllers/BaseController.php @@ -166,8 +166,6 @@ class BaseController /** * Default method to render the controller according to the action parameter. It should return with a PSR * responseObject but it prints texts whatsoeever. - * - * @return void */ public function render() { diff --git a/src/controllers/DatabaseController.php b/src/controllers/DatabaseController.php index 1c6b9192..16277dd6 100644 --- a/src/controllers/DatabaseController.php +++ b/src/controllers/DatabaseController.php @@ -144,6 +144,8 @@ class DatabaseController extends BaseController } /** + * @param mixed $print + * * @return \Slim\Http\Response|string */ public function doTree($print = true) @@ -659,6 +661,9 @@ class DatabaseController extends BaseController } /** + * @param mixed $string + * @param mixed $term + * * @return string */ private function _highlight($string, $term) @@ -670,6 +675,8 @@ class DatabaseController extends BaseController } /** + * @param string $curr + * * @return string */ private function _printTypeOption(string $curr) diff --git a/src/controllers/DbexportController.php b/src/controllers/DbexportController.php index 4c451dfc..94a236ae 100644 --- a/src/controllers/DbexportController.php +++ b/src/controllers/DbexportController.php @@ -14,7 +14,7 @@ class DbexportController extends BaseController /** * Default method to render the controller according to the action parameter. */ - public function render() + public function render() { $data = $this->misc->getDatabaseAccessor(); diff --git a/src/controllers/DisplayController.php b/src/controllers/DisplayController.php index 6a7d20e7..0a32e583 100644 --- a/src/controllers/DisplayController.php +++ b/src/controllers/DisplayController.php @@ -278,9 +278,12 @@ class DisplayController extends BaseController } /** - * @return (mixed|string)[] - * * @psalm-return array{0: mixed, 1: string, 2: string} + * + * @param mixed $data + * @param mixed $object + * + * @return (mixed|string)[] */ public function getQueryTitleAndType($data, $object) { @@ -1108,9 +1111,15 @@ class DisplayController extends BaseController } /** - * @return (((((mixed|string)[]|string)[][]|mixed)[][]|string)[]|iterable)[] - * * @psalm-return array{0: array{actionbuttons: array{edit: array{content: mixed, attr: array{href: array{url: string, urlvars: array{action: mixed|string, strings: mixed, page: mixed}}}}, delete: array{content: mixed, attr: array{href: array{url: string, urlvars: array{action: mixed|string, strings: mixed, page: mixed}}}}}, place: string}, 1: array<empty, empty>|iterable} + * + * @param object $resultset + * @param mixed $object + * @param mixed $data + * @param mixed $page + * @param array $_gets + * + * @return (((((mixed|string)[]|string)[][]|mixed)[][]|string)[]|iterable)[] */ private function _getKeyAndActions(object $resultset, $object, $data, $page, array $_gets) { @@ -1301,9 +1310,12 @@ class DisplayController extends BaseController } /** - * @return int[] - * * @psalm-return array{0: int, 1: int} + * + * @param int $page + * @param int $pages + * + * @return int[] */ private function _getMinMaxPages(int $page, int $pages) { diff --git a/src/controllers/FulltextController.php b/src/controllers/FulltextController.php index 476c4574..e14d6249 100644 --- a/src/controllers/FulltextController.php +++ b/src/controllers/FulltextController.php @@ -252,7 +252,9 @@ class FulltextController extends BaseController } /** - * @return \Slim\Http\Response|null|string + * @param mixed $what + * + * @return null|\Slim\Http\Response|string */ public function doSubTree($what) { diff --git a/src/controllers/FunctionsController.php b/src/controllers/FunctionsController.php index 95b99922..cbd71e80 100644 --- a/src/controllers/FunctionsController.php +++ b/src/controllers/FunctionsController.php @@ -1439,6 +1439,9 @@ class FunctionsController extends BaseController } /** + * @param mixed $data + * @param mixed $fndata + * * @return string */ private function _getNamedParamsArgs($data, $fndata) diff --git a/src/controllers/SqlController.php b/src/controllers/SqlController.php index 9b8521f6..6da26277 100644 --- a/src/controllers/SqlController.php +++ b/src/controllers/SqlController.php @@ -191,7 +191,7 @@ class SqlController extends BaseController } /** - * @return ADORecordSet|null + * @return null|ADORecordSet */ private function execute_query() { diff --git a/src/controllers/TblpropertiesController.php b/src/controllers/TblpropertiesController.php index b49d5bbd..b0d60606 100644 --- a/src/controllers/TblpropertiesController.php +++ b/src/controllers/TblpropertiesController.php @@ -858,9 +858,11 @@ class TblpropertiesController extends BaseController } /** - * @return \Closure - * * @psalm-return \Closure(mixed, mixed):mixed + * + * @param mixed $data + * + * @return \Closure */ private function _getAttPre($data) { @@ -887,9 +889,12 @@ class TblpropertiesController extends BaseController } /** - * @return \Closure - * * @psalm-return \Closure(mixed, mixed):string + * + * @param mixed $misc + * @param mixed $data + * + * @return \Closure */ private function _getCstrRender($misc, $data) { diff --git a/src/controllers/TreeController.php b/src/controllers/TreeController.php index 32ee9434..6e4be3db 100644 --- a/src/controllers/TreeController.php +++ b/src/controllers/TreeController.php @@ -10,7 +10,6 @@ use PHPPgAdmin\ArrayRecordSet; use PHPPgAdmin\ContainerUtils; use PHPPgAdmin\Decorators\Decorator; use PHPPgAdmin\Traits\HelperTrait; -use Slim\Http\Response; /** * Base TreeController controller class. diff --git a/tests/unit/ContainerTest.php b/tests/unit/ContainerTest.php index 122c7325..7c7099a5 100644 --- a/tests/unit/ContainerTest.php +++ b/tests/unit/ContainerTest.php @@ -19,7 +19,12 @@ class ContainerTest extends \Codeception\Test\Unit */ protected $tester; - protected ?\PHPPgAdmin\ContainerUtils $container; + /** + * Undocumented variable. + * + * @var null|\PHPPgAdmin\ContainerUtils + */ + protected $container; public function testContainerValidity(): void { |