for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of sensorario/resources repository
*
* (c) Simone Gentili <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sensorario\Resources;
use RuntimeException;
use Sensorario\Resources\Validators\ResourcesValidator;
class Resource
extends MagicResource
implements Interfaces\ResourceInterface
{
protected $allowed = [];
protected $allowedValues = [];
protected $mandatory = [];
protected $defaults = [];
protected $rules = [];
public function mandatory()
return $this->mandatory;
}
public function allowed()
return $this->allowed;
public function allowedValues()
return $this->allowedValues;
public function rules()
return $this->rules;
public function defaults()
return $this->defaults;
public function applyConfiguration(
Configurator $configurator
) {
$this->allowed = $configurator->allowed();
$this->mandatory = $configurator->mandatory();
$this->defaults = $configurator->defaults();
$this->rules = $configurator->rules();
$this->allowedValues = $configurator->allowedValues();