PluginProbe ʕ •ᴥ•ʔ
Admin Columns / 7.1.4
Admin Columns v7.1.4
7.1.4 7.0.19 2.3.5 2.4 2.4.1 2.4.10 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.6.1 2.5.6.2 2.5.6.3 2.5.6.4 3.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.7 3.1 3.1.1 3.1.10 3.1.2 3.1.3 3.1.5 3.2.3 3.2.7 3.3.1 3.4.1 3.4.6 3.4.8 4.0.1 4.0.3 4.1.6 4.2.2 4.2.5 4.3 4.3.2 4.4.1 4.4.4 4.4.5 4.5.5 4.6.1 4.7.18 4.7.19 4.7.20 4.7.7 7.0.13 7.0.14 7.0.16 trunk 1.0 1.1 1.1.3 1.2 1.2.1 1.3 1.3.1 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.5.1 1.4.6 1.4.6.1 1.4.6.2 1.4.6.3 1.4.6.4 1.4.7 1.4.8 1.4.9 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2 2.2.1 2.2.1.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.5.1 2.2.6 2.2.6.1 2.2.6.2 2.2.6.3 2.2.6.4 2.2.7 2.2.8 2.2.8.1 2.2.9 2.3.1 2.3.2 2.3.3
codepress-admin-columns / classes / Message.php
codepress-admin-columns / classes Last commit date
Acf 2 days ago Admin 2 days ago Ajax 2 days ago ApplyFilter 2 days ago Asset 2 days ago Capabilities 2 days ago Check 2 days ago Collection 2 days ago Column 2 days ago ColumnFactories 2 days ago ColumnFactory 2 days ago ColumnIterator 2 days ago ColumnRepository 2 days ago ColumnSize 2 days ago DI 2 days ago DefaultColumnHandler 2 days ago Deprecated 2 days ago Entity 2 days ago Exception 2 days ago Expression 2 days ago Form 2 days ago Formatter 2 days ago Helper 2 days ago Integration 2 days ago ListScreenRepository 2 days ago ListTable 2 days ago Message 2 days ago Meta 2 days ago Nonce 2 days ago Notice 2 days ago Plugin 2 days ago Preferences 2 days ago Promo 2 days ago Request 2 days ago RequestHandler 2 days ago Response 2 days ago Sanitize 2 days ago Service 2 days ago Setting 2 days ago Settings 2 days ago Storage 2 days ago Table 2 days ago TableIdsFactory 2 days ago TableScreen 2 days ago TableScreenFactory 2 days ago ThirdParty 2 days ago Type 2 days ago Value 2 days ago View 2 days ago Acf.php 2 days ago AdminColumns.php 2 days ago ArrayIterator.php 2 days ago Capabilities.php 2 days ago Collection.php 2 days ago CollectionFormatter.php 2 days ago Column.php 2 days ago ColumnCollection.php 2 days ago ColumnFactoryCollectionFactory.php 2 days ago ColumnFactoryDefinitionCollection.php 2 days ago ColumnGroups.php 2 days ago ColumnIterator.php 2 days ago ColumnNamesTrait.php 2 days ago ColumnRepository.php 2 days ago ColumnTypeRepository.php 2 days ago Config.php 2 days ago DateFormats.php 2 days ago DefaultColumnHandler.php 2 days ago Expirable.php 2 days ago Formatter.php 2 days ago FormatterCollection.php 2 days ago Helper.php 2 days ago ListScreen.php 2 days ago ListScreenCollection.php 2 days ago ListScreenRepository.php 2 days ago ListScreenRepositoryWritable.php 2 days ago ListTable.php 2 days ago ListTableFactory.php 2 days ago Loader.php 2 days ago Message.php 2 days ago MetaType.php 2 days ago Middleware.php 2 days ago OpCacheInvalidateTrait.php 2 days ago PluginActionLinks.php 2 days ago PluginActionUpgrade.php 2 days ago PostType.php 2 days ago PostTypeRepository.php 2 days ago Registerable.php 2 days ago Registry.php 2 days ago Renderable.php 2 days ago Request.php 2 days ago RequestAjaxHandler.php 2 days ago RequestAjaxHandlers.php 2 days ago RequestAjaxParser.php 2 days ago RequestHandler.php 2 days ago RequestHandlerFactory.php 2 days ago Screen.php 2 days ago Services.php 2 days ago TableIdsFactory.php 2 days ago TableScreen.php 2 days ago TableScreenFactory.php 2 days ago Taxonomy.php 2 days ago Transient.php 2 days ago TypedArrayIterator.php 2 days ago View.php 2 days ago WooCommerce.php 2 days ago WpListTableFactory.php 2 days ago
Message.php
83 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace AC;
6
7 use LogicException;
8
9 abstract class Message
10 {
11 public const SUCCESS = 'updated'; // green
12 public const ERROR = 'notice-error'; // red
13 public const WARNING = 'notice-warning'; // yellow
14 public const INFO = 'notice-info'; // blue
15
16 protected string $message;
17
18 protected string $type;
19
20 protected string $id = '';
21
22 public function __construct(string $message, ?string $type = null)
23 {
24 $this->type = $type ?? self::SUCCESS;
25 $this->message = trim($message);
26
27 $this->validate();
28 }
29
30 protected function validate(): void
31 {
32 if (empty($this->message)) {
33 throw new LogicException('Message cannot be empty.');
34 }
35 }
36
37 abstract public function render(): string;
38
39 /**
40 * Display self::render to the screen
41 */
42 public function display(): void
43 {
44 echo $this->render();
45 }
46
47 public function get_message(): string
48 {
49 return $this->message;
50 }
51
52 public function get_type(): string
53 {
54 return $this->type;
55 }
56
57 /**
58 * @return static
59 */
60 public function set_type(string $type): self
61 {
62 $this->type = $type;
63
64 return $this;
65 }
66
67 public function get_id(): string
68 {
69 return $this->id;
70 }
71
72 /**
73 * @return static
74 */
75 public function set_id(string $id): self
76 {
77 $this->id = $id;
78
79 return $this;
80 }
81
82 }
83