Skip to content

Better namespace, add tests for PHPStan config and enhanced tests. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 27, 2025

Conversation

terabytesoftw
Copy link
Member

@terabytesoftw terabytesoftw commented Jun 27, 2025

Q A
Is bugfix? ✔️
New feature?
Breaks BC?

Summary by CodeRabbit

  • Refactor

    • Updated namespaces to lowercase for consistency.
    • Improved type safety and static analysis support with enhanced PHPStan annotations and stricter method signatures.
    • Simplified and clarified configuration and fixture management in tests.
  • Tests

    • Refactored and renamed test methods for clarity and improved diagnostics.
    • Enhanced test reliability with explicit precondition checks and improved output validation against fixture data.
    • Reorganized and replaced test support models and queries for better structure and maintainability.
  • Chores

    • Updated dependency versions and configuration in the project setup files.
    • Expanded static analysis coverage to include test code.

@terabytesoftw terabytesoftw added the bug Something isn't working label Jun 27, 2025
Copy link

coderabbitai bot commented Jun 27, 2025

"""

Walkthrough

This update refactors namespaces to lowercase for consistency, enhances type safety and static analysis via PHPStan-specific annotations, and improves test reliability with clearer assertions and fixture validation. Test support models and queries are reorganized, with new files introduced under lowercase namespaces and obsolete files removed. Composer and PHPStan configurations are updated accordingly.

Changes

File(s) Change Summary
composer.json Updated dependency versions, removed stability flags, changed autoload namespaces to lowercase, updated scripts.
phpstan.neon Added tests directory to PHPStan analysis paths.
src/NestedSetsBehavior.php
src/NestedSetsQueryBehavior.php
Changed namespace to lowercase; updated PHPDoc generics to PHPStan-specific annotations.
tests/NestedSetsBehaviorTest.php Refactored and renamed test methods for clarity, added fixture validation, improved assertions and null checks.
tests/NestedSetsQueryBehaviorTest.php Renamed and swapped test logic for roots/leaves, updated assertions and fixture paths.
tests/Support/Model/MultipleTreeQuery.php
tests/Support/Model/TreeQuery.php
Deleted obsolete query classes under old namespace.
tests/TestCase.php Refactored for lowercase namespace, improved type safety, added fixture directory, removed destroyApplication().
tests/config/phpstan-config.php Deleted obsolete PHPStan config.
tests/phpstan-config.php Updated imports to lowercase, added mappings for new model/query classes.
tests/support/model/MultipleTree.php
tests/support/model/Tree.php
Changed namespace to lowercase, added type hints, improved PHPStan annotations, updated method signatures.
tests/support/model/MultipleTreeQuery.php
tests/support/model/TreeQuery.php
Added new final query classes with behaviors under lowercase namespace.

Sequence Diagram(s)

sequenceDiagram
    participant Test as PHPUnit Test
    participant Model as Tree/MultipleTree
    participant Query as TreeQuery/MultipleTreeQuery
    participant Behavior as NestedSetsBehavior/NestedSetsQueryBehavior

    Test->>Model: Call static find()
    Model->>Query: Return new Query instance
    Query->>Behavior: Attach NestedSetsQueryBehavior via behaviors()
    Test->>Model: Perform operation (e.g., makeRoot, appendTo)
    Model->>Behavior: Delegate tree operation
    Behavior-->>Model: Update tree structure
    Test->>Test: Assert result, validate against fixture
Loading

Possibly related PRs

Poem

In burrows deep, the code did grow,
With lowercase names, it’s sure to flow.
Fixtures checked and tests refined,
PHPStan guides with typing kind.
Old roots pruned, new queries sprout—
The nested sets are sorted out!
🐇✨
"""

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 phpcs (3.7.2)
tests/TestCase.php

Warning: PHP Startup: Invalid date.timezone value 'UTC', using 'UTC' instead in Unknown on line 0

Fatal error: Uncaught Error: Class "Phar" not found in /usr/local/bin/phpcs:3
Stack trace:
#0 {main}
thrown in /usr/local/bin/phpcs on line 3


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a1c5df and 867e39c.

