Skip to content

Commit acdfaeb

Browse files
authored
Merge pull request #745 from phpDocumentor/cleanup
Remove old code
2 parents 6544c3b + cdaacdf commit acdfaeb

42 files changed

Lines changed: 161 additions & 432 deletions

Some content is hidden

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

.github/workflows/integrate.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
uses: "phpDocumentor/.github/.github/workflows/static-analysis.yml@main"
5858
with:
5959
php-version: "8.2"
60-
php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix"
60+
php-extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter, fileinfo, pcntl, posix, iconv"
6161

6262
unit-tests:
6363
name: "Unit test"

composer.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
"homepage": "http://www.phpdoc.org",
66
"license": "MIT",
77
"autoload": {
8-
"files": [
9-
"src/php-parser/Modifiers.php"
10-
],
118
"psr-4": {
129
"phpDocumentor\\": "src/phpDocumentor"
1310
}
@@ -26,7 +23,7 @@
2623
"require": {
2724
"php": "8.2.*|8.3.*|8.4.*|8.5.*",
2825
"composer-runtime-api": "^2",
29-
"nikic/php-parser": "~4.18 || ^5.0",
26+
"nikic/php-parser": "^5.5",
3027
"phpdocumentor/reflection-common": "^2.1",
3128
"phpdocumentor/reflection-docblock": "^6.0",
3229
"phpdocumentor/type-resolver": "^2.0",
@@ -39,12 +36,11 @@
3936
"mikey179/vfsstream": "~1.2",
4037
"mockery/mockery": "~1.6.0",
4138
"phpspec/prophecy-phpunit": "^2.4",
42-
"phpstan/extension-installer": "^1.1",
43-
"phpstan/phpstan": "^1.8",
44-
"phpstan/phpstan-webmozart-assert": "^1.2",
39+
"phpstan/extension-installer": "^1.4",
40+
"phpstan/phpstan": "^2.0",
41+
"phpstan/phpstan-webmozart-assert": "^2.0",
4542
"phpunit/phpunit": "^10.5.53",
4643
"psalm/phar": "^6.0",
47-
"rector/rector": "^1.0.0",
4844
"squizlabs/php_codesniffer": "^3.8"
4945
},
5046
"config": {

composer.lock

Lines changed: 19 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,4 @@ parameters:
33
- src
44

55
level: max
6-
ignoreErrors:
76

8-
- '#Method phpDocumentor\\Reflection\\File\\LocalFile::md5\(\) should return string but returns string\|false\.#'
9-
#
10-
# all these $fqsen errors indicate the need for a decorator class around PhpParser\Node to hold the public $fqsen that Reflection is giving it)
11-
#
12-
# src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
13-
- '#Method phpDocumentor\\Reflection\\Php\\Factory\\(.*)::getFqsen\(\) should return phpDocumentor\\Reflection\\Fqsen but returns mixed\.#'
14-
- '#Parameter \#1 \$fqsen of class phpDocumentor\\Reflection\\Php\\(.*) constructor expects phpDocumentor\\Reflection\\Fqsen, mixed given\.#'
15-
- '#Parameter \#1 \$fqsen of method phpDocumentor\\Reflection\\Php\\File::addNamespace\(\) expects phpDocumentor\\Reflection\\Fqsen, mixed given\.#'
16-
#
17-
# Type hint in php-parser is incorrect.
18-
- '#Cannot cast PhpParser\\Node\\Expr\|string to string.#'
19-
20-
- '#Parameter \#2 \$object of method phpDocumentor\\Reflection\\Php\\ProjectFactoryStrategy::matches\(\) expects object, mixed given.#'
21-
- '#Method phpDocumentor\\Reflection\\Php\\ValueEvaluator\\ConstantEvaluator::evaluate\(\) should return string but returns mixed.#'

psalm-baseline.xml

Lines changed: 9 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.8.2@720ed6b578ac24f9543c65c3d4cecea0ff348ccd">
2+
<files psalm-version="6.16.1@f1f5de594dc76faf8784e02d3dc4716c91c6f6ac">
33
<file src="src/phpDocumentor/Reflection/File/LocalFile.php">
4-
<FalsableReturnStatement>
5-
<code><![CDATA[md5_file($this->path)]]></code>
6-
</FalsableReturnStatement>
7-
<InvalidFalsableReturnType>
8-
<code><![CDATA[string]]></code>
9-
</InvalidFalsableReturnType>
104
<UnusedClass>
115
<code><![CDATA[LocalFile]]></code>
126
</UnusedClass>
@@ -18,12 +12,6 @@
1812
</PossiblyUnusedMethod>
1913
</file>
2014
<file src="src/phpDocumentor/Reflection/Middleware/ChainFactory.php">
21-
<MissingClosureParamType>
22-
<code><![CDATA[$command]]></code>
23-
</MissingClosureParamType>
24-
<MixedArgument>
25-
<code><![CDATA[$command]]></code>
26-
</MixedArgument>
2715
<MixedArgumentTypeCoercion>
2816
<code><![CDATA[$lastCallable]]></code>
2917
</MixedArgumentTypeCoercion>
@@ -59,9 +47,6 @@
5947
</PossiblyUndefinedMethod>
6048
</file>
6149
<file src="src/phpDocumentor/Reflection/Php/Factory/ClassConstantIterator.php">
62-
<MixedReturnStatement>
63-
<code><![CDATA[$this->classConstants->consts[$this->index]->getAttribute('fqsen')]]></code>
64-
</MixedReturnStatement>
6550
<PossiblyUnusedMethod>
6651
<code><![CDATA[getName]]></code>
6752
<code><![CDATA[isPublic]]></code>
@@ -71,55 +56,19 @@
7156
<ImplicitToStringCast>
7257
<code><![CDATA[$object->extends]]></code>
7358
</ImplicitToStringCast>
74-
<MixedArgument>
75-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
76-
</MixedArgument>
7759
</file>
7860
<file src="src/phpDocumentor/Reflection/Php/Factory/ConstructorPromotion.php">
7961
<ImplicitToStringCast>
8062
<code><![CDATA[$methodContainer->getFqsen()]]></code>
8163
</ImplicitToStringCast>
82-
<PossiblyInvalidCast>
83-
<code><![CDATA[$param->var->name]]></code>
84-
</PossiblyInvalidCast>
8564
<RedundantCondition>
8665
<code><![CDATA[$param->hooks]]></code>
8766
</RedundantCondition>
8867
<TypeDoesNotContainType>
8968
<code><![CDATA[[]]]></code>
9069
</TypeDoesNotContainType>
9170
</file>
92-
<file src="src/phpDocumentor/Reflection/Php/Factory/EnumCase.php">
93-
<MixedArgument>
94-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
95-
</MixedArgument>
96-
</file>
97-
<file src="src/phpDocumentor/Reflection/Php/Factory/Enum_.php">
98-
<MixedArgument>
99-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
100-
</MixedArgument>
101-
</file>
102-
<file src="src/phpDocumentor/Reflection/Php/Factory/File.php">
103-
<MissingClosureParamType>
104-
<code><![CDATA[$command]]></code>
105-
</MissingClosureParamType>
106-
<MixedArgument>
107-
<code><![CDATA[$command]]></code>
108-
<code><![CDATA[$file]]></code>
109-
</MixedArgument>
110-
<MixedAssignment>
111-
<code><![CDATA[$file]]></code>
112-
</MixedAssignment>
113-
</file>
114-
<file src="src/phpDocumentor/Reflection/Php/Factory/Function_.php">
115-
<MixedArgument>
116-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
117-
</MixedArgument>
118-
</file>
11971
<file src="src/phpDocumentor/Reflection/Php/Factory/GlobalConstantIterator.php">
120-
<MixedReturnStatement>
121-
<code><![CDATA[$this->constant->consts[$this->index]->getAttribute('fqsen')]]></code>
122-
</MixedReturnStatement>
12372
<PossiblyUnusedMethod>
12473
<code><![CDATA[getName]]></code>
12574
</PossiblyUnusedMethod>
@@ -129,26 +78,15 @@
12978
<code><![CDATA[IfStatement]]></code>
13079
</ClassMustBeFinal>
13180
</file>
132-
<file src="src/phpDocumentor/Reflection/Php/Factory/Interface_.php">
133-
<MixedArgument>
134-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
135-
</MixedArgument>
136-
</file>
13781
<file src="src/phpDocumentor/Reflection/Php/Factory/Method.php">
138-
<MixedArgument>
139-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
140-
</MixedArgument>
14182
<UndefinedMethod>
14283
<code><![CDATA[addMethod]]></code>
14384
</UndefinedMethod>
14485
</file>
14586
<file src="src/phpDocumentor/Reflection/Php/Factory/Namespace_.php">
146-
<ClassMustBeFinal>
147-
<code><![CDATA[Namespace_]]></code>
148-
</ClassMustBeFinal>
149-
<MixedArgument>
150-
<code><![CDATA[$object->getAttribute('fqsen') ?? new Fqsen('\\')]]></code>
151-
</MixedArgument>
87+
<MixedAssignment>
88+
<code><![CDATA[$rawFqsen]]></code>
89+
</MixedAssignment>
15290
</file>
15391
<file src="src/phpDocumentor/Reflection/Php/Factory/Noop.php">
15492
<ClassMustBeFinal>
@@ -169,23 +107,20 @@
169107
</PropertyNotSetInConstructor>
170108
</file>
171109
<file src="src/phpDocumentor/Reflection/Php/Factory/PropertyIterator.php">
172-
<MixedReturnStatement>
173-
<code><![CDATA[$this->property->props[$this->index]->getAttribute('fqsen')]]></code>
174-
</MixedReturnStatement>
175110
<PossiblyUnusedMethod>
176111
<code><![CDATA[getName]]></code>
177112
</PossiblyUnusedMethod>
178113
</file>
114+
<file src="src/phpDocumentor/Reflection/Php/Factory/Reducer/Attribute.php">
115+
<RedundantCondition>
116+
<code><![CDATA[assert($attrGroup instanceof AttributeGroup)]]></code>
117+
</RedundantCondition>
118+
</file>
179119
<file src="src/phpDocumentor/Reflection/Php/Factory/Reducer/Parameter.php">
180120
<ClassMustBeFinal>
181121
<code><![CDATA[Parameter]]></code>
182122
</ClassMustBeFinal>
183123
</file>
184-
<file src="src/phpDocumentor/Reflection/Php/Factory/Trait_.php">
185-
<MixedArgument>
186-
<code><![CDATA[$object->getAttribute('fqsen')]]></code>
187-
</MixedArgument>
188-
</file>
189124
<file src="src/phpDocumentor/Reflection/Php/NodesFactory.php">
190125
<ClassMustBeFinal>
191126
<code><![CDATA[NodesFactory]]></code>
@@ -209,18 +144,10 @@
209144
</PossiblyUnusedMethod>
210145
</file>
211146
<file src="src/phpDocumentor/Reflection/Php/ProjectFactoryStrategies.php">
212-
<MixedArgument>
213-
<code><![CDATA[$object]]></code>
214-
</MixedArgument>
215147
<MixedPropertyTypeCoercion>
216148
<code><![CDATA[new SplPriorityQueue()]]></code>
217149
</MixedPropertyTypeCoercion>
218150
</file>
219-
<file src="src/phpDocumentor/Reflection/Php/ValueEvaluator/ConstantEvaluator.php">
220-
<MixedReturnStatement>
221-
<code><![CDATA[$evaluator->evaluateSilently($expr)]]></code>
222-
</MixedReturnStatement>
223-
</file>
224151
<file src="src/phpDocumentor/Reflection/Types/NamespaceNodeToContext.php">
225152
<ClassMustBeFinal>
226153
<code><![CDATA[NamespaceNodeToContext]]></code>

0 commit comments

Comments
 (0)