From 5e8cc7c3b5009ea936df7c3c597cd60d7d0dc6dc Mon Sep 17 00:00:00 2001 From: Lexidor Digital <31805625+lexidor@users.noreply.github.com> Date: Mon, 27 Jan 2020 23:04:12 +0100 Subject: [PATCH] Backport Ref to 3.28 (#111) * Backport Ref to 3.28 * (Re)target 3.28 * Test using Docker * Use a hard version number The newer conventions state that we should use a version ending in latest However, this version of HHVM is nolonger supported There will never be an hhvm 3.28.4 Therefore, I can safely test against hhvm 3.28.3 * Fix composer install --- .travis.sh | 27 +++++++++++++++++++++------ .travis.yml | 17 ++++++++++------- src/Ref.php | 28 ++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 src/Ref.php diff --git a/.travis.sh b/.travis.sh index 9e40fd7a..433797f8 100755 --- a/.travis.sh +++ b/.travis.sh @@ -1,12 +1,27 @@ #!/bin/sh set -ex +apt update -y +DEBIAN_FRONTEND=noninteractive apt install -y php-cli zip unzip hhvm --version +php --version +if [ ! -e .git/refs/heads/master ]; then + # - Travis clones with `--branch`, then moves to a detached HEAD state + # - if we're on a detached HEAD, Composer uses master to resolve branch + # aliases. + # So, create the master branch :p + git branch master HEAD +fi -composer install +( + cd $(mktemp -d) + curl https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +) +if (hhvm --version | grep -q -- -dev); then + # Doesn't exist in master, but keep it here so that we can test release + # branches on nightlies too + rm -f composer.lock +fi +hhvm /usr/local/bin/composer install hh_client - -vendor/bin/hacktest tests/ - -echo > .hhconfig -hh_server --check $(pwd) +vendor/bin/hacktest tests/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 6a15bd89..659581df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,13 @@ -language: php -php: - - hhvm -matrix: - allow_failures: - - php: hhvm +sudo: required +language: generic +services: docker +env: +- HHVM_VERSION=3.28.3 +install: +- docker pull hhvm/hhvm:$HHVM_VERSION script: - - ./.travis.sh +- docker run --rm -w /var/source -v $(pwd):/var/source hhvm/hhvm:$HHVM_VERSION ./.travis.sh notifications: webhooks: https://code.facebook.com/travis/webhook/ + slack: + secure: LH2n9tQoW3/OUO/ppXLnGIVAbYtl07avQne/gkcal/csGc18BSly15/bNZvGTlC65aac+yjbGHlcWuBm8Qyl5l2oWZADqoRN7+HeOYw1qSx2eRA5BzVcdKd9eHjl5xobxLC2NXZL/NSiN+Ku/YDuzzkwpGqIcC4EiwvFsab6B2rigdazFaNRceAxnyYwNs3VdzFj9vBDqbfUDFV7lgjZJxbKos26O/Z4F58a2tsV2hbT+tF8W3hfPrMaYuxWVv2+Irc0uGoNc5EG+2eRT5AzMtp6YKzQ5LzEkC/lNwojUg/dr9xV+3vZu+IARy7HsBuX5KZo3IBGHL18q8srgEM4NBQy8IUmVAlGGw7vw1cInIoqUTOvHBqVvDAs2RNr5f7u+2Li0Sw9vuGhoeNtLVvTjZ9r5XmEzdEx9pUFrsO16YdJLnpiYiyWlWAeAkDljXD/d5L/i0sZgaeY/eubYADJr/ZA+M78aiLuw5eEWqu5s9a4xhrGEBkUHyPRpXU1AxVAPr1L6/PK47QKYu1h45QfMQL8TmrNw9VPLUIm5P4k3RFz9CC5C35u5HfFTubErcDl1CZUSoGUuW4foTbkWSJGlgvQquS824mL2VIO5Ut6J6+/2iqsK/HfKOiToDpiiwpe2KoQsyy5QHVWMVNTuKPou1yYH+6Z3DIx8/wEAkvCA+U= \ No newline at end of file diff --git a/src/Ref.php b/src/Ref.php new file mode 100644 index 00000000..06368c4c --- /dev/null +++ b/src/Ref.php @@ -0,0 +1,28 @@ +>` + * over `Vector`. + * + * `C\reduce()` and `C\reduce_with_key()` can also be used in some situations + * to avoid this class. + */ +final class Ref { + <<__RxShallow>> + public function __construct(public T $value) {} +}