Skip to content

Commit 9a7fc33

Browse files
committed
Merge branch 'main' into QA_5_3
2 parents f29200f + 32c95d9 commit 9a7fc33

File tree

112 files changed

+3240
-899
lines changed

Some content is hidden

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

112 files changed

+3240
-899
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
tidelift: "packagist/code-lts/doctum"
2+
github: "williamdes"
3+

.github/SECURITY.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Supported versions for security fixes.
6+
7+
The policy: if the user can upgrade to a newer version without having a newer PHP version required:
8+
Then no fix will be made on older version ranges.
9+
10+
| Version | Supported |
11+
| ------- | ------------------ |
12+
| 5.0.x | :x: |
13+
| 5.1.x | :x: |
14+
| 5.2.x | :x: |
15+
| 5.3.x | :white_check_mark: |
16+
| > 5.3.x | :white_check_mark: |
17+
18+
## Reporting a Vulnerability
19+
20+
Please send and email to: [email protected]
21+
22+
Do not create an issue for the vulnerability until it is public somewhere on the Internet or got fixed.

.github/workflows/lint-and-analyse.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Lint and analyse files
22

3-
on:
3+
on:
44
push:
55
pull_request:
66
types: [opened, synchronize, reopened]
@@ -11,7 +11,7 @@ jobs:
1111
lint-php:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v2
1515
- name: Use php 7.1
1616
uses: shivammathur/setup-php@v2
1717
with:
@@ -25,14 +25,14 @@ jobs:
2525
path: ~/.composer/cache/
2626
key: composer-cache
2727
- name: Install dependencies
28-
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest
28+
run: composer install --no-interaction
2929
- name: Lint files
3030
run: composer run phpcs
3131

3232
analyse-php:
3333
runs-on: ubuntu-latest
3434
steps:
35-
- uses: actions/checkout@v1
35+
- uses: actions/checkout@v2
3636
- name: Use php 7.4
3737
uses: shivammathur/setup-php@v2
3838
with:
@@ -44,6 +44,6 @@ jobs:
4444
path: ~/.composer/cache/
4545
key: composer-cache
4646
- name: Install dependencies
47-
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest
47+
run: composer install --no-interaction
4848
- name: Analyse files
4949
run: composer run phpstan

.github/workflows/tests.yml

Lines changed: 63 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Run tests
22

3-
on:
3+
on:
44
push:
55
pull_request:
66
types: [opened, synchronize, reopened]
@@ -11,12 +11,17 @@ jobs:
1111
test-php:
1212
name: Test on php ${{ matrix.php-version }} and ${{ matrix.os }}
1313
runs-on: ${{ matrix.os }}
14+
continue-on-error: ${{ matrix.experimental }}
1415
strategy:
1516
matrix:
1617
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0"]
1718
os: [ubuntu-latest]
19+
experimental: [false]
20+
composer-options: ['']
21+
include:
22+
- { php-version: '8.1', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
1823
steps:
19-
- uses: actions/checkout@v1
24+
- uses: actions/checkout@v2
2025
- name: Use php ${{ matrix.php-version }}
2126
uses: shivammathur/setup-php@v2
2227
with:
@@ -29,22 +34,68 @@ jobs:
2934
path: ~/.composer/cache/
3035
key: composer-cache
3136
- name: Install dependencies
32-
if: ${{ matrix.php-version != '8.0' }}
33-
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest
34-
- name: Install dependencies for php 8.0
35-
if: ${{ matrix.php-version == '8.0' }}
36-
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest --ignore-platform-reqs
37+
run: composer install --no-interaction ${{ matrix.composer-options }}
3738
- name: Run php tests
3839
run: composer run phpunit
3940
- name: Send coverage
4041
uses: codecov/codecov-action@v1
4142

4243
test-phar:
43-
name: Run command line tests on the phar
44-
runs-on: ubuntu-latest
44+
name: Run command line tests on the phar with php ${{ matrix.php-version }} on ${{ matrix.os }}
45+
runs-on: ${{ matrix.os }}
46+
continue-on-error: ${{ matrix.experimental }}
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0"]
51+
os: [ubuntu-latest]
52+
experimental: [false]
53+
composer-options: ['']
54+
include:
55+
- { php-version: '8.1', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
4556
steps:
46-
- uses: actions/checkout@v1
57+
- uses: actions/checkout@v2
58+
- name: Use php ${{ matrix.php-version }}
59+
uses: shivammathur/setup-php@v2
60+
with:
61+
php-version: ${{ matrix.php-version }}
62+
- name: Cache module
63+
uses: actions/cache@v2
64+
with:
65+
path: ~/v2.1.8.tar.gz
66+
key: shunit2-cache
67+
- name: Setup shunit 2
68+
run: ./tests/phar/install-tests.sh
4769
- name: Run phar tests
48-
uses: sudo-bot/action-shunit2@latest
70+
run: |
71+
export PATH="$PATH:$HOME/shunit2-2.1.8/"
72+
COMPOSER_BIN="/bin/composer" COMPOSER_OPTIONS="${{ matrix.composer-options }}" ./tests/phar/tests.sh
73+
74+
test-resume-from-parse:
75+
name: Run resume from parse tests with php ${{ matrix.php-version }} on ${{ matrix.os }}
76+
runs-on: ${{ matrix.os }}
77+
continue-on-error: ${{ matrix.experimental }}
78+
strategy:
79+
fail-fast: false
80+
matrix:
81+
php-version: ["7.1", "7.2", "7.3", "7.4", "8.0"]
82+
os: [ubuntu-latest]
83+
experimental: [false]
84+
composer-options: ['']
85+
include:
86+
- { php-version: '8.1', experimental: true, os: ubuntu-latest, composer-options: '--ignore-platform-reqs' }
87+
steps:
88+
- uses: actions/checkout@v2
89+
- name: Use php ${{ matrix.php-version }}
90+
uses: shivammathur/setup-php@v2
4991
with:
50-
cli: "./tests/phar/run-tests.sh"
92+
php-version: ${{ matrix.php-version }}
93+
- name: Cache module
94+
uses: actions/cache@v2
95+
with:
96+
path: ~/.composer/cache/
97+
key: composer-cache
98+
- name: Install dependencies
99+
run: composer install --no-interaction ${{ matrix.composer-options }}
100+
- name: Run resume from parse diff tests
101+
run: ./tests/resume-from-parse-test.sh

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased] - yyyy-mm-dd
88

9+
## [5.4.0] - 2021-04-10
10+
11+
- Drop support for PHP `7.1`
12+
- Drop support for `phpdocumentor/reflection-docblock` `4.3` series
13+
- Require PHP `7.2.20`
14+
- Enable support for PHP `8.0` on the PHAR
15+
- Resolve type aliases in docblocks (#24)
16+
- Upgrade Twig to `^3.0`
17+
- Upgrade `code-lts/cli-tools` to `^1.4`
18+
- Upgrade `wdes/php-i18n-l10n` to `^4.0`
19+
- Fixed a bug that removed `@return` and `@var` descriptions since 5.3.0
20+
- Added detection for duplicated `@var` and `@return` tags
21+
- Added a "version" command to avoid having users parsing unsafe output
22+
- Added support for `@mixin` annotations on classes
23+
- Added support for `@property-write` and `@property-read` annotations on classes
24+
- Added support for `@readonly` annotations on methods and classes
25+
- Added support for `@internal` annotations on methods and classes
26+
- Added support for `@deprecated` annotations on properties
27+
- Added support for `@since` annotations on classes, methods, properties
28+
- Better support for `@method` annotations on classes, added `static` keyword support
29+
- Add support for `@internal`, `@deprecated`, `@since` on constants
30+
- Add support for `@example` on methods
31+
- Fix OpenSearch feature and document the config
32+
- Fix favicon config and document an example config
33+
- Add support for `@public`, `@private`, `@protected`, `@final`, `@access` annotations
34+
- Fixed invalid `@see` annotations parsing and rendering
35+
- Added access handling on constants
36+
- Fixed global namespace handling
37+
- Added methods for functions to the `StoreInterface` class
38+
- Changed return body of `readProject` method of `StoreInterface` to also return functions
39+
- Fix some resume after parse step missing data
40+
- Add more tests on render, parse and update CLIs
41+
- Remove old lib `michelf/php-markdown` and use `erusev/parsedown` to fix an HTML parsing bug
42+
- Add GitHub SECURITY and FUNDING configs
43+
- Add `Stringable` PHP 8.0 class to internal PHP class list
44+
- Add WeakReference PHP 7.4 class to internal PHP class list
45+
- Support `UnionType` of PHP 8
46+
- Support `namespace {//code}` syntax for namespaces without a name
47+
948
## [5.3.1] - 2020-12-30
1049

1150
- Fixed: missing "final" keyword on a class page

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: make-release update-release release
1+
.PHONY: make-release update-release release upload-release update-rss update-built-docs
22

33
make-release:
44
./scripts/make-release.sh
@@ -10,8 +10,23 @@ rebuild-release:
1010
update-release:
1111
./scripts/update-release.sh
1212

13+
update-rss:
14+
./scripts/update-rss.sh
15+
16+
update-version-compat:
17+
./scripts/update-version-compat.sh
18+
19+
update-built-docs:
20+
./scripts/update-built-docs.sh
21+
1322
tag:
1423
./scripts/tag-release.sh
1524

1625
release: make-release update-release
1726
@echo "Done"
27+
28+
upload-release:
29+
@git log --graph -4 --format="%H %s - %b - %G?" gh-pages
30+
@git push --dry-run origin gh-pages:gh-pages
31+
@sleep 2
32+
@git push origin gh-pages:gh-pages

README.rst

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ Our badges
1414
:alt: Project code coverage by Codecov
1515
:target: https://codecov.io/gh/code-lts/doctum
1616

17+
.. image:: https://github.com/code-lts/doctum/actions/workflows/tests.yml/badge.svg?branch=main
18+
:alt: Project test suite
19+
:target: https://github.com/code-lts/doctum/actions/workflows/tests.yml
1720

1821
Installation
1922
------------
2023

2124
.. caution::
2225

23-
Doctum requires **PHP 7.1.3** or later.
26+
Doctum requires **PHP 7.2.20** or later.
2427

2528
Get Doctum as a `phar file`_:
2629

@@ -177,6 +180,32 @@ All `footer_link` keys are optional.
177180
],
178181
]);
179182
183+
To enable `OpenSearch <https://en.wikipedia.org/wiki/OpenSearch>`_ feature in your users browsers:
184+
185+
.. code-block:: php
186+
187+
<?php
188+
189+
use Doctum\Doctum;
190+
use Symfony\Component\Finder\Finder;
191+
192+
$dir = '/path/to/yourlib/src';
193+
$iterator = Finder::create()
194+
->files()
195+
->name('*.php')
196+
->exclude('Resources')
197+
->exclude('Tests')
198+
->in($dir);
199+
200+
return new Doctum($iterator, [
201+
'title' => 'Project Api Documentation',
202+
// Necessary to enable the opensearch.xml file generation
203+
'base_url' => 'https://apidocs.company.tld/',
204+
// If you have a favicon
205+
// 'favicon' => 'https://company.tld/favicon.ico',
206+
// ... more configs
207+
]);
208+
180209
You can find more configuration examples under the ``examples/`` directory of
181210
the source code.
182211

