Skip to content

Commit

Permalink
docs: make discoverFilters() deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Oct 6, 2023
1 parent 83b64b4 commit f8acd58
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ public function __construct($config, RequestInterface $request, ResponseInterfac
*
* Sample :
* $filters->aliases['custom-auth'] = \Acme\Blob\Filters\BlobAuth::class;
*
* @deprecated 4.4.2 Use Registrar instead.
*/
private function discoverFilters(): void
{
Expand Down
7 changes: 7 additions & 0 deletions user_guide_src/source/general/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ In that case, see :ref:`routing-priority`.
Filters
=======

.. deprecated:: 4.4.2

.. note:: This feature is deprecated. Use :ref:`registrars` instead like the
following:

.. literalinclude:: modules/015.php

By default, :doc:`filters <../incoming/filters>` are automatically scanned for within modules.
It can be turned off in the **Modules** config file, described above.

Expand Down
22 changes: 22 additions & 0 deletions user_guide_src/source/general/modules/015.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace CodeIgniter\Shield\Config;

use CodeIgniter\Shield\Filters\SessionAuth;
use CodeIgniter\Shield\Filters\TokenAuth;

class Registrar
{
/**
* Registers the Shield filters.
*/
public static function Filters(): array
{
return [
'aliases' => [
'session' => SessionAuth::class,
'tokens' => TokenAuth::class,
],
];
}
}

0 comments on commit f8acd58

Please sign in to comment.