Skip to content

Trim trailing whitespace #14721

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

Merged
merged 2 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion Zend/tests/gh7771_2_definition.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

class Foo {
public const BAR =
public const BAR =
self::BAZ
+ NonExistent::CLASS_CONSTANT;
public const BAZ = 42;
Expand Down
6 changes: 3 additions & 3 deletions Zend/zend_extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,21 +272,21 @@ ZEND_API int zend_get_resource_handle(const char *module_name)
*
* The extension slot has been available since PHP 7.4 on user functions and
* has been available since PHP 8.2 on internal functions.
*
*
* # Safety
* The extension slot made available by calling this function is initialized on
* the first call made to the function in that request. If you need to
* initialize it before this point, call `zend_init_func_run_time_cache`.
*
* The function cache slots are not available if the function is a trampoline,
* which can be checked with something like:
*
*
* if (fbc->type == ZEND_USER_FUNCTION
* && !(fbc->op_array.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE)
* ) {
* // Use ZEND_OP_ARRAY_EXTENSION somehow
* }
*/
*/
ZEND_API int zend_get_op_array_extension_handle(const char *module_name)
{
int handle = zend_op_array_extension_handles++;
Expand Down
4 changes: 2 additions & 2 deletions ext/calendar/easter.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm)
}

#ifdef ZEND_ENABLE_ZVAL_LONG64
/* Compiling for 64bit, allow years between 1970 and 2.000.000.000 */
/* Compiling for 64bit, allow years between 1970 and 2.000.000.000 */
if (gm && year < 1970) {
/* timestamps only start after 1970 */
zend_argument_value_error(1, "must be a year after 1970 (inclusive)");
Expand All @@ -67,7 +67,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm)
RETURN_THROWS();
}
#else
/* Compiling for 32bit, allow years between 1970 and 2037 */
/* Compiling for 32bit, allow years between 1970 and 2037 */
if (gm && (year < 1970 || year > 2037)) {
zend_argument_value_error(1, "must be between 1970 and 2037 (inclusive)");
RETURN_THROWS();
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/parentnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static xmlDocPtr dom_doc_from_context_node(xmlNodePtr contextNode)
}
}

/* Citing from the docs (https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlAddChild):
/* Citing from the docs (https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlAddChild):
* "Add a new node to @parent, at the end of the child (or property) list merging adjacent TEXT nodes (in which case @cur is freed)".
* So we must use a custom way of adding that does not merge. */
static void dom_add_child_without_merging(xmlNodePtr parent, xmlNodePtr child)
Expand Down
4 changes: 2 additions & 2 deletions ext/dom/php_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ static void dom_import_simplexml_common(INTERNAL_FUNCTION_PARAMETERS, php_libxml
zend_argument_type_error(1, "must not be already imported as a DOMNode");
} else {
zend_argument_type_error(1, "must not be already imported as a Dom\\Node");
}
}
RETURN_THROWS();
}

Expand Down Expand Up @@ -1882,7 +1882,7 @@ void php_dom_normalize_modern(xmlNodePtr this)

/* 3. Let data be the concatenation of the data of node’s contiguous exclusive Text nodes (excluding itself), in tree order.
* 4. Replace data with node node, offset length, count 0, and data data.
* 7. Remove node’s contiguous exclusive Text nodes (excluding itself), in tree order.
* 7. Remove node’s contiguous exclusive Text nodes (excluding itself), in tree order.
* => In other words: Concat every contiguous text node into node and delete the merged nodes. */
dom_merge_adjacent_exclusive_text_nodes(node);

Expand Down
4 changes: 2 additions & 2 deletions ext/dom/php_dom.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ public function getRootNode(?array $options = null): DOMNode {}
public function compareDocumentPosition(DOMNode $other): int {}

public function __sleep(): array {}

public function __wakeup(): void {}
}

Expand Down Expand Up @@ -446,7 +446,7 @@ class DOMNameSpaceNode

/** @implementation-alias DOMNode::__sleep */
public function __sleep(): array {}

/** @implementation-alias DOMNode::__wakeup */
public function __wakeup(): void {}
}
Expand Down
4 changes: 2 additions & 2 deletions ext/dom/xml_serializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static int dom_xml_common_text_serialization(xmlOutputBufferPtr out, const char
TRY(xmlOutputBufferWriteLit(out, "&quot;"));
break;
}

/* The following three are added to address https://github.com/w3c/DOM-Parsing/issues/59 */

case '\t': {
Expand Down Expand Up @@ -1050,7 +1050,7 @@ static int dom_xml_serializing_a_document_fragment_node(
int indent
)
{
/* 1. Let markup the empty string.
/* 1. Let markup the empty string.
* => We use the output buffer instead. */

/* 2. For each child child of node, in tree order, run the XML serialization algorithm on the child ... */
Expand Down
2 changes: 1 addition & 1 deletion ext/ftp/tests/server.inc
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ if ($pid) {
fputs($fs, "file1\r\nfile1\r\nfile\nb0rk\r\n");
fputs($s, "226 Closing data Connection.\r\n");
fclose($fs);

fputs($s, "226 Transfer complete\r\n");
}elseif (preg_match('/^LIST no_exists\//', $buf, $matches)) {
fputs($s, "425 Error establishing connection\r\n");
Expand Down
2 changes: 1 addition & 1 deletion ext/gd/libgd/gd_webp.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void gdImageWebpCtx (gdImagePtr im, gdIOCtx * outfile, int quality)
*(p++) = a;
}
}

if (quality >= gdWebpLossless) {
out_size = WebPEncodeLosslessRGBA(argb, gdImageSX(im), gdImageSY(im), gdImageSX(im) * 4, &out);
} else {
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/formatter/formatter_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS, zend_error_handling *error_
zend_argument_value_error(1, "\"%s\" is invalid", locale);
return FAILURE;
}

/* Create an ICU number formatter. */
FORMATTER_OBJECT(nfo) = unum_open(style, spattern, spattern_len, locale, NULL, &INTL_DATA_ERROR_CODE(nfo));

Expand Down
2 changes: 1 addition & 1 deletion ext/intl/grapheme/grapheme_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int32_t grapheme_strpos_utf16(char *haystack, size_t haystack_len, char *needle,
if(char_pos < offset_pos) {
/* last one is beyond our start offset */
char_pos = USEARCH_DONE;
}
}
} else {
/* searching backwards is broken, so we search forwards, albeit it's less efficient */
int32_t prev_pos = USEARCH_DONE;
Expand Down
2 changes: 1 addition & 1 deletion ext/json/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ PHP_FUNCTION(json_validate)
}

