Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Repository Maintainers
* @launchdarkly/team-sdk
* @launchdarkly/team-sdk-php
5 changes: 1 addition & 4 deletions src/EvaluationContextConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,14 @@ private function buildSingleContext(array $attributes, string $kind, string $key
continue;
}

// Validation for name
if ($k === "name" && is_string($v)) {
$builder->name($v);
} elseif ($k === "name") {
$this->logger->error("The attribute 'name' must be a string");
// Validation for anonymous
} elseif ($k === "anonymous" && is_bool($v)) {
$builder->anonymous($v);
} elseif ($k === "anonymous") {
$this->logger->error("The attribute 'anonymous' must be a boolean");
// Validation for privateAttributes
} elseif ($k === "privateAttributes" && is_array($v)) {
$privateAttributes = array_values($v);
foreach ($privateAttributes as $privateAttribute) {
Expand All @@ -158,8 +155,8 @@ private function buildSingleContext(array $attributes, string $kind, string $key
}
} elseif ($k === "privateAttributes") {
$this->logger->error("'privateAttributes' in an evaluation context must be an array");
// Catch all for remaining attributes
} else {
// Catch all for remaining attributes
$builder->set($k, $v);
}
}
Expand Down