Skip to content

Commit

Permalink
net: PSR12 conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Oct 7, 2019
1 parent 2fd60b4 commit 752a9d8
Show file tree
Hide file tree
Showing 64 changed files with 142 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function startAction()
$networks = escapeshellarg($_POST['networks']);
//~ return 'arpscanner start '.$ifname.' '.$networks;
$backend = new Backend();
$result = json_decode(trim($backend->configdRun('arpscanner start '.$ifname.' '.$networks)), true);
$result = json_decode(trim($backend->configdRun('arpscanner start ' . $ifname . ' ' . $networks)), true);
return $result;
}
return array("message" => "unable to run config action");
Expand All @@ -53,7 +53,7 @@ public function statusAction()
$ifname = escapeshellarg($_POST['interface']);
//~ return 'arpscanner start '.$ifname.' '.$networks;
$backend = new Backend();
$result = json_decode(trim($backend->configdRun('arpscanner status '.$ifname)), true);
$result = json_decode(trim($backend->configdRun('arpscanner status ' . $ifname)), true);
return $result;
}
return array("message" => "this action must be called using the POST method");
Expand All @@ -64,7 +64,7 @@ public function stopAction()
if ($this->request->isPost()) {
$ifname = escapeshellarg($_POST['interface']);
$backend = new Backend();
$bckresult = trim($backend->configdRun("arpscanner stop ".$ifname));
$bckresult = trim($backend->configdRun("arpscanner stop " . $ifname));
if ($bckresult !== null) {
// only return valid json type responses
return $bckresult;
Expand All @@ -79,7 +79,7 @@ public function checkAction()
$ifname = escapeshellarg($_POST['interface']);
// test: "configctl arpscanner check em0"
$backend = new Backend();
$bckresult = json_decode(trim($backend->configdRun("arpscanner check ".$ifname)), true);
$bckresult = json_decode(trim($backend->configdRun("arpscanner check " . $ifname)), true);
if ($bckresult !== null) {
// only return valid json type responses
return $bckresult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getAction()
foreach ($ifnames as &$arr) {
$ifname = $arr[0];
$result['arpscanner']['general']['interface'][$ifname] = array();
$result['arpscanner']['general']['interface'][$ifname]['value'] = join(", ", array($ifname, " (".$arr[2].")"));
$result['arpscanner']['general']['interface'][$ifname]['value'] = join(", ", array($ifname, " (" . $arr[2] . ")"));
}
}
// $result['arpscanner']['general']['networks'] = '192.168.1.0/24,172.16.45.0/25';
Expand All @@ -73,7 +73,7 @@ public function getAction()
*/
public function setAction()
{
$result = array("result"=>"failed");
$result = array("result" => "failed");
if ($this->request->isPost()) {
// load model and update with provided data
$mdl = new ARPscanner();
Expand All @@ -85,7 +85,7 @@ public function setAction()
if (!array_key_exists("validations", $result)) {
$result["validations"] = array();
}
$result["validations"]["general.".$msg->getField()] = $msg->getMessage();
$result["validations"]["general." . $msg->getField()] = $msg->getMessage();
}

// serialize model to config and save
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ARPscanner extends BaseModel
{
public function test()
{
$command="/sbin/ifconfig -l -u";
$command = "/sbin/ifconfig -l -u";
exec($command, $output);
return $output;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down Expand Up @@ -52,7 +53,7 @@ public function getAction()

public function setAction()
{
$result = array("result"=>"failed");
$result = array("result" => "failed");
if ($this->request->isPost()) {
// load model and update with provided data
$mdlClient = new Client();
Expand All @@ -63,7 +64,7 @@ public function setAction()
if (!array_key_exists("validations", $result)) {
$result["validations"] = array();
}
$result["validations"]["client.".$msg->getField()] = $msg->getMessage();
$result["validations"]["client." . $msg->getField()] = $msg->getMessage();
}
// serialize model to config and save
if ($valMsgs->count() == 0) {
Expand Down Expand Up @@ -179,7 +180,7 @@ public function toggle_handler($uuid, $elements, $element)
if ($this->request->isPost()) {
$mdlSetting = $this->getModel();
if ($uuid != null) {
$node = $mdlSetting->getNodeByReference($elements . '.'. $element .'.' . $uuid);
$node = $mdlSetting->getNodeByReference($elements . '.' . $element . '.' . $uuid);
if ($node != null) {
if ($node->enabled->__toString() == "1") {
$result['result'] = "Disabled";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2019 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down Expand Up @@ -49,7 +50,7 @@ public function getAction()

public function setAction()
{
$result = array("result"=>"failed");
$result = array("result" => "failed");
if ($this->request->isPost()) {
// load model and update with provided data
$mdlEAP = new EAP();
Expand All @@ -61,7 +62,7 @@ public function setAction()
if (!array_key_exists("validations", $result)) {
$result["validations"] = array();
}
$result["validations"]["eap.".$msg->getField()] = $msg->getMessage();
$result["validations"]["eap." . $msg->getField()] = $msg->getMessage();
}

// serialize model to config and save
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down Expand Up @@ -49,7 +50,7 @@ public function getAction()

public function setAction()
{
$result = array("result"=>"failed");
$result = array("result" => "failed");
if ($this->request->isPost()) {
// load model and update with provided data
$mdlGeneral = new General();
Expand All @@ -61,7 +62,7 @@ public function setAction()
if (!array_key_exists("validations", $result)) {
$result["validations"] = array();
}
$result["validations"]["general.".$msg->getField()] = $msg->getMessage();
$result["validations"]["general." . $msg->getField()] = $msg->getMessage();
}

// serialize model to config and save
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2019 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down Expand Up @@ -53,7 +54,7 @@ public function getAction()

public function setAction()
{
$result = array("result"=>"failed");
$result = array("result" => "failed");
if ($this->request->isPost()) {
// load model and update with provided data
$mdlUser = new User();
Expand All @@ -64,7 +65,7 @@ public function setAction()
if (!array_key_exists("validations", $result)) {
$result["validations"] = array();
}
$result["validations"]["user.".$msg->getField()] = $msg->getMessage();
$result["validations"]["user." . $msg->getField()] = $msg->getMessage();
}
// serialize model to config and save
if ($valMsgs->count() == 0) {
Expand Down Expand Up @@ -180,7 +181,7 @@ public function toggle_handler($uuid, $elements, $element)
if ($this->request->isPost()) {
$mdlSetting = $this->getModel();
if ($uuid != null) {
$node = $mdlSetting->getNodeByReference($elements . '.'. $element .'.' . $uuid);
$node = $mdlSetting->getNodeByReference($elements . '.' . $element . '.' . $uuid);
if ($node != null) {
if ($node->enabled->__toString() == "1") {
$result['result'] = "Disabled";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Freeradius;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Fabian Franz
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2017 Frank Wall
* Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Fabian Franz
Expand Down Expand Up @@ -48,7 +49,7 @@ public function getAction()
}
public function setAction()
{
$result = array("result"=>"failed");
$result = array("result" => "failed");
if ($this->request->isPost()) {
// load model and update with provided data
$mdlGeneral = new General();
Expand All @@ -60,7 +61,7 @@ public function setAction()
if (!array_key_exists("validations", $result)) {
$result["validations"] = array();
}
$result["validations"]["general.".$msg->getField()] = $msg->getMessage();
$result["validations"]["general." . $msg->getField()] = $msg->getMessage();
}

// serialize model to config and save
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2017 Fabian Franz
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2015 - 2017 Deciso B.V.
* Copyright (C) 2017 Fabian Franz
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Quagga;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Quagga;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Quagga;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
Copyright (C) 2017 Fabian Franz
Copyright (C) 2017 Michael Muenz <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace OPNsense\Quagga;

use OPNsense\Base\BaseModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2016 Frank Wall
* Copyright (C) 2015 Deciso B.V.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2016 Frank Wall
* Copyright (C) 2015 Deciso B.V.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2016 Frank Wall
* Copyright (C) 2015 Deciso B.V.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2016 Frank Wall
* Copyright (C) 2015 Deciso B.V.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Copyright (C) 2016-2017 Frank Wall
* Copyright (C) 2015 Deciso B.V.
Expand Down
Loading

0 comments on commit 752a9d8

Please sign in to comment.