@@ -183,7 +183,7 @@ public function build(): bool
183183 $ attributes = $ metaData ->getAttributes ($ entity );
184184 $ dataTypes = $ metaData ->getDataTypes ($ entity );
185185 $ identityField = $ metaData ->getIdentityField ($ entity );
186- $ identityField = $ identityField ? $ identityField : null ;
186+ $ identityField = $ identityField ?: null ;
187187 $ primaryKeys = $ metaData ->getPrimaryKeyAttributes ($ entity );
188188
189189 $ setParams = [];
@@ -210,7 +210,7 @@ public function build(): bool
210210 // Build Controller
211211 $ this ->makeController ();
212212
213- if ($ this ->options ->get ('templateEngine ' ) == 'volt ' ) {
213+ if ($ this ->options ->get ('templateEngine ' ) === 'volt ' ) {
214214 $ this ->makeLayoutsVolt ();
215215 $ this ->makeViewVolt ('index ' );
216216 $ this ->makeViewSearchVolt ();
@@ -233,26 +233,24 @@ public function build(): bool
233233 * @param string $var
234234 * @param mixed $fields
235235 * @param bool $useGetSetters
236- * @param string $identityField
236+ * @param null| string $identityField
237237 *
238238 * @return string
239239 */
240240 private function captureFilterInput (string $ var , $ fields , bool $ useGetSetters , string $ identityField = null ): string
241241 {
242242 $ code = '' ;
243243 foreach ($ fields as $ field => $ dataType ) {
244- if ($ identityField !== null && $ field == $ identityField ) {
244+ if ($ identityField !== null && $ field === $ identityField ) {
245245 continue ;
246246 }
247247
248- if (is_int ($ dataType) !== false ) {
248+ if (\in_array ($ dataType, [Column:: TYPE_DECIMAL , Column:: TYPE_INTEGER ]) ) {
249249 $ fieldCode = '$this->request->getPost(" ' .$ field .'", "int") ' ;
250+ } elseif ($ field === 'email ' ) {
251+ $ fieldCode = '$this->request->getPost(" ' .$ field .'", "email") ' ;
250252 } else {
251- if ($ field == 'email ' ) {
252- $ fieldCode = '$this->request->getPost(" ' .$ field .'", "email") ' ;
253- } else {
254- $ fieldCode = '$this->request->getPost(" ' .$ field .'") ' ;
255- }
253+ $ fieldCode = '$this->request->getPost(" ' .$ field .'") ' ;
256254 }
257255
258256 $ code .= '$ ' . Utils::lowerCamelizeWithDelimiter ($ var , '- ' , true ) . '-> ' ;
0 commit comments