[wp-meta] [Making WordPress.org] #3506: Core SVN commit blocked by a pre-commit hook
Making WordPress.org
noreply at wordpress.org
Sun Mar 11 16:54:52 UTC 2018
#3506: Core SVN commit blocked by a pre-commit hook
-----------------------------+-----------------
Reporter: SergeyBiryukov | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Version Control | Keywords:
-----------------------------+-----------------
Stumbled upon a pre-commit hook on core SVN blocking a commit to unit
tests (adding support for PHPUnit 7.x) due to PHP7 return type
declarations: https://core.trac.wordpress.org/ticket/43218#comment:16
{{{
Commit failed (details follow):
Commit blocked by pre-commit hook (exit code 1) with output:
***********************************
PHP error in: trunk/tests/phpunit/includes/phpunit7/speed-trap-
listener.php:
Parse error: syntax error, unexpected ':', expecting ';' or '{' in
trunk/tests/phpunit/includes/phpunit7/speed-trap-listener.php on line 57
Errors parsing trunk/tests/phpunit/includes/phpunit7/speed-trap-
listener.php
}}}
The line in question is:
{{{
public function addError( PHPUnit\Framework\Test $test, Throwable $t,
float $time ): void {
}}}
PHPUnit 7.x requires PHP 7.1+, but the file with the PHP7 syntax is
included conditionally, and the patch is tested on PHP 5.2.17 with PHPUnit
3.6.12 as well.
Seems like the pre-commit hook should be adjusted to allow PHP7 syntax. If
someone unintentionally makes a PHP7-specific commit to core, Travis
failures on older PHP versions would let us know.
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/3506>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list