Skip to content

Commit

Permalink
Merge in 3.2.7 (#310)
Browse files Browse the repository at this point in the history
* Remove ext-intl as a required extension, making it a suggested extension for
use with Assertion::count(), Assertion::isCountable(), Assertion::minCount(),
and Assertion::maxCount() to operate on ResourceBundles.

* Correct @method return typehint for LazyAssertion chaining

* Restored `\Assert\Assertion::createException()` signature to 3.2.2.

Sincerely apologies to the BC break.

* Fix docblock typehint

* Prepare v3.2.4

* Remove a hard dependency on the intl extension (#289)

Fixes #288.

While #268 and #269 updated count() and isCountable() to now work with intl resources, #286 made that the whole beberlei/assert package now requires the intl extension to be installed.

However, the intl extension dependency is a soft dependency.
The package does not need intl for most of its features and can safely work without it.

* Fix docblocks for `all` to show that they are expected to receive an
array of things

* Preapare v3.2.5

* Make `Assert\Assertion::stringify()` UTF-8 safe.

* Prepare v3.2.6

* Reinstate LazyAssertion docblock

* ## 3.2.7 - 2019-12-19

### Fixes
- Reinstated the `@method` return type for `Assert\LazyAssertion` methods to show that the return type is `LazyAssertion`.

* Fixes

Co-authored-by: Richard Quadling <Richard.Quadling@DigiTickets.co.uk>
Co-authored-by: Jakub Zalas <jakub@zalas.pl>
  • Loading branch information
3 people committed Apr 18, 2021
1 parent c5e24c5 commit 3f6cb5c
Show file tree
Hide file tree
Showing 6 changed files with 452 additions and 330 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
# Change Log
All notable changes to this project will be documented in this file.

## 3.2.7 - 2019-12-19

### Fixes
- Reinstated the `@method` return type for `Assert\LazyAssertion` methods to show that the return type is `LazyAssertion`.

## 3.2.6 - 2019-10-10

### Fixes
- Make `Assert\Assertion::stringify()` UTF-8 safe (Thanks to [Pedram Azimaei](https://github.com/beberlei/assert/pull/290))

## 3.2.5 - 2019-10-10 - Fix the broken things release.

### Notice
- Sigh!
- Richard Quadling

### Fixes
- REALLY Removed dependency of the intl extension.
- Updated the Docblocks for `Assert\Assertion::all()` helper to show that the value is expected to be an array.

## 3.2.4 - 2019-10-10 - Fix the broken things release.

### Notice
- It seems I've been slightly lax in verifying the signature changes and expected extensions.
Hopefully, both of these have been fixed in this version.
Truly sorry for breaking the internet!
- Richard Quadling

### Fixes
- Restored `\Assert\Assertion::createException()` signature to 3.2.2.
- Removed dependency of the intl extension. If the extension is available, then `Assert\Assertion::count()`,
`Assert\Assertion::isCountable()`, `Assert\Assertion::minCount()`, and `Assert\Assertion::maxCount()` will operate on
`ResourceBundles`.
- Fixed the `@method` return type for `Assert\LazyAssertion` methods to show that the return type is `static` for
extensions of `Assert\LazyAssertion`.
*NOTE :* Docblock does not have the ability to differentiate between a non static `@method` whose returns type is of
the subclass and a `@method` that is called statically ([PSR-5#899](https://github.com/php-fig/fig-standards/pull/899)).
So the use of `static static` is a fudge that sort of works for IDEs that need to know about the method that MAY be
overridden in a subclass.

## 3.2.3 - 2019-08-23

### Other changes
Expand Down
8 changes: 6 additions & 2 deletions bin/MethodDocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ private function generateMethodDocs($methods, $format, $skipParameterTest, $pref
}
}

if ($prefix === 'all' && strpos($type, 'null') === false && $parameterIndex === 0) {
$type = str_replace('|', '[]|', $type).'[]';
}

if ($prefix === 'nullOr' && strpos($type, 'null') === false && $parameterIndex === 0) {
$type .= '|null';
}
Expand Down Expand Up @@ -214,8 +218,8 @@ public function generateLazyAssertionDocs()
};

$docs = array_merge(
$this->generateMethodDocs($this->gatherAssertions(), ' * @method $this %s(%s) %s.', $skipParameterTest),
$this->generateMethodDocs($this->gatherAssertionChainSwitches(), ' * @method $this %s(%s) %s.', false)
$this->generateMethodDocs($this->gatherAssertions(), ' * @method LazyAssertion %s(%s) %s.', $skipParameterTest),
$this->generateMethodDocs($this->gatherAssertionChainSwitches(), ' * @method LazyAssertion %s(%s) %s.', false)
);

$this->generateFile($phpFile, $docs, 'class');
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
},
"require": {
"php": "^7.0 || ^8.0",
"ext-intl": "*",
"ext-simplexml": "*",
"ext-mbstring": "*",
"ext-ctype": "*",
Expand Down Expand Up @@ -58,5 +57,8 @@
"assert:cs-fix": "php-cs-fixer fix . -vvv || true",
"assert:sa-code": "vendor/bin/phpstan analyse --configuration=phpstan-code.neon --no-progress --ansi -l 7 bin lib",
"assert:sa-tests": "vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests"
},
"suggest": {
"ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles"
}
}

0 comments on commit 3f6cb5c

Please sign in to comment.