Commit Graph
595 Commits
Author SHA1 Message Date
jrfnl 19e97332e5 CS: miscellaneous other whitespace fixes 2021-08-08 19:41:03 +02:00
jrfnl 11315744bf CS: blank line between different use statement types 2021-08-08 19:41:03 +02:00
jrfnl a607236134 CS: no whitespace before return type colon 2021-08-08 19:41:03 +02:00
jrfnl 2a1aba8089 PHPCS ruleset: update ruleset for upstream changes
* Fix the name and description to prevent confusion between the project ruleset and the organisation ruleset.
* Set the minimum PHP version for the PHPCompatibility standard.
* Don't require property type declarations.
* Ensure special characters used as literals in an exclude pattern are escaped.
2021-08-08 19:41:03 +02:00
Jaap van Otterdijk dc7d72e47e Merge pull request #288 from jrfnl/feature/docblock-source-phpstan-fix
DocBlock/Tags/Source: remove redundant code
2021-08-06 11:57:03 +02:00
Jaap van Otterdijk 9381f67ecc Merge pull request #289 from jrfnl/feature/composer-fix-autoload-dev
Composer: fix `autoload-dev` directive
2021-08-06 11:34:27 +02:00
Jaap van Otterdijk 8c8deff92b Merge pull request #282 from jrfnl/feature/ghactions-switch-to-composer-cache-action
GH Actions: simplify Composer caching
2021-08-06 11:33:24 +02:00
Jaap van Otterdijk be1f0c122d Merge pull request #281 from jrfnl/feature/ghactions-allow-manual-triggering
GH Actions: allow for manually triggering a workflow
2021-08-06 11:31:46 +02:00
Jaap van Otterdijk 78dca37266 Merge pull request #285 from jrfnl/feature/tests-annotate-no-assertions
Tests: mark test without assertions as such
2021-08-01 22:21:35 +02:00
Jaap van Otterdijk d5fef100cc Merge pull request #286 from jrfnl/feature/tests-add-missing-coversnothing
Tests: fix missing `@covers` tag
2021-08-01 22:21:05 +02:00
Jaap van Otterdijk 88b67bd355 Merge pull request #283 from jrfnl/feature/docs-minor-fix
Docblock/Tags/Author: fix typo in method docblock
2021-08-01 22:19:28 +02:00
Jaap van Otterdijk ef02f64d74 Merge pull request #280 from jrfnl/feature/tests-fix-namespace
Tests: fix incorrect namespace
2021-08-01 22:17:39 +02:00
Jaap van Otterdijk e774a02926 Merge pull request #279 from jrfnl/feature/tests-fix-type-in-methodname
Tests: fix typo in test method name
2021-08-01 22:16:55 +02:00
Jaap van Otterdijk 384307b665 Merge pull request #269 from phpDocumentor/dependabot/composer/mockery/mockery-1.3.4
Bump mockery/mockery from 1.3.3 to 1.3.4
2021-08-01 21:39:08 +02:00
jrfnl 8dbbe4940d Composer: fix autoload-dev directive
This only allowed for the tests in the `tests/unit` directory, while there are also tests in the `tests/integration` directory.
2021-08-01 18:27:48 +02:00
jrfnl fcb8fe6588 DocBlock/Tags/Source: remove redundant code
PHPStan flags the code within the `Source::__toString()` method:
```
 ------ -------------------------------------------------------------------------------------------
  Line   DocBlock\Tags\Source.php
 ------ -------------------------------------------------------------------------------------------
  111    Result of || is always true.
  114    Result of || is always true.
  114    Result of || is always true.
 ------ -------------------------------------------------------------------------------------------
```

I have investigated this and can confirm that these flags are correct.

1. `$this->startingLine` is cast to an integer in the `__construct()` method (line 45) and subsequently cast to a string in `__toString()` (line 105).
    This means that it can only ever be a non-empty ("truthy") string or the string '0', so the `$startingLine || $startingLine === '0'` condition used in two places is redundant.
