config
4 years ago
notices
1 month ago
Config.php
1 month ago
Dismissed.php
1 month ago
Display.php
1 month ago
Loader.php
1 month ago
MessageTexts.php
1 month ago
PageConfig.php
1 month ago
ScreenConfig.php
1 month ago
Store.php
1 month ago
Config.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace OTGS\Installer\AdminNotices; |
| 4 | |
| 5 | class Config { |
| 6 | |
| 7 | protected $config; |
| 8 | |
| 9 | public function __construct( array $config ) { |
| 10 | $this->config = $config; |
| 11 | } |
| 12 | |
| 13 | protected function hasItem( array $messages, $item, $type ) { |
| 14 | foreach ( $messages['repo'] as $repo => $ids ) { |
| 15 | foreach ( $ids as $id => $noticeType ) { |
| 16 | $index = is_array( $noticeType ) ? $id : $noticeType; |
| 17 | |
| 18 | if ( isset( $this->config['repo'][ $repo ][ $index ][ $type ] ) |
| 19 | && in_array( $item, $this->config['repo'][ $repo ][ $index ][ $type ], true ) ) { |
| 20 | return true; |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | return false; |
| 26 | } |
| 27 | } |
| 28 |