Skip to content

Commit ab71156

Browse files
committed
Whitespace
1 parent c762306 commit ab71156

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+367
-354
lines changed

functions/array/array.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ function array() {
1818
var arrInst, e, __, that = this,
1919
PHPJS_Array = function PHPJS_Array() {};
2020
mainArgs = arguments, p = this.php_js,
21-
_indexOf = function(value, from, strict) {
22-
var i = from || 0,
23-
nonstrict = !strict,
24-
length = this.length;
25-
while (i < length) {
26-
if (this[i] === value || (nonstrict && this[i] == value)) {
27-
return i;
21+
_indexOf = function(value, from, strict) {
22+
var i = from || 0,
23+
nonstrict = !strict,
24+
length = this.length;
25+
while (i < length) {
26+
if (this[i] === value || (nonstrict && this[i] == value)) {
27+
return i;
28+
}
29+
i++;
2830
}
29-
i++;
30-
}
31-
return -1;
32-
};
31+
return -1;
32+
};
3333
// BEGIN REDUNDANT
3434
if (!p.Relator) {
3535
p.Relator = (function() {
@@ -65,7 +65,8 @@ function array() {
6565
return Relator();
6666
},
6767
constructor: function(that) {
68-
var i = Stack.indexOf(that);~
68+
var i = Stack.indexOf(that);
69+
~
6970
i ? Array[i] : Array[Stack.push(that) - 1] = {};
7071
this.method(that)
7172
.that = that;
@@ -173,9 +174,9 @@ function array() {
173174
this.php_js.ini = this.php_js.ini || {};
174175
ini = this.php_js.ini['phpjs.no-eval'];
175176
if (ini && (
176-
parseInt(ini.local_value, 10) !== 0 && (!ini.local_value.toLowerCase || ini.local_value
177-
.toLowerCase() !== 'off')
178-
)) {
177+
parseInt(ini.local_value, 10) !== 0 && (!ini.local_value.toLowerCase || ini.local_value
178+
.toLowerCase() !== 'off')
179+
)) {
179180
if (arguments.length > 1) {
180181
for (i = 0, kl = _.keys.length; i < kl; i++) {
181182
this.window[funcname](_.values[i], _.keys[i], userdata);
@@ -248,8 +249,8 @@ function array() {
248249
// Let's consider case sensitive searches as strict
249250
flags = 'i' + (needle.global ? 'g' : '') +
250251
(needle.multiline ? 'm' : '') +
251-
// sticky is FF only
252-
(needle.sticky ? 'y' : '');
252+
// sticky is FF only
253+
(needle.sticky ? 'y' : '');
253254
needle = new RegExp(needle.source, flags);
254255
}
255256
for (i = 0, vl = haystack.length; i < vl; i++) {

functions/array/array_chunk.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@ function array_chunk(input, size, preserve_keys) {
2525
if (Object.prototype.toString.call(input) === '[object Array]') {
2626
if (preserve_keys) {
2727
while (i < l) {
28-
(x = i % size) ? n[c][i] = input[i] : n[++c] = {}, n[c][i] = input[i];
28+
(x = i % size) ? n[c][i] = input[i]: n[++c] = {}, n[c][i] = input[i];
2929
i++;
3030
}
3131
} else {
3232
while (i < l) {
33-
(x = i % size) ? n[c][x] = input[i] : n[++c] = [input[i]];
33+
(x = i % size) ? n[c][x] = input[i]: n[++c] = [input[i]];
3434
i++;
3535
}
3636
}
3737
} else {
3838
if (preserve_keys) {
3939
for (p in input) {
4040
if (input.hasOwnProperty(p)) {
41-
(x = i % size) ? n[c][p] = input[p] : n[++c] = {}, n[c][p] = input[p];
41+
(x = i % size) ? n[c][p] = input[p]: n[++c] = {}, n[c][p] = input[p];
4242
i++;
4343
}
4444
}
4545
} else {
4646
for (p in input) {
4747
if (input.hasOwnProperty(p)) {
48-
(x = i % size) ? n[c][x] = input[p] : n[++c] = [input[p]];
48+
(x = i % size) ? n[c][x] = input[p]: n[++c] = [input[p]];
4949
i++;
5050
}
5151
}

functions/array/array_intersect_key.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ function array_intersect_key(arr1) {
4040
}
4141

4242
return retArr;
43-
}
43+
}

functions/array/array_search.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function array_search(needle, haystack, argStrict) {
2525
// Let's consider case sensitive searches as strict
2626
var flags = 'i' + (needle.global ? 'g' : '') +
2727
(needle.multiline ? 'm' : '') +
28-
// sticky is FF only
29-
(needle.sticky ? 'y' : '');
28+
// sticky is FF only
29+
(needle.sticky ? 'y' : '');
3030
needle = new RegExp(needle.source, flags);
3131
}
3232
for (key in haystack) {
@@ -48,4 +48,4 @@ function array_search(needle, haystack, argStrict) {
4848
}
4949

5050
return false;
51-
}
51+
}

functions/array/array_slice.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ function array_slice(arr, offst, lgth, preserve_keys) {
1111
// returns 2: {2: 'c', 3: 'd'}
1212

1313
/*
14-
if ('callee' in arr && 'length' in arr) {
15-
arr = Array.prototype.slice.call(arr);
16-
}
17-
*/
14+
if ('callee' in arr && 'length' in arr) {
15+
arr = Array.prototype.slice.call(arr);
16+
}
17+
*/
1818

1919
var key = '';
2020

functions/array/array_walk.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ function array_walk(array, funcname, userdata) {
4848
this.php_js.ini = this.php_js.ini || {};
4949
ini = this.php_js.ini['phpjs.no-eval'];
5050
if (ini && (
51-
parseInt(ini.local_value, 10) !== 0 && (!ini.local_value.toLowerCase || ini.local_value.toLowerCase() !==
52-
'off')
53-
)) {
51+
parseInt(ini.local_value, 10) !== 0 && (!ini.local_value.toLowerCase || ini.local_value.toLowerCase() !==
52+
'off')
53+
)) {
5454
if (arguments.length > 2) {
5555
for (key in array) {
5656
this.window[funcname](array[key], key, userdata);

functions/array/arsort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,4 @@ function arsort(inputArr, sort_flags) {
102102
}
103103

104104
return strictForIn || populateArr;
105-
}
105+
}

functions/array/asort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ function asort(inputArr, sort_flags) {
108108
}
109109

110110
return strictForIn || populateArr;
111-
}
111+
}

functions/array/count.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function count(mixed_var, mode) {
3030
if (mixed_var.hasOwnProperty(key)) {
3131
cnt++;
3232
if (mode == 1 && mixed_var[key] && (mixed_var[key].constructor === Array || mixed_var[key].constructor ===
33-
Object)) {
33+
Object)) {
3434
cnt += this.count(mixed_var[key], 1);
3535
}
3636
}

functions/array/krsort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,4 @@ function krsort(inputArr, sort_flags) {
103103
}
104104

105105
return strictForIn || populateArr;
106-
}
106+
}

functions/array/rsort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@ function rsort(inputArr, sort_flags) {
106106
populateArr[i] = valArr[i];
107107
}
108108
return strictForIn || populateArr;
109-
}
109+
}

functions/array/sort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@ function sort(inputArr, sort_flags) {
107107
populateArr[i] = valArr[i];
108108
}
109109
return strictForIn || populateArr;
110-
}
110+
}

functions/datetime/gmdate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ function gmdate(format, timestamp) {
88
// returns 1: '07:09:40 m is month'
99

1010
var dt = typeof timestamp === 'undefined' ? new Date() : // Not provided
11-
typeof timestamp === 'object' ? new Date(timestamp) : // Javascript Date()
12-
// UNIX timestamp (auto-convert to int)
13-
new Date(timestamp * 1000);
11+
typeof timestamp === 'object' ? new Date(timestamp) : // Javascript Date()
12+
// UNIX timestamp (auto-convert to int)
13+
new Date(timestamp * 1000);
1414
timestamp = Date.parse(dt.toUTCString()
1515
.slice(0, -4)) / 1000;
1616
return this.date(format, timestamp);

functions/datetime/idate.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function idate(format, timestamp) {
1818

1919
// Fix: Need to allow date_default_timezone_set() (check for this.php_js.default_timezone and use)
2020
var date = ((typeof timestamp === 'undefined') ? new Date() : // Not provided
21-
(timestamp instanceof Date) ? new Date(timestamp) : // Javascript Date()
22-
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
23-
),
21+
(timestamp instanceof Date) ? new Date(timestamp) : // Javascript Date()
22+
new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int)
23+
),
2424
a;
2525

2626
switch (format) {

functions/datetime/microtime.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
function microtime(get_as_float) {
22
// discuss at: http://phpjs.org/functions/microtime/
33
// original by: Paulo Freitas
4-
// improved by Dumitru Uzun (http://duzun.me)
4+
// improved by: Dumitru Uzun (http://duzun.me)
55
// example 1: timeStamp = microtime(true);
66
// example 1: timeStamp > 1000000000 && timeStamp < 2000000000
77
// returns 1: true
88
// example 2: /^0\.[0-9]{1,6} [0-9]{10,10}$/.test(microtime())
99
// returns 2: true
1010

11-
1211
if (typeof performance !== 'undefined' && performance.now) {
1312
var now = (performance.now() + performance.timing.navigationStart) / 1e3;
1413
if (get_as_float) return now;
1514

16-
var s = now | 0; // Math.round(now)
15+
// Math.round(now)
16+
var s = now | 0;
1717
return (Math.round((now - s) * 1e6) / 1e6) + ' ' + s;
18-
} else {
19-
var now = (Date.now ? Date.now() : new Date().getTime()) / 1e3;
18+
} else {
19+
var now = (Date.now ? Date.now() : new Date()
20+
.getTime()) / 1e3;
2021
if (get_as_float) return now;
2122

22-
var s = now | 0; // Math.round(now)
23+
// Math.round(now)
24+
var s = now | 0;
2325
return (Math.round((now - s) * 1e3) / 1e3) + ' ' + s;
2426
}
2527
}

functions/datetime/strptime.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ function strptime(dateStr, format) {
1515
// Needs more thorough testing and examples
1616

1717
var retObj = {
18-
tm_sec: 0,
19-
tm_min: 0,
20-
tm_hour: 0,
21-
tm_mday: 0,
22-
tm_mon: 0,
23-
tm_year: 0,
24-
tm_wday: 0,
25-
tm_yday: 0,
26-
unparsed: ''
27-
},
18+
tm_sec: 0,
19+
tm_min: 0,
20+
tm_hour: 0,
21+
tm_mday: 0,
22+
tm_mon: 0,
23+
tm_year: 0,
24+
tm_wday: 0,
25+
tm_yday: 0,
26+
unparsed: ''
27+
},
2828
i = 0,
2929
that = this,
3030
amPmOffset = 0,

functions/datetime/strtotime.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ function strtotime(text, now) {
181181
// 2015-04-15 20:33:59+02
182182
// 2015-04-15 20:33:59z
183183
// 2015-04-15t20:33:59+02:00
184-
if (match = text.match(/^([0-9]{4}-[0-9]{2}-[0-9]{2})[ t]([0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?)([\+-][0-9]{2}(:[0-9]{2})?|z)/)) {
184+
if (match = text.match(
185+
/^([0-9]{4}-[0-9]{2}-[0-9]{2})[ t]([0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?)([\+-][0-9]{2}(:[0-9]{2})?|z)/)) {
185186
// fix time zone information
186187
if (match[4] == 'z') {
187188
match[4] = 'Z';

functions/filesystem/pathinfo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ function pathinfo(path, options) {
138138

139139
// Return full-blown array
140140
return tmp_arr;
141-
}
141+
}

functions/filesystem/realpath.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ function realpath(path) {
4040
}
4141
} /* Returns the absloute path as a string */
4242
return path.join('/');
43-
}
43+
}

functions/json/json_decode.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ function json_decode(str_json) {
88
// returns 1: [1]
99

1010
/*
11-
http://www.JSON.org/json2.js
12-
2008-11-19
13-
Public Domain.
14-
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
15-
See http://www.JSON.org/js.html
16-
*/
11+
http://www.JSON.org/json2.js
12+
2008-11-19
13+
Public Domain.
14+
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
15+
See http://www.JSON.org/js.html
16+
*/
1717

1818
var json = this.window.JSON;
1919
if (typeof json === 'object' && typeof json.parse === 'function') {
@@ -41,7 +41,7 @@ function json_decode(str_json) {
4141
if (cx.test(text)) {
4242
text = text.replace(cx, function(a) {
4343
return '\\u' + ('0000' + a.charCodeAt(0)
44-
.toString(16))
44+
.toString(16))
4545
.slice(-4);
4646
});
4747
}

functions/json/json_encode.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ function json_encode(mixed_val) {
99
// returns 1: '"Kevin"'
1010

1111
/*
12-
http://www.JSON.org/json2.js
13-
2008-11-19
14-
Public Domain.
15-
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
16-
See http://www.JSON.org/js.html
17-
*/
12+
http://www.JSON.org/json2.js
13+
2008-11-19
14+
Public Domain.
15+
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
16+
See http://www.JSON.org/js.html
17+
*/
1818
var retVal, json = this.window.JSON;
1919
try {
2020
if (typeof json === 'object' && typeof json.stringify === 'function') {
@@ -47,7 +47,7 @@ function json_encode(mixed_val) {
4747
return escapable.test(string) ? '"' + string.replace(escapable, function(a) {
4848
var c = meta[a];
4949
return typeof c === 'string' ? c : '\\u' + ('0000' + a.charCodeAt(0)
50-
.toString(16))
50+
.toString(16))
5151
.slice(-4);
5252
}) + '"' : '"' + string + '"';
5353
};
@@ -96,7 +96,7 @@ function json_encode(mixed_val) {
9696
return 'null';
9797
}
9898
if ((this.PHPJS_Resource && value instanceof this.PHPJS_Resource) || (window.PHPJS_Resource &&
99-
value instanceof window.PHPJS_Resource)) {
99+
value instanceof window.PHPJS_Resource)) {
100100
throw new SyntaxError('json_encode');
101101
}
102102

functions/json/json_last_error.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ function json_last_error() {
55
// returns 1: 0
66

77
/*
8-
JSON_ERROR_NONE = 0
9-
JSON_ERROR_DEPTH = 1 // max depth limit to be removed per PHP comments in json.c (not possible in JS?)
10-
JSON_ERROR_STATE_MISMATCH = 2 // internal use? also not documented
11-
JSON_ERROR_CTRL_CHAR = 3 // [\u0000-\u0008\u000B-\u000C\u000E-\u001F] if used directly within json_decode(),
12-
// but JSON functions auto-escape these, so error not possible in JavaScript
13-
JSON_ERROR_SYNTAX = 4
14-
*/
8+
JSON_ERROR_NONE = 0
9+
JSON_ERROR_DEPTH = 1 // max depth limit to be removed per PHP comments in json.c (not possible in JS?)
10+
JSON_ERROR_STATE_MISMATCH = 2 // internal use? also not documented
11+
JSON_ERROR_CTRL_CHAR = 3 // [\u0000-\u0008\u000B-\u000C\u000E-\u001F] if used directly within json_decode(),
12+
// but JSON functions auto-escape these, so error not possible in JavaScript
13+
JSON_ERROR_SYNTAX = 4
14+
*/
1515
return this.php_js && this.php_js.last_error_json ? this.php_js.last_error_json : 0;
1616
}

functions/math/cos.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ function cos(arg) {
55
// returns 1: -1812718
66

77
return Math.cos(arg);
8-
}
8+
}

0 commit comments

Comments
 (0)