PhilippBaschke\ACFProInstaller\Plugin::getSubscribedEvents PHP Method

getSubscribedEvents() public static method

Pre Install/Update: The version needs to be added to the url (will show up in composer.lock) Pre Download: The key needs to be added to the url (will not show up in composer.lock)
public static getSubscribedEvents ( ) : array
return array An array of events that the plugin subscribes to
    public static function getSubscribedEvents()
    {
        return [PackageEvents::PRE_PACKAGE_INSTALL => 'addVersion', PackageEvents::PRE_PACKAGE_UPDATE => 'addVersion', PluginEvents::PRE_FILE_DOWNLOAD => 'addKey'];
    }

Usage Example

コード例 #1
0
 public function testSubscribesToPreFileDownloadEvent()
 {
     $subscribedEvents = Plugin::getSubscribedEvents();
     $this->assertEquals($subscribedEvents[PluginEvents::PRE_FILE_DOWNLOAD], 'addKey');
 }