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

ActiveSymfony-bundle

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

Random string generator for symfony.

v3.2.4(8mo ago)17.5k↓44%1[2 PRs](https://github.com/marvin255/random-string-generator/pulls)MITPHPPHP &gt;=8.1CI passing

Since Dec 7Pushed 4mo 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 1mo ago

READMEChangelog (10)Dependencies (6)Versions (24)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

48

—

FairBetter than 95% of packages

Maintenance67

Regular maintenance activity

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 92.7% 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 ~86 days

Recently: every ~152 days

Total

21

Last Release

269d 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 (38 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

[endroid/qr-code-bundle

Endroid QR Code Bundle

32110.6M17](/packages/endroid-qr-code-bundle)[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2830.1k2](/packages/inspector-apm-inspector-symfony)[mshauneu/php-rdkafka-bundle

Integrates php-rdkafka with Symfony2|3

1427.0k](/packages/mshauneu-php-rdkafka-bundle)[miracode/stripe-bundle

Symfony bundle to integrate Stripe PHP SDK. Ability to save Stripe objects in database using Doctrine.

1016.1k](/packages/miracode-stripe-bundle)

PHPackages © 2026

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