Commit 86e7dc8b authored by catch's avatar catch
Browse files

Issue #3555881 by alexpott:...

Issue #3555881 by alexpott: \Drupal\Core\Theme\Icon\IconFinder::extractGroupFromPath() causes deprecations on PHP 8.5

(cherry picked from commit 00aea85e)
parent cb8fc951
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ private function processFoundFiles(Finder $finder, string $source, string $path_
        'icon_id' => $icon_id,
        'source' => $this->fileUrlGenerator->generateString(str_replace($this->appRoot, '', $file_absolute_path)),
        'absolute_path' => $file_absolute_path,
        'group' => self::extractGroupFromPath($file->getPath(), $group_position),
        'group' => $group_position === NULL ? NULL : self::extractGroupFromPath($file->getPath(), $group_position),
      ];
    }

@@ -342,13 +342,13 @@ private static function extractIconIdFromFilename(string $filename, string $file
   *
   * @param string $path
   *   The file path.
   * @param int|null $group_position
   *   The position of the group in the path, or null if not applicable.
   * @param int $group_position
   *   The position of the group in the path.
   *
   * @return string|null
   *   The extracted group, or null if not found.
   */
  private static function extractGroupFromPath(string $path, ?int $group_position): ?string {
  private static function extractGroupFromPath(string $path, int $group_position): ?string {
    $parts = explode('/', trim($path, '/'));
    return $parts[$group_position] ?? NULL;
  }