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

feat: add support for user custom attributes #46

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

antonioturdo
Copy link
Collaborator

@antonioturdo antonioturdo commented Jul 30, 2023

🚨 Proposed changes

Add methods in the UserAttributes class to set custom attributes without using dynamic properties.

Close #42

⚙️ Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • New feature (non-breaking change which adds functionality)
  • Bugfix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Refactor

@codecov
Copy link

codecov bot commented Jul 30, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (228be73) 99.55% compared to head (de0b663) 99.56%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main      #46   +/-   ##
=========================================
  Coverage     99.55%   99.56%           
- Complexity      478      481    +3     
=========================================
  Files           135      135           
  Lines           908      913    +5     
=========================================
+ Hits            904      909    +5     
  Misses            4        4           
Files Changed Coverage Δ
src/Object/UserAttributes.php 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@antonioturdo antonioturdo force-pushed the feat/custom-attributes branch 3 times, most recently from 2908d55 to d974402 Compare July 30, 2023 14:17
@@ -67,6 +67,8 @@ class UserAttributes extends BaseObject

public ?string $twitter = null;

private array $_customAttributes = [];
Copy link
Member

Choose a reason for hiding this comment

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

I dislike using "$_*" to figure out that the variable is private.
my2cent

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used this notation to distinguish it from the real properties of the UserAttributes object expected by Braze. However, being a private detail, we can choose to rename it in the future as well.

Copy link
Member

@JellyBellyDev JellyBellyDev left a comment

Choose a reason for hiding this comment

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

AWESOME! LGTM! 👍

@antonioturdo antonioturdo merged commit d10c351 into main Aug 3, 2023
6 checks passed
@JellyBellyDev JellyBellyDev deleted the feat/custom-attributes branch August 3, 2023 15:32
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.

Dynamin properties in UserAttributes
2 participants