Skip to content

Commit 3f6cb5c

Browse files
wilsongerquadlingjakzal
authored
Merge in 3.2.7 (#310)
* 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>
1 parent c5e24c5 commit 3f6cb5c

File tree

6 files changed

+452
-330
lines changed

6 files changed

+452
-330
lines changed

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## 3.2.7 - 2019-12-19
5+
6+
### Fixes
7+
- Reinstated the `@method` return type for `Assert\LazyAssertion` methods to show that the return type is `LazyAssertion`.
8+
9+
## 3.2.6 - 2019-10-10
10+
11+
### Fixes
12+
- Make `Assert\Assertion::stringify()` UTF-8 safe (Thanks to [Pedram Azimaei](https://github.com/beberlei/assert/pull/290))
13+
14+
## 3.2.5 - 2019-10-10 - Fix the broken things release.
15+
16+
### Notice
17+
- Sigh!
18+
- Richard Quadling
19+
20+
### Fixes
21+
- REALLY Removed dependency of the intl extension.
22+
- Updated the Docblocks for `Assert\Assertion::all()` helper to show that the value is expected to be an array.
23+
24+
## 3.2.4 - 2019-10-10 - Fix the broken things release.
25+
26+
### Notice
27+
- It seems I've been slightly lax in verifying the signature changes and expected extensions.
28+
Hopefully, both of these have been fixed in this version.
29+
Truly sorry for breaking the internet!
30+
- Richard Quadling
31+
32+
### Fixes
33+
- Restored `\Assert\Assertion::createException()` signature to 3.2.2.
34+
- Removed dependency of the intl extension. If the extension is available, then `Assert\Assertion::count()`,
35+
`Assert\Assertion::isCountable()`, `Assert\Assertion::minCount()`, and `Assert\Assertion::maxCount()` will operate on
36+
`ResourceBundles`.
37+
- Fixed the `@method` return type for `Assert\LazyAssertion` methods to show that the return type is `static` for
38+
extensions of `Assert\LazyAssertion`.
39+
*NOTE :* Docblock does not have the ability to differentiate between a non static `@method` whose returns type is of
40+
the subclass and a `@method` that is called statically ([PSR-5#899](https://github.com/php-fig/fig-standards/pull/899)).
41+
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
42+
overridden in a subclass.
43+
444
## 3.2.3 - 2019-08-23
545

646
### Other changes

bin/MethodDocGenerator.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ private function generateMethodDocs($methods, $format, $skipParameterTest, $pref
8585
}
8686
}
8787

88+
if ($prefix === 'all' && strpos($type, 'null') === false && $parameterIndex === 0) {
89+
$type = str_replace('|', '[]|', $type).'[]';
90+
}
91+
8892
if ($prefix === 'nullOr' && strpos($type, 'null') === false && $parameterIndex === 0) {
8993
$type .= '|null';
9094
}
@@ -214,8 +218,8 @@ public function generateLazyAssertionDocs()
214218
};
215219

216220
$docs = array_merge(
217-
$this->generateMethodDocs($this->gatherAssertions(), ' * @method $this %s(%s) %s.', $skipParameterTest),
218-
$this->generateMethodDocs($this->gatherAssertionChainSwitches(), ' * @method $this %s(%s) %s.', false)
221+
$this->generateMethodDocs($this->gatherAssertions(), ' * @method LazyAssertion %s(%s) %s.', $skipParameterTest),
222+
$this->generateMethodDocs($this->gatherAssertionChainSwitches(), ' * @method LazyAssertion %s(%s) %s.', false)
219223
);
220224

221225
$this->generateFile($phpFile, $docs, 'class');

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
},
2525
"require": {
2626
"php": "^7.0 || ^8.0",
27-
"ext-intl": "*",
2827
"ext-simplexml": "*",
2928
"ext-mbstring": "*",
3029
"ext-ctype": "*",
@@ -58,5 +57,8 @@
5857
"assert:cs-fix": "php-cs-fixer fix . -vvv || true",
5958
"assert:sa-code": "vendor/bin/phpstan analyse --configuration=phpstan-code.neon --no-progress --ansi -l 7 bin lib",
6059
"assert:sa-tests": "vendor/bin/phpstan analyse --configuration=phpstan-tests.neon --no-progress --ansi -l 7 tests"
60+
},
61+
"suggest": {
62+
"ext-intl": "Needed to allow Assertion::count(), Assertion::isCountable(), Assertion::minCount(), and Assertion::maxCount() to operate on ResourceBundles"
6163
}
6264
}

0 commit comments

Comments
 (0)