Download the PHP package manuwhat/shortcut without Composer
On this page you can find all versions of the php package manuwhat/shortcut. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download manuwhat/shortcut
More information about manuwhat/shortcut
Files in manuwhat/shortcut
Package shortcut
Short Description Shortcut - class instantiation Shortcut designer
License MIT
Homepage https://github.com/manuwhat/Shortcut
Informations about the package shortcut
Class Instantiation Shortcut for PHP
Library which create custom Shortcut for classes Instantiation.
Requires: PHP 5.3+
Why Create Shortcut for PHP classes Instantiation?
Typically you would create Shortcut for class instantiation if:
- You need something more customized just like PHP create arrays with the array() function .
- You want to be more productive avoiding the "new" keyword usage but also too long class name repetitive usage .
- Instead of a gain of productivity You just are nostalgic of the times when you were using Python or the old fashion style of javaScript when you were not load yourself of the "new" keyword to instantiate a new object.
- Just for the fun to do it.
- Because you are just crazy in love with functions -:).
How to use it
Require the library by issuing this command:
Add require 'vendor/autoload.php';
to the top of your script.
Next, create a Shortcut, just like this:
The Shortcut
is once and forever until cache suppression automatically created and the code included then you can use it in your script:
By default shortcuts are cached in a default directory but you can specify a custom directory path where shortcuts will be saved using
Keep in mind that only one custom Shortcut can be defined per class and that only instantiable classes can be used.
To run unit tests