Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter for arithmetic operations #28

Open
fgsl opened this issue Jul 13, 2021 · 2 comments · May be fixed by #29
Open

Filter for arithmetic operations #28

fgsl opened this issue Jul 13, 2021 · 2 comments · May be fixed by #29

Comments

@fgsl
Copy link

fgsl commented Jul 13, 2021

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

I created this filter for an application that converts values from APIs. It's useful for measure unit conversions and making adjustments. For example, an endpoint returns the amount of RAM requested by an user and you can add a security margin.

fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 13, 2021
@fgsl
Copy link
Author

fgsl commented Jul 13, 2021

#29

fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 14, 2021
fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 14, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 14, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
@boesing boesing linked a pull request Jul 14, 2021 that will close this issue
fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 14, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
@fgsl
Copy link
Author

fgsl commented Jul 15, 2021

Hi, @froschdesign. Where can I put documentation about this?

Tell me if something like this is enough.

Some value is given in meters but I want the value in kilometers. Think that value is given by an API that has no option for conversions. You don't have access a database to define the query.

Considering changes from your comments, I write a sample below:

require 'vendor/autoload.php';

use Laminas\Filter\FiveOperations;

$filter = new FiveOperations((['operation' => FiveOperations::DIV, 'value' => 1000]);

$distanceInMeters = 15450; 

$distanceInKilometers = $filter->filter($distanceInMeters);

// $distanceInKilometers = 15.45

fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 15, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Jul 15, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Oct 25, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Signed-off-by: Flávio Gomes da Silva Lisboa <[email protected]>
fgsl added a commit to fgsl/laminas-filter that referenced this issue Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants