Skip to content

Commit 196252f

Browse files
committed
refactor: Minor changes
1 parent ab0eb0e commit 196252f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/BetterNotice.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ class BetterNotice {
1414
'Success',
1515
];
1616

17-
private function __construct() {
18-
return;
19-
}
17+
private function __construct() {}
2018

2119
/**
2220
* Create a new instance of BetterNotice
@@ -36,6 +34,7 @@ protected static function _object_maker( string $type, string $message )
3634
*
3735
* @param string $name
3836
* @param array $arguments
37+
* @return Notice|false
3938
*/
4039
public static function __callStatic( string $name, array $arguments)
4140
{

src/Notice.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function __construct( string $type, string $message ) {
1414
$this->message = $message;
1515
$this->type = $type;
1616

17-
add_action( 'admin_notices', array( $this, 'print_notice' ) );
17+
\add_action( 'admin_notices', array( $this, 'print_notice' ) );
1818

1919
return $this;
2020
}
@@ -25,7 +25,7 @@ public function __construct( string $type, string $message ) {
2525
* @return string
2626
* TODO: Sanitize HTML Tags
2727
*/
28-
protected function _notice_body()
28+
protected function _notice_body(): string
2929
{
3030
$notice_body = '<div class="notice notice-' . $this->type . ' is-dismissible">';
3131
$notice_body .= '<p>' . $this->message . '</p>';
@@ -36,7 +36,7 @@ protected function _notice_body()
3636
/**
3737
* Print the notice
3838
*/
39-
public function print_notice()
39+
public function print_notice(): bool
4040
{
4141
echo $this->_notice_body();
4242

0 commit comments

Comments
 (0)