Skip to content
This repository was archived by the owner on Dec 27, 2023. It is now read-only.

Commit 05a5fee

Browse files
committed
Minor fixes in DecimalConstants
1 parent c9c4f28 commit 05a5fee

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

src/DecimalConstants.php

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,64 +38,69 @@ private function __clone()
3838

3939
/**
4040
* Returns the Pi number.
41+
* @return Decimal
4142
*/
4243
public static function PI()
4344
{
44-
if (static::$PI === null) {
45-
static::$PI = Decimal::fromString(
45+
if (self::$PI === null) {
46+
self::$PI = Decimal::fromString(
4647
"3.14159265358979323846264338327950"
4748
);
4849
}
49-
return static::$PI;
50+
return self::$PI;
5051
}
5152

5253
/**
5354
* Returns the Euler's E number.
55+
* @return Decimal
5456
*/
5557
public static function E()
5658
{
57-
if (static::$E === null) {
58-
static::$E = Decimal::fromString(
59+
if (self::$E === null) {
60+
self::$E = Decimal::fromString(
5961
"2.71828182845904523536028747135266"
6062
);
6163
}
62-
return static::$E;
64+
return self::$E;
6365
}
6466

6567
/**
6668
* Returns the Euler-Mascheroni constant.
69+
* @return Decimal
6770
*/
6871
public static function EulerMascheroni()
6972
{
70-
if (static::$EulerMascheroni === null) {
71-
static::$EulerMascheroni = Decimal::fromString(
73+
if (self::$EulerMascheroni === null) {
74+
self::$EulerMascheroni = Decimal::fromString(
7275
"0.57721566490153286060651209008240"
7376
);
7477
}
75-
return static::$EulerMascheroni;
78+
return self::$EulerMascheroni;
7679
}
7780

7881
/**
7982
* Returns the Golden Ration, also named Phi.
83+
* @return Decimal
8084
*/
8185
public static function GoldenRatio()
8286
{
83-
if (static::$GoldenRatio === null) {
84-
static::$GoldenRatio = Decimal::fromString(
87+
if (self::$GoldenRatio === null) {
88+
self::$GoldenRatio = Decimal::fromString(
8589
"1.61803398874989484820458683436564"
8690
);
8791
}
88-
return static::$GoldenRatio;
92+
return self::$GoldenRatio;
8993
}
9094

9195
/**
9296
* Returns the Light of Speed measured in meters / second.
97+
* @return Decimal
9398
*/
9499
public static function LightSpeed()
95100
{
96-
if (static::$LightSpeed === null) {
97-
static::$LightSpeed = Decimal::fromInteger(299792458);
101+
if (self::$LightSpeed === null) {
102+
self::$LightSpeed = Decimal::fromInteger(299792458);
98103
}
99-
return static::$LightSpeed;
104+
return selfgit::$LightSpeed;
100105
}
101106
}

0 commit comments

Comments
 (0)