[SearchEngine] CS cleanup

This commit is contained in:
Romain Neutron
2012-10-05 00:18:46 +02:00
parent 38f7c4a995
commit 746b51b747
5 changed files with 12 additions and 16 deletions

View File

@@ -7,7 +7,6 @@ use Symfony\Component\HttpFoundation\Request;
interface ConfigurationPanelInterface
{
public function get(Application $app, Request $request);
public function post(Application $app, Request $request);

View File

@@ -2,8 +2,8 @@
namespace Alchemy\Phrasea\SearchEngine\Phrasea;
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\SearchEngine\ConfigurationPanelInterface;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
class ConfigurationPanel implements ConfigurationPanelInterface
@@ -18,7 +18,6 @@ class ConfigurationPanel implements ConfigurationPanelInterface
public function get(Application $app, Request $request)
{
return $app['twig']->render('admin/search-engine/phrasea.html.twig', array());
}
@@ -26,5 +25,4 @@ class ConfigurationPanel implements ConfigurationPanelInterface
{
}
}

View File

@@ -16,8 +16,6 @@ use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
use Alchemy\Phrasea\SearchEngine\SearchEngineResult;
use Alchemy\Phrasea\Exception\RuntimeException;
use Doctrine\Common\Collections\ArrayCollection;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
class PhraseaEngine implements SearchEngineInterface
{

View File

@@ -15,8 +15,6 @@ use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
use Alchemy\Phrasea\SearchEngine\SearchEngineResult;
use Alchemy\Phrasea\Exception\RuntimeException;
use Doctrine\Common\Collections\ArrayCollection;
use Silex\Application;
use Symfony\Component\HttpFoundation\Request;
interface SearchEngineInterface
{

View File

@@ -285,17 +285,20 @@ class SearchEngineOptions implements \Serializable
{
$tmp = array();
foreach ($status as $n => $options) {
if (count($options) > 1)
if (count($options) > 1) {
continue;
}
if (isset($options['on'])) {
foreach ($options['on'] as $sbas_id)
foreach ($options['on'] as $sbas_id) {
$tmp[$n][$sbas_id] = 1;
}
}
if (isset($options['off'])) {
foreach ($options['off'] as $sbas_id)
foreach ($options['off'] as $sbas_id) {
$tmp[$n][$sbas_id] = 0;
}
}
}
$this->status = $tmp;
@@ -383,7 +386,7 @@ class SearchEngineOptions implements \Serializable
public function setMaxDate($max_date)
{
if (!is_null($max_date) && trim($max_date) !== '') {
$this->date_max = DateTime::createFromFormat('Y/m/d H:i:s', $max_date . ' 23:59:59');
$this->date_max = \DateTime::createFromFormat('Y/m/d H:i:s', $max_date . ' 23:59:59');
}
return $this;
@@ -427,7 +430,7 @@ class SearchEngineOptions implements \Serializable
{
$ret = array();
foreach ($this as $key => $value) {
if ($value instanceof DateTime) {
if ($value instanceof \DateTime) {
$value = $value->format('d-m-Y h:i:s');
}
if (in_array($key, array('collections', 'business_fields'))) {