-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #634 from Ocramius/feature/quick-money
Quick money (butchering this library for the glory of satan, and CPU cycles)
- Loading branch information
Showing
134 changed files
with
11,017 additions
and
4,109 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM php:7.2-cli | ||
FROM php:8.0-cli | ||
|
||
RUN set -xe \ | ||
&& apt-get update \ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Benchmark\Money; | ||
|
||
use Money\Currency; | ||
use Money\Money; | ||
use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods; | ||
|
||
/** | ||
* @BeforeMethods({"setUp"}) | ||
*/ | ||
final class MoneyInstantiationBench | ||
{ | ||
/** @var Currency */ | ||
private $currency; | ||
|
||
public function setUp(): void | ||
{ | ||
$this->currency = new Currency('EUR'); | ||
} | ||
|
||
public function benchConstructorWithZeroIntegerAmount(): void | ||
{ | ||
new Money(0, $this->currency); | ||
} | ||
|
||
public function benchConstructorWithPositiveIntegerAmount(): void | ||
{ | ||
new Money(1234567890, $this->currency); | ||
} | ||
|
||
public function benchConstructorWithNegativeIntegerAmount(): void | ||
{ | ||
new Money(-1234567890, $this->currency); | ||
} | ||
|
||
public function benchConstructorWithZeroStringAmount(): void | ||
{ | ||
new Money('0', $this->currency); | ||
} | ||
|
||
public function benchConstructorWithPositiveStringAmount(): void | ||
{ | ||
new Money('1234567890', $this->currency); | ||
} | ||
|
||
public function benchConstructorWithNegativeStringAmount(): void | ||
{ | ||
new Money('-1234567890', $this->currency); | ||
} | ||
} |
Oops, something went wrong.