diff --git a/phpstan.neon b/phpstan.neon index 5f00a3ac82..336871d722 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -87,20 +87,8 @@ parameters: ignoreErrors: - + message: '#Dom\\(HTMLDocument|Element)#i' identifier: class.notFound - path: src/core/etl/src/Flow/ETL/Row/Entry/HTMLEntry.php - - - - identifier: class.notFound - path: src/core/etl/src/Flow/ETL/Function/HTMLQuerySelector.php - - - - identifier: class.notFound - path: src/core/etl/src/Flow/ETL/Function/HTMLQuerySelectorAll.php - - - - identifier: class.notFound - path: src/lib/types/src/Flow/Types/Type/Logical/HTMLType.php includes: - tools/phpstan/vendor/spaze/phpstan-disallowed-calls/extension.neon diff --git a/src/core/etl/src/Flow/ETL/DSL/functions.php b/src/core/etl/src/Flow/ETL/DSL/functions.php index 4b51b12e42..aec40562a6 100644 --- a/src/core/etl/src/Flow/ETL/DSL/functions.php +++ b/src/core/etl/src/Flow/ETL/DSL/functions.php @@ -632,7 +632,7 @@ function xml_element_entry(string $name, \DOMElement|string|null $value, ?Metada * @return Entry */ #[DocumentationDSL(module: Module::CORE, type: DSLType::ENTRY)] -function html_entry(string $name, HTMLDocument|string|null $value, ?Metadata $metadata = null) : Entry // @phpstan-ignore class.notFound,class.notFound +function html_entry(string $name, HTMLDocument|string|null $value, ?Metadata $metadata = null) : Entry { return new HTMLEntry($name, $value, $metadata); } @@ -1973,7 +1973,7 @@ function json_schema(string $name, bool $nullable = false, ?Metadata $metadata = * @return Definition */ #[DocumentationDSL(module: Module::CORE, type: DSLType::SCHEMA)] -function html_schema(string $name, bool $nullable = false, ?Metadata $metadata = null) : Definition // @phpstan-ignore class.notFound +function html_schema(string $name, bool $nullable = false, ?Metadata $metadata = null) : Definition { return Definition::html($name, $nullable, $metadata); } diff --git a/src/core/etl/src/Flow/ETL/Schema/Definition.php b/src/core/etl/src/Flow/ETL/Schema/Definition.php index 8fe5bb03af..ecb9910830 100644 --- a/src/core/etl/src/Flow/ETL/Schema/Definition.php +++ b/src/core/etl/src/Flow/ETL/Schema/Definition.php @@ -143,7 +143,7 @@ public static function fromArray(array $definition) : self /** * @return Definition */ - public static function html(string|Reference $entry, bool $nullable = false, ?Metadata $metadata = null) : self // @phpstan-ignore class.notFound + public static function html(string|Reference $entry, bool $nullable = false, ?Metadata $metadata = null) : self { return new self($entry, type_html(), $nullable, $metadata); } diff --git a/src/lib/types/src/Flow/Types/DSL/functions.php b/src/lib/types/src/Flow/Types/DSL/functions.php index 94abc4a513..d404638a8f 100644 --- a/src/lib/types/src/Flow/Types/DSL/functions.php +++ b/src/lib/types/src/Flow/Types/DSL/functions.php @@ -441,7 +441,7 @@ function type_literal(bool|float|int|string $value) : LiteralType * @return Type */ #[DocumentationDSL(module: Module::TYPES, type: DSLType::TYPE)] -function type_html() : Type // @phpstan-ignore class.notFound +function type_html() : Type { return new HTMLType(); } diff --git a/src/lib/types/src/Flow/Types/Type/Logical/HTMLType.php b/src/lib/types/src/Flow/Types/Type/Logical/HTMLType.php index 56a3597dfb..1205eb1af3 100644 --- a/src/lib/types/src/Flow/Types/Type/Logical/HTMLType.php +++ b/src/lib/types/src/Flow/Types/Type/Logical/HTMLType.php @@ -23,7 +23,7 @@ $@isx REGXP; - public function assert(mixed $value) : HTMLDocument // @phpstan-ignore class.notFound + public function assert(mixed $value) : HTMLDocument { if ($this->isValid($value)) { return $value; @@ -32,7 +32,7 @@ public function assert(mixed $value) : HTMLDocument // @phpstan-ignore class.not throw InvalidTypeException::value($value, $this); } - public function cast(mixed $value) : HTMLDocument // @phpstan-ignore class.notFound + public function cast(mixed $value) : HTMLDocument { if (!$this->isValid($value)) { throw new CastingException($value, $this); @@ -40,7 +40,6 @@ public function cast(mixed $value) : HTMLDocument // @phpstan-ignore class.notFo /* @phpstan-ignore-next-line */ if (\is_string($value)) { - /* @phpstan-ignore-next-line class.notFound */ return HTMLDocument::createFromString($value); }