@param string $generatedState
@param string $passedState
@param string $passedCode

@throws UnexpectedValueException

@return array
486835
public function getResourceOwner($generatedState, $passedState, $passedCode)
    {
        if ($generatedState != $passedState) {
            throw new UnexpectedValueException("Generated and passed states must be same: $generatedState != $passedState");
        }

        $accessToken = $this->provider->getAccessToken('authorization_code', ['code' => $passedCode]);
        $resourceOwner = $this->provider->getResourceOwner($accessToken);

        return $resourceOwner->toArray();
    }
1103646
public function getAccessCredentials($code, $state = null)
    {
        return $this->post('oauth2/token', [
            'client_id' => $this->getClientId(),
            'client_secret' => $this->getClientSecret(),
            'grant_type' => 'authorization_code',
            'redirect_uri' => $this->getRedirectUri(),
            'code' => $code,
            'state' => $state,
        ]);
    }
191517
@Override
    public void sawOpcode(int seen) {
        // System.out.println(getPC() + " " + Const.getOpcodeName(seen) + " " + state);

        if (stack.getStackDepth() < stackDepth) {
            state = FormatState.NONE;
            stackDepth = 0;
            arguments = null;
        }
        if (seen == Const.ANEWARRAY && stack.getStackDepth() >= 2) {
            Object size = stack.getStackItem(0).getConstant();
            Object formatStr = stack.getStackItem(1).getConstant();
            if (size instanceof Integer && formatStr instanceof String) {
                arguments = new OpcodeStack.Item[(Integer) size];
                this.formatString = (String) formatStr;
                state = FormatState.READY_FOR_FORMAT;
                stackDepth = stack.getStackDepth();
            }
        } else if (state == FormatState.READY_FOR_FORMAT && seen == Const.DUP) {
            state = FormatState.EXPECTING_ASSIGNMENT;
        } else if (state == FormatState.EXPECTING_ASSIGNMENT && stack.getStackDepth() == stackDepth + 3 && seen == Const.AASTORE) {
            Object pos = stack.getStackItem(1).getConstant();
            OpcodeStack.Item value = stack.getStackItem(0);
            if (pos instanceof Integer) {
                int index = (Integer) pos;
                if (index >= 0 && index < arguments.length) {
                    arguments[index] = value;
                    state = FormatState.READY_FOR_FORMAT;
                } else {
                    state = FormatState.NONE;
                }
            } else {
                state = FormatState.NONE;
            }
        } else if (state == FormatState.READY_FOR_FORMAT
                && (seen == Const.INVOKESPECIAL || seen == Const.INVOKEVIRTUAL || seen == Const.INVOKESTATIC || seen == Const.INVOKEINTERFACE)
                && stack.getStackDepth() == stackDepth) {

            String cl = getClassConstantOperand();
            String nm = getNameConstantOperand();
            String sig = getSigConstantOperand();
            XMethod m = getXMethodOperand();
            if ((m == null || m.isVarArgs())
                    && sig.indexOf("Ljava/lang/String;[Ljava/lang/Object;)") >= 0
                    && ("java/util/Formatter".equals(cl) && "format".equals(nm) || "java/lang/String".equals(cl)
                            && "format".equals(nm) || "java/io/PrintStream".equals(cl) && "format".equals(nm)
                            || "java/io/PrintStream".equals(cl) && "printf".equals(nm) || cl.endsWith("Writer")
                            && "format".equals(nm) || cl.endsWith("Writer") && "printf".equals(nm)) || cl.endsWith("Logger")
                            && nm.endsWith("fmt")) {

                if (formatString.indexOf('\n') >= 0) {
                    bugReporter.reportBug(new BugInstance(this, "VA_FORMAT_STRING_USES_NEWLINE", NORMAL_PRIORITY)
                    .addClassAndMethod(this).addCalledMethod(this).addString(formatString)
                    .describe(StringAnnotation.FORMAT_STRING_ROLE).addSourceLine(this));
                }
            }

        }
    }
648552
public function getArguments(Request $request, array $controller, array $matched)
    {
        $reflection = new \ReflectionMethod($controller[0], $controller[1]);
        $attributes = $request->attributes->all();
        $arguments  = [];

        foreach ($reflection->getParameters() as $param) {
            if (array_key_exists($param->name, $matched)) {
                $arguments[] = $matched[$param->name];
            } elseif (array_key_exists($param->name, $attributes)) {
                $arguments[] = $attributes[$param->name];
            } elseif ($param->isDefaultValueAvailable()) {
                $arguments[] = $param->getDefaultValue();
            } else {
                $controller = sprintf('%s::%s()', get_class($controller[0]), $controller[1]);
                throw new \RuntimeException(sprintf('Controller "%s" requires that you provide a value for the "$%s" argument (either because there is no default value, or because there is a non-optional argument after this one).', $controller, $param->name));
            }
        }

        return $arguments;
    }
846535
public function getAction(string $code): Action
    {
        if (!$this->hasAction($code)) {
            throw new \UnexpectedValueException("No action with code: '{$code}' for admin '{$this->getCode()}'");
        }

        return $this->actions[$code];
    }
258684
@Override
  public GeneratedCode generate(ClassTemplateSpec templateSpec) {

    String code;
    SwiftProperties swiftProperties = globalConfig.lookupSwiftProperties(templateSpec);
    if (swiftProperties.omit) return null;

    SwiftSyntax syntax = new SwiftSyntax(templateSpec, swiftProperties, globalConfig);
    SwiftyJSON swifty = new SwiftyJSON(syntax);

    try {
      if (templateSpec instanceof RecordTemplateSpec) {
        code = engine.render("rythm-swift/record.txt", templateSpec, syntax, swifty);
      } else if (templateSpec instanceof EnumTemplateSpec) {
        code = engine.render("rythm-swift/enum.txt", templateSpec);
      } else if (templateSpec instanceof UnionTemplateSpec) {
        code = engine.render("rythm-swift/union.txt", templateSpec, syntax, swifty);
      } else {
        return null; // Indicates that we are declining to generate code for the type (e.g. map or array)
      }
    } catch (RythmException e) {
      throw new RuntimeException(
        "Internal error in generator while processing " + templateSpec.getFullName(), e);
    }
    SwiftCompilationUnit compilationUnit =
        new SwiftCompilationUnit(
            templateSpec.getClassName(), "");
    code = formatter.format(code);
    return new GeneratedCode(compilationUnit, code);
  }
1274537
public function process(&$state) {
		assert('is_array($state)');
		assert('array_key_exists("Attributes", $state)');

		$state['Attributes']['eduPersonTargetedID'] = array();
		foreach ($this->confValues as $name => $parameters) {
			$dataRetrieved= array();

			// get the identifier of the authenticated user (mandatory)
			$data= (empty($parameters['userID']))?
				'':
				self::getValue ($state, (array) $parameters['userID'], 'eduPersonTargetedId: not user id found');
			// check that user is not filtered out for this value of the attribute
			if (!empty($parameters['ifUser']) && !self::someMatch($data, (array) $parameters['ifUser'])) {
				SimpleSAML_Logger::debug('eduPersonTargetedId, ' . $name . ' skipped: userID = ' . $data);
				continue;
			}
			$dataRetrieved['userID']= $data;

			// get the identifier of the destination (optional)
			$data= (empty($parameters['targetID']))?
				'':
				self::getValue ($state, (array) $parameters['targetID'], NULL);
			// transform, if needed, the identifier
			if (is_array($parameters['targetTransform'])) {
				foreach($parameters['targetTransform'] as $pattern => $replacement)
					$data= preg_replace($pattern, $replacement, $data);
			}
			// check that destination is not filtered out for this value of the attribute
			if (!empty($parameters['ifTarget']) && !self::someMatch($data, (array) $parameters['ifTarget'])) {
				SimpleSAML_Logger::debug('eduPersonTargetedId, ' . $name . ' skipped: targetID = ' . $data);
				continue;
			}
			$dataRetrieved['targetID']= $data;

			// get the identifier of the source (optional)
			$data= (empty($parameters['sourceID']))?
				'':
				self::getValue ($state, (array) $parameters['sourceID'], NULL);
			$dataRetrieved['sourceID']= $data;

			// get a salt for obfuscating the hash
			$data= (empty($parameters['salt']))?
				'':
				$parameters['salt'];
			$dataRetrieved['salt']= $data;

			// generate the value applying the hash function
			$dataRaw= array();
			foreach((array) $parameters['fields'] as $field) {
				$data= $dataRetrieved[$field];
				if (!empty($data))
					$dataRaw[]= $data;
			}
			$dataRaw= implode($parameters['fieldSeparator'], $dataRaw);
			$eduPersonTargetedId= hash($parameters['hashFunction'], $dataRaw);

			// set a prefix, if needed
			if (!empty($parameters['prefix']))
				$eduPersonTargetedId= $parameters['prefix'] . $eduPersonTargetedId;

			// log
			SimpleSAML_Logger::debug('eduPersonTargetedId, ' . $name . ' function: ' . $parameters['hashFunction'] . '(' . $dataRaw . ')');
			SimpleSAML_Logger::debug('eduPersonTargetedId, ' . $name . ' value: ' . $eduPersonTargetedId);

			// Convert to a name identifier element
			if ($parameters['nameId'])
				$eduPersonTargetedId= self::toNameId($eduPersonTargetedId, $dataRetrieved['sourceID'], $dataRetrieved['targetID']);

			// add the attribute
			$state['Attributes']['eduPersonTargetedID'][]= $eduPersonTargetedId;
		}
	}
372479
function overwriteValueWithCode($code)
    {
        $this->replacedState = self::VALUE_REPLACED;
        $this->phpVariable = null;
        $this->setPHPCode($code);
    }
286775
@Override
    public void sawOpcode(int seen) {
        Integer userValue = null;
        try {
            stack.precomputation(this);

            switch (seen) {
                case Const.NEWARRAY:
                case Const.ANEWARRAY: {
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item itm = stack.getStackItem(0);
                        Integer size = (Integer) itm.getConstant();
                        if ((size != null) && (size.intValue() == 1)) {
                            userValue = Values.NEGATIVE_ONE;
                        }
                    }
                }
                break;

                case Const.IASTORE:
                case Const.LASTORE:
                case Const.FASTORE:
                case Const.DASTORE:
                case Const.AASTORE:
                case Const.BASTORE:
                case Const.CASTORE:
                case Const.SASTORE: {
                    userValue = processArrayElementStore();
                }
                break;

                case Const.ASTORE:
                case Const.ASTORE_0:
                case Const.ASTORE_1:
                case Const.ASTORE_2:
                case Const.ASTORE_3: {
                    processLocalStore(seen);
                }
                break;

                case Const.INVOKEVIRTUAL:
                case Const.INVOKEINTERFACE:
                case Const.INVOKESPECIAL:
                case Const.INVOKESTATIC: {
                    processMethodCall();
                }
                break;

                case Const.IALOAD:
                case Const.LALOAD:
                case Const.FALOAD:
                case Const.DALOAD:
                case Const.AALOAD:
                case Const.BALOAD:
                case Const.CALOAD:
                case Const.SALOAD: {
                    if (stack.getStackDepth() >= 2) {
                        OpcodeStack.Item arItm = stack.getStackItem(1);
                        int arReg = arItm.getRegisterNumber();
                        WrapperInfo wi = wrappers.get(Integer.valueOf(arReg));
                        if ((wi != null) && wi.wasArg) {
                            userValue = Integer.valueOf(wi.wrappedReg);
                        }
                    }
                }
                break;

                case Const.ALOAD:
                case Const.ALOAD_0:
                case Const.ALOAD_1:
                case Const.ALOAD_2:
                case Const.ALOAD_3: {
                    int reg = RegisterUtils.getALoadReg(this, seen);
                    WrapperInfo wi = wrappers.get(Integer.valueOf(reg));
                    if (wi != null) {
                        userValue = Integer.valueOf(wi.wrappedReg);
                    }
                }
                break;

                case Const.ISTORE:
                case Const.ISTORE_0:
                case Const.ISTORE_1:
                case Const.ISTORE_2:
                case Const.ISTORE_3:
                case Const.LSTORE:
                case Const.LSTORE_0:
                case Const.LSTORE_1:
                case Const.LSTORE_2:
                case Const.LSTORE_3:
                case Const.DSTORE:
                case Const.DSTORE_0:
                case Const.DSTORE_1:
                case Const.DSTORE_2:
                case Const.DSTORE_3:
                case Const.FSTORE:
                case Const.FSTORE_0:
                case Const.FSTORE_1:
                case Const.FSTORE_2:
                case Const.FSTORE_3: {
                    if (stack.getStackDepth() == 0) {
                        break;
                    }
                    OpcodeStack.Item itm = stack.getStackItem(0);
                    Integer elReg = (Integer) itm.getUserValue();
                    if (elReg == null) {
                        break;
                    }
                    int reg = RegisterUtils.getStoreReg(this, seen);
                    if (elReg.intValue() == reg) {
                        bugReporter.reportBug(new BugInstance(this, BugType.AWCBR_ARRAY_WRAPPED_CALL_BY_REFERENCE.name(), NORMAL_PRIORITY).addClass(this)
                                .addMethod(this).addSourceLine(this));
                    }
                }
                break;

                default:
                break;
            }
        } finally {
            TernaryPatcher.pre(stack, seen);
            stack.sawOpcode(this, seen);
            TernaryPatcher.post(stack, seen);
            if ((userValue != null) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item itm = stack.getStackItem(0);
                itm.setUserValue(userValue);
            }
        }
    }
155182
public function getCodeFields($state = null)
    {
        $fields = [
            'client_id' => $this->clientId,
            'redirect_uri' => $this->redirectUrl,
            'view' => $this->view,
            'response_type' => 'code',
        ];

        if ($this->usesState()) {
            $fields['state'] = $state;
        }

        return $fields;
    }
632912
@Override
    public void sawOpcode(int seen) {
        switch (state) {
            case SAW_NOTHING:
                if (OpcodeUtils.isALoad(seen)) {
                    register1_1 = RegisterUtils.getALoadReg(this, seen);
                    state = State.SAW_LOAD1_1;
                }
            break;

            case SAW_LOAD1_1:
                if (OpcodeUtils.isALoad(seen)) {
                    register1_2 = RegisterUtils.getALoadReg(this, seen);
                }

                if (register1_2 > -1) {
                    state = State.SAW_LOAD1_2;
                } else {
                    state = State.SAW_NOTHING;
                }
            break;

            case SAW_LOAD1_2:
                if (seen == Const.INVOKEVIRTUAL) {
                    String cls = getDottedClassConstantOperand();
                    if (dateClasses.contains(cls)) {
                        String methodName = getNameConstantOperand();
                        if ("equals".equals(methodName) || "after".equals(methodName) || "before".equals(methodName)) {
                            state = State.SAW_CMP1;
                        }
                    }
                }
                if (state != State.SAW_CMP1) {
                    state = State.SAW_NOTHING;
                }
            break;

            case SAW_CMP1:
                if (seen == Const.IFNE) {
                    state = State.SAW_IFNE;
                } else {
                    state = State.SAW_NOTHING;
                }
            break;

            case SAW_IFNE:
                if (OpcodeUtils.isALoad(seen)) {
                    register2_1 = RegisterUtils.getALoadReg(this, seen);
                }

                if (register2_1 > -1) {
                    state = State.SAW_LOAD2_1;
                } else {
                    state = State.SAW_NOTHING;
                }
            break;

            case SAW_LOAD2_1:
                if (OpcodeUtils.isALoad(seen)) {
                    register2_2 = RegisterUtils.getALoadReg(this, seen);
                }

                if ((register2_2 > -1)
                        && (((register1_1 == register2_1) && (register1_2 == register2_2)) || ((register1_1 == register2_2) && (register1_2 == register2_1)))) {
                    state = State.SAW_LOAD2_2;
                } else {
                    state = State.SAW_NOTHING;
                }
            break;

            case SAW_LOAD2_2:
                if (seen == Const.INVOKEVIRTUAL) {
                    String cls = getDottedClassConstantOperand();
                    if (dateClasses.contains(cls)) {
                        String methodName = getNameConstantOperand();
                        if ("equals".equals(methodName) || "after".equals(methodName) || "before".equals(methodName)) {
                            state = State.SAW_CMP2;
                        }
                    }
                }
                if (state != State.SAW_CMP2) {
                    state = State.SAW_NOTHING;
                }
            break;

            case SAW_CMP2:
                if (seen == Const.IFEQ) {
                    bugReporter.reportBug(new BugInstance("DDC_DOUBLE_DATE_COMPARISON", NORMAL_PRIORITY).addClassAndMethod(this).addSourceLine(this));
                }
                state = State.SAW_NOTHING;
            break;

            default:
            break;
        }
    }
