2017 © Pedro Peláez
 

symfony-bundle php-code-validator-bundle

Provides a basic system to organize and execute php code validators

image

trovit/php-code-validator-bundle

Provides a basic system to organize and execute php code validators

  • Wednesday, January 25, 2017
  • by poteirard
  • Repository
  • 8 Watchers
  • 0 Stars
  • 74 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Php Code Validator Bundle

Build Status, (*1)

Symfony bundle which provides a basic system to organize and execute php code validators., (*2)

Installation

Step 1: Require bundle using composer

$ composer require trovit/php-validator-bundle "^1.0"

Step 2: Enable the bundle

'; //missing "

// This will return a PhpCodeValidatorResult object wich contains an array of detected problems
$result = $this->get('trovit.php_code_validator.managers.validator_manager')->execute($code);

$result->hasErrors(); // will return true (hasWarnings() is also available if needed)

$result->getErrors(); //will return an array of PhpCodeValidatorProblem:

/*
    new PhpCodeValidatorProblem()
    ->setMessage('Unexpected end of file, expecting variable '.
        '(T_VARIABLE) or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN)')
    ->setErrorType(PhpCodeValidatorProblem::ERROR_TYPE)
    ->setLineNum(1)
    ->setColumnNum(null)
    ->setErrorName('Parallel Lint Error');
*/

For more information please see the component repo, (*3)

The Versions