Create enums for File exists options and deprecate consts

Created on 7 March 2024, 9 months ago
Updated 28 April 2024, 7 months ago

Problem/Motivation

We can replace \Drupal\Core\File\FileSystemInterface::EXISTS_RENAME, EXISTS_REPLACE, and EXISTS_ERROR constants with an enum.

Steps to reproduce

Proposed resolution

Create a new enum \Drupal\Core\File\FileExists with:

  • FileExists::Rename
  • FileExists::Replace
  • FileExists::Error

Deprecate the old constants and replace usages in core. Provide FileExists::fromLegacyInt() to convert the old constants into the new enum.

Remaining tasks

User interface changes

API changes

\Drupal\Core\File\FileSystemInterface::EXISTS_RENAME, EXISTS_REPLACE, and EXISTS_ERROR constants are deprecated
New \Drupal\Core\File\FileExists enum replaces them.

Data model changes

None

Release notes snippet

I don't think this is necessary.

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
File systemΒ  β†’

Last updated about 1 hour ago

Created by

πŸ‡¦πŸ‡ΊAustralia kim.pepper πŸ„β€β™‚οΈπŸ‡¦πŸ‡ΊSydney, Australia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024