Skip to content

Commit

Permalink
Merge pull request #15 from LoversOfBehat/bc-event
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea authored Jun 26, 2023
2 parents 7551f0d + f0c10fb commit 2b756b9
Showing 1 changed file with 57 additions and 23 deletions.
80 changes: 57 additions & 23 deletions src/Event/AfterTableFetchEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,70 @@
namespace LoversOfBehat\TableExtension\Event;

use LoversOfBehat\TableExtension\HtmlContainer;
use Symfony\Component\EventDispatcher\Event;

/**
* Event that fires after fetching a table from the web page.
*/
class AfterTableFetchEvent extends Event implements TableEventInterface
{

/**
* An object containing the HTML of the fetched table.
*
* @var HtmlContainer
*/
protected $htmlContainer;

if (class_exists('Symfony\Component\EventDispatcher\Event')) {
/**
* Constructs a new AfterTableFetchEvent object.
*
* @param HtmlContainer $htmlContainer
* Event that fires after fetching a table from the web page.
*/
public function __construct(HtmlContainer $htmlContainer)
class AfterTableFetchEvent extends Symfony\Component\EventDispatcher\Event implements TableEventInterface
{
$this->htmlContainer = $htmlContainer;
}

/**
* An object containing the HTML of the fetched table.
*
* @var HtmlContainer
*/
protected $htmlContainer;

/**
* Constructs a new AfterTableFetchEvent object.
*
* @param HtmlContainer $htmlContainer
*/
public function __construct(HtmlContainer $htmlContainer)
{
$this->htmlContainer = $htmlContainer;
}

/**
* {@inheritdoc}
*/
public function getHtmlContainer(): HtmlContainer
{
return $this->htmlContainer;
}
}
}
else {
/**
* {@inheritdoc}
* Event that fires after fetching a table from the web page.
*/
public function getHtmlContainer(): HtmlContainer
class AfterTableFetchEvent extends \Symfony\Contracts\EventDispatcher\Event implements TableEventInterface
{
return $this->htmlContainer;

/**
* An object containing the HTML of the fetched table.
*
* @var HtmlContainer
*/
protected $htmlContainer;

/**
* Constructs a new AfterTableFetchEvent object.
*
* @param HtmlContainer $htmlContainer
*/
public function __construct(HtmlContainer $htmlContainer)
{
$this->htmlContainer = $htmlContainer;
}

/**
* {@inheritdoc}
*/
public function getHtmlContainer(): HtmlContainer
{
return $this->htmlContainer;
}
}
}

0 comments on commit 2b756b9

Please sign in to comment.