@@ -457,7 +457,7 @@ public function updateVisibilityLocation(
457
457
?LocationUpdateVisibilityData $ data = null ,
458
458
?string $ name = null
459
459
): FormInterface {
460
- $ name = $ name ?: StringUtil::fqcnToBlockPrefix (LocationUpdateVisibilityType ::class);
460
+ $ name = $ name ?: StringUtil::fqcnToBlockPrefix (LocationUpdateVisibilityData ::class);
461
461
462
462
if (!is_string ($ name ) || $ name === '' ) {
463
463
throw new InvalidArgumentException (
@@ -797,14 +797,10 @@ public function updatePolicy(
797
797
PolicyUpdateData $ data ,
798
798
?string $ name = null
799
799
): FormInterface {
800
- $ name = $ name ?: StringUtil::fqcnToBlockPrefix (PolicyUpdateType::class);
801
-
802
- if (!is_string ($ name ) || $ name === '' ) {
803
- throw new InvalidArgumentException (
804
- 'name ' ,
805
- 'The form name must be a non-empty string. '
806
- );
807
- }
800
+ $ name = $ name ?: sprintf (
801
+ 'update-policy-%s ' ,
802
+ hash ('sha256 ' , implode ('/ ' , $ data ->getPolicy ()))
803
+ );
808
804
809
805
return $ this ->formFactory ->createNamed ($ name , PolicyUpdateType::class, $ data );
810
806
}
@@ -813,14 +809,10 @@ public function deletePolicy(
813
809
PolicyDeleteData $ data ,
814
810
?string $ name = null
815
811
): FormInterface {
816
- $ name = $ name ?: StringUtil::fqcnToBlockPrefix (PolicyDeleteType::class);
817
-
818
- if (!is_string ($ name ) || $ name === '' ) {
819
- throw new InvalidArgumentException (
820
- 'name ' ,
821
- 'The form name must be a non-empty string. '
822
- );
823
- }
812
+ $ name = $ name ?: sprintf (
813
+ 'delete-policy-%s ' ,
814
+ hash ('sha256 ' , implode ('/ ' , $ data ->getPolicy ()))
815
+ );
824
816
825
817
return $ this ->formFactory ->createNamed ($ name , PolicyDeleteType::class, $ data );
826
818
}
@@ -849,7 +841,7 @@ public function createSearchForm(
849
841
?string $ name = null ,
850
842
array $ options = []
851
843
): FormInterface {
852
- $ name = $ name ?: StringUtil::fqcnToBlockPrefix (SearchType ::class);
844
+ $ name = $ name ?: StringUtil::fqcnToBlockPrefix (SearchData ::class);
853
845
854
846
if (!is_string ($ name ) || $ name === '' ) {
855
847
throw new InvalidArgumentException (
@@ -866,7 +858,7 @@ public function createUrlListForm(
866
858
?string $ name = null ,
867
859
array $ options = []
868
860
): FormInterface {
869
- $ name = $ name ?: StringUtil::fqcnToBlockPrefix (URLListType ::class);
861
+ $ name = $ name ?: StringUtil::fqcnToBlockPrefix (SearchData ::class);
870
862
871
863
if (!is_string ($ name ) || $ name === '' ) {
872
864
throw new InvalidArgumentException (
@@ -883,7 +875,7 @@ public function createUrlEditForm(
883
875
?string $ name = null ,
884
876
array $ options = []
885
877
): FormInterface {
886
- $ name = $ name ?: StringUtil::fqcnToBlockPrefix (URLEditType ::class);
878
+ $ name = $ name ?: StringUtil::fqcnToBlockPrefix (SearchData ::class);
887
879
888
880
if (!is_string ($ name ) || $ name === '' ) {
889
881
throw new InvalidArgumentException (
0 commit comments