for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sensorario\Resources;
use \RuntimeException;
final class ArrayResources
{
private $resources;
public function __construct(array $resources)
if (!isset($resources['resources'])) {
throw new RuntimeException(
''
);
}
foreach ($resources['resources'] as $item) {
if (isset($item['constraints'])) {
foreach ($item['constraints'] as $name => $value) {
if (!in_array($name, [])) {
'Invalid constraint'
$this->resources = $resources;
public function countResources()
return count(
$this->resources['resources']