📒 Files selected for processing (1)
  • tests/TestCase.php (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/TestCase.php
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: phpunit / PHP 8.4-windows-latest
  • GitHub Check: phpunit / PHP 8.1-windows-latest
  • GitHub Check: phpunit-compatibility / PHP 8.3-windows-latest
  • GitHub Check: phpunit-compatibility / PHP 8.1-windows-latest
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
tests/support/model/TreeQuery.php (1)

17-22: Consider adding method documentation for better maintainability.

While the behaviors() method implementation is correct, adding a brief PHPDoc comment would improve code maintainability:

+    /**
+     * @return array<string> Behaviors attached to this query.
+     */
     public function behaviors(): array
     {
         return [
             NestedSetsQueryBehavior::class,
         ];
     }
tests/support/model/MultipleTreeQuery.php (1)

17-22: Consider adding method documentation for consistency.

For consistency with the TreeQuery class and better maintainability, consider adding method documentation:

+    /**
+     * @return array<string> Behaviors attached to this query.
+     */
     public function behaviors(): array
     {
         return [
             NestedSetsQueryBehavior::class,
         ];
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e3db951 and 6e7f527.

📒 Files selected for processing (15)
  • composer.json (3 hunks)
  • phpstan.neon (1 hunks)
  • src/NestedSetsBehavior.php (2 hunks)
  • src/NestedSetsQueryBehavior.php (2 hunks)
  • tests/NestedSetsBehaviorTest.php (1 hunks)
  • tests/NestedSetsQueryBehaviorTest.php (1 hunks)
  • tests/Support/Model/MultipleTreeQuery.php (0 hunks)
  • tests/Support/Model/TreeQuery.php (0 hunks)
  • tests/TestCase.php (6 hunks)
  • tests/config/phpstan-config.php (0 hunks)
  • tests/phpstan-config.php (2 hunks)
  • tests/support/model/MultipleTree.php (2 hunks)
  • tests/support/model/MultipleTreeQuery.php (1 hunks)
  • tests/support/model/Tree.php (2 hunks)
  • tests/support/model/TreeQuery.php (1 hunks)
💤 Files with no reviewable changes (3)
  • tests/Support/Model/TreeQuery.php
  • tests/Support/Model/MultipleTreeQuery.php
  • tests/config/phpstan-config.php
🧰 Additional context used
🧬 Code Graph Analysis (5)
tests/support/model/TreeQuery.php (2)
src/NestedSetsQueryBehavior.php (1)
  • NestedSetsQueryBehavior (36-142)
tests/support/model/MultipleTreeQuery.php (1)
  • behaviors (17-22)
tests/phpstan-config.php (4)
tests/support/model/MultipleTree.php (1)
  • MultipleTree (18-59)
tests/support/model/MultipleTreeQuery.php (1)
  • MultipleTreeQuery (15-23)
tests/support/model/Tree.php (1)
  • Tree (17-55)
tests/support/model/TreeQuery.php (1)
  • TreeQuery (15-23)
tests/support/model/Tree.php (2)
src/NestedSetsBehavior.php (1)
  • NestedSetsBehavior (44-1393)
tests/support/model/TreeQuery.php (2)
  • behaviors (17-22)
  • TreeQuery (15-23)
tests/TestCase.php (2)
tests/support/model/MultipleTree.php (2)
  • MultipleTree (18-59)
  • find (55-58)
tests/support/model/Tree.php (2)
  • Tree (17-55)
  • find (51-54)
tests/NestedSetsBehaviorTest.php (5)
tests/support/model/MultipleTree.php (1)
  • MultipleTree (18-59)
tests/support/model/Tree.php (1)
  • Tree (17-55)
tests/TestCase.php (4)
  • TestCase (13-212)
  • createDatabase (59-93)
  • buildFlatXMLDataSet (28-57)
  • generateFixtureTree (150-184)
src/NestedSetsBehavior.php (14)
  • makeRoot (830-835)
  • prependTo (959-965)
  • appendTo (292-298)
  • insertBefore (647-653)
  • insertAfter (606-612)
  • deleteWithChildren (519-541)
  • parents (900-924)
  • children (470-495)
  • leaves (775-797)
  • prev (990-996)
  • next (860-866)
  • isRoot (746-749)
  • isChildOf (678-696)
  • isLeaf (719-723)
src/NestedSetsQueryBehavior.php (1)
  • leaves (59-82)
🪛 phpcs (3.7.2)
tests/support/model/TreeQuery.php

[ERROR] 2-2: Missing file doc comment

(PEAR.Commenting.FileComment.Missing)


[ERROR] 10-10: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 14-14: Missing @category tag in class comment

(PEAR.Commenting.ClassComment.MissingCategoryTag)


[ERROR] 14-14: Missing @Package tag in class comment

(PEAR.Commenting.ClassComment.MissingPackageTag)


[ERROR] 14-14: Missing @author tag in class comment

(PEAR.Commenting.ClassComment.MissingAuthorTag)


[ERROR] 14-14: Missing @license tag in class comment

(PEAR.Commenting.ClassComment.MissingLicenseTag)


[ERROR] 14-14: Missing @link tag in class comment

(PEAR.Commenting.ClassComment.MissingLinkTag)


[ERROR] 17-17: Missing doc comment for function behaviors()

(PEAR.Commenting.FunctionComment.Missing)

tests/support/model/MultipleTreeQuery.php

[ERROR] 2-2: Missing file doc comment

(PEAR.Commenting.FileComment.Missing)


[ERROR] 10-10: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 14-14: Missing @category tag in class comment

(PEAR.Commenting.ClassComment.MissingCategoryTag)


[ERROR] 14-14: Missing @Package tag in class comment

(PEAR.Commenting.ClassComment.MissingPackageTag)


[ERROR] 14-14: Missing @author tag in class comment

(PEAR.Commenting.ClassComment.MissingAuthorTag)


[ERROR] 14-14: Missing @license tag in class comment

(PEAR.Commenting.ClassComment.MissingLicenseTag)


[ERROR] 14-14: Missing @link tag in class comment

(PEAR.Commenting.ClassComment.MissingLinkTag)


[ERROR] 17-17: Missing doc comment for function behaviors()

(PEAR.Commenting.FunctionComment.Missing)

tests/NestedSetsQueryBehaviorTest.php

[ERROR] 10-10: Missing doc comment for class NestedSetsQueryBehaviorTest

(PEAR.Commenting.ClassComment.Missing)


[ERROR] 12-12: Missing doc comment for function testReturnLeavesForSingleAndMultipleTreeModels()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 17-17: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 22-22: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 28-28: Missing doc comment for function testReturnRootsForSingleAndMultipleTreeModels()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 33-33: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 38-38: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)

tests/support/model/MultipleTree.php

[ERROR] 10-10: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 17-17: Missing @category tag in class comment

(PEAR.Commenting.ClassComment.MissingCategoryTag)


[ERROR] 17-17: Missing @Package tag in class comment

(PEAR.Commenting.ClassComment.MissingPackageTag)


[ERROR] 17-17: Missing @author tag in class comment

(PEAR.Commenting.ClassComment.MissingAuthorTag)


[ERROR] 17-17: Missing @license tag in class comment

(PEAR.Commenting.ClassComment.MissingLicenseTag)


[ERROR] 17-17: Missing @link tag in class comment

(PEAR.Commenting.ClassComment.MissingLinkTag)


[ERROR] 20-20: Missing doc comment for function tableName()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 25-25: Missing doc comment for function behaviors()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 35-35: Missing doc comment for function rules()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 42-42: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 44-44: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)


[ERROR] 52-52: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 54-54: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)

tests/support/model/Tree.php

[ERROR] 19-19: Missing doc comment for function tableName()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 24-24: Missing doc comment for function behaviors()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 31-31: Missing doc comment for function rules()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 38-38: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 40-40: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)


[ERROR] 48-48: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 50-50: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)

tests/TestCase.php

[ERROR] 13-13: Missing doc comment for class TestCase

(PEAR.Commenting.ClassComment.Missing)


[ERROR] 18-18: Missing doc comment for function getDb()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 23-23: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 23-23: Doc comment for parameter "$dataSet" missing

(PEAR.Commenting.FunctionComment.MissingParamTag)


[ERROR] 27-27: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)


[ERROR] 95-95: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 107-107: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)


[ERROR] 126-126: Missing short description in doc comment

(Generic.Commenting.DocComment.MissingShort)


[ERROR] 138-138: Missing @return tag in function comment

(PEAR.Commenting.FunctionComment.MissingReturn)


[ERROR] 202-202: Missing doc comment for function setUp()

(PEAR.Commenting.FunctionComment.Missing)

tests/NestedSetsBehaviorTest.php

[ERROR] 14-14: Missing doc comment for class NestedSetsBehaviorTest

(PEAR.Commenting.ClassComment.Missing)


