Download the PHP package wexample/symfony-helpers without Composer

On this page you can find all versions of the php package wexample/symfony-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-helpers

symfony_helpers

Version: 9.0.0

wexample/symfony-helpers is a Symfony bundle that supplies reusable building blocks for application development: static constant dictionaries across more than twenty helper classes (environment names, Doctrine column types, security roles, status values, HTML, routing, and more), composable Doctrine entity traits (HasEmailTrait, HasStatusTrait, HasDateCreatedTrait, and others), and abstract base classes for controllers, console commands, Twig extensions, and entity services. It targets Symfony developers — particularly those working within the Wexample package ecosystem — who want shared, stable conventions rather than re-implementing the same patterns across projects.

Table of Contents

Architecture

The bundle is a standard Symfony extension package: one entry class, a DI extension that loads services.yaml, and a set of namespaces that each own a single responsibility. Nothing calls across layers in unusual directions — controllers call services, services use repositories, repositories speak to Doctrine.

Bundle entry and DI registration

src/WexampleSymfonyHelpersBundle.php extends src/Class/AbstractBundle.php, which adds two static helpers: getAlias() (short class name) and getTemplatePath() (prefixed bundle template path). The bundle itself has no logic.

src/DependencyInjection/WexampleSymfonyHelpersExtension.php delegates entirely to src/DependencyInjection/AbstractWexampleSymfonyExtension.php, which does two things at container build time:

Helpers

src/Helper/ is a flat collection of static classes that carry only constants and pure functions. None of them require a service container. Representative members:

Because helpers are static, they are the expected first stop when you need a shared constant or a string transformation that has no external dependency.

Entity layer

src/Entity/ holds abstract base classes, two concrete shipped entities, and the traits.

AbstractEntity (the base) adds the BaseEntityTrait and a single identifier: a Symfony\Component\Uid\Uuid mapped with UuidType, generated as a UUIDv7 in the constructor. Three consequences are worth knowing before writing against it. An entity carries its identity from the moment it is instantiated, so there is no "id is null until persist" state and no if (! $entity->getId()) test for newness. v7 is time-ordered, so ordering by id remains a stable creation order — which is what orderByDefaultPagination() and EntityHelper::sortById() rely on. And the id is an object: compare with ->equals(), never ===, and cast to (string) before using it as an array key.

AbstractUser extends it and implements UserEntityInterface with a unique $username and a no-op eraseCredentials(). SystemParameter stores a named string value (key–value application config) and is itself abstract so host apps can extend and map it.

Traits (src/Entity/Traits/) are composable columns. Each trait owns exactly one concern: HasEmailTrait, HasDateCreatedTrait, HasPositionTrait, HasJsonDataTrait, HasEmbeddingTrait, and about twenty others. You add them to an entity class by declaring use HasEmailTrait;; no service is involved.

Manipulator traits (src/Entity/Traits/Manipulator/) complement those by adding factory/fill methods. EntityManipulatorTrait is used by both AbstractEntityService and AbstractRepository so the same creation logic is available from service or repository context.

Interfaces (src/Entity/Interfaces/) define contracts: AbstractEntityInterface, UserEntityInterface, WithUserEntityInterface, LinkedToAnyEntityInterface.

The #[LinkableEntity] attribute (src/Attribute/LinkableEntity.php) marks an entity others are meant to point at, and #[ImportableEntity] (src/Attribute/ImportableEntity.php) one that carries import DTOs. Both are read by filestate-symfony, which scaffolds the corresponding satellites; the package itself only declares them.

Repository layer

src/Repository/AbstractRepository.php extends ServiceEntityRepository and is the only repository base any host application should extend. It provides:

SearchableRepositoryTrait adds LIKE/equal/number search methods to any repository that needs full-text style filtering.

Service layer

Services are the main extension point for host applications.

EntityNeutralService wraps EntityManagerInterface and is the root of the entity service hierarchy. It is useful when you need the entity manager without binding to an entity type.

AbstractEntityService extends it and adds EntityManipulatorTrait plus magic create*() dispatch: a call to createFoo($arg) instantiates an entity of the class the service manages and forwards to fillFoo($entity, $arg). Host applications sub-class this to get a typed entity service with a conventional creation API. SystemParameterEntityService ships as a concrete sub-class that adds/gets SystemParameter rows.

BundleService manages local Composer packages: version increment, dependency version sync across a vendor-local/ workspace. It is used by bundle-scoped commands.

ReversedRoleHierarchy inverts the security.role_hierarchy.roles parameter so you can ask "what roles imply this role" rather than the Symfony default of "what roles does this role grant".

Syntax services (src/Service/Syntax/) are code-generation utilities. src/Service/Syntax/AbstractSyntaxService.php defines the concept of a "cousin": given a source class path, a cousin is a related class (test, API controller, manipulator trait) whose path is derived by substituting a namespace prefix and adding a suffix. writeCousinIfMissing() uses Twig to render a PHP template to disk when the cousin file does not exist yet. EntitySyntaxService and ControllerSyntaxService each declare their own cousin maps.

Routing

