@param $state

@return \Technote\Interfaces\Helper\Social|null
775667
private function get_social_service( $state ) {
		$name = $this->get_social_service_name( $state );
		if ( empty( $name ) ) {
			return null;
		}
		foreach ( $this->get_class_list() as $class ) {
			/** @var \Technote\Interfaces\Helper\Social $class */
			if ( $name === $class->get_service_name() ) {
				return $class;
			}
		}

		return null;
	}
217046
public function checkState($storeState, $state = null)
	{
		if(null === $state)
		{
			if(null === $this->state)
			{
				if(isset($_GET['state']))
				{
					$state = $_GET['state'];
				}
				else
				{
					$state = '';
				}
			}
			else
			{
				$state = $this->state;
			}
		}
		return $storeState === $state;
	}
799680
public function getObjects($state = null)
    {
        if (!isset($state)) {
            return $this->objects;
        }

        $objectList = [];
        foreach ($this->objects as $id => $object) {
            if ($this->objectStates[$id] == $state) {
                $objectList[$id] = $object;
            }
        }

        return $objectList;
    }
940144
public function states($states = null)
    {
        if ($states === null) {
            return $this->_states;
        } else {
            unset($states['id']);
            foreach ($states as $key => $value) {
                $this->_states[$key] = $value;
            }
            $this->save();
        }
    }
531544
public function isLanguageRequiredInUri($state = null)
    {
        if (isset($state)) {
            $this->languageRequiredInUri = (bool) $state;
        }

        return $this->languageRequiredInUri;
    }
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;
    }
951639
public static function state($state) {

        $result = new \sb\Validate\Results();
        $result->value = $state;

        if (in_array($state, self::states)) {

            $result->is_valid = true;
            $result->message = 'Valid state code';
        } else {

            $result->is_valid = false;
            $result->message = 'Invalid state code, are you sure you are using a two letter abbreviation';
        }

        return $result;
    }
1090895
public function andStateIsIn($states)
    {
        $suffix = $this->getSuffix();
        return $this->andWhere($this->getAlias().'._state IN (:states'.$suffix.')')
                        ->setParameter('states'.$suffix, (array) $states);
    }
1038823
protected function getState($state = null)
	{
		if(null === $state)
		{
			if(null === $this->state)
			{
				$this->state = md5(\uniqid('', true));
			}
		}
		else
		{
			$this->state = $state;
		}
		return $this->state;
	}
1059743
public function execute(State $state) {
        $errors = [];
        foreach ($state->functionLookup as $name => $functions) {
            $calls = $state->callFinder->getCallsForFunction($name);
            foreach ($functions as $func) {
                foreach ($calls as $call) {
                    $errors = array_merge($errors, $this->verifyCall($func, $call[0], $state, $name));
                }
            }
        }
        foreach ($state->internalTypeInfo->functions as $name => $arginfo) {
            $calls = $state->callFinder->getCallsForFunction($name);
            foreach ($calls as $call) {
                $errors = array_merge($errors, $this->verifyInternalCall($arginfo, $call[0], $state, $name));
            }
        }
        foreach ($state->methodCalls as $call) {
            if (!$call->name instanceof Operand\Literal) {
                // Variable method call
                continue;
            }
            if (!$call->var->type || $call->var->type->type !== Type::TYPE_OBJECT) {
                // We don't know the type
                continue;
            }
            $name = strtolower($call->var->type->userType);
            if (!isset($state->classResolves[$name])) {
                // Could not find class
                continue;
            }
            foreach ($state->classResolves[$name] as $cn => $class) {
                // For every possible class that can resolve the type
                $method = $this->findMethod($class, $name);
                if (!$method) {
                    // Class does not *directly* implement method
                    continue;
                }
                $errors = array_merge($errors, $this->verifyCall($method, $call, $state, $cn . "->" . $name));
            }
        }
        return $errors;
    }
1348203
public function listYourOrganizationMembership(string $state = null): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/user/memberships/orgs?:args',
            http_build_query(['state' => $state])));
    }
354420
public function setState(State $state = null): AbstractTable
    {
        $this->current = new State($this->initial->getName());

        if (!empty($state)) {
            $this->current->setName($state->getName());
            $this->current->syncState($state);
        }

        return $this;
    }
1205334
private function setBatchRequest($state)
    {
        $this->_connection->setBatchRequest($state);
        $this->_processed = true;

        return $this;
    }
77544
public function recode_legacy_state_answer($state) {
        $answer = $state->answer;
        $resultarr = array();
        foreach (explode(',', $answer) as $pair) {
            $pairarr = explode('-', $pair);
            $questionid = $pairarr[0];
            $answerid = $pairarr[1];
            $newquestionid = $questionid ? $this->get_mappingid('question', $questionid) : 0;
            $newanswerid = $answerid ? $this->get_mappingid('question_answer', $answerid) : 0;
            $resultarr[] = implode('-', array($newquestionid, $newanswerid));
        }
        return implode(',', $resultarr);
    }
268506
private function makeCallable($state) : callable
    {
        if (is_callable($state)) {
            return $state;
        }
        return function () use ($state) {
            if (is_string($state) && class_exists($state)) {
                $state = new $state;
            }
            return $state;
        };
    }
422840
public function setState(int $state): ControllerInterface
    {
        switch ($state) {
            case self::STATE_PLAYING:
                return $this->play();
            case self::STATE_PAUSED:
                return $this->pause();
            case self::STATE_STOPPED:
                return $this->pause();
        }
        throw new \InvalidArgumentException("Unknown state: {$state})");
    }
1133295
public function setPushModelSupport($state) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');

        $this->pushModelSupport = (bool) $state;

        foreach ($this->nestedTiles as $tile) {
            if ($tile && $tile->isPushModelSupport()===null) {
                $tile->setPushModelSupport($state);
            }
        }
        return $this;
    }