https://github.com/kelunik/callbacks
https://github.com/kelunik/callbacks
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kelunik/callbacks
- Owner: kelunik
- License: mit
- Created: 2017-01-22T15:03:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-22T15:03:44.000Z (over 8 years ago)
- Last Synced: 2025-02-12T06:54:21.074Z (4 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# callbacks
This package allows to define strict and weak callbacks.
PHP 7 introduced `declare(strict_types=1);` which toggles the caller in being strict about the passed types or not. While this toggle behavior is OK for most code, it is not in case of callbacks. Interfaces accepting callbacks have to specifiy whether implementations MUST or MUST NOT use strict types now, otherwise behavior cannot guaranteed to be the same accross different implementations.
While interfaces might define always-strict or always-weak, this library allows callback authors toggle their callbacks independently.