Config.php
725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace OTGS\Installer\AdminNotices;
class Config {
/**
* @var array
*/
protected $config;
public function __construct( array $config ) {
$this->config = $config;
}
/**
* @param array $messages
* @param string $item
* @param string $type
*
* @return bool
*/
protected function hasItem( array $messages, $item, $type ) {
foreach ( $messages['repo'] as $repo => $ids ) {
foreach ( $ids as $id => $noticeType ) {
$index = is_array( $noticeType ) ? $id : $noticeType;
if ( isset( $this->config['repo'][ $repo ][ $index ][ $type ] )
&& in_array( $item, $this->config['repo'][ $repo ][ $index ][ $type ], true ) ) {
return true;
}
}
}
return false;
}
}