Created
February 23, 2014 16:11
-
-
Save mathiasverraes/9173323 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
final class Number // Immutable value object | |
{ | |
/** | |
* @param int $arabic | |
* @throws InvalidArgumentException | |
*/ | |
public function __construct($arabic) { /* ... */ } | |
/** | |
* @param int $arabic | |
* @return Number | |
* @throws InvalidArgumentException | |
*/ | |
public static function fromArabic($arabic) { /* ... */ } | |
/** | |
* @param string $roman | |
* @return Number | |
* @throws InvalidArgumentException | |
*/ | |
public static function fromRoman($roman) { /* ... */ } | |
/** | |
* @return int | |
*/ | |
public function asArabic() { /* ... */ } | |
/** | |
* @return string | |
*/ | |
public function asRoman() { /* ... */ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment