Esempio n. 1
0
}
/**
 * Initialize a new Box
 */
$box = new Box();
/**
 * Bind Product to the container
 */
$box->bind('Product', function () {
    return new Product();
});
/**
 * Bind Repository to the container
 */
$box->bind('ProductRepositoryInterface', function () use($box) {
    return new ProductRepository($box->make('Product'));
});
/**
 * Create new Reflection Class for the ProductController
 */
$class = new ReflectionClass('ProductController');
/**
 * Get the constructor
 */
$constructor = $class->getConstructor();
/**
 * Check with parameter the constructor needs
 */
$parameters = $constructor->getParameters();
$arguments = [];
/**
Esempio n. 2
0
 /**
  * Add Title
  *
  * @author WN
  * @param string $title
  * @param int|null $color
  * @param int|null $option
  * @param int|null $bgcolor
  * @param int|null $borderColor
  * @param int|null $borderBgColor
  * @param string $borderFill
  * @param int|null $size
  * @return $this
  */
 public function addTitle($title, $color = null, $option = null, $bgcolor = null, $borderColor = null, $borderBgColor = null, $borderFill = '*', $size = 0)
 {
     $box = Box::make($this->getWidth(), 3 + 2 * $size, $color, $option, $bgcolor)->addBorder($borderFill, $borderColor, $borderBgColor)->putInCenter(Box::makeFromString($title), $size + 1);
     return $this->putInCenter($box, 0);
 }