Page MenuHomeSealhub

No OneTemporary

diff --git a/src/lint/linter/__tests__/xhpast/decl-parens-hug-closing.lint-test b/src/lint/linter/__tests__/xhpast/decl-parens-hug-closing.lint-test
index a7ea5adf..c6accb15 100644
--- a/src/lint/linter/__tests__/xhpast/decl-parens-hug-closing.lint-test
+++ b/src/lint/linter/__tests__/xhpast/decl-parens-hug-closing.lint-test
@@ -1,61 +1,61 @@
<?php
function f($x) {}
function g($x ) {}
function h ($x) {}
function &i($x) {}
function &j($x ) {}
final class X {
public function a($x) {}
public function b($x ) {}
public static function &c($x) {}
public static function &d($x ) {}
abstract private function e($x);
abstract private function f($x );
}
f(function($x) {});
f(function($x ) {});
f(function($x ) use ($z) {});
~~~~~~~~~~
warning:4:14
warning:5:11
warning:8:15
error:10:13
-warning:11:23
+warning:13:23
warning:16:31
warning:19:33
warning:24:14
warning:25:14
~~~~~~~~~~
<?php
function f($x) {}
function g($x) {}
function h($x) {}
function &i($x) {}
function &j($x) {}
final class X {
public function a($x) {}
public function b($x) {}
public static function &c($x) {}
public static function &d($x) {}
abstract private function e($x);
abstract private function f($x);
}
f(function($x) {});
f(function($x) {});
f(function($x) use ($z) {});
diff --git a/src/lint/linter/__tests__/xhpast/naming-conventions.lint-test b/src/lint/linter/__tests__/xhpast/naming-conventions.lint-test
index cc78e403..3bf1a71a 100644
--- a/src/lint/linter/__tests__/xhpast/naming-conventions.lint-test
+++ b/src/lint/linter/__tests__/xhpast/naming-conventions.lint-test
@@ -1,75 +1,75 @@
<?php
final class a {
const b = 1, c = d;
protected $E, $H;
public function F($G, $GG) {}
}
interface i {}
function YY($ZZ) {}
final class Quack {
const R = 1, S = 2;
protected $tX, $uY;
public function vV($w_w) {}
}
-function () use ($this_is_a_closure) {};
+function() use ($this_is_a_closure) {};
function f(&$YY) {}
function g() {
$lowerCamelCase = 0;
$UpperCamelCase = 0;
$UPPERCASE_WITH_UNDERSCORES = 0;
$lowercase_with_underscores = 0;
$mIxEd_CaSe = 0;
}
function h() {
global $mIxEd_CaSe;
$mIxEd_CaSe = 2;
$GLOBALS[0] = 2;
$_ENV[0] = 1;
}
function i() {
self::$X_x;
Other::$Y_y;
parent::$Z_z;
self::$X_x[0];
Other::$Y_y[0];
parent::$Z_z[0];
}
function j() {
// Test case for bug where any static access would shadow other variables.
Other::$y = 0;
$mIxEdCaSe = 1;
}
~~~~~~~~~~
warning:2:13
warning:3:9
warning:3:16
warning:4:13
warning:4:17
warning:5:19
warning:5:21
warning:5:25
warning:8:11
warning:12:10
warning:12:13
warning:26:13
warning:29:3
warning:30:3
warning:31:3
warning:33:3
warning:55:3
diff --git a/src/lint/linter/__tests__/xhpast/undeclared-variables.lint-test b/src/lint/linter/__tests__/xhpast/undeclared-variables.lint-test
index 7c4b9c6d..3b07c19c 100644
--- a/src/lint/linter/__tests__/xhpast/undeclared-variables.lint-test
+++ b/src/lint/linter/__tests__/xhpast/undeclared-variables.lint-test
@@ -1,193 +1,193 @@
<?php
-function () use ($c) {
+function() use ($c) {
$c++;
};
function f($a, $b) {
static $c, $d;
global $e, $f;
$g = $h = x();
list($i, list($j, $k)) = y();
foreach (q() as $l => $m) {}
$a++;
$b++;
$c++;
$d++;
$e++;
$f++;
$g++;
$h++;
$i++;
$j++;
$k++;
$l++;
$m++;
$this++;
$n++; // Only one that isn't declared.
extract(z());
$o++;
}
function g($q) {
$$q = x();
$r = y();
}
final class C {
public function m() {
$a++;
x($b);
$c[] = 3;
$d->v = 4;
$a = $f;
}
}
function worst() {
global $$x;
$y++;
}
function superglobals() {
$GLOBALS[$_FILES[$_POST[$this]]]++;
}
function ref_foreach($x) {
foreach ($x as &$z) {}
$z++;
}
function has_default($x = 0) {
$x++;
}
function declparse(
$a,
Q $b,
Q &$c,
Q $d = null,
Q &$e = null,
$f = null,
$g = null,
&$h = null,
&$i = null) {
$a++;
$b++;
$c++;
$d++;
$e++;
$f++;
$g++;
$h++;
$i++;
$j++;
}
function declparse_a(Q $a) { $a++; }
function declparse_b(Q &$a) { $a++; }
function declparse_c(Q $a = null) { $a++; }
function declparse_d(Q &$a = null) { $a++; }
function declparse_e($a) { $a++; }
function declparse_f(&$a) { $a++; }
function declparse_g($a = null) { $a++; }
function declparse_h(&$a = null) { $a++; }
function static_class() {
SomeClass::$x;
}
function instance_class() {
$a = $this->$x;
}
function exception_vars() {
try {
// This is intentionally left blank.
} catch (Exception $y) {
$y++;
}
}
function nonuse() {
isset($x);
empty($y);
$x++;
}
function twice() {
$y++;
$y++;
}
function more_exceptions() {
try {
// This is intentionally left blank.
} catch (Exception $a) {
$a++;
} catch (Exception $b) {
$b++;
}
}
abstract class P {
abstract public function q();
}
function x() {
$lib = $_SERVER['PHP_ROOT'].'/lib/titan/display/read/init.php';
require_once $lib;
f(((($lib)))); // Tests for paren expressions.
f(((($lub))));
}
final class A {
public function foo($a) {
$im_service = foo($a);
if ($im_servce === false) {
return 1;
}
return 2;
}
}
function arrow($o, $x) {
echo $o->{$x->{$x->{$x.$x->{$x}}.$x}};
}
function strings() {
$a = 1;
echo "$a";
echo "$b";
}
function catchy() {
try {
dangerous();
} catch (Exception $ex) {
$y->z();
}
}
~~~~~~~~~~
error:28:3
error:30:3
error:36:3
error:42:5
error:43:7
error:44:5
error:45:5
error:46:10
error:51:10 worst ever
warning:61:3
error:87:3 This stuff is basically testing the lexer/parser for function decls.
error:104:15 Variables in instance derefs should be checked, static should not.
error:118:3 isset() and empty() should not trigger errors.
error:122:3 Should only warn once in this function.
error:144:8
error:150:9
error:164:9
error:171:5

File Metadata

Mime Type
text/x-diff
Expires
Sat, Nov 8, 06:39 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034227
Default Alt Text
(6 KB)

Event Timeline