Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4ff6def5e3
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 53 lines (49 sloc) 1.501 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
<?php

/*
* This file is part of the Lime framework.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
* (c) Bernhard Schussek <bernhard.schussek@symfony-project.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

/**
* A callback that loads test files.
*
* The callback receives the executable and the labels passed to the constructor
* of this class as first two arguments.
*
* @author Bernhard Schussek <bernhard.schussek@symfony-project.com>
*/
class LimeCallback implements LimeLoadable
{
  protected
    $callback = null,
    $executable = null,
    $labels = array();

  /**
* Constructor.
*
* @param callable $callback The callback which should return an
* array of LimeFile instances
* @param LimeExecutable $executable The executable that is passed to the
* callable
* @param array $labels The lables that are passed to the
* callable
*/
  public function __construct($callback, LimeExecutable $executable, array $labels = array())
  {
    $this->callback = $callback;
    $this->executable = $executable;
    $this->labels = $labels;
  }

  /**
* (non-PHPdoc)
* @see LimeLoadable#loadFiles()
*/
  public function loadFiles()
  {
    return call_user_func($this->callback, $this->executable, $this->labels);
  }
}
Something went wrong with that request. Please try again.