original_string: public static function get_lock_summaries() {
          $locks = array();
          $instance = cache_config::instance();
          $stores = $instance->get_all_stores();
          foreach ($instance->get_locks() as $lock) {
              $default = !empty($lock['default']);
              if ($default) {
                  $name = new lang_string($lock['name'], 'cache');
              } else {
                  $name = $lock['name'];
              }
              $uses = 0;
              foreach ($stores as $store) {
                  if (!empty($store['lock']) && $store['lock'] === $lock['name']) {
                      $uses++;
                  }
              }
              $lockdata = array(
                  'name' => $name,
                  'default' => $default,
                  'uses' => $uses,
                  'type' => get_string('pluginname', $lock['type'])
              );
              $locks[$lock['name']] = $lockdata;
          }
          return $locks;
      }
code: public static function get_lock_summaries() {
          $locks = array();
          $instance = cache_config::instance();
          $stores = $instance->get_all_stores();
          foreach ($instance->get_locks() as $lock) {
              $default = !empty($lock['default']);
              if ($default) {
                  $name = new lang_string($lock['name'], 'cache');
              } else {
                  $name = $lock['name'];
              }
              $uses = 0;
              foreach ($stores as $store) {
                  if (!empty($store['lock']) && $store['lock'] === $lock['name']) {
                      $uses++;
                  }
              }
              $lockdata = array(
                  'name' => $name,
                  'default' => $default,
                  'uses' => $uses,
                  'type' => get_string('pluginname', $lock['type'])
              );
              $locks[$lock['name']] = $lockdata;
          }
          return $locks;
      }
code_tokens: public static function get_lock_summaries ( ) { $ locks = array ( ) ; $ instance = cache_config :: instance ( ) ; $ stores = $ instance -> get_all_stores ( ) ; foreach ( $ instance -> get_locks ( ) as $ lock ) { $ default = ! empty ( $ lock [ 'default' ] ) ; if ( $ default ) { $ name = new lang_string ( $ lock [ 'name' ] , 'cache' ) ; } else { $ name = $ lock [ 'name' ] ; } $ uses = 0 ; foreach ( $ stores as $ store ) { if ( ! empty ( $ store [ 'lock' ] ) && $ store [ 'lock' ] === $ lock [ 'name' ] ) { $ uses ++ ; } } $ lockdata = array ( 'name' => $ name , 'default' => $ default , 'uses' => $ uses , 'type' => get_string ( 'pluginname' , $ lock [ 'type' ] ) ) ; $ locks [ $ lock [ 'name' ] ] = $ lockdata ; } return $ locks ; }
docstring: Returns an array summarising the locks available in the system
docstring_tokens: Returns an array summarising the locks available in the system