Skip to content

Commit

Permalink
IHasInfo is deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Mar 29, 2018
1 parent f8bd090 commit 566032b
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CHANGELOG

5.1.0.pre
----------------
* IHasInfo is deprecated
* Fixed create new dir
* ClusterLocal update set publicBaseUrl and rootBasePath
* Removed skeeks\cms\Exception
Expand Down
28 changes: 28 additions & 0 deletions src/IHasIcon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/

namespace skeeks\cms;

/**
* @property string $icon;
*
* @author Semenov Alexander <semenov@skeeks.com>
*/
interface IHasIcon
{
/**
* @return string
*/
public function getIcon();

/**
* @param string $icon
* @return mixed
*/
public function setIcon($icon);
}
28 changes: 28 additions & 0 deletions src/IHasImage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/

namespace skeeks\cms;

/**
* @property string $image;
*
* @author Semenov Alexander <semenov@skeeks.com>
*/
interface IHasImage
{
/**
* @return string
*/
public function getImage();

/**
* @param string $image
* @return mixed
*/
public function setImage($image);
}
7 changes: 2 additions & 5 deletions src/IHasInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
namespace skeeks\cms;

/**
* @property string $name;
* @property string $icon;
* @property string $image;
* @deprecated
*
* Interface IHasInfo
* @package skeeks\cms
* @author Semenov Alexander <semenov@skeeks.com>
*/
interface IHasInfo
{
Expand Down
28 changes: 28 additions & 0 deletions src/IHasName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/

namespace skeeks\cms;

/**
* @property string $name;
*
* @author Semenov Alexander <semenov@skeeks.com>
*/
interface IHasName
{
/**
* @return string
*/
public function getName();

/**
* @param string|array $name
* @return mixed
*/
public function setName($name);
}
40 changes: 40 additions & 0 deletions src/traits/THasIcon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/

namespace skeeks\cms\traits;

/**
* @property $icon;
*
* @author Semenov Alexander <semenov@skeeks.com>
*/
trait THasIcon
{
/**
* @var string
*/
protected $_icon = '';

/**
* @return string
*/
public function getIcon()
{
return $this->_icon;
}

/**
* @param $icon
* @return $this
*/
public function setIcon($icon)
{
$this->_icon = $icon;
return $this;
}
}
40 changes: 40 additions & 0 deletions src/traits/THasImage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/

namespace skeeks\cms\traits;

/**
* @property $image;
*
* @author Semenov Alexander <semenov@skeeks.com>
*/
trait THasImage
{
/**
* @var string
*/
protected $_image = '';

/**
* @return string
*/
public function getImage()
{
return $this->_image;
}

/**
* @param $image
* @return $this
*/
public function setImage($image)
{
$this->_image = $image;
return $this;
}
}
5 changes: 2 additions & 3 deletions src/traits/THasInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
use yii\helpers\ArrayHelper;

/**
* @deprecated
*
* @property $name;
* @property $icon;
* @property $image;
*
* Class THasInfo
* @package skeeks\cms\traits
*/
trait THasInfo
{
Expand Down
52 changes: 52 additions & 0 deletions src/traits/THasName.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
/**
* @link https://cms.skeeks.com/
* @copyright Copyright (c) 2010 SkeekS
* @license https://cms.skeeks.com/license/
* @author Semenov Alexander <semenov@skeeks.com>
*/

namespace skeeks\cms\traits;

use yii\helpers\ArrayHelper;

/**
* @property $name;
*
* @author Semenov Alexander <semenov@skeeks.com>
*/
trait THasName
{
/**
* @var string
*/
protected $_name = '';

/**
* @return string
*/
public function getName()
{
return $this->_name;
}

/**
* @param string|array $name
* @return $this
*/
public function setName($name)
{
if (is_array($name)) {
$this->_name = \Yii::t(
ArrayHelper::getValue($name, 0),
ArrayHelper::getValue($name, 1, ''),
ArrayHelper::getValue($name, 2, []),
ArrayHelper::getValue($name, 3)
);
} else if (is_string($name)) {
$this->_name = $name;
}

return $this;
}
}

0 comments on commit 566032b

Please sign in to comment.