[ERROR] 16-16: Missing doc comment for function testReturnTrueAndMatchXmlAfterMakeRootNewForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 54-54: Missing doc comment for function testThrowExceptionWhenMakeRootWithTreeAttributeFalseAndRootExists()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 66-66: Missing doc comment for function testReturnTrueAndMatchXmlAfterPrependToNewNodeForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 109-109: Missing doc comment for function testThrowExceptionWhenAppendToNewNodeTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 121-121: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertBeforeNewForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 164-164: Missing doc comment for function testThrowExceptionWhenInsertBeforeNewNodeTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 176-176: Missing doc comment for function testThrowExceptionWhenInsertBeforeNewNodeTargetIsRoot()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 194-194: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertAfterNewForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 238-238: Missing doc comment for function testThrowExceptionWhenInsertAfterNewNodeTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 250-250: Missing doc comment for function testThrowExceptionWhenInsertAfterNewNodeTargetIsRoot()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 269-269: Missing doc comment for function testReturnTrueAndMatchXmlAfterMakeRootOnExistingMultipleTreeNode()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 300-300: Missing doc comment for function testThrowExceptionWhenMakeRootOnNonRootNodeWithTreeAttributeFalse()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 314-314: Missing doc comment for function testThrowExceptionWhenMakeRootOnRootNodeInMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 331-331: Missing doc comment for function testReturnTrueAndMatchXmlAfterPrependToUpForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 388-388: Missing doc comment for function testReturnTrueAndMatchXmlAfterPrependToDownForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 445-445: Missing doc comment for function testReturnTrueAndMatchXmlAfterPrependToMultipleTreeWhenTargetIsInAnotherTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 482-482: Missing doc comment for function testThrowExceptionWhenPrependToTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 496-496: Missing doc comment for function testThrowExceptionWhenPrependToTargetIsSame()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 510-510: Missing doc comment for function testThrowExceptionWhenPrependToTargetIsChild()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 534-534: Missing doc comment for function testReturnTrueAndMatchXmlAfterAppendToUpForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 591-591: Missing doc comment for function testReturnTrueAndMatchXmlAfterAppendToDownForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 648-648: Missing doc comment for function testReturnTrueAndMatchXmlAfterAppendToMultipleTreeWhenTargetIsInAnotherTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 686-686: Missing doc comment for function testThrowExceptionWhenAppendToTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 700-700: Missing doc comment for function testThrowExceptionWhenAppendToTargetIsSame()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 724-724: Missing doc comment for function testThrowExceptionWhenAppendToTargetIsChild()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 748-748: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertBeforeUpForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 805-805: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertBeforeDownForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 862-862: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertBeforeMultipleTreeWhenTargetIsInAnotherTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 899-899: Missing doc comment for function testThrowExceptionWhenInsertBeforeTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 916-916: Missing doc comment for function testThrowExceptionWhenInsertBeforeTargetIsSame()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 930-930: Missing doc comment for function testThrowExceptionWhenInsertBeforeTargetIsChild()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 954-954: Missing doc comment for function testThrowExceptionWhenInsertBeforeTargetIsRoot()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 978-978: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertAfterUpForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1035-1035: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertAfterDownForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1092-1092: Missing doc comment for function testReturnTrueAndMatchXmlAfterInsertAfterMultipleTreeWhenTargetIsInAnotherTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1129-1129: Missing doc comment for function testThrowExceptionWhenInsertAfterTargetIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1143-1143: Missing doc comment for function testThrowExceptionWhenInsertAfterTargetIsSame()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1160-1160: Missing doc comment for function testThrowExceptionWhenInsertAfterTargetIsChild()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1184-1184: Missing doc comment for function testThrowExceptionWhenInsertAfterTargetIsRoot()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1202-1202: Missing doc comment for function testReturnAffectedRowsAndMatchXmlAfterDeleteWithChildrenForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1230-1230: Missing doc comment for function testThrowExceptionWhenDeleteWithChildrenIsCalledOnNewRecordNode()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1242-1242: Missing doc comment for function testReturnOneWhenDeleteNodeForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1270-1270: Missing doc comment for function testThrowExceptionWhenDeleteNodeIsNewRecord()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1282-1282: Missing doc comment for function testThrowNotSupportedExceptionWhenDeleteIsCalledOnRootNode()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1301-1301: Missing doc comment for function testThrowNotSupportedExceptionWhenInsertIsCalledOnTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1315-1315: Missing doc comment for function testReturnOneWhenUpdateNodeName()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1328-1328: Missing doc comment for function testReturnParentsForTreeAndMultipleTreeWithAndWithoutDepth()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1333-1333: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1338-1338: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1343-1343: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1348-1348: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1354-1354: Missing doc comment for function testReturnChildrenForTreeAndMultipleTreeWithAndWithoutDepth()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1359-1359: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1364-1364: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1369-1369: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1374-1374: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1380-1380: Missing doc comment for function testReturnLeavesForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1385-1385: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1390-1390: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1396-1396: Missing doc comment for function testReturnPrevNodesForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1401-1401: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1406-1406: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1412-1412: Missing doc comment for function testReturnNextNodesForTreeAndMultipleTree()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1417-1417: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1422-1422: File is being conditionally included; use "include" instead

