Skip to content

fix: support rector 2.8 - #115

Open
susnux wants to merge 3 commits into
mainfrom
fix/rector-2.8
Open

susnux wants to merge 3 commits into
mainfrom
fix/rector-2.8

Conversation

@susnux

@susnux susnux commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Rector 2.8 broke this library, and with it Nextcloud server's rector setup (nextcloud/server#66578):

  • AnnotationToAttributeRector: Rector 2.8.2 removed Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser. This switches to phpdoc-parser's NodeTraverser with CallablePhpDocNodeVisitor, the way upstream's AnnotationToAttributeRector does now. It also replaces the deprecated PhpVersionFeature with PhpVersion. rector/rector is bumped to ^2.8.2.

  • OC_Helper → OCP\Util: RenameStaticMethodRector is deprecated and now a no-op, so the Nextcloud 25 set silently stopped migrating these calls. It is replaced by a dedicated OcHelperToOcpUtilRector.

  • Breaking: NextcloudNamespaceSkipVoter is removed. Rector 2.8.0 deleted ClassNameImportSkipVoterInterface (Inline class-name import skip voters into ClassNameImportSkipper rectorphp/rector-src#8696) and offers no replacement, so imports can no longer be limited to Nextcloud namespaces.

  • AI assisted

Rector 2.8.2 removed its own `PhpDocNodeTraverser` in favour of the
phpdoc-parser `NodeTraverser` and deprecated `PhpVersionFeature`.

Assisted-by: ClaudeCode:claude-opus-5-5
Rector 2.8 turned `RenameStaticMethodRector` into a no-op, so the
`OC_Helper` to `OCP\Util` migration needs its own rule.

Assisted-by: ClaudeCode:claude-opus-5-5
Rector 2.8 removed `ClassNameImportSkipVoterInterface` without a
replacement, so name imports can no longer be limited to Nextcloud
namespaces.

Assisted-by: ClaudeCode:claude-opus-5-5

@nickvergessen nickvergessen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Did not execute, but looks good

@nickvergessen

Copy link
Copy Markdown
Contributor

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.

AnnotationToAttributeRector fails with rector 2.8: PhpDocNodeTraverser was removed

2 participants