Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: "phpDocumentor/.github/.github/workflows/static-analysis.yml@main"
with:
php-version: "8.2"
php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix"
php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix, iconv"

unit-tests:
name: "Unit test"
Expand Down
12 changes: 4 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"homepage": "http://www.phpdoc.org",
"license": "MIT",
"autoload": {
"files": [
"src/php-parser/Modifiers.php"
],
"psr-4": {
"phpDocumentor\\": "src/phpDocumentor"
}
Expand All @@ -26,7 +23,7 @@
"require": {
"php": "8.2.*|8.3.*|8.4.*|8.5.*",
"composer-runtime-api": "^2",
"nikic/php-parser": "~4.18 || ^5.0",
"nikic/php-parser": "^5.5",
"phpdocumentor/reflection-common": "^2.1",
"phpdocumentor/reflection-docblock": "^6.0",
"phpdocumentor/type-resolver": "^2.0",
Expand All @@ -39,12 +36,11 @@
"mikey179/vfsstream": "~1.2",
"mockery/mockery": "~1.6.0",
"phpspec/prophecy-phpunit": "^2.4",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-webmozart-assert": "^1.2",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-webmozart-assert": "^2.0",
"phpunit/phpunit": "^10.5.53",
"psalm/phar": "^6.0",
"rector/rector": "^1.0.0",
"squizlabs/php_codesniffer": "^3.8"
},
"config": {
Expand Down
102 changes: 19 additions & 83 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,4 @@ parameters:
- src

level: max
ignoreErrors:

- '#Method phpDocumentor\\Reflection\\File\\LocalFile::md5\(\) should return string but returns string\|false\.#'
#
# all these $fqsen errors indicate the need for a decorator class around PhpParser\Node to hold the public $fqsen that Reflection is giving it)
#
# src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
- '#Method phpDocumentor\\Reflection\\Php\\Factory\\(.*)::getFqsen\(\) should return phpDocumentor\\Reflection\\Fqsen but returns mixed\.#'
- '#Parameter \#1 \$fqsen of class phpDocumentor\\Reflection\\Php\\(.*) constructor expects phpDocumentor\\Reflection\\Fqsen, mixed given\.#'
- '#Parameter \#1 \$fqsen of method phpDocumentor\\Reflection\\Php\\File::addNamespace\(\) expects phpDocumentor\\Reflection\\Fqsen, mixed given\.#'
#
# Type hint in php-parser is incorrect.
- '#Cannot cast PhpParser\\Node\\Expr\|string to string.#'

- '#Parameter \#2 \$object of method phpDocumentor\\Reflection\\Php\\ProjectFactoryStrategy::matches\(\) expects object, mixed given.#'
- '#Method phpDocumentor\\Reflection\\Php\\ValueEvaluator\\ConstantEvaluator::evaluate\(\) should return string but returns mixed.#'
91 changes: 9 additions & 82 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="6.8.2@720ed6b578ac24f9543c65c3d4cecea0ff348ccd">
<files psalm-version="6.16.1@f1f5de594dc76faf8784e02d3dc4716c91c6f6ac">
<file src="src/phpDocumentor/Reflection/File/LocalFile.php">
<FalsableReturnStatement>
<code><![CDATA[md5_file($this->path)]]></code>
</FalsableReturnStatement>
<InvalidFalsableReturnType>
<code><![CDATA[string]]></code>
</InvalidFalsableReturnType>
<UnusedClass>
<code><![CDATA[LocalFile]]></code>
</UnusedClass>
Expand All @@ -18,12 +12,6 @@
</PossiblyUnusedMethod>
</file>
<file src="src/phpDocumentor/Reflection/Middleware/ChainFactory.php">
<MissingClosureParamType>
<code><![CDATA[$command]]></code>
</MissingClosureParamType>
<MixedArgument>
<code><![CDATA[$command]]></code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code><![CDATA[$lastCallable]]></code>
</MixedArgumentTypeCoercion>
Expand Down Expand Up @@ -59,9 +47,6 @@
</PossiblyUndefinedMethod>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/ClassConstantIterator.php">
<MixedReturnStatement>
<code><![CDATA[$this->classConstants->consts[$this->index]->getAttribute('fqsen')]]></code>
</MixedReturnStatement>
<PossiblyUnusedMethod>
<code><![CDATA[getName]]></code>
<code><![CDATA[isPublic]]></code>
Expand All @@ -71,55 +56,19 @@
<ImplicitToStringCast>
<code><![CDATA[$object->extends]]></code>
</ImplicitToStringCast>
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/ConstructorPromotion.php">
<ImplicitToStringCast>
<code><![CDATA[$methodContainer->getFqsen()]]></code>
</ImplicitToStringCast>
<PossiblyInvalidCast>
<code><![CDATA[$param->var->name]]></code>
</PossiblyInvalidCast>
<RedundantCondition>
<code><![CDATA[$param->hooks]]></code>
</RedundantCondition>
<TypeDoesNotContainType>
<code><![CDATA[[]]]></code>
</TypeDoesNotContainType>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/EnumCase.php">
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Enum_.php">
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/File.php">
<MissingClosureParamType>
<code><![CDATA[$command]]></code>
</MissingClosureParamType>
<MixedArgument>
<code><![CDATA[$command]]></code>
<code><![CDATA[$file]]></code>
</MixedArgument>
<MixedAssignment>
<code><![CDATA[$file]]></code>
</MixedAssignment>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Function_.php">
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/GlobalConstantIterator.php">
<MixedReturnStatement>
<code><![CDATA[$this->constant->consts[$this->index]->getAttribute('fqsen')]]></code>
</MixedReturnStatement>
<PossiblyUnusedMethod>
<code><![CDATA[getName]]></code>
</PossiblyUnusedMethod>
Expand All @@ -129,26 +78,15 @@
<code><![CDATA[IfStatement]]></code>
</ClassMustBeFinal>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Interface_.php">
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Method.php">
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
<UndefinedMethod>
<code><![CDATA[addMethod]]></code>
</UndefinedMethod>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Namespace_.php">
<ClassMustBeFinal>
<code><![CDATA[Namespace_]]></code>
</ClassMustBeFinal>
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen') ?? new Fqsen('\\')]]></code>
</MixedArgument>
<MixedAssignment>
<code><![CDATA[$rawFqsen]]></code>
</MixedAssignment>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Noop.php">
<ClassMustBeFinal>
Expand All @@ -169,23 +107,20 @@
</PropertyNotSetInConstructor>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/PropertyIterator.php">
<MixedReturnStatement>
<code><![CDATA[$this->property->props[$this->index]->getAttribute('fqsen')]]></code>
</MixedReturnStatement>
<PossiblyUnusedMethod>
<code><![CDATA[getName]]></code>
</PossiblyUnusedMethod>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Reducer/Attribute.php">
<RedundantCondition>
<code><![CDATA[assert($attrGroup instanceof AttributeGroup)]]></code>
</RedundantCondition>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Reducer/Parameter.php">
<ClassMustBeFinal>
<code><![CDATA[Parameter]]></code>
</ClassMustBeFinal>
</file>
<file src="src/phpDocumentor/Reflection/Php/Factory/Trait_.php">
<MixedArgument>
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
</MixedArgument>
</file>
<file src="src/phpDocumentor/Reflection/Php/NodesFactory.php">
<ClassMustBeFinal>
<code><![CDATA[NodesFactory]]></code>
Expand All @@ -209,18 +144,10 @@
</PossiblyUnusedMethod>
</file>
<file src="src/phpDocumentor/Reflection/Php/ProjectFactoryStrategies.php">
<MixedArgument>
<code><![CDATA[$object]]></code>
</MixedArgument>
<MixedPropertyTypeCoercion>
<code><![CDATA[new SplPriorityQueue()]]></code>
</MixedPropertyTypeCoercion>
</file>
<file src="src/phpDocumentor/Reflection/Php/ValueEvaluator/ConstantEvaluator.php">
<MixedReturnStatement>
<code><![CDATA[$evaluator->evaluateSilently($expr)]]></code>
</MixedReturnStatement>
</file>
<file src="src/phpDocumentor/Reflection/Types/NamespaceNodeToContext.php">
<ClassMustBeFinal>
<code><![CDATA[NamespaceNodeToContext]]></code>
Expand Down
Loading
Loading