-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Clifford Vickrey
committed
Oct 11, 2023
1 parent
53aaefb
commit a14b04c
Showing
14 changed files
with
39 additions
and
38 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
<?php | ||
|
||
/** @noinspection PhpComposerExtensionStubsInspection */ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CliffordVickrey\Crosstabs\NumberFormatting; | ||
|
||
use NumberFormatter; | ||
use function extension_loaded; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
enum CrosstabNumberFormatterType | ||
{ | ||
case DECIMAL; | ||
case PERCENT; | ||
case Decimal; | ||
case Percent; | ||
|
||
/** | ||
* @return int | ||
* @noinspection PhpFullyQualifiedNameUsageInspection | ||
*/ | ||
public function toIntlConstant(): int | ||
{ | ||
if (self::DECIMAL === $this) { | ||
return NumberFormatter::DECIMAL; | ||
if (!extension_loaded('intl')) { | ||
// @codeCoverageIgnoreStart | ||
return self::Decimal === $this ? 1 : 3; | ||
// @codeCoverageIgnoreEnd | ||
} | ||
|
||
return NumberFormatter::PERCENT; | ||
return self::Decimal === $this ? \NumberFormatter::DECIMAL : \NumberFormatter::PERCENT; | ||
} | ||
} |
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 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 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