File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed
Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change 1313 "require" : {
1414 "php" : " >=7.2" ,
1515 "wol-soft/php-micro-template" : " ^1.3.1" ,
16- "symplify/easy-coding-standard" : " ^4.1 " ,
16+ "symplify/easy-coding-standard" : " ^6.0.4 " ,
1717 "ext-json" : " *"
1818 },
1919 "require-dev" : {
Original file line number Diff line number Diff line change 99use PHPModelGenerator \Exception \FileSystemException ;
1010use PHPModelGenerator \Exception \RenderException ;
1111use PHPModelGenerator \Utils \RenderHelper ;
12+ use Throwable ;
1213
1314class RenderJob
1415{
@@ -104,6 +105,10 @@ protected function renderClass(GeneratorConfiguration $generatorConfiguration):
104105 ? [$ generatorConfiguration ->getErrorRegistryClass ()]
105106 : [$ generatorConfiguration ->getExceptionClass ()];
106107
108+ if ($ namespace ) {
109+ $ use [] = Throwable::class;
110+ }
111+
107112 try {
108113 $ class = $ render ->renderTemplate (
109114 'Model.phptpl ' ,
Original file line number Diff line number Diff line change @@ -36,11 +36,10 @@ class {{ class }}
3636 * {{ class }} constructor.
3737 *
3838 * @param array $modelData
39- {% if use %}
40- *
41- * @throws Exception
42- {% endif %}
43- */
39+ {% if generatorConfiguration.collectErrors() %}* @param {{ viewHelper.getSimpleClassName(generatorConfiguration.getErrorRegistryClass()) }} $errorRegistry{% endif %}
40+ *
41+ * @throws Throwable
42+ */
4443 public function __construct(
4544 array $modelData
4645 {% if generatorConfiguration.collectErrors() %}, {{ viewHelper.getSimpleClassName(generatorConfiguration.getErrorRegistryClass()) }} $errorRegistry = null{% endif %}
@@ -122,7 +121,7 @@ class {{ class }}
122121 *
123122 * @param array $modelData
124123 *
125- * {% if property.getValidators() %}@throws Exception {% endif %}
124+ * {% if property.getValidators() %}{% if not generatorConfiguration.collectErrors() %} @throws Throwable{% endif %} {% endif %}
126125 */
127126 protected function process{{ viewHelper.ucfirst(property.getAttribute()) }}(array $modelData): void
128127 {
Original file line number Diff line number Diff line change 11imports :
2- - { resource: '../vendor/symplify/easy-coding-standard/config/psr12.yml' }
3- - { resource: '../vendor/symplify/easy-coding-standard/config/psr2.yml' }
4- - { resource: '../vendor/symplify/easy-coding-standard/config/common.yml' }
2+ - { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/psr12.yaml' }
3+ - { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/psr2.yaml' }
4+ - { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/common.yaml' }
5+ - { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/clean-code.yaml' }
56
67parameters :
7- exclude_checkers :
8- - ' Symplify\CodingStandard\Fixer\Commenting\RemoveUselessDocBlockFixer'
9- - ' PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer'
10- - ' PhpCsFixer\Fixer\Strict\StrictComparisonFixer'
8+ skip :
9+ Symplify\CodingStandard\Fixer\Commenting\RemoveUselessDocBlockFixer : ~
10+ PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer : ~
11+ PhpCsFixer\Fixer\Strict\StrictComparisonFixer : ~
You can’t perform that action at this time.
0 commit comments