Add HH\Readonly\Shapes class
commit8277728c56b5b66e7ae8bbfb250690302b4f6974
authorJames Wu <jjwu@fb.com>
Fri, 4 Feb 2022 03:45:33 +0000 (3 19:45 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 4 Feb 2022 03:47:07 +0000 (3 19:47 -0800)
tree5a0e9a23a2057be004faa3d4cc393a6824918828
parent2150b563f0465f97783ddc6ca8be571091b2b314
Add HH\Readonly\Shapes class

Summary:
Since we aren't planning on supporting readonly polymorphism (due to the increase in complexity to the language of adding such a feature), we'll likely want some interim Readonly\ namespace versions of common functions in Shapes. These don't pollute the main systemlib namespace, and mostly just call directly into their original Shapes class counterparts, which to me feel like the least invasive way to add this without introducing too much technical debt/cognitive load.

We can incrementally remove these if we do decide to add polymorphism for readonly, but right now the tradeoffs of doing so would certainly be too much complexity without TIC. So we should expect these functions to be around for a while. Feedback and concerns appreciated!

Reviewed By: oulgen

Differential Revision: D33730938

fbshipit-source-id: 3948731bb9055de7378ed35e058596e5de307f34
hphp/system/php/lang/readonly.ns.php
hphp/system/php/misc/idx.php
hphp/test/slow/readonly/readonly_shapes_ext.php [new file with mode: 0644]
hphp/test/slow/readonly/readonly_shapes_ext.php.expectf [new file with mode: 0644]