Skip to content

Commit

Permalink
Fix apply and CS
Browse files Browse the repository at this point in the history
  • Loading branch information
beberlei committed Jul 21, 2012
1 parent 94fd1bb commit 64a0a69
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Request/ParamConverter/DateTimeParamConverter.php
@@ -1,11 +1,5 @@
<?php

namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
use Symfony\Component\HttpFoundation\Request;
use DateTime;

/*
* This file is part of the Symfony framework.
*
Expand All @@ -15,6 +9,12 @@
* with this source code in the file LICENSE.
*/

namespace Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\ConfigurationInterface;
use Symfony\Component\HttpFoundation\Request;
use DateTime;

/**
* Convert DateTime instances from request variables.
*
Expand All @@ -26,8 +26,8 @@ public function apply(Request $request, ConfigurationInterface $configuration)
{
$param = $configuration->getName();

if ( ! $request->get($param)) {
return;
if (!$request->get($param)) {
return false;
}

$options = $configuration->getOptions();
Expand All @@ -39,6 +39,8 @@ public function apply(Request $request, ConfigurationInterface $configuration)
}

$request->attributes->set($param, $date);

return true;
}

public function supports(ConfigurationInterface $configuration)
Expand Down

0 comments on commit 64a0a69

Please sign in to comment.