PHP Class GrumPHP\Composer\GrumPHPPlugin

Inheritance: implements Composer\Plugin\PluginInterface, implements Composer\EventDispatcher\EventSubscriberInterface
显示文件 Open project: phpro/grumphp

Protected Properties

Property Type Description
$composer Composer\Composer
$configureScheduled boolean
$initScheduled boolean
$io Composer\IO\IOInterface

Public Methods

Method Description
activate ( Composer\Composer $composer, Composer\IO\IOInterface $io )
getSubscribedEvents ( ) Attach package installation events:
postPackageInstall ( Composer\Installer\PackageEvent $event ) When this package is updated, the git hook is also initialized
postPackageUpdate ( Composer\Installer\PackageEvent $event ) When this package is updated, the git hook is also updated
prePackageUninstall ( Composer\Installer\PackageEvent $event ) When this package is uninstalled, the generated git hooks need to be removed
runScheduledTasks ( Composer\Script\Event $event )

Protected Methods

Method Description
deInitGitHook ( ) Deinitialize git hooks
guardIsGrumPhpPackage ( Composer\Package\PackageInterface $package ) : boolean
initGitHook ( ) Initialize git hooks
runGrumPhpCommand ( $command ) Run the GrumPHP console to (de)init the git hooks

Method Details

activate() public method

public activate ( Composer\Composer $composer, Composer\IO\IOInterface $io )
$composer Composer\Composer
$io Composer\IO\IOInterface

deInitGitHook() protected method

Deinitialize git hooks
protected deInitGitHook ( )

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

guardIsGrumPhpPackage() protected method

protected guardIsGrumPhpPackage ( Composer\Package\PackageInterface $package ) : boolean
$package Composer\Package\PackageInterface
return boolean

initGitHook() protected method

Initialize git hooks
protected initGitHook ( )

postPackageInstall() public method

When this package is updated, the git hook is also initialized
public postPackageInstall ( Composer\Installer\PackageEvent $event )
$event Composer\Installer\PackageEvent

postPackageUpdate() public method

When this package is updated, the git hook is also updated
public postPackageUpdate ( Composer\Installer\PackageEvent $event )
$event Composer\Installer\PackageEvent

prePackageUninstall() public method

When this package is uninstalled, the generated git hooks need to be removed
public prePackageUninstall ( Composer\Installer\PackageEvent $event )
$event Composer\Installer\PackageEvent

runGrumPhpCommand() protected method

Run the GrumPHP console to (de)init the git hooks
protected runGrumPhpCommand ( $command )
$command

runScheduledTasks() public method

public runScheduledTasks ( Composer\Script\Event $event )
$event Composer\Script\Event

Property Details

$composer protected_oe property

protected Composer,Composer $composer
return Composer\Composer

$configureScheduled protected_oe property

protected bool $configureScheduled
return boolean

$initScheduled protected_oe property

protected bool $initScheduled
return boolean

$io protected_oe property

protected IOInterface,Composer\IO $io
return Composer\IO\IOInterface