Skip to content

Commit 16e7c09

Browse files
committed
updates
1 parent 25c4e89 commit 16e7c09

File tree

7 files changed

+10
-13
lines changed

7 files changed

+10
-13
lines changed

.codeclimate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ engines:
1313
enabled: false
1414
CleanCode/StaticAccess:
1515
enabled: false
16-
16+

.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
RewriteEngine On
33

44
RewriteRule ^(.*)$ public/$1 [L]
5-
</IfModule>
5+
</IfModule>

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ before_script:
1717
- composer self-update
1818
- composer update
1919
script: phpunit Test.php
20-

Test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ public function testOnePlusOne() {
1111
$this->assertEquals(1+1,2);
1212
}
1313
}
14-
?>

app/HomeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ public function showIndex()
2020
$this->template->display('layout.tpl');
2121
}
2222

23-
}
23+
}

system/Validation.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ public function __construct($formrequest)
3535
public function addRule($field, $errorMessage, $rules = array())
3636
{
3737
if (count($this->request) == 0) {
38-
throw new Exception("The array of post parameters is empty");
38+
throw new \Exception("The array of post parameters is empty");
3939
}
4040
if ($field == '') {
41-
throw new Exception("field parameter is empty");
41+
throw new \Exception("field parameter is empty");
4242
}
43-
if (!is_array($rules) or empty($rules)) {
44-
throw new Exception("The array of rules parameter is empty");
43+
if (!is_array($rules) || empty($rules)) {
44+
throw new \Exception("The array of rules parameter is empty");
4545
}
4646
$errorMessage = ($errorMessage == '') ? $field : $errorMessage;
4747
$this->fields[] = array(
@@ -76,10 +76,10 @@ public function createRule($rulename, $errorMessage, $callback)
7676
public function validate()
7777
{
7878
if (count($this->request) == 0) {
79-
throw new Exception("The array of post parameters is empty");
79+
throw new \Exception("The array of post parameters is empty");
8080
}
8181
if (count($this->fields) == 0) {
82-
throw new Exception("Validation rules is not set");
82+
throw new \Exception("Validation rules is not set");
8383
}
8484
foreach ($this->fields as $field) {
8585
$fieldName = $field['name'];
@@ -106,7 +106,7 @@ public function validate()
106106
$output = call_user_func($rule['callback']);
107107
if ($output !== true && $rule['name'] !== '') {
108108
// if empty errorMessage, then get errors array from callback output
109-
if ($rule['name'] == $rule['errorMessage'] and is_array($output)) {
109+
if ($rule['name'] == $rule['errorMessage'] && is_array($output)) {
110110
// $errnum='0';
111111
foreach ($output as $rulekey => $errmsg) {
112112
// $errnum++;

system/ValidationMethods.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,3 @@ function validURI($input) {
6666
return (preg_match("#^[a-zA-ZA-y0-9_-]+$#", $input) == 1);
6767
}
6868
}
69-
?>

0 commit comments

Comments
 (0)