diff options
| author | Peter Kokot <peterkokot@gmail.com> | 2018-10-15 04:29:24 +0200 |
|---|---|---|
| committer | Peter Kokot <peterkokot@gmail.com> | 2018-10-15 04:29:24 +0200 |
| commit | 113213f0277562a4ca6d020cb28ba98321d3c62a (patch) | |
| tree | bbe57fa40e644a1e1861af1d362a3e40e345b620 /ext/pcre | |
| parent | 7af945e271d042a4991c9510f78b6ff7ac43ac34 (diff) | |
| download | php-git-113213f0277562a4ca6d020cb28ba98321d3c62a.tar.gz | |
Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.
According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.
C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."
Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.
[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
Diffstat (limited to 'ext/pcre')
26 files changed, 15 insertions, 33 deletions
diff --git a/ext/pcre/tests/002.phpt b/ext/pcre/tests/002.phpt index 42b63c7d1b..d4780447bc 100644 --- a/ext/pcre/tests/002.phpt +++ b/ext/pcre/tests/002.phpt @@ -16,7 +16,6 @@ var_dump(preg_replace('/(.)/e', 'for ($', 'abc')); ?> --EXPECTF-- - Warning: preg_match() expects at least 2 parameters, 0 given in %s002.php on line 3 bool(false) diff --git a/ext/pcre/tests/bug27103.phpt b/ext/pcre/tests/bug27103.phpt index 163dc9f1ea..0264228aee 100644 --- a/ext/pcre/tests/bug27103.phpt +++ b/ext/pcre/tests/bug27103.phpt @@ -40,4 +40,3 @@ h: 1 e: 1 r: 1 e: 1 - diff --git a/ext/pcre/tests/bug52732.phpt b/ext/pcre/tests/bug52732.phpt index 8cfa20420f..2ca969d3bf 100644 --- a/ext/pcre/tests/bug52732.phpt +++ b/ext/pcre/tests/bug52732.phpt @@ -10,4 +10,4 @@ var_dump($ret); ?> --EXPECT-- -bool(false)
\ No newline at end of file +bool(false) diff --git a/ext/pcre/tests/bug73392.phpt b/ext/pcre/tests/bug73392.phpt index 2b432543b8..90606c9e05 100644 --- a/ext/pcre/tests/bug73392.phpt +++ b/ext/pcre/tests/bug73392.phpt @@ -20,7 +20,6 @@ var_dump(preg_replace_callback_array( "/a/" => 'b', "/b/" => function () { return "c"; }, "/c/" => new Rep, "reporting" => array("Foo", "rep"), "a1" => array("Foo", "rep"), ), 'a')); ?> - --EXPECTF-- Warning: preg_replace_callback_array(): Delimiter must not be alphanumeric or backslash in %sbug73392.php on line %d diff --git a/ext/pcre/tests/bug74183.phpt b/ext/pcre/tests/bug74183.phpt index a230145961..5e1b3e8abf 100644 --- a/ext/pcre/tests/bug74183.phpt +++ b/ext/pcre/tests/bug74183.phpt @@ -12,4 +12,4 @@ var_dump(preg_last_error() === \PREG_INTERNAL_ERROR); --EXPECTF-- Warning: preg_match(): Compilation failed: regular expression is too large at offset %s in %s on line %s bool(false) -bool(true)
\ No newline at end of file +bool(true) diff --git a/ext/pcre/tests/bug75539.phpt b/ext/pcre/tests/bug75539.phpt index 83f3ef7d6b..044e8fa718 100644 --- a/ext/pcre/tests/bug75539.phpt +++ b/ext/pcre/tests/bug75539.phpt @@ -10,4 +10,4 @@ var_dump(preg_last_error() === \PREG_INTERNAL_ERROR); --EXPECTF-- Warning: preg_match(): Compilation failed: recursive call could loop indefinitely at offset %s in %s on line %s bool(false) -bool(true)
\ No newline at end of file +bool(true) diff --git a/ext/pcre/tests/match_flags3.phpt b/ext/pcre/tests/match_flags3.phpt index 84deb0b80c..695f0c1e81 100644 --- a/ext/pcre/tests/match_flags3.phpt +++ b/ext/pcre/tests/match_flags3.phpt @@ -18,7 +18,6 @@ var_dump(preg_match('/(?P<3>)/', '')); ?> --EXPECTF-- - Warning: preg_match(): Empty regular expression in %smatch_flags3.php on line 3 bool(false) int(1) diff --git a/ext/pcre/tests/pcre.constants.phpt b/ext/pcre/tests/pcre.constants.phpt index ad012e7e69..5abc6c72c2 100644 --- a/ext/pcre/tests/pcre.constants.phpt +++ b/ext/pcre/tests/pcre.constants.phpt @@ -32,4 +32,4 @@ PREG_INTERNAL_ERROR= 1 PREG_BACKTRACK_LIMIT_ERROR= 2 PREG_RECURSION_LIMIT_ERROR= 3 PREG_BAD_UTF8_ERROR= 4 -===Done===
\ No newline at end of file +===Done=== diff --git a/ext/pcre/tests/preg_grep_error.phpt b/ext/pcre/tests/preg_grep_error.phpt index f2afdb9d26..8cc3ffe669 100644 --- a/ext/pcre/tests/preg_grep_error.phpt +++ b/ext/pcre/tests/preg_grep_error.phpt @@ -40,4 +40,4 @@ NULL Warning: preg_grep() expects at least 2 parameters, 1 given in %spreg_grep_error.php on line %d NULL -Done
\ No newline at end of file +Done diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt index ae2eb128ba..fcc36e7d91 100644 --- a/ext/pcre/tests/preg_grep_error1.phpt +++ b/ext/pcre/tests/preg_grep_error1.phpt @@ -27,7 +27,6 @@ var_dump(preg_grep($value, $array)); echo "Done" ?> --EXPECTF-- - *** Testing preg_grep() : error conditions *** Arg value is abcdef @@ -65,4 +64,4 @@ array(2) { Warning: preg_grep() expects parameter 1 to be string, object given in %spreg_grep_error1.php on line %d NULL -Done
\ No newline at end of file +Done diff --git a/ext/pcre/tests/preg_grep_error2.phpt b/ext/pcre/tests/preg_grep_error2.phpt index aa4dae98a0..720940800f 100644 --- a/ext/pcre/tests/preg_grep_error2.phpt +++ b/ext/pcre/tests/preg_grep_error2.phpt @@ -39,4 +39,4 @@ array(2) { Warning: preg_grep() expects parameter 2 to be array, object given in %spreg_grep_error2.php on line %d NULL -Done
\ No newline at end of file +Done diff --git a/ext/pcre/tests/preg_last_error_error.phpt b/ext/pcre/tests/preg_last_error_error.phpt index c75e2f86c1..105d5ab1c2 100644 --- a/ext/pcre/tests/preg_last_error_error.phpt +++ b/ext/pcre/tests/preg_last_error_error.phpt @@ -27,4 +27,4 @@ var_dump( preg_last_error($extra_arg) ); Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d NULL -===Done===
\ No newline at end of file +===Done=== diff --git a/ext/pcre/tests/preg_match_all_error3.phpt b/ext/pcre/tests/preg_match_all_error3.phpt index 6c1422b61a..6559b22d2e 100644 --- a/ext/pcre/tests/preg_match_all_error3.phpt +++ b/ext/pcre/tests/preg_match_all_error3.phpt @@ -16,5 +16,4 @@ var_dump(preg_match_all($regex, $subject, 'test')); echo "Done"; ?> --EXPECTF-- - Fatal error: Only variables can be passed by reference in %spreg_match_all_error3.php on line %d diff --git a/ext/pcre/tests/preg_match_basic.phpt b/ext/pcre/tests/preg_match_basic.phpt index 1f20bbdde5..ea4b470df9 100644 --- a/ext/pcre/tests/preg_match_basic.phpt +++ b/ext/pcre/tests/preg_match_basic.phpt @@ -18,9 +18,7 @@ var_dump($match4); var_dump(preg_match('/hello world/', $string, $match5)); //tries to find "hello world" (should be Hello, world) var_dump($match5); ?> - --EXPECTF-- - int(1) array(1) { [0]=> @@ -49,4 +47,3 @@ array(1) { int(0) array(0) { } - diff --git a/ext/pcre/tests/preg_match_basic_002.phpt b/ext/pcre/tests/preg_match_basic_002.phpt index e4854f6b08..5ae52654db 100644 --- a/ext/pcre/tests/preg_match_basic_002.phpt +++ b/ext/pcre/tests/preg_match_basic_002.phpt @@ -20,4 +20,4 @@ array(2) { [1]=> string(1) "y" } -===Done===
\ No newline at end of file +===Done=== diff --git a/ext/pcre/tests/preg_match_basic_edit.phpt b/ext/pcre/tests/preg_match_basic_edit.phpt index 116899c60f..3eb918439d 100644 --- a/ext/pcre/tests/preg_match_basic_edit.phpt +++ b/ext/pcre/tests/preg_match_basic_edit.phpt @@ -26,9 +26,7 @@ var_dump($match4); var_dump(preg_match('/hello world/', $string, $match5)); //tries to find "hello world" (should be Hello, world) var_dump($match5); ?> - --EXPECTF-- - int(1) array(1) { [0]=> @@ -57,4 +55,3 @@ array(1) { int(0) array(0) { } - diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt index ba0aea4912..42bb5abd27 100644 --- a/ext/pcre/tests/preg_match_error1.phpt +++ b/ext/pcre/tests/preg_match_error1.phpt @@ -26,7 +26,6 @@ $regex_value = new stdclass(); //Object var_dump(preg_match($regex_value, $subject)); ?> --EXPECTF-- - *** Testing preg_match() : error conditions *** Arg value is abcdef diff --git a/ext/pcre/tests/preg_match_error2.phpt b/ext/pcre/tests/preg_match_error2.phpt index f44b1d0f72..cb0917a228 100644 --- a/ext/pcre/tests/preg_match_error2.phpt +++ b/ext/pcre/tests/preg_match_error2.phpt @@ -22,7 +22,6 @@ var_dump(preg_match($regex, $value)); echo "Done"; ?> --EXPECTF-- - *** Testing preg_match() : error conditions *** Arg value is: this is a string @@ -35,4 +34,4 @@ bool(false) Warning: preg_match() expects parameter 2 to be string, object given in %spreg_match_error2.php on line %d bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/pcre/tests/preg_quote_basic.phpt b/ext/pcre/tests/preg_quote_basic.phpt index 2697a80155..bdcd933428 100644 --- a/ext/pcre/tests/preg_quote_basic.phpt +++ b/ext/pcre/tests/preg_quote_basic.phpt @@ -15,11 +15,10 @@ var_dump(preg_match('/^[tT]\w{6} - ' . preg_quote($string_before, '/') . ' [a-z] var_dump($matches1); ?> --EXPECT-- - $string_before looks like: /this *-has \ metacharacters^ in $ $string_after looks like: \/this \*\-has \\ metacharacters\^ in \$, with metacharacters and / (set as delimiter) escaped int(1) array(1) { [0]=> string(58) "testing - /this *-has \ metacharacters^ in $ should work" -}
\ No newline at end of file +} diff --git a/ext/pcre/tests/preg_quote_error1.phpt b/ext/pcre/tests/preg_quote_error1.phpt index a02c836707..6f885f0509 100644 --- a/ext/pcre/tests/preg_quote_error1.phpt +++ b/ext/pcre/tests/preg_quote_error1.phpt @@ -33,4 +33,4 @@ NULL Warning: preg_quote() expects parameter 1 to be string, object given in %spreg_quote_error1.php on line %d NULL -Done
\ No newline at end of file +Done diff --git a/ext/pcre/tests/preg_replace_basic.phpt b/ext/pcre/tests/preg_replace_basic.phpt index 9c2eba47d8..266bd0eebd 100644 --- a/ext/pcre/tests/preg_replace_basic.phpt +++ b/ext/pcre/tests/preg_replace_basic.phpt @@ -16,7 +16,6 @@ var_dump(preg_replace('<(^[a-z]\w+)@(\w+)\.(\w+)\.([a-z]{2,}$)>', '\\1 at \\2 do ?> --EXPECT-- - string(54) "123456789 - Hello, world - This is a string." string(54) "123456789 - Hello, world - This is a string." string(54) "444444444 - Hello, world - This is a string." diff --git a/ext/pcre/tests/preg_replace_callback_error1.phpt b/ext/pcre/tests/preg_replace_callback_error1.phpt index add24fbc82..313064eab8 100644 --- a/ext/pcre/tests/preg_replace_callback_error1.phpt +++ b/ext/pcre/tests/preg_replace_callback_error1.phpt @@ -56,4 +56,4 @@ string(9) "number 1." Arg value is /[a-zA-Z]/ string(3) " 1." -===Done===
\ No newline at end of file +===Done=== diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt index 04eef25e3d..8e20108b88 100644 --- a/ext/pcre/tests/preg_replace_error1.phpt +++ b/ext/pcre/tests/preg_replace_error1.phpt @@ -56,4 +56,3 @@ Arg value is /[a-zA-Z]/ string(1) "1" Recoverable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error1.php on line %d - diff --git a/ext/pcre/tests/preg_replace_error2.phpt b/ext/pcre/tests/preg_replace_error2.phpt index 79f4c60d69..8c826587ea 100644 --- a/ext/pcre/tests/preg_replace_error2.phpt +++ b/ext/pcre/tests/preg_replace_error2.phpt @@ -34,4 +34,3 @@ Warning: preg_replace(): Parameter mismatch, pattern is a string while replaceme bool(false) Recoverable fatal error: Object of class stdClass could not be converted to string in %spreg_replace_error2.php on line %d - diff --git a/ext/pcre/tests/preg_split_error.phpt b/ext/pcre/tests/preg_split_error.phpt index 960b286c91..45fe6459e6 100644 --- a/ext/pcre/tests/preg_split_error.phpt +++ b/ext/pcre/tests/preg_split_error.phpt @@ -41,4 +41,4 @@ bool(false) Warning: preg_split() expects at least 2 parameters, 1 given in %spreg_split_error.php on line %d bool(false) -Done
\ No newline at end of file +Done diff --git a/ext/pcre/tests/preg_split_error2.phpt b/ext/pcre/tests/preg_split_error2.phpt index e08182177f..030f757d0a 100644 --- a/ext/pcre/tests/preg_split_error2.phpt +++ b/ext/pcre/tests/preg_split_error2.phpt @@ -31,4 +31,4 @@ bool(false) Warning: preg_split() expects parameter 2 to be string, object given in %spreg_split_error2.php on line %d bool(false) -Done
\ No newline at end of file +Done |
