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

@ -12,6 +12,11 @@ namespace FML\Stylesheet;
class Stylesheet
{
/**
* @var Style[] $styles Styles
*/
protected $styles = array();
/**
* @var Style3d[] $styles3d 3d Styles
*/
@ -33,6 +38,44 @@ class Stylesheet
return new static();
}
/**
* Get the Styles
*
* @api
* @return Style[]
*/
public function getStyles()
{
return $this->styles;
}
/**
* Add a new Style
*
* @api
* @param Style $style The Style to be added
* @return static
*/
public function addStyle(Style $style)
{
if (!in_array($style, $this->styles, true)) {
array_push($this->styles, $style);
}
return $this;
}
/**
* Remove all Styles
*
* @api
* @return static
*/
public function removeAllStyles()
{
$this->styles = array();
return $this;
}
/**
* Get the Styles3d
*
@ -71,14 +114,32 @@ class Stylesheet
return $this;
}
/**
* Remove all Style3ds
*
* @api
* @return static
* @deprecated Use removeAllStyles3d()
* @see Stylesheet::removeAllStyles3d()
*/
public function removeStyles()
{
return $this->removeAllStyles()
->removeAllStyles3d();
}
/**
* Get the Mood
*
* @api
* @param bool $createIfEmpty (optional) If the Mood should be created if it doesn't exist yet
* @return Mood
*/
public function getMood()
public function getMood($createIfEmpty = true)
{
if (!$this->mood && $createIfEmpty) {
$this->createMood();
}
return $this->mood;
}