-
Notifications
You must be signed in to change notification settings - Fork 443
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
deal with integer limits #115
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- v4.6.0
- v4.5.1
- v4.5.0
- v4.4.0
- v4.3.0
- v4.2.0
- v4.1.1
- v4.1.0
- v4.0.5
- v4.0.4
- v4.0.3
- v4.0.2
- v4.0.1
- v4.0.0
- v4.0.0-beta1
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.1
- v3.2.0
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-beta4
- v3.0.0-beta.3
- v3.0.0-beta.2
- v3.0.0-beta
- v3.0.0-alpha
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,16 @@ | |
namespace Money; | ||
|
||
/** | ||
* Interface Calculator | ||
* @package Money | ||
* Calculator Interface | ||
* @author Frederik Bosch | ||
*/ | ||
interface Calculator | ||
{ | ||
|
||
/** | ||
* Returns whether the calculator is supported in | ||
* the current server environment | ||
* | ||
* @return bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it's kind of obvious, but can you please add some documentation here as well? |
||
*/ | ||
public static function supported(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?php | ||
|
||
namespace Money; | ||
|
||
use InvalidArgumentException; | ||
|
@@ -483,17 +484,17 @@ public function jsonSerialize() | |
*/ | ||
public static function registerCalculator(Calculator $calculator) | ||
{ | ||
self::$calculators = $calculator + self::$calculators; | ||
array_unshift(self::$calculators, $calculator); | ||
} | ||
|
||
/** | ||
* @return Calculator | ||
*/ | ||
private static function initializeCalculator() | ||
{ | ||
/** @var Calculator[] $calculators */ | ||
$calculators = self::$calculators; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove this line and modify the docblock to |
||
foreach ($calculators as $calculator) { | ||
/** @var Calculator $calculator */ | ||
if ($calculator::supported()) { | ||
return new $calculator; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing newline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why this is necessary, but OK, I will add it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency.