https://github.com/intervention/zodiac
PHP Zodiac Sign Calculator
https://github.com/intervention/zodiac
Last synced: 4 months ago
JSON representation
PHP Zodiac Sign Calculator
- Host: GitHub
- URL: https://github.com/intervention/zodiac
- Owner: Intervention
- License: mit
- Created: 2016-01-02T17:36:49.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-03-31T13:50:29.000Z (about 1 year ago)
- Last Synced: 2025-04-04T10:03:56.555Z (about 1 year ago)
- Language: PHP
- Homepage: https://zodiac.intervention.io
- Size: 155 KB
- Stars: 52
- Watchers: 2
- Forks: 14
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Intervention Zodiac
[](https://packagist.org/packages/intervention/zodiac)
[](https://github.com/Intervention/zodiac/actions/workflows/build.yml)
[](https://packagist.org/packages/intervention/zodiac/stats)
[](https://ko-fi.com/interventionphp)
Intervention Zodiac is a calculator for zodiac signs to resolve the respective
zodiac sign from various data types.
## Installation
You can install this package with Composer.
Require the package via Composer:
$ composer require intervention/zodiac
Although the library is **framework agnostic** it comes with a service provider
for the [Laravel Framework](https://www.laravel.com/). Which will be discovered
automatically and registers the calculator into your installation.
## Documentation
Read the full [documentation](https://zodiac.intervention.io) for this library.
## Code Examples
```php
use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;
// get zodiac object from a date
$zodiac = Calculator::zodiac('1980-09-15');
// method takes mixed formats
$zodiac = Calculator::zodiac('first day of June 2008');
// create from DateTime object
$zodiac = Calculator::zodiac(new DateTime('1977-03-15'));
// get zodiac from a Carbon object
$zodiac = Calculator::zodiac(Carbon::yesterday());
// get zodiac from unix timestamp
$zodiac = Calculator::zodiac(228268800);
```
```php
use Intervention\Zodiac\Calculator;
use DateTime;
use Carbon\Carbon;
// calculate zodiac sing
$zodiac = Calculator::zodiac('1977-06-17');
$name = $zodiac->name(); // 'gemini'
$html = $zodiac->html(); // '♊︎'
$localized = $zodiac->localized('fr'); // Gémeaux
$compatibility = $zodiac->compatibility($zodiac); // .6
```
## Development & Testing
With this package comes a Docker image to build a test suite container. To build this container you have to have Docker installed on your system.
You can run all tests with the following command.
```bash
docker-compose run --rm --build tests
```
Run the static analyzer on the code base.
```bash
docker-compose run --rm --build analysis
```
## Authors
This library is developed and maintained by [Oliver Vogel](https://intervention.io)
Thanks to the community of [contributors](https://github.com/Intervention/zodiac/graphs/contributors) who have helped to improve this project.
## License
Intervention Zodiac is licensed under the [MIT License](LICENSE).