Recommend this page to a friend! |
Classes of Andrey Iatsenko | Typer PHP Type Casting Class | README.md | Download |
|
DownloadTyperThis is a simple helper package that helps make the code cleaner. Often, when working with data from third-party sources, such as website parsing, you need to write hundreds of lines of code to check for a particular property. Most likely, you write a lot of if or ternary operators, and your code looks something like this:
When using Typer, you don't need to worry about a lot of checks and transformations. Simply wrap the code in the
If, in the absence of a parameter, you need to specify a default value other than "null", you can simply pass it as the second argument:
InstallationThe package can be installed via composer:
|