Commit 4cf690e0 authored by Franco Fichtner's avatar Franco Fichtner

src: style and whitespace sweep

parent aa34ef3e
...@@ -35,6 +35,8 @@ sweep: ...@@ -35,6 +35,8 @@ sweep:
find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \ find ${.CURDIR}/src ! -name "*.min.*" ! -name "*.svg" \
! -name "*.map" -type f -print0 | \ ! -name "*.map" -type f -print0 | \
xargs -0 -n1 scripts/cleanfile xargs -0 -n1 scripts/cleanfile
find ${.CURDIR}/pkg -type f -print0 | \
xargs -0 -n1 scripts/cleanfile
style: style:
@(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense/mvc \ @(phpcs --tab-width=4 --standard=PSR2 ${.CURDIR}/src/opnsense/mvc \
......
<?php <?php
/** /**
* Copyright (C) 2015 Deciso B.V. * Copyright (C) 2015 Deciso B.V.
* *
...@@ -88,9 +89,11 @@ $di->set('router', function() { ...@@ -88,9 +89,11 @@ $di->set('router', function() {
// //
// probe registered API modules and create a namespace map // probe registered API modules and create a namespace map
// for example, OPNsense\Core\Api will be mapped at http(s):\\host\core\.. // for example, OPNsense\Core\Api will be mapped at http(s):\\host\core\..
// module names should be unique in the application, unless you want to overwrite functionality (check glob's sorting). // module names should be unique in the application, unless you want to
// overwrite functionality (check glob's sorting).
// //
// if the glob for probing the directories turns out to be too slow, we should consider some kind of caching here // if the glob for probing the directories turns out to be too slow,
// we should consider some kind of caching here
// //
$registered_modules = array(); $registered_modules = array();
$controller_dir = __DIR__."/../controllers/"; $controller_dir = __DIR__."/../controllers/";
......
<?php <?php
/** /**
* Copyright (C) 2015 Deciso B.V. * Copyright (C) 2015 Deciso B.V.
* *
...@@ -30,17 +31,15 @@ namespace OPNsense\Base\Validators; ...@@ -30,17 +31,15 @@ namespace OPNsense\Base\Validators;
use \Phalcon\Validation\Validator; use \Phalcon\Validation\Validator;
use \Phalcon\Validation\ValidatorInterface; use \Phalcon\Validation\ValidatorInterface;
use \Phalcon\Validation\Message;; use \Phalcon\Validation\Message;
class IntegerValidator extends Validator implements ValidatorInterface class IntegerValidator extends Validator implements ValidatorInterface
{ {
public function validate($validator, $attribute) public function validate($validator, $attribute)
{ {
$value = $validator->getValue($attribute); $value = $validator->getValue($attribute);
$msg = $this->getOption('message'); $msg = $this->getOption('message');
if (ctype_digit(strval(($value))) == false) { if (ctype_digit(strval(($value))) == false) {
$validator->appendMessage(new Message($msg, $attribute, 'IntegerValidator')); $validator->appendMessage(new Message($msg, $attribute, 'IntegerValidator'));
return false; return false;
......
<?php <?php
/** /**
* Copyright (C) 2015 Deciso B.V. * Copyright (C) 2015 Deciso B.V.
* *
...@@ -30,11 +31,10 @@ namespace OPNsense\Base\Validators; ...@@ -30,11 +31,10 @@ namespace OPNsense\Base\Validators;
use \Phalcon\Validation\Validator; use \Phalcon\Validation\Validator;
use \Phalcon\Validation\ValidatorInterface; use \Phalcon\Validation\ValidatorInterface;
use \Phalcon\Validation\Message;; use \Phalcon\Validation\Message;
class MinMaxValidator extends Validator implements ValidatorInterface class MinMaxValidator extends Validator implements ValidatorInterface
{ {
public function validate($validator, $attribute) public function validate($validator, $attribute)
{ {
$value = $validator->getValue($attribute); $value = $validator->getValue($attribute);
......
...@@ -29,4 +29,3 @@ ...@@ -29,4 +29,3 @@
-------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------
package : configd package : configd
""" """
...@@ -64,4 +64,3 @@ class Helpers(object): ...@@ -64,4 +64,3 @@ class Helpers(object):
return True return True
else: else:
return False return False
...@@ -34,6 +34,3 @@ A sample with multiple output files ( for example based on interface ) can be fo ...@@ -34,6 +34,3 @@ A sample with multiple output files ( for example based on interface ) can be fo
{% if helpers.exists('filter.rule') %} {% if helpers.exists('filter.rule') %}
filter.rule exists filter.rule exists
{% endif %} {% endif %}
...@@ -603,4 +603,3 @@ ...@@ -603,4 +603,3 @@
@fa-var-youtube: "\f167"; @fa-var-youtube: "\f167";
@fa-var-youtube-play: "\f16a"; @fa-var-youtube-play: "\f16a";
@fa-var-youtube-square: "\f166"; @fa-var-youtube-square: "\f166";
...@@ -603,4 +603,3 @@ $fa-var-yen: "\f157"; ...@@ -603,4 +603,3 @@ $fa-var-yen: "\f157";
$fa-var-youtube: "\f167"; $fa-var-youtube: "\f167";
$fa-var-youtube-play: "\f16a"; $fa-var-youtube-play: "\f16a";
$fa-var-youtube-square: "\f166"; $fa-var-youtube-square: "\f166";
...@@ -162,5 +162,3 @@ function ajaxGet(url,sendData,callback) { ...@@ -162,5 +162,3 @@ function ajaxGet(url,sendData,callback) {
data:sendData data:sendData
}); });
} }
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