PHPackages                             whatsma/zodiacsign - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. whatsma/zodiacsign

ActivePackage[Utility &amp; Helpers](/categories/utility)

whatsma/zodiacsign
==================

Calculates the zodiac sign for a given day and month.

1.0.1(8y ago)99.1k1[1 issues](https://github.com/whatsma/ZodiacSign/issues)MITPHPPHP &gt;=5.4.0

Since Sep 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/whatsma/ZodiacSign)[ Packagist](https://packagist.org/packages/whatsma/zodiacsign)[ RSS](/packages/whatsma-zodiacsign/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

 [![Zodiac Sign Calculator in PHP](https://github.com/whatsma/ZodiacSign/raw/main/logo/zodiac-sign.png)](https://github.com/whatsma/ZodiacSign/blob/main/logo/zodiac-sign.png)

Zodiac Sign Calculator
======================

[](#zodiac-sign-calculator)

A PHP calculator to calculate the zodiac sign for a given day and month.

Status
------

[](#status)

[![Total Downloads](https://camo.githubusercontent.com/cef359cf988052dc2d988fcd9132306d27069da414a316ed58cabe9825c14833/68747470733a2f2f706f7365722e707567782e6f72672f77686174736d612f7a6f646961637369676e2f646f776e6c6f616473)](https://packagist.org/packages/whatsma/zodiacsign)[![Latest Stable Version](https://camo.githubusercontent.com/aba6a2e55f8907cbe6a8ce80c0f9b7600c6759953f32ab7d663a2b0259787645/68747470733a2f2f706f7365722e707567782e6f72672f77686174736d612f7a6f646961637369676e2f762f737461626c65)](https://packagist.org/packages/whatsma/zodiacsign)[![PHP Version Require](https://camo.githubusercontent.com/4580ca8c42d3023c41dabc7d04351d99c359fd115c775d9087c2aecd990cd196/687474703a2f2f706f7365722e707567782e6f72672f77686174736d612f5a6f646961635369676e2f726571756972652f706870)](https://packagist.org/packages/whatsma/zodiacsign)

[![Multi PHP Versions](https://github.com/whatsma/ZodiacSign/actions/workflows/ci-multiple-php-versions.yml/badge.svg)](https://github.com/whatsma/ZodiacSign/actions/workflows/ci-multiple-php-versions.yml)[![Windows/Mac](https://github.com/whatsma/ZodiacSign/actions/workflows/ci-windows-mac.yml/badge.svg)](https://github.com/whatsma/ZodiacSign/actions/workflows/ci-windows-mac.yml)[![Static Code Analysis](https://github.com/whatsma/ZodiacSign/actions/workflows/ci-static.yml/badge.svg)](https://github.com/whatsma/ZodiacSign/actions/workflows/ci-static.yml)

[![Test Coverage](https://camo.githubusercontent.com/3c74950b9fdbdc845c1ee13774bc7ebba49a79a2901f8ad56422a31273ecf6a6/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f77686174736d612f5a6f646961635369676e2f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/whatsma/ZodiacSign/coverage)[![Code Climate](https://camo.githubusercontent.com/33e7544f3bb782cd367c64864d375690bd44b35a65017844ca1ad4a0249834e0/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f77686174736d612f5a6f646961635369676e2f6261646765732f6770612e737667)](https://codeclimate.com/github/whatsma/ZodiacSign)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ba88c6086d3a3c44e8cc39dea9bd5aeeeb607367d18ee3c81bed52ffc792cf07/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f77686174736d612f5a6f646961635369676e2f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/whatsma/ZodiacSign)

[![GitHub license](https://camo.githubusercontent.com/a40260a8a0b8ff6cb174bb40e60242aef8ad681b91f1df20dec97e91b52464fa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77686174736d612f5a6f646961635369676e2e737667)](https://github.com/whatsma/ZodiacSign/blob/master/LICENSE)

Installation
------------

[](#installation)

Install ZodiacSign using [Composer](https://getcomposer.org/):

```
$ composer require whatsma/zodiacsign:^1.0
```

Usage
-----

[](#usage)

Given a month (integer from 1 to 12) and a day (integer from 1 to 31), calculate the zodiac sign.

Returns a lower case string representing a zodiac sign, (eg "aries", or "leo").

Raises an InvalidMonthException:

- if the input month is invalid (eg is non int, or has a value of 13)

Raises an InvalidDayException:

- if the day is invalid (eg is non int, or has a value of 32)
- if the day is an invalid day of the month, such as 31st of February)

### Example

[](#example)

```
