11<?php
22
33declare (strict_types=1 );
4- /**
5- * Zikula Application Framework
4+
5+ /*
6+ * This file is part of the Zikula package.
7+ *
8+ * Copyright Zikula Foundation - https://ziku.la/
69 *
7- * @copyright (c) Zikula Development Team
8- * @see https://ziku.la
9- * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
10+ * For the full copyright and license information, please view the LICENSE
11+ * file that was distributed with this source code.
1012 */
1113
1214namespace Zikula \ScribiteModule \Editor \CKEditor \Collection ;
1315
16+ use Zikula \ScribiteModule \Editor \EditorPluginCollectionInterface ;
17+
1418/**
15- * This class is used as the subject of the event 'moduleplugin.ckeditor.externalplugins' .
16- * Any module that needs to add *external* editor plugins can use an event listener to automatically load their
19+ * This class is used by the `Zikula\ScribiteModule\Editor\CKEditor\LoadExternalPluginsEvent` .
20+ * Any extension that needs to add *external* editor plugins can use an event listener to automatically load their
1721 * helper every time a Scribite editor is loaded.
1822 * @see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.resourceManager.html#addExternal
1923 * @see http://ckeditor.com/comment/47922#comment-47922
2024 */
21- class PluginCollection
25+ class PluginCollection implements EditorPluginCollectionInterface
2226{
2327 /**
24- * stack of plugins
25- * @var array
28+ * Stack of plugins.
2629 */
27- private $ plugins ;
28-
29- /**
30- * PluginCollection constructor.
31- */
32- public function __construct ()
33- {
34- $ this ->plugins = [];
35- }
30+ private $ plugins = [];
3631
3732 /**
38- * add a plugin to the stack
39- * @param array $plugin
40- * $helper must have array keys [name, path, file, img] set
33+ * Adds a plugin to the stack.
34+ *
35+ * $plugin must have array keys [name, path, file, img] set.
4136 */
42- public function add (array $ plugin )
37+ public function add (array $ plugin ): void
4338 {
4439 if (isset ($ plugin ['name ' ], $ plugin ['path ' ], $ plugin ['file ' ], $ plugin ['img ' ])) {
4540 $ plugin ['path ' ] = rtrim ($ plugin ['path ' ], '/ ' ) . '/ ' ; // ensure there is a trailing slash
@@ -48,10 +43,9 @@ public function add(array $plugin)
4843 }
4944
5045 /**
51- * get the helper stack
52- * @return array
46+ * Gets the plugins stack.
5347 */
54- public function getPlugins ()
48+ public function getPlugins (): array
5549 {
5650 return $ this ->plugins ;
5751 }
0 commit comments