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 static $allowed = [];
public static function mandatory()
return [];
}
public static function allowed()
return static::$allowed;
public static function allowedValues()
public static function rules()
public function applyConfiguration(
$resourceName,
Container $config
) {
static::$allowed = $config->allowed($resourceName);
public static function fromConfiguration(
Container $container
$resource = new self(
[],
new ResourcesValidator()
);
$resource->applyConfiguration(
$container
return $resource;