Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
M
money-datatype
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
package
money-datatype
Commits
fa027149
Commit
fa027149
authored
Oct 12, 2017
by
Thorsten Buss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Currency::getInstance for better currency usability
parent
47e3fabd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
Currency.php
src/Money/Currency.php
+9
-0
No files found.
src/Money/Currency.php
View file @
fa027149
...
...
@@ -66,6 +66,15 @@ class Currency {
$this
->
loadAttributes
(
$this
->
code
,
$attributes
);
}
/**
* @param $code
* @param array $attributes
* @return static
*/
public
function
getInstance
(
$code
,
array
$attributes
=
[])
{
return
new
static
(
$code
,
$attributes
);
}
/**
* register a repository for loading the currency attributes
* @param CurrencyRepositoryInterface $repo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment