id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
221,500 | adhocore/php-cron-expr | src/SegmentChecker.php | SegmentChecker.checkDue | public function checkDue($segment, $pos, $times)
{
$isDue = true;
$offsets = \explode(',', \trim($segment));
foreach ($offsets as $offset) {
if (null === $isDue = $this->isOffsetDue($offset, $pos, $times)) {
throw new \UnexpectedValueException(
... | php | public function checkDue($segment, $pos, $times)
{
$isDue = true;
$offsets = \explode(',', \trim($segment));
foreach ($offsets as $offset) {
if (null === $isDue = $this->isOffsetDue($offset, $pos, $times)) {
throw new \UnexpectedValueException(
... | [
"public",
"function",
"checkDue",
"(",
"$",
"segment",
",",
"$",
"pos",
",",
"$",
"times",
")",
"{",
"$",
"isDue",
"=",
"true",
";",
"$",
"offsets",
"=",
"\\",
"explode",
"(",
"','",
",",
"\\",
"trim",
"(",
"$",
"segment",
")",
")",
";",
"foreach... | Checks if a cron segment satisfies given time.
@param string $segment
@param int $pos
@param array $times
@return bool | [
"Checks",
"if",
"a",
"cron",
"segment",
"satisfies",
"given",
"time",
"."
] | d7bfd342d62795a50ad6377964cf567eb727961a | https://github.com/adhocore/php-cron-expr/blob/d7bfd342d62795a50ad6377964cf567eb727961a/src/SegmentChecker.php#L40-L58 |
221,501 | adhocore/php-cron-expr | src/SegmentChecker.php | SegmentChecker.isOffsetDue | protected function isOffsetDue($offset, $pos, $times)
{
if (\strpos($offset, '/') !== false) {
return $this->validator->inStep($times[$pos], $offset);
}
if (\strpos($offset, '-') !== false) {
return $this->validator->inRange($times[$pos], $offset);
}
... | php | protected function isOffsetDue($offset, $pos, $times)
{
if (\strpos($offset, '/') !== false) {
return $this->validator->inStep($times[$pos], $offset);
}
if (\strpos($offset, '-') !== false) {
return $this->validator->inRange($times[$pos], $offset);
}
... | [
"protected",
"function",
"isOffsetDue",
"(",
"$",
"offset",
",",
"$",
"pos",
",",
"$",
"times",
")",
"{",
"if",
"(",
"\\",
"strpos",
"(",
"$",
"offset",
",",
"'/'",
")",
"!==",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"validator",
"->",
"inS... | Check if a given offset at a position is due with respect to given time.
@param string $offset
@param int $pos
@param array $times
@return bool|null | [
"Check",
"if",
"a",
"given",
"offset",
"at",
"a",
"position",
"is",
"due",
"with",
"respect",
"to",
"given",
"time",
"."
] | d7bfd342d62795a50ad6377964cf567eb727961a | https://github.com/adhocore/php-cron-expr/blob/d7bfd342d62795a50ad6377964cf567eb727961a/src/SegmentChecker.php#L69-L84 |
221,502 | twizoapi/lib-api-php | src/Entity/Factory.php | Factory.createBioVoiceRegistration | public function createBioVoiceRegistration($recipient, $language = null, $webHook = null)
{
$bioVoiceRegistration = $this->createEmptyBioVoiceRegistration();
$bioVoiceRegistration->setRecipient($recipient);
if ($language !== null) {
$bioVoiceRegistration->setLanguage($language);... | php | public function createBioVoiceRegistration($recipient, $language = null, $webHook = null)
{
$bioVoiceRegistration = $this->createEmptyBioVoiceRegistration();
$bioVoiceRegistration->setRecipient($recipient);
if ($language !== null) {
$bioVoiceRegistration->setLanguage($language);... | [
"public",
"function",
"createBioVoiceRegistration",
"(",
"$",
"recipient",
",",
"$",
"language",
"=",
"null",
",",
"$",
"webHook",
"=",
"null",
")",
"{",
"$",
"bioVoiceRegistration",
"=",
"$",
"this",
"->",
"createEmptyBioVoiceRegistration",
"(",
")",
";",
"$"... | Create bio voice registration object
@param string $recipient
@param string|null $language
@param string|null $webHook
@return BioVoiceRegistration | [
"Create",
"bio",
"voice",
"registration",
"object"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Factory.php#L58-L72 |
221,503 | twizoapi/lib-api-php | src/Entity/Factory.php | Factory.createSms | public function createSms($body, array $recipients, $sender)
{
$sms = $this->createEmptySms();
$sms->setBody($body);
$sms->setRecipients($recipients);
$sms->setSender($sender);
return $sms;
} | php | public function createSms($body, array $recipients, $sender)
{
$sms = $this->createEmptySms();
$sms->setBody($body);
$sms->setRecipients($recipients);
$sms->setSender($sender);
return $sms;
} | [
"public",
"function",
"createSms",
"(",
"$",
"body",
",",
"array",
"$",
"recipients",
",",
"$",
"sender",
")",
"{",
"$",
"sms",
"=",
"$",
"this",
"->",
"createEmptySms",
"(",
")",
";",
"$",
"sms",
"->",
"setBody",
"(",
"$",
"body",
")",
";",
"$",
... | Create sms object
@param string $body
@param array $recipients
@param string $sender
@return Sms | [
"Create",
"sms",
"object"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Factory.php#L247-L255 |
221,504 | twizoapi/lib-api-php | src/Entity/Factory.php | Factory.createTotp | public function createTotp($identifier, $issuer = null)
{
$totp = $this->createEmptyTotp();
$totp->setIdentifier($identifier);
if (null !== $issuer) {
$totp->setIssuer($issuer);
}
return $totp;
} | php | public function createTotp($identifier, $issuer = null)
{
$totp = $this->createEmptyTotp();
$totp->setIdentifier($identifier);
if (null !== $issuer) {
$totp->setIssuer($issuer);
}
return $totp;
} | [
"public",
"function",
"createTotp",
"(",
"$",
"identifier",
",",
"$",
"issuer",
"=",
"null",
")",
"{",
"$",
"totp",
"=",
"$",
"this",
"->",
"createEmptyTotp",
"(",
")",
";",
"$",
"totp",
"->",
"setIdentifier",
"(",
"$",
"identifier",
")",
";",
"if",
... | Create new totp secret secret
@param string $identifier
@param string|null $issuer
@return Totp | [
"Create",
"new",
"totp",
"secret",
"secret"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Factory.php#L275-L284 |
221,505 | twizoapi/lib-api-php | src/Entity/Factory.php | Factory.createWidgetSession | public function createWidgetSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
{
$widgetSession = $this->createEmptyWidgetSession();
if ($allowedTypes !== null) {
$widgetSession->setAllowedTypes($allowedTypes);
... | php | public function createWidgetSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
{
$widgetSession = $this->createEmptyWidgetSession();
if ($allowedTypes !== null) {
$widgetSession->setAllowedTypes($allowedTypes);
... | [
"public",
"function",
"createWidgetSession",
"(",
"array",
"$",
"allowedTypes",
"=",
"null",
",",
"$",
"recipient",
"=",
"null",
",",
"$",
"backupCodeIdentifier",
"=",
"null",
",",
"$",
"totpIdentifier",
"=",
"null",
",",
"$",
"issuer",
"=",
"null",
")",
"... | Create widget session object
@param array|null $allowedTypes
@param string|null $recipient
@param string|null $backupCodeIdentifier
@param string|null $totpIdentifier
@param string|null $issuer
@return WidgetSession | [
"Create",
"widget",
"session",
"object"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Factory.php#L312-L336 |
221,506 | twizoapi/lib-api-php | src/Entity/Factory.php | Factory.createWidgetRegisterSession | public function createWidgetRegisterSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
{
$widgetRegisterSession = $this->createEmptyWidgetRegisterSession();
if ($allowedTypes !== null) {
$widgetRegisterSession->se... | php | public function createWidgetRegisterSession(array $allowedTypes = null, $recipient = null, $backupCodeIdentifier = null, $totpIdentifier = null, $issuer = null)
{
$widgetRegisterSession = $this->createEmptyWidgetRegisterSession();
if ($allowedTypes !== null) {
$widgetRegisterSession->se... | [
"public",
"function",
"createWidgetRegisterSession",
"(",
"array",
"$",
"allowedTypes",
"=",
"null",
",",
"$",
"recipient",
"=",
"null",
",",
"$",
"backupCodeIdentifier",
"=",
"null",
",",
"$",
"totpIdentifier",
"=",
"null",
",",
"$",
"issuer",
"=",
"null",
... | Create widget register session object
@param array|null $allowedTypes
@param string|null $recipient
@param string|null $backupCodeIdentifier
@param string|null $totpIdentifier
@param string|null $issuer
@return WidgetRegisterSession | [
"Create",
"widget",
"register",
"session",
"object"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Factory.php#L349-L373 |
221,507 | paquettg/leaguewrap | src/LeagueWrap/Dto/ShardList.php | ShardList.getShardByRegion | public function getShardByRegion($region)
{
foreach($this->info as $shard) {
if($shard->slug == $region)
return $shard;
}
return null;
} | php | public function getShardByRegion($region)
{
foreach($this->info as $shard) {
if($shard->slug == $region)
return $shard;
}
return null;
} | [
"public",
"function",
"getShardByRegion",
"(",
"$",
"region",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"info",
"as",
"$",
"shard",
")",
"{",
"if",
"(",
"$",
"shard",
"->",
"slug",
"==",
"$",
"region",
")",
"return",
"$",
"shard",
";",
"}",
"ret... | Get a shard by its region.
@param String $region
@return Shard|null | [
"Get",
"a",
"shard",
"by",
"its",
"region",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/ShardList.php#L29-L36 |
221,508 | neos/fluid | Classes/TYPO3/Fluid/View/AbstractTemplateView.php | AbstractTemplateView.setRenderingContext | public function setRenderingContext(RenderingContextInterface $renderingContext)
{
$this->baseRenderingContext = $renderingContext;
$this->baseRenderingContext->getViewHelperVariableContainer()->setView($this);
$this->controllerContext = $renderingContext->getControllerContext();
} | php | public function setRenderingContext(RenderingContextInterface $renderingContext)
{
$this->baseRenderingContext = $renderingContext;
$this->baseRenderingContext->getViewHelperVariableContainer()->setView($this);
$this->controllerContext = $renderingContext->getControllerContext();
} | [
"public",
"function",
"setRenderingContext",
"(",
"RenderingContextInterface",
"$",
"renderingContext",
")",
"{",
"$",
"this",
"->",
"baseRenderingContext",
"=",
"$",
"renderingContext",
";",
"$",
"this",
"->",
"baseRenderingContext",
"->",
"getViewHelperVariableContainer... | Injects a fresh rendering context
@param RenderingContextInterface $renderingContext
@return void | [
"Injects",
"a",
"fresh",
"rendering",
"context"
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/AbstractTemplateView.php#L126-L131 |
221,509 | neos/fluid | Classes/TYPO3/Fluid/View/AbstractTemplateView.php | AbstractTemplateView.assign | public function assign($key, $value)
{
$templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
if ($templateVariableContainer->exists($key)) {
$templateVariableContainer->remove($key);
}
$templateVariableContainer->add($key, $value);
... | php | public function assign($key, $value)
{
$templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
if ($templateVariableContainer->exists($key)) {
$templateVariableContainer->remove($key);
}
$templateVariableContainer->add($key, $value);
... | [
"public",
"function",
"assign",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"templateVariableContainer",
"=",
"$",
"this",
"->",
"baseRenderingContext",
"->",
"getTemplateVariableContainer",
"(",
")",
";",
"if",
"(",
"$",
"templateVariableContainer",
"->"... | Assign a value to the variable container.
@param string $key The key of a view variable to set
@param mixed $value The value of the view variable
@return \TYPO3\Fluid\View\AbstractTemplateView the instance of this view to allow chaining
@api | [
"Assign",
"a",
"value",
"to",
"the",
"variable",
"container",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/AbstractTemplateView.php#L156-L164 |
221,510 | neos/fluid | Classes/TYPO3/Fluid/View/AbstractTemplateView.php | AbstractTemplateView.assignMultiple | public function assignMultiple(array $values)
{
$templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
foreach ($values as $key => $value) {
if ($templateVariableContainer->exists($key)) {
$templateVariableContainer->remove($key);
... | php | public function assignMultiple(array $values)
{
$templateVariableContainer = $this->baseRenderingContext->getTemplateVariableContainer();
foreach ($values as $key => $value) {
if ($templateVariableContainer->exists($key)) {
$templateVariableContainer->remove($key);
... | [
"public",
"function",
"assignMultiple",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"templateVariableContainer",
"=",
"$",
"this",
"->",
"baseRenderingContext",
"->",
"getTemplateVariableContainer",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",... | Assigns multiple values to the JSON output.
However, only the key "value" is accepted.
@param array $values Keys and values - only a value with key "value" is considered
@return \TYPO3\Fluid\View\AbstractTemplateView the instance of this view to allow chaining
@api | [
"Assigns",
"multiple",
"values",
"to",
"the",
"JSON",
"output",
".",
"However",
"only",
"the",
"key",
"value",
"is",
"accepted",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/AbstractTemplateView.php#L174-L184 |
221,511 | neos/fluid | Classes/TYPO3/Fluid/View/AbstractTemplateView.php | AbstractTemplateView.render | public function render($actionName = null)
{
$this->baseRenderingContext->setControllerContext($this->controllerContext);
$this->templateParser->setConfiguration($this->buildParserConfiguration());
$templateIdentifier = $this->getTemplateIdentifier($actionName);
if ($this->templateC... | php | public function render($actionName = null)
{
$this->baseRenderingContext->setControllerContext($this->controllerContext);
$this->templateParser->setConfiguration($this->buildParserConfiguration());
$templateIdentifier = $this->getTemplateIdentifier($actionName);
if ($this->templateC... | [
"public",
"function",
"render",
"(",
"$",
"actionName",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"baseRenderingContext",
"->",
"setControllerContext",
"(",
"$",
"this",
"->",
"controllerContext",
")",
";",
"$",
"this",
"->",
"templateParser",
"->",
"setConfig... | Loads the template source and render the template.
If "layoutName" is set in a PostParseFacet callback, it will render the file with the given layout.
@param string $actionName If set, the view of the specified action will be rendered instead. Default is the action specified in the Request object
@return string Render... | [
"Loads",
"the",
"template",
"source",
"and",
"render",
"the",
"template",
".",
"If",
"layoutName",
"is",
"set",
"in",
"a",
"PostParseFacet",
"callback",
"it",
"will",
"render",
"the",
"file",
"with",
"the",
"given",
"layout",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/AbstractTemplateView.php#L194-L230 |
221,512 | neos/fluid | Classes/TYPO3/Fluid/View/AbstractTemplateView.php | AbstractTemplateView.renderStandaloneSection | protected function renderStandaloneSection($sectionName, array $variables = null, $ignoreUnknown = false)
{
$templateIdentifier = $this->getTemplateIdentifier();
if ($this->templateCompiler->has($templateIdentifier)) {
$parsedTemplate = $this->templateCompiler->get($templateIdentifier);
... | php | protected function renderStandaloneSection($sectionName, array $variables = null, $ignoreUnknown = false)
{
$templateIdentifier = $this->getTemplateIdentifier();
if ($this->templateCompiler->has($templateIdentifier)) {
$parsedTemplate = $this->templateCompiler->get($templateIdentifier);
... | [
"protected",
"function",
"renderStandaloneSection",
"(",
"$",
"sectionName",
",",
"array",
"$",
"variables",
"=",
"null",
",",
"$",
"ignoreUnknown",
"=",
"false",
")",
"{",
"$",
"templateIdentifier",
"=",
"$",
"this",
"->",
"getTemplateIdentifier",
"(",
")",
"... | Renders a section on its own, i.e. without the a surrounding template.
In this case, we just emulate that a surrounding (empty) layout exists,
and trigger the normal rendering flow then.
@param string $sectionName Name of section to render
@param array $variables The variables to use
@param boolean $ignoreUnknown Ign... | [
"Renders",
"a",
"section",
"on",
"its",
"own",
"i",
".",
"e",
".",
"without",
"the",
"a",
"surrounding",
"template",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/AbstractTemplateView.php#L304-L322 |
221,513 | twizoapi/lib-api-php | src/Entity/Totp/Exception.php | Exception.isTotpException | public static function isTotpException(EntityException $e)
{
if (in_array($e->getStatusCode(), array(RestStatusCodesInterface::REST_CLIENT_ERROR_UNPROCESSABLE_ENTITY, RestStatusCodesInterface::REST_CLIENT_ERROR_LOCKED))
&& in_array($e->getJsonErrorCode(), self::getVerificationJsonStatusCodes())
... | php | public static function isTotpException(EntityException $e)
{
if (in_array($e->getStatusCode(), array(RestStatusCodesInterface::REST_CLIENT_ERROR_UNPROCESSABLE_ENTITY, RestStatusCodesInterface::REST_CLIENT_ERROR_LOCKED))
&& in_array($e->getJsonErrorCode(), self::getVerificationJsonStatusCodes())
... | [
"public",
"static",
"function",
"isTotpException",
"(",
"EntityException",
"$",
"e",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"e",
"->",
"getStatusCode",
"(",
")",
",",
"array",
"(",
"RestStatusCodesInterface",
"::",
"REST_CLIENT_ERROR_UNPROCESSABLE_ENTITY",
","... | Test if the entity exception is the result of a verification exception
@param EntityException $e
@return bool | [
"Test",
"if",
"the",
"entity",
"exception",
"is",
"the",
"result",
"of",
"a",
"verification",
"exception"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Totp/Exception.php#L84-L93 |
221,514 | ThibaudDauce/mattermost-php | src/Message.php | Message.attachment | public function attachment(Closure $callback)
{
$this->attachments[] = $attachment = new Attachment;
$callback($attachment);
return $this;
} | php | public function attachment(Closure $callback)
{
$this->attachments[] = $attachment = new Attachment;
$callback($attachment);
return $this;
} | [
"public",
"function",
"attachment",
"(",
"Closure",
"$",
"callback",
")",
"{",
"$",
"this",
"->",
"attachments",
"[",
"]",
"=",
"$",
"attachment",
"=",
"new",
"Attachment",
";",
"$",
"callback",
"(",
"$",
"attachment",
")",
";",
"return",
"$",
"this",
... | Add an attachment for the message.
@param \Closure $callback
@return $this | [
"Add",
"an",
"attachment",
"for",
"the",
"message",
"."
] | 7542208205ba160589f54cd8636cbba6fee29a37 | https://github.com/ThibaudDauce/mattermost-php/blob/7542208205ba160589f54cd8636cbba6fee29a37/src/Message.php#L108-L115 |
221,515 | twizoapi/lib-api-php | src/Entity/BackupCode/Exception.php | Exception.isBackupCodeException | public static function isBackupCodeException(EntityException $e)
{
if (in_array($e->getStatusCode(), array(RestStatusCodesInterface::REST_CLIENT_ERROR_CONFLICT, RestStatusCodesInterface::REST_CLIENT_ERROR_UNPROCESSABLE_ENTITY, RestStatusCodesInterface::REST_CLIENT_ERROR_LOCKED))
&& in_array($e->... | php | public static function isBackupCodeException(EntityException $e)
{
if (in_array($e->getStatusCode(), array(RestStatusCodesInterface::REST_CLIENT_ERROR_CONFLICT, RestStatusCodesInterface::REST_CLIENT_ERROR_UNPROCESSABLE_ENTITY, RestStatusCodesInterface::REST_CLIENT_ERROR_LOCKED))
&& in_array($e->... | [
"public",
"static",
"function",
"isBackupCodeException",
"(",
"EntityException",
"$",
"e",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"e",
"->",
"getStatusCode",
"(",
")",
",",
"array",
"(",
"RestStatusCodesInterface",
"::",
"REST_CLIENT_ERROR_CONFLICT",
",",
"R... | Test if the entity exception is the result of a backup code exception
@param EntityException $e
@return bool | [
"Test",
"if",
"the",
"entity",
"exception",
"is",
"the",
"result",
"of",
"a",
"backup",
"code",
"exception"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/BackupCode/Exception.php#L76-L85 |
221,516 | radphp/radphp | src/Network/Session.php | Session.get | public function get($key, $defaultValue = null)
{
if (isset($this->session[$key]) && !empty($this->session[$key])) {
return $this->session[$key];
}
return $defaultValue;
} | php | public function get($key, $defaultValue = null)
{
if (isset($this->session[$key]) && !empty($this->session[$key])) {
return $this->session[$key];
}
return $defaultValue;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"defaultValue",
"=",
"null",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"key",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"session",
"[",
"$",
"k... | Gets a session variable
@param string $key
@param mixed $defaultValue
@return mixed | [
"Gets",
"a",
"session",
"variable"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Network/Session.php#L67-L74 |
221,517 | radphp/radphp | src/Core/DotEnv.php | DotEnv.load | public static function load($path)
{
if (is_dir($path)) {
foreach (preg_grep('/^\.env$/', scandir($path)) as $filename) {
$filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $filename;
if (is_readable($filePath)) {
foreach (pa... | php | public static function load($path)
{
if (is_dir($path)) {
foreach (preg_grep('/^\.env$/', scandir($path)) as $filename) {
$filePath = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $filename;
if (is_readable($filePath)) {
foreach (pa... | [
"public",
"static",
"function",
"load",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"foreach",
"(",
"preg_grep",
"(",
"'/^\\.env$/'",
",",
"scandir",
"(",
"$",
"path",
")",
")",
"as",
"$",
"filename",
")",
"{",... | Load .env file
@param string $path Directory path
@throws BaseException | [
"Load",
".",
"env",
"file"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Core/DotEnv.php#L21-L35 |
221,518 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/Uri/ResourceViewHelper.php | ResourceViewHelper.render | public function render($path = null, $package = null, Resource $resource = null, $localize = true)
{
if ($resource !== null) {
$uri = $this->resourceManager->getPublicPersistentResourceUri($resource);
if ($uri === false) {
$uri = '404-Resource-Not-Found';
... | php | public function render($path = null, $package = null, Resource $resource = null, $localize = true)
{
if ($resource !== null) {
$uri = $this->resourceManager->getPublicPersistentResourceUri($resource);
if ($uri === false) {
$uri = '404-Resource-Not-Found';
... | [
"public",
"function",
"render",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"package",
"=",
"null",
",",
"Resource",
"$",
"resource",
"=",
"null",
",",
"$",
"localize",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"resource",
"!==",
"null",
")",
"{",
"$",
... | Render the URI to the resource. The filename is used from child content.
@param string $path The location of the resource, can be either a path relative to the Public resource directory of the package or a resource://... URI
@param string $package Target package key. If not set, the current package key will be used
@p... | [
"Render",
"the",
"URI",
"to",
"the",
"resource",
".",
"The",
"filename",
"is",
"used",
"from",
"child",
"content",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/Uri/ResourceViewHelper.php#L86-L119 |
221,519 | paquettg/leaguewrap | src/LeagueWrap/Api/Staticdata.php | Staticdata.makeRequest | protected function makeRequest($path, $requestId, array $params)
{
if ($this->appendId($requestId))
{
$path .= "/$requestId";
}
return $this->request($path, $params, true);
} | php | protected function makeRequest($path, $requestId, array $params)
{
if ($this->appendId($requestId))
{
$path .= "/$requestId";
}
return $this->request($path, $params, true);
} | [
"protected",
"function",
"makeRequest",
"(",
"$",
"path",
",",
"$",
"requestId",
",",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"appendId",
"(",
"$",
"requestId",
")",
")",
"{",
"$",
"path",
".=",
"\"/$requestId\"",
";",
"}",
"r... | Make the request given the proper information.
@param string $path
@param mixed $requestId
@param array $params
@return array | [
"Make",
"the",
"request",
"given",
"the",
"proper",
"information",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/Staticdata.php#L315-L323 |
221,520 | paquettg/leaguewrap | src/LeagueWrap/Api/Staticdata.php | Staticdata.setUpParams | protected function setUpParams($name = '', $requestId = null, $data = null, $listData = '', $itemData = '')
{
$params = [];
if ( ! is_null($this->locale))
{
$params['locale'] = $this->locale;
}
if ( ! is_null($this->DDversion))
{
$params['version'] = $this->DDversion;
}
if ( ! $this->appendId($re... | php | protected function setUpParams($name = '', $requestId = null, $data = null, $listData = '', $itemData = '')
{
$params = [];
if ( ! is_null($this->locale))
{
$params['locale'] = $this->locale;
}
if ( ! is_null($this->DDversion))
{
$params['version'] = $this->DDversion;
}
if ( ! $this->appendId($re... | [
"protected",
"function",
"setUpParams",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"requestId",
"=",
"null",
",",
"$",
"data",
"=",
"null",
",",
"$",
"listData",
"=",
"''",
",",
"$",
"itemData",
"=",
"''",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",... | Set up the boiler plate for the param array for any
static data call.
@param string $name of api call
@param mixed $requestId
@param mixed $data
@param string $listData
@param string $itemData
@return array | [
"Set",
"up",
"the",
"boiler",
"plate",
"for",
"the",
"param",
"array",
"for",
"any",
"static",
"data",
"call",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/Staticdata.php#L336-L374 |
221,521 | paquettg/leaguewrap | src/LeagueWrap/Api/Featuredgames.php | Featuredgames.featuredGames | public function featuredGames()
{
$response = $this->request('featured', [], false, false);
return $this->attachStaticDataToDto(new FeaturedGamesDto($response));
} | php | public function featuredGames()
{
$response = $this->request('featured', [], false, false);
return $this->attachStaticDataToDto(new FeaturedGamesDto($response));
} | [
"public",
"function",
"featuredGames",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"request",
"(",
"'featured'",
",",
"[",
"]",
",",
"false",
",",
"false",
")",
";",
"return",
"$",
"this",
"->",
"attachStaticDataToDto",
"(",
"new",
"FeaturedG... | Requests all featured games.
@return \LeagueWrap\Dto\AbstractDto
@throws \Exception
@throws \LeagueWrap\Exception\CacheNotFoundException
@throws \LeagueWrap\Exception\RegionException
@throws \LeagueWrap\Response\HttpClientError
@throws \LeagueWrap\Response\HttpServerError | [
"Requests",
"all",
"featured",
"games",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/Featuredgames.php#L61-L66 |
221,522 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/Form/AbstractFormFieldViewHelper.php | AbstractFormFieldViewHelper.renderHiddenFieldForEmptyValue | protected function renderHiddenFieldForEmptyValue()
{
$emptyHiddenFieldNames = array();
if ($this->viewHelperVariableContainer->exists(\TYPO3\Fluid\ViewHelpers\FormViewHelper::class, 'emptyHiddenFieldNames')) {
$emptyHiddenFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\Fluid... | php | protected function renderHiddenFieldForEmptyValue()
{
$emptyHiddenFieldNames = array();
if ($this->viewHelperVariableContainer->exists(\TYPO3\Fluid\ViewHelpers\FormViewHelper::class, 'emptyHiddenFieldNames')) {
$emptyHiddenFieldNames = $this->viewHelperVariableContainer->get(\TYPO3\Fluid... | [
"protected",
"function",
"renderHiddenFieldForEmptyValue",
"(",
")",
"{",
"$",
"emptyHiddenFieldNames",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"viewHelperVariableContainer",
"->",
"exists",
"(",
"\\",
"TYPO3",
"\\",
"Fluid",
"\\",
"ViewHelper... | Renders a hidden field with the same name as the element, to make sure the empty value is submitted
in case nothing is selected. This is needed for checkbox and multiple select fields
@return void | [
"Renders",
"a",
"hidden",
"field",
"with",
"the",
"same",
"name",
"as",
"the",
"element",
"to",
"make",
"sure",
"the",
"empty",
"value",
"is",
"submitted",
"in",
"case",
"nothing",
"is",
"selected",
".",
"This",
"is",
"needed",
"for",
"checkbox",
"and",
... | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/Form/AbstractFormFieldViewHelper.php#L325-L344 |
221,523 | CapMousse/React-Restify | src/Container/Container.php | Container.has | public function has($id)
{
if (!is_string($id)) {
throw new ContainerException('$id must be a string');
}
if (array_key_exists($id, $this->definitions)) {
return true;
}
return false;
} | php | public function has($id)
{
if (!is_string($id)) {
throw new ContainerException('$id must be a string');
}
if (array_key_exists($id, $this->definitions)) {
return true;
}
return false;
} | [
"public",
"function",
"has",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"ContainerException",
"(",
"'$id must be a string'",
")",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
... | Check if item is available in container
@param string $id
@return boolean | [
"Check",
"if",
"item",
"is",
"available",
"in",
"container"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L60-L71 |
221,524 | CapMousse/React-Restify | src/Container/Container.php | Container.get | public function get($id)
{
if (!is_string($id)) {
throw new ContainerException('$id must be a string');
}
if (!isset($this->definitions[$id])) {
throw new NotFoundException("Unresolvable ".$id);
}
return $this->definitions[$id];
} | php | public function get($id)
{
if (!is_string($id)) {
throw new ContainerException('$id must be a string');
}
if (!isset($this->definitions[$id])) {
throw new NotFoundException("Unresolvable ".$id);
}
return $this->definitions[$id];
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"id",
")",
")",
"{",
"throw",
"new",
"ContainerException",
"(",
"'$id must be a string'",
")",
";",
"}",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
... | Get an item of the container
@param string $id
@return mixed
@throw NotFoundException | [
"Get",
"an",
"item",
"of",
"the",
"container"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L79-L90 |
221,525 | CapMousse/React-Restify | src/Container/Container.php | Container.call | public function call ($action, array $args = [])
{
$method = $action;
$class = null;
if (is_string($action)) {
list($class, $method) = explode('@', $action);
}
elseif (is_array($action)) {
list($class, $method) = $action;
if (!is_object(... | php | public function call ($action, array $args = [])
{
$method = $action;
$class = null;
if (is_string($action)) {
list($class, $method) = explode('@', $action);
}
elseif (is_array($action)) {
list($class, $method) = $action;
if (!is_object(... | [
"public",
"function",
"call",
"(",
"$",
"action",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"method",
"=",
"$",
"action",
";",
"$",
"class",
"=",
"null",
";",
"if",
"(",
"is_string",
"(",
"$",
"action",
")",
")",
"{",
"list",
"("... | Call method with given parameters
@param string|array|callable $action
@param array $args
@return mixed | [
"Call",
"method",
"with",
"given",
"parameters"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L98-L131 |
221,526 | CapMousse/React-Restify | src/Container/Container.php | Container.getParametersDictionary | public function getParametersDictionary(array $args = [])
{
$dictionary = [];
foreach ($args as $parameter) {
if (!is_object($parameter)) continue;
$dictionary[get_class($parameter)] = $parameter;
}
return array_merge($args, $dictionary);
} | php | public function getParametersDictionary(array $args = [])
{
$dictionary = [];
foreach ($args as $parameter) {
if (!is_object($parameter)) continue;
$dictionary[get_class($parameter)] = $parameter;
}
return array_merge($args, $dictionary);
} | [
"public",
"function",
"getParametersDictionary",
"(",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"dictionary",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"paramet... | Find object and set classname alias on argument list
@param array $args
@return array | [
"Find",
"object",
"and",
"set",
"classname",
"alias",
"on",
"argument",
"list"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L153-L163 |
221,527 | CapMousse/React-Restify | src/Container/Container.php | Container.getParameters | public function getParameters(\ReflectionFunctionAbstract $reflection, array $args = [])
{
$dependencies = $reflection->getParameters();
$parameters = [];
foreach ($dependencies as $parameter) {
$parameters[] = $this->getParameter($parameter, $args);
}
return $p... | php | public function getParameters(\ReflectionFunctionAbstract $reflection, array $args = [])
{
$dependencies = $reflection->getParameters();
$parameters = [];
foreach ($dependencies as $parameter) {
$parameters[] = $this->getParameter($parameter, $args);
}
return $p... | [
"public",
"function",
"getParameters",
"(",
"\\",
"ReflectionFunctionAbstract",
"$",
"reflection",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"dependencies",
"=",
"$",
"reflection",
"->",
"getParameters",
"(",
")",
";",
"$",
"parameters",
"=",
... | Get reflection parameters
@param \ReflectionFunctionAbstract $reflection
@param array $args
@return array | [
"Get",
"reflection",
"parameters"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L171-L181 |
221,528 | CapMousse/React-Restify | src/Container/Container.php | Container.getParameter | public function getParameter(\ReflectionParameter $parameter, array $args = [])
{
$class = $parameter->getClass();
if ($class && $this->has($class->name)) {
return $this->get($class->name);
}
if ($class && array_key_exists($class->name, $args)) {
return $arg... | php | public function getParameter(\ReflectionParameter $parameter, array $args = [])
{
$class = $parameter->getClass();
if ($class && $this->has($class->name)) {
return $this->get($class->name);
}
if ($class && array_key_exists($class->name, $args)) {
return $arg... | [
"public",
"function",
"getParameter",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"class",
"=",
"$",
"parameter",
"->",
"getClass",
"(",
")",
";",
"if",
"(",
"$",
"class",
"&&",
"$",
"t... | Get paremeter value
@param \ReflectionParameter $parameter
@param array $args
@return mixed | [
"Get",
"paremeter",
"value"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L189-L206 |
221,529 | CapMousse/React-Restify | src/Container/Container.php | Container.build | public function build ($class)
{
$reflection = new \ReflectionClass($class);
$parameters = [];
if (!is_null($reflection->getConstructor())) {
$parameters = $this->getParameters($reflection->getConstructor());
}
return new $class(...$parameters);
} | php | public function build ($class)
{
$reflection = new \ReflectionClass($class);
$parameters = [];
if (!is_null($reflection->getConstructor())) {
$parameters = $this->getParameters($reflection->getConstructor());
}
return new $class(...$parameters);
} | [
"public",
"function",
"build",
"(",
"$",
"class",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"parameters",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"reflection",
"->",
"getConst... | Create a new container for asked class
@param string $class
@return Container | [
"Create",
"a",
"new",
"container",
"for",
"asked",
"class"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Container/Container.php#L213-L223 |
221,530 | paquettg/leaguewrap | src/LeagueWrap/Dto/AbstractDto.php | AbstractDto.get | public function get($key)
{
if (isset($this->info[$key]))
{
return $this->info[$key];
}
return null;
} | php | public function get($key)
{
if (isset($this->info[$key]))
{
return $this->info[$key];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"info",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"null",
";",
"}"
] | Gets the attribute of this Dto.
@param string $key
@return string|null | [
"Gets",
"the",
"attribute",
"of",
"this",
"Dto",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/AbstractDto.php#L61-L69 |
221,531 | paquettg/leaguewrap | src/LeagueWrap/Dto/AbstractDto.php | AbstractDto.loadStaticData | public function loadStaticData(Staticdata $staticData)
{
$fields = $this->getStaticFields();
$optimizer = new StaticOptimizer;
$optimizer->optimizeFields($fields)
->setStaticInfo($staticData);
$this->addStaticData($optimizer);
return $this;
} | php | public function loadStaticData(Staticdata $staticData)
{
$fields = $this->getStaticFields();
$optimizer = new StaticOptimizer;
$optimizer->optimizeFields($fields)
->setStaticInfo($staticData);
$this->addStaticData($optimizer);
return $this;
} | [
"public",
"function",
"loadStaticData",
"(",
"Staticdata",
"$",
"staticData",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"getStaticFields",
"(",
")",
";",
"$",
"optimizer",
"=",
"new",
"StaticOptimizer",
";",
"$",
"optimizer",
"->",
"optimizeFields",
"... | Attempts to load all static data within the children DTO
objects.
@param Staticdata $staticData
@return $this | [
"Attempts",
"to",
"load",
"all",
"static",
"data",
"within",
"the",
"children",
"DTO",
"objects",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/AbstractDto.php#L92-L101 |
221,532 | paquettg/leaguewrap | src/LeagueWrap/Dto/AbstractDto.php | AbstractDto.raw | public function raw()
{
// unpack
$raw = [];
foreach ($this->info as $key => $info)
{
if (is_array($info))
{
$info = $this->unpack($info);
}
// check if it's just a single object
if ($info instanceof AbstractDto)
{
$info = $info->raw();
}
// set the raw value
$raw[$key] = $in... | php | public function raw()
{
// unpack
$raw = [];
foreach ($this->info as $key => $info)
{
if (is_array($info))
{
$info = $this->unpack($info);
}
// check if it's just a single object
if ($info instanceof AbstractDto)
{
$info = $info->raw();
}
// set the raw value
$raw[$key] = $in... | [
"public",
"function",
"raw",
"(",
")",
"{",
"// unpack",
"$",
"raw",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"info",
"as",
"$",
"key",
"=>",
"$",
"info",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"info",
")",
")",
"{",
"$",
"i... | Returns the raw info array
@return array
@recursive | [
"Returns",
"the",
"raw",
"info",
"array"
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/AbstractDto.php#L109-L129 |
221,533 | paquettg/leaguewrap | src/LeagueWrap/Dto/AbstractDto.php | AbstractDto.getStaticFields | protected function getStaticFields()
{
$fields = [];
foreach ($this->info as $info)
{
if (is_array($info))
{
foreach ($info as $value)
{
if ($value instanceof AbstractDto)
{
$fields += $value->getStaticFields();
}
}
}
if ($info instanceof AbstractDto)
{
$fields... | php | protected function getStaticFields()
{
$fields = [];
foreach ($this->info as $info)
{
if (is_array($info))
{
foreach ($info as $value)
{
if ($value instanceof AbstractDto)
{
$fields += $value->getStaticFields();
}
}
}
if ($info instanceof AbstractDto)
{
$fields... | [
"protected",
"function",
"getStaticFields",
"(",
")",
"{",
"$",
"fields",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"info",
"as",
"$",
"info",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"info",
")",
")",
"{",
"foreach",
"(",
"$",
"in... | Gets all static fields that we expect to need to get all static data
for any child dto object.
@return array | [
"Gets",
"all",
"static",
"fields",
"that",
"we",
"expect",
"to",
"need",
"to",
"get",
"all",
"static",
"data",
"for",
"any",
"child",
"dto",
"object",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/AbstractDto.php#L137-L159 |
221,534 | paquettg/leaguewrap | src/LeagueWrap/Dto/AbstractDto.php | AbstractDto.addStaticData | protected function addStaticData(StaticOptimizer $optimizer)
{
foreach ($this->info as $info)
{
if (is_array($info))
{
foreach ($info as $value)
{
if ($value instanceof AbstractDto)
{
$value->addStaticData($optimizer);
}
}
}
if ($info instanceof AbstractDto)
{
$i... | php | protected function addStaticData(StaticOptimizer $optimizer)
{
foreach ($this->info as $info)
{
if (is_array($info))
{
foreach ($info as $value)
{
if ($value instanceof AbstractDto)
{
$value->addStaticData($optimizer);
}
}
}
if ($info instanceof AbstractDto)
{
$i... | [
"protected",
"function",
"addStaticData",
"(",
"StaticOptimizer",
"$",
"optimizer",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"info",
"as",
"$",
"info",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"info",
")",
")",
"{",
"foreach",
"(",
"$",
"info",
... | Attempts to add the static data that we got from getStaticData to
any children DTO objects.
@param StaticOptimizer $optimizer
@return void | [
"Attempts",
"to",
"add",
"the",
"static",
"data",
"that",
"we",
"got",
"from",
"getStaticData",
"to",
"any",
"children",
"DTO",
"objects",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/AbstractDto.php#L168-L187 |
221,535 | paquettg/leaguewrap | src/LeagueWrap/Dto/AbstractDto.php | AbstractDto.unpack | protected function unpack(array $info)
{
$return = [];
foreach ($info as $key => $value)
{
if ($value instanceof AbstractDto)
{
$value = $value->raw();
}
$return[$key] = $value;
}
return $return;
} | php | protected function unpack(array $info)
{
$return = [];
foreach ($info as $key => $value)
{
if ($value instanceof AbstractDto)
{
$value = $value->raw();
}
$return[$key] = $value;
}
return $return;
} | [
"protected",
"function",
"unpack",
"(",
"array",
"$",
"info",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"info",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"AbstractDto",
")",
"{",
... | Unpacks an array that contains Dto objects.
@param array $info
@return array | [
"Unpacks",
"an",
"array",
"that",
"contains",
"Dto",
"objects",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/AbstractDto.php#L195-L208 |
221,536 | paquettg/leaguewrap | src/LeagueWrap/Dto/MatchTeam.php | MatchTeam.ban | public function ban($banId)
{
if ( ! isset($this->info['bans']))
{
// no teams
return null;
}
$bans = $this->info['bans'];
if (isset($bans[$banId]))
{
return $bans[$banId];
}
return null;
} | php | public function ban($banId)
{
if ( ! isset($this->info['bans']))
{
// no teams
return null;
}
$bans = $this->info['bans'];
if (isset($bans[$banId]))
{
return $bans[$banId];
}
return null;
} | [
"public",
"function",
"ban",
"(",
"$",
"banId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'bans'",
"]",
")",
")",
"{",
"// no teams",
"return",
"null",
";",
"}",
"$",
"bans",
"=",
"$",
"this",
"->",
"info",
"[",
"... | Attempts to get a ban from this team.
@param int $banId
@return Ban|null | [
"Attempts",
"to",
"get",
"a",
"ban",
"from",
"this",
"team",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/MatchTeam.php#L42-L56 |
221,537 | neos/fluid | Classes/TYPO3/Fluid/Core/Parser/SyntaxTree/ObjectAccessorNode.php | ObjectAccessorNode.evaluate | public function evaluate(RenderingContextInterface $renderingContext)
{
return self::getPropertyPath($renderingContext->getTemplateVariableContainer(), $this->objectPath, $renderingContext);
} | php | public function evaluate(RenderingContextInterface $renderingContext)
{
return self::getPropertyPath($renderingContext->getTemplateVariableContainer(), $this->objectPath, $renderingContext);
} | [
"public",
"function",
"evaluate",
"(",
"RenderingContextInterface",
"$",
"renderingContext",
")",
"{",
"return",
"self",
"::",
"getPropertyPath",
"(",
"$",
"renderingContext",
"->",
"getTemplateVariableContainer",
"(",
")",
",",
"$",
"this",
"->",
"objectPath",
",",... | Evaluate this node and return the correct object.
Handles each part (denoted by .) in $this->objectPath in the following order:
- call appropriate getter
- call public property, if exists
- fail
The first part of the object path has to be a variable in the
TemplateVariableContainer.
@param RenderingContextInterface ... | [
"Evaluate",
"this",
"node",
"and",
"return",
"the",
"correct",
"object",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/Core/Parser/SyntaxTree/ObjectAccessorNode.php#L69-L72 |
221,538 | radphp/radphp | src/Routing/Router.php | Router.checkRestPrefixValidity | private function checkRestPrefixValidity(array $restPrefixes)
{
foreach ($restPrefixes as $prefix) {
if (!is_string($prefix)) {
throw new DomainException('All provided prefixes for REST must be string');
}
// if it has "/" in it
if (strpos('/'... | php | private function checkRestPrefixValidity(array $restPrefixes)
{
foreach ($restPrefixes as $prefix) {
if (!is_string($prefix)) {
throw new DomainException('All provided prefixes for REST must be string');
}
// if it has "/" in it
if (strpos('/'... | [
"private",
"function",
"checkRestPrefixValidity",
"(",
"array",
"$",
"restPrefixes",
")",
"{",
"foreach",
"(",
"$",
"restPrefixes",
"as",
"$",
"prefix",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"prefix",
")",
")",
"{",
"throw",
"new",
"DomainExcept... | Check if REST prefixes are valid or not. It will throw exception on error
@param array $restPrefixes REST prefixes
@throws DomainException | [
"Check",
"if",
"REST",
"prefixes",
"are",
"valid",
"or",
"not",
".",
"It",
"will",
"throw",
"exception",
"on",
"error"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Routing/Router.php#L418-L430 |
221,539 | radphp/radphp | src/Routing/Router.php | Router.prepareMethodName | protected function prepareMethodName()
{
if (PHP_SAPI === 'cli') {
$method = 'cli';
} else {
/** @var Request $request */
$request = $this->getContainer()->get('request');
$method = $request->getMethod();
}
return ucfirst(strtolower($m... | php | protected function prepareMethodName()
{
if (PHP_SAPI === 'cli') {
$method = 'cli';
} else {
/** @var Request $request */
$request = $this->getContainer()->get('request');
$method = $request->getMethod();
}
return ucfirst(strtolower($m... | [
"protected",
"function",
"prepareMethodName",
"(",
")",
"{",
"if",
"(",
"PHP_SAPI",
"===",
"'cli'",
")",
"{",
"$",
"method",
"=",
"'cli'",
";",
"}",
"else",
"{",
"/** @var Request $request */",
"$",
"request",
"=",
"$",
"this",
"->",
"getContainer",
"(",
"... | Prepare method name, choose between CLI and all other HTTP methods
@return string Method name + "Method" | [
"Prepare",
"method",
"name",
"choose",
"between",
"CLI",
"and",
"all",
"other",
"HTTP",
"methods"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Routing/Router.php#L437-L448 |
221,540 | radphp/radphp | src/Routing/Router.php | Router.extractLanguage | protected function extractLanguage(array &$parts)
{
if (!empty($parts) && in_array($parts[0], Config::get('languages.possible', ['en']))) {
// We found the language, so set it as current language
$this->language = array_shift($parts);
} else {
$this->language = Co... | php | protected function extractLanguage(array &$parts)
{
if (!empty($parts) && in_array($parts[0], Config::get('languages.possible', ['en']))) {
// We found the language, so set it as current language
$this->language = array_shift($parts);
} else {
$this->language = Co... | [
"protected",
"function",
"extractLanguage",
"(",
"array",
"&",
"$",
"parts",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"parts",
")",
"&&",
"in_array",
"(",
"$",
"parts",
"[",
"0",
"]",
",",
"Config",
"::",
"get",
"(",
"'languages.possible'",
",",
... | If route is prefixed with language, extract it
@param array $parts router parts | [
"If",
"route",
"is",
"prefixed",
"with",
"language",
"extract",
"it"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Routing/Router.php#L455-L463 |
221,541 | radphp/radphp | src/Routing/Router.php | Router.prepareRestRequest | protected function prepareRestRequest(array &$parts)
{
if (!empty($parts) && in_array($parts[0], $this->restPrefixes)) {
/*
* if the request is something like /_/posts/1/comments/2
* it will convert it to something like /posts/comments/1/2
*/
/... | php | protected function prepareRestRequest(array &$parts)
{
if (!empty($parts) && in_array($parts[0], $this->restPrefixes)) {
/*
* if the request is something like /_/posts/1/comments/2
* it will convert it to something like /posts/comments/1/2
*/
/... | [
"protected",
"function",
"prepareRestRequest",
"(",
"array",
"&",
"$",
"parts",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"parts",
")",
"&&",
"in_array",
"(",
"$",
"parts",
"[",
"0",
"]",
",",
"$",
"this",
"->",
"restPrefixes",
")",
")",
"{",
"/... | Prepare REST requests
@param array $parts router parts | [
"Prepare",
"REST",
"requests"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Routing/Router.php#L470-L496 |
221,542 | radphp/radphp | src/Routing/Router.php | Router.finalizeRouterArguments | private function finalizeRouterArguments(
array $parts,
array $camelizedParts,
$actionNamespace,
$bundleName,
$method
) {
array_splice($camelizedParts, 1, 1, 'Responder');
$responderNamespace = implode('\\', $camelizedParts) . 'Responder';
$delta = ($... | php | private function finalizeRouterArguments(
array $parts,
array $camelizedParts,
$actionNamespace,
$bundleName,
$method
) {
array_splice($camelizedParts, 1, 1, 'Responder');
$responderNamespace = implode('\\', $camelizedParts) . 'Responder';
$delta = ($... | [
"private",
"function",
"finalizeRouterArguments",
"(",
"array",
"$",
"parts",
",",
"array",
"$",
"camelizedParts",
",",
"$",
"actionNamespace",
",",
"$",
"bundleName",
",",
"$",
"method",
")",
"{",
"array_splice",
"(",
"$",
"camelizedParts",
",",
"1",
",",
"... | Finalize and set all route parameters
@param array $parts Router parts
@param array $camelizedParts Camelized router parts
@param string $actionNamespace Namespace
@param string $bundleName Bundle
@param string $method Method | [
"Finalize",
"and",
"set",
"all",
"route",
"parameters"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Routing/Router.php#L507-L528 |
221,543 | radphp/radphp | src/Network/Http/Message/Stream.php | Stream.connectionErrorHandler | protected function connectionErrorHandler($code, $message, $file, $line, $args)
{
$this->connectionErrors[] = [
'code' => $code,
'message' => $message,
'file' => $file,
'line' => $line,
'args' => $args
];
} | php | protected function connectionErrorHandler($code, $message, $file, $line, $args)
{
$this->connectionErrors[] = [
'code' => $code,
'message' => $message,
'file' => $file,
'line' => $line,
'args' => $args
];
} | [
"protected",
"function",
"connectionErrorHandler",
"(",
"$",
"code",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
",",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"connectionErrors",
"[",
"]",
"=",
"[",
"'code'",
"=>",
"$",
"code",
",",
"'m... | Connection error handler
@param int $code Error code
@param string $message Error message
@param string $file Error file
@param int $line Error line
@param array $args Error arguments | [
"Connection",
"error",
"handler"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Network/Http/Message/Stream.php#L104-L113 |
221,544 | CapMousse/React-Restify | src/Traits/EventTrait.php | EventTrait.after | public function after($callback)
{
$container = Container::getInstance();
$this->on('after', function ($request, $response) use (&$container, &$callback) {
try {
$container->call($callback, func_get_args());
} catch (\Exception $e) {
$this->e... | php | public function after($callback)
{
$container = Container::getInstance();
$this->on('after', function ($request, $response) use (&$container, &$callback) {
try {
$container->call($callback, func_get_args());
} catch (\Exception $e) {
$this->e... | [
"public",
"function",
"after",
"(",
"$",
"callback",
")",
"{",
"$",
"container",
"=",
"Container",
"::",
"getInstance",
"(",
")",
";",
"$",
"this",
"->",
"on",
"(",
"'after'",
",",
"function",
"(",
"$",
"request",
",",
"$",
"response",
")",
"use",
"(... | Helper to listing to after event
@param Callable $callback
@return Void | [
"Helper",
"to",
"listing",
"to",
"after",
"event"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Traits/EventTrait.php#L31-L42 |
221,545 | paquettg/leaguewrap | src/LeagueWrap/Dto/RecentGames.php | RecentGames.game | public function game($gameId)
{
if ( ! isset($this->info['games'][$gameId]))
{
return null;
}
return $this->info['games'][$gameId];
} | php | public function game($gameId)
{
if ( ! isset($this->info['games'][$gameId]))
{
return null;
}
return $this->info['games'][$gameId];
} | [
"public",
"function",
"game",
"(",
"$",
"gameId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'games'",
"]",
"[",
"$",
"gameId",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"info",
"... | Get a game by the id.
@param int $gameId
@return Game|null | [
"Get",
"a",
"game",
"by",
"the",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/RecentGames.php#L33-L41 |
221,546 | CapMousse/React-Restify | src/Routing/Routes.php | Routes.addRoute | public function addRoute($method, $route, $callback)
{
$route = $this->router->addRoute(strtoupper($method), $this->prefix . '/' . $route, $callback);
$route->onAny(function($event, $arguments){
$this->emit($event, $arguments);
});
$this->routes[] = $route;
ret... | php | public function addRoute($method, $route, $callback)
{
$route = $this->router->addRoute(strtoupper($method), $this->prefix . '/' . $route, $callback);
$route->onAny(function($event, $arguments){
$this->emit($event, $arguments);
});
$this->routes[] = $route;
ret... | [
"public",
"function",
"addRoute",
"(",
"$",
"method",
",",
"$",
"route",
",",
"$",
"callback",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"router",
"->",
"addRoute",
"(",
"strtoupper",
"(",
"$",
"method",
")",
",",
"$",
"this",
"->",
"prefix",
... | Create a new route for the group
@param String $method
@param String $route
@param Callable $callback | [
"Create",
"a",
"new",
"route",
"for",
"the",
"group"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Routing/Routes.php#L51-L62 |
221,547 | CawaKharkov/laravel-balance | src/LaravelBalance/Services/BalanceService.php | BalanceService.canPay | public function canPay($amount, $userId)
{
$balance = config('laravel_balance.user')::find($userId)->balance();
return ($balance < $amount) ? false : true;
} | php | public function canPay($amount, $userId)
{
$balance = config('laravel_balance.user')::find($userId)->balance();
return ($balance < $amount) ? false : true;
} | [
"public",
"function",
"canPay",
"(",
"$",
"amount",
",",
"$",
"userId",
")",
"{",
"$",
"balance",
"=",
"config",
"(",
"'laravel_balance.user'",
")",
"::",
"find",
"(",
"$",
"userId",
")",
"->",
"balance",
"(",
")",
";",
"return",
"(",
"$",
"balance",
... | Check if user can pay for transaction
@param $amount
@param $userId
@return bool | [
"Check",
"if",
"user",
"can",
"pay",
"for",
"transaction"
] | 9c297dc9675527b4be96699671ae26e76475a466 | https://github.com/CawaKharkov/laravel-balance/blob/9c297dc9675527b4be96699671ae26e76475a466/src/LaravelBalance/Services/BalanceService.php#L53-L58 |
221,548 | paquettg/leaguewrap | src/LeagueWrap/Limit/Collection.php | Collection.hitLimits | public function hitLimits($region, $count = 1)
{
foreach ($this->limits as $limit)
{
if ($limit->getRegion() == $region &&
! $limit->hit($count)
)
{
return false;
}
}
return true;
} | php | public function hitLimits($region, $count = 1)
{
foreach ($this->limits as $limit)
{
if ($limit->getRegion() == $region &&
! $limit->hit($count)
)
{
return false;
}
}
return true;
} | [
"public",
"function",
"hitLimits",
"(",
"$",
"region",
",",
"$",
"count",
"=",
"1",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"limits",
"as",
"$",
"limit",
")",
"{",
"if",
"(",
"$",
"limit",
"->",
"getRegion",
"(",
")",
"==",
"$",
"region",
"&... | Hit the limit set for the given region.
@param string $region
@param int $count
@return bool | [
"Hit",
"the",
"limit",
"set",
"for",
"the",
"given",
"region",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Limit/Collection.php#L28-L41 |
221,549 | paquettg/leaguewrap | src/LeagueWrap/Limit/Collection.php | Collection.remainingHits | public function remainingHits()
{
$remaining = null;
foreach ($this->limits as $limit)
{
$hitsLeft = $limit->remaining();
if (is_null($remaining) ||
$hitsLeft < $remaining
)
{
$remaining = $hitsLeft;
}
}
return $remaining;
} | php | public function remainingHits()
{
$remaining = null;
foreach ($this->limits as $limit)
{
$hitsLeft = $limit->remaining();
if (is_null($remaining) ||
$hitsLeft < $remaining
)
{
$remaining = $hitsLeft;
}
}
return $remaining;
} | [
"public",
"function",
"remainingHits",
"(",
")",
"{",
"$",
"remaining",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"limits",
"as",
"$",
"limit",
")",
"{",
"$",
"hitsLeft",
"=",
"$",
"limit",
"->",
"remaining",
"(",
")",
";",
"if",
"(",
"i... | Returns the lowest | [
"Returns",
"the",
"lowest"
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Limit/Collection.php#L46-L61 |
221,550 | radphp/radphp | src/Network/Http/Response/Cookies.php | Cookies.set | public function set($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = false, $httpOnly = false)
{
if (!is_string($name)) {
throw new Cookie\Exception('The cookie name must be string');
}
if (!isset($this->cookies[$name])) {
$this->cookies[$name] =... | php | public function set($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = false, $httpOnly = false)
{
if (!is_string($name)) {
throw new Cookie\Exception('The cookie name must be string');
}
if (!isset($this->cookies[$name])) {
$this->cookies[$name] =... | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
",",
"$",
"expire",
"=",
"0",
",",
"$",
"path",
"=",
"'/'",
",",
"$",
"domain",
"=",
"''",
",",
"$",
"secure",
"=",
"false",
",",
"$",
"httpOnly",
"=",
"false",
")",
... | Sets a cookie to be sent at the end of the request This method
overrides any cookie set before with the same name
@param string $name The name of the cookie.
@param string $value The value of the cookie.
@param int $expire The time the cookie expires.
@param string $path The path on the server in which... | [
"Sets",
"a",
"cookie",
"to",
"be",
"sent",
"at",
"the",
"end",
"of",
"the",
"request",
"This",
"method",
"overrides",
"any",
"cookie",
"set",
"before",
"with",
"the",
"same",
"name"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Network/Http/Response/Cookies.php#L64-L83 |
221,551 | radphp/radphp | src/Network/Http/Response/Cookies.php | Cookies.get | public function get($name)
{
if (!is_string($name)) {
throw new Cookie\Exception('The cookie name must be string');
}
if (isset($this->cookies[$name])) {
$this->cookies[$name]->useEncryption($this->isUsingEncryption());
return $this->cookies[$name];
... | php | public function get($name)
{
if (!is_string($name)) {
throw new Cookie\Exception('The cookie name must be string');
}
if (isset($this->cookies[$name])) {
$this->cookies[$name]->useEncryption($this->isUsingEncryption());
return $this->cookies[$name];
... | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"Cookie",
"\\",
"Exception",
"(",
"'The cookie name must be string'",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
... | Gets a cookie from the bag
@param string $name
@return null|Cookie
@throws Cookie\Exception | [
"Gets",
"a",
"cookie",
"from",
"the",
"bag"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Network/Http/Response/Cookies.php#L93-L106 |
221,552 | neos/fluid | Classes/TYPO3/Fluid/View/TemplateView.php | TemplateView.getPartialRootPaths | protected function getPartialRootPaths()
{
if ($this->options['partialRootPaths'] !== null) {
return $this->options['partialRootPaths'];
}
/** @var $actionRequest \TYPO3\Flow\Mvc\ActionRequest */
$actionRequest = $this->controllerContext->getRequest();
return arra... | php | protected function getPartialRootPaths()
{
if ($this->options['partialRootPaths'] !== null) {
return $this->options['partialRootPaths'];
}
/** @var $actionRequest \TYPO3\Flow\Mvc\ActionRequest */
$actionRequest = $this->controllerContext->getRequest();
return arra... | [
"protected",
"function",
"getPartialRootPaths",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'partialRootPaths'",
"]",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"[",
"'partialRootPaths'",
"]",
";",
"}",
"/** @var $acti... | Resolves the partial root to be used inside other paths.
@return array Path(s) to partial root directory | [
"Resolves",
"the",
"partial",
"root",
"to",
"be",
"used",
"inside",
"other",
"paths",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/TemplateView.php#L143-L151 |
221,553 | neos/fluid | Classes/TYPO3/Fluid/View/TemplateView.php | TemplateView.getLayoutIdentifier | protected function getLayoutIdentifier($layoutName = 'Default')
{
$layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
$prefix = 'layout_' . $layoutName;
return $this->createIdentifierForFile($layoutPathAndFilename, $prefix);
} | php | protected function getLayoutIdentifier($layoutName = 'Default')
{
$layoutPathAndFilename = $this->getLayoutPathAndFilename($layoutName);
$prefix = 'layout_' . $layoutName;
return $this->createIdentifierForFile($layoutPathAndFilename, $prefix);
} | [
"protected",
"function",
"getLayoutIdentifier",
"(",
"$",
"layoutName",
"=",
"'Default'",
")",
"{",
"$",
"layoutPathAndFilename",
"=",
"$",
"this",
"->",
"getLayoutPathAndFilename",
"(",
"$",
"layoutName",
")",
";",
"$",
"prefix",
"=",
"'layout_'",
".",
"$",
"... | Returns a unique identifier for the resolved layout file.
This identifier is based on the template path and last modification date
@param string $layoutName The name of the layout
@return string layout identifier | [
"Returns",
"a",
"unique",
"identifier",
"for",
"the",
"resolved",
"layout",
"file",
".",
"This",
"identifier",
"is",
"based",
"on",
"the",
"template",
"path",
"and",
"last",
"modification",
"date"
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/TemplateView.php#L270-L275 |
221,554 | neos/fluid | Classes/TYPO3/Fluid/View/TemplateView.php | TemplateView.getPartialIdentifier | protected function getPartialIdentifier($partialName)
{
$partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
$prefix = 'partial_' . $partialName;
return $this->createIdentifierForFile($partialPathAndFilename, $prefix);
} | php | protected function getPartialIdentifier($partialName)
{
$partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
$prefix = 'partial_' . $partialName;
return $this->createIdentifierForFile($partialPathAndFilename, $prefix);
} | [
"protected",
"function",
"getPartialIdentifier",
"(",
"$",
"partialName",
")",
"{",
"$",
"partialPathAndFilename",
"=",
"$",
"this",
"->",
"getPartialPathAndFilename",
"(",
"$",
"partialName",
")",
";",
"$",
"prefix",
"=",
"'partial_'",
".",
"$",
"partialName",
... | Returns a unique identifier for the resolved partial file.
This identifier is based on the template path and last modification date
@param string $partialName The name of the partial
@return string partial identifier | [
"Returns",
"a",
"unique",
"identifier",
"for",
"the",
"resolved",
"partial",
"file",
".",
"This",
"identifier",
"is",
"based",
"on",
"the",
"template",
"path",
"and",
"last",
"modification",
"date"
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/TemplateView.php#L334-L339 |
221,555 | neos/fluid | Classes/TYPO3/Fluid/View/TemplateView.php | TemplateView.getPartialSource | protected function getPartialSource($partialName)
{
$partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
$partialSource = Files::getFileContents($partialPathAndFilename, FILE_TEXT);
if ($partialSource === false) {
throw new Exception\InvalidTemplateResourceEx... | php | protected function getPartialSource($partialName)
{
$partialPathAndFilename = $this->getPartialPathAndFilename($partialName);
$partialSource = Files::getFileContents($partialPathAndFilename, FILE_TEXT);
if ($partialSource === false) {
throw new Exception\InvalidTemplateResourceEx... | [
"protected",
"function",
"getPartialSource",
"(",
"$",
"partialName",
")",
"{",
"$",
"partialPathAndFilename",
"=",
"$",
"this",
"->",
"getPartialPathAndFilename",
"(",
"$",
"partialName",
")",
";",
"$",
"partialSource",
"=",
"Files",
"::",
"getFileContents",
"(",... | Figures out which partial to use.
@param string $partialName The name of the partial
@return string contents of the partial template
@throws Exception\InvalidTemplateResourceException | [
"Figures",
"out",
"which",
"partial",
"to",
"use",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/TemplateView.php#L348-L356 |
221,556 | neos/fluid | Classes/TYPO3/Fluid/View/TemplateView.php | TemplateView.canRender | public function canRender(ControllerContext $controllerContext)
{
$this->setControllerContext($controllerContext);
try {
$this->getTemplateSource();
return true;
} catch (Exception\InvalidTemplateResourceException $e) {
return false;
}
} | php | public function canRender(ControllerContext $controllerContext)
{
$this->setControllerContext($controllerContext);
try {
$this->getTemplateSource();
return true;
} catch (Exception\InvalidTemplateResourceException $e) {
return false;
}
} | [
"public",
"function",
"canRender",
"(",
"ControllerContext",
"$",
"controllerContext",
")",
"{",
"$",
"this",
"->",
"setControllerContext",
"(",
"$",
"controllerContext",
")",
";",
"try",
"{",
"$",
"this",
"->",
"getTemplateSource",
"(",
")",
";",
"return",
"t... | Checks whether a template can be resolved for the current request context.
@param ControllerContext $controllerContext Controller context which is available inside the view
@return boolean | [
"Checks",
"whether",
"a",
"template",
"can",
"be",
"resolved",
"for",
"the",
"current",
"request",
"context",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/View/TemplateView.php#L383-L392 |
221,557 | paquettg/leaguewrap | src/LeagueWrap/Dto/StaticData/Block.php | Block.item | public function item($key)
{
if ( ! isset($this->info['items'][$key]))
{
return null;
}
return $this->info['items'][$key];
} | php | public function item($key)
{
if ( ! isset($this->info['items'][$key]))
{
return null;
}
return $this->info['items'][$key];
} | [
"public",
"function",
"item",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'items'",
"]",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"info",
"[",
... | Gets the item by key.
@param mixed $key
@return null | [
"Gets",
"the",
"item",
"by",
"key",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/StaticData/Block.php#L33-L41 |
221,558 | radphp/radphp | src/Core/Action.php | Action.forward | public function forward($uri, $method = Request::METHOD_GET)
{
if ('cli' === PHP_SAPI) {
throw new BaseException('You can not call forward method in cli mode.');
}
$request = $this->getRequest()->withMethod($method);
$this->getContainer()->setShared('request', $request)... | php | public function forward($uri, $method = Request::METHOD_GET)
{
if ('cli' === PHP_SAPI) {
throw new BaseException('You can not call forward method in cli mode.');
}
$request = $this->getRequest()->withMethod($method);
$this->getContainer()->setShared('request', $request)... | [
"public",
"function",
"forward",
"(",
"$",
"uri",
",",
"$",
"method",
"=",
"Request",
"::",
"METHOD_GET",
")",
"{",
"if",
"(",
"'cli'",
"===",
"PHP_SAPI",
")",
"{",
"throw",
"new",
"BaseException",
"(",
"'You can not call forward method in cli mode.'",
")",
";... | Forward to other action without redirect
@param string $uri
@param string $method
@return Response
@throws BaseException | [
"Forward",
"to",
"other",
"action",
"without",
"redirect"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Core/Action.php#L186-L220 |
221,559 | radphp/radphp | src/Core/Action.php | Action.subscribe | public function subscribe(EventManager $eventManager)
{
$eventManager->attach(self::EVENT_BEFORE_WEB_METHOD, [$this, 'beforeWebMethod'])
->attach(self::EVENT_AFTER_WEB_METHOD, [$this, 'afterWebMethod'])
->attach(self::EVENT_BEFORE_CLI_METHOD, [$this, 'beforeCLiMethod'])
-... | php | public function subscribe(EventManager $eventManager)
{
$eventManager->attach(self::EVENT_BEFORE_WEB_METHOD, [$this, 'beforeWebMethod'])
->attach(self::EVENT_AFTER_WEB_METHOD, [$this, 'afterWebMethod'])
->attach(self::EVENT_BEFORE_CLI_METHOD, [$this, 'beforeCLiMethod'])
-... | [
"public",
"function",
"subscribe",
"(",
"EventManager",
"$",
"eventManager",
")",
"{",
"$",
"eventManager",
"->",
"attach",
"(",
"self",
"::",
"EVENT_BEFORE_WEB_METHOD",
",",
"[",
"$",
"this",
",",
"'beforeWebMethod'",
"]",
")",
"->",
"attach",
"(",
"self",
... | Subscribe event listener
@param EventManager $eventManager
@return mixed | [
"Subscribe",
"event",
"listener"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Core/Action.php#L229-L235 |
221,560 | paquettg/leaguewrap | src/LeagueWrap/Dto/MatchList.php | MatchList.match | public function match($matchPosition)
{
if ( ! isset($this->info['matches'][$matchPosition]))
{
return null;
}
return $this->info['matches'][$matchPosition];
} | php | public function match($matchPosition)
{
if ( ! isset($this->info['matches'][$matchPosition]))
{
return null;
}
return $this->info['matches'][$matchPosition];
} | [
"public",
"function",
"match",
"(",
"$",
"matchPosition",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'matches'",
"]",
"[",
"$",
"matchPosition",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"-... | Get a match by position.
@param int $matchPosition
@return Match|null | [
"Get",
"a",
"match",
"by",
"position",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/MatchList.php#L46-L54 |
221,561 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/Form/SelectViewHelper.php | SelectViewHelper.getTranslatedLabel | protected function getTranslatedLabel($value, $label)
{
$translationConfiguration = $this->arguments['translate'];
$translateBy = isset($translationConfiguration['by']) ? $translationConfiguration['by'] : 'id';
$sourceName = isset($translationConfiguration['source']) ? $translationConfigura... | php | protected function getTranslatedLabel($value, $label)
{
$translationConfiguration = $this->arguments['translate'];
$translateBy = isset($translationConfiguration['by']) ? $translationConfiguration['by'] : 'id';
$sourceName = isset($translationConfiguration['source']) ? $translationConfigura... | [
"protected",
"function",
"getTranslatedLabel",
"(",
"$",
"value",
",",
"$",
"label",
")",
"{",
"$",
"translationConfiguration",
"=",
"$",
"this",
"->",
"arguments",
"[",
"'translate'",
"]",
";",
"$",
"translateBy",
"=",
"isset",
"(",
"$",
"translationConfigura... | Returns a translated version of the given label
@param string $value option tag value
@param string $label option tag label
@return string
@throws ViewHelper\Exception
@throws Fluid\Exception | [
"Returns",
"a",
"translated",
"version",
"of",
"the",
"given",
"label"
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/Form/SelectViewHelper.php#L372-L408 |
221,562 | radphp/radphp | src/OAuthentication/OAuthProviderFactory.php | OAuthProviderFactory.create | public static function create($oAuthProvider)
{
if (strpos($oAuthProvider, '\\') !== false) {
if (class_exists($oAuthProvider)) {
$providerInstance = new $oAuthProvider();
if (!($providerInstance instanceof AbstractOAuthProvider)) {
throw new E... | php | public static function create($oAuthProvider)
{
if (strpos($oAuthProvider, '\\') !== false) {
if (class_exists($oAuthProvider)) {
$providerInstance = new $oAuthProvider();
if (!($providerInstance instanceof AbstractOAuthProvider)) {
throw new E... | [
"public",
"static",
"function",
"create",
"(",
"$",
"oAuthProvider",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"oAuthProvider",
",",
"'\\\\'",
")",
"!==",
"false",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"oAuthProvider",
")",
")",
"{",
"$",
"prov... | Create OAuth provider
@param string $oAuthProvider
@return AbstractOAuthProvider
@throws Exception | [
"Create",
"OAuth",
"provider"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/OAuthentication/OAuthProviderFactory.php#L22-L50 |
221,563 | twizoapi/lib-api-php | examples/util/Bootstrap.php | Bootstrap.init | public function init()
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Load composer auto loader or when not available the Twizo auto loader
if (file_exists($this->baseDir . '/vendor/autoload.php')) {
require_once($this->baseDir . '/vendor/autoload.php');
... | php | public function init()
{
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Load composer auto loader or when not available the Twizo auto loader
if (file_exists($this->baseDir . '/vendor/autoload.php')) {
require_once($this->baseDir . '/vendor/autoload.php');
... | [
"public",
"function",
"init",
"(",
")",
"{",
"error_reporting",
"(",
"E_ALL",
")",
";",
"ini_set",
"(",
"'display_errors'",
",",
"1",
")",
";",
"// Load composer auto loader or when not available the Twizo auto loader",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"-... | Configure php to display errors and load all required file | [
"Configure",
"php",
"to",
"display",
"errors",
"and",
"load",
"all",
"required",
"file"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/examples/util/Bootstrap.php#L38-L51 |
221,564 | twizoapi/lib-api-php | examples/util/Bootstrap.php | Bootstrap.loadConfig | public function loadConfig()
{
// Load / create config file
if (file_exists($this->baseDir . '/examples/config.php')) {
include_once($this->baseDir . '/examples/config.php');
} else {
define('SECRET', readline('Secret: '));
define('API_HOST', readline('Api... | php | public function loadConfig()
{
// Load / create config file
if (file_exists($this->baseDir . '/examples/config.php')) {
include_once($this->baseDir . '/examples/config.php');
} else {
define('SECRET', readline('Secret: '));
define('API_HOST', readline('Api... | [
"public",
"function",
"loadConfig",
"(",
")",
"{",
"// Load / create config file",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"baseDir",
".",
"'/examples/config.php'",
")",
")",
"{",
"include_once",
"(",
"$",
"this",
"->",
"baseDir",
".",
"'/examples/conf... | Load config file when it exists; otherwise create it by asking the user on command line for the required files | [
"Load",
"config",
"file",
"when",
"it",
"exists",
";",
"otherwise",
"create",
"it",
"by",
"asking",
"the",
"user",
"on",
"command",
"line",
"for",
"the",
"required",
"files"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/examples/util/Bootstrap.php#L56-L78 |
221,565 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/Format/BytesViewHelper.php | BytesViewHelper.render | public function render($value = null, $decimals = 0, $decimalSeparator = '.', $thousandsSeparator = ',')
{
return self::renderStatic(array('value' => $value, 'decimals' => $decimals, 'decimalSeparator' => $decimalSeparator, 'thousandsSeparator' => $thousandsSeparator), $this->buildRenderChildrenClosure(), $... | php | public function render($value = null, $decimals = 0, $decimalSeparator = '.', $thousandsSeparator = ',')
{
return self::renderStatic(array('value' => $value, 'decimals' => $decimals, 'decimalSeparator' => $decimalSeparator, 'thousandsSeparator' => $thousandsSeparator), $this->buildRenderChildrenClosure(), $... | [
"public",
"function",
"render",
"(",
"$",
"value",
"=",
"null",
",",
"$",
"decimals",
"=",
"0",
",",
"$",
"decimalSeparator",
"=",
"'.'",
",",
"$",
"thousandsSeparator",
"=",
"','",
")",
"{",
"return",
"self",
"::",
"renderStatic",
"(",
"array",
"(",
"... | Render the supplied byte count as a human readable string.
@param integer $value The incoming data to convert, or NULL if VH children should be used
@param integer $decimals The number of digits after the decimal point
@param string $decimalSeparator The decimal point character
@param string $thousandsSeparator The ch... | [
"Render",
"the",
"supplied",
"byte",
"count",
"as",
"a",
"human",
"readable",
"string",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/Format/BytesViewHelper.php#L54-L57 |
221,566 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/LayoutViewHelper.php | LayoutViewHelper.postParseEvent | public static function postParseEvent(ViewHelperNode $syntaxTreeNode, array $viewHelperArguments, TemplateVariableContainer $variableContainer)
{
if (isset($viewHelperArguments['name'])) {
$layoutNameNode = $viewHelperArguments['name'];
} else {
$layoutNameNode = new TextNode... | php | public static function postParseEvent(ViewHelperNode $syntaxTreeNode, array $viewHelperArguments, TemplateVariableContainer $variableContainer)
{
if (isset($viewHelperArguments['name'])) {
$layoutNameNode = $viewHelperArguments['name'];
} else {
$layoutNameNode = new TextNode... | [
"public",
"static",
"function",
"postParseEvent",
"(",
"ViewHelperNode",
"$",
"syntaxTreeNode",
",",
"array",
"$",
"viewHelperArguments",
",",
"TemplateVariableContainer",
"$",
"variableContainer",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"viewHelperArguments",
"[",
... | On the post parse event, add the "layoutName" variable to the variable container so it can be used by the TemplateView.
@param ViewHelperNode $syntaxTreeNode
@param array $viewHelperArguments
@param TemplateVariableContainer $variableContainer
@return void | [
"On",
"the",
"post",
"parse",
"event",
"add",
"the",
"layoutName",
"variable",
"to",
"the",
"variable",
"container",
"so",
"it",
"can",
"be",
"used",
"by",
"the",
"TemplateView",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/LayoutViewHelper.php#L55-L64 |
221,567 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/FlashMessagesViewHelper.php | FlashMessagesViewHelper.renderAsList | protected function renderAsList(array $flashMessages)
{
$flashMessagesClass = $this->arguments['class'] !== null ? $this->arguments['class'] : 'flashmessages';
$tagContent = '';
/** @var $singleFlashMessage Message */
foreach ($flashMessages as $singleFlashMessage) {
$sev... | php | protected function renderAsList(array $flashMessages)
{
$flashMessagesClass = $this->arguments['class'] !== null ? $this->arguments['class'] : 'flashmessages';
$tagContent = '';
/** @var $singleFlashMessage Message */
foreach ($flashMessages as $singleFlashMessage) {
$sev... | [
"protected",
"function",
"renderAsList",
"(",
"array",
"$",
"flashMessages",
")",
"{",
"$",
"flashMessagesClass",
"=",
"$",
"this",
"->",
"arguments",
"[",
"'class'",
"]",
"!==",
"null",
"?",
"$",
"this",
"->",
"arguments",
"[",
"'class'",
"]",
":",
"'flas... | Render the flash messages as unsorted list. This is triggered if no "as" argument is given
to the ViewHelper.
@param array<Message> $flashMessages
@return string | [
"Render",
"the",
"flash",
"messages",
"as",
"unsorted",
"list",
".",
"This",
"is",
"triggered",
"if",
"no",
"as",
"argument",
"is",
"given",
"to",
"the",
"ViewHelper",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/FlashMessagesViewHelper.php#L110-L127 |
221,568 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/FlashMessagesViewHelper.php | FlashMessagesViewHelper.renderFromTemplate | protected function renderFromTemplate(array $flashMessages, $as)
{
$templateVariableContainer = $this->renderingContext->getTemplateVariableContainer();
$templateVariableContainer->add($as, $flashMessages);
$content = $this->renderChildren();
$templateVariableContainer->remove($as);
... | php | protected function renderFromTemplate(array $flashMessages, $as)
{
$templateVariableContainer = $this->renderingContext->getTemplateVariableContainer();
$templateVariableContainer->add($as, $flashMessages);
$content = $this->renderChildren();
$templateVariableContainer->remove($as);
... | [
"protected",
"function",
"renderFromTemplate",
"(",
"array",
"$",
"flashMessages",
",",
"$",
"as",
")",
"{",
"$",
"templateVariableContainer",
"=",
"$",
"this",
"->",
"renderingContext",
"->",
"getTemplateVariableContainer",
"(",
")",
";",
"$",
"templateVariableCont... | Defer the rendering of Flash Messages to the template. In this case,
the flash messages are stored in the template inside the variable specified
in "as".
@param array $flashMessages
@param string $as
@return string | [
"Defer",
"the",
"rendering",
"of",
"Flash",
"Messages",
"to",
"the",
"template",
".",
"In",
"this",
"case",
"the",
"flash",
"messages",
"are",
"stored",
"in",
"the",
"template",
"inside",
"the",
"variable",
"specified",
"in",
"as",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/FlashMessagesViewHelper.php#L138-L146 |
221,569 | paquettg/leaguewrap | src/LeagueWrap/Dto/CurrentGame.php | CurrentGame.ban | public function ban($pickTurn)
{
$bans = $this->info['bannedChampions'];
if (isset($bans[$pickTurn]))
{
return $bans[$pickTurn];
}
return null;
} | php | public function ban($pickTurn)
{
$bans = $this->info['bannedChampions'];
if (isset($bans[$pickTurn]))
{
return $bans[$pickTurn];
}
return null;
} | [
"public",
"function",
"ban",
"(",
"$",
"pickTurn",
")",
"{",
"$",
"bans",
"=",
"$",
"this",
"->",
"info",
"[",
"'bannedChampions'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"bans",
"[",
"$",
"pickTurn",
"]",
")",
")",
"{",
"return",
"$",
"bans",
"... | get a ban from the current game
@param $pickTurn
@return \LeagueWrap\Dto\Ban | [
"get",
"a",
"ban",
"from",
"the",
"current",
"game"
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/CurrentGame.php#L57-L66 |
221,570 | paquettg/leaguewrap | src/LeagueWrap/Dto/CurrentGame.php | CurrentGame.participant | public function participant($summonerId)
{
$participant = $this->info['participants'];
if (isset($participant[$summonerId]))
{
return $participant[$summonerId];
}
return null;
} | php | public function participant($summonerId)
{
$participant = $this->info['participants'];
if (isset($participant[$summonerId]))
{
return $participant[$summonerId];
}
return null;
} | [
"public",
"function",
"participant",
"(",
"$",
"summonerId",
")",
"{",
"$",
"participant",
"=",
"$",
"this",
"->",
"info",
"[",
"'participants'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"participant",
"[",
"$",
"summonerId",
"]",
")",
")",
"{",
"return... | Gets the participant by the given summoner id.
@param $summonerId
@return \LeagueWrap\Dto\CurrentGameParticipant|null | [
"Gets",
"the",
"participant",
"by",
"the",
"given",
"summoner",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/CurrentGame.php#L74-L83 |
221,571 | paquettg/leaguewrap | src/LeagueWrap/Api/League.php | League.challenger | public function challenger($type = 'RANKED_SOLO_5x5')
{
$info = $this->request('league/challenger', ['type' => $type]);
$info['id'] = null;
return $this->attachStaticDataToDto(new Dto\League($info));
} | php | public function challenger($type = 'RANKED_SOLO_5x5')
{
$info = $this->request('league/challenger', ['type' => $type]);
$info['id'] = null;
return $this->attachStaticDataToDto(new Dto\League($info));
} | [
"public",
"function",
"challenger",
"(",
"$",
"type",
"=",
"'RANKED_SOLO_5x5'",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"request",
"(",
"'league/challenger'",
",",
"[",
"'type'",
"=>",
"$",
"type",
"]",
")",
";",
"$",
"info",
"[",
"'id'",
"]",
... | Gets the league information for the challenger teams.
@param string $type
@return array | [
"Gets",
"the",
"league",
"information",
"for",
"the",
"challenger",
"teams",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/League.php#L118-L124 |
221,572 | neos/fluid | Classes/TYPO3/Fluid/Core/Compiler/AbstractCompiledTemplate.php | AbstractCompiledTemplate.getViewHelper | public function getViewHelper($uniqueCounter, RenderingContextInterface $renderingContext, $viewHelperName)
{
if (Bootstrap::$staticObjectManager->getScope($viewHelperName) === Configuration::SCOPE_SINGLETON) {
// if ViewHelper is Singleton, do NOT instantiate with NEW, but re-use it.
... | php | public function getViewHelper($uniqueCounter, RenderingContextInterface $renderingContext, $viewHelperName)
{
if (Bootstrap::$staticObjectManager->getScope($viewHelperName) === Configuration::SCOPE_SINGLETON) {
// if ViewHelper is Singleton, do NOT instantiate with NEW, but re-use it.
... | [
"public",
"function",
"getViewHelper",
"(",
"$",
"uniqueCounter",
",",
"RenderingContextInterface",
"$",
"renderingContext",
",",
"$",
"viewHelperName",
")",
"{",
"if",
"(",
"Bootstrap",
"::",
"$",
"staticObjectManager",
"->",
"getScope",
"(",
"$",
"viewHelperName",... | Public such that it is callable from within closures
@param integer $uniqueCounter
@param RenderingContextInterface $renderingContext
@param string $viewHelperName
@return AbstractViewHelper
@Flow\Internal | [
"Public",
"such",
"that",
"it",
"is",
"callable",
"from",
"within",
"closures"
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/Core/Compiler/AbstractCompiledTemplate.php#L42-L69 |
221,573 | twizoapi/lib-api-php | src/Entity/Sms.php | Sms.isBinary | protected function isBinary()
{
$binary = false;
if (($this->dcs & 200) === 0) {
$binary = (($this->dcs & 4) > 0);
} elseif (($this->dcs & 248) === 240) {
$binary = (($this->dcs & 4) > 0);
}
return $binary;
} | php | protected function isBinary()
{
$binary = false;
if (($this->dcs & 200) === 0) {
$binary = (($this->dcs & 4) > 0);
} elseif (($this->dcs & 248) === 240) {
$binary = (($this->dcs & 4) > 0);
}
return $binary;
} | [
"protected",
"function",
"isBinary",
"(",
")",
"{",
"$",
"binary",
"=",
"false",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"dcs",
"&",
"200",
")",
"===",
"0",
")",
"{",
"$",
"binary",
"=",
"(",
"(",
"$",
"this",
"->",
"dcs",
"&",
"4",
")",
">",... | Return true if the sms has been configured as binary message
@return bool | [
"Return",
"true",
"if",
"the",
"sms",
"has",
"been",
"configured",
"as",
"binary",
"message"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Sms.php#L382-L393 |
221,574 | twizoapi/lib-api-php | src/Entity/Sms.php | Sms.sendSimple | public function sendSimple()
{
$this->setType(self::TYPE_SIMPLE);
$response = $this->sendApiCall(self::ACTION_CREATE, $this->getCreateUrl());
if (!isset($response->getBody()['_embedded']['items'])) {
throw new Exception('Invalid response returned from server', Exception::INVALID... | php | public function sendSimple()
{
$this->setType(self::TYPE_SIMPLE);
$response = $this->sendApiCall(self::ACTION_CREATE, $this->getCreateUrl());
if (!isset($response->getBody()['_embedded']['items'])) {
throw new Exception('Invalid response returned from server', Exception::INVALID... | [
"public",
"function",
"sendSimple",
"(",
")",
"{",
"$",
"this",
"->",
"setType",
"(",
"self",
"::",
"TYPE_SIMPLE",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"sendApiCall",
"(",
"self",
"::",
"ACTION_CREATE",
",",
"$",
"this",
"->",
"getCreateUrl... | Automatically split multi part sms messages and return result sms messages
@return Sms[]
@throws Exception | [
"Automatically",
"split",
"multi",
"part",
"sms",
"messages",
"and",
"return",
"result",
"sms",
"messages"
] | 2e545d859784184138332c9b5bfc063940e3c926 | https://github.com/twizoapi/lib-api-php/blob/2e545d859784184138332c9b5bfc063940e3c926/src/Entity/Sms.php#L431-L448 |
221,575 | neos/fluid | Classes/TYPO3/Fluid/ViewHelpers/Widget/UriViewHelper.php | UriViewHelper.getAjaxUri | protected function getAjaxUri()
{
$action = $this->arguments['action'];
$arguments = $this->arguments['arguments'];
if ($action === null) {
$action = $this->controllerContext->getRequest()->getControllerActionName();
}
$arguments['@action'] = $action;
if ... | php | protected function getAjaxUri()
{
$action = $this->arguments['action'];
$arguments = $this->arguments['arguments'];
if ($action === null) {
$action = $this->controllerContext->getRequest()->getControllerActionName();
}
$arguments['@action'] = $action;
if ... | [
"protected",
"function",
"getAjaxUri",
"(",
")",
"{",
"$",
"action",
"=",
"$",
"this",
"->",
"arguments",
"[",
"'action'",
"]",
";",
"$",
"arguments",
"=",
"$",
"this",
"->",
"arguments",
"[",
"'arguments'",
"]",
";",
"if",
"(",
"$",
"action",
"===",
... | Get the URI for an AJAX Request.
@return string the AJAX URI
@throws WidgetContextNotFoundException | [
"Get",
"the",
"URI",
"for",
"an",
"AJAX",
"Request",
"."
] | ded6be84a9487f7e0e204703a30b12d2c58c0efd | https://github.com/neos/fluid/blob/ded6be84a9487f7e0e204703a30b12d2c58c0efd/Classes/TYPO3/Fluid/ViewHelpers/Widget/UriViewHelper.php#L73-L97 |
221,576 | radphp/radphp | src/Events/Event.php | Event.stopImmediatePropagation | public function stopImmediatePropagation()
{
if ($this->isCancelable() === false) {
throw new Exception(sprintf('Event "%s" not cancelable.', $this->type));
}
$this->immediateStopped = true;
} | php | public function stopImmediatePropagation()
{
if ($this->isCancelable() === false) {
throw new Exception(sprintf('Event "%s" not cancelable.', $this->type));
}
$this->immediateStopped = true;
} | [
"public",
"function",
"stopImmediatePropagation",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isCancelable",
"(",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",
"'Event \"%s\" not cancelable.'",
",",
"$",
"this",
"->",
"ty... | Keeps the rest of the handlers from being executed and prevents the event
@throws Exception | [
"Keeps",
"the",
"rest",
"of",
"the",
"handlers",
"from",
"being",
"executed",
"and",
"prevents",
"the",
"event"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/Events/Event.php#L50-L57 |
221,577 | paquettg/leaguewrap | src/LeagueWrap/Api/Stats.php | Stats.summary | public function summary($identity)
{
$summonerId = $this->extractId($identity);
$params = [];
if ( ! is_null($this->season))
{
$params['season'] = $this->season;
}
$info = $this->request('stats/by-summoner/'.$summonerId.'/summary', $params);
$stats = new PlayerStatsSummaryList($info);
$stats = $th... | php | public function summary($identity)
{
$summonerId = $this->extractId($identity);
$params = [];
if ( ! is_null($this->season))
{
$params['season'] = $this->season;
}
$info = $this->request('stats/by-summoner/'.$summonerId.'/summary', $params);
$stats = new PlayerStatsSummaryList($info);
$stats = $th... | [
"public",
"function",
"summary",
"(",
"$",
"identity",
")",
"{",
"$",
"summonerId",
"=",
"$",
"this",
"->",
"extractId",
"(",
"$",
"identity",
")",
";",
"$",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"season",... | Gets the stats summary by summoner id.
@param mixed $identity
@return array | [
"Gets",
"the",
"stats",
"summary",
"by",
"summoner",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/Stats.php#L79-L95 |
221,578 | paquettg/leaguewrap | src/LeagueWrap/Api/Stats.php | Stats.ranked | public function ranked($identity)
{
$summonerId = $this->extractId($identity);
$params = [];
if ( ! is_null($this->season))
{
$params['season'] = $this->season;
}
$info = $this->request('stats/by-summoner/'.$summonerId.'/ranked', $params);
$stats = $this->attachStaticDataToDto(new RankedStats($info)... | php | public function ranked($identity)
{
$summonerId = $this->extractId($identity);
$params = [];
if ( ! is_null($this->season))
{
$params['season'] = $this->season;
}
$info = $this->request('stats/by-summoner/'.$summonerId.'/ranked', $params);
$stats = $this->attachStaticDataToDto(new RankedStats($info)... | [
"public",
"function",
"ranked",
"(",
"$",
"identity",
")",
"{",
"$",
"summonerId",
"=",
"$",
"this",
"->",
"extractId",
"(",
"$",
"identity",
")",
";",
"$",
"params",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"season",
... | Gets the stats for ranked queues only by summary id.
@param mixed $identity
@return array | [
"Gets",
"the",
"stats",
"for",
"ranked",
"queues",
"only",
"by",
"summary",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/Stats.php#L103-L118 |
221,579 | paquettg/leaguewrap | src/LeagueWrap/StaticApi.php | StaticApi.mount | public static function mount()
{
foreach (self::$staticProxy as $staticProxy)
{
$staticProxyObject = '\\LeagueWrap\\StaticProxy\\Static'.$staticProxy;
// mount it
$staticProxyObject::mount();
// freshen it up
$staticProxyObject::fresh();
}
} | php | public static function mount()
{
foreach (self::$staticProxy as $staticProxy)
{
$staticProxyObject = '\\LeagueWrap\\StaticProxy\\Static'.$staticProxy;
// mount it
$staticProxyObject::mount();
// freshen it up
$staticProxyObject::fresh();
}
} | [
"public",
"static",
"function",
"mount",
"(",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"staticProxy",
"as",
"$",
"staticProxy",
")",
"{",
"$",
"staticProxyObject",
"=",
"'\\\\LeagueWrap\\\\StaticProxy\\\\Static'",
".",
"$",
"staticProxy",
";",
"// mount it",
... | Mount all the static static proxys found in the StaticProxy directory.
@return void | [
"Mount",
"all",
"the",
"static",
"static",
"proxys",
"found",
"in",
"the",
"StaticProxy",
"directory",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/StaticApi.php#L27-L37 |
221,580 | radphp/radphp | src/OAuthentication/User.php | User.get | public function get($key)
{
if (array_key_exists($key, $this->container)) {
return $this->container[$key];
}
return null;
} | php | public function get($key)
{
if (array_key_exists($key, $this->container)) {
return $this->container[$key];
}
return null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"container",
")",
")",
"{",
"return",
"$",
"this",
"->",
"container",
"[",
"$",
"key",
"]",
";",
"}",
"return",
"null",
... | Get user detail
@param string $key
@return null|mixed | [
"Get",
"user",
"detail"
] | 2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a | https://github.com/radphp/radphp/blob/2cbde2c12dd7204b1aba3f8a6e351b287ae85f0a/src/OAuthentication/User.php#L168-L175 |
221,581 | paquettg/leaguewrap | src/LeagueWrap/Dto/Match.php | Match.participant | public function participant($participantId)
{
$participant = $this->info['participants'];
if (isset($participant[$participantId]))
{
return $participant[$participantId];
}
return null;
} | php | public function participant($participantId)
{
$participant = $this->info['participants'];
if (isset($participant[$participantId]))
{
return $participant[$participantId];
}
return null;
} | [
"public",
"function",
"participant",
"(",
"$",
"participantId",
")",
"{",
"$",
"participant",
"=",
"$",
"this",
"->",
"info",
"[",
"'participants'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"participant",
"[",
"$",
"participantId",
"]",
")",
")",
"{",
"... | Attempts to get a participant from this match.
@param int $participantId
@return Participant|null | [
"Attempts",
"to",
"get",
"a",
"participant",
"from",
"this",
"match",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/Match.php#L80-L89 |
221,582 | paquettg/leaguewrap | src/LeagueWrap/Dto/Match.php | Match.identity | public function identity($participantId)
{
$participantIdentity = $this->info['participantIdentities'];
if (isset($participantIdentity[$participantId]))
{
return $participantIdentity[$participantId];
}
return null;
} | php | public function identity($participantId)
{
$participantIdentity = $this->info['participantIdentities'];
if (isset($participantIdentity[$participantId]))
{
return $participantIdentity[$participantId];
}
return null;
} | [
"public",
"function",
"identity",
"(",
"$",
"participantId",
")",
"{",
"$",
"participantIdentity",
"=",
"$",
"this",
"->",
"info",
"[",
"'participantIdentities'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"participantIdentity",
"[",
"$",
"participantId",
"]",
... | Attempts to get a participant identity from this match.
@param int $participantId
@return ParticipantIdentity|null | [
"Attempts",
"to",
"get",
"a",
"participant",
"identity",
"from",
"this",
"match",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/Match.php#L97-L106 |
221,583 | paquettg/leaguewrap | src/LeagueWrap/Dto/Match.php | Match.team | public function team($teamId)
{
$team = $this->info['teams'];
if (isset($team[$teamId]))
{
return $team[$teamId];
}
return null;
} | php | public function team($teamId)
{
$team = $this->info['teams'];
if (isset($team[$teamId]))
{
return $team[$teamId];
}
return null;
} | [
"public",
"function",
"team",
"(",
"$",
"teamId",
")",
"{",
"$",
"team",
"=",
"$",
"this",
"->",
"info",
"[",
"'teams'",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"team",
"[",
"$",
"teamId",
"]",
")",
")",
"{",
"return",
"$",
"team",
"[",
"$",
... | Attempts to get a team from this match.
@param int $teamId
@return Team|null | [
"Attempts",
"to",
"get",
"a",
"team",
"from",
"this",
"match",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/Match.php#L114-L123 |
221,584 | CapMousse/React-Restify | src/Http/Request.php | Request.getHeaders | public function getHeaders()
{
$headers = array_change_key_case($this->httpRequest->getHeaders(), CASE_LOWER);
foreach ($headers as $header) {
$header = array_map(function ($value) {
return strtolower($value);
}, $header);
}
return $headers;
... | php | public function getHeaders()
{
$headers = array_change_key_case($this->httpRequest->getHeaders(), CASE_LOWER);
foreach ($headers as $header) {
$header = array_map(function ($value) {
return strtolower($value);
}, $header);
}
return $headers;
... | [
"public",
"function",
"getHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"array_change_key_case",
"(",
"$",
"this",
"->",
"httpRequest",
"->",
"getHeaders",
"(",
")",
",",
"CASE_LOWER",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
")",
"... | Get formated headers
@return array | [
"Get",
"formated",
"headers"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Http/Request.php#L49-L60 |
221,585 | CapMousse/React-Restify | src/Http/Request.php | Request.onEnd | private function onEnd($dataResult)
{
if ($dataResult === null) return $this->emit('end');
if ($this->isJson()) $this->parseJson($dataResult);
else $this->parseStr($dataResult);
} | php | private function onEnd($dataResult)
{
if ($dataResult === null) return $this->emit('end');
if ($this->isJson()) $this->parseJson($dataResult);
else $this->parseStr($dataResult);
} | [
"private",
"function",
"onEnd",
"(",
"$",
"dataResult",
")",
"{",
"if",
"(",
"$",
"dataResult",
"===",
"null",
")",
"return",
"$",
"this",
"->",
"emit",
"(",
"'end'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isJson",
"(",
")",
")",
"$",
"this",
"... | On request end
@param string $dataResult
@return void | [
"On",
"request",
"end"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Http/Request.php#L96-L102 |
221,586 | CapMousse/React-Restify | src/Http/Request.php | Request.parseJson | private function parseJson($jsonString)
{
$jsonData = json_decode($jsonString, true);
if ($jsonData === null) {
$this->emit('error', [json_last_error_msg()]);
return;
}
$this->setContent($jsonString);
$this->setData($jsonData);
$this->emit('e... | php | private function parseJson($jsonString)
{
$jsonData = json_decode($jsonString, true);
if ($jsonData === null) {
$this->emit('error', [json_last_error_msg()]);
return;
}
$this->setContent($jsonString);
$this->setData($jsonData);
$this->emit('e... | [
"private",
"function",
"parseJson",
"(",
"$",
"jsonString",
")",
"{",
"$",
"jsonData",
"=",
"json_decode",
"(",
"$",
"jsonString",
",",
"true",
")",
";",
"if",
"(",
"$",
"jsonData",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"emit",
"(",
"'error'",
... | Parse json string
@param string $jsonString
@return void | [
"Parse",
"json",
"string"
] | 51fe94d6e4c7fafec06fb304f9e44badde4bfe71 | https://github.com/CapMousse/React-Restify/blob/51fe94d6e4c7fafec06fb304f9e44badde4bfe71/src/Http/Request.php#L125-L137 |
221,587 | paquettg/leaguewrap | src/LeagueWrap/Api/Game.php | Game.recent | public function recent($identity)
{
$summonerId = $this->extractId($identity);
$info = $this->request('game/by-summoner/'.$summonerId.'/recent');
$games = $this->attachStaticDataToDto(new RecentGames($info));
$this->attachResponse($identity, $games, 'recentGames');
return $games;
} | php | public function recent($identity)
{
$summonerId = $this->extractId($identity);
$info = $this->request('game/by-summoner/'.$summonerId.'/recent');
$games = $this->attachStaticDataToDto(new RecentGames($info));
$this->attachResponse($identity, $games, 'recentGames');
return $games;
} | [
"public",
"function",
"recent",
"(",
"$",
"identity",
")",
"{",
"$",
"summonerId",
"=",
"$",
"this",
"->",
"extractId",
"(",
"$",
"identity",
")",
";",
"$",
"info",
"=",
"$",
"this",
"->",
"request",
"(",
"'game/by-summoner/'",
".",
"$",
"summonerId",
... | Get the recent games by summoner id.
@param Summoner|Int $identity
@return array | [
"Get",
"the",
"recent",
"games",
"by",
"summoner",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/Game.php#L57-L67 |
221,588 | paquettg/leaguewrap | src/LeagueWrap/Dto/Summoner.php | Summoner.runePage | public function runePage($runePageId)
{
if ( ! isset($this->info['runePages']))
{
// no rune pages
return null;
}
$runePages = $this->info['runePages'];
if (isset($runePages[$runePageId]))
{
return $runePages[$runePageId];
}
return null;
} | php | public function runePage($runePageId)
{
if ( ! isset($this->info['runePages']))
{
// no rune pages
return null;
}
$runePages = $this->info['runePages'];
if (isset($runePages[$runePageId]))
{
return $runePages[$runePageId];
}
return null;
} | [
"public",
"function",
"runePage",
"(",
"$",
"runePageId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'runePages'",
"]",
")",
")",
"{",
"// no rune pages",
"return",
"null",
";",
"}",
"$",
"runePages",
"=",
"$",
"this",
"... | Attempts to get a rune page by the id.
@param int $runePageId
@return RunePage|null | [
"Attempts",
"to",
"get",
"a",
"rune",
"page",
"by",
"the",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/Summoner.php#L12-L26 |
221,589 | paquettg/leaguewrap | src/LeagueWrap/Dto/Summoner.php | Summoner.masteryPage | public function masteryPage($masteryPageId)
{
if ( ! isset($this->info['masteryPages']))
{
// no rune pages
return null;
}
$masteryPages = $this->info['masteryPages'];
if (isset($masteryPages[$masteryPageId]))
{
return $masteryPages[$masteryPageId];
}
return null;
} | php | public function masteryPage($masteryPageId)
{
if ( ! isset($this->info['masteryPages']))
{
// no rune pages
return null;
}
$masteryPages = $this->info['masteryPages'];
if (isset($masteryPages[$masteryPageId]))
{
return $masteryPages[$masteryPageId];
}
return null;
} | [
"public",
"function",
"masteryPage",
"(",
"$",
"masteryPageId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'masteryPages'",
"]",
")",
")",
"{",
"// no rune pages",
"return",
"null",
";",
"}",
"$",
"masteryPages",
"=",
"$",
... | Attempts to get the mastery page by the id.
@param int $masteryPageId
@return MasteryPage|null | [
"Attempts",
"to",
"get",
"the",
"mastery",
"page",
"by",
"the",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/Summoner.php#L34-L48 |
221,590 | paquettg/leaguewrap | src/LeagueWrap/Dto/Summoner.php | Summoner.recentGame | public function recentGame($gameId)
{
if ( ! isset($this->info['recentGames']))
{
// no rune pages
return null;
}
$recentGames = $this->info['recentGames'];
return $recentGames->game($gameId);
} | php | public function recentGame($gameId)
{
if ( ! isset($this->info['recentGames']))
{
// no rune pages
return null;
}
$recentGames = $this->info['recentGames'];
return $recentGames->game($gameId);
} | [
"public",
"function",
"recentGame",
"(",
"$",
"gameId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"info",
"[",
"'recentGames'",
"]",
")",
")",
"{",
"// no rune pages",
"return",
"null",
";",
"}",
"$",
"recentGames",
"=",
"$",
"this",
... | Attempts to get the game by the id.
@param int $gameId
@return MasteryPage|null | [
"Attempts",
"to",
"get",
"the",
"game",
"by",
"the",
"id",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Dto/Summoner.php#L56-L66 |
221,591 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.selectVersion | public function selectVersion($version)
{
if ( ! in_array($version, $this->versions))
{
// not a value version
return false;
}
$this->version = $version;
return $this;
} | php | public function selectVersion($version)
{
if ( ! in_array($version, $this->versions))
{
// not a value version
return false;
}
$this->version = $version;
return $this;
} | [
"public",
"function",
"selectVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"version",
",",
"$",
"this",
"->",
"versions",
")",
")",
"{",
"// not a value version",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"version",... | Select the version of the api you wish to
query.
@param string $version
@return bool|$this
@return $this | [
"Select",
"the",
"version",
"of",
"the",
"api",
"you",
"wish",
"to",
"query",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L161-L172 |
221,592 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.request | protected function request($path, $params = [], $static = false, $isVersionized = true)
{
// get and validate the region
if ($this->region->isLocked($this->permittedRegions))
{
throw new RegionException('The region "'.$this->region->getRegion().'" is not permited to query this API.');
}
$this->client->ba... | php | protected function request($path, $params = [], $static = false, $isVersionized = true)
{
// get and validate the region
if ($this->region->isLocked($this->permittedRegions))
{
throw new RegionException('The region "'.$this->region->getRegion().'" is not permited to query this API.');
}
$this->client->ba... | [
"protected",
"function",
"request",
"(",
"$",
"path",
",",
"$",
"params",
"=",
"[",
"]",
",",
"$",
"static",
"=",
"false",
",",
"$",
"isVersionized",
"=",
"true",
")",
"{",
"// get and validate the region",
"if",
"(",
"$",
"this",
"->",
"region",
"->",
... | Wraps the request of the api in this method.
@param string $path
@param array $params
@param bool $static
@param bool $isVersionized
@return mixed
@throws CacheNotFoundException
@throws HttpClientError
@throws HttpServerError
@throws LimitReachedException
@throws RegionException
@throws string | [
"Wraps",
"the",
"request",
"of",
"the",
"api",
"in",
"this",
"method",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L231-L312 |
221,593 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.clientRequest | protected function clientRequest($static, $uri, $params)
{
// check if we have hit the limit
if ( ! $static &&
! $this->collection->hitLimits($this->region->getRegion())
)
{
throw new LimitReachedException('You have hit the request limit in your collection.');
}
$response = $this->client->request($u... | php | protected function clientRequest($static, $uri, $params)
{
// check if we have hit the limit
if ( ! $static &&
! $this->collection->hitLimits($this->region->getRegion())
)
{
throw new LimitReachedException('You have hit the request limit in your collection.');
}
$response = $this->client->request($u... | [
"protected",
"function",
"clientRequest",
"(",
"$",
"static",
",",
"$",
"uri",
",",
"$",
"params",
")",
"{",
"// check if we have hit the limit",
"if",
"(",
"!",
"$",
"static",
"&&",
"!",
"$",
"this",
"->",
"collection",
"->",
"hitLimits",
"(",
"$",
"this"... | Make the actual request.
@param bool $static
@param string $uri
@param array $params
@return \LeagueWrap\Response
@throws LimitReachedException | [
"Make",
"the",
"actual",
"request",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L323-L342 |
221,594 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.getVersion | protected function getVersion()
{
if (is_null($this->version))
{
// get the first version in versions
$this->version = reset($this->versions);
}
return $this->version;
} | php | protected function getVersion()
{
if (is_null($this->version))
{
// get the first version in versions
$this->version = reset($this->versions);
}
return $this->version;
} | [
"protected",
"function",
"getVersion",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"version",
")",
")",
"{",
"// get the first version in versions",
"$",
"this",
"->",
"version",
"=",
"reset",
"(",
"$",
"this",
"->",
"versions",
")",
";",
... | Get the version string.
@return string | [
"Get",
"the",
"version",
"string",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L349-L358 |
221,595 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.extractIds | protected function extractIds($identities)
{
$ids = [];
if (is_array($identities))
{
foreach ($identities as $identity)
{
$ids[] = $this->extractId($identity);
}
}
else
{
$ids[] = $this->extractId($identities);
}
return $ids;
} | php | protected function extractIds($identities)
{
$ids = [];
if (is_array($identities))
{
foreach ($identities as $identity)
{
$ids[] = $this->extractId($identity);
}
}
else
{
$ids[] = $this->extractId($identities);
}
return $ids;
} | [
"protected",
"function",
"extractIds",
"(",
"$",
"identities",
")",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"identities",
")",
")",
"{",
"foreach",
"(",
"$",
"identities",
"as",
"$",
"identity",
")",
"{",
"$",
"ids",
"... | Attempts to extract an ID from the array given.
@param mixed $identities
@return array
@uses extractId() | [
"Attempts",
"to",
"extract",
"an",
"ID",
"from",
"the",
"array",
"given",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L390-L406 |
221,596 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.attachResponse | protected function attachResponse($identity, $response, $key)
{
if ($identity instanceof Summoner)
{
$identity->set($key, $response);
return true;
}
return false;
} | php | protected function attachResponse($identity, $response, $key)
{
if ($identity instanceof Summoner)
{
$identity->set($key, $response);
return true;
}
return false;
} | [
"protected",
"function",
"attachResponse",
"(",
"$",
"identity",
",",
"$",
"response",
",",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"identity",
"instanceof",
"Summoner",
")",
"{",
"$",
"identity",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"response",
")",
... | Attempts to attach the response to a summoner object.
@param mixed $identity
@param mixed $response
@param string $key
@return bool | [
"Attempts",
"to",
"attach",
"the",
"response",
"to",
"a",
"summoner",
"object",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L416-L426 |
221,597 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.attachResponses | protected function attachResponses($identities, $responses, $key)
{
if (is_array($identities))
{
foreach ($identities as $identity)
{
if ($identity instanceof Summoner)
{
$id = $identity->id;
if (isset($responses[$id]))
{
$response = $responses[$id];
$this->attachResponse($... | php | protected function attachResponses($identities, $responses, $key)
{
if (is_array($identities))
{
foreach ($identities as $identity)
{
if ($identity instanceof Summoner)
{
$id = $identity->id;
if (isset($responses[$id]))
{
$response = $responses[$id];
$this->attachResponse($... | [
"protected",
"function",
"attachResponses",
"(",
"$",
"identities",
",",
"$",
"responses",
",",
"$",
"key",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"identities",
")",
")",
"{",
"foreach",
"(",
"$",
"identities",
"as",
"$",
"identity",
")",
"{",
"if"... | Attempts to attach all the responses to the correct summoner.
@param array|Summoner $identities
@param mixed $responses
@param string $key
@return bool | [
"Attempts",
"to",
"attach",
"all",
"the",
"responses",
"to",
"the",
"correct",
"summoner",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L436-L478 |
221,598 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.attachStaticDataToDto | protected function attachStaticDataToDto(AbstractDto $dto)
{
if ($this->attachStaticData)
{
$dto->loadStaticData($this->staticData);
}
return $dto;
} | php | protected function attachStaticDataToDto(AbstractDto $dto)
{
if ($this->attachStaticData)
{
$dto->loadStaticData($this->staticData);
}
return $dto;
} | [
"protected",
"function",
"attachStaticDataToDto",
"(",
"AbstractDto",
"$",
"dto",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attachStaticData",
")",
"{",
"$",
"dto",
"->",
"loadStaticData",
"(",
"$",
"this",
"->",
"staticData",
")",
";",
"}",
"return",
"$",
... | Will attempt to attach any static data to the given dto if
the attach static data flag is set.
@param AbstractDto $dto
@return AbstractDto | [
"Will",
"attempt",
"to",
"attach",
"any",
"static",
"data",
"to",
"the",
"given",
"dto",
"if",
"the",
"attach",
"static",
"data",
"flag",
"is",
"set",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L487-L495 |
221,599 | paquettg/leaguewrap | src/LeagueWrap/Api/AbstractApi.php | AbstractApi.checkResponseErrors | protected function checkResponseErrors(Response $response)
{
$code = $response->getCode();
if ($code === 429 && !$response->hasHeader('Retry-After')) {
throw Response\UnderlyingServiceRateLimitReached::withResponse(
"Did not receive 'X-Rate-Limit-Type' and 'Retry-After' headers. ".
"See https://develope... | php | protected function checkResponseErrors(Response $response)
{
$code = $response->getCode();
if ($code === 429 && !$response->hasHeader('Retry-After')) {
throw Response\UnderlyingServiceRateLimitReached::withResponse(
"Did not receive 'X-Rate-Limit-Type' and 'Retry-After' headers. ".
"See https://develope... | [
"protected",
"function",
"checkResponseErrors",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"code",
"=",
"$",
"response",
"->",
"getCode",
"(",
")",
";",
"if",
"(",
"$",
"code",
"===",
"429",
"&&",
"!",
"$",
"response",
"->",
"hasHeader",
"(",
"'R... | Checks the response for Http errors.
@param Response $response
@throws \LeagueWrap\Response\Http400
@throws \LeagueWrap\Response\Http401
@throws \LeagueWrap\Response\Http402
@throws \LeagueWrap\Response\Http403
@throws \LeagueWrap\Response\Http404
@throws \LeagueWrap\Response\Http405
@throws \LeagueWrap\Response\Http4... | [
"Checks",
"the",
"response",
"for",
"Http",
"errors",
"."
] | 0f91813b5d8292054e5e13619d591b6b14dc63e6 | https://github.com/paquettg/leaguewrap/blob/0f91813b5d8292054e5e13619d591b6b14dc63e6/src/LeagueWrap/Api/AbstractApi.php#L519-L544 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.