Updated FML to newest version

This commit is contained in:
Jocy
2017-04-02 16:32:57 +02:00
parent 83710a9269
commit c5926aded2
21 changed files with 1425 additions and 995 deletions

View File

@ -2,6 +2,7 @@
namespace FML\Elements;
use FML\Stylesheet\Style;
use FML\Types\Container;
use FML\Types\Identifiable;
use FML\Types\Renderable;
@ -113,14 +114,23 @@ class FrameModel implements Container, Identifiable, Renderable
/**
* @see Container::addChild()
*/
public function addChild(Renderable $childElement)
public function addChild(Renderable $child)
{
if (!in_array($childElement, $this->children, true)) {
array_push($this->children, $childElement);
if (!in_array($child, $this->children, true)) {
array_push($this->children, $child);
}
return $this;
}
/**
* @deprecated Use addChild()
* @see FrameModel::addChild()
*/
public function add(Renderable $child)
{
return $this->addChild($child);
}
/**
* @see Container::addChildren()
*/
@ -142,15 +152,29 @@ class FrameModel implements Container, Identifiable, Renderable
}
/**
* @see Container::getFormat()
* @deprecated Use removeAllChildren()
* @see FrameModel::removeAllChildren()
*/
public function getFormat()
public function removeChildren()
{
return $this->removeAllChildren();
}
/**
* @deprecated Use Style
* @see Style
*/
public function getFormat($createIfEmpty = true)
{
if (!$this->format && $createIfEmpty) {
$this->setFormat(new Format());
}
return $this->format;
}
/**
* @see Container::setFormat()
* @deprecated Use Style
* @see Style
*/
public function setFormat(Format $format = null)
{