Skip to content

Commit

Permalink
CS fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
dbellettini committed Feb 10, 2013
1 parent 0d2fed6 commit 4250f9a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/Universibo/Bundle/LegacyBundle/App/AntiVirus/Clamav.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ class Clamav
{
/**
* Command line options
*
* @var type
*
* @var type
*/
private $opts = '';

/**
* Clamav command
*
*
* @var string
*/
private $cmd = '';

/**
* class constructor
*
* @param string $cmd
* @param string $opts
*
* @param string $cmd
* @param string $opts
* @param boolean $enabled
*/
public function __construct($cmd, $opts, $enabled)
Expand All @@ -44,10 +44,10 @@ public function __construct($cmd, $opts, $enabled)
*/
public function checkFile($filename)
{
if(!$this->enabled) {
if (!$this->enabled) {
return false;
}

$filename = escapeshellarg($filename);

$fullCommand = $this->cmd.' '.$this->opts.' '.$filename;
Expand All @@ -56,7 +56,7 @@ public function checkFile($filename)
$returnval = null;

exec ( $fullCommand, $output, $returnval );

return $returnval != 0;
}
}
2 changes: 1 addition & 1 deletion src/Universibo/Bundle/LegacyBundle/Command/FileAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ public function execute()

$fullFileName = $frontcontroller->getAppSetting('filesPath') . $nomeFile;
$antivirus = $this->get('universibo_legacy.antivirus');

if ($antivirus->checkFile($fullFileName)) {
$transaction->rollback();
Error::throwError(_ERROR_DEFAULT, array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Universibo\Bundle\LegacyBundle\Framework\Error;
use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException;
use Universibo\Bundle\CoreBundle\Entity\User;
use Universibo\Bundle\LegacyBundle\App\AntiVirus\AntiVirusFactory;
use Universibo\Bundle\LegacyBundle\App\UniversiboCommand;
use Universibo\Bundle\LegacyBundle\Auth\LegacyRoles;
use Universibo\Bundle\LegacyBundle\Entity\Canale;
Expand Down Expand Up @@ -412,7 +411,7 @@ public function execute()

$fullFileName = $frontcontroller->getAppSetting('filesPath') . $nomeFile;
$antivirus = $this->get('universibo_legacy.antivirus');

if ($antivirus->checkFile($fullFileName)) {
$transaction->rollback();
Error::throwError(_ERROR_DEFAULT, array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function execute()

foreach ($lista_contatti as $contatto) {
$doc = Docente::selectDocenteFromCod($contatto->getCodDoc());
if($doc instanceof Docente) {
if ($doc instanceof Docente) {
$elenco[] = array('nome' => $doc->getNomeDoc(),
'URI' => $router->generate('universibo_legacy_contact_professor', array('cod_doc' => $doc->getCodDoc())),
'stato' => $contatto->getStatoDesc(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public function setConfig($configFile)

$config = new DOMDocument();
$config->load($configFile);

$this->_appSettings($config);
$this->_setCommandClass($config);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<argument type="service" id="universibo_legacy.db.connection.main" />
<argument>true</argument>
</service>

<service id="universibo_legacy.antivirus"
class="Universibo\Bundle\LegacyBundle\App\AntiVirus\Clamav">
<argument>%antivirus_cmd%</argument>
Expand Down

0 comments on commit 4250f9a

Please sign in to comment.