PHPackages                             marvin255/random-string-generator - 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. marvin255/random-string-generator

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

marvin255/random-string-generator
=================================

Random string generator for symfony.

v3.2.5(3mo ago)18.8k↓65.8%1MITPHPPHP &gt;=8.1CI passing

Since Dec 7Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/marvin255/random-string-generator)[ Packagist](https://packagist.org/packages/marvin255/random-string-generator)[ RSS](/packages/marvin255-random-string-generator/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)Dependencies (12)Versions (25)Used By (0)

Random string generator for Symfony
===================================

[](#random-string-generator-for-symfony)

[![Latest Stable Version](https://camo.githubusercontent.com/5ecca30138834f8731a14e87cad736fdb06fe98e675b404a1883cb6ca3769de0/68747470733a2f2f706f7365722e707567782e6f72672f6d617276696e3235352f72616e646f6d2d737472696e672d67656e657261746f722f76)](https://packagist.org/packages/marvin255/random-string-generator)[![Total Downloads](https://camo.githubusercontent.com/9dbc6c01190a82c93e643b515f547b95cd59d7c71b9c2787fa18e572f7611711/68747470733a2f2f706f7365722e707567782e6f72672f6d617276696e3235352f72616e646f6d2d737472696e672d67656e657261746f722f646f776e6c6f616473)](https://packagist.org/packages/marvin255/random-string-generator)[![License](https://camo.githubusercontent.com/d592b1c2d9b414acbac6913955f8aef56e4a261bf13d0e2d36d18fb9acfb6fe6/68747470733a2f2f706f7365722e707567782e6f72672f6d617276696e3235352f72616e646f6d2d737472696e672d67656e657261746f722f6c6963656e7365)](https://packagist.org/packages/marvin255/random-string-generator)[![Build Status](https://github.com/marvin255/random-string-generator/workflows/random_string_generator/badge.svg)](https://github.com/marvin255/random-string-generator/actions?query=workflow%3A%22random_string_generator%22)

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

[](#installation)

Install package via composer:

```
composer req marvin255/random-string-generator
```

It will be configured automatically.

Usage
-----

[](#usage)

Inject the generator to a service or a controller via DI:

```
use Marvin255\RandomStringGenerator\Generator\RandomStringGenerator;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class SiteController extends AbstractController
{
    public function __construct(private readonly RandomStringGenerator $randomStringGenerator)
    {
    }
}
```

Use one of the generators methods:

```
$this->randomStringGenerator->alphanumeric(10);  // 10 symbols of latin alphabet or digits
$this->randomStringGenerator->alpha(10);         // 10 symbols of latin alphabet
$this->randomStringGenerator->numeric(10);       // 10 symbols of digits
$this->randomStringGenerator->password(10);      // 10 symbols that can be used as password
$this->randomStringGenerator->string(10, 'qwe'); // 10 symbols of provided vocabulary
```

Mock strings for testing
------------------------

[](#mock-strings-for-testing)

Bundle can be configured to return a mock string in the test environment.

```
# config/packages/test/marvin255_random_string_generator.yaml
marvin255_random_string_generator:
    dummy: true
    dummy_string: mock_string
```

All methods calls will return `mock_string`.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance82

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~92 days

Recently: every ~192 days

Total

22

Last Release

90d ago

Major Versions

v1.6.0 → v2.0.02023-01-04

v2.0.0 → v3.0.02023-08-13

PHP version history (2 changes)v1.0.0PHP &gt;=7.4.0

v2.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c29b776ac327dcfcdfc20619a65826ad94a0cb554503386fb080299edfbe3e8?d=identicon)[marvin255](/maintainers/marvin255)

---

Top Contributors

[![marvin255](https://avatars.githubusercontent.com/u/2802915?v=4)](https://github.com/marvin255 "marvin255 (39 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

phprandom-generationsymfonysymfony-bundlephpsymfonyrandom string

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/marvin255-random-string-generator/health.svg)

```
[![Health](https://phpackages.com/badges/marvin255-random-string-generator/health.svg)](https://phpackages.com/packages/marvin255-random-string-generator)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)

PHPackages © 2026

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