Problem/Motivation


2) web/modules/orig/decoupled_json_log/tests/src/Kernel/LogJsonPayloadSizeTest.php:141

    ---------- begin diff ----------
@@ Line 141 @@
    * @return bool
    *   TRUE if a matching message was logged.
    */
-  private function loggedWarning(): bool {
-    foreach ($this->logger->messages as $message) {
-      if (str_contains($message, 'Rejected oversized')) {
-        return TRUE;
-      }
-    }
-    return FALSE;
+  private function loggedWarning(): bool
+  {
+      return array_any($this->logger->messages, fn(string $message): bool => str_contains($message, 'Rejected oversized'));
   }

   /**
    ----------- end diff -----------

Applied rules:
 * ProtectedStaticModulesPropertyRector
 * ForeachToArrayAnyRector
 * AddArrowFunctionReturnTypeRector
 * AddArrayAnyAllClosureParamTypeRector


3) web/modules/orig/decoupled_json_log/tests/src/Unit/LogJsonAccessControlHandlerTest.php:45

    ---------- begin diff ----------
@@ Line 45 @@
    * Builds a handler instance without invoking the parent constructor.
    */
   private function makeHandler(): LogJsonAccessControlHandler {
-    return (new \ReflectionClass(LogJsonAccessControlHandler::class))
+    return new \ReflectionClass(LogJsonAccessControlHandler::class)
       ->newInstanceWithoutConstructor();
   }

@@ Line 68 @@
   private function invokeCheckAccess(string $operation, AccountInterface $account): AccessResultInterface {
     $handler = $this->makeHandler();
     $entity = $this->createMock(EntityInterface::class);
-    $result = (new \ReflectionMethod($handler, 'checkAccess'))
+    $result = new \ReflectionMethod($handler, 'checkAccess')
       ->invoke($handler, $entity, $operation, $account);
     assert($result instanceof AccessResultInterface);
     return $result;
@@ Line 79 @@
    */
   private function invokeCheckCreateAccess(AccountInterface $account): AccessResultInterface {
     $handler = $this->makeHandler();
-    $result = (new \ReflectionMethod($handler, 'checkCreateAccess'))
+    $result = new \ReflectionMethod($handler, 'checkCreateAccess')
       ->invoke($handler, $account, [], NULL);
     assert($result instanceof AccessResultInterface);
     return $result;
    ----------- end diff -----------

Applied rules:
 * NewMethodCallWithoutParenthesesRector


4) web/modules/orig/decoupled_json_log/tests/src/Unit/Routing/DecoupledJsonLogLimitingRouteSubscriberTest.php:41

    ---------- begin diff ----------
@@ Line 41 @@
    */
   private function alterRoutes(RouteCollection $collection): void {
     $subscriber = new DecoupledJsonLogLimitingRouteSubscriber();
-    (new \ReflectionMethod($subscriber, 'alterRoutes'))->invoke($subscriber, $collection);
+    new \ReflectionMethod($subscriber, 'alterRoutes')->invoke($subscriber, $collection);
   }

   /**
    ----------- end diff -----------

Applied rules:
 * NewMethodCallWithoutParenthesesRector


Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ptmkenny created an issue. See original summary.

ptmkenny’s picture

Title: Rector fixes » Rector fixes July 2026

ptmkenny’s picture

Issue summary: View changes

  • ptmkenny committed 64bf7080 on 1.0.x
    task: #3607656 Rector fixes July 2026
    
    By: ptmkenny
    
ptmkenny’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.