Skip to content

Conversation

@yiiman-dev
Copy link
Contributor

First of all, I would like to thank for creating such a useful and well-structured package. It has been a great foundation to build upon.

Summary

This pull request addresses an issue in the CategoryDiscovery component related to resolving class namespaces when the path to the classes is changed in the project configuration.

Problem

Previously, CategoryDiscovery allowed changing the path to locate the target classes via configuration. However, when the path was changed, the system still attempted to resolve the classes using a static namespace defined internally. Because the physical location of the class files and their declared namespaces no longer matched the static namespace, this caused resolution errors and failures in locating the classes correctly.

What was changed

In this update, instead of relying on a fixed static namespace, the code now opens the moved file and reads the actual namespace declared inside the class file. It then uses this real namespace to register and resolve the class within the system.
This approach ensures that even if the files are moved to a new location with a different namespace, the class resolution works correctly without errors.

Benefits

•	Fixes class resolution errors caused by namespace mismatches after changing class file paths.
•	Makes `CategoryDiscovery` more flexible and robust in handling dynamic project structures.
•	Improves maintainability by relying on the actual namespace declarations rather than hardcoded assumptions.

@DrakkoFire
Copy link
Contributor

Thanks for the kind words and the PR @yiiman-dev !

I'll merge it and tag a new version so you can update it on your project

@DrakkoFire DrakkoFire merged commit 42c7958 into nodilabs:main Jul 16, 2025
1 check passed
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.

2 participants