Skip to content
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

Use traits for methods that belong to the public API #94

Merged
merged 1 commit into from Jan 12, 2021
Merged

Use traits for methods that belong to the public API #94

merged 1 commit into from Jan 12, 2021

Conversation

TavoNiievez
Copy link
Member

This is the directory structure proposed by this PR:

imagen

Why should we make this change?

  1. Because it increases cohesion and pseudo-reduce coupling, the methods that use a specific service or collector are grouped and it is easy to identify them, to know how many and which there are and which framework classes they use.
  2. Because if it is not done, over time, inevitably the Symfony.php module file will grow so much that it will become colossal, which will make it difficult to navigate and, above all, its maintenance. (It was already on the 1629 lines, hopefully, it will not reach 2077.)
  3. This does not create any BC and can lay the foundation for the module to continue to grow and improve in a healthy way.

Did you randomly make up that structure and those names for the traits?

No, it is based on Symfony's own structure.

This will break git history, stop it!

Luckily, it will not, in this PR the public methods are simply removed from the main file of the modules and moved to their corresponding trait, the git history only records deletions in the main file Symfony.php, and it will always be possible to use git blame locating you in the repository prior to this commit, this is intended to be part of version 2.0 where changes like these are allowed.

Ok, but is there a quick way to review where each method is located?

Of course, here is the class trait diagram:

imagen

Wait, this is the only change for version 2?

No, but it makes the work of the other features much easier, I hope to fix issue #90, add support for codeception 5, remove support for Symfony 3.4 (just like codeception 5 did), and add the functions to assert the orphan events (which were introduced in Symfony 4.1 [they are not documented in symfony far from that PR, but I will document it.]).

@TavoNiievez TavoNiievez added this to the 2.0.0 milestone Jan 8, 2021
@TavoNiievez TavoNiievez merged commit f740f2a into Codeception:master Jan 12, 2021
@TavoNiievez TavoNiievez deleted the 2.0 branch January 12, 2021 23:42
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.

None yet

2 participants