Created
February 25, 2020 17:01
-
-
Save fredemmott/2e945f3a8fc78a61be11c77be3e5cb31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 45f46c67ab06976bc96265e55aa516a6336285cc | |
Author: Fred Emmott <fe@fb.com> | |
Date: Tue Feb 25 08:33:29 2020 -0800 | |
codemod | |
diff --git a/src/children/XHPChildDeclarationConsistencyValidation.hack b/src/children/XHPChildDeclarationConsistencyValidation.hack | |
index 8010ed4..3e2e092 100644 | |
--- a/src/children/XHPChildDeclarationConsistencyValidation.hack | |
+++ b/src/children/XHPChildDeclarationConsistencyValidation.hack | |
@@ -11,7 +11,7 @@ use namespace \Facebook\XHP\ChildValidation as XHPChild; | |
/** Verify that a new child declaration matches the legacy codegen. */ | |
trait XHPChildDeclarationConsistencyValidation { | |
- require extends :x:composable-element; | |
+ require extends :x:composable_element; | |
abstract protected static function getChildrenDeclaration( | |
): XHPChild\Constraint; | |
diff --git a/src/children/XHPChildValidation.hack b/src/children/XHPChildValidation.hack | |
index a27b438..bf38819 100644 | |
--- a/src/children/XHPChildValidation.hack | |
+++ b/src/children/XHPChildValidation.hack | |
@@ -11,7 +11,7 @@ use namespace \Facebook\XHP\ChildValidation as XHPChild; | |
/** Verify that a new child declaration matches the legacy codegen. */ | |
trait XHPChildValidation { | |
- require extends :x:composable-element; | |
+ require extends :x:composable_element; | |
abstract protected static function getChildrenDeclaration( | |
): XHPChild\Constraint; | |
diff --git a/src/core/ComposableElement.php b/src/core/ComposableElement.php | |
index 2a3a652..d6940cf 100644 | |
--- a/src/core/ComposableElement.php | |
+++ b/src/core/ComposableElement.php | |
@@ -12,7 +12,7 @@ use type Facebook\TypeAssert\IncorrectTypeException; | |
use namespace Facebook\TypeAssert; | |
use namespace HH\Lib\{C, Str}; | |
-abstract class :x:composable-element extends :xhp { | |
+abstract xhp class x:composable_element extends :xhp { | |
private Map<string, mixed> $attributes = Map {}; | |
private Vector<XHPChild> $children = Vector {}; | |
private Map<string, mixed> $context = Map {}; | |
@@ -46,7 +46,7 @@ abstract class :x:composable-element extends :xhp { | |
foreach ($attributes as $key => $value) { | |
if (self::isSpreadKey($key)) { | |
invariant( | |
- $value is :x:composable-element, | |
+ $value is :x:composable_element, | |
"Only XHP can be used with an attribute spread operator", | |
); | |
$this->spreadElementImpl($value); | |
@@ -326,7 +326,7 @@ abstract class :x:composable-element extends :xhp { | |
* Defaults from $xhp are copied as well, if they are present. | |
*/ | |
protected final function spreadElementImpl( | |
- :x:composable-element $element, | |
+ :x:composable_element $element, | |
): void { | |
foreach ($element::__xhpReflectionAttributes() as $attr_name => $attr) { | |
$our_attr = static::__xhpReflectionAttribute($attr_name); | |
diff --git a/src/core/Element.php b/src/core/Element.php | |
index 6892803..d37327e 100644 | |
--- a/src/core/Element.php | |
+++ b/src/core/Element.php | |
@@ -15,7 +15,7 @@ | |
* This is important because most elements should not be dealing with strings | |
* of markup. | |
*/ | |
-abstract class :x:element extends :x:composable-element implements XHPRoot { | |
+abstract xhp class x:element extends :x:composable_element implements XHPRoot { | |
abstract protected function render(): XHPRoot; | |
final public function toString(): string { | |
diff --git a/src/core/Frag.php b/src/core/Frag.php | |
index ec7ec02..57d0730 100644 | |
--- a/src/core/Frag.php | |
+++ b/src/core/Frag.php | |
@@ -14,7 +14,7 @@ | |
* element the <x:frag /> will disappear and each child will be sequentially | |
* appended to the element. | |
*/ | |
-class :x:frag extends :x:primitive { | |
+xhp class x:frag extends :x:primitive { | |
protected function stringify(): string { | |
$buf = ''; | |
foreach ($this->getChildren() as $child) { | |
diff --git a/src/core/Primitive.php b/src/core/Primitive.php | |
index 9a32912..8bcd3ce 100644 | |
--- a/src/core/Primitive.php | |
+++ b/src/core/Primitive.php | |
@@ -14,7 +14,7 @@ | |
* needs to directly implement stringify(). All other elements should subclass | |
* from :x:element. | |
*/ | |
-abstract class :x:primitive extends :x:composable-element implements XHPRoot { | |
+abstract xhp class x:primitive extends :x:composable_element implements XHPRoot { | |
abstract protected function stringify(): string; | |
final public function toString(): string { | |
@@ -30,7 +30,7 @@ abstract class :x:primitive extends :x:composable-element implements XHPRoot { | |
$children = $this->getChildren(); | |
$awaitables = Map {}; | |
foreach ($children as $idx => $child) { | |
- if ($child is :x:composable-element) { | |
+ if ($child is :x:composable_element) { | |
$child->__transferContext($this->getAllContexts()); | |
$awaitables[$idx] = $child->__flushSubtree(); | |
} | |
diff --git a/src/core/ReflectionXHPClass.php b/src/core/ReflectionXHPClass.php | |
index a4102a4..7d00079 100644 | |
--- a/src/core/ReflectionXHPClass.php | |
+++ b/src/core/ReflectionXHPClass.php | |
@@ -9,7 +9,7 @@ | |
*/ | |
class ReflectionXHPClass { | |
- public function __construct(private classname<:x:composable-element> $className) { | |
+ public function __construct(private classname<:x:composable_element> $className) { | |
invariant( | |
class_exists($this->className), | |
'Invalid class name: %s', | |
@@ -21,7 +21,7 @@ class ReflectionXHPClass { | |
return new ReflectionClass($this->getClassName()); | |
} | |
- public function getClassName(): classname<:x:composable-element> { | |
+ public function getClassName(): classname<:x:composable_element> { | |
return $this->className; | |
} | |
diff --git a/src/core/XHP.php b/src/core/XHP.php | |
index 2282052..e0c5251 100644 | |
--- a/src/core/XHP.php | |
+++ b/src/core/XHP.php | |
@@ -10,7 +10,7 @@ | |
use namespace HH\Lib\Str; | |
-abstract class :xhp implements XHPChild, JsonSerializable { | |
+abstract xhp class xhp implements XHPChild, JsonSerializable { | |
// Must be kept in sync with code generation for XHP | |
const string SPREAD_PREFIX = '...$'; | |
diff --git a/src/core/XHPAttributeCoercion.php b/src/core/XHPAttributeCoercion.php | |
index 5b8c84c..87517d5 100644 | |
--- a/src/core/XHPAttributeCoercion.php | |
+++ b/src/core/XHPAttributeCoercion.php | |
@@ -27,7 +27,7 @@ abstract final class XHPAttributeCoercion { | |
} | |
private static function LogCoercion( | |
- :x:composable-element $context, | |
+ :x:composable_element $context, | |
string $what, | |
string $attr, | |
mixed $val, | |
@@ -60,7 +60,7 @@ abstract final class XHPAttributeCoercion { | |
} | |
public static function CoerceToString( | |
- :x:composable-element $context, | |
+ :x:composable_element $context, | |
string $attr, | |
mixed $val, | |
): string { | |
@@ -79,7 +79,7 @@ abstract final class XHPAttributeCoercion { | |
} | |
public static function CoerceToInt( | |
- :x:composable-element $context, | |
+ :x:composable_element $context, | |
string $attr, | |
mixed $val, | |
): int { | |
@@ -94,7 +94,7 @@ abstract final class XHPAttributeCoercion { | |
} | |
public static function CoerceToBool( | |
- :x:composable-element $context, | |
+ :x:composable_element $context, | |
string $attr, | |
mixed $val, | |
): bool { | |
@@ -111,7 +111,7 @@ abstract final class XHPAttributeCoercion { | |
} | |
public static function CoerceToFloat( | |
- :x:composable-element $context, | |
+ :x:composable_element $context, | |
string $attr, | |
mixed $val, | |
): float { | |
diff --git a/src/core/XHPHasTransferAttributes.php b/src/core/XHPHasTransferAttributes.php | |
index 7297f60..d8c973d 100644 | |
--- a/src/core/XHPHasTransferAttributes.php | |
+++ b/src/core/XHPHasTransferAttributes.php | |
@@ -16,6 +16,6 @@ | |
interface XHPHasTransferAttributes { | |
require extends :x:element; | |
public function transferAttributesToRenderedRoot( | |
- :x:composable-element $root, | |
+ :x:composable_element $root, | |
): void; | |
} | |
diff --git a/src/core/XHPRoot.php b/src/core/XHPRoot.php | |
index 0582cd2..0501cd2 100644 | |
--- a/src/core/XHPRoot.php | |
+++ b/src/core/XHPRoot.php | |
@@ -9,5 +9,5 @@ | |
*/ | |
interface XHPRoot extends XHPChild { | |
- require extends :x:composable-element; | |
+ require extends :x:composable_element; | |
} | |
diff --git a/src/exceptions/InvalidChildrenException.php b/src/exceptions/InvalidChildrenException.php | |
index 332ad53..440359a 100644 | |
--- a/src/exceptions/InvalidChildrenException.php | |
+++ b/src/exceptions/InvalidChildrenException.php | |
@@ -9,7 +9,7 @@ | |
*/ | |
class XHPInvalidChildrenException extends XHPException { | |
- public function __construct(:x:composable-element $that, int $index) { | |
+ public function __construct(:x:composable_element $that, int $index) { | |
parent::__construct( | |
'Element `'. | |
XHPException::getElementName($that). | |
diff --git a/src/html/Element.php b/src/html/Element.php | |
index 450acf0..a9e08c0 100644 | |
--- a/src/html/Element.php | |
+++ b/src/html/Element.php | |
@@ -14,7 +14,7 @@ | |
* close to spec as possible. Facebook-specific extensions should go into their | |
* own elements. | |
*/ | |
-abstract class :xhp:html-element extends :x:primitive { | |
+abstract xhp class xhp:html_element extends :x:primitive { | |
use XHPBaseHTMLHelpers; | |
// enum { 'true', 'false' } attributes: these are actually tri-state - | |
diff --git a/src/html/HasXHPBaseHTMLHelpers.php b/src/html/HasXHPBaseHTMLHelpers.php | |
index 82f2992..d3791bc 100644 | |
--- a/src/html/HasXHPBaseHTMLHelpers.php | |
+++ b/src/html/HasXHPBaseHTMLHelpers.php | |
@@ -9,7 +9,7 @@ | |
*/ | |
interface HasXHPBaseHTMLHelpers { | |
- require extends :x:composable-element; | |
+ require extends :x:composable_element; | |
public function addClass(string $class): this; | |
public function conditionClass(bool $cond, string $class): this; | |
diff --git a/src/html/PcdataElement.php b/src/html/PcdataElement.php | |
index a603d80..22c3d15 100644 | |
--- a/src/html/PcdataElement.php | |
+++ b/src/html/PcdataElement.php | |
@@ -13,7 +13,7 @@ | |
*/ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-abstract class :xhp:pcdata-element extends :xhp:html-element { | |
+abstract xhp class xhp:pcdata_element extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/RawPcdataElement.php b/src/html/RawPcdataElement.php | |
index 3cdb05c..0f96e86 100644 | |
--- a/src/html/RawPcdataElement.php | |
+++ b/src/html/RawPcdataElement.php | |
@@ -21,7 +21,7 @@ | |
* the end of the s content. In valid documents, this would be the end tag for | |
* the element." | |
*/ | |
-abstract class :xhp:raw-pcdata-element extends :xhp:pcdata-element { | |
+abstract xhp class xhp:raw_pcdata_element extends :xhp:pcdata_element { | |
protected function stringify(): string { | |
$buf = $this->renderBaseAttrs().'>'; | |
foreach ($this->getChildren() as $child) { | |
diff --git a/src/html/Singleton.php b/src/html/Singleton.php | |
index f600e3f..6a6e9dd 100644 | |
--- a/src/html/Singleton.php | |
+++ b/src/html/Singleton.php | |
@@ -14,7 +14,7 @@ | |
*/ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-abstract class :xhp:html-singleton extends :xhp:html-element { | |
+abstract xhp class xhp:html_singleton extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/XHPBaseHTMLHelpers.php b/src/html/XHPBaseHTMLHelpers.php | |
index 9e848ae..c327807 100644 | |
--- a/src/html/XHPBaseHTMLHelpers.php | |
+++ b/src/html/XHPBaseHTMLHelpers.php | |
@@ -10,7 +10,7 @@ | |
trait XHPBaseHTMLHelpers implements HasXHPBaseHTMLHelpers { | |
- require extends :x:composable-element; | |
+ require extends :x:composable_element; | |
/* | |
* Appends a string to the "class" attribute (space separated). | |
diff --git a/src/html/XHPHelpers.php b/src/html/XHPHelpers.php | |
index 7903aeb..6c67d6f 100644 | |
--- a/src/html/XHPHelpers.php | |
+++ b/src/html/XHPHelpers.php | |
@@ -20,7 +20,7 @@ interface HasXHPHelpers | |
* attribute :xhp:html-element; | |
*/ | |
trait XHPHelpers implements HasXHPHelpers { | |
- require extends :x:composable-element; | |
+ require extends :x:composable_element; | |
use XHPBaseHTMLHelpers; | |
@@ -28,7 +28,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
* Copies all attributes that are set on $this and valid on $target to | |
* $target. | |
*/ | |
- final public function copyAllAttributes(:x:composable-element $target): void { | |
+ final public function copyAllAttributes(:x:composable_element $target): void { | |
$this->transferAttributesImpl($target, Set {}); | |
} | |
@@ -37,7 +37,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
* $target to $target. | |
*/ | |
final public function copyCustomAttributes( | |
- :x:composable-element $target, | |
+ :x:composable_element $target, | |
): void { | |
$this->transferAttributesImpl($target); | |
} | |
@@ -47,7 +47,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
* valid on $target to $target. | |
*/ | |
final public function copyAttributesExcept( | |
- :x:composable-element $target, | |
+ :x:composable_element $target, | |
Set<string> $ignore, | |
): void { | |
$this->transferAttributesImpl($target, $ignore); | |
@@ -58,7 +58,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
* $target. This will unset all transfered attributes from $this. | |
*/ | |
final public function transferAllAttributes( | |
- :x:composable-element $target, | |
+ :x:composable_element $target, | |
): void { | |
$this->transferAttributesImpl($target, Set {}, true); | |
} | |
@@ -68,7 +68,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
* $target to $target. This will unset all transfered attributes from $this. | |
*/ | |
final public function transferCustomAttributes( | |
- :x:composable-element $target, | |
+ :x:composable_element $target, | |
): void { | |
$this->transferAttributesImpl($target, null, true); | |
} | |
@@ -79,7 +79,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
* $this. | |
*/ | |
final public function transferAttributesExcept( | |
- :x:composable-element $target, | |
+ :x:composable_element $target, | |
Set<string> $ignore, | |
): void { | |
$this->transferAttributesImpl($target, $ignore, true); | |
@@ -90,12 +90,12 @@ trait XHPHelpers implements HasXHPHelpers { | |
* directly. Instead, use one of the transfer/copy flavors above. | |
*/ | |
final private function transferAttributesImpl( | |
- :x:composable-element $target, | |
+ :x:composable_element $target, | |
?Set<string> $ignore = null, | |
bool $remove = false, | |
): void { | |
if ($ignore === null) { | |
- $ignore = :xhp:html-element::__xhpAttributeDeclaration(); | |
+ $ignore = :xhp:html_element::__xhpAttributeDeclaration(); | |
} else { | |
$ignore = array_fill_keys($ignore->toArray(), true); | |
} | |
@@ -143,7 +143,7 @@ trait XHPHelpers implements HasXHPHelpers { | |
} | |
final public function transferAttributesToRenderedRoot( | |
- :x:composable-element $root, | |
+ :x:composable_element $root, | |
): void { | |
if (:xhp::isAttributeValidationEnabled() && $root is :x:element) { | |
if (!($root is HasXHPHelpers)) { | |
diff --git a/src/html/tags/a/A.php b/src/html/tags/a/A.php | |
index 8b4fd3a..69429bb 100644 | |
--- a/src/html/tags/a/A.php | |
+++ b/src/html/tags/a/A.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :a extends :xhp:html-element { | |
+xhp class a extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string download, | |
diff --git a/src/html/tags/a/Abbr.php b/src/html/tags/a/Abbr.php | |
index 651f4aa..14b0e4b 100644 | |
--- a/src/html/tags/a/Abbr.php | |
+++ b/src/html/tags/a/Abbr.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :abbr extends :xhp:html-element { | |
+xhp class abbr extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/a/Address.php b/src/html/tags/a/Address.php | |
index f8882fc..8ffdaa7 100644 | |
--- a/src/html/tags/a/Address.php | |
+++ b/src/html/tags/a/Address.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :address extends :xhp:html-element { | |
+xhp class address extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
// May not contain %heading, %sectioning, :header, :footer, or :address | |
diff --git a/src/html/tags/a/Area.php b/src/html/tags/a/Area.php | |
index 94c4f7e..6205c82 100644 | |
--- a/src/html/tags/a/Area.php | |
+++ b/src/html/tags/a/Area.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :area extends :xhp:html-singleton { | |
+xhp class area extends :xhp:html_singleton { | |
attribute | |
string alt, | |
string coords, | |
diff --git a/src/html/tags/a/Article.php b/src/html/tags/a/Article.php | |
index 0c5158e..9820590 100644 | |
--- a/src/html/tags/a/Article.php | |
+++ b/src/html/tags/a/Article.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :article extends :xhp:html-element { | |
+xhp class article extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %sectioning; | |
diff --git a/src/html/tags/a/Aside.php b/src/html/tags/a/Aside.php | |
index 57b476d..1ae7d8d 100644 | |
--- a/src/html/tags/a/Aside.php | |
+++ b/src/html/tags/a/Aside.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :aside extends :xhp:html-element { | |
+xhp class aside extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %sectioning; | |
diff --git a/src/html/tags/a/Audio.php b/src/html/tags/a/Audio.php | |
index 8e6f86e..b282112 100644 | |
--- a/src/html/tags/a/Audio.php | |
+++ b/src/html/tags/a/Audio.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :audio extends :xhp:html-element { | |
+xhp class audio extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool autoplay, | |
diff --git a/src/html/tags/b/B.php b/src/html/tags/b/B.php | |
index 6da085c..70b7674 100644 | |
--- a/src/html/tags/b/B.php | |
+++ b/src/html/tags/b/B.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :b extends :xhp:html-element { | |
+xhp class b extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/b/Base.php b/src/html/tags/b/Base.php | |
index 5957223..0a8d235 100644 | |
--- a/src/html/tags/b/Base.php | |
+++ b/src/html/tags/b/Base.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :base extends :xhp:html-singleton { | |
+xhp class base extends :xhp:html_singleton { | |
attribute | |
string href, | |
string target; | |
diff --git a/src/html/tags/b/Bdi.php b/src/html/tags/b/Bdi.php | |
index 326a1cf..75e9566 100644 | |
--- a/src/html/tags/b/Bdi.php | |
+++ b/src/html/tags/b/Bdi.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :bdi extends :xhp:html-element { | |
+xhp class bdi extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/b/Bdo.php b/src/html/tags/b/Bdo.php | |
index c5b5308..ae9ad4e 100644 | |
--- a/src/html/tags/b/Bdo.php | |
+++ b/src/html/tags/b/Bdo.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :bdo extends :xhp:html-element { | |
+xhp class bdo extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/b/Blockquote.php b/src/html/tags/b/Blockquote.php | |
index ca1abc6..4c84787 100644 | |
--- a/src/html/tags/b/Blockquote.php | |
+++ b/src/html/tags/b/Blockquote.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :blockquote extends :xhp:html-element { | |
+xhp class blockquote extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute string cite; | |
category %flow, %sectioning; | |
diff --git a/src/html/tags/b/Body.php b/src/html/tags/b/Body.php | |
index d6ad0ea..ce961d5 100644 | |
--- a/src/html/tags/b/Body.php | |
+++ b/src/html/tags/b/Body.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :body extends :xhp:html-element { | |
+xhp class body extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string onafterprint, | |
diff --git a/src/html/tags/b/Br.php b/src/html/tags/b/Br.php | |
index 21a1ecd..1ef1f74 100644 | |
--- a/src/html/tags/b/Br.php | |
+++ b/src/html/tags/b/Br.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :br extends :xhp:html-singleton { | |
+xhp class br extends :xhp:html_singleton { | |
category %flow, %phrase; | |
protected string $tagName = 'br'; | |
} | |
diff --git a/src/html/tags/b/Button.php b/src/html/tags/b/Button.php | |
index bc85989..7573e11 100644 | |
--- a/src/html/tags/b/Button.php | |
+++ b/src/html/tags/b/Button.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :button extends :xhp:html-element { | |
+xhp class button extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool autofocus, | |
diff --git a/src/html/tags/c/Canvas.php b/src/html/tags/c/Canvas.php | |
index 399197b..3f0927d 100644 | |
--- a/src/html/tags/c/Canvas.php | |
+++ b/src/html/tags/c/Canvas.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :canvas extends :xhp:html-element { | |
+xhp class canvas extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
int height, | |
diff --git a/src/html/tags/c/Caption.php b/src/html/tags/c/Caption.php | |
index e187249..5e6eadf 100644 | |
--- a/src/html/tags/c/Caption.php | |
+++ b/src/html/tags/c/Caption.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :caption extends :xhp:html-element { | |
+xhp class caption extends :xhp:html_element { | |
use XHPChildValidation; | |
// Should not contain :table | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/c/Cite.php b/src/html/tags/c/Cite.php | |
index 818ed88..af1d1bb 100644 | |
--- a/src/html/tags/c/Cite.php | |
+++ b/src/html/tags/c/Cite.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :cite extends :xhp:html-element { | |
+xhp class cite extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/c/Code.php b/src/html/tags/c/Code.php | |
index 8fcc9de..c75f9a5 100644 | |
--- a/src/html/tags/c/Code.php | |
+++ b/src/html/tags/c/Code.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :code extends :xhp:html-element { | |
+xhp class code extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/c/Col.php b/src/html/tags/c/Col.php | |
index 17f0e15..eadaa87 100644 | |
--- a/src/html/tags/c/Col.php | |
+++ b/src/html/tags/c/Col.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :col extends :xhp:html-singleton { | |
+xhp class col extends :xhp:html_singleton { | |
attribute int span; | |
protected string $tagName = 'col'; | |
} | |
diff --git a/src/html/tags/c/Colgroup.php b/src/html/tags/c/Colgroup.php | |
index f18d080..7516dc2 100644 | |
--- a/src/html/tags/c/Colgroup.php | |
+++ b/src/html/tags/c/Colgroup.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :colgroup extends :xhp:html-element { | |
+xhp class colgroup extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute int span; | |
diff --git a/src/html/tags/c/ConditionalComment.php b/src/html/tags/c/ConditionalComment.php | |
index 775ea05..58d25ed 100644 | |
--- a/src/html/tags/c/ConditionalComment.php | |
+++ b/src/html/tags/c/ConditionalComment.php | |
@@ -14,7 +14,7 @@ | |
*/ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :x:conditional-comment extends :x:primitive { | |
+xhp class x:conditional_comment extends :x:primitive { | |
use XHPChildValidation; | |
attribute string if @required; | |
diff --git a/src/html/tags/d/Data.php b/src/html/tags/d/Data.php | |
index 3f3dc2e..f57b928 100644 | |
--- a/src/html/tags/d/Data.php | |
+++ b/src/html/tags/d/Data.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :data extends :xhp:html-element { | |
+xhp class data extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute string value @required; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/d/Datalist.php b/src/html/tags/d/Datalist.php | |
index 71f2705..f20b484 100644 | |
--- a/src/html/tags/d/Datalist.php | |
+++ b/src/html/tags/d/Datalist.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :datalist extends :xhp:html-element { | |
+xhp class datalist extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/d/Dd.php b/src/html/tags/d/Dd.php | |
index 4b6da27..bf4bb92 100644 | |
--- a/src/html/tags/d/Dd.php | |
+++ b/src/html/tags/d/Dd.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :dd extends :xhp:html-element { | |
+xhp class dd extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/d/Del.php b/src/html/tags/d/Del.php | |
index 61e9623..6288515 100644 | |
--- a/src/html/tags/d/Del.php | |
+++ b/src/html/tags/d/Del.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :del extends :xhp:html-element { | |
+xhp class del extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string cite, | |
diff --git a/src/html/tags/d/Details.php b/src/html/tags/d/Details.php | |
index 546d2c1..201f96a 100644 | |
--- a/src/html/tags/d/Details.php | |
+++ b/src/html/tags/d/Details.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :details extends :xhp:html-element { | |
+xhp class details extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute bool open; | |
category %flow, %phrase, %interactive; | |
diff --git a/src/html/tags/d/Dfn.php b/src/html/tags/d/Dfn.php | |
index 8267137..0543ba5 100644 | |
--- a/src/html/tags/d/Dfn.php | |
+++ b/src/html/tags/d/Dfn.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :dfn extends :xhp:html-element { | |
+xhp class dfn extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/d/Dialog.php b/src/html/tags/d/Dialog.php | |
index bad6d84..ca70f4f 100644 | |
--- a/src/html/tags/d/Dialog.php | |
+++ b/src/html/tags/d/Dialog.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :dialog extends :xhp:html-element { | |
+xhp class dialog extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute bool open; | |
category %flow, %sectioning; | |
diff --git a/src/html/tags/d/Div.php b/src/html/tags/d/Div.php | |
index 5e7776b..a9e4d3a 100644 | |
--- a/src/html/tags/d/Div.php | |
+++ b/src/html/tags/d/Div.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :div extends :xhp:html-element { | |
+xhp class div extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/d/Dl.php b/src/html/tags/d/Dl.php | |
index ffa7531..5275dae 100644 | |
--- a/src/html/tags/d/Dl.php | |
+++ b/src/html/tags/d/Dl.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :dl extends :xhp:html-element { | |
+xhp class dl extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/d/Doctype.php b/src/html/tags/d/Doctype.php | |
index d910cf4..003e78b 100644 | |
--- a/src/html/tags/d/Doctype.php | |
+++ b/src/html/tags/d/Doctype.php | |
@@ -14,7 +14,7 @@ | |
*/ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :x:doctype extends :x:primitive { | |
+xhp class x:doctype extends :x:primitive { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/d/Dt.php b/src/html/tags/d/Dt.php | |
index 2001d93..a2ed4cb 100644 | |
--- a/src/html/tags/d/Dt.php | |
+++ b/src/html/tags/d/Dt.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :dt extends :xhp:html-element { | |
+xhp class dt extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/e/Em.php b/src/html/tags/e/Em.php | |
index d970f25..7e8853c 100644 | |
--- a/src/html/tags/e/Em.php | |
+++ b/src/html/tags/e/Em.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :em extends :xhp:html-element { | |
+xhp class em extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/e/Embed.php b/src/html/tags/e/Embed.php | |
index b9f550d..2c488fa 100644 | |
--- a/src/html/tags/e/Embed.php | |
+++ b/src/html/tags/e/Embed.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :embed extends :xhp:html-element { | |
+xhp class embed extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
int height, | |
diff --git a/src/html/tags/f/Fieldset.php b/src/html/tags/f/Fieldset.php | |
index 2f6e34a..7485daf 100644 | |
--- a/src/html/tags/f/Fieldset.php | |
+++ b/src/html/tags/f/Fieldset.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :fieldset extends :xhp:html-element { | |
+xhp class fieldset extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool disabled, | |
diff --git a/src/html/tags/f/Figcaption.php b/src/html/tags/f/Figcaption.php | |
index 34317d5..8b40535 100644 | |
--- a/src/html/tags/f/Figcaption.php | |
+++ b/src/html/tags/f/Figcaption.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :figcaption extends :xhp:html-element { | |
+xhp class figcaption extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/f/Figure.php b/src/html/tags/f/Figure.php | |
index 81fb146..db0a07c 100644 | |
--- a/src/html/tags/f/Figure.php | |
+++ b/src/html/tags/f/Figure.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :figure extends :xhp:html-element { | |
+xhp class figure extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %sectioning; | |
diff --git a/src/html/tags/f/Footer.php b/src/html/tags/f/Footer.php | |
index c64abaa..5710835 100644 | |
--- a/src/html/tags/f/Footer.php | |
+++ b/src/html/tags/f/Footer.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :footer extends :xhp:html-element { | |
+xhp class footer extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/f/Form.php b/src/html/tags/f/Form.php | |
index dda900c..0d3d9a6 100644 | |
--- a/src/html/tags/f/Form.php | |
+++ b/src/html/tags/f/Form.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :form extends :xhp:html-element { | |
+xhp class form extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string action, | |
diff --git a/src/html/tags/h/H1.php b/src/html/tags/h/H1.php | |
index 51ad65a..05f60f0 100644 | |
--- a/src/html/tags/h/H1.php | |
+++ b/src/html/tags/h/H1.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :h1 extends :xhp:html-element { | |
+xhp class h1 extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/h/H2.php b/src/html/tags/h/H2.php | |
index e1987d6..0de0f68 100644 | |
--- a/src/html/tags/h/H2.php | |
+++ b/src/html/tags/h/H2.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :h2 extends :xhp:html-element { | |
+xhp class h2 extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/h/H3.php b/src/html/tags/h/H3.php | |
index 63e5f82..1450211 100644 | |
--- a/src/html/tags/h/H3.php | |
+++ b/src/html/tags/h/H3.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :h3 extends :xhp:html-element { | |
+xhp class h3 extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/h/H4.php b/src/html/tags/h/H4.php | |
index 80ca119..937c274 100644 | |
--- a/src/html/tags/h/H4.php | |
+++ b/src/html/tags/h/H4.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :h4 extends :xhp:html-element { | |
+xhp class h4 extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/h/H5.php b/src/html/tags/h/H5.php | |
index ae6ec72..aee83d8 100644 | |
--- a/src/html/tags/h/H5.php | |
+++ b/src/html/tags/h/H5.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :h5 extends :xhp:html-element { | |
+xhp class h5 extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/h/H6.php b/src/html/tags/h/H6.php | |
index 7abe5a3..26f57a8 100644 | |
--- a/src/html/tags/h/H6.php | |
+++ b/src/html/tags/h/H6.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :h6 extends :xhp:html-element { | |
+xhp class h6 extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/h/Head.php b/src/html/tags/h/Head.php | |
index ad2df8a..6af1eed 100644 | |
--- a/src/html/tags/h/Head.php | |
+++ b/src/html/tags/h/Head.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :head extends :xhp:html-element { | |
+xhp class head extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/h/Header.php b/src/html/tags/h/Header.php | |
index 43adf9c..6e7e5a9 100644 | |
--- a/src/html/tags/h/Header.php | |
+++ b/src/html/tags/h/Header.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :header extends :xhp:html-element { | |
+xhp class header extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %heading; | |
diff --git a/src/html/tags/h/Hgroup.php b/src/html/tags/h/Hgroup.php | |
index 8e44f4b..b634a75 100644 | |
--- a/src/html/tags/h/Hgroup.php | |
+++ b/src/html/tags/h/Hgroup.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :hgroup extends :xhp:html-element { | |
+xhp class hgroup extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %heading; | |
diff --git a/src/html/tags/h/Hr.php b/src/html/tags/h/Hr.php | |
index d61e18e..7e56e52 100644 | |
--- a/src/html/tags/h/Hr.php | |
+++ b/src/html/tags/h/Hr.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :hr extends :xhp:html-singleton { | |
+xhp class hr extends :xhp:html_singleton { | |
category %flow; | |
protected string $tagName = 'hr'; | |
} | |
diff --git a/src/html/tags/h/Html.php b/src/html/tags/h/Html.php | |
index dcd30a5..e62ad39 100644 | |
--- a/src/html/tags/h/Html.php | |
+++ b/src/html/tags/h/Html.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :html extends :xhp:html-element { | |
+xhp class html extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string manifest, | |
diff --git a/src/html/tags/i/I.php b/src/html/tags/i/I.php | |
index 5a6f86e..fab0f06 100644 | |
--- a/src/html/tags/i/I.php | |
+++ b/src/html/tags/i/I.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :i extends :xhp:html-element { | |
+xhp class i extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/i/Iframe.php b/src/html/tags/i/Iframe.php | |
index 6e5f2ee..feace81 100644 | |
--- a/src/html/tags/i/Iframe.php | |
+++ b/src/html/tags/i/Iframe.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :iframe extends :xhp:pcdata-element { | |
+xhp class iframe extends :xhp:pcdata_element { | |
attribute | |
bool allowfullscreen, | |
string name, | |
diff --git a/src/html/tags/i/Img.php b/src/html/tags/i/Img.php | |
index 3e1ea3a..1c81ced 100644 | |
--- a/src/html/tags/i/Img.php | |
+++ b/src/html/tags/i/Img.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :img extends :xhp:html-singleton { | |
+xhp class img extends :xhp:html_singleton { | |
attribute | |
string alt, | |
enum {'anonymous', 'use-credentials'} crossorigin, | |
diff --git a/src/html/tags/i/Input.php b/src/html/tags/i/Input.php | |
index 0dee3a2..0306350 100644 | |
--- a/src/html/tags/i/Input.php | |
+++ b/src/html/tags/i/Input.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :input extends :xhp:html-singleton { | |
+xhp class input extends :xhp:html_singleton { | |
attribute | |
string accept, | |
string alt, | |
diff --git a/src/html/tags/i/Ins.php b/src/html/tags/i/Ins.php | |
index dbce363..7fdf642 100644 | |
--- a/src/html/tags/i/Ins.php | |
+++ b/src/html/tags/i/Ins.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :ins extends :xhp:html-element { | |
+xhp class ins extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string cite, | |
diff --git a/src/html/tags/k/Kbd.php b/src/html/tags/k/Kbd.php | |
index 9467d32..829a9ab 100644 | |
--- a/src/html/tags/k/Kbd.php | |
+++ b/src/html/tags/k/Kbd.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :kbd extends :xhp:html-element { | |
+xhp class kbd extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/k/Keygen.php b/src/html/tags/k/Keygen.php | |
index 67e13ec..c6ff251 100644 | |
--- a/src/html/tags/k/Keygen.php | |
+++ b/src/html/tags/k/Keygen.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :keygen extends :xhp:html-singleton { | |
+xhp class keygen extends :xhp:html_singleton { | |
attribute | |
bool autofocus, | |
string challenge, | |
diff --git a/src/html/tags/l/Label.php b/src/html/tags/l/Label.php | |
index ddcbf05..daf4fb1 100644 | |
--- a/src/html/tags/l/Label.php | |
+++ b/src/html/tags/l/Label.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :label extends :xhp:html-element { | |
+xhp class label extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string for, | |
diff --git a/src/html/tags/l/Legend.php b/src/html/tags/l/Legend.php | |
index 881524d..1bf9ad8 100644 | |
--- a/src/html/tags/l/Legend.php | |
+++ b/src/html/tags/l/Legend.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :legend extends :xhp:html-element { | |
+xhp class legend extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/l/Li.php b/src/html/tags/l/Li.php | |
index 355d768..a2d9e5e 100644 | |
--- a/src/html/tags/l/Li.php | |
+++ b/src/html/tags/l/Li.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :li extends :xhp:html-element { | |
+xhp class li extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/l/Link.php b/src/html/tags/l/Link.php | |
index 3fd45cb..26b0318 100644 | |
--- a/src/html/tags/l/Link.php | |
+++ b/src/html/tags/l/Link.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :link extends :xhp:html-singleton { | |
+xhp class link extends :xhp:html_singleton { | |
attribute | |
string as, | |
enum {'anonymous', 'use-credentials'} crossorigin, | |
diff --git a/src/html/tags/m/Main.php b/src/html/tags/m/Main.php | |
index 705f611..9bed46b 100644 | |
--- a/src/html/tags/m/Main.php | |
+++ b/src/html/tags/m/Main.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :main extends :xhp:html-element { | |
+xhp class main extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/m/Map.php b/src/html/tags/m/Map.php | |
index b5ac9bf..9a56407 100644 | |
--- a/src/html/tags/m/Map.php | |
+++ b/src/html/tags/m/Map.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :map extends :xhp:html-element { | |
+xhp class map extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute string name; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/m/Mark.php b/src/html/tags/m/Mark.php | |
index 01bdfa3..e010aab 100644 | |
--- a/src/html/tags/m/Mark.php | |
+++ b/src/html/tags/m/Mark.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :mark extends :xhp:html-element { | |
+xhp class mark extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/m/Menu.php b/src/html/tags/m/Menu.php | |
index 7a8ef01..09afb28 100644 | |
--- a/src/html/tags/m/Menu.php | |
+++ b/src/html/tags/m/Menu.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :menu extends :xhp:html-element { | |
+xhp class menu extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string label, | |
diff --git a/src/html/tags/m/Menuitem.php b/src/html/tags/m/Menuitem.php | |
index f26246d..13be1f8 100644 | |
--- a/src/html/tags/m/Menuitem.php | |
+++ b/src/html/tags/m/Menuitem.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :menuitem extends :xhp:html-singleton { | |
+xhp class menuitem extends :xhp:html_singleton { | |
attribute | |
bool checked, | |
string command, | |
diff --git a/src/html/tags/m/Meta.php b/src/html/tags/m/Meta.php | |
index 192b6b7..575986f 100644 | |
--- a/src/html/tags/m/Meta.php | |
+++ b/src/html/tags/m/Meta.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :meta extends :xhp:html-singleton { | |
+xhp class meta extends :xhp:html_singleton { | |
attribute | |
// The correct definition of http-equiv is an enum, but there are legacy | |
// values still used and any strictness here would only be frustrating. | |
diff --git a/src/html/tags/m/Meter.php b/src/html/tags/m/Meter.php | |
index c093461..4b975fe 100644 | |
--- a/src/html/tags/m/Meter.php | |
+++ b/src/html/tags/m/Meter.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :meter extends :xhp:html-element { | |
+xhp class meter extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
float high, | |
diff --git a/src/html/tags/n/Nav.php b/src/html/tags/n/Nav.php | |
index 0fbd052..42316f0 100644 | |
--- a/src/html/tags/n/Nav.php | |
+++ b/src/html/tags/n/Nav.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :nav extends :xhp:html-element { | |
+xhp class nav extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/n/Noscript.php b/src/html/tags/n/Noscript.php | |
index e275941..fa590ac 100644 | |
--- a/src/html/tags/n/Noscript.php | |
+++ b/src/html/tags/n/Noscript.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :noscript extends :xhp:html-element { | |
+xhp class noscript extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/o/Object.php b/src/html/tags/o/Object.php | |
index 36035b3..e4b2097 100644 | |
--- a/src/html/tags/o/Object.php | |
+++ b/src/html/tags/o/Object.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :object extends :xhp:html-element { | |
+xhp class object extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string data, | |
diff --git a/src/html/tags/o/Ol.php b/src/html/tags/o/Ol.php | |
index a57c60d..4bc70d1 100644 | |
--- a/src/html/tags/o/Ol.php | |
+++ b/src/html/tags/o/Ol.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :ol extends :xhp:html-element { | |
+xhp class ol extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool reversed, | |
diff --git a/src/html/tags/o/Optgroup.php b/src/html/tags/o/Optgroup.php | |
index c3cb0d4..73646e7 100644 | |
--- a/src/html/tags/o/Optgroup.php | |
+++ b/src/html/tags/o/Optgroup.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :optgroup extends :xhp:html-element { | |
+xhp class optgroup extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool disabled, | |
diff --git a/src/html/tags/o/Option.php b/src/html/tags/o/Option.php | |
index 39a40b3..27b7f70 100644 | |
--- a/src/html/tags/o/Option.php | |
+++ b/src/html/tags/o/Option.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :option extends :xhp:pcdata-element { | |
+xhp class option extends :xhp:pcdata_element { | |
attribute | |
bool disabled, | |
string label, | |
diff --git a/src/html/tags/o/Output.php b/src/html/tags/o/Output.php | |
index d7d64c1..812e1e6 100644 | |
--- a/src/html/tags/o/Output.php | |
+++ b/src/html/tags/o/Output.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :output extends :xhp:html-element { | |
+xhp class output extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string for, | |
diff --git a/src/html/tags/p/P.php b/src/html/tags/p/P.php | |
index 37c73a6..816f540 100644 | |
--- a/src/html/tags/p/P.php | |
+++ b/src/html/tags/p/P.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :p extends :xhp:html-element { | |
+xhp class p extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/p/Param.php b/src/html/tags/p/Param.php | |
index d30654f..26ad999 100644 | |
--- a/src/html/tags/p/Param.php | |
+++ b/src/html/tags/p/Param.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :param extends :xhp:pcdata-element { | |
+xhp class param extends :xhp:pcdata_element { | |
attribute | |
string name, | |
string value; | |
diff --git a/src/html/tags/p/Picture.php b/src/html/tags/p/Picture.php | |
index 92374c0..9726b2f 100644 | |
--- a/src/html/tags/p/Picture.php | |
+++ b/src/html/tags/p/Picture.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :picture extends :xhp:html-element { | |
+xhp class picture extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/p/Pre.php b/src/html/tags/p/Pre.php | |
index f2dc359..8608ab9 100644 | |
--- a/src/html/tags/p/Pre.php | |
+++ b/src/html/tags/p/Pre.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :pre extends :xhp:html-element { | |
+xhp class pre extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/p/Progress.php b/src/html/tags/p/Progress.php | |
index 257116a..5ee1a73 100644 | |
--- a/src/html/tags/p/Progress.php | |
+++ b/src/html/tags/p/Progress.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :progress extends :xhp:html-element { | |
+xhp class progress extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
float max, | |
diff --git a/src/html/tags/q/Q.php b/src/html/tags/q/Q.php | |
index 583d77f..9f5c49a 100644 | |
--- a/src/html/tags/q/Q.php | |
+++ b/src/html/tags/q/Q.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :q extends :xhp:html-element { | |
+xhp class q extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute string cite; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/r/Rb.php b/src/html/tags/r/Rb.php | |
index 0c63bff..5aac408 100644 | |
--- a/src/html/tags/r/Rb.php | |
+++ b/src/html/tags/r/Rb.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :rb extends :xhp:html-element { | |
+xhp class rb extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/r/Rp.php b/src/html/tags/r/Rp.php | |
index 9903f4c..9236809 100644 | |
--- a/src/html/tags/r/Rp.php | |
+++ b/src/html/tags/r/Rp.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :rp extends :xhp:html-element { | |
+xhp class rp extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/r/Rt.php b/src/html/tags/r/Rt.php | |
index 190609e..878938d 100644 | |
--- a/src/html/tags/r/Rt.php | |
+++ b/src/html/tags/r/Rt.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :rt extends :xhp:html-element { | |
+xhp class rt extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/r/Rtc.php b/src/html/tags/r/Rtc.php | |
index 382778b..c87efe8 100644 | |
--- a/src/html/tags/r/Rtc.php | |
+++ b/src/html/tags/r/Rtc.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :rtc extends :xhp:html-element { | |
+xhp class rtc extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/r/Ruby.php b/src/html/tags/r/Ruby.php | |
index 74ad012..387f012 100644 | |
--- a/src/html/tags/r/Ruby.php | |
+++ b/src/html/tags/r/Ruby.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :ruby extends :xhp:html-element { | |
+xhp class ruby extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/S.php b/src/html/tags/s/S.php | |
index f62fad2..40f27dd 100644 | |
--- a/src/html/tags/s/S.php | |
+++ b/src/html/tags/s/S.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :s extends :xhp:html-element { | |
+xhp class s extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/Samp.php b/src/html/tags/s/Samp.php | |
index 10d8dd1..51f7092 100644 | |
--- a/src/html/tags/s/Samp.php | |
+++ b/src/html/tags/s/Samp.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :samp extends :xhp:html-element { | |
+xhp class samp extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/Script.php b/src/html/tags/s/Script.php | |
index c8022ea..f487b8d 100644 | |
--- a/src/html/tags/s/Script.php | |
+++ b/src/html/tags/s/Script.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :script extends :xhp:raw-pcdata-element { | |
+xhp class script extends :xhp:raw_pcdata_element { | |
attribute | |
bool async, | |
string charset, | |
diff --git a/src/html/tags/s/Section.php b/src/html/tags/s/Section.php | |
index e99cd9b..2c37f02 100644 | |
--- a/src/html/tags/s/Section.php | |
+++ b/src/html/tags/s/Section.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :section extends :xhp:html-element { | |
+xhp class section extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %sectioning; | |
diff --git a/src/html/tags/s/Select.php b/src/html/tags/s/Select.php | |
index ff098c0..26f9217 100644 | |
--- a/src/html/tags/s/Select.php | |
+++ b/src/html/tags/s/Select.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :select extends :xhp:html-element { | |
+xhp class select extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool autofocus, | |
diff --git a/src/html/tags/s/Small.php b/src/html/tags/s/Small.php | |
index 2ce8a28..107a94b 100644 | |
--- a/src/html/tags/s/Small.php | |
+++ b/src/html/tags/s/Small.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :small extends :xhp:html-element { | |
+xhp class small extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/Source.php b/src/html/tags/s/Source.php | |
index 624fa9e..d4de7b0 100644 | |
--- a/src/html/tags/s/Source.php | |
+++ b/src/html/tags/s/Source.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :source extends :xhp:html-singleton { | |
+xhp class source extends :xhp:html_singleton { | |
attribute | |
string media, | |
string sizes, | |
diff --git a/src/html/tags/s/Span.php b/src/html/tags/s/Span.php | |
index 488852c..26e10b4 100644 | |
--- a/src/html/tags/s/Span.php | |
+++ b/src/html/tags/s/Span.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :span extends :xhp:html-element { | |
+xhp class span extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/Strong.php b/src/html/tags/s/Strong.php | |
index 4800f7c..1da2213 100644 | |
--- a/src/html/tags/s/Strong.php | |
+++ b/src/html/tags/s/Strong.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :strong extends :xhp:html-element { | |
+xhp class strong extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/Style.php b/src/html/tags/s/Style.php | |
index 8784513..2aa25f0 100644 | |
--- a/src/html/tags/s/Style.php | |
+++ b/src/html/tags/s/Style.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :style extends :xhp:raw-pcdata-element { | |
+xhp class style extends :xhp:raw_pcdata_element { | |
attribute | |
string media, | |
bool scoped, | |
diff --git a/src/html/tags/s/Sub.php b/src/html/tags/s/Sub.php | |
index 2e15a51..4fc2d96 100644 | |
--- a/src/html/tags/s/Sub.php | |
+++ b/src/html/tags/s/Sub.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :sub extends :xhp:html-element { | |
+xhp class sub extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/s/Summary.php b/src/html/tags/s/Summary.php | |
index 0a28680..656ceb7 100644 | |
--- a/src/html/tags/s/Summary.php | |
+++ b/src/html/tags/s/Summary.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :summary extends :xhp:html-element { | |
+xhp class summary extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/s/Sup.php b/src/html/tags/s/Sup.php | |
index 0a8e09e..5d1700a 100644 | |
--- a/src/html/tags/s/Sup.php | |
+++ b/src/html/tags/s/Sup.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :sup extends :xhp:html-element { | |
+xhp class sup extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/t/Table.php b/src/html/tags/t/Table.php | |
index f8078b3..2f0b591 100644 | |
--- a/src/html/tags/t/Table.php | |
+++ b/src/html/tags/t/Table.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :table extends :xhp:html-element { | |
+xhp class table extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
int border, | |
diff --git a/src/html/tags/t/Tbody.php b/src/html/tags/t/Tbody.php | |
index 6d0e373..08b57f6 100644 | |
--- a/src/html/tags/t/Tbody.php | |
+++ b/src/html/tags/t/Tbody.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :tbody extends :xhp:html-element { | |
+xhp class tbody extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/t/Td.php b/src/html/tags/t/Td.php | |
index e0658c5..dec692f 100644 | |
--- a/src/html/tags/t/Td.php | |
+++ b/src/html/tags/t/Td.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :td extends :xhp:html-element { | |
+xhp class td extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
int colspan, | |
diff --git a/src/html/tags/t/Template.php b/src/html/tags/t/Template.php | |
index 42650f5..4f256f3 100644 | |
--- a/src/html/tags/t/Template.php | |
+++ b/src/html/tags/t/Template.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :template extends :xhp:html-element { | |
+xhp class template extends :xhp:html_element { | |
category %flow, %phrase, %metadata; | |
// The children declaration for this element is extraordinarily verbose so | |
// I leave it to you to use it appropriately. | |
diff --git a/src/html/tags/t/Textarea.php b/src/html/tags/t/Textarea.php | |
index 6ae80fd..f644351 100644 | |
--- a/src/html/tags/t/Textarea.php | |
+++ b/src/html/tags/t/Textarea.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :textarea extends :xhp:pcdata-element { | |
+xhp class textarea extends :xhp:pcdata_element { | |
attribute | |
enum {'on', 'off'} autocomplete, | |
bool autofocus, | |
diff --git a/src/html/tags/t/Tfoot.php b/src/html/tags/t/Tfoot.php | |
index 8f0eb3d..25b4126 100644 | |
--- a/src/html/tags/t/Tfoot.php | |
+++ b/src/html/tags/t/Tfoot.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :tfoot extends :xhp:html-element { | |
+xhp class tfoot extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/t/Th.php b/src/html/tags/t/Th.php | |
index 201ea87..93aee6c 100644 | |
--- a/src/html/tags/t/Th.php | |
+++ b/src/html/tags/t/Th.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :th extends :xhp:html-element { | |
+xhp class th extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
string abbr, | |
diff --git a/src/html/tags/t/Thead.php b/src/html/tags/t/Thead.php | |
index f921d5d..7ed513a 100644 | |
--- a/src/html/tags/t/Thead.php | |
+++ b/src/html/tags/t/Thead.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :thead extends :xhp:html-element { | |
+xhp class thead extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/t/Time.php b/src/html/tags/t/Time.php | |
index c16b539..915cacb 100644 | |
--- a/src/html/tags/t/Time.php | |
+++ b/src/html/tags/t/Time.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :time extends :xhp:html-element { | |
+xhp class time extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute string datetime; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/t/Title.php b/src/html/tags/t/Title.php | |
index 6e6f614..abacd0d 100644 | |
--- a/src/html/tags/t/Title.php | |
+++ b/src/html/tags/t/Title.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :title extends :xhp:pcdata-element { | |
+xhp class title extends :xhp:pcdata_element { | |
category %metadata; | |
protected string $tagName = 'title'; | |
} | |
diff --git a/src/html/tags/t/Tr.php b/src/html/tags/t/Tr.php | |
index 79a494d..e5fe454 100644 | |
--- a/src/html/tags/t/Tr.php | |
+++ b/src/html/tags/t/Tr.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :tr extends :xhp:html-element { | |
+xhp class tr extends :xhp:html_element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
diff --git a/src/html/tags/t/Track.php b/src/html/tags/t/Track.php | |
index be8bb90..f983324 100644 | |
--- a/src/html/tags/t/Track.php | |
+++ b/src/html/tags/t/Track.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :track extends :xhp:html-singleton { | |
+xhp class track extends :xhp:html_singleton { | |
attribute | |
bool default, | |
enum {'subtitles', 'captions', 'descriptions', 'chapters', 'metadata'} kind, | |
diff --git a/src/html/tags/t/Tt.php b/src/html/tags/t/Tt.php | |
index 68c4fff..0b18376 100644 | |
--- a/src/html/tags/t/Tt.php | |
+++ b/src/html/tags/t/Tt.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :tt extends :xhp:html-element { | |
+xhp class tt extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/u/U.php b/src/html/tags/u/U.php | |
index f382a6f..19d1607 100644 | |
--- a/src/html/tags/u/U.php | |
+++ b/src/html/tags/u/U.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :u extends :xhp:html-element { | |
+xhp class u extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/u/Ul.php b/src/html/tags/u/Ul.php | |
index 5095b94..a1f3c1e 100644 | |
--- a/src/html/tags/u/Ul.php | |
+++ b/src/html/tags/u/Ul.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :ul extends :xhp:html-element { | |
+xhp class ul extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow; | |
diff --git a/src/html/tags/v/Var.php b/src/html/tags/v/Var.php | |
index 0da5fbe..3447f05 100644 | |
--- a/src/html/tags/v/Var.php | |
+++ b/src/html/tags/v/Var.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :var extends :xhp:html-element { | |
+xhp class var extends :xhp:html_element { | |
use XHPChildValidation; | |
category %flow, %phrase; | |
diff --git a/src/html/tags/v/Video.php b/src/html/tags/v/Video.php | |
index 835d51c..fdabc11 100644 | |
--- a/src/html/tags/v/Video.php | |
+++ b/src/html/tags/v/Video.php | |
@@ -10,7 +10,7 @@ | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :video extends :xhp:html-element { | |
+xhp class video extends :xhp:html_element { | |
use XHPChildValidation; | |
attribute | |
bool autoplay, | |
diff --git a/src/html/tags/w/Wbr.php b/src/html/tags/w/Wbr.php | |
index 55617c7..d6c004b 100644 | |
--- a/src/html/tags/w/Wbr.php | |
+++ b/src/html/tags/w/Wbr.php | |
@@ -8,7 +8,7 @@ | |
* | |
*/ | |
-class :wbr extends :xhp:html-singleton { | |
+xhp class wbr extends :xhp:html_singleton { | |
category %flow, %phrase; | |
protected string $tagName = 'wbr'; | |
} | |
diff --git a/tests/AsyncTest.php b/tests/AsyncTest.php | |
index 8cce4ce..d5345e7 100644 | |
--- a/tests/AsyncTest.php | |
+++ b/tests/AsyncTest.php | |
@@ -11,7 +11,7 @@ | |
use function Facebook\FBExpect\expect; | |
use type Facebook\HackTest\DataProvider; | |
-class :async:test extends :x:element { | |
+xhp class async:test extends :x:element { | |
use XHPAsync; | |
protected async function asyncRender(): Awaitable<XHPRoot> { | |
@@ -19,14 +19,14 @@ class :async:test extends :x:element { | |
} | |
} | |
-class :test:xfrag-wrap extends :x:element { | |
+xhp class test:xfrag_wrap extends :x:element { | |
protected function render(): XHPRoot { | |
return <x:frag>{$this->getChildren()}</x:frag>; | |
} | |
} | |
-class :test:async-xfrag-wrap extends :x:element { | |
+xhp class test:async_xfrag_wrap extends :x:element { | |
use XHPAsync; | |
protected async function asyncRender(): Awaitable<XHPRoot> { | |
@@ -34,7 +34,7 @@ class :test:async-xfrag-wrap extends :x:element { | |
} | |
} | |
-class :async:par-test extends :x:element { | |
+xhp class async:par_test extends :x:element { | |
use XHPAsync; | |
attribute string label @required; | |
@@ -91,18 +91,18 @@ class AsyncTest extends Facebook\HackTest\HackTest { | |
public function parallelizationContainersProvider(): varray<varray<:xhp>> { | |
return varray[ | |
- varray[<test:xfrag-wrap />], | |
- varray[<test:async-xfrag-wrap />], | |
+ varray[<test:xfrag_wrap />], | |
+ varray[<test:async_xfrag_wrap />], | |
]; | |
} | |
<<DataProvider('parallelizationContainersProvider')>> | |
public function testParallelization(:x:element $container): void { | |
- :async:par-test::$log = Vector {}; | |
+ :async:par_test::$log = Vector {}; | |
- $a = <async:par-test label="a" />; | |
- $b = <async:par-test label="b" />; | |
- $c = <async:par-test label="c" />; | |
+ $a = <async:par_test label="a" />; | |
+ $b = <async:par_test label="b" />; | |
+ $c = <async:par_test label="c" />; | |
$container->replaceChildren(varray[$b, $c]); | |
@@ -111,7 +111,7 @@ class AsyncTest extends Facebook\HackTest\HackTest { | |
'<div><div>a</div><div>b</div><div>c</div></div>', | |
); | |
- $log = :async:par-test::$log; | |
+ $log = :async:par_test::$log; | |
$by_node = Map {'a' => Map {}, 'b' => Map {}, 'c' => Map {}}; | |
foreach ($log as $idx => $data) { | |
diff --git a/tests/AttributesCoercionModeTest.php b/tests/AttributesCoercionModeTest.php | |
index e5ff20c..b00e35a 100644 | |
--- a/tests/AttributesCoercionModeTest.php | |
+++ b/tests/AttributesCoercionModeTest.php | |
@@ -12,7 +12,7 @@ use function Facebook\FBExpect\expect; | |
// Using decl because this test intentional passes the wrong types for | |
// attributes | |
-class :test:attribute-coercion-modes extends :x:element { | |
+xhp class test:attribute_coercion_modes extends :x:element { | |
attribute | |
int myint, | |
float myfloat, | |
@@ -46,7 +46,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
public function testNoCoercion(): void { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
$x = | |
- <test:attribute-coercion-modes | |
+ <test:attribute_coercion_modes | |
myint={3} | |
myfloat={1.23} | |
mystring="foo" | |
@@ -63,7 +63,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes myint="1" />; | |
+ $x = <test:attribute_coercion_modes myint="1" />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -72,7 +72,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes myint={1.23} />; | |
+ $x = <test:attribute_coercion_modes myint={1.23} />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -81,7 +81,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes myfloat={2} />; | |
+ $x = <test:attribute_coercion_modes myfloat={2} />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -90,7 +90,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes mystring={2} />; | |
+ $x = <test:attribute_coercion_modes mystring={2} />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -99,7 +99,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes mybool={1} />; | |
+ $x = <test:attribute_coercion_modes mybool={1} />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -108,7 +108,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::THROW_EXCEPTION); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes mybool="true" />; | |
+ $x = <test:attribute_coercion_modes mybool="true" />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -117,7 +117,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
XHPAttributeCoercion::SetMode(XHPAttributeCoercionMode::SILENT); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes mystring={2} />; | |
+ $x = <test:attribute_coercion_modes mystring={2} />; | |
expect($x->:mystring)->toEqual('2'); | |
} | |
@@ -129,7 +129,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
try { | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes mystring={2} />; | |
+ $x = <test:attribute_coercion_modes mystring={2} />; | |
} catch (Exception $e) { | |
$exception = $e; | |
} | |
@@ -138,7 +138,7 @@ class AttributesCoercionModeTest extends Facebook\HackTest\HackTest { | |
error_reporting(E_ALL & ~E_USER_DEPRECATED); | |
/* HH_IGNORE_ERROR[4110] testing behavior for incorrect types */ | |
/* HH_IGNORE_ERROR[4343] testing behavior for incorrect types */ | |
- $x = <test:attribute-coercion-modes mystring={2} />; | |
+ $x = <test:attribute_coercion_modes mystring={2} />; | |
expect($x->:mystring)->toEqual('2'); | |
} | |
} | |
diff --git a/tests/AttributesTest.php b/tests/AttributesTest.php | |
index 774af2c..df846ee 100644 | |
--- a/tests/AttributesTest.php | |
+++ b/tests/AttributesTest.php | |
@@ -11,7 +11,7 @@ | |
use function Facebook\FBExpect\expect; | |
type TMyTestShape = shape('foo' => string, 'bar' => ?string); | |
-class :test:attribute-types extends :x:element { | |
+xhp class test:attribute_types extends :x:element { | |
attribute | |
string mystring, | |
bool mybool, | |
@@ -31,7 +31,7 @@ class :test:attribute-types extends :x:element { | |
} | |
} | |
-class :test:required-attributes extends :x:element { | |
+xhp class test:required_attributes extends :x:element { | |
attribute string mystring @required; | |
protected function render(): XHPRoot { | |
@@ -39,7 +39,7 @@ class :test:required-attributes extends :x:element { | |
} | |
} | |
-class :test:default-attributes extends :x:element { | |
+xhp class test:default_attributes extends :x:element { | |
attribute string mystring = 'mydefault'; | |
protected function render(): XHPRoot { | |
@@ -47,7 +47,7 @@ class :test:default-attributes extends :x:element { | |
} | |
} | |
-class :test:callable-attribute extends :x:element { | |
+xhp class test:callable_attribute extends :x:element { | |
attribute | |
/* HH_FIXME[2049]: callable is an invalid Hack type */ | |
callable foo; // unsupported in 2.0+ | |
@@ -78,7 +78,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testValidTypes(): void { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
mystring="foo" | |
mybool={true} | |
myint={123} | |
@@ -98,7 +98,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
/* HH_IGNORE_ERROR[4166] */ | |
@@ -113,7 +113,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
expect(() ==> { | |
/* HH_IGNORE_ERROR[4057] */ | |
- $x = <test:attribute-types myshape={shape('foo' => 'herp')} />; | |
+ $x = <test:attribute_types myshape={shape('foo' => 'herp')} />; | |
expect($x->toString())->toEqual('<div></div>'); | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
@@ -122,14 +122,14 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('Only enums are validated at runtime.'); | |
expect(() ==> { | |
/* HH_IGNORE_ERROR[4057] */ | |
- $x = <test:attribute-types myshape={shape()} />; | |
+ $x = <test:attribute_types myshape={shape()} />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
public function testValidArrayKeys(): void { | |
- $x = <test:attribute-types myarraykey="foo" />; | |
+ $x = <test:attribute_types myarraykey="foo" />; | |
expect($x->toString())->toEqual('<div></div>'); | |
- $x = <test:attribute-types myarraykey={123} />; | |
+ $x = <test:attribute_types myarraykey={123} />; | |
expect($x->toString())->toEqual('<div></div>'); | |
} | |
@@ -137,7 +137,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('Only enums are validated at runtime.'); | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myarraykey={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ 1.23} | |
/>; | |
$x->toString(); | |
@@ -145,9 +145,9 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
} | |
public function testValidNum(): void { | |
- $x = <test:attribute-types mynum={123} />; | |
+ $x = <test:attribute_types mynum={123} />; | |
expect($x->toString())->toEqual('<div></div>'); | |
- $x = <test:attribute-types mynum={1.23} />; | |
+ $x = <test:attribute_types mynum={1.23} />; | |
expect($x->toString())->toEqual('<div></div>'); | |
} | |
@@ -156,7 +156,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
mynum=/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ "123" | |
/>; | |
$x->toString(); | |
@@ -164,27 +164,27 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
} | |
public function testNoAttributes(): void { | |
- expect((<test:attribute-types />)->toString())->toEqual('<div></div>'); | |
+ expect((<test:attribute_types />)->toString())->toEqual('<div></div>'); | |
} | |
public function testStringableObjectAsString(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types mystring={new StringableTestClass()} />; | |
+ $x = <test:attribute_types mystring={new StringableTestClass()} />; | |
expect($x->:mystring)->toEqual('StringableTestClass'); | |
} | |
public function testIntegerAsString(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types mystring={123} />; | |
+ $x = <test:attribute_types mystring={123} />; | |
expect($x->:mystring)->toEqual('123'); | |
} | |
public function testUnstringableObjectAsString(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
mystring={ | |
/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ new EmptyTestClass() | |
} | |
@@ -195,7 +195,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testArrayAsString(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
mystring={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ varray[]} | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -204,28 +204,28 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testIntishStringAsInt(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types myint={'123'} />; | |
+ $x = <test:attribute_types myint={'123'} />; | |
expect($x->:myint)->toEqual(123); | |
} | |
public function testFloatAsInt(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types myint={1.23} />; | |
+ $x = <test:attribute_types myint={1.23} />; | |
expect($x->:myint)->toEqual(1); | |
} | |
public function testFloatishStringAsInt(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types myint="1.23" />; | |
+ $x = <test:attribute_types myint="1.23" />; | |
expect($x->:myint)->toEqual(1); | |
} | |
public function testObjectAsInt(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myint={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ new EmptyTestClass()} | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -234,7 +234,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testArrayAsInt(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myint={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ varray[]} | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -243,7 +243,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testNumericPrefixStringAsInt(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myint=/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ "123derp" | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -252,21 +252,21 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testTrueStringAsBool(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types mybool="true" />; | |
+ $x = <test:attribute_types mybool="true" />; | |
expect($x->:mybool)->toEqual(true); | |
} | |
public function testFalseStringAsBool(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types mybool="false" />; | |
+ $x = <test:attribute_types mybool="false" />; | |
expect($x->:mybool)->toEqual(false); | |
} | |
public function testMixedCaseFalseStringAsBool(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
mybool=/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ "False" | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -276,7 +276,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testNoStringAsBool(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
mybool=/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ "No" | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -287,38 +287,38 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
// idiomatic - eg checked="checked" | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types mybool="mybool" />; | |
+ $x = <test:attribute_types mybool="mybool" />; | |
expect($x->:mybool)->toEqual(true); | |
} | |
public function testInvalidEnumValue(): void { | |
expect(() ==> { | |
- $x = <test:attribute-types myenum="derp" />; | |
+ $x = <test:attribute_types myenum="derp" />; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
public function testIntAsFloat(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types myfloat={123} />; | |
+ $x = <test:attribute_types myfloat={123} />; | |
expect($x->:myfloat)->toEqual(123.0); | |
} | |
public function testNumericStringsAsFloats(): void { | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types myfloat="123" />; | |
+ $x = <test:attribute_types myfloat="123" />; | |
expect($x->:myfloat)->toEqual(123.0); | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
- $x = <test:attribute-types myfloat="1.23" />; | |
+ $x = <test:attribute_types myfloat="1.23" />; | |
expect($x->:myfloat)->toEqual(1.23); | |
} | |
public function testNonNumericStringAsFloat(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myfloat=/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ "herpderp" | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -327,7 +327,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testNumericPrefixStringAsFloat(): void { | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myfloat=/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ "123derp" | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -337,7 +337,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('Only enums are validated at runtime.'); | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myarray={ | |
/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ new EmptyTestClass() | |
} | |
@@ -349,7 +349,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('Only enums are validated at runtime.'); | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myarray={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ Vector {1, 2, 3}} | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
@@ -359,7 +359,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('Only enums are validated at runtime.'); | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myobject={ | |
/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ new EmptyTestClass() | |
} | |
@@ -371,47 +371,47 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('Only enums are validated at runtime.'); | |
expect(() ==> { | |
$x = | |
- <test:attribute-types | |
+ <test:attribute_types | |
myvector={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ varray[1, 2, 3]} | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
} | |
public function testProvidingRequiredAttributes(): void { | |
- $x = <test:required-attributes mystring="herp" />; | |
+ $x = <test:required_attributes mystring="herp" />; | |
expect($x->:mystring)->toEqual('herp'); | |
expect($x->toString())->toEqual('<div>herp</div>'); | |
} | |
public function testOmittingRequiredAttributes(): void { | |
expect(() ==> { | |
- $x = <test:required-attributes />; | |
+ $x = <test:required_attributes />; | |
expect($x->:mystring)->toBeNull(); | |
})->toThrow(XHPAttributeRequiredException::class); | |
} | |
public function testProvidingDefaultAttributes(): void { | |
- $x = <test:default-attributes mystring="herp" />; | |
+ $x = <test:default_attributes mystring="herp" />; | |
expect($x->:mystring)->toEqual('herp'); | |
expect($x->toString())->toEqual('<div>herp</div>'); | |
} | |
public function testOmittingDefaultAttributes(): void { | |
- $x = <test:default-attributes />; | |
+ $x = <test:default_attributes />; | |
expect($x->:mystring)->toEqual('mydefault'); | |
expect($x->toString())->toEqual('<div>mydefault</div>'); | |
} | |
public function testBogusAttributes(): void { | |
expect(() ==> { | |
- $x = <test:default-attributes /* HH_FIXME[4053] */ idonotexist="derp" />; | |
+ $x = <test:default_attributes /* HH_FIXME[4053] */ idonotexist="derp" />; | |
})->toThrow(XHPAttributeNotSupportedException::class); | |
} | |
public function testSpecialAttributes(): void { | |
- $x = <test:default-attributes data-idonotexist="derp" />; | |
+ $x = <test:default_attributes data-idonotexist="derp" />; | |
expect($x->toString())->toEqual('<div>mydefault</div>'); | |
- $x = <test:default-attributes aria-idonotexist="derp" />; | |
+ $x = <test:default_attributes aria-idonotexist="derp" />; | |
expect($x->toString())->toEqual('<div>mydefault</div>'); | |
// verify that special attributes actually render | |
@@ -438,7 +438,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
self::markTestSkipped('This type has been unsupported since 2.0'); | |
expect(() ==> { | |
$x = | |
- <test:callable-attribute | |
+ <test:callable_attribute | |
/* HH_IGNORE_ERROR[4110] */ | |
/* HH_IGNORE_ERROR[4343] */ | |
foo={function() { | |
@@ -449,7 +449,7 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
public function testReflectOnCallableAttribute(): void { | |
self::markTestSkipped('This type has been unsupported since 2.0'); | |
- $rxhp = new ReflectionXHPClass(:test:callable-attribute::class); | |
+ $rxhp = new ReflectionXHPClass(:test:callable_attribute::class); | |
$rattr = $rxhp->getAttribute('foo'); | |
expect( | |
strstr($rattr->__toString(), "<UNSUPPORTED: legacy callable>") !== false, | |
@@ -460,8 +460,8 @@ class AttributesTest extends Facebook\HackTest\HackTest { | |
} | |
public function testAttributeSpread(): void { | |
- $x = <test:attribute-types mystring="foo" mybool={true} />; | |
- $y = <test:attribute-types mystring="bar" {...$x} myint={5} />; | |
+ $x = <test:attribute_types mystring="foo" mybool={true} />; | |
+ $y = <test:attribute_types mystring="bar" {...$x} myint={5} />; | |
expect($y->:mystring)->toEqual('foo'); | |
expect($y->:myint)->toEqual(5); | |
expect($y->:mybool)->toEqual(true); | |
diff --git a/tests/BasicsTest.php b/tests/BasicsTest.php | |
index 4a8bb2e..8f88579 100644 | |
--- a/tests/BasicsTest.php | |
+++ b/tests/BasicsTest.php | |
@@ -10,7 +10,7 @@ | |
use function Facebook\FBExpect\expect; | |
-class :test:renders-primitive extends :x:element { | |
+xhp class test:renders_primitive extends :x:element { | |
protected function render(): XHPRoot { | |
return <x:frag><div>123</div></x:frag>; | |
} | |
@@ -64,7 +64,7 @@ class BasicsTest extends Facebook\HackTest\HackTest { | |
} | |
public function testRendersPrimitive(): void { | |
- $xhp = <test:renders-primitive />; | |
+ $xhp = <test:renders_primitive />; | |
expect($xhp->toString())->toEqual('<div>123</div>'); | |
} | |
diff --git a/tests/ChildRuleTest.php b/tests/ChildRuleTest.php | |
index 65e92d5..4fb2195 100644 | |
--- a/tests/ChildRuleTest.php | |
+++ b/tests/ChildRuleTest.php | |
@@ -12,7 +12,7 @@ use function Facebook\FBExpect\expect; | |
use type Facebook\HackTest\DataProvider; | |
use namespace Facebook\XHP\ChildValidation as XHPChild; | |
-class :test:new-child-declaration-only extends :x:element { | |
+xhp class test:new_child_declaration_only extends :x:element { | |
use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
@@ -24,11 +24,10 @@ class :test:new-child-declaration-only extends :x:element { | |
} | |
} | |
-class :test:new-and-old-child-declarations extends :x:element { | |
+xhp class test:new_and_old_child_declarations extends :x:element { | |
// Providing all of these is invalid; for a migration consistency check, use | |
// the XHPChildDeclarationConsistencyValidation trait instead. | |
use XHPChildValidation; | |
- children (:div); | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\ofType<:div>(); | |
} | |
@@ -38,17 +37,21 @@ class :test:new-and-old-child-declarations extends :x:element { | |
} | |
} | |
-class :test:old-child-declaration-only extends :x:element { | |
- children (:div); | |
+xhp class test:old_child_declaration_only extends :x:element { | |
+ use XHPChildValidation; | |
+ | |
+ protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
+ return XHPChild\ofType<:div>(); | |
+ } | |
+ | |
protected function render(): XHPRoot { | |
return <x:frag>{$this->getChildren()}</x:frag>; | |
} | |
} | |
-class :test:any-children extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children any; | |
+xhp class test:any_children extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\any(); | |
} | |
@@ -58,9 +61,8 @@ class :test:any-children extends :x:element { | |
} | |
} | |
-class :test:no-children extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children empty; | |
+xhp class test:no_children extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\empty(); | |
} | |
@@ -70,9 +72,8 @@ class :test:no-children extends :x:element { | |
} | |
} | |
-class :test:single-child extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div); | |
+xhp class test:single_child extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\ofType<:div>(); | |
} | |
@@ -82,9 +83,8 @@ class :test:single-child extends :x:element { | |
} | |
} | |
-class :test:optional-child extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div?); | |
+xhp class test:optional_child extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\optional(XHPChild\ofType<:div>()); | |
} | |
@@ -94,9 +94,8 @@ class :test:optional-child extends :x:element { | |
} | |
} | |
-class :test:any-number-of-child extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div*); | |
+xhp class test:any_number_of_child extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\anyNumberOf(XHPChild\ofType<:div>()); | |
} | |
@@ -106,9 +105,8 @@ class :test:any-number-of-child extends :x:element { | |
} | |
} | |
-class :test:at-least-one-child extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div+); | |
+xhp class test:at_least_one_child extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\atLeastOneOf(XHPChild\ofType<:div>()); | |
} | |
@@ -118,9 +116,8 @@ class :test:at-least-one-child extends :x:element { | |
} | |
} | |
-class :test:two-children extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div, :div); | |
+xhp class test:two_children extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\sequence(XHPChild\ofType<:div>(), XHPChild\ofType<:div>()); | |
} | |
@@ -130,9 +127,8 @@ class :test:two-children extends :x:element { | |
} | |
} | |
-class :test:three-children extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div, :div, :div); | |
+xhp class test:three_children extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\sequence( | |
XHPChild\ofType<:div>(), | |
@@ -147,9 +143,8 @@ class :test:three-children extends :x:element { | |
} | |
-class :test:either-of-two-children extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div | :code); | |
+xhp class test:either_of_two_children extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\anyOf(XHPChild\ofType<:div>(), XHPChild\ofType<:code>()); | |
} | |
@@ -159,9 +154,8 @@ class :test:either-of-two-children extends :x:element { | |
} | |
} | |
-class :test:any-of-three-children extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div | :code | :p); | |
+xhp class test:any_of_three_children extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\anyOf( | |
XHPChild\ofType<:div>(), | |
@@ -176,9 +170,8 @@ class :test:any-of-three-children extends :x:element { | |
} | |
-class :test:nested-rule extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (:div | (:code+)); | |
+xhp class test:nested_rule extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\anyOf( | |
XHPChild\ofType<:div>(), | |
@@ -191,9 +184,8 @@ class :test:nested-rule extends :x:element { | |
} | |
} | |
-class :test:pcdata-child extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (pcdata); | |
+xhp class test:pcdata_child extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\pcdata(); | |
} | |
@@ -203,9 +195,8 @@ class :test:pcdata-child extends :x:element { | |
} | |
} | |
-class :test:category-child extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (%flow); | |
+xhp class test:category_child extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\category('%flow'); | |
} | |
@@ -215,7 +206,7 @@ class :test:category-child extends :x:element { | |
} | |
} | |
-class :test:has-comma-category extends :x:element { | |
+xhp class test:has_comma_category extends :x:element { | |
category %foo:bar; | |
protected function render(): XHPRoot { | |
@@ -223,9 +214,8 @@ class :test:has-comma-category extends :x:element { | |
} | |
} | |
-class :test:needs-comma-category extends :x:element { | |
- use XHPChildDeclarationConsistencyValidation; | |
- children (%foo:bar); | |
+xhp class test:needs_comma_category extends :x:element { | |
+ use XHPChildValidation; | |
protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
return XHPChild\category('%foo:bar'); | |
} | |
@@ -238,10 +228,10 @@ class :test:needs-comma-category extends :x:element { | |
class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testNoChild(): void { | |
$elems = Vector { | |
- <test:no-children />, | |
- <test:any-children />, | |
- <test:optional-child />, | |
- <test:any-number-of-child />, | |
+ <test:no_children />, | |
+ <test:any_children />, | |
+ <test:optional_child />, | |
+ <test:any_number_of_child />, | |
}; | |
foreach ($elems as $elem) { | |
expect($elem->__toString())->toEqual('<div></div>'); | |
@@ -250,22 +240,22 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testUnexpectedChild(): void { | |
expect(() ==> { | |
- $x = <test:no-children><div /></test:no-children>; | |
+ $x = <test:no_children><div /></test:no_children>; | |
$x->toString(); | |
})->toThrow(XHPInvalidChildrenException::class); | |
} | |
public function testSingleChild(): void { | |
$elems = Vector { | |
- <test:any-children />, | |
- <test:single-child />, | |
- <test:optional-child />, | |
- <test:any-number-of-child />, | |
- <test:at-least-one-child />, | |
- <test:either-of-two-children />, | |
- <test:any-of-three-children />, | |
- <test:nested-rule />, | |
- <test:category-child />, | |
+ <test:any_children />, | |
+ <test:single_child />, | |
+ <test:optional_child />, | |
+ <test:any_number_of_child />, | |
+ <test:at_least_one_child />, | |
+ <test:either_of_two_children />, | |
+ <test:any_of_three_children />, | |
+ <test:nested_rule />, | |
+ <test:category_child />, | |
}; | |
foreach ($elems as $elem) { | |
$elem->appendChild(<div>Foo</div>); | |
@@ -275,7 +265,7 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
<<DataProvider('toStringProvider')>> | |
public function testToString( | |
- :x:composable-element $elem, | |
+ :x:composable_element $elem, | |
string $expected, | |
): void { | |
expect($elem->__getChildrenDeclaration())->toEqual($expected); | |
@@ -283,29 +273,29 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function toStringProvider(): vec<(:xhp, string)> { | |
return vec[ | |
- tuple(<test:any-children />, 'any'), | |
- tuple(<test:no-children />, 'empty'), | |
- tuple(<test:single-child />, ':div'), | |
- tuple(<test:optional-child />, ':div?'), | |
- tuple(<test:any-number-of-child />, ':div*'), | |
- tuple(<test:at-least-one-child />, ':div+'), | |
- tuple(<test:two-children />, ':div,:div'), | |
- tuple(<test:three-children />, ':div,:div,:div'), | |
- tuple(<test:either-of-two-children />, ':div|:code'), | |
- tuple(<test:any-of-three-children />, ':div|:code|:p'), | |
- tuple(<test:nested-rule />, ':div|:code+'), | |
- tuple(<test:pcdata-child />, 'pcdata'), | |
- tuple(<test:category-child />, '%flow'), | |
+ tuple(<test:any_children />, 'any'), | |
+ tuple(<test:no_children />, 'empty'), | |
+ tuple(<test:single_child />, ':div'), | |
+ tuple(<test:optional_child />, ':div?'), | |
+ tuple(<test:any_number_of_child />, ':div*'), | |
+ tuple(<test:at_least_one_child />, ':div+'), | |
+ tuple(<test:two_children />, ':div,:div'), | |
+ tuple(<test:three_children />, ':div,:div,:div'), | |
+ tuple(<test:either_of_two_children />, ':div|:code'), | |
+ tuple(<test:any_of_three_children />, ':div|:code|:p'), | |
+ tuple(<test:nested_rule />, ':div|:code+'), | |
+ tuple(<test:pcdata_child />, 'pcdata'), | |
+ tuple(<test:category_child />, '%flow'), | |
]; | |
} | |
public function testExpectedChild(): void { | |
$elems = Vector { | |
- <test:single-child />, | |
- <test:at-least-one-child />, | |
- <test:either-of-two-children />, | |
- <test:nested-rule />, | |
- <test:pcdata-child />, | |
+ <test:single_child />, | |
+ <test:at_least_one_child />, | |
+ <test:either_of_two_children />, | |
+ <test:nested_rule />, | |
+ <test:pcdata_child />, | |
}; | |
foreach ($elems as $elem) { | |
$exception = null; | |
@@ -320,13 +310,13 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testTooManyChildren(): void { | |
$elems = Vector { | |
- <test:single-child />, | |
- <test:optional-child />, | |
- <test:two-children />, | |
- <test:three-children />, | |
- <test:either-of-two-children />, | |
- <test:nested-rule />, | |
- <test:category-child />, | |
+ <test:single_child />, | |
+ <test:optional_child />, | |
+ <test:two_children />, | |
+ <test:three_children />, | |
+ <test:either_of_two_children />, | |
+ <test:nested_rule />, | |
+ <test:category_child />, | |
}; | |
foreach ($elems as $elem) { | |
$exception = null; | |
@@ -342,14 +332,14 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testIncorrectChild(): void { | |
$elems = Vector { | |
- <test:single-child />, | |
- <test:optional-child />, | |
- <test:any-number-of-child />, | |
- <test:at-least-one-child />, | |
- <test:either-of-two-children />, | |
- <test:any-of-three-children />, | |
- <test:nested-rule />, | |
- <test:category-child />, | |
+ <test:single_child />, | |
+ <test:optional_child />, | |
+ <test:any_number_of_child />, | |
+ <test:at_least_one_child />, | |
+ <test:either_of_two_children />, | |
+ <test:any_of_three_children />, | |
+ <test:nested_rule />, | |
+ <test:category_child />, | |
}; | |
foreach ($elems as $elem) { | |
$exception = null; | |
@@ -365,9 +355,9 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testTwoChildren(): void { | |
$elems = Vector { | |
- <test:any-number-of-child />, | |
- <test:at-least-one-child />, | |
- <test:two-children />, | |
+ <test:any_number_of_child />, | |
+ <test:at_least_one_child />, | |
+ <test:two_children />, | |
}; | |
foreach ($elems as $elem) { | |
$elem->appendChild(<x:frag><div /><div /></x:frag>); | |
@@ -376,7 +366,7 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
} | |
public function testThreeChildren(): void { | |
- $elems = Vector {<test:any-number-of-child />, <test:at-least-one-child />}; | |
+ $elems = Vector {<test:any_number_of_child />, <test:at_least_one_child />}; | |
foreach ($elems as $elem) { | |
$elem->appendChild(<x:frag><div /><div /><div /></x:frag>); | |
expect($elem->toString())->toEqual('<div></div>'); | |
@@ -384,31 +374,31 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
} | |
public function testEitherValidChild(): void { | |
- $x = <test:either-of-two-children><div /></test:either-of-two-children>; | |
+ $x = <test:either_of_two_children><div /></test:either_of_two_children>; | |
expect($x->toString())->toEqual('<div></div>'); | |
- $x = <test:either-of-two-children><code /></test:either-of-two-children>; | |
+ $x = <test:either_of_two_children><code /></test:either_of_two_children>; | |
expect($x->toString())->toEqual('<div></div>'); | |
- $x = <test:nested-rule><div /></test:nested-rule>; | |
+ $x = <test:nested_rule><div /></test:nested_rule>; | |
expect($x->toString())->toEqual('<div></div>'); | |
- $x = <test:nested-rule><code /></test:nested-rule>; | |
+ $x = <test:nested_rule><code /></test:nested_rule>; | |
expect($x->toString())->toEqual('<div></div>'); | |
- $x = <test:nested-rule><code /><code /></test:nested-rule>; | |
+ $x = <test:nested_rule><code /><code /></test:nested_rule>; | |
expect($x->toString())->toEqual('<div></div>'); | |
} | |
public function testPCDataChild(): void { | |
- $x = <test:pcdata-child>herp derp</test:pcdata-child>; | |
+ $x = <test:pcdata_child>herp derp</test:pcdata_child>; | |
expect($x->toString())->toEqual('<div>herp derp</div>'); | |
- $x = <test:pcdata-child>{123}</test:pcdata-child>; | |
+ $x = <test:pcdata_child>{123}</test:pcdata_child>; | |
expect($x->toString())->toEqual('<div>123</div>'); | |
} | |
public function testCommaCategory(): void { | |
$x = | |
- <test:needs-comma-category> | |
- <test:has-comma-category /> | |
- </test:needs-comma-category>; | |
+ <test:needs_comma_category> | |
+ <test:has_comma_category /> | |
+ </test:needs_comma_category>; | |
expect($x->toString())->toEqual('<div></div>'); | |
} | |
@@ -419,7 +409,7 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testNested(): void { | |
expect(() ==> { | |
- $x = <div><test:at-least-one-child /></div>; | |
+ $x = <div><test:at_least_one_child /></div>; | |
$x->toString(); | |
})->toThrow(XHPInvalidChildrenException::class); | |
} | |
@@ -427,18 +417,18 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testNewChildDeclarations(): void { | |
expect( | |
( | |
- <test:new-child-declaration-only> | |
+ <test:new_child_declaration_only> | |
<div>foo</div> | |
- </test:new-child-declaration-only> | |
+ </test:new_child_declaration_only> | |
)->toString(), | |
)->toEqual('<div>foo</div>'); | |
- expect(() ==> (<test:new-child-declaration-only />)->toString())->toThrow( | |
+ expect(() ==> (<test:new_child_declaration_only />)->toString())->toThrow( | |
XHPInvalidChildrenException::class, | |
); | |
expect( | |
() ==> ( | |
- <test:new-child-declaration-only><p /></test:new-child-declaration-only> | |
+ <test:new_child_declaration_only><p /></test:new_child_declaration_only> | |
)->toString(), | |
)->toThrow(XHPInvalidChildrenException::class); | |
} | |
@@ -446,18 +436,18 @@ class ChildRuleTest extends Facebook\HackTest\HackTest { | |
public function testOldChildDeclarations(): void { | |
expect( | |
( | |
- <test:old-child-declaration-only> | |
+ <test:old_child_declaration_only> | |
<div>foo</div> | |
- </test:old-child-declaration-only> | |
+ </test:old_child_declaration_only> | |
)->toString(), | |
)->toEqual('<div>foo</div>'); | |
- expect(() ==> (<test:old-child-declaration-only />)->toString())->toThrow( | |
+ expect(() ==> (<test:old_child_declaration_only />)->toString())->toThrow( | |
XHPInvalidChildrenException::class, | |
); | |
expect( | |
() ==> ( | |
- <test:old-child-declaration-only><p /></test:old-child-declaration-only> | |
+ <test:old_child_declaration_only><p /></test:old_child_declaration_only> | |
)->toString(), | |
)->toThrow(XHPInvalidChildrenException::class); | |
} | |
diff --git a/tests/HackEnumAttributesTest.php b/tests/HackEnumAttributesTest.php | |
index b6c8138..0698920 100644 | |
--- a/tests/HackEnumAttributesTest.php | |
+++ b/tests/HackEnumAttributesTest.php | |
@@ -15,7 +15,7 @@ enum TestEnum: int { | |
DERP = 2; | |
} | |
-class :test:hack-enum-attribute extends :x:element { | |
+xhp class test:hack_enum_attribute extends :x:element { | |
attribute TestEnum foo @required; | |
protected function render(): XHPRoot { | |
$foo = TestEnum::getNames()[$this->:foo]; | |
@@ -34,21 +34,21 @@ class HackEnumAttributesTest extends Facebook\HackTest\HackTest { | |
} | |
public function testValidValues(): void { | |
- $x = <test:hack-enum-attribute foo={TestEnum::HERP} />; | |
+ $x = <test:hack_enum_attribute foo={TestEnum::HERP} />; | |
expect($x->toString())->toEqual('<div>HERP</div>'); | |
- $x = <test:hack-enum-attribute foo={TestEnum::DERP} />; | |
+ $x = <test:hack_enum_attribute foo={TestEnum::DERP} />; | |
expect($x->toString())->toEqual('<div>DERP</div>'); | |
} | |
public function testValidRawValues(): void { | |
// UNSAFE | |
$x = | |
- <test:hack-enum-attribute | |
+ <test:hack_enum_attribute | |
foo={/* HH_IGNORE_ERROR[4110] */ /* HH_IGNORE_ERROR[4343] */ 1} | |
/>; | |
expect($x->toString())->toEqual('<div>HERP</div>'); | |
$x = | |
- <test:hack-enum-attribute | |
+ <test:hack_enum_attribute | |
foo={/* HH_IGNORE_ERROR[4110] *//* HH_IGNORE_ERROR[4343] */2} | |
/>; | |
expect($x->toString())->toEqual('<div>DERP</div>'); | |
@@ -57,7 +57,7 @@ class HackEnumAttributesTest extends Facebook\HackTest\HackTest { | |
public function testInvalidValue(): void { | |
expect(() ==> { | |
$x = | |
- <test:hack-enum-attribute | |
+ <test:hack_enum_attribute | |
foo={/* HH_FIXME[4110] */ /* HH_FIXME[4343] */ 0} | |
/>; | |
})->toThrow(XHPInvalidAttributeException::class); | |
diff --git a/tests/ReflectionTest.php b/tests/ReflectionTest.php | |
index adf1ab1..6a90b66 100644 | |
--- a/tests/ReflectionTest.php | |
+++ b/tests/ReflectionTest.php | |
@@ -10,12 +10,19 @@ | |
use function Facebook\FBExpect\expect; | |
-class :test:for-reflection extends :x:element { | |
+use namespace Facebook\XHP\ChildValidation as XHPChild; | |
+ | |
+xhp class test:for_reflection extends :x:element { | |
+ use XHPChildValidation; | |
attribute | |
string mystring @required, | |
enum {'herp', 'derp'} myenum, | |
string mystringwithdefault = 'mydefault'; | |
- children (:div+, (:code, :a)?); | |
+ | |
+ protected static function getChildrenDeclaration(): XHPChild\Constraint { | |
+ return XHPChild\sequence(XHPChild\atLeastOneOf(XHPChild\ofType<:div>()), XHPChild\optional(XHPChild\sequence(XHPChild\ofType<:code>(), XHPChild\ofType<:a>(), )), ); | |
+ } | |
+ | |
category %herp, %derp; | |
public function render(): XHPRoot { | |
@@ -27,11 +34,11 @@ class ReflectionTest extends Facebook\HackTest\HackTest { | |
private ?ReflectionXHPClass $rxc; | |
public async function beforeEachTestAsync(): Awaitable<void> { | |
- $this->rxc = new ReflectionXHPClass(:test:for-reflection::class); | |
+ $this->rxc = new ReflectionXHPClass(:test:for_reflection::class); | |
} | |
public function testClassName(): void { | |
- expect($this->rxc?->getClassName())->toEqual(:test:for-reflection::class); | |
+ expect($this->rxc?->getClassName())->toEqual(:test:for_reflection::class); | |
} | |
public function testElementName(): void { | |
@@ -44,7 +51,7 @@ class ReflectionTest extends Facebook\HackTest\HackTest { | |
public function testReflectionClass(): void { | |
$rc = $this->rxc?->getReflectionClass(); | |
expect($rc)->toBeInstanceOf(ReflectionClass::class); | |
- expect($rc?->getName())->toEqual(:test:for-reflection::class); | |
+ expect($rc?->getName())->toEqual(:test:for_reflection::class); | |
} | |
public function testGetChildren(): void { | |
diff --git a/tests/TestChildFlushing.php b/tests/TestChildFlushing.php | |
index 9390396..49c25b2 100644 | |
--- a/tests/TestChildFlushing.php | |
+++ b/tests/TestChildFlushing.php | |
@@ -12,7 +12,7 @@ use function Facebook\FBExpect\expect; | |
use type Facebook\HackTest\DataProvider; | |
-class :test:verbatim-root extends :x:element { | |
+xhp class test:verbatim_root extends :x:element { | |
attribute XHPRoot root @required; | |
protected function render(): XHPRoot { | |
@@ -20,7 +20,7 @@ class :test:verbatim-root extends :x:element { | |
} | |
} | |
-class :test:verbatim-root:async extends :x:element { | |
+xhp class test:verbatim_root:async extends :x:element { | |
use XHPAsync; | |
attribute XHPRoot root @required; | |
@@ -35,31 +35,31 @@ class XHPChildFlushTest extends Facebook\HackTest\HackTest { | |
return vec[ | |
tuple(<div />, '<div></div>'), | |
tuple(<div><div /><div /></div>, '<div><div></div><div></div></div>'), | |
- tuple(<test:verbatim-root root={<div />} />, '<div></div>'), | |
+ tuple(<test:verbatim_root root={<div />} />, '<div></div>'), | |
tuple(<x:frag><div /></x:frag>, '<div></div>'), | |
tuple(<x:frag><div /><div /></x:frag>, '<div></div><div></div>'), | |
tuple( | |
- <test:verbatim-root root={<x:frag><div /><div /></x:frag>} />, | |
+ <test:verbatim_root root={<x:frag><div /><div /></x:frag>} />, | |
'<div></div><div></div>', | |
), | |
tuple( | |
- <test:verbatim-root root={<test:verbatim-root root={<div />} />} />, | |
+ <test:verbatim_root root={<test:verbatim_root root={<div />} />} />, | |
'<div></div>', | |
), | |
- tuple(<test:verbatim-root:async root={<div />} />, '<div></div>'), | |
+ tuple(<test:verbatim_root:async root={<div />} />, '<div></div>'), | |
]; | |
} | |
<<DataProvider('xhpRootProvider')>> | |
public function testSynchronous(XHPRoot $root, string $expected): void { | |
- $elem = <test:verbatim-root />; | |
+ $elem = <test:verbatim_root />; | |
$elem->setContext('root', $root); | |
expect($elem->toString())->toEqual($expected); | |
} | |
<<DataProvider('xhpRootProvider')>> | |
public function testAsynchronous(XHPRoot $root, string $expected): void { | |
- $elem = <test:verbatim-root:async />; | |
+ $elem = <test:verbatim_root:async />; | |
$elem->setContext('root', $root); | |
expect($elem->toString())->toEqual($expected); | |
} | |
diff --git a/tests/XHPContextsTest.php b/tests/XHPContextsTest.php | |
index f703423..0c82566 100644 | |
--- a/tests/XHPContextsTest.php | |
+++ b/tests/XHPContextsTest.php | |
@@ -10,7 +10,7 @@ | |
use function Facebook\FBExpect\expect; | |
-class :test:contexts extends :x:element { | |
+xhp class test:contexts extends :x:element { | |
protected function render(): XHPRoot { | |
return | |
<div> | |
diff --git a/tests/XHPHelpersTest.php b/tests/XHPHelpersTest.php | |
index 94856d5..41811b4 100644 | |
--- a/tests/XHPHelpersTest.php | |
+++ b/tests/XHPHelpersTest.php | |
@@ -10,47 +10,47 @@ | |
use function Facebook\FBExpect\expect; | |
-class :test:no-xhphelpers extends :x:element { | |
+xhp class test:no_xhphelpers extends :x:element { | |
use XHPBaseHTMLHelpers; | |
- attribute :xhp:html-element; | |
+ attribute :xhp:html_element; | |
protected function render(): XHPRoot { | |
return <div />; | |
} | |
} | |
-class :test:xhphelpers extends :x:element { | |
+xhp class test:xhphelpers extends :x:element { | |
use XHPHelpers; | |
- attribute :xhp:html-element; | |
+ attribute :xhp:html_element; | |
protected function render(): XHPRoot { | |
return <div>{$this->getChildren()}</div>; | |
} | |
} | |
-class :test:async:no-xhphelpers extends :x:element { | |
+xhp class test:async:no_xhphelpers extends :x:element { | |
use XHPAsync; | |
use XHPBaseHTMLHelpers; | |
- attribute :xhp:html-element; | |
+ attribute :xhp:html_element; | |
protected async function asyncRender(): Awaitable<XHPRoot> { | |
return <div />; | |
} | |
} | |
-class :test:async:xhphelpers extends :x:element { | |
+xhp class test:async:xhphelpers extends :x:element { | |
use XHPAsync; | |
use XHPHelpers; | |
- attribute :xhp:html-element; | |
+ attribute :xhp:html_element; | |
protected async function asyncRender(): Awaitable<XHPRoot> { | |
return <div />; | |
} | |
} | |
-class :test:with-class-on-root extends :x:element { | |
+xhp class test:with_class_on_root extends :x:element { | |
use XHPHelpers; | |
- attribute :xhp:html-element; | |
+ attribute :xhp:html_element; | |
protected function render(): XHPRoot { | |
return <div class="rootClass" />; | |
@@ -59,14 +59,14 @@ class :test:with-class-on-root extends :x:element { | |
class XHPHelpersTest extends Facebook\HackTest\HackTest { | |
public function testTransferAttributesWithoutHelpers(): void { | |
- $x = <test:no-xhphelpers data-foo="bar" />; | |
+ $x = <test:no_xhphelpers data-foo="bar" />; | |
expect($x->toString())->toEqual('<div></div>'); | |
expect($x->getID())->toNotBeEmpty(); | |
expect($x->toString())->toEqual('<div></div>'); | |
} | |
public function testTransferAttributesAsyncWithoutHelpers(): void { | |
- $x = <test:async:no-xhphelpers data-foo="bar" />; | |
+ $x = <test:async:no_xhphelpers data-foo="bar" />; | |
expect($x->toString())->toEqual('<div></div>'); | |
expect($x->getID())->toNotBeEmpty(); | |
expect($x->toString())->toEqual('<div></div>'); | |
@@ -87,7 +87,7 @@ class XHPHelpersTest extends Facebook\HackTest\HackTest { | |
} | |
public function testAddClassWithoutHelpers(): void { | |
- $x = <test:no-xhphelpers class="foo" />; | |
+ $x = <test:no_xhphelpers class="foo" />; | |
$x->addClass("bar"); | |
$x->conditionClass(true, "herp"); | |
$x->conditionClass(false, "derp"); | |
@@ -105,17 +105,17 @@ class XHPHelpersTest extends Facebook\HackTest\HackTest { | |
} | |
public function testRootClassPreserved(): void { | |
- $x = <test:with-class-on-root />; | |
+ $x = <test:with_class_on_root />; | |
expect($x->toString())->toEqual('<div class="rootClass"></div>'); | |
} | |
public function testTransferedClassesAppended(): void { | |
- $x = <test:with-class-on-root class="extraClass" />; | |
+ $x = <test:with_class_on_root class="extraClass" />; | |
expect($x->toString())->toEqual('<div class="rootClass extraClass"></div>'); | |
} | |
public function testRootClassesNotOverridenByEmptyString(): void { | |
- $x = <test:with-class-on-root class="" />; | |
+ $x = <test:with_class_on_root class="" />; | |
expect($x->toString())->toEqual('<div class="rootClass"></div>'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment