PHPackages                             alancole/gins - 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. alancole/gins

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

alancole/gins
=============

A PHP library for collecting genders and pronouns for people.

1.0.0(9y ago)18315[2 issues](https://github.com/waxim/Gins/issues)PHP

Since Mar 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/waxim/Gins)[ Packagist](https://packagist.org/packages/alancole/gins)[ RSS](/packages/alancole-gins/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

[![Build Status](https://camo.githubusercontent.com/44df25e73af58e03f851ad439db073b9cbad74b782084b0e45d8d9dc72a0ce2f/68747470733a2f2f7472617669732d63692e6f72672f776178696d2f47696e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/waxim/Gins) [![StyleCI](https://camo.githubusercontent.com/ae4817f8acbbd9e9df1b291f4d45eca803d2ab3a95e2036013f00491a567eaf2/68747470733a2f2f7374796c6563692e696f2f7265706f732f38363336313232302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/86361220)

Gins
====

[](#gins)

Gins (Gender is not sex) is a PHP library that provides you with a host of options for genders and pronouns for your users and customers. Too often I arrive at a site with the form field "Gender" and only "Male/Female" as options. We don't live in that world any more. So this attempts to help developers fix that.

This is by no means comprehensive but hopefully people will help expand it over time and its a marked improvement on the binary way of thinking.

Genders
-------

[](#genders)

We provide a comprehensive list of genders to select from.

```
$genders = new Gins\Genders();

echo "";
foreach ($genders as $gender) {
    echo "";
        echo $gender->getTerm();
    echo "";
}
echo "";
```

Genders will also allow you to pass in a value, and get its term.

```
$genders = new Gins\Genders();

try {
    $gender = $genders->findOrFailByValue("m");
    print $gender->getTerm(); // "Male"
} catch (GenderNotRegistered $e) {
    print "We couldn't find that gender"
}
```

or pass a term and get a value.

```
$genders = new Gins\Genders();

try {
    $gender = $genders->findOrFailByTerm("Male");
    print $gender->getValue(); // "m"
} catch (GenderNotRegistered $e) {
    print "We're sorry but we don't have your gender listed,
    but we've logged its term and will get it added soon.";
}
```

Some genders will presume a pronoun to save on inputs if you wish but its normally best to ask people how they like to be identified so you should use these assumptions with caution.

```
$pronoun = $gender->getPronoun();
print $pronoun->getNoun(); // "He"
```

You may set the pronoun to any valid pronoun object.

```
$gender->setPronoun($noun);
```

Pronouns
--------

[](#pronouns)

This is a list of accepted or used pronouns and their derivations. There are 5 standard derivations of pronouns in English. Subject "He/She", Object "Him/Her", Possessive "His/Her", Possessive Pronoun (Plural) "His/Hers", Reflexive "Himself/Herself"

```
$pronouns = new Gins\Pronouns();

foreach ($pronouns as $noun) {
    print $pro->getNoun(); # He/She
    print $noun->getSubject(); # He/She
    print $noun->getObject(); # Him/Her
    print $noun->getPossessive(); # His/Her
    print $noun->getPossessivePlural(); # His/Hers
    print $noun->getReflexive(); #Himself/Herself
}
```

```
$noun = new Gins\Pronouns\He();
```

Expanding
---------

[](#expanding)

Adding Genders and pronouns is as easy to building new classes which extend the base classes `Gender` or `Pronoun` if you'd like to add genders of pronouns you can start a pull request with your own and I'll merge them in.

Once you've added your own genders and pronouns you can pass them into gins either at constrct or by using the add mehtods.

```
$custom_gender = new My\Custom\Gender();
$custom_gender_two = new My\Custom\GenderTwo();

$custom_pronoun = new My\Custom\Pronoun();

$genders->addGender($custom_gender);
$genders->addGender($custom_gender_two);

$all_genders = new Gins\Genders([$custom_gender, $custom_gender_two]); # Another way to do it,

$pronouns->addNoun($custom_pronoun);

$all_pronouns = new Gins\Pronouns([$custom_pronoun]); # Another way to do it.
```

Whilst we allow you to patch in your own genders, we'd really love it if you can make a pull request with any missing genders instead.

Installing
----------

[](#installing)

```
composer require waxim/gins

```

Testing
-------

[](#testing)

```
phpunit

```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3379d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6cee12237f7ad937cba998c0a4745f87986389a414a529309c0ab15095801d20?d=identicon)[alancole](/maintainers/alancole)

---

Top Contributors

[![waxim](https://avatars.githubusercontent.com/u/3833567?v=4)](https://github.com/waxim "waxim (8 commits)")

---

Tags

composergendergender-equalitygender-recognitionphppronouns

### Embed Badge

![Health badge](/badges/alancole-gins/health.svg)

```
[![Health](https://phpackages.com/badges/alancole-gins/health.svg)](https://phpackages.com/packages/alancole-gins)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