1165918
@Override
    public void sawOpcode(int seen) {
        boolean srcField = false;
        try {
            stack.precomputation(this);

            switch (seen) {
                case Const.ALOAD_0:
                    srcField = true;
                break;

                case Const.DUP:
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item item = stack.getStackItem(0);
                        if (item.getUserValue() != null) {
                            srcField = true;
                        }
                    }
                break;

                case Const.GETFIELD:
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item item = stack.getStackItem(0);
                        if (item.getRegisterNumber() == 0) {
                            srcField = true;
                        }
                    }
                break;

                case Const.PUTFIELD:
                    if (stack.getStackDepth() >= 2) {
                        OpcodeStack.Item item = stack.getStackItem(1);
                        if ((item.getRegisterNumber() == 0) || (item.getUserValue() != null)) {
                            bugReporter.reportBug(new BugInstance(this, BugType.SCA_SUSPICIOUS_CLONE_ALGORITHM.name(), NORMAL_PRIORITY).addClass(this)
                                    .addMethod(this).addSourceLine(this));
                        }
                    }

                break;

                case Const.INVOKEINTERFACE:
                case Const.INVOKEVIRTUAL:
                    String sig = getSigConstantOperand();
                    int numArgs = SignatureUtils.getNumParameters(sig);
                    if (stack.getStackDepth() > numArgs) {
                        OpcodeStack.Item item = stack.getStackItem(numArgs);
                        if ((item.getRegisterNumber() == 0) || (item.getUserValue() != null)) {
                            String name = getNameConstantOperand();
                            Integer priority = changingMethods.get(name);
                            if (priority != null) {
                                bugReporter.reportBug(new BugInstance(this, BugType.SCA_SUSPICIOUS_CLONE_ALGORITHM.name(), priority.intValue()).addClass(this)
                                        .addMethod(this).addSourceLine(this));
                            }
                        }
                    }
                break;

                default:
                break;
            }
        } finally {
            TernaryPatcher.pre(stack, seen);
            stack.sawOpcode(this, seen);
            TernaryPatcher.post(stack, seen);
            if (srcField && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item item = stack.getStackItem(0);
                item.setUserValue(Boolean.TRUE);
            }
        }
    }
