@@ -662,9 +662,7 @@ private function matchesVendorFilter($filters, BasicProjectInfo $project)
662662 */
663663 public function getMyProjects ($ refresh = null )
664664 {
665- $ new = $ this ->config ->get ('api.centralized_permissions ' ) && $ this ->config ->get ('api.organizations ' );
666- $ vendorFilter = $ this ->config ->getWithDefault ('api.vendor_filter ' , null );
667- $ cacheKey = sprintf ('%s:my-projects%s:%s ' , $ this ->config ->getSessionId (), $ new ? ':new ' : '' , is_array ($ vendorFilter ) ? implode (', ' , $ vendorFilter ) : (string ) $ vendorFilter );
665+ $ cacheKey = $ this ->myProjectsCacheKey ();
668666 $ cached = $ this ->cache ->fetch ($ cacheKey );
669667
670668 if ($ refresh === false && !$ cached ) {
@@ -1010,12 +1008,23 @@ public function clearEnvironmentsCache($projectId)
10101008 }
10111009
10121010 /**
1013- * Clear the projects cache.
1011+ * Calculates a cache key for the projects list.
1012+ *
1013+ * @return string
1014+ */
1015+ private function myProjectsCacheKey ()
1016+ {
1017+ $ new = $ this ->config ->get ('api.centralized_permissions ' ) && $ this ->config ->get ('api.organizations ' );
1018+ $ vendorFilter = $ this ->config ->getWithDefault ('api.vendor_filter ' , null );
1019+ return sprintf ('%s:my-projects%s:%s ' , $ this ->config ->getSessionId (), $ new ? ':new ' : '' , is_array ($ vendorFilter ) ? implode (', ' , $ vendorFilter ) : (string ) $ vendorFilter );
1020+ }
1021+
1022+ /**
1023+ * Clears the projects cache.
10141024 */
10151025 public function clearProjectsCache ()
10161026 {
1017- $ this ->cache ->delete (sprintf ('%s:project-stubs ' , $ this ->config ->getSessionId ()));
1018- $ this ->cache ->delete (sprintf ('%s:my-account ' , $ this ->config ->getSessionId ()));
1027+ $ this ->cache ->delete ($ this ->myProjectsCacheKey ());
10191028 }
10201029
10211030 /**
0 commit comments