Skip to content

Commit

Permalink
refactor: Remove deprecated Config\Format::getFormatter() (#9405)
Browse files Browse the repository at this point in the history
* refactor: Remove deprecated `Config\Format::getFormatter()`

* docs: Update changelog
  • Loading branch information
neznaika0 authored Jan 13, 2025
1 parent 5e50f2f commit 35321ac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
13 changes: 0 additions & 13 deletions app/Config/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Config;

use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Format\FormatterInterface;
use CodeIgniter\Format\JSONFormatter;
use CodeIgniter\Format\XMLFormatter;

Expand Down Expand Up @@ -62,16 +61,4 @@ class Format extends BaseConfig
'application/xml' => 0,
'text/xml' => 0,
];

/**
* A Factory method to return the appropriate formatter for the given mime type.
*
* @return FormatterInterface
*
* @deprecated This is an alias of `\CodeIgniter\Format\Format::getFormatter`. Use that instead.
*/
public function getFormatter(string $mime)
{
return service('format')->getFormatter($mime);
}
}
1 change: 1 addition & 0 deletions user_guide_src/source/changelogs/v4.6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ Removed Deprecated Items
- **Constants:** The deprecated constants ``EVENT_PRIORITY_*`` in has been removed. Use the class constants ``CodeIgniter\Events\Events::PRIORITY_LOW``, ``CodeIgniter\Events\Events::PRIORITY_NORMAL`` and ``CodeIgniter\Events\Events::PRIORITY_HIGH`` instead.
- **View:** The deprecated property ``CodeIgniter\View\View::$currentSection`` has been removed.
- **Config:** The deprecated property ``Config\Cache::$storePath`` has been removed. Use ``Config\Cache::$file['storePath']`` instead.
- **Formatter:** The deprecated ``Config\Format::getFormatter()`` has been removed. Use ``CodeIgniter\Format\Format::getFormatter()`` instead.

************
Enhancements
Expand Down
3 changes: 2 additions & 1 deletion user_guide_src/source/installation/upgrade_460.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,5 @@ many will be simple comments or formatting that have no effect on the runtime:

- app/Config/Feature.php
- app/Config/Constants.php
- app/Config/Cache.php
- app/Config/Cache.php
- app/Config/Format.php

0 comments on commit 35321ac

Please sign in to comment.