Skip to content

Commit

Permalink
Merge pull request #63 from WimDeMeester/analysis-RPl1yp
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
WimDeMeester authored Feb 6, 2024
2 parents 33e9ccb + c3c207d commit 415ee5a
Show file tree
Hide file tree
Showing 37 changed files with 680 additions and 749 deletions.
79 changes: 33 additions & 46 deletions src/deepskylog/AstronomyLibrary/AstronomyLibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
* PHP Version 8
*
* @category AstronomyLibrary
*
* @author Deepsky Developers <[email protected]>
* @license GPL3 <https://opensource.org/licenses/GPL-3.0>
*
* @link http://www.deepskylog.org
*/

Expand All @@ -26,8 +28,10 @@
* PHP Version 8
*
* @category AstronomyLibrary
*
* @author Deepsky Developers <[email protected]>
* @license GPL3 <https://opensource.org/licenses/GPL-3.0>
*
* @link http://www.deepskylog.org
*/
class AstronomyLibrary
Expand All @@ -45,9 +49,9 @@ class AstronomyLibrary
/**
* The constructor.
*
* @param Carbon $carbonDate The date
* @param GeographicalCoordinates $coordinates The geographical coordinates
* @param float $height The height of the location
* @param Carbon $carbonDate The date
* @param GeographicalCoordinates $coordinates The geographical coordinates
* @param float $height The height of the location
*/
public function __construct(
Carbon $carbonDate,
Expand Down Expand Up @@ -79,8 +83,7 @@ public function getDate(): Carbon
/**
* Sets the date and time.
*
* @param Carbon $date The new Carbon date
*
* @param Carbon $date The new Carbon date
* @return None
*/
public function setDate(Carbon $date): void
Expand Down Expand Up @@ -109,8 +112,7 @@ public function getGeographicalCoordinates(): GeographicalCoordinates
/**
* Sets the date and time.
*
* @param GeographicalCoordinates $coordinates The new geographical coordinates
*
* @param GeographicalCoordinates $coordinates The new geographical coordinates
* @return None
*/
public function setGeographicalCoordinates(
Expand Down Expand Up @@ -138,8 +140,7 @@ public function getHeight(): float
/**
* Sets the height of the location in meters.
*
* @param float $height The height of the location in meters
*
* @param float $height The height of the location in meters
* @return None
*/
public function setHeight(
Expand All @@ -162,8 +163,7 @@ public function getJd(): float
/**
* Sets the julian day and adapt the date.
*
* @param float $jd The julian day
*
* @param float $jd The julian day
* @return None
*/
public function setJd(float $jd): void
Expand Down Expand Up @@ -238,8 +238,7 @@ public function getNutation(): array
/**
* Converts from Equatorial coordinates to ecliptical coordinates.
*
* @param EquatorialCoordinates $coords the equatorial coordinates to convert
*
* @param EquatorialCoordinates $coords the equatorial coordinates to convert
* @return EclipticalCoordinates the ecliptical coordinates for J2000
*/
public function equatorialToEcliptical(
Expand All @@ -251,8 +250,7 @@ public function equatorialToEcliptical(
/**
* Converts from Ecliptical coordinates to Equatorial coordinates.
*
* @param EclipticalCoordinates $coords the ecliptical coordinates to convert
*
* @param EclipticalCoordinates $coords the ecliptical coordinates to convert
* @return EquatorialCoordinates The equatorial coordinates in J2000
*/
public function eclipticalToEquatorial(
Expand All @@ -264,8 +262,7 @@ public function eclipticalToEquatorial(
/**
* Converts from Equatorial coordinates to horizontal coordinates.
*
* @param EquatorialCoordinates $coords the equatorial coordinates to convert
*
* @param EquatorialCoordinates $coords the equatorial coordinates to convert
* @return HorizontalCoordinates the horizontal coordinates for the date and
* location
*/
Expand All @@ -283,8 +280,7 @@ public function equatorialToHorizontal(
* negative before and positive after the passage throught the southern
* meridian. This is the effect of the moon that is lying down at moonrise.
*
* @param EquatorialCoordinates $coords The coordinates of the object
*
* @param EquatorialCoordinates $coords The coordinates of the object
* @return float the parallactic angle in degrees
*/
public function parallacticAngle(EquatorialCoordinates $coords): float
Expand All @@ -298,8 +294,7 @@ public function parallacticAngle(EquatorialCoordinates $coords): float
/**
* Converts from Horizontal coordinates to Equatorial coordinates.
*
* @param HorizontalCoordinates $coords the horizontal coordinates to convert
*
* @param HorizontalCoordinates $coords the horizontal coordinates to convert
* @return EquatorialCoordinates The equatorial coordinates
*/
public function horizontalToEquatorial(
Expand All @@ -314,8 +309,7 @@ public function horizontalToEquatorial(
/**
* Converts from Equatorial coordinates to Galactic coordinates.
*
* @param EquatorialCoordinates $coords the equatorial coordinates to convert
*
* @param EquatorialCoordinates $coords the equatorial coordinates to convert
* @return GalacticCoordinates The galactic coordinates (J2000)
*/
public function equatorialToGalactic(
Expand All @@ -327,8 +321,7 @@ public function equatorialToGalactic(
/**
* Converts from Galactic coordinates to Equatorial coordinates.
*
* @param GalacticCoordinates $coords the galactic coordinates to convert
*
* @param GalacticCoordinates $coords the galactic coordinates to convert
* @return EquatorialCoordinates The equatorial coordinates
*/
public function galacticToEquatorial(
Expand All @@ -340,8 +333,7 @@ public function galacticToEquatorial(
/**
* Creates a chart with the length of the year during the year.
*
* @param string $timezone the timezone to create the graph for
*
* @param string $timezone the timezone to create the graph for
* @return string The chart with the length of the night
*/
public function getLengthOfNightPlot($timezone): string
Expand Down Expand Up @@ -687,7 +679,7 @@ public function getLengthOfNightPlot($timezone): string
}
// Date line
$red = imagecolorallocate($image, 255, 0, 0);
$datelocation = 2 * ($this->getDate()->dayOfYear);
$datelocation = 2 * $this->getDate()->dayOfYear;
imageline($image, $datelocation + 70, 5, $datelocation + 70, 365, $red);

imageline($image, 802, 365, 802, 355, $axiscolor);
Expand Down Expand Up @@ -731,12 +723,11 @@ public function getLengthOfNightPlot($timezone): string
* Returns true if the three bodies are in a straight line.
* Chapter 19 of Astronomical Algorithms.
*
* @param EquatorialCoordinates $coords1 The coordinates of the first object
* @param EquatorialCoordinates $coords2 The coordinates of the second object
* @param EquatorialCoordinates $coords3 The coordinates of the thirds object
* @param float $threshold The threshold for the method
* (default value is 10e-06)
*
* @param EquatorialCoordinates $coords1 The coordinates of the first object
* @param EquatorialCoordinates $coords2 The coordinates of the second object
* @param EquatorialCoordinates $coords3 The coordinates of the thirds object
* @param float $threshold The threshold for the method
* (default value is 10e-06)
* @return bool True if the three bodies are in a straight line
*/
public function isInStraightLine(
Expand All @@ -752,10 +743,9 @@ public function isInStraightLine(
* Returns the deviation from a straight line.
* Chapter 19 of Astronomical Algorithms.
*
* @param EquatorialCoordinates $coords1 The coordinates of the first object
* @param EquatorialCoordinates $coords2 The coordinates of the first object
* @param EquatorialCoordinates $coords3 The coordinates of the second object
*
* @param EquatorialCoordinates $coords1 The coordinates of the first object
* @param EquatorialCoordinates $coords2 The coordinates of the first object
* @param EquatorialCoordinates $coords3 The coordinates of the second object
* @return Coordinate the deviation from the straight line
*/
public function deviationFromStraightLine(
Expand All @@ -770,10 +760,9 @@ public function deviationFromStraightLine(
* Returns the smallest circle containing three celestial bodies.
* Chapter 20 of Astronomical Algorithms.
*
* @param EquatorialCoordinates $coords1 The coordinates of the first object
* @param EquatorialCoordinates $coords2 The coordinates of the second object
* @param EquatorialCoordinates $coords3 The coordinates of the third object
*
* @param EquatorialCoordinates $coords1 The coordinates of the first object
* @param EquatorialCoordinates $coords2 The coordinates of the second object
* @param EquatorialCoordinates $coords3 The coordinates of the third object
* @return Coordinate the diameter of the smallest circle
*/
public function smallestCircle(
Expand All @@ -787,8 +776,7 @@ public function smallestCircle(
/**
* Returns the apparent place of a star.
*
* @param EquatorialCoordinates $coords The coordinates to start with
*
* @param EquatorialCoordinates $coords The coordinates to start with
* @return EquatorialCoordinates The apparent place for the star
*/
public function apparentPlace(
Expand All @@ -801,8 +789,7 @@ public function apparentPlace(
* Returns rhoSinPhi and rhoCosPhi.
* Needed for the calculation of the parallax.
*
* @param float $height The height of the location
*
* @param float $height The height of the location
* @return array with rhoSinPhi and rhoCosPhi
*
* See Chapter 11 of Astronomical Algorithms
Expand Down
44 changes: 22 additions & 22 deletions src/deepskylog/AstronomyLibrary/Commands/UpdateOrbitalElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ public function handle()
if ($name != '') {
CometsOrbitalElements::create(
[
'name' => $name,
'epoch' => $epoch,
'q' => $q,
'e' => $e,
'i' => $i,
'w' => $w,
'node' => $node,
'Tp' => $Tp,
'ref' => $ref,
'name' => $name,
'epoch' => $epoch,
'q' => $q,
'e' => $e,
'i' => $i,
'w' => $w,
'node' => $node,
'Tp' => $Tp,
'ref' => $ref,
]
);
}
Expand Down Expand Up @@ -127,19 +127,19 @@ public function handle()
if ($name != '') {
AsteroidsOrbitalElements::create(
[
'number' => $number,
'name' => $name,
'epoch' => $epoch,
'a' => $a,
'e' => $e,
'i' => $i,
'w' => $w,
'node' => $node,
'M' => $M,
'H' => $H,
'G' => $G,
'Tp' => $Tp,
'ref' => $ref,
'number' => $number,
'name' => $name,
'epoch' => $epoch,
'a' => $a,
'e' => $e,
'i' => $i,
'w' => $w,
'node' => $node,
'M' => $M,
'H' => $H,
'G' => $G,
'Tp' => $Tp,
'ref' => $ref,
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/deepskylog/AstronomyLibrary/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Kernel extends ConsoleKernel
/**
* Define laravel-astronomy-library's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule The schedule
* @param \Illuminate\Console\Scheduling\Schedule $schedule The schedule
*/
protected function schedule(Schedule $schedule)
{
Expand Down
19 changes: 10 additions & 9 deletions src/deepskylog/AstronomyLibrary/Coordinates/Coordinate.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
* PHP Version 8
*
* @category Coordinates
*
* @author Deepsky Developers <[email protected]>
* @license GPL3 <https://opensource.org/licenses/GPL-3.0>
*
* @link http://www.deepskylog.org
*/

Expand All @@ -19,8 +21,10 @@
* PHP Version 8
*
* @category Coordinates
*
* @author Deepsky Developers <[email protected]>
* @license GPL3 <https://opensource.org/licenses/GPL-3.0>
*
* @link http://www.deepskylog.org
*/
class Coordinate
Expand All @@ -32,9 +36,9 @@ class Coordinate
/**
* The constructor.
*
* @param float $coordinate The coordinate
* @param float $minValue The minimum value for the coordinate
* @param float $maxValue The maximum value for the coordinate
* @param float $coordinate The coordinate
* @param float $minValue The minimum value for the coordinate
* @param float $maxValue The maximum value for the coordinate
*/
public function __construct(
float $coordinate,
Expand All @@ -50,8 +54,7 @@ public function __construct(
/**
* Set the coordinate.
*
* @param float $coord the coordinate to set
*
* @param float $coord the coordinate to set
* @return None
*/
public function setCoordinate(float $coord): void
Expand Down Expand Up @@ -185,8 +188,7 @@ public function convertToShortHours(): string
/**
* Sets the minimum valid value for the coordinate.
*
* @param float $minValue The minimum valid value
*
* @param float $minValue The minimum valid value
* @return None
*/
public function setMinValue(float $minValue): void
Expand All @@ -197,8 +199,7 @@ public function setMinValue(float $minValue): void
/**
* Sets the maximum valid value for the first coordinate.
*
* @param float $maxValue The maximum valid value
*
* @param float $maxValue The maximum valid value
* @return None
*/
public function setMaxValue(float $maxValue): void
Expand Down
Loading

0 comments on commit 415ee5a

Please sign in to comment.