1108202
@Override
    public void sawOpcode(int seen) {
        Integer userValue = null;

        if ((conditionalTarget != -1) && (getPC() >= conditionalTarget)) {
            conditionalTarget = -1;
            sawMethodWeight = 0;
        }

        try {
            switch (seen) {
                case Const.INVOKESPECIAL:
                case Const.INVOKESTATIC:
                case Const.INVOKEINTERFACE:
                case Const.INVOKEVIRTUAL:
                    String signature = getSigConstantOperand();
                    if (Values.SIG_VOID.equals(SignatureUtils.getReturnSignature(signature))) {
                        sawMethodWeight = 0;
                        return;
                    }

                    String clsName = getClassConstantOperand();
                    MethodInfo mi = Statistics.getStatistics().getMethodStatistics(clsName, getNameConstantOperand(), signature);
                    if ((mi == null) || (mi.getNumBytes() == 0)) {
                        userValue = Values.ONE;
                    } else {
                        userValue = Integer.valueOf(mi.getNumBytes());
                    }
                break;

                case Const.LCMP:
                case Const.FCMPL:
                case Const.FCMPG:
                case Const.DCMPL:
                case Const.DCMPG:
                case Const.IAND:
                case Const.IOR:
                case Const.IXOR:
                    if (stack.getStackDepth() >= 2) {
                        for (int i = 0; i <= 1; i++) {
                            OpcodeStack.Item itm = stack.getStackItem(i);
                            userValue = (Integer) itm.getUserValue();
                            if (userValue != null) {
                                break;
                            }
                        }
                    } else {
                        sawMethodWeight = 0;
                    }
                break;

                case Const.IF_ICMPEQ:
                case Const.IF_ICMPNE:
                case Const.IF_ICMPLT:
                case Const.IF_ICMPGE:
                case Const.IF_ICMPGT:
                case Const.IF_ICMPLE:
                case Const.IF_ACMPEQ:
                case Const.IF_ACMPNE:
                    if (conditionalTarget < 0) {
                        conditionalTarget = getBranchTarget();
                    } else if (conditionalTarget != getBranchTarget()) {
                        conditionalTarget = -1;
                        sawMethodWeight = 0;
                        return;
                    }

                    if (stack.getStackDepth() >= 2) {
                        int expWeight = 0;
                        for (int i = 0; i <= 1; i++) {
                            OpcodeStack.Item itm = stack.getStackItem(i);

                            Integer uv = (Integer) itm.getUserValue();
                            if (uv != null) {
                                expWeight = Math.max(uv.intValue(), expWeight);
                            }
                        }

                        if ((expWeight == 0) && (sawMethodWeight > 0)) {
                            bugReporter.reportBug(new BugInstance(this, BugType.SEO_SUBOPTIMAL_EXPRESSION_ORDER.name(),
                                    sawMethodWeight >= NORMAL_WEIGHT_LIMIT ? NORMAL_PRIORITY : LOW_PRIORITY).addClass(this).addMethod(this)
                                            .addSourceLine(this));
                            sawMethodWeight = 0;
                            conditionalTarget = Integer.MAX_VALUE;
                        } else {
                            sawMethodWeight = Math.max(sawMethodWeight, expWeight);
                        }
                    }
                break;

                case Const.IFEQ:
                case Const.IFNE:
                case Const.IFLT:
                case Const.IFGE:
                case Const.IFGT:
                case Const.IFLE:
                case Const.IFNULL:
                case Const.IFNONNULL:
                    if (conditionalTarget < 0) {
                        conditionalTarget = getBranchTarget();
                    } else if (conditionalTarget != getBranchTarget()) {
                        conditionalTarget = -1;
                        sawMethodWeight = 0;
                        return;
                    }

                    if (stack.getStackDepth() >= 1) {
                        OpcodeStack.Item itm = stack.getStackItem(0);

                        Integer uv = (Integer) itm.getUserValue();
                        if (uv == null) {
                            if (sawMethodWeight > 0) {
                                bugReporter.reportBug(new BugInstance(this, BugType.SEO_SUBOPTIMAL_EXPRESSION_ORDER.name(),
                                        sawMethodWeight >= NORMAL_WEIGHT_LIMIT ? NORMAL_PRIORITY : LOW_PRIORITY).addClass(this).addMethod(this)
                                                .addSourceLine(this));
                                sawMethodWeight = 0;
                                conditionalTarget = Integer.MAX_VALUE;
                            }
                        } else {
                            sawMethodWeight = Math.max(sawMethodWeight, uv.intValue());
                        }
                    }
                break;

                case Const.ISTORE:
                case Const.LSTORE:
                case Const.FSTORE:
                case Const.DSTORE:
                case Const.ASTORE:
                case Const.ISTORE_0:
                case Const.ISTORE_1:
                case Const.ISTORE_2:
                case Const.ISTORE_3:
                case Const.LSTORE_0:
                case Const.LSTORE_1:
                case Const.LSTORE_2:
                case Const.LSTORE_3:
                case Const.FSTORE_0:
                case Const.FSTORE_1:
                case Const.FSTORE_2:
                case Const.FSTORE_3:
                case Const.DSTORE_0:
                case Const.DSTORE_1:
                case Const.DSTORE_2:
                case Const.DSTORE_3:
                case Const.ASTORE_0:
                case Const.ASTORE_1:
                case Const.ASTORE_2:
                case Const.ASTORE_3:
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item itm = stack.getStackItem(0);
                        itm.setUserValue(null);
                    }
                    sawMethodWeight = 0;
                    conditionalTarget = -1;
                break;

                case Const.ATHROW:
                case Const.POP:
                case Const.POP2:
                case Const.GOTO:
                case Const.GOTO_W:
                case Const.PUTFIELD:
                case Const.PUTSTATIC:
                case Const.IINC:
                case Const.INSTANCEOF:
                case Const.RETURN:
                case Const.ARETURN:
                case Const.IRETURN:
                case Const.LRETURN:
                case Const.FRETURN:
                case Const.DRETURN:
                    sawMethodWeight = 0;
                    conditionalTarget = -1;
                break;

                case Const.ARRAYLENGTH:
                case Const.CHECKCAST:
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item itm = stack.getStackItem(0);
                        userValue = (Integer) itm.getUserValue();
                    }
                break;

                case Const.GETFIELD:
                    if (stack.getStackDepth() > 0) {
                        OpcodeStack.Item itm = stack.getStackItem(0);
                        if (itm.getReturnValueOf() != null) {
                            sawMethodWeight = 0;
                            conditionalTarget = -1;
                        }
                    }
                break;
            }
        } finally {
            stack.sawOpcode(this, seen);
            if ((userValue != null) && (stack.getStackDepth() > 0)) {
                OpcodeStack.Item itm = stack.getStackItem(0);
                itm.setUserValue(userValue);
            }
        }
    }
