Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/core/etl/src/Flow/ETL/DSL/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ function xml_element_entry(string $name, \DOMElement|string|null $value, ?Metada
* @return Entry<?HTMLDocument>
*/
#[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);
}
Expand Down Expand Up @@ -1973,7 +1973,7 @@ function json_schema(string $name, bool $nullable = false, ?Metadata $metadata =
* @return Definition<HTMLDocument>
*/
#[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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/etl/src/Flow/ETL/Schema/Definition.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public static function fromArray(array $definition) : self
/**
* @return Definition<HTMLDocument>
*/
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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/src/Flow/Types/DSL/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function type_literal(bool|float|int|string $value) : LiteralType
* @return Type<HTMLDocument>
*/
#[DocumentationDSL(module: Module::TYPES, type: DSLType::TYPE)]
function type_html() : Type // @phpstan-ignore class.notFound
function type_html() : Type
{
return new HTMLType();
}
Expand Down
5 changes: 2 additions & 3 deletions src/lib/types/src/Flow/Types/Type/Logical/HTMLType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -32,15 +32,14 @@ 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);
}

/* @phpstan-ignore-next-line */
if (\is_string($value)) {
/* @phpstan-ignore-next-line class.notFound */
return HTMLDocument::createFromString($value);
}

Expand Down