Skip to content

Commit 823131b

Browse files
authored
Fix issue with types being a dependency in hookable (#816)
* Fix issue with types being a dependency in hookable * Interface not class * Interface not class
1 parent a7dbb05 commit 823131b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828

2929
- Clear `$_COOKIE` and `$_SESSION` in addition to other superglobals when
3030
cleaning the global scope between tests.
31-
32-
33-
### Changed
34-
35-
- Clear `$_COOKIE` and `$_SESSION` in addition to other superglobals when
36-
cleaning the global scope between tests.
37-
38-
39-
### Changed
40-
4131
- Added `Deprecation` attribute to some already-deprecated methods in the
4232
framework to better indicate their deprecation status.
4333

34+
### Fixed
35+
36+
- Fixed issue where `Mantle\Types\Validator` is used within `mantle-framework/support` but `mantle-framework/types` is not a dependency.
37+
4438
## v1.12.4
4539

4640
### Fixed

src/mantle/support/traits/trait-hookable.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ protected function fire_doing_it_wrong( ReflectionMethod $method ): void {
275275
* @param ReflectionMethod $method The hook callback method.
276276
*/
277277
protected function validate_method( ReflectionMethod $method ): bool {
278+
if ( ! interface_exists( \Mantle\Types\Validator::class ) ) {
279+
return true;
280+
}
281+
278282
$attributes = $method->getAttributes( \Mantle\Types\Validator::class, \ReflectionAttribute::IS_INSTANCEOF );
279283

280284
// Check all validators for this method.

0 commit comments

Comments
 (0)