PluginProbe
Extendify / 3.1.5
Extendify v3.1.5
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / app / Notifications / Slots.php

Slots.php in Extendify 3.1.5, at app/Notifications/Slots.php

43 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Slots.
5 */
6
7 namespace Extendify\Notifications;
8
9 defined('ABSPATH') || die('No direct access.');
10
11 /**
12 * The slots a notification can be placed in. Slot names arrive from the API, so
13 * ones this release has no container for are dropped rather than trusted.
14 */
15 class Slots
16 {
17 // phpcs:disable PSR12.Properties.ConstantVisibility.NotFound -- 7.0 floor: no const visibility
18 const ADMIN_DASHBOARD = 'admin-dashboard';
19 const ADMIN_OTHERS = 'admin-others';
20 const ADMIN_ASSIST = 'admin-assist';
21 const AGENT_CHAT = 'agent-chat';
22 const FRONTEND_BOTTOM = 'frontend-bottom';
23 const FRONTEND_TOPBAR = 'frontend-topbar';
24
25 /**
26 * A slot missing from src/Notifications/slots.js renders nothing.
27 */
28 const ALLOWLIST = [
29 self::ADMIN_DASHBOARD,
30 self::ADMIN_OTHERS,
31 self::ADMIN_ASSIST,
32 self::AGENT_CHAT,
33 self::FRONTEND_BOTTOM,
34 self::FRONTEND_TOPBAR,
35 ];
36 // phpcs:enable PSR12.Properties.ConstantVisibility.NotFound
37
38 public static function isKnown(string $slot)
39 {
40 return in_array($slot, self::ALLOWLIST, true);
41 }
42 }
43