Download the PHP package simonmarx/symfony-service-annotations without Composer

On this page you can find all versions of the php package simonmarx/symfony-service-annotations. 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-service-annotations

Installation

Enable the Bundle (when not using Symfony flex)

Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:

Usage

When using Symfonys autowire feature, some stuff like service aliases or service tags must be configured in the services.yaml/xml file.

This bundle tries to prevent the developer from having to enter the services.yaml and configure services there in the class itselfs.

It makes service classes feels more like a standalone service since the class holds all service configuration itself.

Important

Bundle and readme is currently under construction but should work anyways.

Examples

Example 1: Tagged services with an interfaces

When annotate an interface or abstract class with @ServiceTag all extending classes which implements the interface or extends the abstract class will be registered as a tagged service.

When you want to tag a single class instead an interface or abstract class, simply use the annotation the same way as in this example.

Example 2: Service tag attributes definition

When using the interface/abstract service tagging (see Example 1) you can overwrite tag arguments in your child class by using @ServiceTagArgument.

You also can use this annotation in a normal class to add arguments to any tag

When you define more than 1 annotation of type @ServiceTag in your class or your parent class/interface you must specify for which tag your annotation @ServiceTagArgument is responsible.

e.g. @ServiceTagArgument(tag="my_tag", argument="priority", value=-23)

Example 3: Service Alias

By using the annotation @ServiceAlias you can specify an alias for you service class.

Example 4: Prevent loading classes as service (e.g. when using autowire)

Sometimes you dont want that your class is loaded into die dic, for that you can use the @NoService annotation. Every class which is annotated with this annotation would be removed from the symfony container before container build is finished.

Example 5: Ignore annotation from parent classes

In default annotation from parent classes (as long as they are abstract or interfaces) will be used for your child class to. To prevent unwanted service configurations you can use the @IgnoreParentServiceAnnotations annotation.

Example 6: DependencyInjection via Annotation

In case you want to inject something from your container into the constructor (e.g. tagged_iterator) which is not handled by autowiring you can use the @DependencyInjection annotation.

Example 7: Assign Parent service

If your current service requires a parent service, just annotate your service class with @ParentService, the compilerpass will redefine your service as a ChildDefinition and replace it in the service container


All versions of symfony-service-annotations with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
symfony/framework-bundle Version >=3.0
doctrine/annotations Version ^1.10
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 simonmarx/symfony-service-annotations contains the following files

Loading the files please wait ....