Switch to PHP for conversion script to avoid issues with read in travis

This commit is contained in:
Daniil Gentili 2019-12-26 21:33:51 +01:00
parent efef22d747
commit 474691d81f
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1,17 @@
<?php
$input = \file_get_contents('vendor/league/uri-interfaces/src/Contracts/UriInterface.php');
\preg_match_all("/public function (\w+)[(].*/", $input, $matches);
$search = $matches[1];
$replace = $matches[0];
foreach ($search as &$method) {
$method = "/public function $method".'[(].*/';
}
foreach ($replace as &$method) {
$method= \str_replace(';', '', $method);
}
$input = \file_get_contents('vendor/league/uri/src/Uri.php');
$input = \preg_replace($search, $replace, $input);
\file_put_contents('vendor/league/uri/src/Uri.php', $input);

View File

@ -3,7 +3,7 @@
rm -rf vendor/danog/madelineproto/docs
sed -re 's/\?(\w*) (\$\w+)/\2 = NULL/g;s/= null = null/=null/ig;s/: self//g' -i vendor/league/uri-interfaces/src/Contracts/UriInterface.php
while read line; do l=$(echo "$line" | sed 's/[(].*//g'); sed -i "s/$l.*/$line/g" vendor/league/uri/src/Uri.php; done <<< $(grep 'public function' vendor/league/uri-interfaces/src/Contracts/UriInterface.php | sed 's/;//g;s/: self//g')
php $(dirname $0)/prepare-5.php
sed -i 's/handleConnectionWindowIncrement[(]\$windowSize[)]/handleConnectionWindowIncrement(int $windowSize)/g' vendor/amphp/http-client/src/Connection/Internal/Http2ConnectionProcessor.php