From 8cd015673cfa8cb0f3524cbb2093b80ef1f5a813 Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Thu, 15 Aug 2019 11:58:55 -0400 Subject: [PATCH] Avoid creating lots of unnecessary objects in getProject() --- src/PlatformClient.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/PlatformClient.php b/src/PlatformClient.php index 94dac42..fcd4e73 100644 --- a/src/PlatformClient.php +++ b/src/PlatformClient.php @@ -54,9 +54,9 @@ public function getConnector() public function getProject($id, $hostname = null, $https = true) { // Search for a project in the user's project list. - foreach ($this->getProjects() as $project) { - if ($project->id === $id) { - return $project; + foreach ($this->getAccountInfo()['projects'] as $project) { + if ($project['id'] === $id) { + return new Project($project, $project['endpoint'], $this->connector->getClient()); } }