Download the PHP package zlikavac32/php-enum-symfony without Composer

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

PHP Enum Symfony

Build Status Latest Stable Version License Scrutinizer Code Quality Codacy Badge

Symfony support for zlikavac32/php-enum.

Table of contents

  1. Installation
  2. Usage
    1. Form
    2. Validator
  3. Limitations

Installation

Recommended installation is through Composer.

Usage

Assumption is that there exists a valid enum \YesNoEnum.

Form

Form type for enum is provided as \Zlikavac32\SymfonyEnum\Form\Type\EnumType. There is one required options enum_class which must contain enum class FQN.

Internally this extends \Symfony\Component\Form\Extension\Core\Type\ChoiceType and populates choices from the defining enum_class.

If any of the choices and/or choice_loader options is/are passed, an \LogicException will be thrown. Since these fields are overridden internally, passing them from the outside could cloud code's original purpose. Any other option provided by the \Symfony\Component\Form\Extension\Core\Type\ChoiceType can be used.

Validator

Two constraints are provided, \Zlikavac32\SymfonyEnum\Validator\Constraints\ValidEnumElement and \Zlikavac32\SymfonyEnum\Validator\Constraints\ValidEnumElementName. Internally, they use \Symfony\Component\Validator\Constraints\Choice.

Required constraint argument is enumClass which must contain enum class FQN.

If any of the choices, callback and/or strict options is/are passed, an \LogicException will be thrown. Since these fields are overridden internally, passing them from the outside could cloud code's original purpose. Any other option provided by the \Symfony\Component\Validator\Constraints\Choice can be used.

Example for annotation use:

Limitations

Due to doctrine/common issue #794 with checks for aliased namespaces, validation of form enum element within an array will throw exception in following cases:

For more details on what's wrong and why, feel free to check related issue.


All versions of php-enum-symfony with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
zlikavac32/php-enum Version ^3.0
symfony/form Version ^4.4
symfony/options-resolver Version ^4.4
symfony/validator Version ^4.4
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 zlikavac32/php-enum-symfony contains the following files

Loading the files please wait ....