for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
/**
* Created by Vitaly Iegorov <[email protected]>.
* on 04.09.16 at 12:03
*/
namespace samsonphp\generator;
* Class VisibilityTrait
*
* @author Vitaly Egorov <[email protected]>
trait VisibilityTrait
{
/** @var string Method visibility */
protected $visibility = ClassGenerator::VISIBILITY_PUBLIC;
/** @var bool Flag that method is static */
protected $isStatic = false;
* Set method to be static.
* @return $this
public function defStatic()
$this->isStatic = true;
return $this;
}
* Set protected property visibility.
public function defProtected()
return $this->defVisibility(ClassGenerator::VISIBILITY_PROTECTED);
* Set property visibility.
* @param string $visibility Property visibility
protected function defVisibility(string $visibility)
$this->visibility = $visibility;
* Set private property visibility.
public function defPrivate()
return $this->defVisibility(ClassGenerator::VISIBILITY_PRIVATE);