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

patched metric-diff #81

Merged
merged 2 commits into from
Oct 24, 2024
Merged

patched metric-diff #81

merged 2 commits into from
Oct 24, 2024

Conversation

bezhanSalleh
Copy link
Owner

This pull request includes several changes to improve type safety, refactor methods, and enhance data retrieval ordering in the FilamentGoogleAnalytics class and related traits.

Type Safety and Refactoring:

Data Retrieval and Ordering:

Session Data Handling:

  • src/Traits/Sessions.php: Refactored the sessionsToday method to use a match expression for better handling of different scenarios.
  • src/Traits/SessionsDuration.php: Refactored the sessionDurationToday method to use a match expression for better handling of different scenarios.

@bezhanSalleh bezhanSalleh merged commit d076058 into 1.x Oct 24, 2024
1 check passed
@bezhanSalleh bezhanSalleh deleted the patch/metric-diff branch October 24, 2024 00:39
Copy link

what-the-diff bot commented Oct 24, 2024

PR Summary

  • Updated Property Type for $previous in FilamentGoogleAnalytics
    The code has been adjusted so that this property now has a more versatile type, allowing it to represent whole numbers or floating point values rather than just textual data, and setting its default value to 0.

  • Adjusted the Constructor and Method Signatures
    They now accept and produce whole numbers or floating point values, which offers greater flexibility compared to working with just textual data.

  • Rewrote compute Method in FilamentGoogleAnalytics
    The logic of this method is now simpler and more understandable thanks to the use of a feature called "match expressions" to handle different scenarios.

  • Improved trajectoryDescription Method in FilamentGoogleAnalytics
    String concatenation in this method has been improved to make it clearer and better structured.

  • Introduced Use of OrderBy in MetricDiff Trait
    This inclusion allows the analytics results to be sorted based on their dimensions, improving data organization and potentially making analysis easier.

  • Optimized sessionsToday Method in Sessions Trait
    This method now employs "match expressions" for different result conditions, simplifying its logic and making the code cleaner to read and understand.

  • Fine-Tuned Return Values in sessionDurationToday Method in SessionsDuration Trait
    Edge cases are now handled more efficiently in this method using "match expressions" to cover all unexpected scenarios, boosting the robustness of the system.

  • Refined Order of Assigning previous and result in Certain Methods
    The assignment sequence in the sessionsYesterday and sessionDurationYesterday methods is adjusted to align better with the newly introduced logic, making the overall workflow more consistent.

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.

1 participant