Skip to content

Commit a3ff666

Browse files
committed
Merge remote-tracking branch 'origin/main' into main
* origin/main: Misc code improvements Improve README Fix CI, add tools Improve bootstrap Update README.md Update README.md Update README.md Update README.md # Conflicts: # README.md # src/voku/PhpDocFixer/CliCommand/PhpDocFixerCommand.php # src/voku/PhpDocFixer/ReadXmlDocs/XmlReader.php
2 parents b03391a + 1aa8ffd commit a3ff666

File tree

6 files changed

+23
-45
lines changed

6 files changed

+23
-45
lines changed

.phive/phars.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="scrutinizer-ci/ocular" version="^1.6.0" installed="1.6.0" location="./tools/ocular" copy="false"/>
4+
<phar name="box-project/box" version="^3.9.0" installed="3.9.0" location="./tools/box" copy="false"/>
5+
<phar name="php-cs-fixer" version="^2.16.4" installed="2.16.4" location="./tools/php-cs-fixer" copy="false"/>
6+
</phive>

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ jobs:
1717
fast_finish: true
1818
include:
1919
- php: 7.4
20-
- php: 7.3
2120
after_script:
2221
- travis_retry composer require --no-interaction --prefer-dist --optimize-autoloader php-coveralls/php-coveralls
2322
- vendor/bin/php-coveralls -v
2423
- tools/ocular code-coverage:upload --format=php-clover build/logs/clover.xml
2524
- bash <(curl -s "https://codecov.io/bash") -Z
26-
- php: 7.2
27-
- php: nightly
25+
- name: "PHP 8.0"
26+
php: nightly
2827
- name: "Coding style"
2928
php: 7.4
3029
install: "skip"
@@ -34,10 +33,9 @@ jobs:
3433
- name: "Static analysis"
3534
php: 7.4
3635
install:
37-
- travis_retry composer require --no-interaction --prefer-dist --optimize-autoloader phpstan/phpstan
38-
- travis_retry composer require --no-interaction --prefer-dist --optimize-autoloader vimeo/psalm
36+
- travis_retry composer require --no-interaction --prefer-dist --optimize-autoloader phpstan/phpstan vimeo/psalm
3937
script:
40-
- php bin/phpdocfixer analyse src
38+
- php bin/phpdocfixer run src/
4139
- vendor/bin/phpstan analyse
4240
- vendor/bin/psalm
4341
- name: "Compile PHAR"

README.md

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,12 @@
1-
[![Build Status](https://travis-ci.com/voku/php-doc-fixer.svg?branch=master)](https://travis-ci.com/voku/php-doc-fixer)
2-
[![Latest Stable Version](https://poser.pugx.org/voku/php-doc-fixer/v/stable)](https://packagist.org/packages/voku/php-doc-fixer)
3-
[![License](https://poser.pugx.org/voku/php-doc-fixer/license)](https://packagist.org/packages/voku/php-doc-fixer)
4-
[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken)
5-
[![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku)
61

72
# ***PHP-Documentation-Check***
83

94
This is a experiment! Lets check and fix the php documentation automatically.
105

6+
```bash
7+
git clone https://github.com/php/doc-en.git
8+
git clone https://github.com/voku/php-doc-fixer.git
9+
cd php-doc-fixer/
10+
composer update --prefer-dist
11+
php bin/phpdocfixer run [--auto-fix="true"] ../doc-en/reference
1112
```
12-
git clone https://github.com/php/doc-en
13-
cd ..
14-
git clone https://github.com/voku/php-doc-fixer
15-
composer install
16-
php bin/phpdocfixer run [--auto-fix="true"] doc-en/reference
17-
```
18-
19-
### Support
20-
21-
For support and donations please visit [Github](https://github.com/voku/simple_html_dom/) | [Issues](https://github.com/voku/simple_html_dom/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku).
22-
23-
For status updates and release announcements please visit [Releases](https://github.com/voku/simple_html_dom/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts).
24-
25-
For professional support please contact [me](https://about.me/voku).
26-
27-
### Thanks
28-
29-
- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc.
30-
- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm!
31-
- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there!
32-
- Thanks to [StyleCI](https://styleci.io/) for the simple but powerfull code style check.
33-
- Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code!

bin/phpdocfixer.php

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

77
use Symfony\Component\Console\Application;
88

9-
require_once __DIR__ . "/../vendor/autoload.php";
9+
require_once dirname(__DIR__) . '/vendor/autoload.php';
1010

1111
(static function () {
1212
error_reporting(E_ALL);
1313
ini_set('display_errors', 'stderr');
1414

15-
\define('__PHPDOCFIXER_RUNNING__', true);
15+
define('__PHPDOCFIXER_RUNNING__', true);
1616

1717
$app = new Application('PhpDocFixer');
1818

psalm.xml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xmlns="https://getpsalm.org/schema/config"
55
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
6-
totallyTyped="false"
7-
allowPhpStormGenerics="true"
6+
totallyTyped="true"
7+
errorLevel="1"
88
>
99
<projectFiles>
1010
<directory name="src" />
@@ -14,14 +14,8 @@
1414
</projectFiles>
1515

1616
<issueHandlers>
17-
<InternalClass errorLevel="suppress" />
1817
<MoreSpecificReturnType errorLevel="suppress" />
1918
<LessSpecificReturnStatement errorLevel="suppress" />
20-
<MoreSpecificImplementedParamType errorLevel="suppress" />
21-
<UnresolvableInclude errorLevel="suppress" />
22-
<ParamNameMismatch errorLevel="suppress" />
23-
<ForbiddenCode errorLevel="suppress" />
24-
<RedundantCondition errorLevel="suppress" />
2519
</issueHandlers>
2620

2721
</psalm>

src/voku/PhpDocFixer/PhpStormStubs/PhpStormStubsReader.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ public function parse(): array
3333

3434
foreach ($phpCode->getClasses() as $class) {
3535
$methodInfo = $class->getMethodsInfo();
36+
$className = (string) $class->name;
3637
foreach ($methodInfo as $methodName => $info) {
37-
$return[$class->name . '::' . $methodName]['return'] = \ltrim($info['returnTypes']['typeFromPhpDocSimple'] ?? '', '\\');
38+
$return[$className . '::' . $methodName]['return'] = \ltrim($info['returnTypes']['typeFromPhpDocSimple'] ?? '', '\\');
3839
foreach ($info['paramsTypes'] as $paramName => $paramTypes) {
39-
$return[$class->name . '::' . $methodName]['params'][$paramName] = \ltrim($paramTypes['typeFromPhpDocSimple'] ?? '', '\\');
40+
$return[$className . '::' . $methodName]['params'][$paramName] = \ltrim($paramTypes['typeFromPhpDocSimple'] ?? '', '\\');
4041
}
4142
}
4243
}

0 commit comments

Comments
 (0)