PHPackages                             boshurik/twig-petrovich-extension - 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. [Templating &amp; Views](/categories/templating)
4. /
5. boshurik/twig-petrovich-extension

ActiveLibrary[Templating &amp; Views](/categories/templating)

boshurik/twig-petrovich-extension
=================================

Twig Petrovich extension

0.1.0(5y ago)0828MITPHPPHP ^7.2CI failing

Since Jun 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/BoShurik/twig-petrovich-extension)[ Packagist](https://packagist.org/packages/boshurik/twig-petrovich-extension)[ RSS](/packages/boshurik-twig-petrovich-extension/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Petrovich Twig Extension
========================

[](#petrovich-twig-extension)

[![Petrovich](https://camo.githubusercontent.com/e4a8f17e5d5dc26c86b5321aaf9a7491438714720d27ffd16bc9d82c7ea7eccd/68747470733a2f2f7261772e6769746875622e636f6d2f726f637363692f706574726f766963682f6d61737465722f706574726f766963682e706e67)](https://camo.githubusercontent.com/e4a8f17e5d5dc26c86b5321aaf9a7491438714720d27ffd16bc9d82c7ea7eccd/68747470733a2f2f7261772e6769746875622e636f6d2f726f637363692f706574726f766963682f6d61737465722f706574726f766963682e706e67)

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

[](#installation)

```
composer req boshurik/twig-petrovich-extension
```

```
use Staticall\Petrovich\Petrovich;
use Staticall\Petrovich\Petrovich\Loader;
use BoShurik\Petrovich\Twig\Extension\PetrovichExtension;
use Twig\Environment;

$petrovich = new Petrovich(Loader::load('/path/to/rules.json'));
$extension = new PetrovichExtension($petrovich);
$twig = new Environment($loader);
$twig->addExtension($extension);
```

You can use callable to lazy loading `Petrovich` instance

```
use Staticall\Petrovich\Petrovich;
use Staticall\Petrovich\Petrovich\Loader;
use BoShurik\Petrovich\Twig\Extension\PetrovichExtension;

$factory = function () {
    return new Petrovich(Loader::load('/path/to/rules.json'));
};
$extension = new PetrovichExtension($factory);
```

Usage
-----

[](#usage)

```
{{ 'Тестов Тест Тестович' | inflect_full_name('genitive', 'male') }}
{{ 'Тестов Тест Тестович' | inflect_full_name('dative') }}
{{ 'Тестов Тест Тестович' | inflect_full_name_accusative }}
{{ 'Тестов Тест Тестович' | inflect_full_name_instrumental_male }}

{{ inflect_full_name('Тестов Тест Тестович', 'genitive', 'male') }}
{{ inflect_full_name('Тестов Тест Тестович', 'dative') }}
{{ inflect_full_name_accusative('Тестов Тест Тестович') }}
{{ inflect_full_name_instrumental_male('Тестов Тест Тестович') }}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

2155d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/boshurik-twig-petrovich-extension/health.svg)

```
[![Health](https://phpackages.com/badges/boshurik-twig-petrovich-extension/health.svg)](https://phpackages.com/packages/boshurik-twig-petrovich-extension)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36663.2M221](/packages/twig-intl-extra)[rcrowe/twigbridge

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

21946.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

23018.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21814.8M162](/packages/symfony-ux-twig-component)

PHPackages © 2026

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