composer.json

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@
99
"homepage": "https://github.com/code-lts/doctum",
1010
"readme": "https://github.com/code-lts/doctum#readme",
1111
"license": "MIT",
12+
"funding": [
13+
{
14+
"type": "tidelift",
15+
"url": "https://tidelift.com/funding/github/packagist/code-lts/doctum"
16+
},
17+
{
18+
"type": "github",
19+
"url": "https://github.com/sponsors/williamdes"
20+
}
21+
],
22+
"support": {
23+
"email": "[email protected]",
24+
"issues": "https://github.com/code-lts/doctum/issues",
25+
"source": "https://github.com/code-lts/doctum"
26+
},
1227
"authors": [
1328
{
1429
"name": "Fabien Potencier",
@@ -23,15 +38,15 @@
2338
"php": "^7.1.3 || ^8.0",
2439
"twig/twig": "~2.12",
2540
"nikic/php-parser": "~4.6",
26-
"michelf/php-markdown": "~1.3",
2741
"symfony/console": "~3.4|~4.3|~5.1|~5.2",
2842
"symfony/finder": "~3.4|~4.3|~5.1|~5.2",
2943
"symfony/filesystem": "~3.4|~4.3|~5.1|~5.2",
3044
"symfony/yaml": "~3.4|~4.3|~5.1|~5.2",
3145
"symfony/process": "~3.4|~4.3|~5.1|~5.2",
3246
"phpdocumentor/reflection-docblock": "~4.3|~5.2.1",
3347
"wdes/php-i18n-l10n": "^2.0",
34-
"code-lts/cli-tools": "^1.3.1"
48+
"code-lts/cli-tools": "^1.4.0",
49+
"erusev/parsedown": "^1.7"
3550
},
3651
"scripts": {
3752
"phpunit": "./vendor/bin/phpunit",
@@ -42,7 +57,7 @@
4257
"require-dev": {
4358
"phpunit/phpunit": "^7 || ^8 || ^9",
4459
"phpstan/phpstan": "^0.12.30",
45-
"squizlabs/php_codesniffer": "^3.5"
60+
"wdes/coding-standard": "^3"
4661
},
4762
"autoload": {
4863
"psr-4": {

examples/sf2.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
->name('*.php')
1010
->exclude('Resources')
1111
->exclude('Tests')
12-
->in($dir = '/path/to/symfony/src')
13-
;
12+
->in($dir = '/path/to/symfony/src');
1413

1514
$versions = GitVersionCollection::create($dir)
1615
->addFromTags('v2.0.*')
1716
->add('2.0', '2.0 branch')
18-
->add('master', 'master branch')
19-
;
17+
->add('master', 'master branch');
2018

2119
return new Doctum($iterator, [
2220
'theme' => 'symfony',
@@ -27,4 +25,5 @@
2725
// use a custom theme directory
2826
'template_dirs' => [__DIR__ . '/themes/symfony'],
2927
'default_opened_level' => 2,
30-
]);
28+
]
29+
);

examples/sf2_with_gitlab.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
->name('*.php')
1111
->exclude('Resources')
1212
->exclude('Tests')
13-
->in($dir = '/path/to/symfony/src')
14-
;
13+
->in($dir = '/path/to/symfony/src');
1514

1615
$versions = GitVersionCollection::create($dir)
1716
->addFromTags('v2.0.*')
1817
->add('2.0', '2.0 branch')
19-
->add('master', 'master branch')
20-
;
18+
->add('master', 'master branch');
2119

2220
return new Doctum($iterator, [
2321
'theme' => 'symfony',
@@ -27,4 +25,5 @@
2725
'cache_dir' => __DIR__ . '/../cache/sf2/%version%',
2826
'remote_repository' => new GitLabRemoteRepository('symfony/symfony', dirname($dir), 'https://gitlab.company.com/'),
2927
'default_opened_level' => 2,
30-
]);
28+
]
29+
);

0 commit comments

Comments
 (0)