You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

190 lines
5.3 KiB

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