for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TreeHouse\Feeder\Transport;
class Connection implements \ArrayAccess
{
/**
* @var array
*/
protected $options;
* @param array $options
public function __construct(array $options)
$this->options = $options;
}
* @inheritdoc
public function offsetSet($offset, $value)
if (is_null($offset)) {
$this->options[] = $value;
} else {
$this->options[$offset] = $value;
public function offsetExists($offset)
return isset($this->options[$offset]);
public function offsetUnset($offset)
unset($this->options[$offset]);
public function offsetGet($offset)
return isset($this->options[$offset]) ? $this->options[$offset] : null;
* @return array
public function toArray()
return $this->options;
* @return string
public function getHash()
return md5(json_encode($this->options));
public function __toString()
foreach (['name', 'url', 'file'] as $attempt) {
if (array_key_exists($attempt, $this->options)) {
return $this->options[$attempt];
return json_encode($this);