Skip to content

Commit 832c608

Browse files
jjerguslexidor
andauthored
rewrite XHP guide for namespace support + xhp-lib v4 (#901)
https://hhvm.com/blog/2020/09/02/XHP-namespaces-and-syntax.html * rewrite all XHP guides and examples to be accurate with default settings in HHVM 4.73+ * old behavior is documented in "Historical note" sections * removed "introduction"; renamed "some basics" to "introduction" * moved 2 sections from there to a new "setup" guide, as they became much longer * rewrite attribute transfer section to use ...splat * targets HHVM v4.73.0 * update to xhp-lib v4.0 * applied automated migrations: --add-xhp-children-declaration-method, --remove-xhp-child-declarations, --demangle-xhp-class-names, --xhp-class-modifier Co-authored-by: Lexidor Digital <[email protected]>
1 parent 9bad3bc commit 832c608

File tree

137 files changed

+1286
-792
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1286
-792
lines changed

.deploy/built-site.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Creates a docker image with a built copy of the site. Not repo-auth.
22
# Useful as a scratch/testing area.
3-
FROM hhvm/hhvm:4.68-latest
3+
FROM hhvm/hhvm:4.73-latest
44
ARG DOCKER_BUILD_ENV=prod
55
ENV TZ UTC
66
ENV DEBIAN_FRONTEND noninteractive

.deploy/prod.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM hhvm/hhvm-proxygen:4.68-latest
1+
FROM hhvm/hhvm-proxygen:4.73-latest
22

33
ADD hhvm.prod.ini /etc/hhvm/site.ini
44
ADD hhvm.hhbc /var/www/hhvm.hhbc

.hhconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ disallow_elvis_space=true
44
disallow_non_arraykey_keys=true
55
disallow_unsafe_comparisons=true
66
decl_override_require_hint=true
7+
disable_xhp_children_declarations=true
8+
check_xhp_attribute=true
79
enable_experimental_tc_features=shape_field_check,sealed_classes,reified_generics
810
allowed_decl_fixme_codes=1002,2053,4030,4035,4045,4047,4101,4323
9-
allowed_fixme_codes_strict=1002,2011,2049,2050,2053,4005,4006,4026,4027,4030,4035,4045,4047,4051,4053,4057,4063,4064,4067,4101,4104,4106,4107,4108,4110,4112,4128,4135,4165,4188,4193,4240,4251,4281,4297,4323,4324,4347,4371
11+
allowed_fixme_codes_strict=1002,2011,2049,2050,2053,4005,4006,4026,4027,4030,4035,4045,4047,4051,4053,4057,4063,4064,4067,4101,4104,4106,4107,4108,4110,4112,4128,4135,4165,4188,4193,4240,4251,4281,4297,4314,4323,4324,4347,4371

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
- docker
55
env:
66
matrix:
7-
- HHVM_VERSION=4.68-latest
7+
- HHVM_VERSION=4.73-latest
88
global:
99
- secure: LoQU9i44IKyQGx7+i/d1do+H/CLvC3a8UO668E/AgWG8z+1gnCadDbUfFXHDV20cXN+7wFZXs+qr9BfI/iiiQmG2uHs+iYo6svujwjPqhbGlIFkUkPYQHW1dQg8f0Bj1q+OgOB7zNO6CJj6njXgciOAXZizhIdhfIIqMGQNfLlJlnk2hzrQmQVc4Pqce1eV8tsUjoWcz3vtjCId8xcS9kSDzQFbsRv3pule23WseGqbPuoWVFazHU/BGSIF/QnO7OTTw8p9/fItmoNBf6zGHZqHBklEfRRWgg8iV064u92vp1aKeJHpYhOBbOBe7bzjXsMAtjUgUEAXf58A0clLDo+l6uxtsHKAxalCv4ulLrVLTraCK5HItrA3fnB1AGofJUDKRe6y2AMaqhGm0vmEsKF0ooTCMQ3MvatRm5o7UtrVwOabGie6BEctnLXDbIgcBKOZk7led3Mh4UW68s/ciiE2cgCIkNgxDoNytoZozQsXPcA87VqUkypX2RacLrH/JIBy+vZAsJvUCnsrDzsDuMqeWuNw27VKL3CjucvzEevIC3nV+ZfC0e4K6UJetb6kPRIVsfS2E6JIg/SKd2aIOmTxlD28XbDiMiQRh3lLkhuegTu/QVPt9bgvSnvDyOsKoAbmZRJHDhePmyzcavKPtdP02xF/2BPTu9Y/9czIQnxA=
1010
- secure: KjiRypAiRl0tvxAq66fneIfHY5lZI5EVDyDf/m2GSrsoMIMFDNeSCkvWuq5UzJjk2NWvXzSgoZZHod1yIRl+KiVqRqmbF11QnZffd8TfDAY8qf/zrinnP+Jw/Vzy9g5xlMNM+ncTijaWXYlqkEYSKGJxTaARymHbqSTtS+G14HyJ6yPRDPJkr+Q2Xvw0mQnNPQshqzISb2emdEpO/Fowu2ti8DD7jaFYakPBV1gndcW1TFLYMFE1R8qrWcPP+ntcqWAQA0nN+xS/ugH/cDxq+RfePz83egtph43l3S3lzSP2CVCEhIAiMvkqN+IsHKoIXZ88L4MI2pIyA4Wt1iVmITSjD9RDg3f6OJ107uo/htkGRKulWs3XPzabMftBp8ATygpUwb2yr3rRUDV+R8m56gaiDGi0zQoxSpPo/bCl6T6jhS6of86ow6OVkdak0F+83PFAkmS+C+ekJP/0XQrnyRY9+iWKcIzZbVMRD1gpavJBD2gCrXgwtORumHkTzFYEF2vqjvt/BqxvwnwXWry5E5lEIk79CmENDulWfBBMBa/LdIkd0hv7Mr8t76bu+lj7AP6UEJIB+9odYZnaKrKpOkC4frdaOJZDzK2ArBhIKNUbL4xP34xBnvjuWyFoqTMMLBxxOjW8uVlX74SMbfq6Gg2o0A9xY+l1Vb9sNqbcKjY=

DOCSITE_REV

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1fa47f258c6b68f8ec01899aa82fd6ffa0957109

api-examples/class.HH.Map/toDArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ function main(): void {
1414

1515
$array = $m->toDArray();
1616

17-
\var_dump(\is_array($array));
17+
\var_dump(\HH\is_any_array($array));
1818
\var_dump($array);
1919
}

api-examples/class.HH.Map/toKeysArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
$keys_array = $m->toKeysArray();
1313

14-
var_dump(is_array($keys_array));
14+
var_dump(\HH\is_any_array($keys_array));
1515
var_dump($keys_array);

api-examples/class.HH.Map/toValuesArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111

1212
$array = $m->toValuesArray();
1313

14-
var_dump(is_array($array));
14+
var_dump(\HH\is_any_array($array));
1515
var_dump($array);

api-examples/class.HH.Pair/toVArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ function main(): void {
88

99
$array = $p->toVArray();
1010

11-
\var_dump(\is_array($array));
11+
\var_dump(\HH\is_any_array($array));
1212
\var_dump($array);
1313
}

api-examples/class.HH.Pair/toValuesArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
$array = $p->toValuesArray();
88

9-
var_dump(is_array($array));
9+
var_dump(\HH\is_any_array($array));
1010
var_dump($array);

api-examples/class.HH.Set/toDArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ function run() {
88

99
$array = $s->toDArray();
1010

11-
\var_dump(\is_array($array));
11+
\var_dump(\HH\is_any_array($array));
1212
\var_dump($array);
1313
}

api-examples/class.HH.Set/toVArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ function run() {
88

99
$array = $s->toVArray();
1010

11-
\var_dump(\is_array($array));
11+
\var_dump(\HH\is_any_array($array));
1212
\var_dump($array);
1313
}

api-examples/class.HH.Set/toValuesArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
$array = $s->toValuesArray();
88

9-
var_dump(is_array($array));
9+
var_dump(\HH\is_any_array($array));
1010
var_dump($array);

api-examples/class.HH.Vector/toKeysArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
$keys_array = $v->toKeysArray();
88

9-
var_dump(is_array($keys_array));
9+
var_dump(\HH\is_any_array($keys_array));
1010
var_dump($keys_array);

api-examples/class.HH.Vector/toVArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ function main(): void {
88

99
$array = $v->toVArray();
1010

11-
\var_dump(\is_array($array));
11+
\var_dump(\HH\is_any_array($array));
1212
\var_dump($array);
1313
}

api-examples/class.HH.Vector/toValuesArray/001-basic-usage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
$array = $v->toValuesArray();
88

9-
var_dump(is_array($array));
9+
var_dump(\HH\is_any_array($array));
1010
var_dump($array);

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"require": {
3-
"facebook/xhp-lib": "^3.1.1",
4-
"hhvm": "4.68.*",
5-
"usox/hackttp": "*",
6-
"hhvm/hhvm-autoload": "^2.0|^3.0",
3+
"facebook/xhp-lib": "^4.0",
4+
"hhvm": "4.73.*",
5+
"usox/hackttp": "dev-master",
6+
"hhvm/hhvm-autoload": "^3.0",
77
"hhvm/type-assert": "^4.0",
88
"facebook/hack-codegen": "^4.0",
99
"facebook/hack-router-codegen": ">=0.14 <1.0",
@@ -17,6 +17,7 @@
1717
"hhvm/hhast": "^4.0",
1818
"facebook/definition-finder": "^2.0.0",
1919
"hhvm/hacktest": "^2.0",
20+
"usox/hackmock": "dev-master",
2021
"facebook/fbexpect": "^2.6.1"
2122
}
2223
}

0 commit comments

Comments
 (0)