This repository has been archived by the owner on Jan 31, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into acceptHandling
Conflicts: library/Zend/Mvc/Controller/RestfulController.php
- Loading branch information
62 parents
e63ad13
+
ebb65de
+
feaeb97
+
6d76c21
+
8080e99
+
3d8fc08
+
376eb68
+
846ff4b
+
a0b34c2
+
40bdf5a
+
e01831f
+
f22306a
+
8248197
+
740d2ca
+
3e4973e
+
1f71371
+
f945a68
+
6737231
+
7554e22
+
f43a14f
+
5680e05
+
8c71fbe
+
7640752
+
17fca5b
+
3e4bdb7
+
a1ec0e4
+
73e93c4
+
954b983
+
5a4d447
+
08d604f
+
a198091
+
3b2d396
+
ed13b76
+
8c1c902
+
66db3c0
+
88e5c45
+
4766aaf
+
af7efc8
+
2c6ae34
+
ea85a56
+
d1750df
+
665f6e2
+
3e28dac
+
edefcee
+
fed5933
+
55c0906
+
067d44c
+
694c574
+
1ea7f1a
+
e705000
+
c4d0f17
+
fb9a1b3
+
9b34c27
+
457dc51
+
bd1a8cd
+
21c6816
+
5b6a369
+
ce9b366
+
61eaaee
+
1c21891
+
1302107
+
b74ab9c
commit 8d7b1b5
Showing
31 changed files
with
291 additions
and
676 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,21 @@ | ||
<?php | ||
/** | ||
* Zend Framework | ||
* Zend Framework (http://framework.zend.com/) | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE.txt. | ||
* It is also available through the world-wide-web at this URL: | ||
* http://framework.zend.com/license/new-bsd | ||
* If you did not receive a copy of the license and are unable to | ||
* obtain it through the world-wide-web, please send an email | ||
* to [email protected] so we can send you a copy immediately. | ||
* | ||
* @category Zend | ||
* @package Zend_Tag | ||
* @subpackage Cloud | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @link http://github.com/zendframework/zf2 for the canonical source repository | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
* @package Zend_Tag | ||
*/ | ||
|
||
namespace Zend\Tag; | ||
|
||
use Traversable; | ||
use Zend\Stdlib\ArrayUtils; | ||
use Zend\Tag\Exception\InvalidArgumentException, | ||
Zend\Loader\Broker; | ||
|
||
/** | ||
* @category Zend | ||
* @package Zend_Tag | ||
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) | ||
* @license http://framework.zend.com/license/new-bsd New BSD License | ||
*/ | ||
class Cloud | ||
{ | ||
|
@@ -51,16 +36,16 @@ class Cloud | |
/** | ||
* List of all tags | ||
* | ||
* @var \Zend\Tag\ItemList | ||
* @var ItemList | ||
*/ | ||
protected $_tags = null; | ||
|
||
/** | ||
* Plugin broker for decorators | ||
* Plugin manager for decorators | ||
* | ||
* @var \Zend\Loader\Broker | ||
* @var Cloud\DecoratorPluginManager | ||
*/ | ||
protected $_decoratorBroker = null; | ||
protected $_decorators = null; | ||
|
||
/** | ||
* Option keys to skip when calling setOptions() | ||
|
@@ -90,8 +75,8 @@ public function __construct($options = null) | |
/** | ||
* Set options from array | ||
* | ||
* @param array $options Configuration for \Zend\Tag\Cloud | ||
* @return \Zend\Tag\Cloud | ||
* @param array $options Configuration for Cloud | ||
* @return Cloud | ||
*/ | ||
public function setOptions(array $options) | ||
{ | ||
|
@@ -124,53 +109,51 @@ public function setOptions(array $options) | |
* decorators. | ||
* | ||
* @param array $tags | ||
* @throws \Zend\Tag\Exception\InvalidArgumentException | ||
* @return \Zend\Tag\Cloud | ||
* @throws Exception\InvalidArgumentException | ||
* @return Cloud | ||
*/ | ||
public function setTags(array $tags) | ||
{ | ||
// Validate and cleanup the tags | ||
$itemList = $this->getItemList(); | ||
|
||
foreach ($tags as $tag) { | ||
if ($tag instanceof TaggableInterface) { | ||
$itemList[] = $tag; | ||
} else if (is_array($tag)) { | ||
$itemList[] = new Item($tag); | ||
} else { | ||
throw new InvalidArgumentException('Tag must be an instance of Zend\Tag\TaggableInterface or an array'); | ||
} | ||
$this->appendTag($tag); | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Append a single tag to the cloud | ||
* | ||
* @param \Zend\Tag\TaggableInterface|array $tag | ||
* @throws \Zend\Tag\Exception\InvalidArgumentException | ||
* @return \Zend\Tag\Cloud | ||
* @param TaggableInterface|array $tag | ||
* @throws Exception\InvalidArgumentException | ||
* @return Cloud | ||
*/ | ||
public function appendTag($tag) | ||
{ | ||
$tags = $this->getItemList(); | ||
|
||
if ($tag instanceof TaggableInterface) { | ||
$tags[] = $tag; | ||
} else if (is_array($tag)) { | ||
$tags[] = new Item($tag); | ||
} else { | ||
throw new InvalidArgumentException('Tag must be an instance of Zend\Tag\TaggableInterface or an array'); | ||
return $this; | ||
} | ||
|
||
if (!is_array($tag)) { | ||
throw new Exception\InvalidArgumentException(sprintf( | ||
'Tag must be an instance of %s\TaggableInterface or an array; received "%s"', | ||
__NAMESPACE__, | ||
(is_object($tag) ? get_class($tag) : gettype($tag)) | ||
)); | ||
} | ||
|
||
$tags[] = new Item($tag); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Set the item list | ||
* | ||
* @param \Zend\Tag\ItemList $itemList | ||
* @return \Zend\Tag\Cloud | ||
* @param ItemList $itemList | ||
* @return Cloud | ||
*/ | ||
public function setItemList(ItemList $itemList) | ||
{ | ||
|
@@ -183,7 +166,7 @@ public function setItemList(ItemList $itemList) | |
* | ||
* If item list is undefined, creates one. | ||
* | ||
* @return \Zend\Tag\ItemList | ||
* @return ItemList | ||
*/ | ||
public function getItemList() | ||
{ | ||
|
@@ -197,8 +180,8 @@ public function getItemList() | |
* Set the decorator for the cloud | ||
* | ||
* @param mixed $decorator | ||
* @throws \Zend\Tag\Exception\InvalidArgumentException | ||
* @return \Zend\Tag\Cloud | ||
* @throws Exception\InvalidArgumentException | ||
* @return Cloud | ||
*/ | ||
public function setCloudDecorator($decorator) | ||
{ | ||
|
@@ -215,11 +198,11 @@ public function setCloudDecorator($decorator) | |
} | ||
|
||
if (is_string($decorator)) { | ||
$decorator = $this->getDecoratorBroker()->load($decorator, $options); | ||
$decorator = $this->getDecoratorPluginManager()->get($decorator, $options); | ||
} | ||
|
||
if (!($decorator instanceof Cloud\Decorator\Cloud)) { | ||
throw new InvalidArgumentException('DecoratorInterface is no instance of Zend\Tag\Cloud\Decorator\Cloud'); | ||
if (!($decorator instanceof Cloud\Decorator\AbstractCloud)) { | ||
throw new Exception\InvalidArgumentException('DecoratorInterface is no instance of Cloud\Decorator\AbstractCloud'); | ||
} | ||
|
||
$this->_cloudDecorator = $decorator; | ||
|
@@ -244,8 +227,8 @@ public function getCloudDecorator() | |
* Set the decorator for the tags | ||
* | ||
* @param mixed $decorator | ||
* @throws \Zend\Tag\Exception\InvalidArgumentException | ||
* @return \Zend\Tag\Cloud | ||
* @throws Exception\InvalidArgumentException | ||
* @return Cloud | ||
*/ | ||
public function setTagDecorator($decorator) | ||
{ | ||
|
@@ -262,11 +245,11 @@ public function setTagDecorator($decorator) | |
} | ||
|
||
if (is_string($decorator)) { | ||
$decorator = $this->getDecoratorBroker()->load($decorator, $options); | ||
$decorator = $this->getDecoratorPluginManager()->get($decorator, $options); | ||
} | ||
|
||
if (!($decorator instanceof Cloud\Decorator\Tag)) { | ||
throw new InvalidArgumentException('DecoratorInterface is no instance of Zend\Tag\Cloud\Decorator\Tag'); | ||
if (!($decorator instanceof Cloud\Decorator\AbstractTag)) { | ||
throw new Exception\InvalidArgumentException('DecoratorInterface is no instance of Cloud\Decorator\Tag'); | ||
} | ||
|
||
$this->_tagDecorator = $decorator; | ||
|
@@ -288,29 +271,29 @@ public function getTagDecorator() | |
} | ||
|
||
/** | ||
* Set plugin broker for use with decorators | ||
* Set plugin manager for use with decorators | ||
* | ||
* @param \Zend\Loader\Broker $broker | ||
* @return \Zend\Tag\Cloud | ||
* @param Cloud\DecoratorPluginManager $decorators | ||
* @return Cloud | ||
*/ | ||
public function setDecoratorBroker(Broker $broker) | ||
public function setDecoratorPluginManager(Cloud\DecoratorPluginManager $decorators) | ||
{ | ||
$this->_decoratorBroker = $broker; | ||
$this->_decorators = $decorators; | ||
return $this; | ||
} | ||
|
||
/** | ||
* Get the plugin broker for decorators | ||
* Get the plugin manager for decorators | ||
* | ||
* @return \Zend\Loader\Broker | ||
* @return Cloud\DecoratorPluginManager | ||
*/ | ||
public function getDecoratorBroker() | ||
public function getDecoratorPluginManager() | ||
{ | ||
if ($this->_decoratorBroker === null) { | ||
$this->_decoratorBroker = new Cloud\DecoratorBroker(); | ||
if ($this->_decorators === null) { | ||
$this->_decorators = new Cloud\DecoratorPluginManager(); | ||
} | ||
|
||
return $this->_decoratorBroker; | ||
return $this->_decorators; | ||
} | ||
|
||
/** | ||
|
Oops, something went wrong.