Skip to content

Instantly share code, notes, and snippets.

@alnutile
Created August 27, 2014 15:06
Show Gist options
  • Save alnutile/a353c80a40ec1aec9e14 to your computer and use it in GitHub Desktop.
Save alnutile/a353c80a40ec1aec9e14 to your computer and use it in GitHub Desktop.
browsers
<?php
/**
* Created by PhpStorm.
* User: alfrednutile
* Date: 8/27/14
* Time: 11:04 AM
*/
namespace BehatEditor;
use BehatEditor\Models\Browser;
trait BrowsersTrait {
protected $browsers;
public function getBrowsers()
{
if($this->browsers == null)
{
$this->setBrowsers();
}
return $this->browsers;
}
public function setBrowsers(array $browsers = array())
{
if($browsers == null)
{
$browsers = new Browser();
return $browsers->all()->toArray();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment