Author: Manuel Lemos
Updated on: 2023-06-01
Posted on: 2023-06-01
Package: PHP Dependency Injection Calculator
For instance, a developer may store and retrieve the application data using different databases.
In this case, using different classes that implement the same database access operations with other codes is recommended for accessing different types of databases.
Then the application may write code that works well with different databases.
If, in the future, the developer needs to change the application to use a different type of database, he needs to use an object to access that type of database without needing to change the code of the rest of the application.
In this case, the application uses a database access object and injects it into the code that implements the application.
This approach to separate the application code from the implementation class code that the application depends on is called dependency injection.
This package implements this approach to perform math operations. It provides a main class that implements several types of math operations. It also offers several classes that implement those math operations with different PHP extensions that provide various types of precision.
About the PHP Dependency Injection Calculator Package
The basic purpose is: Perform math calculations using an injected object
Here follows in more detail what it does:
This package can perform math calculations using an injected object.
It provides an abstract calculator class that can perform several math calculations with numbers, like adding, subtracting, multiplying, and dividing.
The calculator class takes an injected object that will perform the actual calculations.
The package provides several classes that implement the math operations using different approaches to perform those operations.
Currently, it provides math operations classes that can be used to create objects to inject in the calculator class, like:
- GMP (GNU Multi Precision)
- BCMath (Arbitrary Precision Mathematics)
This package was considered notable for implementing its benefits in a way that is worth noticing.
Notable PHP packages can be often considered innovative. If this package is also innovative, it can be nominated to the PHP Innovation Award and the author may win prizes and recognition for sharing innovative packages.
If you also developed your own notable or innovative packages consider sharing them, so you can also earn more visibility for your package as well nice prizes.
One nice prize that many PHP developers want and you may like is the PHP elePHPant mascot plush.
You need to be a registered user or login to post a comment
1,611,062 PHP developers registered to the PHP Classes site.
Be One of Us!
Login Immediately with your account on:
No comments were submitted yet.