aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-09 10:55:03 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-09 13:09:38 +0100
commit04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa (patch)
tree5c691241355c943a3c68ddb06b8cf8c60aa11319 /srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php
parent7e0d85db834d6351ed85d01e5126ac31dc510b86 (diff)
downloadft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.gz
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.tar.bz2
ft_server-04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa.zip
phpmyadmin working
Diffstat (limited to 'srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php')
-rw-r--r--srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php73
1 files changed, 73 insertions, 0 deletions
diff --git a/srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php b/srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php
new file mode 100644
index 0000000..3c44c1d
--- /dev/null
+++ b/srcs/phpmyadmin/vendor/dasprid/enum/test/Planet.php
@@ -0,0 +1,73 @@
+<?php
+declare(strict_types = 1);
+
+namespace DASPRiD\EnumTest;
+
+use DASPRiD\Enum\AbstractEnum;
+
+/**
+ * @method static self MERCURY()
+ * @method static self VENUS()
+ * @method static self EARTH()
+ * @method static self MARS()
+ * @method static self JUPITER()
+ * @method static self SATURN()
+ * @method static self URANUS()
+ * @method static self NEPTUNE()
+ */
+final class Planet extends AbstractEnum
+{
+ protected const MERCURY = [3.303e+23, 2.4397e6];
+ protected const VENUS = [4.869e+24, 6.0518e6];
+ protected const EARTH = [5.976e+24, 6.37814e6];
+ protected const MARS = [6.421e+23, 3.3972e6];
+ protected const JUPITER = [1.9e+27, 7.1492e7];
+ protected const SATURN = [5.688e+26, 6.0268e7];
+ protected const URANUS = [8.686e+25, 2.5559e7];
+ protected const NEPTUNE = [1.024e+26, 2.4746e7];
+
+ /**
+ * Universal gravitational constant.
+ */
+ private const G = 6.67300E-11;
+
+ /**
+ * Mass in kilograms.
+ *
+ * @var float
+ */
+ private $mass;
+
+ /**
+ * Radius in meters.
+ *
+ * @var float
+ */
+ private $radius;
+
+ protected function __construct(float $mass, float $radius)
+ {
+ $this->mass = $mass;
+ $this->radius = $radius;
+ }
+
+ public function mass() : float
+ {
+ return $this->mass;
+ }
+
+ public function radius() : float
+ {
+ return $this->radius;
+ }
+
+ public function surfaceGravity() : float
+ {
+ return self::G * $this->mass / ($this->radius * $this->radius);
+ }
+
+ public function surfaceWeight(float $otherMass) : float
+ {
+ return $otherMass * $this->surfaceGravity();
+ }
+}