for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Iatstuti\SimpleMenu\Traits;
/**
* Trait to handle retrieving all or a specific option.
*
* @package Iatstuti\SimpleMenu
* @copyright 2016 IATSTUTI
* @author Michael Dyrynda <[email protected]>
*/
trait ObjectOptions
{
* Return this menu's options, or a single option as specified.
* @param string|null $key
* @return array
public function options($key = null)
if (! is_null($key) && array_key_exists($key, $this->options)) {
return $this->options[$key];
}
return $this->options;