Verzeichnisstruktur phpBB-3.3.15


Veröffentlicht
28.08.2024

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

handler_factory.php

Zuletzt modifiziert: 02.04.2025, 15:02 - Dateigröße: 1.27 KiB


01  <?php
02  /**
03   *
04   * This file is part of the phpBB Forum Software package.
05   *
06   * @copyright (c) phpBB Limited <https://www.phpbb.com>
07   * @license GNU General Public License, version 2 (GPL-2.0)
08   *
09   * For full copyright and license information, please see
10   * the docs/CREDITS.txt file.
11   *
12   */
13   
14  namespace phpbb\report;
15   
16  use phpbb\report\exception\factory_invalid_argument_exception;
17   
18  class handler_factory
19  {
20      /**
21       * @var \Symfony\Component\DependencyInjection\ContainerInterface
22       */
23      protected $container;
24   
25      /**
26       * Constructor
27       *
28       * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
29       */
30      public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container)
31      {
32          $this->container = $container;
33      }
34   
35      /**
36       * Return a new instance of an appropriate report handler
37       *
38       * @param string    $type
39       * @return \phpbb\report\report_handler_interface
40       * @throws factory_invalid_argument_exception if $type is not valid
41       */
42      public function get_instance($type)
43      {
44          switch ($type)
45          {
46              case 'pm':
47                  return $this->container->get('phpbb.report.handlers.report_handler_pm');
48              break;
49              case 'post':
50                  return $this->container->get('phpbb.report.handlers.report_handler_post');
51              break;
52          }
53   
54          throw new factory_invalid_argument_exception();
55      }
56  }
57