1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Refactor scripts

This commit is contained in:
Jordi Boggiano 2012-02-05 16:14:25 +01:00
parent c2aac6a37c
commit 7add1001ae
10 changed files with 428 additions and 326 deletions

View file

@ -0,0 +1,83 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Script;
use Composer\Composer;
use Composer\IO\IOInterface;
/**
* The base event class
*
* @author François Pluchino <francois.pluchino@opendisplay.com>
*/
class Event
{
/**
* @var string This event's name
*/
private $name;
/**
* @var Composer The composer instance
*/
private $composer;
/**
* @var IOInterface The IO instance
*/
private $io;
/**
* Constructor.
*
* @param string $name The event name
* @param Composer $composer The composer objet
* @param IOInterface $io The IOInterface object
*/
public function __construct($name, Composer $composer, IOInterface $io)
{
$this->name = $name;
$this->composer = $composer;
$this->io = $io;
}
/**
* Returns the event's name.
*
* @return string The event name
*/
public function getName()
{
return $this->name;
}
/**
* Returns the composer instance.
*
* @return Composer
*/
public function getComposer()
{
return $this->composer;
}
/**
* Returns the IO instance.
*
* @return IOInterface
*/
public function getIO()
{
return $this->io;
}
}