Skip to content

Commit

Permalink
moved property match check to version method
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetty committed Jan 17, 2019
1 parent deeb431 commit 5f2717b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Agent.php
Expand Up @@ -320,6 +320,10 @@ public function version($propertyName, $type = self::VERSION_TYPE_STRING)
$properties[$propertyName] = (array) $properties[$propertyName];

foreach ($properties[$propertyName] as $propertyMatchString) {
if (is_array($propertyMatchString)) {
$propertyMatchString = implode("|", $propertyMatchString);
}

$propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString);

// Identify and extract the version.
Expand Down Expand Up @@ -347,10 +351,6 @@ protected static function mergeRules(...$all)

foreach ($all as $rules) {
foreach ($rules as $key => $value) {
if (is_array($value)) {
$value = implode('|', $value);
}

if (empty($merged[$key])) {
$merged[$key] = $value;
} elseif (is_array($merged[$key])) {
Expand Down

0 comments on commit 5f2717b

Please sign in to comment.