(PEAR.Files.IncludingFile.UseInclude)


[ERROR] 1428-1428: Missing doc comment for function testReturnIsRootForRootAndNonRootNode()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1436-1436: Missing doc comment for function testReturnIsChildOfForMultipleTreeNodeUnderVariousAncestors()

(PEAR.Commenting.FunctionComment.Missing)


[ERROR] 1480-1480: Missing doc comment for function testIsLeafReturnsTrueForLeafAndFalseForRoot()

(PEAR.Commenting.FunctionComment.Missing)

🪛 PHPMD (2.15.0)
tests/NestedSetsQueryBehaviorTest.php

18-18: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnLeavesForSingleAndMultipleTreeModels'. (Clean Code Rules)

(StaticAccess)


23-23: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnLeavesForSingleAndMultipleTreeModels'. (Clean Code Rules)

(StaticAccess)


34-34: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnRootsForSingleAndMultipleTreeModels'. (Clean Code Rules)

(StaticAccess)


39-39: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnRootsForSingleAndMultipleTreeModels'. (Clean Code Rules)

(StaticAccess)

tests/NestedSetsBehaviorTest.php

72-72: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterPrependToNewNodeForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


85-85: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToNewNodeForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


127-127: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeNewForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


140-140: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeNewForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


181-181: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeNewNodeTargetIsRoot'. (Clean Code Rules)

(StaticAccess)


200-200: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterNewForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


214-214: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterNewForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


256-256: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterNewNodeTargetIsRoot'. (Clean Code Rules)

(StaticAccess)


273-273: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterMakeRootOnExistingMultipleTreeNode'. (Clean Code Rules)

(StaticAccess)


304-304: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenMakeRootOnNonRootNodeWithTreeAttributeFalse'. (Clean Code Rules)

(StaticAccess)


318-318: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testThrowExceptionWhenMakeRootOnRootNodeInMultipleTree'. (Clean Code Rules)

(StaticAccess)


335-335: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterPrependToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


344-344: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterPrependToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


355-355: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


364-364: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


392-392: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterPrependToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


401-401: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterPrependToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


412-412: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


421-421: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


449-449: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


458-458: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterPrependToMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


486-486: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenPrependToTargetIsNewRecord'. (Clean Code Rules)

(StaticAccess)


500-500: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenPrependToTargetIsSame'. (Clean Code Rules)

(StaticAccess)


514-514: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenPrependToTargetIsChild'. (Clean Code Rules)

(StaticAccess)


521-521: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenPrependToTargetIsChild'. (Clean Code Rules)

(StaticAccess)


538-538: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterAppendToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


547-547: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterAppendToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


558-558: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterAppendToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


567-567: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterAppendToUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


595-595: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterAppendToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


604-604: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterAppendToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


615-615: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterAppendToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


624-624: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterAppendToDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


652-652: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterAppendToMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


661-661: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterAppendToMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


690-690: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenAppendToTargetIsNewRecord'. (Clean Code Rules)

(StaticAccess)


704-704: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenAppendToTargetIsSame'. (Clean Code Rules)

(StaticAccess)


711-711: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenAppendToTargetIsSame'. (Clean Code Rules)

(StaticAccess)


728-728: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenAppendToTargetIsChild'. (Clean Code Rules)

(StaticAccess)


735-735: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenAppendToTargetIsChild'. (Clean Code Rules)

(StaticAccess)


752-752: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


761-761: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


772-772: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


781-781: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


809-809: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


818-818: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


829-829: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


838-838: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


866-866: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


875-875: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


903-903: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeTargetIsNewRecord'. (Clean Code Rules)

(StaticAccess)


920-920: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeTargetIsSame'. (Clean Code Rules)

(StaticAccess)


934-934: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeTargetIsChild'. (Clean Code Rules)

(StaticAccess)


941-941: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeTargetIsChild'. (Clean Code Rules)

(StaticAccess)


958-958: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeTargetIsRoot'. (Clean Code Rules)

(StaticAccess)


965-965: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertBeforeTargetIsRoot'. (Clean Code Rules)

(StaticAccess)


982-982: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


