@@ -1827,3 +1827,55 @@ enum MyWellNamedEnum: int {
18271827 case One = 1 ;
18281828 case Two = 2 ;
18291829}
1830+
1831+ // Allow longer than 80 character array definitions on one line (up to 120).
1832+ if (!in_array ($ form_object ->getOperation (), ['add ' , 'edit ' , 'delete ' , 'clone ' , 'default ' ], TRUE )) {
1833+ return ;
1834+ }
1835+ if ($ content_type_facet_field && in_array ($ entity_type , ['entity:node ' , 'entity:media ' ])) {
1836+ $ foo ->setContentTypeFacetValues ($ item , $ entity_type , $ content_type_facet_field );
1837+ }
1838+
1839+ /**
1840+ * Testing nested array definitions going over 80 characters.
1841+ */
1842+ class LongNestedArrayLine {
1843+
1844+ /**
1845+ * Test method.
1846+ */
1847+ public function foo () {
1848+ foreach ($ x as $ y ) {
1849+ foreach ($ a as $ b ) {
1850+ $ form [$ policyTypeKey ]['directives ' ][$ directiveName ]['options ' ]['flags_wrapper ' ]['flags ' ] = [
1851+ '#type ' => 'checkboxes ' ,
1852+ '#parents ' => [$ policyTypeKey , 'directives ' , $ directiveName , 'flags ' , 'humans ' ],
1853+ '#options ' => [
1854+ 'unsafe-inline ' => "'unsafe-inline' " ,
1855+ 'unsafe-eval ' => "'unsafe-eval' " ,
1856+ 'unsafe-hashes ' => "'unsafe-hashes' " ,
1857+ 'unsafe-allow-redirects ' => "'unsafe-allow-redirects' " ,
1858+ 'strict-dynamic ' => "'strict-dynamic' " ,
1859+ 'report-sample ' => "'report-sample' " ,
1860+ ],
1861+ '#default_value ' => $ config ->get ($ policyTypeKey . '.directives. ' . $ directiveName . '.flags ' ) ?: [],
1862+ ];
1863+ }
1864+ }
1865+ }
1866+
1867+ }
1868+
1869+ // Allow array definition statements over 80 but under 120 characters.
1870+ $ form ['strings ' ] = [
1871+ '#type ' => 'table ' ,
1872+ '#tree ' => TRUE ,
1873+ '#language ' => $ langname ,
1874+ '#header ' => [
1875+ $ this ->t ('Source string ' ),
1876+ $ this ->t ('Translation for @language on this longer line ' , ['@language ' => $ langname ]),
1877+ $ this ->t ('Delete ' ),
1878+ ],
1879+ '#empty ' => $ this ->t ('No strings available. ' ),
1880+ '#attributes ' => ['class ' => ['locale-translate-edit-table ' ]],
1881+ ];
0 commit comments