PHP code example of php-composter / php-composter

1. Go to this page and download the library: Download php-composter/php-composter library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

php-composter / php-composter example snippets


 namespace PHPComposter\PHPComposterExample;

use PHPComposter\PHPComposter\BaseAction;

class Example extends BaseAction
{
    // [...]
}


// [...]

class Example extends BaseAction
{

    /**
     * Example pre-commit action method.
     *
     * @var string $hook Name of the hook that was triggered.
     * @var string $root Root folder in which the hook was triggered.
     */
    public function preCommit()
    {
        echo 'Example Pre-Commit Hook ' . $this->hook . ' @ ' . $this->root . PHP_EOL;
    }
}
BASH
composer init --name php-composter/php-composter-example
JSON
{
  "name": "php-composter/php-composter-example",
  "description": "PHP Composter Example.",
  "type": "php-composter-action",
  "[...]": ""
}
JSON
{
  "[...]": "",
  "composter": "^0.1",
  },
  "[...]": ""
}
BASH
composer