Skip to content

This bundle is intended to group common and often repeated things when creating an APP with Symfony.

License

Notifications You must be signed in to change notification settings

idmarinas/common-bundle

Test Suite Quality Gate Status

GitHub release GitHub Release Date GitHub code size in bytes Build in PHP

GitHub issues GitHub pull requests Github commits (since latest release) GitHub commit activity GitHub last commit

GitHub top language GitHub language count

Reliability Rating Bugs Security Rating Vulnerabilities Maintainability Rating Technical Debt Code Smells Coverage Duplicated Lines (%)

PayPal.Me - The safer, easier way to pay online! Liberapay - Donate Twitter

IDMarinas Common Bundle

This bundle is intended to group common and often repeated things when creating an APP with Symfony.

Content

Command

Reset cache of OPcache

  symfony console idm:opcache:reset

Regenerate APP_SECRET

  # Change var APP_SECRET in .env file
  symfony console idm:regenerate:app_secret
    
  # Only show value WITHOUT update .env file
  symfony console idm:regenerate:app_secret --show

Entity

AbstractContact: to create a table with contact messages from the web.

Form

AbstractContactFormType: to create form for send contact messages.

Repository

AbstractContactRepository: repository for AbstractContact entity.

Traits

Entity

IdTrait: add a field id in INT format

UuidTrait: add a field uuid in UUID format

Tool

FakerTrait: add a Faker method to use in test, fixtures...

VersionTrait: add two methods:

  1. convertVersionToString converts a version like '100000000' to STRING version like '1.0.0'
  2. convertVersionToInt converts a version like '1.0.0' to INT version like '100000000'

Validator

Constraint

IsEven check if value is an even value.

IsOdd check if value is an odd value.