addiks/symfony_generics

A collection of generic configurable PHP components

v0.12.0 2019-04-29 11:15 UTC

README

Travis Build Status Scrutinizer Build Status Scrutinizer Code Quality Code Coverage Total Downloads Licence Version PHP PHP

Symfony Generic Components

This is a collection of configurable generic components to use for symfony. (Currently it mostly consists of generic controllers.) I believe that as a developer you should focus your work as much as possible to model and mold your domain of choice into software. Other technical necessities (such as controllers) should be reduced as much as possible.

The generic components in this library are built in a way that they can be re-used multiple times in different configurations to replace components in your software that you would otherwise would have to build from scratch. This not only saves you time, it also improves the quality of your software because all the components in this library are fully tested and thus by extension a bigger part of your application becomes tested.

Additionally, if you use generic components instead of writing everything by hand, your application becomes more uniform and machine-readable & -interpretable. For example: If you use generic controllers it is easy to tell which controllers just render a template, you could write a smoke-test that just executes all template-render-controllers and checks if any errors happen. Because you know that these controllers just render a template and do nothing else, you know that you can execute them without side-effect. Without doing much, you would have already tested a big portion of your application. (I actually plan to include such a smoke-test in this library in the future.)

In short, these are the advantages of using this library:

  • Less code to write and maintain
  • More time for the things that make your software unique
  • A bigger part of your application will be battle-tested
  • More standardized parts that other developers will know how to work with

These components currently exist in the library:

Type Name Description
Controller API/GenericEntityCreateController API to create an entity.
Controller API/GenericEntityFetchController API to download an entity.
Controller API/GenericEntityInvokeController API to call a method on an entity.
Controller API/GenericEntityListingController API to get a list of entities.
Controller API/GenericEntityRemoveController API to remove an entity.
Controller API/GenericServiceInvokeController API to call a method on a service.
Controller GenericTemplateRenderController Renders a template with arguments.
Controller GenericExceptionResponseController Handle different exceptions.