PHPackages                             ukrainian-declension/core - 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. ukrainian-declension/core

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

ukrainian-declension/core
=========================

A PHP library for Ukrainian language declensions.

1.16(5mo ago)1608↓50%MITPHPPHP &gt;=8.1CI passing

Since Jun 22Pushed 4mo agoCompare

[ Source](https://github.com/KamaZz/declension-ukrainian)[ Packagist](https://packagist.org/packages/ukrainian-declension/core)[ RSS](/packages/ukrainian-declension-core/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (18)Used By (0)

Ukrainian Declension Library
============================

[](#ukrainian-declension-library)

A simple PHP library for declining Ukrainian nouns and phrases. This library provides a straightforward way to get the correct grammatical form of a noun for any of the seven Ukrainian cases, in both singular and plural forms.

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

[](#installation)

Install the library via Composer:

```
composer require ukrainian-declension/core
```

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

[](#basic-usage)

The easiest way to use the library is by calling the static `decline` method.

```
use UkrainianDeclension\UkrainianDeclension;
use UkrainianDeclension\Enums\GrammaticalCase;
use UkrainianDeclension\Enums\Number;

// Decline a single word
$declinedWord = UkrainianDeclension::decline('книга', GrammaticalCase::GENITIVE, Number::SINGULAR);
echo $declinedWord; // Outputs: книги

// Decline a full name
$declinedName = UkrainianDeclension::decline('Петренко Олексій Іванович', GrammaticalCase::DATIVE, Number::SINGULAR);
echo $declinedName; // Outputs: Петренку Олексію Івановичу
```

Usage in Laravel
----------------

[](#usage-in-laravel)

This library includes a Service Provider and Facade for easy integration with Laravel applications.

1. The provider and facade will be auto-discovered by Laravel.
2. You can use the `Declensioner` facade directly or inject the `DeclensionerContract` anywhere in your application.

### Using the Facade

[](#using-the-facade)

```
use UkrainianDeclension\Facades\Declensioner;
use UkrainianDeclension\Enums\GrammaticalCase;
use UkrainianDeclension\Enums\Number;

// Decline a phrase
$declinedPhrase = Declensioner::decline('молодший лейтенант', GrammaticalCase::INSTRUMENTAL, Number::SINGULAR);
echo $declinedPhrase; // Outputs: молодшим лейтенантом
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use UkrainianDeclension\Contracts\DeclensionerContract;
use UkrainianDeclension\Enums\GrammaticalCase;
use UkrainianDeclension\Enums\Gender;
use UkrainianDeclension\Enums\Number;

class MyController
{
    private $declensioner;

    public function __construct(DeclensionerContract $declensioner)
    {
        $this->declensioner = $declensioner;
    }

    public function showDeclinedWord()
    {
        $word = 'книга';

        // Decline to Genitive Singular: "книги"
        $declined_singular = $this->declensioner->decline($word, GrammaticalCase::GENITIVE, Number::SINGULAR);

        // Decline to Nominative Plural: "книги"
        $declined_plural = $this->declensioner->decline($word, GrammaticalCase::NOMINATIVE, Number::PLURAL);

        echo $declined_singular; // Outputs: книги
        echo $declined_plural; // Outputs: книги
    }
}
```

### Gender Guessing

[](#gender-guessing)

The library can automatically guess the gender of a noun or a name within a phrase. For names, it often identifies gender by the patronymic (e.g., words ending in -ович for masculine, -івна for feminine). For single words, it uses endings and a list of exceptions.

This means you can often omit the `Gender` parameter.

```
// The library will correctly guess that "книга" is feminine.
$declined = UkrainianDeclension::decline('книга', GrammaticalCase::GENITIVE, Number::SINGULAR);

// The library will guess the gender is masculine from the patronymic 'Іванович'.
$declinedName = UkrainianDeclension::decline('Петренко Олексій Іванович', GrammaticalCase::DATIVE, Number::SINGULAR);
```

However, you can still provide the gender for ambiguous words or to ensure accuracy.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance72

Regular maintenance activity

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Every ~10 days

Recently: every ~38 days

Total

17

Last Release

174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1b0bae1c0f9d75cfd35b4d66d57d7da96b4d9b9dae8065335eae5a98a8449520?d=identicon)[KamaZz](/maintainers/KamaZz)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ukrainian-declension-core/health.svg)

```
[![Health](https://phpackages.com/badges/ukrainian-declension-core/health.svg)](https://phpackages.com/packages/ukrainian-declension-core)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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