heimrichhannot/contao-code-generator-bundle

This module offers comfortable code generation based on separated configurations for Contao.

1.4.0 2024-07-09 13:18 UTC

This package is auto-updated.

Last update: 2024-12-09 14:34:50 UTC


README

This module offers comfortable code generation based on separated configurations for Contao.

alt Preview

Code config preview

alt List view

List view

Features

  • offers a code configuration entity
  • offers a service to create codes
  • criteria:
    • prevent ambiguous characters
    • prevent double codes
    • limit to certain alphabets (numbers, capitals, ...)
    • add rules like "at least one number"
  • one-click-creation of an arbitrary number of codes

Developers

use HeimrichHannot\CodeGeneratorBundle\Code\Criteria;
use HeimrichHannot\CodeGeneratorBundle\Code\Generator;

class Example
{
    public function __construct(
        private readonly Generator $generator
    ) {}
    
    public function generatePasswort(): string
    {
        $criteria = new Criteria();
        $criteria->allowSymbols = true;
        $criteria->length = 14;
        $criteria->requireNumbers = true;
        $criteria->requireSymbols = true;
        
        return $this->generator->generate($criteria);
    }
}