- Issue created by @Nicoc
- Status changed to Needs work
over 1 year ago 7:08pm 28 February 2023 - Status changed to Needs review
over 1 year ago 7:11pm 28 February 2023 - π§π·Brazil renatog Campinas
#3 really seems good.
Let me ask you what do you think about this?
$isPathEmpty = empty($path); $pathHasWebform = str_contains($path, '/webform/'); $isRequestEmpty = empty($request); $isQueryStringEmpty = empty($request->getQueryString()); if ($isPathEmpty || !$pathHasWebform || $isRequestEmpty || $isQueryStringEmpty) { return $path; }
- @renatog opened merge request.
- π§π·Brazil renatog Campinas
Created the MR with this example: https://git.drupalcode.org/project/webform/-/merge_requests/312/diffs
I'd say that technically is the same, but I was reading #Line length and wrapping β and I saw that recommendation there, that seems interesting
With that the conditional is shorter and make the code easier to read. What do you think, makes sense?
thanks jrockowitz but, i applied another patch : https://www.drupal.org/project/webform/issues/3301970 π Fix PHP 8.1 deprecation Closed: duplicate
and that makes yours not appliable.- πΊπΈUnited States jrockowitz Brooklyn, NY
We can simplify the conditions.
$is_webform_path = (!empty($path) && str_contains($path, '/webform/')); $has_query_string = (!empty($request) && !empty($request->getQueryString())); if (!$is_webform_path || !$has_query_string) { return $path; }
- First commit to issue fork.
-
jrockowitz β
committed 33949efa on 6.1.x authored by
RenatoG β
Issue #3344996 by RenatoG, jrockowitz, paulocs: Fix PHP 8.1 deprecation
-
jrockowitz β
committed 33949efa on 6.1.x authored by
RenatoG β
- Status changed to Fixed
over 1 year ago 1:24pm 4 March 2023 -
jrockowitz β
committed 33949efa on 6.x authored by
RenatoG β
Issue #3344996 by RenatoG, jrockowitz, paulocs: Fix PHP 8.1 deprecation
-
jrockowitz β
committed 33949efa on 6.x authored by
RenatoG β
-
jrockowitz β
committed 33949efa on 6.2.x authored by
RenatoG β
Issue #3344996 by RenatoG, jrockowitz, paulocs: Fix PHP 8.1 deprecation
-
jrockowitz β
committed 33949efa on 6.2.x authored by
RenatoG β
Automatically closed - issue fixed for 2 weeks with no activity.