Skip to content

Commit

Permalink
Optim : Loop can be replace with 'in_array()'
Browse files Browse the repository at this point in the history
  • Loading branch information
s-renier-taonix-fr authored and f3l1x committed Feb 13, 2023
1 parent eedc2a5 commit 5aff87a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/nusoap.php
Original file line number Diff line number Diff line change
Expand Up @@ -5405,11 +5405,10 @@ function getOperationData($operation, $bindingType = 'soap')
if ($portData['bindingType'] == $bindingType) {
// get binding
//foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) {
// note that we could/should also check the namespace here
if ($operation == $bOperation) {
return $this->bindings[$portData['binding']]['operations'][$operation];
}
// note that we could/should also check the namespace here
if (in_array ($operation, array_keys ($this->bindings[$portData['binding']]['operations'])))
{
return $this->bindings[$portData['binding']]['operations'][$operation];
}
}
}
Expand Down

0 comments on commit 5aff87a

Please sign in to comment.