244737
private function getParameters(ControllerReadyEvent $event) : array
    {
        $controller = $event->getRouteMatch()->getControllerReflection();

        $currentParameters = $event->getParameters();
        $newParameters = [];

        foreach ($controller->getParameters() as $parameter) {
            $name = $parameter->getName();

            if (isset($currentParameters[$name])) {
                $newParameters[$name] = $this->getParameterValue($parameter, $currentParameters[$name]);
            }
        }

        return $newParameters;
    }
892602
public function getNextExpected($expectedCode)
    {
        $token = $this->getNext();
        if ($this->getCurrentCode() != $expectedCode) {
            return null;
        }

        return $token;
    }
985112
@Override
    public void sawOpcode(int seen) {
        Integer arraySize = null;
        String[] loadedTypes = null;

        try {
            stack.precomputation(this);

            switch (seen) {
                case Const.ANEWARRAY: {
                    if (Values.SLASHED_JAVA_LANG_CLASS.equals(getClassConstantOperand()) && (stack.getStackDepth() >= 1)) {
                        OpcodeStack.Item item = stack.getStackItem(0);
                        arraySize = (Integer) item.getConstant();
                    }
                }
                break;

                case Const.AASTORE: {
                    if (stack.getStackDepth() >= 3) {
                        OpcodeStack.Item arrayItem = stack.getStackItem(2);
                        String[] arrayTypes = (String[]) arrayItem.getUserValue();
                        if (arrayTypes != null) {
                            OpcodeStack.Item valueItem = stack.getStackItem(0);
                            String type = (String) valueItem.getConstant();
                            if (type != null) {
                                OpcodeStack.Item indexItem = stack.getStackItem(1);
                                Integer index = (Integer) indexItem.getConstant();
                                if (index != null) {
                                    arrayTypes[index.intValue()] = type;
                                }
                            }
                        }
                    }
                }
                break;

                case Const.PUTFIELD:
                case Const.PUTSTATIC: {
                    String name = getNameConstantOperand();
                    if (stack.getStackDepth() >= 1) {
                        OpcodeStack.Item item = stack.getStackItem(0);
                        String[] arrayTypes = (String[]) item.getUserValue();
                        if (arrayTypes != null) {
                            fieldClassTypes.put(name, arrayTypes);
                            return;
                        }
                    }
                    fieldClassTypes.remove(name);
                }
                break;

                case Const.GETFIELD:
                case Const.GETSTATIC: {
                    String name = getNameConstantOperand();
                    loadedTypes = fieldClassTypes.get(name);
                }
                break;

                case Const.ASTORE_0:
                case Const.ASTORE_1:
                case Const.ASTORE_2:
                case Const.ASTORE_3:
                case Const.ASTORE: {
                    Integer reg = Integer.valueOf(RegisterUtils.getAStoreReg(this, seen));
                    if (stack.getStackDepth() >= 1) {
                        OpcodeStack.Item item = stack.getStackItem(0);
                        String[] arrayTypes = (String[]) item.getUserValue();
                        if (arrayTypes != null) {
                            localClassTypes.put(reg, arrayTypes);
                            return;
                        }
                    }
                    localClassTypes.remove(reg);
                }
                break;

                case Const.ALOAD_0:
                case Const.ALOAD_1:
                case Const.ALOAD_2:
                case Const.ALOAD_3:
                case Const.ALOAD: {
                    int reg = RegisterUtils.getAStoreReg(this, seen);
                    loadedTypes = localClassTypes.get(Integer.valueOf(reg));
                }
                break;

                case Const.INVOKEVIRTUAL: {
                    String cls = getClassConstantOperand();
                    if (Values.SLASHED_JAVA_LANG_CLASS.equals(cls)) {
                        String method = getNameConstantOperand();
                        if ("getMethod".equals(method)) {
                            String sig = getSigConstantOperand();
                            if (SIG_STRING_AND_CLASS_ARRAY_TO_METHOD.equals(sig) && (stack.getStackDepth() >= 2)) {
                                OpcodeStack.Item clsArgs = stack.getStackItem(0);
                                String[] arrayTypes = (String[]) clsArgs.getUserValue();
                                if ((arrayTypes != null) || clsArgs.isNull()) {
                                    OpcodeStack.Item methodItem = stack.getStackItem(1);
                                    String methodName = (String) methodItem.getConstant();
                                    if (methodName != null) {
                                        String reflectionSig = sigWithoutReturn.withMethodName(methodName).withParamTypes(arrayTypes).build();
                                        if (objectSigs.contains(reflectionSig)) {
                                            loadedTypes = (arrayTypes == null) ? new String[0] : arrayTypes;
                                        }
                                    }
                                }
                            }
                        }
                    } else if ("java/lang/reflect/Method".equals(cls)) {
                        String method = getNameConstantOperand();
                        if ("invoke".equals(method) && (stack.getStackDepth() >= 3)) {
                            OpcodeStack.Item methodItem = stack.getStackItem(2);
                            String[] arrayTypes = (String[]) methodItem.getUserValue();
                            if (arrayTypes != null) {
                                bugReporter.reportBug(new BugInstance(this, BugType.ROOM_REFLECTION_ON_OBJECT_METHODS.name(), NORMAL_PRIORITY).addClass(this)
                                        .addMethod(this).addSourceLine(this));
                            }
                        }
                    }
                }
                break;

                default:
                break;
            }
        } finally {
            TernaryPatcher.pre(stack, seen);
            stack.sawOpcode(this, seen);
            TernaryPatcher.post(stack, seen);

            if (stack.getStackDepth() >= 1) {
                if (arraySize != null) {
                    OpcodeStack.Item item = stack.getStackItem(0);
                    item.setUserValue(new String[arraySize.intValue()]);
                } else if (loadedTypes != null) {
                    OpcodeStack.Item item = stack.getStackItem(0);
                    item.setUserValue(loadedTypes);
                }
            }
        }
    }
126765
@Override
    public void sawOpcode(int seen) {
        boolean reset = true;
        switch (state) { // TODO: Refactor this to use state pattern, not nested
                         // switches
            case SEEN_NOTHING:
                reset = sawOpcodeAfterNothing(seen);
            break;

            case SEEN_ALOAD:
                reset = sawOpcodeAfterLoad(seen);
            break;

            case SEEN_GETFIELD:
                reset = sawOpcodeAfterGetField(seen);
            break;

            case SEEN_DUAL_LOADS:
                reset = sawOpcodeAfterDualLoads(seen);
            break;

            case SEEN_INVOKEVIRTUAL:
                if (seen == Const.INVOKEVIRTUAL) {
                    checkForSGSU();
                }
            break;
        }

        if (reset) {
            beanReference1 = null;
            beanReference2 = null;
            propType = null;
            propName = null;
            sawField = false;
            state = State.SEEN_NOTHING;
        }
    }