src/Routing/AbstractRouteLoader.php is a one-shot Symfony Loader: it refuses to load twice and delegates to loadOnce(). src/Routing/SimpleRoutesRouteLoader.php extends it. When the router boots, it:

  1. Iterates all services whose class name contains Controller and that carry #[SimpleRoutesController] (src/Attribute/SimpleRoutesController.php).
  2. Calls getSimpleRoutes() on each to get a list of route names (index, create, edit, …).
  3. For each name, builds the route path and name from the controller class using RoutePathBuilderTrait, and registers a Route that points to ControllerClass::resolveSimpleRoute with a routeName parameter.

This lets a controller declare its routes as a plain array rather than per-action #[Route] attributes, while still producing a normal RouteCollection.

Controller layer

src/Controller/AbstractController.php extends Symfony's own AbstractController and adds:

src/Controller/AbstractEntityController.php adds EntityControllerTrait on top.

Commands

src/Command/AbstractCommand.php auto-derives the Symfony console name from getCommandPrefixGroup() (default app) and the kebab form of the class name with Command stripped. It provides execCommand() (finds a command by class or name and runs it) and executeAndCatchErrors() (wraps execution in a try/catch that formats exceptions with SymfonyStyle).

AbstractBundleCommand extends it and injects BundleService, overriding getCommandPrefixGroup() to derive the prefix from the bundle class name.

The package ships no concrete command of its own.

Command traits add narrow concerns: FilePathCommandTrait, JsonArgumentCommandTrait, EnvironmentSpecificCommandTrait, EntityManipulationCommandTrait, and CommandLoggerTrait (colorised writeln with optional indent).

Twig

src/Twig/AbstractExtension.php re-exports three option key constants as class constants (FUNCTION_OPTION_IS_SAFE, FUNCTION_OPTION_NEEDS_CONTEXT, FUNCTION_OPTION_NEEDS_ENVIRONMENT) so extension subclasses do not repeat string literals. A LoremIpsumExtension is also shipped.

Doctrine extras

src/Doctrine/Type/VectorType.php registers a custom vector DBAL type that serialises a PHP float array to and from the vector(N) SQL column type used by pgvector and similar. The default dimension is 1536.

src/Migration/Traits/WithDataMigrationTrait.php is a Doctrine migration helper that resolves a JSON or SQL companion file from migrations/ (named after the migration class) and loads it inside up().

RenderableResponse

src/Class/RenderableResponse.php separates the concern of formatting output from the logic that produces data. A subclass sets an output type (api, cli, default), which is mapped to a format (array, cli, json, yaml). Calling render() picks the matching AbstractResponseRenderProcessor and delegates to its renderResponseData(). The CLI processor formats for terminal output; the others serialise to the expected wire format.

Validator

src/Validator/ holds two custom constraints: DateQueryStringConstraint (validates a date given as a query string parameter) and MultipleTypeConstraint (validates that a value matches one of several allowed types). A custom File constraint and its validator also live here.

Normalizer

src/Normalizer/AbstractNormalizer.php implements NormalizerInterface and adds a normalizeCollection() method that iterates an array or Doctrine Collection and calls normalize() on each item.

Integration in the Suite

This package is part of the Wexample Suite — a collection of high-quality, modular tools designed to work seamlessly together across multiple languages and environments.

Related Packages

The suite includes packages for configuration management, file handling, prompts, and more. Each package can be used independently or as part of the integrated suite.

Visit the Wexample Suite documentation for the complete package ecosystem.

Dependencies

Versioning & Compatibility Policy

Wexample packages follow Semantic Versioning (SemVer):

We maintain backward compatibility within major versions and provide clear migration guides for breaking changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Free to use in both personal and commercial projects.

About us

Wexample stands as a cornerstone of the digital ecosystem — a collective of seasoned engineers, researchers, and creators driven by a relentless pursuit of technological excellence. More than a media platform, it has grown into a vibrant community where innovation meets craftsmanship, and where every line of code reflects a commitment to clarity, durability, and shared intelligence.

This packages suite embodies this spirit. Trusted by professionals and enthusiasts alike, it delivers a consistent, high-quality foundation for modern development — open, elegant, and battle-tested. Its reputation is built on years of collaboration, refinement, and rigorous attention to detail, making it a natural choice for those who demand both robustness and beauty in their tools.

Wexample cultivates a culture of mastery. Each package, each contribution carries the mark of a community that values precision, ethics, and innovation — a community proud to shape the future of digital craftsmanship.

Migration Notes

When upgrading between major versions, refer to the migration guides in the documentation.

Breaking changes are clearly documented with upgrade paths and examples.


All versions of symfony-helpers with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
twig/string-extra Version ^3.6
symfony/twig-bundle Version >=6.2
symfony/uid Version >=6.2
symfony/doctrine-bridge Version >=6.2
laminas/laminas-text Version ^2.10
doctrine/common Version ^3.4
doctrine/orm Version ^3.3
doctrine/doctrine-bundle Version ^2.9
wexample/php-date Version >=2.0.0
wexample/php-file Version >=2.0.0
wexample/php-helpers Version >=4.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wexample/symfony-helpers contains the following files

Loading the files please wait ...