IsActive.php
4 years ago
IsInstalled.php
4 years ago
IsNotActive.php
4 years ago
IsPluginActive.php
4 years ago
IsPluginNotActive.php
4 years ago
IsInstalled.php
22 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AC\Integration\Filter; |
| 4 | |
| 5 | use AC\Integration; |
| 6 | use AC\Integration\Filter; |
| 7 | use AC\Integrations; |
| 8 | use AC\PluginInformation; |
| 9 | |
| 10 | class IsInstalled implements Filter { |
| 11 | |
| 12 | public function filter( Integrations $integrations ) { |
| 13 | return new Integrations( array_filter( $integrations->all(), [ $this, 'is_installed' ] ) ); |
| 14 | } |
| 15 | |
| 16 | private function is_installed( Integration $integration ) { |
| 17 | $plugin = new PluginInformation( $integration->get_basename() ); |
| 18 | |
| 19 | return $plugin->is_installed(); |
| 20 | } |
| 21 | |
| 22 | } |