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 13
13
"require" : {
14
14
"php" : " >=7.2" ,
15
15
"wol-soft/php-micro-template" : " ^1.3.1" ,
16
- "symplify/easy-coding-standard" : " ^4.1 " ,
16
+ "symplify/easy-coding-standard" : " ^6.0.4 " ,
17
17
"ext-json" : " *"
18
18
},
19
19
"require-dev" : {
Original file line number Diff line number Diff line change 9
9
use PHPModelGenerator \Exception \FileSystemException ;
10
10
use PHPModelGenerator \Exception \RenderException ;
11
11
use PHPModelGenerator \Utils \RenderHelper ;
12
+ use Throwable ;
12
13
13
14
class RenderJob
14
15
{
@@ -104,6 +105,10 @@ protected function renderClass(GeneratorConfiguration $generatorConfiguration):
104
105
? [$ generatorConfiguration ->getErrorRegistryClass ()]
105
106
: [$ generatorConfiguration ->getExceptionClass ()];
106
107
108
+ if ($ namespace ) {
109
+ $ use [] = Throwable::class;
110
+ }
111
+
107
112
try {
108
113
$ class = $ render ->renderTemplate (
109
114
'Model.phptpl ' ,
Original file line number Diff line number Diff line change @@ -36,11 +36,10 @@ class {{ class }}
36
36
* {{ class }} constructor.
37
37
*
38
38
* @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
+ */
44
43
public function __construct(
45
44
array $modelData
46
45
{% if generatorConfiguration.collectErrors() %}, {{ viewHelper.getSimpleClassName(generatorConfiguration.getErrorRegistryClass()) }} $errorRegistry = null{% endif %}
@@ -122,7 +121,7 @@ class {{ class }}
122
121
*
123
122
* @param array $modelData
124
123
*
125
- * {% if property.getValidators() %}@throws Exception {% endif %}
124
+ * {% if property.getValidators() %}{% if not generatorConfiguration.collectErrors() %} @throws Throwable{% endif %} {% endif %}
126
125
*/
127
126
protected function process{{ viewHelper.ucfirst(property.getAttribute()) }}(array $modelData): void
128
127
{
Original file line number Diff line number Diff line change 1
1
imports :
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' }
5
6
6
7
parameters :
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