for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Bavix\Cases;
/**
* Class Params
* @package Bavix\Cases
*/
class Params
{
* @var array
protected $annotations;
* Params constructor.
* @param array $annotations
public function __construct(array $annotations)
$this->annotations = $annotations;
}
* @param string $name
* @param array $default
* @return array
protected function getAttribute(string $name, array $default = []): array
return $this->annotations['method'][$name] ?? $default;
* @param int $default
* @return int
protected function getInt(string $name, int $default = 0): int
return \current($this->getAttribute($name, [$default]));
* @param string $default
* @return string
protected function getString(string $name, string $default): string
public function getWidth(): int
return $this->getInt('width', 1024);
public function getHeight(): int
return $this->getInt('height', 768);
public function getPath(): string
return $this->getString('path', '/');
public function getBrowser(): string
return $this->getString('browser', $_ENV['BROWSER']);