File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/Coduo/PHPHumanizer/String Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ final class BinarySuffix
3939 */
4040 public function __construct ($ number , $ locale = 'en ' , $ precision = null )
4141 {
42+ if (!\class_exists ('NumberFormatter ' )) {
43+ throw new \RuntimeException ('Binary suffix converter requires intl extension! ' );
44+ }
45+
4246 if (!\is_numeric ($ number )) {
4347 throw new \InvalidArgumentException ('Binary suffix converter accept only numeric values. ' );
4448 }
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ final class MetricSuffix
3838 */
3939 public function __construct ($ number , $ locale = 'en ' )
4040 {
41+ if (!\class_exists ('NumberFormatter ' )) {
42+ throw new \RuntimeException ('Metric suffix converter requires intl extension! ' );
43+ }
44+
4145 if (!\is_numeric ($ number )) {
4246 throw new \InvalidArgumentException ('Metric suffix converter accept only numeric values. ' );
4347 }
You can’t perform that action at this time.
0 commit comments