PHPackages                             enkot/shevchenko - 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. enkot/shevchenko

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

enkot/shevchenko
================

Port of shevchenko-js library to PHP

0642PHP

Since Jan 24Pushed 5mo agoCompare

[ Source](https://github.com/enkot/shevchenko-php)[ Packagist](https://packagist.org/packages/enkot/shevchenko)[ RSS](/packages/enkot-shevchenko/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Shevchenko PHP
==============

[](#shevchenko-php)

A PHP port of the [shevchenko.js](https://github.com/shevchenko-js/shevchenko-js) library for declining Ukrainian anthropomorphic names (given names, patronymics, family names) and other proper nouns.

This library provides accurate inflection rules for Ukrainian language grammatical cases and includes support for military ranks and appointments through extensions.

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

[](#installation)

Install the library via Composer:

```
composer require enkot/shevchenko
```

Basic Usage
-----------

[](#basic-usage)

### Declining Names

[](#declining-names)

You can inflect a full name into a specific grammatical case. The library handles gender and the component parts of the name.

```
use Shevchenko\Shevchenko;
use Shevchenko\Language\GrammaticalGender;
use Shevchenko\Language\GrammaticalCase;

$shevchenko = new Shevchenko();

// create input
$input = [
    'gender' => GrammaticalGender::MASCULINE
    'givenName' => 'Тарас',
    'patronymicName' => 'Григорович',
    'familyName' => 'Шевченко'
];

// Inflect to Dative case (Давальний відмінок)
$dativeoutput = $shevchenko->inDative($input);

echo $dativeoutput['givenName'];       // Тарасу
echo $dativeoutput['patronymicName'];  // Григоровичу
echo $dativeoutput['familyName'];      // Шевченку

// Or using generic method
$genitiveOutput = $shevchenko->inGrammaticalCase(GrammaticalCase::GENITIVE, $input);
```

### Supported Grammatical Cases

[](#supported-grammatical-cases)

The library supports all 7 Ukrainian grammatical cases:

- `inNominative()` - Називний (who? what?)
- `inGenitive()` - Родовий (whom? what?)
- `inDative()` - Давальний (to whom? to what?)
- `inAccusative()` - Знахідний (whom? what?)
- `inAblative()` - Орудний (by whom? by what?)
- `inLocative()` - Місцевий (on whom? on what?)
- `inVocative()` - Кличний (addressing)

### Gender Detection

[](#gender-detection)

The library can attempt to detect the grammatical gender of a name based on the suffix of the given name or patronymic.

```
use Shevchenko\Shevchenko;

$shevchenko = new Shevchenko();

$input = [
    'givenName' => 'Тарас',
    'patronymicName' => 'Григорович',
    'familyName' => 'Шевченко'
];

$gender = $shevchenko->detectGender($input);

echo $gender->value; // masculine
```

Extensions
----------

[](#extensions)

### Military Extension

[](#military-extension)

The library includes a built-in military extension for correctly declining military ranks and appointments.

```
use Shevchenko\Shevchenko;
use Shevchenko\Military\MilitaryExtension;
use Shevchenko\Language\GrammaticalCase;

$shevchenko = new Shevchenko();
// Register the extension
$shevchenko->registerExtension(new MilitaryExtension());

$input = [
    'gender' => 'masculine',
    'familyName' => 'Шевченко',
    'givenName' => 'Тарас',
    'patronymicName' => 'Григорович',
    // Extension fields
    'militaryRank' => 'солдат',
    'militaryAppointment' => 'помічник гранатометника',
];

// Inflect everything in one go (e.g., to Genitive/Родовий)
$output = $shevchenko->inGenitive($input);

echo $output['militaryRank'];        // солдата
echo $output['militaryAppointment']; // помічника гранатометника
echo $output['familyName'];          // Шевченка
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- ext-json

License
-------

[](#license)

MIT

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance49

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/032f257d6090037e68294b75ac37f4b76d12fc4154c10995df25823f91ad4a14?d=identicon)[enkot](/maintainers/enkot)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/enkot-shevchenko/health.svg)

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

###  Alternatives

[pitchart/transformer

A transducers implementation in PHP, with OOP powers

1017.0k](/packages/pitchart-transformer)[aluguest/ical-easy-reader

An easy to understood class, loads a "ics" format string and returns an array with the traditional iCal fields.

122.8k](/packages/aluguest-ical-easy-reader)

PHPackages © 2026

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