@@ -75,26 +75,24 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
7575 $ form = $ context ->getRoot ();
7676 /** @var Language $language */
7777 $ language = $ form ->get ('language ' )->getData ();
78- if ($ language ) {
79- $ langId = strtolower ($ language ->getExtensions ()[0 ]);
80- if ($ language ->getRequireEntryPoint () && empty ($ value )) {
81- $ message = sprintf ('%s required, but not specified ' ,
82- $ language ->getEntryPointDescription () ?: 'Entry point ' );
83- $ context
84- ->buildViolation ($ message )
85- ->atPath ('entry_point ' )
86- ->addViolation ();
87- }
78+ $ langId = strtolower ($ language ->getExtensions ()[0 ]);
79+ if ($ language ->getRequireEntryPoint () && empty ($ value )) {
80+ $ message = sprintf ('%s required, but not specified ' ,
81+ $ language ->getEntryPointDescription () ?: 'Entry point ' );
82+ $ context
83+ ->buildViolation ($ message )
84+ ->atPath ('entry_point ' )
85+ ->addViolation ();
86+ }
8887
89- if (in_array ($ langId , ['java ' , 'kt ' ]) && empty ($ value )) {
90- $ message = sprintf ('%s is required for %s language, but not specified ' ,
91- $ language ->getEntryPointDescription () ?: 'Entry point ' ,
92- ucfirst ($ langId ));
93- $ context
94- ->buildViolation ($ message )
95- ->atPath ('entry_point ' )
96- ->addViolation ();
97- }
88+ if (in_array ($ langId , ['java ' , 'kt ' ]) && empty ($ value )) {
89+ $ message = sprintf ('%s is required for %s language, but not specified ' ,
90+ $ language ->getEntryPointDescription () ?: 'Entry point ' ,
91+ ucfirst ($ langId ));
92+ $ context
93+ ->buildViolation ($ message )
94+ ->atPath ('entry_point ' )
95+ ->addViolation ();
9896 }
9997 }),
10098 ]
0 commit comments