2. `$this->lineCount` is either an integer or `null` after the `__construct()` method (line 46).
    In the `__toString()` method, if the `lineCount` is an integer, it is effectively cast to a string by the concatenation with an empty string on line 107, while if the `lineCount` was `null`, it is turned into an empty string.
    By changing the concatenation from concatenating with an empty string to concatenating with a one-space string, we can remove the ternary in the `return` statement checking for `$lineCount` being empty.

The existing unit tests already cover this code and still pass after this change.
2021-08-01 17:56:47 +02:00
jrfnl 6eee464f8d Tests: fix missing @covers tag
... or rather add the missing `@coversNothing` as this is an integration test.

This prevents the test from being marked as "risky" due to the missing tag on PHPUnit 9.x:
```
There was 1 risky test:

1) phpDocumentor\Reflection\DocblockSeeTagResolvingTest::testResolvesSeeFQSENOfInlineTags
This test does not have a @covers annotation but is expected to have one
```
2021-08-01 14:17:11 +02:00
jrfnl 36f4124fa4 Tests: mark test without assertions as such
... to prevent it from being considered "risky" and being listed as "risky" below each test run.

```
There was 1 risky test:

1) phpDocumentor\Reflection\ModifyBackTraceSafeTest::testBackTraceModificationDoesNotImpactFunctionArguments
This test did not perform any assertions

/home/runner/work/ReflectionDocBlock/ReflectionDocBlock/tests/integration/ModifyBackTraceSafeTest.php:15
```
2021-08-01 14:16:50 +02:00
jrfnl d73732391f Docblock/Tags/Author: fix typo in method docblock 2021-08-01 05:16:32 +02:00
jrfnl 294709592f Tests: fix incorrect namespace 2021-08-01 04:33:44 +02:00
jrfnl 9c67b4c8b9 GH Actions: simplify Composer caching
... by using the `ramsey/composer-install` action.

Ref: https://github.com/marketplace/actions/install-composer-dependencies
2021-08-01 04:29:20 +02:00
jrfnl 8bc1e76abc GH Actions: allow for manually triggering a workflow
Triggering a workflow for a branch manually is not supported by default in GH Actions, but has to be explicitly allowed.

This is useful if, for instance, an external action script or composer dependency has broken.
Once a fix is available, failing builds for open PRs can be retriggered manually instead of having to be re-pushed to retrigger the workflow.

Ref: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
2021-08-01 04:28:58 +02:00
jrfnl 261f5b2a16 Tests: fix typo in test method name 2021-08-01 04:27:53 +02:00
Jaap van Otterdijk 8719cc12e2 Merge pull request #267 from phpDocumentor/dependabot/github_actions/actions/cache-v2.1.4
Bump actions/cache from v2 to v2.1.4
2021-04-23 11:50:58 +02:00
Jaap van Otterdijk 99e3fb891c Merge pull request #260 from voku/get_tags_with_type_by_name
Get tags with type by name
2021-04-23 11:50:05 +02:00
Jaap van Otterdijk f8d350d851 Merge pull request #262 from voku/more_tests
Only more tests
2021-03-07 12:12:25 +01:00
dependabot[bot] 56e4e57a1b Bump mockery/mockery from 1.3.3 to 1.3.4
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.3.3 to 1.3.4.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mockery/mockery/compare/1.3.3...1.3.4)