JSON_G(error_code) = PHP_JSON_ERROR_NONE;

if (depth <= 0) {
zend_argument_value_error(2, "must be greater than 0");
RETURN_THROWS();
Expand Down
4 changes: 2 additions & 2 deletions ext/mysqli/mysqli_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,12 @@ PHP_FUNCTION(mysqli_execute_query)

if (FAIL == mysql_stmt_prepare(stmt->stmt, query, query_len)) {
MYSQLI_REPORT_STMT_ERROR(stmt->stmt);

close_stmt_and_copy_errors(stmt, mysql);
RETURN_FALSE;
}

/* The bit below, which is copied from mysqli_prepare, is needed for bad index exceptions */
/* The bit below, which is copied from mysqli_prepare, is needed for bad index exceptions */
/* don't initialize stmt->query with NULL, we ecalloc()-ed the memory */
/* Get performance boost if reporting is switched off */
if (query_len && (MyG(report_mode) & MYSQLI_REPORT_INDEX)) {
Expand Down
2 changes: 1 addition & 1 deletion ext/mysqli/mysqli_exception.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ PHP_METHOD(mysqli_sql_exception, getSqlState)
prop = zend_read_property(mysqli_exception_class_entry, Z_OBJ_P(ZEND_THIS), "sqlstate", sizeof("sqlstate")-1, 1, &rv);
ZVAL_DEREF(prop);
zend_string *str = zval_get_string(prop);

RETURN_STR(str);
}
4 changes: 2 additions & 2 deletions ext/mysqli/tests/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The mysqli extension tests

To run the tests, a test database must be created in the MySQL command-line:
To run the tests, a test database must be created in the MySQL command-line:
```sql
CREATE DATABASE test;
```
Expand Down Expand Up @@ -36,4 +36,4 @@ MYSQL_TEST_SOCKET

## MySQL User Permissions

The MySQL user used to run the tests must have full permissions on the test database.
The MySQL user used to run the tests must have full permissions on the test database.
4 changes: 2 additions & 2 deletions ext/opcache/jit/zend_jit_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -4570,7 +4570,7 @@ static struct jit_observer_fcall_is_unobserved_data jit_observer_fcall_is_unobse
ir_ref tmp = ir_LOAD_U8(ir_ADD_OFFSET(func_ref, offsetof(zend_function, type)));
ir_ref if_internal_func = ir_IF(ir_AND_U8(tmp, ir_CONST_U8(ZEND_INTERNAL_FUNCTION)));
ir_IF_TRUE(if_internal_func);

ir_ref observer_handler_internal = ir_ADD_OFFSET(run_time_cache, zend_observer_fcall_internal_function_extension * sizeof(void *));

ir_ref if_internal_func_end = ir_END();
Expand Down Expand Up @@ -17103,7 +17103,7 @@ static ir_ref jit_frameless_observer(zend_jit_ctx *jit, const zend_op *opline) {
// Not need for runtime cache or generator checks here, we just need if_unobserved
ir_ref if_unobserved = jit_observer_fcall_is_unobserved_start(jit, fbc, &observer_handler, IR_UNUSED, IR_UNUSED).if_unobserved;

// Call zend_frameless_observed_call for the main logic.
// Call zend_frameless_observed_call for the main logic.
ir_CALL_1(IR_VOID, ir_CONST_ADDR((size_t)zend_frameless_observed_call), jit_FP(jit));

ir_ref skip = ir_END();
Expand Down
2 changes: 1 addition & 1 deletion ext/pcntl/pcntl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ PHP_FUNCTION(pcntl_setcpuaffinity)
zend_argument_value_error(2, "cpu id must be between 0 and " ZEND_ULONG_FMT " (" ZEND_LONG_FMT ")", maxcpus, cpu);
RETURN_THROWS();
}

if (!PCNTL_CPU_ISSET(cpu, mask)) {
PCNTL_CPU_SET(cpu, mask);
}
Expand Down
2 changes: 1 addition & 1 deletion sapi/embed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ $ gcc \
If all goes to plan you should be able to run the program.

```bash
$ ./a.out
$ ./a.out
Number of functions loaded: 1046
```

Expand Down
4 changes: 2 additions & 2 deletions tests/basic/errorlog_permission.phpt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
Check permissions for created errorlog file
--SKIPIF--
<?php
<?php
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
die("skip this test on windows");
}
Expand All @@ -26,7 +26,7 @@ try {

printf("got permissions=%o\n", fileperms(LOG_FILENAME) & 0777);
printf("errorlog contents\n%s", file_get_contents(LOG_FILENAME));

umask($oldMask);
} finally {
unlink(LOG_FILENAME);
Expand Down
Loading