991-991: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1002-1002: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1011-1011: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterUpForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1039-1039: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1048-1048: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1059-1059: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1068-1068: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterDownForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1096-1096: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


1105-1105: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertAfterMultipleTreeWhenTargetIsInAnotherTree'. (Clean Code Rules)

(StaticAccess)


1133-1133: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterTargetIsNewRecord'. (Clean Code Rules)

(StaticAccess)


1147-1147: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterTargetIsSame'. (Clean Code Rules)

(StaticAccess)


1164-1164: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterTargetIsChild'. (Clean Code Rules)

(StaticAccess)


1171-1171: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterTargetIsChild'. (Clean Code Rules)

(StaticAccess)


1188-1188: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterTargetIsRoot'. (Clean Code Rules)

(StaticAccess)


1192-1192: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowExceptionWhenInsertAfterTargetIsRoot'. (Clean Code Rules)

(StaticAccess)


1286-1286: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testThrowNotSupportedExceptionWhenDeleteIsCalledOnRootNode'. (Clean Code Rules)

(StaticAccess)


1319-1319: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\Tree' in method 'testReturnOneWhenUpdateNodeName'. (Clean Code Rules)

(StaticAccess)


1334-1334: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnParentsForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1339-1339: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnParentsForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1344-1344: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnParentsForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1349-1349: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnParentsForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1360-1360: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnChildrenForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1365-1365: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnChildrenForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1370-1370: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnChildrenForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1375-1375: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnChildrenForTreeAndMultipleTreeWithAndWithoutDepth'. (Clean Code Rules)

(StaticAccess)


1386-1386: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnLeavesForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1391-1391: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnLeavesForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1402-1402: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnPrevNodesForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1407-1407: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnPrevNodesForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1418-1418: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnNextNodesForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1423-1423: Avoid using static access to class '\yii\helpers\ArrayHelper' in method 'testReturnNextNodesForTreeAndMultipleTree'. (Clean Code Rules)

(StaticAccess)


1440-1440: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnIsChildOfForMultipleTreeNodeUnderVariousAncestors'. (Clean Code Rules)

(StaticAccess)


1447-1447: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnIsChildOfForMultipleTreeNodeUnderVariousAncestors'. (Clean Code Rules)

(StaticAccess)


1455-1455: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnIsChildOfForMultipleTreeNodeUnderVariousAncestors'. (Clean Code Rules)

(StaticAccess)


1463-1463: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnIsChildOfForMultipleTreeNodeUnderVariousAncestors'. (Clean Code Rules)

(StaticAccess)


1471-1471: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnIsChildOfForMultipleTreeNodeUnderVariousAncestors'. (Clean Code Rules)

(StaticAccess)

🪛 GitHub Actions: build
tests/TestCase.php

[error] 157-157: Exception: String could not be parsed as XML due to failure loading external XML file in test cases.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: phpunit / PHP 8.3-windows-latest
🔇 Additional comments (30)
phpstan.neon (1)

12-12: Excellent addition for comprehensive static analysis coverage.

Including the tests directory in PHPStan analysis ensures test code maintains the same quality standards as production code and helps catch type errors in test files.

src/NestedSetsQueryBehavior.php (2)

5-5: LGTM: Namespace modernization to lowercase convention.

The namespace change from uppercase to lowercase follows modern PSR-4 conventions and improves consistency across the codebase.


29-31: LGTM: Enhanced static analysis with PHPStan-specific annotations.

The migration from generic @template and @extends to PHPStan-specific @phpstan-template and @phpstan-extends annotations provides better type safety and static analysis support.

tests/support/model/TreeQuery.php (1)

1-23: LGTM: Clean query class implementation with good type safety.

The TreeQuery class correctly extends ActiveQuery, attaches the NestedSetsQueryBehavior, and uses PHPStan generics for type safety. The implementation follows expected patterns and integrates well with the updated namespace structure.

tests/support/model/MultipleTreeQuery.php (1)

1-23: LGTM: Consistent query class implementation.

The MultipleTreeQuery class correctly mirrors the TreeQuery implementation with appropriate generic typing for the MultipleTree model. The consistent structure across query classes enhances maintainability.

src/NestedSetsBehavior.php (2)

5-5: LGTM: Consistent namespace modernization.

The lowercase namespace change aligns with the broader refactoring effort and follows modern PSR-4 conventions, maintaining consistency with NestedSetsQueryBehavior.


33-35: LGTM: Enhanced type safety with PHPStan annotations.

The update to PHPStan-specific template annotations improves static analysis capabilities and maintains consistency with the query behavior class updates.

