| 148 |
lars |
1 |
Changelog
|
|
|
2 |
=========
|
|
|
3 |
|
|
|
4 |
## UNRELEASED
|
|
|
5 |
|
|
|
6 |
## 1.11.0
|
|
|
7 |
|
|
|
8 |
### Added
|
|
|
9 |
|
|
|
10 |
* Added explicit (non magic) `allNullOr*` methods, with `@psalm-assert` annotations, for better Psalm support.
|
|
|
11 |
|
|
|
12 |
### Changed
|
|
|
13 |
|
|
|
14 |
* Trait methods will now check the assertion themselves, instead of using `__callStatic`
|
|
|
15 |
* `isList` will now deal correctly with (modified) lists that contain `NaN`
|
|
|
16 |
* `reportInvalidArgument` now has a return type of `never`.
|
|
|
17 |
|
|
|
18 |
### Removed
|
|
|
19 |
|
|
|
20 |
* Removed `symfony/polyfill-ctype` as a dependency, and require `ext-cytpe` instead.
|
|
|
21 |
* You can still require the `symfony/polyfill-ctype` in your project if you need it, as it provides `ext-ctype`
|
|
|
22 |
|
|
|
23 |
## 1.10.0
|
|
|
24 |
|
|
|
25 |
### Added
|
|
|
26 |
|
|
|
27 |
* On invalid assertion, we throw a `Webmozart\Assert\InvalidArgumentException`
|
|
|
28 |
* Added `Assert::positiveInteger()`
|
|
|
29 |
|
|
|
30 |
### Changed
|
|
|
31 |
|
|
|
32 |
* Using a trait with real implementations of `all*()` and `nullOr*()` methods to improve psalm compatibility.
|
|
|
33 |
|
|
|
34 |
### Removed
|
|
|
35 |
|
|
|
36 |
* Support for PHP <7.2
|
|
|
37 |
|
|
|
38 |
## 1.9.1
|
|
|
39 |
|
|
|
40 |
## Fixed
|
|
|
41 |
|
|
|
42 |
* provisional support for PHP 8.0
|
|
|
43 |
|
|
|
44 |
## 1.9.0
|
|
|
45 |
|
|
|
46 |
* added better Psalm support for `all*` & `nullOr*` methods
|
|
|
47 |
* These methods are now understood by Psalm through a mixin. You may need a newer version of Psalm in order to use this
|
|
|
48 |
* added `@psalm-pure` annotation to `Assert::notFalse()`
|
|
|
49 |
* added more `@psalm-assert` annotations where appropriate
|
|
|
50 |
|
|
|
51 |
## Changed
|
|
|
52 |
|
|
|
53 |
* the `all*` & `nullOr*` methods are now declared on an interface, instead of `@method` annotations.
|
|
|
54 |
This interface is linked to the `Assert` class with a `@mixin` annotation. Most IDE's have supported this
|
|
|
55 |
for a long time, and you should not lose any autocompletion capabilities. PHPStan has supported this since
|
|
|
56 |
version `0.12.20`. This package is marked incompatible (with a composer conflict) with phpstan version prior to that.
|
|
|
57 |
If you do not use PHPStan than this does not matter.
|
|
|
58 |
|
|
|
59 |
## 1.8.0
|
|
|
60 |
|
|
|
61 |
### Added
|
|
|
62 |
|
|
|
63 |
* added `Assert::notStartsWith()`
|
|
|
64 |
* added `Assert::notEndsWith()`
|
|
|
65 |
* added `Assert::inArray()`
|
|
|
66 |
* added `@psalm-pure` annotations to pure assertions
|
|
|
67 |
|
|
|
68 |
### Fixed
|
|
|
69 |
|
|
|
70 |
* Exception messages of comparisons between `DateTime(Immutable)` objects now display their date & time.
|
|
|
71 |
* Custom Exception messages for `Assert::count()` now use the values to render the exception message.
|
|
|
72 |
|
|
|
73 |
## 1.7.0 (2020-02-14)
|
|
|
74 |
|
|
|
75 |
### Added
|
|
|
76 |
|
|
|
77 |
* added `Assert::notFalse()`
|
|
|
78 |
* added `Assert::isAOf()`
|
|
|
79 |
* added `Assert::isAnyOf()`
|
|
|
80 |
* added `Assert::isNotA()`
|
|
|
81 |
|
|
|
82 |
## 1.6.0 (2019-11-24)
|
|
|
83 |
|
|
|
84 |
### Added
|
|
|
85 |
|
|
|
86 |
* added `Assert::validArrayKey()`
|
|
|
87 |
* added `Assert::isNonEmptyList()`
|
|
|
88 |
* added `Assert::isNonEmptyMap()`
|
|
|
89 |
* added `@throws InvalidArgumentException` annotations to all methods that throw.
|
|
|
90 |
* added `@psalm-assert` for the list type to the `isList` assertion.
|
|
|
91 |
|
|
|
92 |
### Fixed
|
|
|
93 |
|
|
|
94 |
* `ResourceBundle` & `SimpleXMLElement` now pass the `isCountable` assertions.
|
|
|
95 |
They are countable, without implementing the `Countable` interface.
|
|
|
96 |
* The doc block of `range` now has the proper variables.
|
|
|
97 |
* An empty array will now pass `isList` and `isMap`. As it is a valid form of both.
|
|
|
98 |
If a non-empty variant is needed, use `isNonEmptyList` or `isNonEmptyMap`.
|
|
|
99 |
|
|
|
100 |
### Changed
|
|
|
101 |
|
|
|
102 |
* Removed some `@psalm-assert` annotations, that were 'side effect' assertions See:
|
|
|
103 |
* [#144](https://github.com/webmozart/assert/pull/144)
|
|
|
104 |
* [#145](https://github.com/webmozart/assert/issues/145)
|
|
|
105 |
* [#146](https://github.com/webmozart/assert/pull/146)
|
|
|
106 |
* [#150](https://github.com/webmozart/assert/pull/150)
|
|
|
107 |
* If you use Psalm, the minimum version needed is `3.6.0`. Which is enforced through a composer conflict.
|
|
|
108 |
If you don't use Psalm, then this has no impact.
|
|
|
109 |
|
|
|
110 |
## 1.5.0 (2019-08-24)
|
|
|
111 |
|
|
|
112 |
### Added
|
|
|
113 |
|
|
|
114 |
* added `Assert::uniqueValues()`
|
|
|
115 |
* added `Assert::unicodeLetters()`
|
|
|
116 |
* added: `Assert::email()`
|
|
|
117 |
* added support for [Psalm](https://github.com/vimeo/psalm), by adding `@psalm-assert` annotations where appropriate.
|
|
|
118 |
|
|
|
119 |
### Fixed
|
|
|
120 |
|
|
|
121 |
* `Assert::endsWith()` would not give the correct result when dealing with a multibyte suffix.
|
|
|
122 |
* `Assert::length(), minLength, maxLength, lengthBetween` would not give the correct result when dealing with multibyte characters.
|
|
|
123 |
|
|
|
124 |
**NOTE**: These 2 changes may break your assertions if you relied on the fact that multibyte characters didn't behave correctly.
|
|
|
125 |
|
|
|
126 |
### Changed
|
|
|
127 |
|
|
|
128 |
* The names of some variables have been updated to better reflect what they are.
|
|
|
129 |
* All function calls are now in their FQN form, slightly increasing performance.
|
|
|
130 |
* Tests are now properly ran against HHVM-3.30 and PHP nightly.
|
|
|
131 |
|
|
|
132 |
### Deprecation
|
|
|
133 |
|
|
|
134 |
* deprecated `Assert::isTraversable()` in favor of `Assert::isIterable()`
|
|
|
135 |
* This was already done in 1.3.0, but it was only done through a silenced `trigger_error`. It is now annotated as well.
|
|
|
136 |
|
|
|
137 |
## 1.4.0 (2018-12-25)
|
|
|
138 |
|
|
|
139 |
### Added
|
|
|
140 |
|
|
|
141 |
* added `Assert::ip()`
|
|
|
142 |
* added `Assert::ipv4()`
|
|
|
143 |
* added `Assert::ipv6()`
|
|
|
144 |
* added `Assert::notRegex()`
|
|
|
145 |
* added `Assert::interfaceExists()`
|
|
|
146 |
* added `Assert::isList()`
|
|
|
147 |
* added `Assert::isMap()`
|
|
|
148 |
* added polyfill for ctype
|
|
|
149 |
|
|
|
150 |
### Fixed
|
|
|
151 |
|
|
|
152 |
* Special case when comparing objects implementing `__toString()`
|
|
|
153 |
|
|
|
154 |
## 1.3.0 (2018-01-29)
|
|
|
155 |
|
|
|
156 |
### Added
|
|
|
157 |
|
|
|
158 |
* added `Assert::minCount()`
|
|
|
159 |
* added `Assert::maxCount()`
|
|
|
160 |
* added `Assert::countBetween()`
|
|
|
161 |
* added `Assert::isCountable()`
|
|
|
162 |
* added `Assert::notWhitespaceOnly()`
|
|
|
163 |
* added `Assert::natural()`
|
|
|
164 |
* added `Assert::notContains()`
|
|
|
165 |
* added `Assert::isArrayAccessible()`
|
|
|
166 |
* added `Assert::isInstanceOfAny()`
|
|
|
167 |
* added `Assert::isIterable()`
|
|
|
168 |
|
|
|
169 |
### Fixed
|
|
|
170 |
|
|
|
171 |
* `stringNotEmpty` will no longer report "0" is an empty string
|
|
|
172 |
|
|
|
173 |
### Deprecation
|
|
|
174 |
|
|
|
175 |
* deprecated `Assert::isTraversable()` in favor of `Assert::isIterable()`
|
|
|
176 |
|
|
|
177 |
## 1.2.0 (2016-11-23)
|
|
|
178 |
|
|
|
179 |
* added `Assert::throws()`
|
|
|
180 |
* added `Assert::count()`
|
|
|
181 |
* added extension point `Assert::reportInvalidArgument()` for custom subclasses
|
|
|
182 |
|
|
|
183 |
## 1.1.0 (2016-08-09)
|
|
|
184 |
|
|
|
185 |
* added `Assert::object()`
|
|
|
186 |
* added `Assert::propertyExists()`
|
|
|
187 |
* added `Assert::propertyNotExists()`
|
|
|
188 |
* added `Assert::methodExists()`
|
|
|
189 |
* added `Assert::methodNotExists()`
|
|
|
190 |
* added `Assert::uuid()`
|
|
|
191 |
|
|
|
192 |
## 1.0.2 (2015-08-24)
|
|
|
193 |
|
|
|
194 |
* integrated Style CI
|
|
|
195 |
* add tests for minimum package dependencies on Travis CI
|
|
|
196 |
|
|
|
197 |
## 1.0.1 (2015-05-12)
|
|
|
198 |
|
|
|
199 |
* added support for PHP 5.3.3
|
|
|
200 |
|
|
|
201 |
## 1.0.0 (2015-05-12)
|
|
|
202 |
|
|
|
203 |
* first stable release
|
|
|
204 |
|
|
|
205 |
## 1.0.0-beta (2015-03-19)
|
|
|
206 |
|
|
|
207 |
* first beta release
|