File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/ApiPlatform/State/Base/Wrapper Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ protected function getUriVariablesOutput(): array
374374 $ property [BaseRoute::KEY_TYPE ] === BaseRoute::TYPE_STRING ,
375375 $ property [BaseRoute::KEY_TYPE ] === BaseRoute::TYPE_ENUM_STRING => $ this ->getFilterString ($ name ),
376376 $ property [BaseRoute::KEY_TYPE ] === BaseRoute::TYPE_INTEGER => $ this ->getFilterInteger ($ name ),
377+ $ property [BaseRoute::KEY_TYPE ] === BaseRoute::TYPE_BOOLEAN => $ this ->isFilterBoolean ($ name ),
377378 default => throw new TypeInvalidException (sprintf ('BaseRoute::KEY_TYPE (%s) ' , $ name )),
378379 };
379380 break ;
@@ -552,6 +553,19 @@ protected function getFilterInteger(string $name): int
552553 return (new TypeCastingHelper ($ this ->getFilter ($ name )))->intval ();
553554 }
554555
556+ /**
557+ * Returns a filter variable as bool representation.
558+ *
559+ * @param string $name
560+ * @return bool
561+ * @throws ArrayKeyNotFoundException
562+ * @throws TypeInvalidException
563+ */
564+ protected function isFilterBoolean (string $ name ): bool
565+ {
566+ return (bool ) $ this ->getFilter ($ name );
567+ }
568+
555569 /**
556570 * @return array<int|string, mixed>|null
557571 */
You can’t perform that action at this time.
0 commit comments