Adjust return type

This commit is contained in:
Dennis Eichhorn 2017-07-24 13:25:14 +02:00 committed by GitHub
parent ff3d253588
commit e4e5ea9f6b

View File

@ -7,6 +7,7 @@
* @category TBD * @category TBD
* @package TBD * @package TBD
* @author OMS Development Team <dev@oms.com> * @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @copyright Dennis Eichhorn * @copyright Dennis Eichhorn
* @license OMS License 1.0 * @license OMS License 1.0
* @version 1.0.0 * @version 1.0.0
@ -24,6 +25,7 @@ use phpOMS\System\File\PathException;
* @category Framework * @category Framework
* @package phpOMS/Views * @package phpOMS/Views
* @author OMS Development Team <dev@oms.com> * @author OMS Development Team <dev@oms.com>
* @author Dennis Eichhorn <d.eichhorn@oms.com>
* @license OMS License 1.0 * @license OMS License 1.0
* @link http://orange-management.com * @link http://orange-management.com
* @since 1.0.0 * @since 1.0.0
@ -51,6 +53,7 @@ abstract class ViewAbstract implements \Serializable
* Constructor. * Constructor.
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function __construct() public function __construct()
{ {
@ -65,6 +68,7 @@ abstract class ViewAbstract implements \Serializable
* @return int * @return int
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
private static function viewSort(array $a, array $b) : int private static function viewSort(array $a, array $b) : int
{ {
@ -81,6 +85,7 @@ abstract class ViewAbstract implements \Serializable
* @return string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getTemplate() : string public function getTemplate() : string
{ {
@ -95,6 +100,7 @@ abstract class ViewAbstract implements \Serializable
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function setTemplate(string $template) /* : void */ public function setTemplate(string $template) /* : void */
{ {
@ -105,6 +111,7 @@ abstract class ViewAbstract implements \Serializable
* @return View[] * @return View[]
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getViews() : array public function getViews() : array
{ {
@ -117,6 +124,7 @@ abstract class ViewAbstract implements \Serializable
* @return false|View * @return false|View
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function getView($id) public function getView($id)
{ {
@ -135,6 +143,7 @@ abstract class ViewAbstract implements \Serializable
* @return bool * @return bool
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function removeView(string $id) : bool public function removeView(string $id) : bool
{ {
@ -157,6 +166,7 @@ abstract class ViewAbstract implements \Serializable
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function editView(string $id, View $view, $order = null) /* : void */ public function editView(string $id, View $view, $order = null) /* : void */
{ {
@ -174,8 +184,9 @@ abstract class ViewAbstract implements \Serializable
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) /* : void */ public function addView(string $id, View $view, int $order = 0, bool $overwrite = true) : bool
{ {
if ($overwrite || !isset($this->views[$id])) { if ($overwrite || !isset($this->views[$id])) {
$this->views[$id] = $view; $this->views[$id] = $view;
@ -183,7 +194,11 @@ abstract class ViewAbstract implements \Serializable
if ($order !== 0) { if ($order !== 0) {
uasort($this->views, ['\phpOMS\Views\View', 'viewSort']); uasort($this->views, ['\phpOMS\Views\View', 'viewSort']);
} }
return true;
} }
return false;
} }
/** /**
@ -192,6 +207,7 @@ abstract class ViewAbstract implements \Serializable
* @return string|array * @return string|array
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function serialize() public function serialize()
{ {
@ -208,6 +224,7 @@ abstract class ViewAbstract implements \Serializable
* @return array * @return array
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function toArray() : array public function toArray() : array
{ {
@ -230,6 +247,7 @@ abstract class ViewAbstract implements \Serializable
* @return string * @return string
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function render(...$data) : string public function render(...$data) : string
{ {
@ -259,6 +277,7 @@ abstract class ViewAbstract implements \Serializable
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
* @author Dennis Eichhorn <d.eichhorn@oms.com>
*/ */
public function unserialize($raw) public function unserialize($raw)
{ {