MDL-58087 core_calendar: Remove redundant event vault factory
authorCameron Ball <cameron@moodle.com>
Wed, 22 Mar 2017 09:42:21 +0000 (17:42 +0800)
committerDan Poltawski <dan@moodle.com>
Tue, 4 Apr 2017 10:01:38 +0000 (11:01 +0100)
Part of MDL-55611 epic.

calendar/classes/local/event/core_container.php
calendar/classes/local/event/factories/event_vault_factory.php [deleted file]
calendar/classes/local/interfaces/event_vault_factory_interface.php [deleted file]

index 9563c12..cc484b9 100644 (file)
@@ -31,9 +31,9 @@ namespace core_calendar\local\event;
 defined('MOODLE_INTERNAL') || die();
 
 use core_calendar\action_factory;
+use core_calendar\local\event\data_access\event_vault;
 use core_calendar\local\event\factories\action_event_factory;
 use core_calendar\local\event\factories\event_factory;
-use core_calendar\local\event\factories\event_vault_factory;
 use core_calendar\local\event\mappers\event_mapper;
 use core_calendar\local\interfaces\action_event_interface;
 use core_calendar\local\interfaces\event_interface;
@@ -147,8 +147,7 @@ class core_container {
         }
 
         if (empty(self::$eventvault)) {
-            $vaultfactory = new event_vault_factory();
-            self::$eventvault = $vaultfactory->create_instance(self::$eventfactory);
+            self::$eventvault = new event_vault(self::$eventfactory, self::$eventretrievalstrategy);
         }
     }
 
diff --git a/calendar/classes/local/event/factories/event_vault_factory.php b/calendar/classes/local/event/factories/event_vault_factory.php
deleted file mode 100644 (file)
index 130d2b4..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
-/**
- * Event vault factory class
- *
- * @package    core_calendar
- * @copyright  2017 Ryan Wyllie <ryan@moodle.com>
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-namespace core_calendar\local\event\factories;
-
-use core_calendar\local\event\data_access\event_vault;
-use core_calendar\local\interfaces\event_factory_interface;
-use core_calendar\local\interfaces\event_vault_factory_interface;
-
-/**
- * Event vault factory class
- *
- * @copyright 2017 Ryan Wyllie <ryan@moodle.com>
- * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-class event_vault_factory implements event_vault_factory_interface {
-    /**
-     * Creates an instance of an event vault
-     *
-     * @param event_factory_interface $eventfactory The event factory
-     * @return event_vault_interface
-     */
-    public function create_instance(event_factory_interface $eventfactory) {
-        return new event_vault($eventfactory);
-    }
-}
diff --git a/calendar/classes/local/interfaces/event_vault_factory_interface.php b/calendar/classes/local/interfaces/event_vault_factory_interface.php
deleted file mode 100644 (file)
index 0cdc89c..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-// This file is part of Moodle - http://moodle.org/
-//
-// Moodle is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Moodle is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-
-/**
- * Event vault factory interface
- *
- * @package    core_calendar
- * @copyright  2017 Ryan Wyllie <ryan@moodle.com>
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-
-namespace core_calendar\local\interfaces;
-
-/**
- * Interface for an event vault factory class
- *
- * @copyright  2017 Ryan Wyllie <ryan@moodle.com>
- * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
- */
-interface event_vault_factory_interface {
-    /**
-     * Creates an instance of an event vault
-     *
-     * @param event_factory_interface $eventfactory The event factory
-     * @return event_vault_interface
-     */
-    public function create_instance(event_factory_interface $eventfactory);
-}