Signed-off-by: dependabot[bot] <[email protected]>
2021-03-01 05:21:34 +00:00
dependabot[bot] ed0587db7f Bump actions/cache from v2 to v2.1.4
Bumps [actions/cache](https://github.com/actions/cache) from v2 to v2.1.4.
- [Release notes](https://github.com/actions/cache/releases)
- [Commits](https://github.com/actions/cache/compare/v2...26968a09c0ea4f3e233fdddbafd1166051a095f6)

Signed-off-by: dependabot[bot] <[email protected]>
2021-02-08 05:20:56 +00:00
Jaap van Otterdijk e3324ecbde Merge pull request #256 from phpDocumentor/dependabot/composer/phpdocumentor/type-resolver-1.4.0
Bump phpdocumentor/type-resolver from 1.3.0 to 1.4.0
2020-11-18 15:27:38 +01:00
Lars Moelleken c2889e4c40 code styles fixes only 2020-10-24 10:34:38 +02:00
Lars Moelleken 0722b31031 "StandardTagFactory" -> add more tests 2020-10-24 10:33:49 +02:00
Lars Moelleken 2b6310620c "Uses" -> add more test only 2020-10-24 10:33:38 +02:00
Lars Moelleken e31c62da4c "See" -> add more test + simplify the regex 2020-10-24 10:33:28 +02:00
Lars Moelleken 5a2dd88e14 "Link" -> add some more tests 2020-10-24 10:33:17 +02:00
Lars Moelleken 3b4c4d1c2c "CoversTest" -> add only one more test 2020-10-24 10:33:08 +02:00
Lars Moelleken 591f5935c9 code styles fixes only 2020-10-24 10:29:01 +02:00
Lars Moelleken 8c3953ef86 "DocBlock" -> add "getTagsWithTypeByName()"
-> because I saw errors like this ```Call to undefined method phpDocumentor\Reflection\DocBlock\Tags\InvalidTag::getType()```

-> https://github.com/Roave/BetterReflection/blob/5b4d1c53768e2a3bc32ab348752663733fd70546/src/TypesFinder/FindReturnType.php#L53
2020-10-24 10:27:35 +02:00
dependabot[bot] 78e45517b9 Bump phpdocumentor/type-resolver from 1.3.0 to 1.4.0
Bumps [phpdocumentor/type-resolver](https://github.com/phpDocumentor/TypeResolver) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/phpDocumentor/TypeResolver/releases)
- [Commits](https://github.com/phpDocumentor/TypeResolver/compare/1.3.0...1.4.0)

Signed-off-by: dependabot[bot] <[email protected]>
2020-09-21 05:40:47 +00:00
Jaap van Otterdijk 069a785b21 Merge pull request #254 from voku/fix_for_phpstorm_stubs
do not resolve types if it's not possible
2020-09-03 21:13:55 +02:00
Lars Moelleken 2ef4c3da53 add more unit tests and normalize the "__toString" methods
-> update the code coverage level
2020-09-03 02:54:11 +02:00
Lars Moelleken 5bb97a97c0 add more unit tests and normalize the "__toString" methods
-> fix code style v2
2020-09-03 02:51:17 +02:00
Lars Moelleken 4438ee7955 add more unit tests and normalize the "__toString" methods
-> fix code style + psalm reported errors
2020-09-03 02:38:39 +02:00
Lars Moelleken 4e6d7ecd03 add more unit tests and normalize the "__toString" methods v2 2020-09-03 02:06:24 +02:00
Lars Moelleken 7b7c22ddc3 Merge remote-tracking branch 'upstream/master' into fix_for_phpstorm_stubs
* upstream/master:
  Bump mockery
  Fix FQSEN resolving on see,covers,uses
  Improve test coverage
2020-09-03 00:41:27 +02:00
Lars Moelleken 3d8d7df9f1 clean-up code comments 2020-09-03 00:35:02 +02:00
Lars Moelleken 97863e0c44 add more unit tests and normalize the "__toString" methods 2020-09-03 00:33:09 +02:00
Jaapio f6075926e9 Bump mockery 2020-09-02 23:38:01 +02:00
Jaap van Otterdijk 86733dc09c Merge pull request #226 from phpDocumentor/fix-resolve-all-fqsen-formats
Fix FQSEN resolving on see,covers,uses
2020-09-02 23:14:11 +02:00
Lars Moelleken bbe0f54877 add more unit tests and fixed the output v2 2020-09-02 22:55:00 +02:00
Jaapio 73650dde91 Fix FQSEN resolving on see,covers,uses
The See, Covers and Use tags can reference also methods, properties and
constants. Which means that the FqsenResolver cannot handle those properly.
This patch fixes that issue.
2020-09-02 22:48:30 +02:00