-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static analysis compatibility with PHP 8.1 and PHP 8.4
* tweak: php 8.1 support * tweak: php 8.4 support * tweak: inherit integers from parent node class * tweak: inherit integers from parent node class * tweak: class definition * tweak: fix node extension issue * tweak: php 8.4 changes * tweak: phpcs ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files * tweak: phpstan ignore node files
- Loading branch information
Showing
7 changed files
with
115 additions
and
44 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
parameters: | ||
level: 6 | ||
paths: | ||
- src/ | ||
excludePaths: | ||
- src/Node83.php | ||
- src/Node84.php |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,12 @@ | ||
<?php | ||
// phpcs:ignoreFile | ||
namespace Gt\Dom; | ||
|
||
use DOMNode; | ||
|
||
class Node extends DOMNode { | ||
use NonDocumentTypeChildNode; | ||
use ChildNode; | ||
use ParentNode; | ||
use RegisteredNodeClass; | ||
|
||
const TYPE_ELEMENT = XML_ELEMENT_NODE; | ||
const TYPE_ATTR = XML_ATTRIBUTE_NODE; | ||
const TYPE_TEXT = XML_TEXT_NODE; | ||
const TYPE_CDATA = XML_CDATA_SECTION_NODE; | ||
const TYPE_ENTITY_REF = XML_ENTITY_REF_NODE; | ||
const TYPE_ENTITY = XML_ENTITY_NODE; | ||
const TYPE_PI = XML_PI_NODE; | ||
const TYPE_COMMENT = XML_COMMENT_NODE; | ||
const TYPE_DOCUMENT = XML_DOCUMENT_NODE; | ||
const TYPE_DOCUMENT_TYPE = XML_DOCUMENT_TYPE_NODE; | ||
const TYPE_DOCUMENT_FRAGMENT = XML_DOCUMENT_FRAG_NODE; | ||
const TYPE_NOTATION = XML_NOTATION_NODE; | ||
const TYPE_HTML_DOCUMENT = XML_HTML_DOCUMENT_NODE; | ||
const TYPE_DTD = XML_DTD_NODE; | ||
const TYPE_ELEMENT_DECL = XML_ELEMENT_DECL_NODE; | ||
const TYPE_ATTRIBUTE_DECL = XML_ATTRIBUTE_DECL_NODE; | ||
const TYPE_ENTITY_DECL = XML_ENTITY_DECL_NODE; | ||
const TYPE_NAMESPACE_DECL = XML_NAMESPACE_DECL_NODE; | ||
|
||
public const DOCUMENT_POSITION_DISCONNECTED = 0b000001; | ||
public const DOCUMENT_POSITION_PRECEDING = 0b000010; | ||
public const DOCUMENT_POSITION_FOLLOWING = 0b000100; | ||
public const DOCUMENT_POSITION_CONTAINS = 0b001000; | ||
public const DOCUMENT_POSITION_CONTAINED_BY = 0b010000; | ||
public const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0b100000; | ||
|
||
private function __construct() {} | ||
if (version_compare(PHP_VERSION, '8.4', '>=')) { | ||
class Node extends Node84 { | ||
} | ||
} | ||
else { | ||
class Node extends Node83 { | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
// phpcs:ignoreFile | ||
namespace Gt\Dom; | ||
|
||
use DOMNode; | ||
|
||
class Node83 extends DOMNode { | ||
use NonDocumentTypeChildNode; | ||
use ChildNode; | ||
use ParentNode; | ||
use RegisteredNodeClass; | ||
|
||
const TYPE_ELEMENT = XML_ELEMENT_NODE; | ||
const TYPE_ATTR = XML_ATTRIBUTE_NODE; | ||
const TYPE_TEXT = XML_TEXT_NODE; | ||
const TYPE_CDATA = XML_CDATA_SECTION_NODE; | ||
const TYPE_ENTITY_REF = XML_ENTITY_REF_NODE; | ||
const TYPE_ENTITY = XML_ENTITY_NODE; | ||
const TYPE_PI = XML_PI_NODE; | ||
const TYPE_COMMENT = XML_COMMENT_NODE; | ||
const TYPE_DOCUMENT = XML_DOCUMENT_NODE; | ||
const TYPE_DOCUMENT_TYPE = XML_DOCUMENT_TYPE_NODE; | ||
const TYPE_DOCUMENT_FRAGMENT = XML_DOCUMENT_FRAG_NODE; | ||
const TYPE_NOTATION = XML_NOTATION_NODE; | ||
const TYPE_HTML_DOCUMENT = XML_HTML_DOCUMENT_NODE; | ||
const TYPE_DTD = XML_DTD_NODE; | ||
const TYPE_ELEMENT_DECL = XML_ELEMENT_DECL_NODE; | ||
const TYPE_ATTRIBUTE_DECL = XML_ATTRIBUTE_DECL_NODE; | ||
const TYPE_ENTITY_DECL = XML_ENTITY_DECL_NODE; | ||
const TYPE_NAMESPACE_DECL = XML_NAMESPACE_DECL_NODE; | ||
|
||
public const DOCUMENT_POSITION_DISCONNECTED = 0b000001; | ||
public const DOCUMENT_POSITION_PRECEDING = 0b000010; | ||
public const DOCUMENT_POSITION_FOLLOWING = 0b000100; | ||
public const DOCUMENT_POSITION_CONTAINS = 0b001000; | ||
public const DOCUMENT_POSITION_CONTAINED_BY = 0b010000; | ||
public const DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0b100000; | ||
|
||
private function __construct() {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
// phpcs:ignoreFile | ||
namespace Gt\Dom; | ||
|
||
use DOMNode; | ||
|
||
class Node84 extends DOMNode { | ||
use NonDocumentTypeChildNode; | ||
use ChildNode; | ||
use ParentNode; | ||
use RegisteredNodeClass; | ||
|
||
const TYPE_ELEMENT = XML_ELEMENT_NODE; | ||
const TYPE_ATTR = XML_ATTRIBUTE_NODE; | ||
const TYPE_TEXT = XML_TEXT_NODE; | ||
const TYPE_CDATA = XML_CDATA_SECTION_NODE; | ||
const TYPE_ENTITY_REF = XML_ENTITY_REF_NODE; | ||
const TYPE_ENTITY = XML_ENTITY_NODE; | ||
const TYPE_PI = XML_PI_NODE; | ||
const TYPE_COMMENT = XML_COMMENT_NODE; | ||
const TYPE_DOCUMENT = XML_DOCUMENT_NODE; | ||
const TYPE_DOCUMENT_TYPE = XML_DOCUMENT_TYPE_NODE; | ||
const TYPE_DOCUMENT_FRAGMENT = XML_DOCUMENT_FRAG_NODE; | ||
const TYPE_NOTATION = XML_NOTATION_NODE; | ||
const TYPE_HTML_DOCUMENT = XML_HTML_DOCUMENT_NODE; | ||
const TYPE_DTD = XML_DTD_NODE; | ||
const TYPE_ELEMENT_DECL = XML_ELEMENT_DECL_NODE; | ||
const TYPE_ATTRIBUTE_DECL = XML_ATTRIBUTE_DECL_NODE; | ||
const TYPE_ENTITY_DECL = XML_ENTITY_DECL_NODE; | ||
const TYPE_NAMESPACE_DECL = XML_NAMESPACE_DECL_NODE; | ||
|
||
public const int DOCUMENT_POSITION_DISCONNECTED = 0b000001; | ||
public const int DOCUMENT_POSITION_PRECEDING = 0b000010; | ||
public const int DOCUMENT_POSITION_FOLLOWING = 0b000100; | ||
public const int DOCUMENT_POSITION_CONTAINS = 0b001000; | ||
public const int DOCUMENT_POSITION_CONTAINED_BY = 0b010000; | ||
public const int DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 0b100000; | ||
|
||
private function __construct() {} | ||
} |
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
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