Skip to content

Commit

Permalink
new release
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Feb 11, 2020
1 parent 2c54ac9 commit d1b72a2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
24 changes: 0 additions & 24 deletions config/definitions/twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,39 +27,15 @@
'optimizations' => get('twig.configuration.optimizations'),
],

// A path or an array of paths where to look for templates.
'twig.configuration.loader_paths' => [
string('{app.root}/resources/views'),
],

// When set to true, it automatically set "auto_reload" to true as well (default to false).
'twig.configuration.debug' => false,

// The charset used by the templates (default to UTF-8).
'twig.configuration.charset' => 'UTF-8',

// Whether to ignore invalid variables in templates (default to false).
'twig.configuration.strict_variables' => false,

// Whether to enable auto-escaping (default to html):
// * false: disable auto-escaping
// * html, js: set the autoescaping to one of the supported strategies
// * name: set the autoescaping strategy based on the template name extension
// * PHP callback: a PHP callback that returns an escaping strategy based on the template "name"
'twig.configuration.autoescape' => 'html',

// An absolute path where to store the compiled templates,
// a \Twig\Cache\CacheInterface implementation,
// or false to disable compilation cache (default).
'twig.configuration.cache' => false,

// Whether to reload the template if the original source changed.
// If you don't provide the auto_reload option, it will be
// determined automatically based on the debug value.
'twig.configuration.auto_reload' => null,

// A flag that indicates which optimizations to apply
// (default to -1 which means that all optimizations are enabled;
// set it to 0 to disable).
'twig.configuration.optimizations' => -1,
];
2 changes: 2 additions & 0 deletions src/Exception/InvalidEntityException.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function getEntityViolations() : ConstraintViolationListInterface
* @param ValidatorInterface $validator
*
* @return void
*
* @throws self
*/
public static function assert(object $entity, ValidatorInterface $validator) : void
{
Expand Down
16 changes: 16 additions & 0 deletions src/Exception/ResourceNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,20 @@ public function __construct(string $message = null)
{
parent::__construct($message ?? 'The requested resource was not found');
}

/**
* Throws the exception if the given entity is NULL
*
* @param null|object $entity
*
* @return void
*
* @throws self
*/
public static function assert(?object $entity) : void
{
if (null === $entity) {
throw new self($entity, $violations);
}
}
}
6 changes: 2 additions & 4 deletions src/Middleware/CorsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,9 @@ final class CorsMiddleware implements MiddlewareInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$settings = $this->createSettings(
$analyzer = Analyzer::instance($this->createSettings(
$this->container->get('cors.configuration')
);

$analyzer = Analyzer::instance($settings);
));

if ($this->container->get('cors.debug')) {
$analyzer->setLogger($this->container->get('logger'));
Expand Down

0 comments on commit d1b72a2

Please sign in to comment.