-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Tune RenderingContext withAttribute() and getAttribute() (#882)
getAttribute($className) now always returns an instance of $className, or throws. This avoids checking the returned instance and helps with type hinting in IDEs. withAttribute() now requires a value is an instance of given class name. Checking if an attribute has been set for given class name can be done using hasAttribute() to avoid a try-catch for a generic \RuntimeException. This change is not considered breaking since it is an adjustment of a new API added just recently.
- Loading branch information
Showing
3 changed files
with
73 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters