From 5bd7487aa242248ad255b041f5fe99a8f5daca33 Mon Sep 17 00:00:00 2001 From: Ivan Stanojevic Date: Wed, 8 Jan 2020 11:08:36 +0100 Subject: [PATCH] add code from tle-api project --- .gitignore | 2 + LICENSE => LICENSE.md | 0 README.md | 20 +- TLE/Constant.php | 16 - TLE/Parser.php | 383 ---- composer.json | 28 + composer.lock | 1859 +++++++++++++++++ examples.php | 54 - phpunit.xml.dist | 27 + src/Api.php | 39 + src/Enum/Constant.php | 13 + src/Enum/OrbitDirectionEnum.php | 11 + src/Enum/SatelliteClassificationEnum.php | 12 + src/Exception/InvalidTleException.php | 7 + src/Field/InclinationField.php | 18 + src/Field/NameField.php | 18 + src/Field/TleField.php | 29 + src/Helper/SampleTleHelper.php | 19 + src/Model/Tle.php | 183 ++ src/Model/TleFile.php | 44 + src/Parser.php | 294 +++ src/Service/ChecksumCalculator.php | 27 + src/Service/Validator.php | 16 + src/Specification/PolarOrbitSpecification.php | 23 + .../PosigradeOrbitSpecification.php | 13 + .../RetrogradeOrbitSpecification.php | 13 + src/Specification/SpecificationInterface.php | 10 + tests/ChecksumCalculatorTest.php | 20 + tests/PolarOrbitSpecificationTest.php | 38 + tests/PosigradeOrbitSpecificationTest.php | 17 + tests/RetrogradeOrbitSpecificationTest.php | 17 + tests/TleApiTest.php | 15 + 32 files changed, 2824 insertions(+), 461 deletions(-) rename LICENSE => LICENSE.md (100%) delete mode 100644 TLE/Constant.php delete mode 100644 TLE/Parser.php create mode 100644 composer.json create mode 100644 composer.lock delete mode 100644 examples.php create mode 100644 phpunit.xml.dist create mode 100644 src/Api.php create mode 100644 src/Enum/Constant.php create mode 100644 src/Enum/OrbitDirectionEnum.php create mode 100644 src/Enum/SatelliteClassificationEnum.php create mode 100644 src/Exception/InvalidTleException.php create mode 100644 src/Field/InclinationField.php create mode 100644 src/Field/NameField.php create mode 100644 src/Field/TleField.php create mode 100644 src/Helper/SampleTleHelper.php create mode 100644 src/Model/Tle.php create mode 100644 src/Model/TleFile.php create mode 100644 src/Parser.php create mode 100644 src/Service/ChecksumCalculator.php create mode 100644 src/Service/Validator.php create mode 100644 src/Specification/PolarOrbitSpecification.php create mode 100644 src/Specification/PosigradeOrbitSpecification.php create mode 100644 src/Specification/RetrogradeOrbitSpecification.php create mode 100644 src/Specification/SpecificationInterface.php create mode 100644 tests/ChecksumCalculatorTest.php create mode 100644 tests/PolarOrbitSpecificationTest.php create mode 100644 tests/PosigradeOrbitSpecificationTest.php create mode 100644 tests/RetrogradeOrbitSpecificationTest.php create mode 100644 tests/TleApiTest.php diff --git a/.gitignore b/.gitignore index 485dee6..b9f0e75 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .idea + +/vendor diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md index eba161f..e1fb2e5 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,19 @@ -# TLE - Two Line Element -NASA/NORAD Two line element set framework +# TLE PHP -A two-line element (TLE) is a set of two data lines listing orbital elements that describe the state (position and velocity) of an Earth-orbiting object. The TLE data representation is specific to the Simplified perturbations models (SGP, SGP4, SDP4, SGP8 and SDP8) so any algorithm using a TLE as a data source must implement one of the simplified perturbations models to correctly compute the state of an object at a time of interest. +Client for NASA TLE API (http://api.nasa.gov/) and TLE framework implemented in php. -Parser usage: +# About + +The TLE API provides up to date two line element set records, the data is updated daily from [CelesTrak](https://celestrak.com/) and served in JSON format. A two-line element set (TLE) is a data format encoding a list of orbital elements of an Earth-orbiting object for a given point in time. For more information on TLE data format visit [Definition of Two-line Element Set Coordinate System](https://spaceflight.nasa.gov/realdata/sightings/SSapplications/Post/JavaSSOP/SSOP_Help/tle_def.html). + +#Usage ``` -use TLE\Parser; +use Ivanstan\Tle\Api; -$tleParser = new Parser($tleString); +$client = new Api(); -$tleParser->eccentricity; -$tleParser->raan; +$tle = $client->get(25544); +$tle->getLine1(); +$tle->getLine2(); ``` diff --git a/TLE/Constant.php b/TLE/Constant.php deleted file mode 100644 index ffe14e6..0000000 --- a/TLE/Constant.php +++ /dev/null @@ -1,16 +0,0 @@ -dateTimeZone = new \DateTimeZone('UTC'); - $this->currentDateTime = ($dateTime == null) ? getdate() : $dateTime; - - $lines = explode("\n", $tleString); - - switch(count($lines)) { - case 2: - - break; - case 3: - $this->name = substr($lines[0], 0, 24); - unset($lines[0]); - break; - default: - throw new \Exception('Invalid two element set'); - } - - $this->firstLine = trim(reset($lines)); - $this->secondLine = trim(end($lines)); - - $this->firstLineChecksum = (int)trim(substr($this->firstLine, 68)); - $this->firstLineCalculatedChecksum = (int)$this->calculateChecksum($this->firstLine); - - if($this->firstLineChecksum != $this->firstLineCalculatedChecksum) { - throw new \Exception('TLE First Line Checksum fail'); - } - - $this->secondLineChecksum = (int)trim(substr($this->secondLine, 68)); - $this->secondLineCalculatedChecksum = (int)$this->calculateChecksum($this->secondLine); - - if($this->secondLineChecksum != $this->secondLineCalculatedChecksum) { - throw new \Exception('TLE Second Line Checksum fail'); - } - - $this->satelliteNumber = (int)substr($this->firstLine, 2, 6); - $this->classification = substr($this->firstLine, 7, 1); - $this->internationalDesignatorLaunchYear = (int)trim(substr($this->firstLine, 9, 2)); - - if($this->internationalDesignatorLaunchYear) { - $dateTime = \DateTime::createFromFormat('y', $this->internationalDesignatorLaunchYear); - $dateTime->setTimezone($this->dateTimeZone); - $this->internationalDesignatorLaunchYear = (int)$dateTime->format('Y'); - } - - $this->internationalDesignatorLaunchNumber = (int)trim(substr($this->firstLine, 12, 2)); - $this->internationalDesignatorLaunchPiece = trim(substr($this->firstLine, 14, 2)); - $this->epochYear = trim(substr($this->firstLine, 18, 2)); - $dateTime = \DateTime::createFromFormat('y', $this->epochYear); - $dateTime->setTimezone($this->dateTimeZone); - $this->epochYear = (int)$dateTime->format('Y'); - $this->epoch = trim(substr($this->firstLine, 18, 14)); - $epoch = explode('.', trim(substr($this->firstLine, 20, 12))); - $this->epochDay = (int)$epoch[0]; - $this->epochFraction = '0.' . $epoch[1]; - $this->epochUnixTimestamp = $this->getEpochUnixTimestamp(); - $this->meanMotionFirstDerivative = trim(substr($this->firstLine, 33, 10)); - $this->meanMotionSecondDerivative = trim(substr($this->firstLine, 44, 8)); - $this->bStarDragTerm = trim(substr($this->firstLine, 53, 8)); - $this->elementNumber = (int)trim(substr($this->firstLine, 64, 4)); - $this->satelliteNumber = (int)trim(substr($this->secondLine, 2, 6)); - $this->inclination = (float)trim(substr($this->secondLine, 8, 8)); - $this->rightAscensionAscendingNode = (float)trim(substr($this->secondLine, 17, 8)); - $this->eccentricity = (float)('.' . trim(substr($this->secondLine, 26, 7))); - $this->argumentPerigee = (float)trim(substr($this->secondLine, 34, 8)); - $this->meanAnomaly = (float)trim(substr($this->secondLine, 43, 8)); - $this->meanMotion = (float)trim(substr($this->secondLine, 52, 11)); - $this->revTime = $this->meanMotion * \Constant::SIDERAL_DAY_SEC; - } - - /** - * Check if orbit is retrograde. Inclination larger 90 degrees. - * - * @return bool - */ - public function orbitRetrograde() { - return ($this->inclination > 90) ? true : false; - } - - /** - * Check if orbit is prograde. Inclination less than 90 degrees. - * - * @return bool - */ - public function orbitPrograde() { - return ($this->inclination < 90) ? true : false; - } - - /** - * Check if orbit is polar. Inclination equal to 90 degrees. - * - * @return bool - */ - public function orbitPolar() { - return ($this->inclination == 90) ? true : false; - } - - /** - * Calculates checksum (Modulo 10) for TLE line. - * - * @param $line TLE line - * - * @return int - */ - public function calculateChecksum($line) { - $line = substr($line, 0, strlen($line) - 1); - $sum = 0; - for($i = 0; $i < strlen($line); $i++) { - if($line[$i] == '-') { - $sum += 1; - } elseif(is_numeric($line[$i])) { - $sum += $line[$i]; - } - - } - - return $sum % 10; - } - - /** - * Calculate Unix timestamp from TLE Epoch. - * - * @return string - */ - private function getEpochUnixTimestamp() { - $seconds = round(86400 * $this->epochFraction); - $date = new \DateTime(); - $date->setTimezone($this->dateTimeZone); - $date->setDate($this->epochYear, 1, 1); - $date->setTime(0, 0, 0); - - return $date->format('U') + (86400 * $this->epochDay) + $seconds - 86400; - } - -} diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7662eb1 --- /dev/null +++ b/composer.json @@ -0,0 +1,28 @@ +{ + "name": "ivanstan/tle-php", + "description": "TLE Framework written in PHP and client to NASA TLE API.", + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Ivan Stanojevic", + "email": "ivan.stanojevic@protonmail.com" + } + ], + "require": { + "myclabs/php-enum": "^1.7", + "guzzlehttp/guzzle": "^6.5", + "ext-json": "*" + }, + "autoload": { + "psr-4": { + "Ivanstan\\Tle\\": "src" + } + }, + "scripts": { + "test": "./vendor/bin/phpunit --coverage-text" + }, + "require-dev": { + "phpunit/phpunit": "^8" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..c6f25be --- /dev/null +++ b/composer.lock @@ -0,0 +1,1859 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "8dde21dd272af9f9e2a1ef0955d7959a", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "6.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/43ece0e75098b7ecd8d13918293029e555a50f82", + "reference": "43ece0e75098b7ecd8d13918293029e555a50f82", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.6.1", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.1" + }, + "suggest": { + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2019-12-23T11:57:10+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/239400de7a173fe9901b9ac7c06497751f00727a", + "reference": "239400de7a173fe9901b9ac7c06497751f00727a", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "ext-zlib": "*", + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" + }, + "suggest": { + "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2019-07-01T23:21:34+00:00" + }, + { + "name": "myclabs/php-enum", + "version": "1.7.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/php-enum.git", + "reference": "45f01adf6922df6082bcda36619deb466e826acf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/45f01adf6922df6082bcda36619deb466e826acf", + "reference": "45f01adf6922df6082bcda36619deb466e826acf", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "squizlabs/php_codesniffer": "1.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "MyCLabs\\Enum\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP Enum contributors", + "homepage": "https://github.com/myclabs/php-enum/graphs/contributors" + } + ], + "description": "PHP Enum implementation", + "homepage": "http://github.com/myclabs/php-enum", + "keywords": [ + "enum" + ], + "time": "2019-08-19T13:53:00+00:00" + }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2019-03-08T08:55:37+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^6.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-shim": "^0.11", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2019-10-21T16:45:58+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.9.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", + "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2019-12-15T19:12:40+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^2.0", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2018-07-08T19:23:20+00:00" + }, + { + "name": "phar-io/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2018-07-08T19:19:57+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpunit/phpunit": "~6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2018-08-07T13:53:10+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "^1.0.5", + "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2019-12-28T18:55:12+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "shasum": "" + }, + "require": { + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.10.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc", + "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2019-12-22T21:05:45+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "7.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f1884187926fbb755a9aaf0b3836ad3165b478bf", + "reference": "f1884187926fbb755a9aaf0b3836ad3165b478bf", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.2", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^3.1.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^4.2.2", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1.3" + }, + "require-dev": { + "phpunit/phpunit": "^8.2.2" + }, + "suggest": { + "ext-xdebug": "^2.7.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2019-11-20T13:55:58+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "050bedf145a257b1ff02746c31894800e5122946" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2018-09-13T20:33:42+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", + "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2019-06-07T04:22:29+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2019-09-17T06:23:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "8.5.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7870c78da3c5e4883eaef36ae47853ebb3cb86f2", + "reference": "7870c78da3c5e4883eaef36ae47853ebb3cb86f2", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2.0", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.9.1", + "phar-io/manifest": "^1.0.3", + "phar-io/version": "^2.0.1", + "php": "^7.2", + "phpspec/prophecy": "^1.8.1", + "phpunit/php-code-coverage": "^7.0.7", + "phpunit/php-file-iterator": "^2.0.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^2.1.2", + "sebastian/comparator": "^3.0.2", + "sebastian/diff": "^3.0.2", + "sebastian/environment": "^4.2.2", + "sebastian/exporter": "^3.1.1", + "sebastian/global-state": "^3.0.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^2.0.1", + "sebastian/type": "^1.1.3", + "sebastian/version": "^2.0.1" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*", + "phpunit/php-invoker": "^2.0.0" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2019-12-25T14:49:39+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "shasum": "" + }, + "require": { + "php": "^7.1", + "sebastian/diff": "^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-07-12T15:12:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "time": "2019-02-04T06:01:07+00:00" + }, + { + "name": "sebastian/environment", + "version": "4.2.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2019-11-20T08:46:58+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2019-09-14T09:02:43+00:00" + }, + { + "name": "sebastian/global-state", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "reference": "edf8a461cf1d4005f19fb0b6b8b95a9f7fa0adc4", + "shasum": "" + }, + "require": { + "php": "^7.2", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^8.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2019-02-01T05:30:01+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2018-10-04T04:07:39+00:00" + }, + { + "name": "sebastian/type", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/3aaaa15fa71d27650d62a948be022fe3b48541a3", + "reference": "3aaaa15fa71d27650d62a948be022fe3b48541a3", + "shasum": "" + }, + "require": { + "php": "^7.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "time": "2019-07-02T08:10:15+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.13.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.13-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-11-27T13:56:44+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2019-06-13T22:48:21+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.6.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", + "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2019-11-24T13:36:37+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/examples.php b/examples.php deleted file mode 100644 index fcbce18..0000000 --- a/examples.php +++ /dev/null @@ -1,54 +0,0 @@ -"; print_r($tle); echo ""; - - $parser = new Parser($tle); - echo "
"; var_dump(get_object_vars($parser)); echo "
"; -} - diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..2f4a2cf --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,27 @@ + + + + + + + + + + + src + + + + + + tests + tests/TleApiTest.php + + + + diff --git a/src/Api.php b/src/Api.php new file mode 100644 index 0000000..8c5382c --- /dev/null +++ b/src/Api.php @@ -0,0 +1,39 @@ +client = $client; + } + + public function get(int $id): Tle + { + $response = $this->client->get( + self::ENDPOINT . '/api/tle/' . $id + , + [ + 'query' => [ + 'id' => $id, + ], + ] + ); + + $record = json_decode($response->getBody()->getContents(), true, 512, JSON_THROW_ON_ERROR); + + return new Tle($record['line1'], $record['line2'], $record['name']); + } +} \ No newline at end of file diff --git a/src/Enum/Constant.php b/src/Enum/Constant.php new file mode 100644 index 0000000..7bc2ab8 --- /dev/null +++ b/src/Enum/Constant.php @@ -0,0 +1,13 @@ +inclination; + } + + public function setInclination(float $inclination): void + { + $this->inclination = $inclination; + } +} \ No newline at end of file diff --git a/src/Field/NameField.php b/src/Field/NameField.php new file mode 100644 index 0000000..65d4dfa --- /dev/null +++ b/src/Field/NameField.php @@ -0,0 +1,18 @@ +name; + } + + public function setName(string $name): void + { + $this->name = $name; + } +} diff --git a/src/Field/TleField.php b/src/Field/TleField.php new file mode 100644 index 0000000..a64e1ac --- /dev/null +++ b/src/Field/TleField.php @@ -0,0 +1,29 @@ +line1; + } + + public function setLine1(string $line1): void + { + $this->line1 = $line1; + } + + public function getLine2(): string + { + return $this->line2; + } + + public function setLine2(string $line2): void + { + $this->line2 = $line2; + } +} diff --git a/src/Helper/SampleTleHelper.php b/src/Helper/SampleTleHelper.php new file mode 100644 index 0000000..8c0556a --- /dev/null +++ b/src/Helper/SampleTleHelper.php @@ -0,0 +1,19 @@ +line1 = $line1; + $this->line2 = $line2; + $this->name = $name; + + // calculated fields + $this->inclination = (float)trim(substr($this->line2, 8, 8)); + } + + public function getId(): int + { + return (int)substr($this->line1, 2, 6); + } + + public function getClassification(): string + { + return $this->line1[7]; + } + + public function getName(): string + { + return $this->name; + } + + public function launchYear(?bool $fourDigits = null): int + { + $year = (int)trim(substr($this->line1, 9, 2)); + + if ($fourDigits ?? true) { + $this->formatYear($year); + } + + return $year; + } + + public function launchNumberOfYear(): int + { + return (int)trim(substr($this->line1, 12, 2)); + } + + public function epoch(): string + { + return trim(substr($this->line1, 18, 14)); + } + + public function launchPiece(): string + { + return trim(substr($this->line1, 14, 2)); + } + + public function bstar(): string + { + return trim(substr($this->line1, 53, 8)); + } + + public function elementNumber(): int + { + return (int)trim(substr($this->line1, 64, 4)); + } + + public function raan(): float + { + return (float)trim(substr($this->line2, 17, 8)); + } + + public function eccentricity(): float + { + return (float)('.' . trim(substr($this->line2, 26, 7))); + } + + public function meanAnomaly(): float + { + return (float)trim(substr($this->line2, 43, 8)); + } + + public function argumentOfPerigee(): float + { + return (float)trim(substr($this->line2, 34, 8)); + } + + public function meanMotion(): float + { + return (float)trim(substr($this->line2, 52, 11)); + } + + public function getDate(): string + { + $year = (int)trim(substr($this->line1, 18, 2)); + $year = $this->formatYear($year); + + $date = new \DateTime(); + $timezone = new \DateTimeZone('UTC'); + + $epoch = (float)trim(substr($this->line1, 20, 12)); + $days = (int)$epoch; + + $date + ->setTimezone($timezone) + ->setDate($year, 1, $days); + + $faction = round($epoch - $days, 8); + + $faction *= 24; // hours + $hours = round($faction); + $faction -= $hours; + + $faction *= 60; // minutes + $minutes = round($faction); + $faction -= $minutes; + + $faction *= 60; // seconds + $seconds = round($faction); + $faction -= $seconds; + + $faction *= 1000; // milliseconds + $milliseconds = round($faction); + + $date->setTime($hours, $minutes, $seconds, $milliseconds); + + return $date->format('c'); + } + + public function getChecksum(int $lineNumber): int + { + $line = $this->getLineByNumber($lineNumber); + + return (int)trim(substr($line, 68)); + } + + public function calculateChecksum(int $lineNumber): int + { + $line = $this->getLineByNumber($lineNumber); + + return ChecksumCalculator::calculate($line); + } + + private function formatYear(int $twoDigitYear): int + { + if ($twoDigitYear < 57) { + $twoDigitYear += 2000; + } else { + $twoDigitYear += 1900; + } + + return $twoDigitYear; + } + + private function getLineByNumber(int $lineNumber): string + { + if (self::LINE1 === $lineNumber) { + return $this->line1; + } + + if (self::LINE2 === $lineNumber) { + return $this->line2; + } + + throw new \InvalidArgumentException(\sprintf('Invalid line number %d', $lineNumber)); + } +} diff --git a/src/Model/TleFile.php b/src/Model/TleFile.php new file mode 100644 index 0000000..b01b350 --- /dev/null +++ b/src/Model/TleFile.php @@ -0,0 +1,44 @@ +content = $content; + } + + /** + * @return Tle[] + */ + public function parse(): array + { + $data = explode("\n", $this->content); + $data = array_filter($data); + $raw = array_chunk($data, 3); + + $result = []; + foreach ($raw as $key => $item) { + if (!isset($item[0], $item[1], $item[2])) { + $result[$key] = null; + continue; + } + + $result[$key] = new Tle($this->trim($item[1]), $this->trim($item[2]), $this->trim($item[0])); + } + + return $result; + } + + protected function trim(string $string): string + { + $string = str_replace(["/\r\n/", "/\r/", "/\n/"], '', $string); + + return trim($string); + } +} \ No newline at end of file diff --git a/src/Parser.php b/src/Parser.php new file mode 100644 index 0000000..5af89ec --- /dev/null +++ b/src/Parser.php @@ -0,0 +1,294 @@ +dateTimeZone = new \DateTimeZone('UTC'); + $this->currentDateTime = ($dateTime == null) ? getdate() : $dateTime; + + $lines = explode("\n", $tleString); + + switch (count($lines)) { + case 2: + + break; + case 3: + $this->name = substr($lines[0], 0, 24); + unset($lines[0]); + break; + default: + throw new \Exception('Invalid two element set'); + } + + $this->firstLine = trim(reset($lines)); + $this->secondLine = trim(end($lines)); + + $this->firstLineChecksum = (int)trim(substr($this->firstLine, 68)); + $this->firstLineCalculatedChecksum = (int)$this->calculateChecksum($this->firstLine); + + if ($this->firstLineChecksum != $this->firstLineCalculatedChecksum) { + throw new \Exception('src First Line ChecksumCalculatorTest.php fail'); + } + + $this->secondLineChecksum = (int)trim(substr($this->secondLine, 68)); + $this->secondLineCalculatedChecksum = (int)$this->calculateChecksum($this->secondLine); + + if ($this->secondLineChecksum != $this->secondLineCalculatedChecksum) { + throw new \Exception('src Second Line ChecksumCalculatorTest.php fail'); + } + + $this->satelliteNumber = (int)substr($this->firstLine, 2, 6); + $this->classification = substr($this->firstLine, 7, 1); + $this->internationalDesignatorLaunchYear = (int)trim(substr($this->firstLine, 9, 2)); + + if ($this->internationalDesignatorLaunchYear) { + $dateTime = \DateTime::createFromFormat('y', $this->internationalDesignatorLaunchYear); + $dateTime->setTimezone($this->dateTimeZone); + $this->internationalDesignatorLaunchYear = (int)$dateTime->format('Y'); + } + + $this->internationalDesignatorLaunchNumber = (int)trim(substr($this->firstLine, 12, 2)); + $this->internationalDesignatorLaunchPiece = trim(substr($this->firstLine, 14, 2)); + $this->epochYear = trim(substr($this->firstLine, 18, 2)); + $dateTime = \DateTime::createFromFormat('y', $this->epochYear); + $dateTime->setTimezone($this->dateTimeZone); + $this->epochYear = (int)$dateTime->format('Y'); + $this->epoch = trim(substr($this->firstLine, 18, 14)); + $epoch = explode('.', trim(substr($this->firstLine, 20, 12))); + $this->epochDay = (int)$epoch[0]; + $this->epochFraction = '0.' . $epoch[1]; + $this->epochUnixTimestamp = $this->getEpochUnixTimestamp(); + $this->meanMotionFirstDerivative = trim(substr($this->firstLine, 33, 10)); + $this->meanMotionSecondDerivative = trim(substr($this->firstLine, 44, 8)); + $this->bStarDragTerm = trim(substr($this->firstLine, 53, 8)); + $this->elementNumber = (int)trim(substr($this->firstLine, 64, 4)); + $this->satelliteNumber = (int)trim(substr($this->secondLine, 2, 6)); + $this->inclination = (float)trim(substr($this->secondLine, 8, 8)); + $this->rightAscensionAscendingNode = (float)trim(substr($this->secondLine, 17, 8)); + $this->eccentricity = (float)('.' . trim(substr($this->secondLine, 26, 7))); + $this->argumentPerigee = (float)trim(substr($this->secondLine, 34, 8)); + $this->meanAnomaly = (float)trim(substr($this->secondLine, 43, 8)); + $this->meanMotion = (float)trim(substr($this->secondLine, 52, 11)); + $this->revTime = $this->meanMotion * Constant::SIDEREAL_DAY_SEC; + } +} diff --git a/src/Service/ChecksumCalculator.php b/src/Service/ChecksumCalculator.php new file mode 100644 index 0000000..a61f83f --- /dev/null +++ b/src/Service/ChecksumCalculator.php @@ -0,0 +1,27 @@ +tolerance = $tolerance; + } + + public function isSatisfiedBy(Tle $tle): bool + { + return abs($tle->getInclination() - 90) <= $this->tolerance; + } +} \ No newline at end of file diff --git a/src/Specification/PosigradeOrbitSpecification.php b/src/Specification/PosigradeOrbitSpecification.php new file mode 100644 index 0000000..5b7198f --- /dev/null +++ b/src/Specification/PosigradeOrbitSpecification.php @@ -0,0 +1,13 @@ +getInclination() < 90; + } +} \ No newline at end of file diff --git a/src/Specification/RetrogradeOrbitSpecification.php b/src/Specification/RetrogradeOrbitSpecification.php new file mode 100644 index 0000000..3e3bc6d --- /dev/null +++ b/src/Specification/RetrogradeOrbitSpecification.php @@ -0,0 +1,13 @@ +getInclination() > 90; + } +} \ No newline at end of file diff --git a/src/Specification/SpecificationInterface.php b/src/Specification/SpecificationInterface.php new file mode 100644 index 0000000..0a7ee99 --- /dev/null +++ b/src/Specification/SpecificationInterface.php @@ -0,0 +1,10 @@ +assertEquals( + $tle->getChecksum(Tle::LINE1), + ChecksumCalculator::calculate($tle->getLine1()), + 'Assert checksum calculator returned correct value' + ); + } +} \ No newline at end of file diff --git a/tests/PolarOrbitSpecificationTest.php b/tests/PolarOrbitSpecificationTest.php new file mode 100644 index 0000000..ff9ece9 --- /dev/null +++ b/tests/PolarOrbitSpecificationTest.php @@ -0,0 +1,38 @@ +setInclination(90); + + $specification = new PolarOrbitSpecification(); + $this->assertTrue($specification->isSatisfiedBy($tle), 'Assert polar orbit specification is satisfied for 90° inclined orbit'); + } + + public function testOrbitIsNotPolar(): void + { + $tle = SampleTleHelper::create(); + $tle->setInclination(70); + + $specification = new PolarOrbitSpecification(); + $this->assertFalse($specification->isSatisfiedBy($tle), 'Assert polar orbit specification is not satisfied for 70° inclined orbit'); + } + + public function testOrbitIsPolarWithTolerance(): void + { + $tle = SampleTleHelper::create(); + $tle->setInclination(88.9); + + $specification = new PolarOrbitSpecification(2); + $this->assertTrue( + $specification->isSatisfiedBy($tle), + 'Assert polar orbit specification is satisfied for 88.9° inclined orbit with tolerance of 2°' + ); + } +} \ No newline at end of file diff --git a/tests/PosigradeOrbitSpecificationTest.php b/tests/PosigradeOrbitSpecificationTest.php new file mode 100644 index 0000000..3bc9671 --- /dev/null +++ b/tests/PosigradeOrbitSpecificationTest.php @@ -0,0 +1,17 @@ +setInclination(78); + + $specification = new PosigradeOrbitSpecification(); + $this->assertTrue($specification->isSatisfiedBy($tle), 'Assert posigrade orbit specification is satisfied for 78° inclined orbit'); + } +} \ No newline at end of file diff --git a/tests/RetrogradeOrbitSpecificationTest.php b/tests/RetrogradeOrbitSpecificationTest.php new file mode 100644 index 0000000..acbb165 --- /dev/null +++ b/tests/RetrogradeOrbitSpecificationTest.php @@ -0,0 +1,17 @@ +setInclination(120); + + $specification = new RetrogradeOrbitSpecification(); + $this->assertTrue($specification->isSatisfiedBy($tle), 'Assert retrograde orbit specification is satisfied for 120° inclined orbit'); + } +} \ No newline at end of file diff --git a/tests/TleApiTest.php b/tests/TleApiTest.php new file mode 100644 index 0000000..996e502 --- /dev/null +++ b/tests/TleApiTest.php @@ -0,0 +1,15 @@ +assertInstanceOf(Tle::class, $api->get(43553), 'Assert Api get record returns Tle instance'); + } +} \ No newline at end of file