original_string: private static function is_allowed_field_set($toolconfig, $instanceconfig, $fields) {
          $isallowedstate = [];
          foreach ($fields as $key => $field) {
              $allowed = self::ALWAYS_INCLUDE_FIELD == $toolconfig->{$field};
              if (!$allowed) {
                  if (self::DELEGATE_TO_INSTRUCTOR == $toolconfig->{$field} && !is_null($instanceconfig)) {
                      $allowed = $instanceconfig->{$field} == self::INSTRUCTOR_INCLUDED;
                  }
              }
              $isallowedstate[$key] = $allowed;
          }
          return $isallowedstate;
      }
code: private static function is_allowed_field_set($toolconfig, $instanceconfig, $fields) {
          $isallowedstate = [];
          foreach ($fields as $key => $field) {
              $allowed = self::ALWAYS_INCLUDE_FIELD == $toolconfig->{$field};
              if (!$allowed) {
                  if (self::DELEGATE_TO_INSTRUCTOR == $toolconfig->{$field} && !is_null($instanceconfig)) {
                      $allowed = $instanceconfig->{$field} == self::INSTRUCTOR_INCLUDED;
                  }
              }
              $isallowedstate[$key] = $allowed;
          }
          return $isallowedstate;
      }
code_tokens: private static function is_allowed_field_set ( $ toolconfig , $ instanceconfig , $ fields ) { $ isallowedstate = [ ] ; foreach ( $ fields as $ key => $ field ) { $ allowed = self :: ALWAYS_INCLUDE_FIELD == $ toolconfig -> { $ field } ; if ( ! $ allowed ) { if ( self :: DELEGATE_TO_INSTRUCTOR == $ toolconfig -> { $ field } && ! is_null ( $ instanceconfig ) ) { $ allowed = $ instanceconfig -> { $ field } == self :: INSTRUCTOR_INCLUDED ; } } $ isallowedstate [ $ key ] = $ allowed ; } return $ isallowedstate ; }
docstring: Determines whether a user attribute may be used as part of LTI membership
  @param object            $toolconfig      Tool config
  @param object            $instanceconfig  Tool instance config
  @param array             $fields          Set of fields to return if allowed or not
  @return array Verification which associates an attribute with a boolean (allowed or not)
docstring_tokens: Determines whether a user attribute may be used as part of LTI membership