for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Phossa Project
*
* PHP version 5.4
* @category Library
* @package Phossa2\Storage
* @copyright Copyright (c) 2016 phossa.com
* @license http://mit-license.org/ MIT License
* @link http://www.phossa.com/
*/
/*# declare(strict_types=1); */
namespace Phossa2\Storage\Traits;
use Phossa2\Storage\Interfaces\PermissionAwareInterface;
* PermissionAwareTrait
* Implementation of PermissionAwareInterface
* @author Hong Zhang <[email protected]>
* @see PermissionAwareInterface
* @version 2.0.0
* @since 2.0.0 added
trait PermissionAwareTrait
{
* permissions
* @var int
* @access protected
protected $perm = PermissionAwareInterface::PERM_ALL;
* {@inheritDoc}
public function getPermissions()/*# : int */
return $this->perm;
}
public function setPermissions(/*# int */ $permissions)
$this->perm = $permissions;
return $this;
public function isReadable()/*# : bool */
return (bool) ($this->perm & PermissionAwareInterface::PERM_READ);
public function isWritable()/*# : bool */
return (bool) ($this->perm & PermissionAwareInterface::PERM_WRITE);
public function isDeletable()/*# : bool */