Skip to content

Commit

Permalink
fix minor scruitinzer findings
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Bragg committed Feb 22, 2016
1 parent 4a60c0e commit 28c66b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Exception/UnknownPropertyDefinitionException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

class UnknownPropertyDefinitionException extends Exception
{
public function __construct($property, $message = '', Exception $e = null)
public function __construct($property, $message = '', Exception $previous = null)
{
$message = "Unknown property definition: $property. " . $message;

parent::__construct($message, 0, $e);
parent::__construct($message, 0, $previous);
}
}
4 changes: 3 additions & 1 deletion src/Factory/ValueFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function __construct()
{
$this->mappings = [
'/(?<!:\{)\{date:([^\}:]+):?([^\}]+)?\}(?!:\})/i' => function ($matches) {
$dt = new DateTime($matches[1]);
$dt = new DateTime($matches[1]);
$format = isset($matches[2]) ? $matches[2] : 'c';
return $dt->format($format);
},
Expand All @@ -32,6 +32,8 @@ public function __construct()
public function addMapping($regex, $replace)
{
$this->mappings[$regex] = $replace;

return $this;
}

/**
Expand Down

0 comments on commit 28c66b0

Please sign in to comment.