Download the PHP package secit-pl/validation-bundle without Composer

On this page you can find all versions of the php package secit-pl/validation-bundle. 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 validation-bundle

Symfony Validation Bundle

Additional validators set for Symfony.

Compatibility matrix

Bundle version Maintained Symfony versions Min. PHP version
3.x Yes 7.x 8.2.0
2.x No 6.x 8.0.0
1.8 No 5.x, 4.x 7.1.0

Installation

From the command line run

Validators

NotBlankIf

This validator checks if value is not blank like a standard NotBlank Symfony validator, but also allows define the condition when the NotBlank validation should be performed using Symfony Expression Language.

From Symfony 6.2 you can also use When validator.

https://symfony.com/blog/new-in-symfony-6-2-conditional-constraints

https://symfony.com/doc/6.2/reference/constraints/When.html

Example usage

Parameters

Parameter Type Default Description
expression string empty array The expression that will be evaluated. If the expression evaluates to a false value (using ==, not ===), not blank validation won't be performed)
values array empty array The values of the custom variables used in the expression. Values can be of any type (numeric, boolean, strings, null, etc.)

FileExtension

This validator checks if file has valid file extension.

From Symfony 6.2 you can also use the "extensions" option in File validator.

https://symfony.com/blog/new-in-symfony-6-2-improved-file-validator

https://symfony.com/doc/6.2/reference/constraints/File.html#extensions

Example usage

Parameters

Parameter Type Default Description
validExtensions array empty array Allowed/valid file extensions list
disallowedExtensions array empty array Disallowed/invalid file extensions list
matchCase bool false Enable/disable verifying the file extension case

Caution! It's highly recommended to use this validator together with native Symfony File/Image validator.

CollectionOfUniqueElements

Checks if collection contains only unique elements.

Parameters

Parameter Type Default Description
matchCase bool false Enable/disable verifying the characters case
customNormalizationFunction null or callable null Custom normalization function

This validator can also be used to validate unique files upload.

AntiXss

Checks if text contains XSS attack using voku\anti-xss library.

NaiveNoHtml

Perform very naive check if text contains HTML.

Parameters

Parameter Type Default Description
strongValidation bool true (recommended) Enable/disable strong validation. Disable if you'd like to allow strings with unclosed tags such as "I <3 You".

BurnerEmail

Checks if email address is a throw away email addresses (burner email). This check is perform against the list provided by wesbos/burner-email-providers. You need to install this package manually (composer require wesbos/burner-email-providers) if you'd like to use this validator.

ClamAvScanFile

Scans file for infection using ClamAV. The check is made using the bundle sineflow/clamav. You need to install and configure this package manually if you'd like to use this validator.

You can find test files here https://github.com/fire1ce/eicar-standard-antivirus-test-files/tree/master.

The validator will not work if the PrivateTmp is set to true because the temp file path in php will differ from the real system temp file path so the clamscan will not find the file to scan!


All versions of validation-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
symfony/framework-bundle Version ~7.0
symfony/dependency-injection Version ~7.0
symfony/expression-language Version ~7.0
symfony/http-foundation Version ~7.0
symfony/validator Version ~7.0
voku/anti-xss Version ~4.1
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 secit-pl/validation-bundle contains the following files

Loading the files please wait ....