feat(phpstan) implementation of PHPStan Custom Rules (#208)
* feat(phpstan) prepared phpunit and pest environments (#196) * Prepared PHPUnit and Pest Test environment * Fixed issues with config files * reinstalled pest with minor fixes to config files * deleted autogenerated files by pest * feat(phpstan): implementation of variable custom rules (#198) * Implementation of Variable length custom rules and Back Tick variable rules * Implementation of Misc PHPStan Custom Rules + refacto * Fixed namespace issue * Fixed class name typo * Fixed small typos * Implementation of Variable length custom rules and Back Tick variable rules * Implementation of Misc PHPStan Custom Rules + refacto * Fixed namespace issue * Fixed class name typo * Fixed small typos * implemented unit test for variable custom rules * deleted old files * fixes * removed calls to getType in StringBackquotesCustomRuleTest.php * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update StringBackquotesCustomRule.php * Update VariableLengthCustomRule.php Changed switch to match * Apply suggestions from code review Co-authored-by: Kevin Duret <kduret@centreon.com> * feat(phpstan) implementation of log custom rules (#200) * implemented LoggerUseCaseCustomRule * implemented try/catch custom rule * refacto try/catch custom rule * refacto try/catch custom rule v2 * rewrite buildErrorMessage() method * corrected a bug in LoggerUseCaseCustomRule * refacto tests * implemented log custom rules and unit tests * added dependecy for unit tests * Update src/PHPStan/CustomRules/LogMethodInCatchCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/LoggerUseCaseCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/LoggerUseCaseCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/LogMethodInCatchCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/AbstractGetLoggerMethodsClass.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * refacto unit tests * Update src/PHPStan/CustomRules/AbstractGetLoggerMethodsClass.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/AbstractGetLoggerMethodsClass.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * feat(phpstan) implementation of repository custom rules (#205) * refacto of previous PR * Repository rules implementation * implemented unit tests for Repository custom rules part 1 * reorganized rules in folders by type, implemented unit tests * fix newlines * Update .gitignore Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/CentreonRuleErrorBuilder.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/RepositoryRules/RepositoryNameCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/RepositoryRules/RepositoryNameCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/RepositoryRules/RepositoryNameValidationByInterfaceCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> Co-authored-by: Kevin Duret <kduret@centreon.com> * feat(phpstan) prepared phpunit and pest environments (#196) * Prepared PHPUnit and Pest Test environment * Fixed issues with config files * reinstalled pest with minor fixes to config files * deleted autogenerated files by pest * feat(phpstan): implementation of variable custom rules (#198) * Implementation of Variable length custom rules and Back Tick variable rules * Implementation of Misc PHPStan Custom Rules + refacto * Fixed namespace issue * Fixed class name typo * Fixed small typos * Implementation of Variable length custom rules and Back Tick variable rules * Implementation of Misc PHPStan Custom Rules + refacto * Fixed namespace issue * Fixed class name typo * Fixed small typos * implemented unit test for variable custom rules * deleted old files * fixes * removed calls to getType in StringBackquotesCustomRuleTest.php * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/StringBackquotesCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update StringBackquotesCustomRule.php * Update VariableLengthCustomRule.php Changed switch to match * Apply suggestions from code review Co-authored-by: Kevin Duret <kduret@centreon.com> * feat(phpstan) implementation of log custom rules (#200) * implemented LoggerUseCaseCustomRule * implemented try/catch custom rule * refacto try/catch custom rule * refacto try/catch custom rule v2 * rewrite buildErrorMessage() method * corrected a bug in LoggerUseCaseCustomRule * refacto tests * implemented log custom rules and unit tests * added dependecy for unit tests * Update src/PHPStan/CustomRules/LogMethodInCatchCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/LoggerUseCaseCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/LoggerUseCaseCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/LogMethodInCatchCustomRule.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/AbstractGetLoggerMethodsClass.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * refacto unit tests * Update src/PHPStan/CustomRules/AbstractGetLoggerMethodsClass.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * Update src/PHPStan/CustomRules/AbstractGetLoggerMethodsClass.php Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com> * feat(phpstan) implementation of repository custom rules (#205) * refacto of previous PR * Repository rules implementation * implemented unit tests for Repository custom rules part 1 * reorganized rules in folders by type, implemented unit tests * fix newlines * Update .gitignore Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/CentreonRuleErrorBuilder.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/RepositoryRules/RepositoryNameCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/RepositoryRules/RepositoryNameCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> * Update src/PHPStan/CustomRules/RepositoryRules/RepositoryNameValidationByInterfaceCustomRule.php Co-authored-by: Kevin Duret <kduret@centreon.com> Co-authored-by: Kevin Duret <kduret@centreon.com> * feat(phpstan) implementation of architecture custom rules (#207) * correction in Logger Custom Rule regarding Directory Separator * implemented architecture rules * implemented architecture rules * implemented unit tests for architecture rules * fixes * fix * refacto Exception Custom Rule * fix * fix * newlines in the end of files * newlines before return * Update src/PHPStan/CustomRules/Traits/UseCaseTrait.php * added additional checks for Repository Rules * fix check for exception in repo rule * refined Repository Custom Rules * Exception Rule: excluded a case when Exception is thrown in constructor * Exception Rule: removed exception for Exceptions in constructor method * fix(phpstan) implement a particular case in exception custom rule (#212) * excuded private methods from error checking * added unit test for constructor method exception from rule * additional checks to solve process exited with 1 issue * cleanup * composer.lock Co-authored-by: Kevin Duret <kduret@centreon.com> Co-authored-by: jeremyjaouen <61694165+jeremyjaouen@users.noreply.github.com>
Please register or sign in to comment