tests/phpstan-config.php (2)

6-7: LGTM: Namespace and import updates are consistent.

The namespace changes from PascalCase to lowercase and the addition of new model imports align perfectly with the broader refactoring objectives.


17-28: LGTM: PHPStan behavior mappings are properly configured.

The behavior mappings correctly associate the new test models (MultipleTree, Tree) and their query classes (MultipleTreeQuery, TreeQuery) with the appropriate nested sets behaviors, enhancing static analysis coverage.

composer.json (4)

14-14: LGTM: Version constraint improvement.

The change from "dev-master|^22" to "^2.0.53|^22" is a good improvement, moving away from development versions to stable releases while maintaining compatibility.


23-23: LGTM: PHPStan dependency stabilized.

Updating from "dev-main" to "^0.3.0" provides better version stability for the PHPStan extension.


27-27: LGTM: Namespace standardization to lowercase.

The autoloading namespace changes from PascalCase to lowercase are consistent with the broader refactoring across the codebase.

Also applies to: 32-32


51-51: LGTM: Simplified PHPStan script command.

The removal of the analyse src argument is appropriate since PHPStan configuration should handle the analysis scope via its configuration files.

tests/NestedSetsQueryBehaviorTest.php (2)

5-8: LGTM: Namespace and import improvements.

The namespace update to lowercase and the use of grouped imports enhance code consistency and readability.


12-26: LGTM: Enhanced test method naming and assertions.

The renamed test methods (testReturnLeavesForSingleAndMultipleTreeModels and testReturnRootsForSingleAndMultipleTreeModels) are more descriptive. The improved assertions with self::assertEquals and descriptive messages enhance test maintainability.

Also applies to: 28-42

tests/support/model/Tree.php (3)

5-8: LGTM: Namespace standardization and explicit imports.

The lowercase namespace and explicit imports for ActiveRecord and NestedSetsBehavior improve code clarity and consistency.


17-17: LGTM: Type safety improvements.

Making the class final and adding explicit return types (string, array) enhances type safety and prevents unintended inheritance in test models.

Also applies to: 19-19, 24-24, 31-31


38-46: LGTM: Enhanced static analysis support.

The PHPStan docblocks (@phpstan-return) and the typed find() method returning TreeQuery<self> significantly improve static analysis capabilities and type safety.

Also applies to: 48-54

tests/support/model/MultipleTree.php (3)

5-8: LGTM: Consistent namespace and import improvements.

The lowercase namespace and explicit imports maintain consistency with the Tree model and broader refactoring objectives.


18-18: LGTM: Type safety enhancements.

The final class declaration and explicit return types for behaviors() and rules() methods improve type safety and prevent unintended modifications in test scenarios.

Also applies to: 25-25, 35-35


42-50: LGTM: Static analysis and query improvements.

The PHPStan docblocks and typed find() method returning MultipleTreeQuery<self> enhance static analysis capabilities. The configuration correctly supports multi-tree scenarios with the treeAttribute setting.

Also applies to: 52-58

tests/TestCase.php (6)

5-11: LGTM! Namespace and import improvements.

The namespace change to lowercase and grouped imports improve consistency and readability.


16-16: Good addition for fixture path management.

Centralizing the fixture directory path improves maintainability.


23-57: Excellent improvements to XML handling and type safety.

The additions of PHPStan annotations, nullsafe operators, explicit string casting, and validation assertions significantly improve the robustness of this method.


95-124: Type annotations and data consistency improvements.

Good addition of PHPStan annotations and ensuring consistent tree attribute values.


126-148: Well-structured new method for multiple tree datasets.

The method is properly annotated and correctly re-indexes the array to match the list return type.


202-202: Correct PHPUnit lifecycle method naming.

Good fix - PHPUnit expects setUp() not setup().

tests/NestedSetsBehaviorTest.php (3)

5-12: Consistent namespace and import improvements.

Changes align with the project-wide namespace standardization.


16-107: Excellent test improvements for reliability and clarity.

The enhanced test method names, null checks, detailed assertion messages, and proper error handling for XML loading significantly improve test quality and debugging experience.


60-64: Correct exception expectation ordering.

Good practice placing expectation calls before the triggering operation.

@terabytesoftw terabytesoftw requested a review from Copilot June 27, 2025 17:12
Copilot

This comment was marked as outdated.

