Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'weierophinney/feature/pluginloader-remo…
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions src/Cloud.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,35 @@ class Cloud
*
* @var Cloud
*/
protected $_cloudDecorator = null;
protected $cloudDecorator = null;

/**
* DecoratorInterface for the tags
*
* @var Tag
*/
protected $_tagDecorator = null;
protected $tagDecorator = null;

/**
* List of all tags
*
* @var ItemList
*/
protected $_tags = null;
protected $tags = null;

/**
* Plugin manager for decorators
*
* @var Cloud\DecoratorPluginManager
*/
protected $_decorators = null;
protected $decorators = null;

/**
* Option keys to skip when calling setOptions()
*
* @var array
*/
protected $_skipOptions = array(
protected $skipOptions = array(
'options',
'config',
);
Expand Down Expand Up @@ -80,17 +80,12 @@ public function __construct($options = null)
*/
public function setOptions(array $options)
{
if (isset($options['prefixPath'])) {
$this->addPrefixPaths($options['prefixPath']);
unset($options['prefixPath']);
}

foreach ($options as $key => $value) {
if (in_array(strtolower($key), $this->_skipOptions)) {
if (in_array(strtolower($key), $this->skipOptions)) {
continue;
}

$method = 'set' . ucfirst($key);
$method = 'set' . $key;
if (method_exists($this, $method)) {
$this->$method($value);
}
Expand Down Expand Up @@ -157,7 +152,7 @@ public function appendTag($tag)
*/
public function setItemList(ItemList $itemList)
{
$this->_tags = $itemList;
$this->tags = $itemList;
return $this;
}

Expand All @@ -170,10 +165,10 @@ public function setItemList(ItemList $itemList)
*/
public function getItemList()
{
if (null === $this->_tags) {
if (null === $this->tags) {
$this->setItemList(new ItemList());
}
return $this->_tags;
return $this->tags;
}

/**
Expand Down Expand Up @@ -205,7 +200,7 @@ public function setCloudDecorator($decorator)
throw new Exception\InvalidArgumentException('DecoratorInterface is no instance of Cloud\Decorator\AbstractCloud');
}

$this->_cloudDecorator = $decorator;
$this->cloudDecorator = $decorator;

return $this;
}
Expand All @@ -217,10 +212,10 @@ public function setCloudDecorator($decorator)
*/
public function getCloudDecorator()
{
if (null === $this->_cloudDecorator) {
if (null === $this->cloudDecorator) {
$this->setCloudDecorator('htmlCloud');
}
return $this->_cloudDecorator;
return $this->cloudDecorator;
}

/**
Expand Down Expand Up @@ -252,7 +247,7 @@ public function setTagDecorator($decorator)
throw new Exception\InvalidArgumentException('DecoratorInterface is no instance of Cloud\Decorator\Tag');
}

$this->_tagDecorator = $decorator;
$this->tagDecorator = $decorator;

return $this;
}
Expand All @@ -264,10 +259,10 @@ public function setTagDecorator($decorator)
*/
public function getTagDecorator()
{
if (null === $this->_tagDecorator) {
if (null === $this->tagDecorator) {
$this->setTagDecorator('htmlTag');
}
return $this->_tagDecorator;
return $this->tagDecorator;
}

/**
Expand All @@ -278,7 +273,7 @@ public function getTagDecorator()
*/
public function setDecoratorPluginManager(Cloud\DecoratorPluginManager $decorators)
{
$this->_decorators = $decorators;
$this->decorators = $decorators;
return $this;
}

Expand All @@ -289,11 +284,11 @@ public function setDecoratorPluginManager(Cloud\DecoratorPluginManager $decorato
*/
public function getDecoratorPluginManager()
{
if ($this->_decorators === null) {
$this->_decorators = new Cloud\DecoratorPluginManager();
if ($this->decorators === null) {
$this->decorators = new Cloud\DecoratorPluginManager();
}

return $this->_decorators;
return $this->decorators;
}

/**
Expand Down

0 comments on commit 67d62a9

Please sign in to comment.