Skip to content

trim trailing whitespaces and fix code style #5554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Zend/tests/bug72038.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ Bug #72038 (Function calls with values to a by-ref parameter don't always throw
<?php

try {
test($foo = new stdClass);
var_dump($foo);
test($foo = new stdClass);
var_dump($foo);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
echo "Exception: " . $e->getMessage() . "\n";
}
try {
test($bar = 2);
var_dump($bar);
test($bar = 2);
var_dump($bar);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
echo "Exception: " . $e->getMessage() . "\n";
}
try {
test($baz = &$bar);
var_dump($baz);
test($baz = &$bar);
var_dump($baz);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
echo "Exception: " . $e->getMessage() . "\n";
}

function test(&$param) {
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/bug77589.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ BUG #77589 (Core dump using parse_ini_string with numeric sections)
--FILE--
<?php
var_dump(
parse_ini_string(<<<INI
parse_ini_string(<<<INI
[0]
a = 1
b = on
c = true

["true"]
a = 100
a = 100
b = null
c = yes
INI
Expand Down
24 changes: 12 additions & 12 deletions Zend/tests/bug78154.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ Bug #78154: SEND_VAR_NO_REF does not always send reference
<?php

namespace {
try {
var_dump(similar_text('a', 'a', $c=0x44444444));
var_dump($c);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
var_dump(similar_text('a', 'a', $c=0x44444444));
var_dump($c);
} catch (Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}
namespace Foo {
try {
var_dump(similar_text('a', 'a', $d=0x44444444));
var_dump($d);
} catch (\Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
try {
var_dump(similar_text('a', 'a', $d=0x44444444));
var_dump($d);
} catch (\Throwable $e) {
echo "Exception: " . $e->getMessage() . "\n";
}
}

?>
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug79477.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Bug #79477: casting object into array creates references
<?php

class Test {
public $prop = 'default value';
public $prop = 'default value';
}

$obj = new Test;
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/lsb_021.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class B extends A {
B::test();
call_user_func("B::test");
call_user_func(array("B", "test"));

(self::class)::test();
call_user_func(self::class . "::test");
call_user_func(array(self::class, "test"));
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/magic_methods_serialize.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ __serialize declaration
--FILE--
<?php
class Foo {
static function __serialize($arguments) {}
static function __serialize($arguments) {}
}
?>
--EXPECTF--
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/magic_methods_unserialize.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ __unserialize declaration
--FILE--
<?php
class Foo {
static function __unserialize($data, $value) {}
static function __unserialize($data, $value) {}
}
?>
--EXPECTF--
Expand Down
10 changes: 5 additions & 5 deletions ext/ffi/tests/101.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ ffi.enable=1
require_once('utils.inc');
$fastcall = ffi_get_fastcall_specifier();
$zend = ffi_cdef("
const char *get_zend_version(void);
//char *get_zend_version(void);
extern size_t (*zend_printf)(const char *format, ...);
const char *get_zend_version(void);
//char *get_zend_version(void);
extern size_t (*zend_printf)(const char *format, ...);

unsigned long $fastcall zend_hash_func(const char *str, size_t len);
unsigned long $fastcall zend_hash_func(const char *str, size_t len);

void $fastcall zend_str_tolower(char *str, size_t length);
void $fastcall zend_str_tolower(char *str, size_t length);

", ffi_get_php_dll_name());
$f = $zend->get_zend_version;
Expand Down
8 changes: 4 additions & 4 deletions ext/ffi/tests/301-win32.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ ffi.enable=1
require_once('utils.inc');
$fn = __DIR__ . "/300-win32.h";
$cont = str_replace(
"PHP_DLL_NAME",
ffi_get_php_dll_name(),
file_get_contents("$fn.in")
);
"PHP_DLL_NAME",
ffi_get_php_dll_name(),
file_get_contents("$fn.in")
);
file_put_contents($fn, $cont);

$ffi = FFI::load($fn);
Expand Down
32 changes: 16 additions & 16 deletions ext/phar/tests/bug79082.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ chmod(__DIR__ . '/test79082/test79082-testfile', 0644);
chmod(__DIR__ . '/test79082/test79082-testfile2', 0400);

foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) {
clearstatcache();
$phar = new PharData(__DIR__ . '/test79082.' . $ext, null, null, $mode);
$phar->buildFromIterator(new \RecursiveDirectoryIterator(__DIR__ . '/test79082', \FilesystemIterator::SKIP_DOTS), __DIR__ . '/test79082');
$phar->extractTo(__DIR__);
var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode']));
var_dump(decoct(stat(__DIR__ . '/test79082-testfile2')['mode']));
unlink(__DIR__ . '/test79082-testfile');
unlink(__DIR__ . '/test79082-testfile2');
clearstatcache();
$phar = new PharData(__DIR__ . '/test79082.' . $ext, null, null, $mode);
$phar->buildFromIterator(new \RecursiveDirectoryIterator(__DIR__ . '/test79082', \FilesystemIterator::SKIP_DOTS), __DIR__ . '/test79082');
$phar->extractTo(__DIR__);
var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode']));
var_dump(decoct(stat(__DIR__ . '/test79082-testfile2')['mode']));
unlink(__DIR__ . '/test79082-testfile');
unlink(__DIR__ . '/test79082-testfile2');
}
foreach([Phar::TAR => 'tar', Phar::ZIP => 'zip'] as $mode => $ext) {
clearstatcache();
$phar = new PharData(__DIR__ . '/test79082-d.' . $ext, null, null, $mode);
$phar->buildFromDirectory(__DIR__ . '/test79082');
$phar->extractTo(__DIR__);
var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode']));
var_dump(decoct(stat(__DIR__ . '/test79082-testfile2')['mode']));
unlink(__DIR__ . '/test79082-testfile');
unlink(__DIR__ . '/test79082-testfile2');
clearstatcache();
$phar = new PharData(__DIR__ . '/test79082-d.' . $ext, null, null, $mode);
$phar->buildFromDirectory(__DIR__ . '/test79082');
$phar->extractTo(__DIR__);
var_dump(decoct(stat(__DIR__ . '/test79082-testfile')['mode']));
var_dump(decoct(stat(__DIR__ . '/test79082-testfile2')['mode']));
unlink(__DIR__ . '/test79082-testfile');
unlink(__DIR__ . '/test79082-testfile2');
}
?>
--CLEAN--
Expand Down
42 changes: 21 additions & 21 deletions ext/soap/tests/bug79536.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ soap.wsdl_cache_enabled=0
--FILE--
<?php
$GLOBALS['HTTP_RAW_POST_DATA']="
<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
xmlns:ns1=\"http://schemas.nothing.com\"
<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
xmlns:enc=\"http://schemas.xmlsoap.org/soap/encoding/\"
xmlns:ns1=\"http://schemas.nothing.com\"
>
<env:Body>
<ns1:dotest2>
Expand All @@ -22,35 +22,35 @@ $GLOBALS['HTTP_RAW_POST_DATA']="
</env:Envelope>";

class myFault extends SoapFault {
public function __destruct() {
}
public function __destruct() {
}
}

function book_to_xml($book) {
throw new myFault("Server", "Conversion Fault");
throw new myFault("Server", "Conversion Fault");
}

class test{
function dotest2($str){
$book = new book;
$book->a = "foo";
$book->b = "bar";
return $book;
}
function dotest2($str){
$book = new book;
$book->a = "foo";
$book->b = "bar";
return $book;
}
}

class book{
public $a="a";
public $b="c";
public $a="a";
public $b="c";

}

$options=Array(
'actor' =>'http://schemas.nothing.com',
'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
"type_name" => "book",
"to_xml" => "book_to_xml"))
);
'actor' =>'http://schemas.nothing.com',
'typemap' => array(array("type_ns" => "http://schemas.nothing.com",
"type_name" => "book",
"to_xml" => "book_to_xml"))
);

$server = new SoapServer(__DIR__."/classmap.wsdl",$options);
$server->setClass("test");
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/tests/serialize/bug79526.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ Bug #79526 (`__sleep` error message doesn't include the name of the class)
<?php
class A
{
public function __sleep() {
return 1;
}
public function __sleep() {
return 1;
}
}


serialize(new A());

class B
{
public function __sleep() {
return [1];
}
public function __sleep() {
return [1];
}
}


Expand Down
2 changes: 1 addition & 1 deletion ext/xml/tests/xml_parser_set_option_variation5.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (!extension_loaded('xml')) {

$xmlParser = xml_parser_create();

var_dump(xml_parser_set_option($xmlParser, 42, 1));
var_dump(xml_parser_set_option($xmlParser, 42, 1));

?>
--EXPECTF--
Expand Down
8 changes: 4 additions & 4 deletions ext/zip/tests/oo_add_encoding.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $file = $dirname . 'tmp.zip';
@mkdir($dirname);
$zip = new ZipArchive;
if (!$zip->open($file, ZipArchive::CREATE)) {
exit('failed');
exit('failed');
}

$zip->addEmptyDir('foo');
Expand All @@ -27,10 +27,10 @@ $zip->addFromString(chr(0x91), __FILE__, ZipArchive::FL_ENC_CP437);
$zip->addFromString('€', __FILE__, ZipArchive::FL_ENC_UTF_8);

if ($zip->status == ZIPARCHIVE::ER_OK) {
dump_entries_name($zip);
$zip->close();
dump_entries_name($zip);
$zip->close();
} else {
echo "failed\n";
echo "failed\n";
}
?>
--CLEAN--
Expand Down
6 changes: 3 additions & 3 deletions ext/zip/tests/oo_add_from_string.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ var_dump($zip->addFromString('entry1.txt', __FILE__, ZipArchive::FL_OVERWRITE));
var_dump($zip->status == ZipArchive::ER_OK);

if ($zip->status == ZipArchive::ER_OK) {
dump_entries_name($zip);
$zip->close();
dump_entries_name($zip);
$zip->close();
} else {
echo "failed\n";
echo "failed\n";
}
?>
Done
Expand Down
4 changes: 2 additions & 2 deletions ext/zip/tests/oo_addfile.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (!$zip->addFile($dirname . 'utils.inc', 'test.php')) {
}
var_dump($zip->lastId);
if (!$zip->addFile($dirname . 'utils.inc', 'mini.txt', 12, 34)) {
echo "failed\n";
echo "failed\n";
}
var_dump($zip->lastId);
if ($zip->status == ZIPARCHIVE::ER_OK) {
Expand All @@ -44,7 +44,7 @@ if ($zip->status == ZIPARCHIVE::ER_OK) {
echo "failed\n";
}
if (!$zip->open($file)) {
exit('failed');
exit('failed');
}
var_dump(strlen($zip->getFromName('test.php')) == filesize($dirname . 'utils.inc'));
var_dump(strlen($zip->getFromName('mini.txt')) == 34);
Expand Down
8 changes: 4 additions & 4 deletions ext/zip/tests/oo_addglob.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ if (!$zip->open($file)) {
}
$options = array('add_path' => 'baz/', 'remove_all_path' => TRUE);
if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
echo "failed 1\n";
echo "failed 1\n";
}
if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
echo "failed 2\n";
echo "failed 2\n";
}
$options['flags'] = 0; // clean FL_OVERWRITE
if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
var_dump($zip->getStatusString());
var_dump($zip->getStatusString());
}
$options['flags'] = ZipArchive::FL_OVERWRITE;
if (!$zip->addGlob($dirname . '*.{txt,baz}', GLOB_BRACE, $options)) {
echo "failed 3\n";
echo "failed 3\n";
}
if ($zip->status == ZIPARCHIVE::ER_OK) {
if (!verify_entries($zip, [
Expand Down
Loading