@terabytesoftw terabytesoftw requested a review from Copilot June 27, 2025 20:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR standardizes namespaces to lowercase, enhances PHPStan configuration, and refactors test fixtures and assertions for improved type safety and static analysis support.

  • Renamed namespaces and updated PSR-4 mappings in source and test files.
  • Extended PHPStan config to include tests and added phpstan annotations in models and behaviors.
  • Refactored TestCase and test classes with stricter method signatures, clearer fixture loading, and updated PHPUnit setup.

Reviewed Changes

Copilot reviewed 15 out of 55 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/support/model/TreeQuery.php Lowercased namespace and added phpstan template annotation.
tests/support/model/Tree.php Lowercased namespace, added strict return types and phpstan tags.
tests/support/model/MultipleTree.php Lowercased namespace, added stricter signatures and phpstan tags.
tests/TestCase.php Improved XML fixture helper, added null checks, fixed setUp/tearDown.
src/NestedSetsQueryBehavior.php Lowercased namespace, replaced generic annotations with phpstan tags.
src/NestedSetsBehavior.php Lowercased namespace, replaced generic annotations with phpstan tags.
phpstan.neon Included tests directory in analysis paths.
composer.json Updated autoload mappings and dependency constraints.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/TestCase.php (1)

40-49: String casting inconsistency in XML attribute handling.

All attributes except 'name' are explicitly cast to string. For consistency, either cast 'name' to string as well or document why it's treated differently.

-            $treeElement?->addAttribute('name', $item['name']);
+            $treeElement?->addAttribute('name', (string) $item['name']);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 595f70f and 7b4b390.

📒 Files selected for processing (1)
  • tests/TestCase.php (6 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/TestCase.php (2)
tests/support/model/MultipleTree.php (2)
  • MultipleTree (18-59)
  • find (55-58)
tests/support/model/Tree.php (2)
  • Tree (17-55)
  • find (51-54)
⏰ Context from checks skipped due to timeout of 90000ms (15)
  • GitHub Check: phpunit / PHP 8.3-ubuntu-latest
  • GitHub Check: easy-coding-standard / PHP 8.4-ubuntu-latest
  • GitHub Check: phpunit-compatibility / PHP 8.2-windows-latest
  • GitHub Check: phpunit-compatibility / PHP 8.1-windows-latest
  • GitHub Check: phpunit-compatibility / PHP 8.3-windows-latest
  • GitHub Check: phpunit-compatibility / PHP 8.4-windows-latest
  • GitHub Check: composer-require-checker / PHP 8.4-ubuntu-latest
  • GitHub Check: phpstan / PHP 8.4-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.3-windows-latest
  • GitHub Check: phpunit / PHP 8.2-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.3-ubuntu-latest
  • GitHub Check: phpunit / PHP 8.4-windows-latest
  • GitHub Check: phpunit / PHP 8.1-ubuntu-latest
  • GitHub Check: phpunit-compatibility / PHP 8.1-ubuntu-latest
  • GitHub Check: phpunit-compatibility / PHP 8.1-windows-latest
🔇 Additional comments (9)
tests/TestCase.php (9)

5-18: LGTM! Namespace and import improvements follow best practices.

The changes to lowercase namespace, grouped imports with curly braces, and explicit function imports improve code organization and follow PHP coding standards.


22-22: Good addition for centralized fixture path management.

The fixture directory property improves maintainability and addresses the path consistency issues mentioned in previous reviews.


29-33: Excellent PHPStan type annotations for better type safety.

The comprehensive type documentation improves code maintainability and enables better static analysis.


54-64: Excellent error handling improvement!

The addition of runtime exceptions addresses the previous feedback about using exceptions instead of assertions, ensuring proper error handling in production environments.


66-75: Clean refactoring of string replacement logic.

The array-based approach for string replacement is more readable and maintainable than sequential calls.


113-133: Great type safety and data consistency improvements.

The comprehensive PHPStan annotations and default tree=0 value ensure better type safety and consistent data structure across different tree types.


144-166: Well-implemented new method with excellent type safety.

The comprehensive PHPStan annotations and use of array_values() for proper re-indexing demonstrate good attention to detail and type safety.


175-177: Good use of fixture directory property and null-safe handling.

Using the centralized fixture directory and safely handling potential null children with empty array fallback improves code reliability.


220-225: Correct PHPUnit lifecycle method implementation.

The proper setUp() method name and moving mockConsoleApplication() here follows PHPUnit best practices and ensures proper test initialization.

@terabytesoftw terabytesoftw merged commit c7733d1 into main Jun 27, 2025
56 of 57 checks passed
@terabytesoftw terabytesoftw deleted the fix-mini-3 branch June 27, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy