PHP Class PHPComposter\PHPComposter\BaseAction

This class should be extended by each new action.
Since: 0.1.3
Author: Alain Schlesser ([email protected])
Afficher le fichier Open project: php-composter/php-composter

Protected Properties

Свойство Type Description
$hook string Hook that was triggered.
$root string Root folder of the package.

Méthodes publiques

Méthode Description
__construct ( string $hook, string $root ) Instantiate a BaseAction object.
init ( ) Initialize the action.
shutdown ( ) Shut the action down.

Méthodes protégées

Méthode Description
getAgainst ( ) : string Get the tree object to check against.
getStagedFiles ( $pattern ) : array Get the file sthat have been staged for the current commit.
recursiveGlob ( string $pattern, integer $flags ) : mixed Recursively iterate over folders and look for $pattern.

Private Methods

Méthode Description
prependRoot ( string &$file, integer $index, string $root ) Prepend the repository root path

Method Details

__construct() public méthode

Instantiate a BaseAction object.
Since: 0.1.3
public __construct ( string $hook, string $root )
$hook string The name of the hook that was triggered.
$root string Absolute path to the root folder of the package.

getAgainst() protected méthode

Get the tree object to check against.
protected getAgainst ( ) : string
Résultat string HEAD or hash representing empty/initial commit state

getStagedFiles() protected méthode

Get the file sthat have been staged for the current commit.
Since: 0.1.3
protected getStagedFiles ( $pattern ) : array
Résultat array

init() public méthode

Initialize the action.
Since: 0.1.3
public init ( )

recursiveGlob() protected méthode

Recursively iterate over folders and look for $pattern.
Since: 0.1.3
protected recursiveGlob ( string $pattern, integer $flags ) : mixed
$pattern string Pattern to look for.
$flags integer Optional. Flags to PHP glob() function. Defaults to 0.
Résultat mixed

shutdown() public méthode

Shut the action down.
Since: 0.1.3
public shutdown ( )

Property Details

$hook protected_oe property

Hook that was triggered.
Since: 0.1.3
protected string $hook
Résultat string

$root protected_oe property

Root folder of the package.
Since: 0.1.3
protected string $root
Résultat string