for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Malezha\Menu\Element;
use Illuminate\Container\Container;
use Malezha\Menu\Contracts\DisplayRule;
use Malezha\Menu\Contracts\Element;
use Malezha\Menu\Contracts\MenuRender;
use Serafim\Properties\Properties;
/**
* Class AbstractElement
* @package Malezha\Menu\Element
*/
abstract class AbstractElement implements Element
{
use Properties;
* @var string
protected $view;
* @var MenuRender
protected $render;
* @inheritdoc
public function getView()
return $this->view;
}
public function setView($view)
if ($this->render->exists($view)) {
$this->view = $view;
protected function propertiesForSerialization()
return [
'view' => $this->view,
];
* @inheritDoc
public function toArray()
public function serialize()
return serialize($this->propertiesForSerialization());
public function unserialize($serialized)
$data = unserialize($serialized);
if ($this instanceof DisplayRule
&& method_exists($this, 'unserializeRule')
&& array_key_exists('displayRule', $data)
) {
$this->unserializeRule($data['displayRule']);
unserializeRule()
Malezha\Menu\Element\AbstractElement
serialize()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
unset($data['displayRule']);
foreach ($data as $key => $value) {
if (property_exists($this, $key)) {
$this->{$key} = $value;
$app = Container::getInstance();
$this->render = $app->make(MenuRender::class);
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.