Commit 6b4072cd authored by Ad Schellevis's avatar Ad Schellevis

(mvc/style) fix missing php doc strings

parent a1a73283
......@@ -120,6 +120,7 @@ class ControllerBase extends ControllerRoot
}
/**
* parse an xml type form
* @param $formname
* @return array
* @throws \Exception
......
......@@ -35,6 +35,9 @@ namespace OPNsense\Base;
class IndexController extends ControllerBase
{
/**
* default index action
*/
public function indexAction()
{
}
......
......@@ -34,6 +34,10 @@ namespace OPNsense\Cron;
*/
class IndexController extends \OPNsense\Base\IndexController
{
/**
* cron index page
* @throws \Exception
*/
public function indexAction()
{
$this->view->title = "Cron settings";
......
......@@ -34,6 +34,11 @@ namespace OPNsense\Cron;
*/
class ItemController extends \OPNsense\Base\IndexController
{
/**
* open cron form with selected item
* @param null $uuid cron item to open
* @throws \Exception
*/
public function openAction($uuid = null)
{
$this->view->title = "Cron settings";
......
......@@ -41,6 +41,9 @@ use \OPNsense\Core\Config;
*/
class SettingsController extends ApiControllerBase
{
/**
* @var null|IDS IDS model to share across some methods (see getModel)
*/
private $idsModel = null;
/**
......
......@@ -34,6 +34,10 @@ namespace OPNsense\IDS;
*/
class IndexController extends \OPNsense\Base\IndexController
{
/**
* default ids index page
* @throws \Exception
*/
public function indexAction()
{
$this->view->title = "Intrusion Detection";
......
......@@ -57,7 +57,7 @@ class SettingsController extends ApiControllerBase
/**
*
* update proxy configuration fields
* @return array
* @throws \Phalcon\Validation\Exception
*/
......@@ -151,6 +151,12 @@ class SettingsController extends ApiControllerBase
}
/**
* update remote blacklist item
* @param string $uuid
* @return array result status
* @throws \Phalcon\Validation\Exception
*/
public function setRemoteBlacklistAction($uuid)
{
if ($this->request->isPost() && $this->request->hasPost("blacklist")) {
......
......@@ -34,6 +34,10 @@ namespace OPNsense\Proxy;
*/
class IndexController extends \OPNsense\Base\IndexController
{
/**
* proxy index page
* @throws \Exception
*/
public function indexAction()
{
$this->view->title = "Proxy Server";
......
......@@ -34,6 +34,10 @@ namespace OPNsense\TrafficShaper;
*/
class IndexController extends \OPNsense\Base\IndexController
{
/**
* traffic shaper index
* @throws \Exception
*/
public function indexAction()
{
$this->view->title = "Traffic Shaper";
......
......@@ -51,6 +51,9 @@ class Drive
*/
private $cred = null;
/**
* construct a new Drive object
*/
public function __construct()
{
// hook in Google's autoloader
......@@ -95,6 +98,7 @@ class Drive
/**
* download a file by given GDrive file handle
* @param $fileHandle (object from listFiles)
* @return null|string
*/
......
......@@ -41,7 +41,7 @@ class LDAP
private $ldapVersion = 3 ;
/**
* @var null
* @var null base ldap search DN
*/
private $baseSearchDN = null;
......@@ -113,6 +113,7 @@ class LDAP
}
/**
* construct a new LDAP connector
* @param null $baseSearchDN setup base searchDN or list of DN's separated by ;
* @param int $ldapVersion setup ldap version
*/
......@@ -134,6 +135,7 @@ class LDAP
}
/**
* initiate a connection.
* @param $bind_url string url to use
* @param null $userdn connect dn to use, leave empty for anonymous
* @param null $password password
......
......@@ -36,6 +36,11 @@ use \Phalcon\Filter;
*/
class QueryFilter
{
/**
* sanitize query string
* @param $value sanitize input
* @return mixed sanitize output
*/
public function filter($value)
{
return preg_replace("/[^0-9,a-z,A-Z, ,*,\-,.,\#]/", "", $value);
......
......@@ -41,6 +41,7 @@ class UIModelGrid
private $DataField = null;
/**
* construct a new UIModelGrid
* @param FieldTypes\ArrayField $DataField
*/
public function __construct($DataField)
......
......@@ -125,6 +125,7 @@ class Backend
}
/**
* check configd socket for last restart, return 0 socket not present.
* @return int last restart timestamp
*/
public function getLastRestart()
......
......@@ -57,6 +57,7 @@ class Config extends Singleton
/**
* return last known status of this configuration (valid or not)
* @return bool return (last known) status of this configuration
*/
public function isValid()
......@@ -213,6 +214,7 @@ class Config extends Singleton
}
/**
* check if there's a valid config loaded, throws an error if config isn't valid.
* @throws ConfigException
*/
private function checkvalid()
......
......@@ -36,10 +36,11 @@ use Phalcon\Logger\Adapter\Syslog;
/**
* Class BaseModel implements base model to bind config and definition to object.
* Derive from this class to create usable models.
* Every model definition should include a class (derived from this) and a xml model to define the data (model.xml)
* Derive from BaseModel to create usable models.
* Every model definition should include a class (derived from BaseModel) and a xml model to define the data (model.xml)
*
* See the Sample model for a full implementation.
* See the HelloWorld model for a full implementation.
* (https://github.com/opnsense/plugins/tree/master/devel/helloworld/src/opnsense/mvc/app/models/OPNsense/HelloWorld)
*
* @package OPNsense\Base
*/
......
......@@ -113,6 +113,7 @@ class ArrayField extends BaseField
}
/**
* retrieve field validators for this field type
* @param string|array $fieldNames sort by fieldname
* @param bool $descending sort descending
* @return array
......
......@@ -116,6 +116,7 @@ class AutoNumberField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -101,6 +101,7 @@ abstract class BaseField
protected $internalAttributes = array();
/**
* generate a new UUID v4 number
* @return string uuid v4 number
*/
public function generateUUID()
......@@ -140,6 +141,7 @@ abstract class BaseField
}
/**
* check if this is a container type without data
* @return bool returns if this a container type object (no data)
*/
public function isContainer()
......@@ -251,6 +253,7 @@ abstract class BaseField
}
/**
* return string interpretation of this field
* @return null|string string interpretation of this field
*/
public function __toString()
......@@ -303,6 +306,7 @@ abstract class BaseField
}
/**
* retrieve field attributes
* @return array Field attributes
*/
public function getAttributes()
......@@ -311,6 +315,7 @@ abstract class BaseField
}
/**
* get this nodes children
* @return array child items
*/
public function getChildren()
......@@ -319,6 +324,7 @@ abstract class BaseField
}
/**
* return field validators for this field
* @return array returns validators for this field type (empty if none)
*/
public function getValidators()
......@@ -336,6 +342,8 @@ abstract class BaseField
}
/**
* returns if this node is virtual, the framework uses this to determine if this node maybe should only be used to
* clone children. (using ArrayFields)
* @return bool is virtual node
*/
public function getInternalIsVirtual()
......
......@@ -43,6 +43,7 @@ class BooleanField extends BaseField
/**
* retrieve field validators for this field type
* @return array returns validators
*/
public function getValidators()
......
......@@ -121,6 +121,7 @@ class CSVListField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns regex validator
*/
public function getValidators()
......
......@@ -49,7 +49,7 @@ class ConfigdActionsField extends BaseField
private static $internalOptionList = array();
/**
* @var array
* @var array filters to use on the configd selection
*/
private $internalFilters = array();
......@@ -146,6 +146,7 @@ class ConfigdActionsField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -43,6 +43,7 @@ class EmailField extends BaseField
protected $internalIsContainer = false;
/**
* retrieve field validators for this field type
* @return array returns Email validator
*/
public function getValidators()
......
......@@ -89,6 +89,7 @@ class IntegerField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -51,7 +51,7 @@ class InterfaceField extends BaseField
private static $internalOptionList = array();
/**
* @var array
* @var array filters to use on the interface list
*/
private $internalFilters = array();
......@@ -159,6 +159,7 @@ class InterfaceField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -125,6 +125,7 @@ class ModelRelationField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -52,6 +52,7 @@ class NetworkField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -43,7 +43,7 @@ class OptionField extends BaseField
protected $internalIsContainer = false;
/**
* @var array
* @var array valid options for this list
*/
private $internalOptionList = array();
......@@ -89,6 +89,7 @@ class OptionField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns InclusionIn validator
*/
public function getValidators()
......
......@@ -42,6 +42,9 @@ class PortField extends BaseField
*/
protected $internalIsContainer = false;
/**
* @var array list of well known services
*/
private static $wellknownservices = array(
'cvsup',
'domain',
......@@ -119,6 +122,7 @@ class PortField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns InclusionIn validator
*/
public function getValidators()
......
......@@ -57,6 +57,7 @@ class TextField extends BaseField
}
/**
* retrieve field validators for this field type
* @return array returns Text/regex validator
*/
public function getValidators()
......
......@@ -43,6 +43,7 @@ class UrlField extends BaseField
protected $internalIsContainer = false;
/**
* retrieve field validators for this field type
* @return array returns Url validator
*/
public function getValidators()
......
......@@ -28,6 +28,10 @@
*/
namespace OPNsense\Base\Menu;
/**
* Class MenuInitException
* @package OPNsense\Base\Menu
*/
class MenuInitException extends \Exception
{
}
......@@ -220,6 +220,7 @@ class MenuItem
}
/**
* check if this item is selected
* @return bool is this item selected
*/
public function getSelected()
......
......@@ -28,8 +28,15 @@
*/
namespace OPNsense\Base\Menu;
/**
* Class MenuSystem
* @package OPNsense\Base\Menu
*/
class MenuSystem
{
/**
* @var null|MenuItem root node
*/
private $root = null ;
/**
......
......@@ -33,6 +33,10 @@ use \Phalcon\Validation\Validator;
use \Phalcon\Validation\ValidatorInterface;
use \Phalcon\Validation\Message;
/**
* Class IntegerValidator
* @package OPNsense\Base\Validators
*/
class IntegerValidator extends Validator implements ValidatorInterface
{
......
......@@ -33,6 +33,10 @@ use \Phalcon\Validation\Validator;
use \Phalcon\Validation\ValidatorInterface;
use \Phalcon\Validation\Message;
/**
* Class MinMaxValidator
* @package OPNsense\Base\Validators
*/
class MinMaxValidator extends Validator implements ValidatorInterface
{
/**
......
......@@ -30,6 +30,10 @@ namespace OPNsense\Cron;
use OPNsense\Base\BaseModel;
/**
* Class Cron
* @package OPNsense\Cron
*/
class Cron extends BaseModel
{
/**
......
......@@ -30,6 +30,10 @@ namespace OPNsense\IDS;
use OPNsense\Base\BaseModel;
/**
* Class IDS
* @package OPNsense\IDS
*/
class IDS extends BaseModel
{
/**
......
......@@ -30,6 +30,10 @@ namespace OPNsense\Proxy;
use OPNsense\Base\BaseModel;
/**
* Class Proxy
* @package OPNsense\Proxy
*/
class Proxy extends BaseModel
{
}
......@@ -30,6 +30,10 @@ namespace OPNsense\TrafficShaper;
use OPNsense\Base\BaseModel;
/**
* Class TrafficShaper
* @package OPNsense\TrafficShaper
*/
class TrafficShaper extends BaseModel
{
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment