PHPackages                             tomaj/prepositioner - 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. tomaj/prepositioner

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

tomaj/prepositioner
===================

Preposition replace library

3.0.0(5y ago)108.3k3[1 PRs](https://github.com/tomaj/prepositioner/pulls)MITPHPPHP &gt;= 7.2CI failing

Since Jun 26Pushed 9mo ago2 watchersCompare

[ Source](https://github.com/tomaj/prepositioner)[ Packagist](https://packagist.org/packages/tomaj/prepositioner)[ RSS](/packages/tomaj-prepositioner/feed)WikiDiscussions master Synced 1w ago

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

Prepositioner
=============

[](#prepositioner)

PHP Prepositioner for replacing prepositions with &amp;nbsp; after preposition

[![Code Climate](https://camo.githubusercontent.com/f92114446b2015bb16d5af79a8ad16b170a538d917f22b23f88f5bb1bc5b6a3f/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f746f6d616a2f707265706f736974696f6e65722f6261646765732f6770612e737667)](https://codeclimate.com/github/tomaj/prepositioner)[![Test Coverage](https://camo.githubusercontent.com/05a189b59bec9a145e74c8ba14e43f1b1c9425e201bdb7ca9e1a0095058f567e/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f64383265623734376439616333333537316265332f746573745f636f766572616765)](https://codeclimate.com/github/tomaj/prepositioner/test_coverage)[![Latest Stable Version](https://camo.githubusercontent.com/068e0253d46238cf35e1f3c990a357f81a33ecbb14653b42074e8cbc1cfcad92/68747470733a2f2f706f7365722e707567782e6f72672f746f6d616a2f707265706f736974696f6e65722f762f737461626c652e737667)](https://packagist.org/packages/tomaj/prepositioner)[![License](https://camo.githubusercontent.com/d8303eeb8a100b20f16c6402fa4c76519b5dd64e2eef17b9097ced469b92cac3/68747470733a2f2f706f7365722e707567782e6f72672f746f6d616a2f707265706f736974696f6e65722f6c6963656e73652e737667)](https://packagist.org/packages/tomaj/prepositioner)

Instalation
-----------

[](#instalation)

Install package via composer:

```
$ composer require tomaj/prepositioner
```

Usage
-----

[](#usage)

Simple usage without *Factory* is very simple:

```
$prepositioner = new Tomaj\Prepositioner\Prepositioner(['one', 'two']);
$prepositioner->formatText($inputText);
```

This example replaces all occurences of *'one'* or *'two'* strings in `$inputText` as *'one&amp;nbsp;'* and *'two&amp;nbsp;'*.

For using with *Factory* which contains language support try:

```
$prepositioner = Tomaj\Prepositioner\Factory::build('slovak')
$prepositioner->formatText($inputText);
```

Extending
---------

[](#extending)

For new language support you need to implement new language class which implements *LanguageInterface* with prepositions. See *SlovakLanguage* for details.

Upgrade
-------

[](#upgrade)

**From version 2 to 3**

- Minimum php version is **7.3** from now
- If you are using custom *Language* file from otside or from this repository (and don't use `Tomaj\Prepositioner\Factory`) you have to change namespace from `\Tomaj\Prepositioner\MyLanguage` to `\Tomaj\Prepositioner\Language\MyLanguage`
- *Note:* new version includes `declare(strict_types=1);` in all files

Known issue
-----------

[](#known-issue)

1. each new language has to be in *Tomaj\\Prepositioner\\Language* namespace if you would like to use Factory

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance40

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% 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 ~294 days

Recently: every ~580 days

Total

9

Last Release

1992d ago

Major Versions

1.1.3 → 2.0.02018-08-08

2.2.0 → 3.0.02020-12-03

PHP version history (3 changes)1.0.0PHP &gt;= 5.3.7

2.0.0PHP &gt;= 7.0

3.0.0PHP &gt;= 7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/875f8397233f01d81479a45bf6a64ca995f04d8ee9e72118f2ffcf129c502f12?d=identicon)[tomaj](/maintainers/tomaj)

---

Top Contributors

[![tomaj](https://avatars.githubusercontent.com/u/446736?v=4)](https://github.com/tomaj "tomaj (50 commits)")[![adamkiss](https://avatars.githubusercontent.com/u/481362?v=4)](https://github.com/adamkiss "adamkiss (1 commits)")[![ricco24](https://avatars.githubusercontent.com/u/1409647?v=4)](https://github.com/ricco24 "ricco24 (1 commits)")

---

Tags

grammarslovakpreposition

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tomaj-prepositioner/health.svg)

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

###  Alternatives

[nlgen/nlgen

A library for creating recursive-descent natural language generators.

56181.3k](/packages/nlgen-nlgen)[rekurzia/slovak-holidays

Simple PHP library/helper for getting Slovak holidays

114.0k](/packages/rekurzia-slovak-holidays)[artisaninweb/laravel-enum

A provider for Enums in Laravel.

1187.5k](/packages/artisaninweb-laravel-enum)

PHPackages © 2026

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