Skip to content

Adding types#20

Open
SuperDJ wants to merge 18 commits intolaminas:1.7.xfrom
SuperDJ:1.7.x-types
Open

Adding types#20
SuperDJ wants to merge 18 commits intolaminas:1.7.xfrom
SuperDJ:1.7.x-types

Conversation

@SuperDJ
Copy link
Copy Markdown
Contributor

@SuperDJ SuperDJ commented Oct 9, 2024

Q A
Documentation yes, only docblock
Bugfix no
BC Break possibly
New Feature no
RFC no
QA no

Description

  • Added types;

Copy link
Copy Markdown
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding native parameter and return types to public or protected members is a BC break - it can't be done in a minor unfortunately. Thumbs up on the changes to implicitly nullable types i.e. DomDocument $foo = null to DomDocument|null $foo = null as this will kill off deprecations in 8.4 as I'm sure you're aware.

Comment thread src/Security.php
* @throws Exception\RuntimeException If entity expansion or external entity declaration was discovered.
*/
protected static function heuristicScan($xml)
protected static function heuristicScan(string $xml): void
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a BC break on a non-final class. Feel free to add /** @final **/ to the class doc block to signal future intent, but this still can't be changed in a minor release.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you may want to add the BC Checker to CI like this: https://github.com/laminas/laminas-filter/pull/135/files

Comment thread src/Security.php
Comment on lines +37 to +42
private static function scanString(
string $xml,
DOMDocument|null $dom = null,
int $libXmlConstants,
callable $callback
): SimpleXMLElement|DomDocument|bool {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsteel Since there are breaking changes anyway, should we use that opportunity to change the parameter order as well? For example this method has the optional parameter as second instead of last item.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

laminas-xml is in security-only mode so it's unlikely that we'll be releasing a new major version. I'm not 100% sure on the rules around this so I'll have to check with the @laminas/technical-steering-committee …

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperDJ

Since there are breaking changes anyway…

Please note, this package is in security-only maintenance mode. See:

This means that there will be no further updates or changes. Adding version 8.4 of PHP is the only bigger change, aside from security updates.

Some more background informations: https://getlaminas.org/blog/2023-11-28-laminas-and-mezzio-supports-php-83.html

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gsteel
You were faster... 😄

Copy link
Copy Markdown
Member

@alexmerlin alexmerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperDJ Let's go through all the feedback received by this PR and wrap things up.

Comment thread composer.json Outdated
"ext-dom": "*",
"ext-simplexml": "*"
},
"ext-libxml": "*",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also fix indentation on these two lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants