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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
236,100 | vgrdominik/VGRElasticsearchHttpFoundationBundle | Security/Http/Firewall/ElasticsearchContextListener.php | ElasticsearchContextListener.refreshUser | private function refreshUser(TokenInterface $token)
{
$user = $token->getUser();
if (!$user instanceof UserInterface) {
return $token;
}
if (null !== $this->logger) {
$this->logger->debug(sprintf('Reloading user from user provider.'));
}
fore... | php | private function refreshUser(TokenInterface $token)
{
$user = $token->getUser();
if (!$user instanceof UserInterface) {
return $token;
}
if (null !== $this->logger) {
$this->logger->debug(sprintf('Reloading user from user provider.'));
}
fore... | [
"private",
"function",
"refreshUser",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"user",
"=",
"$",
"token",
"->",
"getUser",
"(",
")",
";",
"if",
"(",
"!",
"$",
"user",
"instanceof",
"UserInterface",
")",
"{",
"return",
"$",
"token",
";",
"}",... | Refreshes the user by reloading it from the user provider
@param TokenInterface $token
@return TokenInterface|null
@throws \RuntimeException | [
"Refreshes",
"the",
"user",
"by",
"reloading",
"it",
"from",
"the",
"user",
"provider"
] | 06fad4b3619bfaf481b3141800d0b9eb5ae45b07 | https://github.com/vgrdominik/VGRElasticsearchHttpFoundationBundle/blob/06fad4b3619bfaf481b3141800d0b9eb5ae45b07/Security/Http/Firewall/ElasticsearchContextListener.php#L175-L208 |
236,101 | bishopb/vanilla | applications/vanilla/controllers/class.discussionscontroller.php | DiscussionsController.Table | public function Table($Page = '0') {
if ($this->SyndicationMethod == SYNDICATION_NONE)
$this->View = 'table';
$this->Index($Page);
} | php | public function Table($Page = '0') {
if ($this->SyndicationMethod == SYNDICATION_NONE)
$this->View = 'table';
$this->Index($Page);
} | [
"public",
"function",
"Table",
"(",
"$",
"Page",
"=",
"'0'",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"SyndicationMethod",
"==",
"SYNDICATION_NONE",
")",
"$",
"this",
"->",
"View",
"=",
"'table'",
";",
"$",
"this",
"->",
"Index",
"(",
"$",
"Page",
")"... | "Table" layout for discussions. Mimics more traditional forum discussion layout.
@param int $Page Multiplied by PerPage option to determine offset. | [
"Table",
"layout",
"for",
"discussions",
".",
"Mimics",
"more",
"traditional",
"forum",
"discussion",
"layout",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.discussionscontroller.php#L58-L62 |
236,102 | bishopb/vanilla | applications/vanilla/controllers/class.discussionscontroller.php | DiscussionsController.Bookmarked | public function Bookmarked($Page = '0') {
$this->Permission('Garden.SignIn.Allow');
Gdn_Theme::Section('DiscussionList');
// Figure out which discussions layout to choose (Defined on "Homepage" settings page).
$Layout = C('Vanilla.Discussions.Layout');
switch($Layout) {
case 'tab... | php | public function Bookmarked($Page = '0') {
$this->Permission('Garden.SignIn.Allow');
Gdn_Theme::Section('DiscussionList');
// Figure out which discussions layout to choose (Defined on "Homepage" settings page).
$Layout = C('Vanilla.Discussions.Layout');
switch($Layout) {
case 'tab... | [
"public",
"function",
"Bookmarked",
"(",
"$",
"Page",
"=",
"'0'",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.SignIn.Allow'",
")",
";",
"Gdn_Theme",
"::",
"Section",
"(",
"'DiscussionList'",
")",
";",
"// Figure out which discussions layout to choose (D... | Display discussions the user has bookmarked.
@since 2.0.0
@access public
@param int $Offset Number of discussions to skip. | [
"Display",
"discussions",
"the",
"user",
"has",
"bookmarked",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.discussionscontroller.php#L298-L371 |
236,103 | bishopb/vanilla | applications/vanilla/controllers/class.discussionscontroller.php | DiscussionsController.Mine | public function Mine($Page = 'p1') {
$this->Permission('Garden.SignIn.Allow');
Gdn_Theme::Section('DiscussionList');
// Set criteria & get discussions data
list($Offset, $Limit) = OffsetLimit($Page, C('Vanilla.Discussions.PerPage', 30));
$Session = Gdn::Session();
$Wheres = ar... | php | public function Mine($Page = 'p1') {
$this->Permission('Garden.SignIn.Allow');
Gdn_Theme::Section('DiscussionList');
// Set criteria & get discussions data
list($Offset, $Limit) = OffsetLimit($Page, C('Vanilla.Discussions.PerPage', 30));
$Session = Gdn::Session();
$Wheres = ar... | [
"public",
"function",
"Mine",
"(",
"$",
"Page",
"=",
"'p1'",
")",
"{",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.SignIn.Allow'",
")",
";",
"Gdn_Theme",
"::",
"Section",
"(",
"'DiscussionList'",
")",
";",
"// Set criteria & get discussions data",
"list",
"("... | Display discussions started by the user.
@since 2.0.0
@access public
@param int $Offset Number of discussions to skip. | [
"Display",
"discussions",
"started",
"by",
"the",
"user",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.discussionscontroller.php#L396-L447 |
236,104 | bishopb/vanilla | applications/vanilla/controllers/class.discussionscontroller.php | DiscussionsController.GetCommentCounts | public function GetCommentCounts() {
$this->AllowJSONP(TRUE);
$vanilla_identifier = GetValue('vanilla_identifier', $_GET);
if (!is_array($vanilla_identifier))
$vanilla_identifier = array($vanilla_identifier);
$vanilla_identifier = array_unique($vanilla_identifier);
$Fina... | php | public function GetCommentCounts() {
$this->AllowJSONP(TRUE);
$vanilla_identifier = GetValue('vanilla_identifier', $_GET);
if (!is_array($vanilla_identifier))
$vanilla_identifier = array($vanilla_identifier);
$vanilla_identifier = array_unique($vanilla_identifier);
$Fina... | [
"public",
"function",
"GetCommentCounts",
"(",
")",
"{",
"$",
"this",
"->",
"AllowJSONP",
"(",
"TRUE",
")",
";",
"$",
"vanilla_identifier",
"=",
"GetValue",
"(",
"'vanilla_identifier'",
",",
"$",
"_GET",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"v... | Takes a set of discussion identifiers and returns their comment counts in the same order. | [
"Takes",
"a",
"set",
"of",
"discussion",
"identifiers",
"and",
"returns",
"their",
"comment",
"counts",
"in",
"the",
"same",
"order",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.discussionscontroller.php#L484-L536 |
236,105 | bishopb/vanilla | applications/vanilla/controllers/class.discussionscontroller.php | DiscussionsController.Sort | public function Sort($Target = '') {
if (!Gdn::Session()->IsValid())
throw PermissionException();
if (!$this->Request->IsAuthenticatedPostBack())
throw ForbiddenException('GET');
// Get param
$SortField = Gdn::Request()->Post('DiscussionSort');
$SortField... | php | public function Sort($Target = '') {
if (!Gdn::Session()->IsValid())
throw PermissionException();
if (!$this->Request->IsAuthenticatedPostBack())
throw ForbiddenException('GET');
// Get param
$SortField = Gdn::Request()->Post('DiscussionSort');
$SortField... | [
"public",
"function",
"Sort",
"(",
"$",
"Target",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"Gdn",
"::",
"Session",
"(",
")",
"->",
"IsValid",
"(",
")",
")",
"throw",
"PermissionException",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"Request",
... | Set user preference for sorting discussions. | [
"Set",
"user",
"preference",
"for",
"sorting",
"discussions",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.discussionscontroller.php#L541-L566 |
236,106 | CampusUnion/Sked | src/SkeFormInput.php | SkeFormInput.defineType | protected function defineType(string $strType)
{
switch ($strType) {
case 'select':
case 'textarea':
$this->strElementType = $strType;
break;
case 'checkbox':
case 'hidden':
case 'radio':
case 'text':
... | php | protected function defineType(string $strType)
{
switch ($strType) {
case 'select':
case 'textarea':
$this->strElementType = $strType;
break;
case 'checkbox':
case 'hidden':
case 'radio':
case 'text':
... | [
"protected",
"function",
"defineType",
"(",
"string",
"$",
"strType",
")",
"{",
"switch",
"(",
"$",
"strType",
")",
"{",
"case",
"'select'",
":",
"case",
"'textarea'",
":",
"$",
"this",
"->",
"strElementType",
"=",
"$",
"strType",
";",
"break",
";",
"cas... | Init the HTML element type.
@param string $strType Type of HTML element. | [
"Init",
"the",
"HTML",
"element",
"type",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/SkeFormInput.php#L95-L111 |
236,107 | CampusUnion/Sked | src/SkeFormInput.php | SkeFormInput.renderInput | public function renderInput(array $aAttribs = [])
{
$this->aAttribs += $aAttribs;
$strElement = $this->isMulti() ? $this->renderMulti() : $this->renderSingle();
$strSuffix = $this->strSuffix ? ' ' . $this->strSuffix : '';
return $strElement . $strSuffix;
} | php | public function renderInput(array $aAttribs = [])
{
$this->aAttribs += $aAttribs;
$strElement = $this->isMulti() ? $this->renderMulti() : $this->renderSingle();
$strSuffix = $this->strSuffix ? ' ' . $this->strSuffix : '';
return $strElement . $strSuffix;
} | [
"public",
"function",
"renderInput",
"(",
"array",
"$",
"aAttribs",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"aAttribs",
"+=",
"$",
"aAttribs",
";",
"$",
"strElement",
"=",
"$",
"this",
"->",
"isMulti",
"(",
")",
"?",
"$",
"this",
"->",
"renderMul... | Render the input element.
@param array $aAttribs Array of element attributes.
@return string HTML | [
"Render",
"the",
"input",
"element",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/SkeFormInput.php#L207-L213 |
236,108 | CampusUnion/Sked | src/SkeFormInput.php | SkeFormInput.renderSingle | protected function renderSingle()
{
$strHtml = '';
// Apply label?
if (in_array($this->getType(), ['checkbox', 'radio']))
$strHtml .= '<label class="sked-input-multi">';
// Build opening tag
$strHtml .= '<' . $this->strElementType . ' ' . $this->renderAttribs() ... | php | protected function renderSingle()
{
$strHtml = '';
// Apply label?
if (in_array($this->getType(), ['checkbox', 'radio']))
$strHtml .= '<label class="sked-input-multi">';
// Build opening tag
$strHtml .= '<' . $this->strElementType . ' ' . $this->renderAttribs() ... | [
"protected",
"function",
"renderSingle",
"(",
")",
"{",
"$",
"strHtml",
"=",
"''",
";",
"// Apply label?",
"if",
"(",
"in_array",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
",",
"[",
"'checkbox'",
",",
"'radio'",
"]",
")",
")",
"$",
"strHtml",
".=",
... | Render a single element.
@return string HTML | [
"Render",
"a",
"single",
"element",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/SkeFormInput.php#L220-L256 |
236,109 | CampusUnion/Sked | src/SkeFormInput.php | SkeFormInput.renderMulti | protected function renderMulti()
{
$strHtml = '';
// An indexed array means use the label as the value also.
$bLabelIsValue = isset($this->aOptions[0]);
foreach ($this->aOptions as $mValue => $strLabel) {
if ($bLabelIsValue)
$mValue = $strLabel;
... | php | protected function renderMulti()
{
$strHtml = '';
// An indexed array means use the label as the value also.
$bLabelIsValue = isset($this->aOptions[0]);
foreach ($this->aOptions as $mValue => $strLabel) {
if ($bLabelIsValue)
$mValue = $strLabel;
... | [
"protected",
"function",
"renderMulti",
"(",
")",
"{",
"$",
"strHtml",
"=",
"''",
";",
"// An indexed array means use the label as the value also.",
"$",
"bLabelIsValue",
"=",
"isset",
"(",
"$",
"this",
"->",
"aOptions",
"[",
"0",
"]",
")",
";",
"foreach",
"(",
... | Render multiple related elements.
@return string HTML | [
"Render",
"multiple",
"related",
"elements",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/SkeFormInput.php#L263-L280 |
236,110 | cobonto/module | src/Classes/Actions/Event.php | Event.add | public function add()
{
if($moduleEvents = $this->module->events())
{
$systemEvents = $this->load();
if(isset($moduleEvents['listen']))
// for listen event we must check if exists merge if not add it
foreach ($moduleEvents['listen'] as $event => $liste... | php | public function add()
{
if($moduleEvents = $this->module->events())
{
$systemEvents = $this->load();
if(isset($moduleEvents['listen']))
// for listen event we must check if exists merge if not add it
foreach ($moduleEvents['listen'] as $event => $liste... | [
"public",
"function",
"add",
"(",
")",
"{",
"if",
"(",
"$",
"moduleEvents",
"=",
"$",
"this",
"->",
"module",
"->",
"events",
"(",
")",
")",
"{",
"$",
"systemEvents",
"=",
"$",
"this",
"->",
"load",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
... | add events to events.php in cache | [
"add",
"events",
"to",
"events",
".",
"php",
"in",
"cache"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Actions/Event.php#L11-L31 |
236,111 | cobonto/module | src/Classes/Actions/Event.php | Event.remove | public function remove()
{
if($moduleEvents = $this->module->events())
{
$systemEvents = $this->load();
if (isset($moduleEvents['listen']))
// for listen event we must check if exists merge if not add it
foreach ($moduleEvents['listen'] as $eve... | php | public function remove()
{
if($moduleEvents = $this->module->events())
{
$systemEvents = $this->load();
if (isset($moduleEvents['listen']))
// for listen event we must check if exists merge if not add it
foreach ($moduleEvents['listen'] as $eve... | [
"public",
"function",
"remove",
"(",
")",
"{",
"if",
"(",
"$",
"moduleEvents",
"=",
"$",
"this",
"->",
"module",
"->",
"events",
"(",
")",
")",
"{",
"$",
"systemEvents",
"=",
"$",
"this",
"->",
"load",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",... | remove events from system | [
"remove",
"events",
"from",
"system"
] | 0978b5305c3d6f13ef7e0e5297855bd09eee6b76 | https://github.com/cobonto/module/blob/0978b5305c3d6f13ef7e0e5297855bd09eee6b76/src/Classes/Actions/Event.php#L33-L62 |
236,112 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/GenerateNewPassword.php | GenerateNewPassword.execute | public function execute(Framework $framework, WebRequest $request, Response $response)
{
// Set the title for the page
$this->setTitle($this->translate('Generate a new password', '\\Zepi\\Web\\AccessControl'));
// Generate a new password
$result = $this->generateNewPassword(... | php | public function execute(Framework $framework, WebRequest $request, Response $response)
{
// Set the title for the page
$this->setTitle($this->translate('Generate a new password', '\\Zepi\\Web\\AccessControl'));
// Generate a new password
$result = $this->generateNewPassword(... | [
"public",
"function",
"execute",
"(",
"Framework",
"$",
"framework",
",",
"WebRequest",
"$",
"request",
",",
"Response",
"$",
"response",
")",
"{",
"// Set the title for the page",
"$",
"this",
"->",
"setTitle",
"(",
"$",
"this",
"->",
"translate",
"(",
"'Gene... | Handles the whole registration process
@access public
@param \Zepi\Turbo\Framework $framework
@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response | [
"Handles",
"the",
"whole",
"registration",
"process"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/GenerateNewPassword.php#L66-L80 |
236,113 | zepi/turbo-base | Zepi/Web/AccessControl/src/EventHandler/GenerateNewPassword.php | GenerateNewPassword.generateRandomPassword | protected function generateRandomPassword()
{
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+*=-_/()!?[]{}';
$password = array();
$alphabetLength = strlen($alphabet) - 1;
for ($i = 0; $i < 10; $i++) {
$charIndex = mt_rand(0, $alphabet... | php | protected function generateRandomPassword()
{
$alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+*=-_/()!?[]{}';
$password = array();
$alphabetLength = strlen($alphabet) - 1;
for ($i = 0; $i < 10; $i++) {
$charIndex = mt_rand(0, $alphabet... | [
"protected",
"function",
"generateRandomPassword",
"(",
")",
"{",
"$",
"alphabet",
"=",
"'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890+*=-_/()!?[]{}'",
";",
"$",
"password",
"=",
"array",
"(",
")",
";",
"$",
"alphabetLength",
"=",
"strlen",
"(",
"$",
... | Generates a new random password
@access protected
@return string | [
"Generates",
"a",
"new",
"random",
"password"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/AccessControl/src/EventHandler/GenerateNewPassword.php#L155-L173 |
236,114 | ilya-dev/block | src/Block/Block.php | Block.setObject | public function setObject($object)
{
if ( ! is_object($object))
{
throw new InvalidArgumentException(
'Expected an object, but got '.gettype($object)
);
}
$this->object = new ReflectionClass($object);
} | php | public function setObject($object)
{
if ( ! is_object($object))
{
throw new InvalidArgumentException(
'Expected an object, but got '.gettype($object)
);
}
$this->object = new ReflectionClass($object);
} | [
"public",
"function",
"setObject",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Expected an object, but got '",
".",
"gettype",
"(",
"$",
"object",
")",
")",
... | Set the object you want to work with.
@throws InvalidArgumentException
@param mixed $object
@return void | [
"Set",
"the",
"object",
"you",
"want",
"to",
"work",
"with",
"."
] | 46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8 | https://github.com/ilya-dev/block/blob/46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8/src/Block/Block.php#L46-L56 |
236,115 | ilya-dev/block | src/Block/Block.php | Block.property | public function property($name)
{
if ( ! $this->object->hasProperty($name))
{
throw new UnexpectedValueException(
"Property {$name} does not exist"
);
}
return $this->extractComment($this->object->getProperty($name));
} | php | public function property($name)
{
if ( ! $this->object->hasProperty($name))
{
throw new UnexpectedValueException(
"Property {$name} does not exist"
);
}
return $this->extractComment($this->object->getProperty($name));
} | [
"public",
"function",
"property",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"object",
"->",
"hasProperty",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"\"Property {$name} does not exist\"",
")",
";",... | Fetch a property comment.
@throws UnexpectedValueException
@param string $name
@return Comment | [
"Fetch",
"a",
"property",
"comment",
"."
] | 46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8 | https://github.com/ilya-dev/block/blob/46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8/src/Block/Block.php#L75-L85 |
236,116 | ilya-dev/block | src/Block/Block.php | Block.properties | public function properties($filter = null)
{
if (is_null($filter))
{
$properties = $this->object->getProperties();
}
else
{
$properties = $this->object->getProperties($filter);
}
return array_map([$this, 'extractComment'], $properties)... | php | public function properties($filter = null)
{
if (is_null($filter))
{
$properties = $this->object->getProperties();
}
else
{
$properties = $this->object->getProperties($filter);
}
return array_map([$this, 'extractComment'], $properties)... | [
"public",
"function",
"properties",
"(",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"filter",
")",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"object",
"->",
"getProperties",
"(",
")",
";",
"}",
"else",
"{",
"$"... | Get the comments for all properties.
@param integer|null $filter
@return array | [
"Get",
"the",
"comments",
"for",
"all",
"properties",
"."
] | 46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8 | https://github.com/ilya-dev/block/blob/46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8/src/Block/Block.php#L93-L105 |
236,117 | ilya-dev/block | src/Block/Block.php | Block.method | public function method($name)
{
if ( ! $this->object->hasMethod($name))
{
throw new UnexpectedValueException(
"Method {$name} does not exist"
);
}
return $this->extractComment($this->object->getMethod($name));
} | php | public function method($name)
{
if ( ! $this->object->hasMethod($name))
{
throw new UnexpectedValueException(
"Method {$name} does not exist"
);
}
return $this->extractComment($this->object->getMethod($name));
} | [
"public",
"function",
"method",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"object",
"->",
"hasMethod",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"UnexpectedValueException",
"(",
"\"Method {$name} does not exist\"",
")",
";",
"}"... | Get the method comment.
@throws UnexpectedValueException
@param string $name
@return Comment | [
"Get",
"the",
"method",
"comment",
"."
] | 46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8 | https://github.com/ilya-dev/block/blob/46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8/src/Block/Block.php#L114-L124 |
236,118 | ilya-dev/block | src/Block/Block.php | Block.methods | public function methods($filter = null)
{
if (is_null($filter))
{
$methods = $this->object->getMethods();
}
else
{
$methods = $this->object->getMethods($filter);
}
return array_map([$this, 'extractComment'], $methods);
} | php | public function methods($filter = null)
{
if (is_null($filter))
{
$methods = $this->object->getMethods();
}
else
{
$methods = $this->object->getMethods($filter);
}
return array_map([$this, 'extractComment'], $methods);
} | [
"public",
"function",
"methods",
"(",
"$",
"filter",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"filter",
")",
")",
"{",
"$",
"methods",
"=",
"$",
"this",
"->",
"object",
"->",
"getMethods",
"(",
")",
";",
"}",
"else",
"{",
"$",
"meth... | Get the comments for all methods.
@param integer|null $filter
@return array | [
"Get",
"the",
"comments",
"for",
"all",
"methods",
"."
] | 46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8 | https://github.com/ilya-dev/block/blob/46aeff9abd1e61a4247e1cf3aed3f8c7561e2bd8/src/Block/Block.php#L132-L144 |
236,119 | flowcode/AmulenNewsBundle | src/Flowcode/NewsBundle/Controller/AdminCategoryController.php | AdminCategoryController.indexAction | public function indexAction() {
$em = $this->getDoctrine()->getManager();
$rootName = $this->container->getParameter('flowcode_news.root_category');
$root = $em->getRepository('AmulenClassificationBundle:Category')->findOneBy(array("name" => $rootName));
$entities = $em->getRepository('A... | php | public function indexAction() {
$em = $this->getDoctrine()->getManager();
$rootName = $this->container->getParameter('flowcode_news.root_category');
$root = $em->getRepository('AmulenClassificationBundle:Category')->findOneBy(array("name" => $rootName));
$entities = $em->getRepository('A... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"rootName",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'flowcode_news.root_categor... | Lists all Category entities.
@Route("/", name="admin_news_category")
@Method("GET")
@Template() | [
"Lists",
"all",
"Category",
"entities",
"."
] | e870d2f09b629affeddf9a53ed43205300b66933 | https://github.com/flowcode/AmulenNewsBundle/blob/e870d2f09b629affeddf9a53ed43205300b66933/src/Flowcode/NewsBundle/Controller/AdminCategoryController.php#L27-L37 |
236,120 | flowcode/AmulenNewsBundle | src/Flowcode/NewsBundle/Controller/AdminCategoryController.php | AdminCategoryController.childrensAction | public function childrensAction($id) {
$em = $this->getDoctrine()->getManager();
$parent = $em->getRepository('AmulenClassificationBundle:Category')->findOneBy(array("id" => $id));
$childrens = $em->getRepository('AmulenClassificationBundle:Category')->getChildren($parent, true);
retur... | php | public function childrensAction($id) {
$em = $this->getDoctrine()->getManager();
$parent = $em->getRepository('AmulenClassificationBundle:Category')->findOneBy(array("id" => $id));
$childrens = $em->getRepository('AmulenClassificationBundle:Category')->getChildren($parent, true);
retur... | [
"public",
"function",
"childrensAction",
"(",
"$",
"id",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getDoctrine",
"(",
")",
"->",
"getManager",
"(",
")",
";",
"$",
"parent",
"=",
"$",
"em",
"->",
"getRepository",
"(",
"'AmulenClassificationBundle:Catego... | Select parent.
@Route("/childrens/{id}", name="admin_news_category_children")
@Method("GET")
@Template() | [
"Select",
"parent",
"."
] | e870d2f09b629affeddf9a53ed43205300b66933 | https://github.com/flowcode/AmulenNewsBundle/blob/e870d2f09b629affeddf9a53ed43205300b66933/src/Flowcode/NewsBundle/Controller/AdminCategoryController.php#L113-L123 |
236,121 | flowcode/AmulenNewsBundle | src/Flowcode/NewsBundle/Controller/AdminCategoryController.php | AdminCategoryController.createDeleteForm | private function createDeleteForm($id) {
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_news_category_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete',
... | php | private function createDeleteForm($id) {
return $this->createFormBuilder()
->setAction($this->generateUrl('admin_news_category_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Delete',
... | [
"private",
"function",
"createDeleteForm",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"createFormBuilder",
"(",
")",
"->",
"setAction",
"(",
"$",
"this",
"->",
"generateUrl",
"(",
"'admin_news_category_delete'",
",",
"array",
"(",
"'id'",
"=>",
"... | Creates a form to delete a Category entity by id.
@param mixed $id The entity id
@return Form The form | [
"Creates",
"a",
"form",
"to",
"delete",
"a",
"Category",
"entity",
"by",
"id",
"."
] | e870d2f09b629affeddf9a53ed43205300b66933 | https://github.com/flowcode/AmulenNewsBundle/blob/e870d2f09b629affeddf9a53ed43205300b66933/src/Flowcode/NewsBundle/Controller/AdminCategoryController.php#L258-L268 |
236,122 | bereczkybalazs/brick-core | src/RouteDispatcher.php | RouteDispatcher.parseFilters | protected function parseFilters($filters)
{
$beforeFilter = array();
$afterFilter = array();
if (isset($filters[Route::BEFORE])) {
$beforeFilter = array_intersect_key($this->filters, array_flip((array)$filters[Route::BEFORE]));
}
if (isset($filters[Route::AFTER]... | php | protected function parseFilters($filters)
{
$beforeFilter = array();
$afterFilter = array();
if (isset($filters[Route::BEFORE])) {
$beforeFilter = array_intersect_key($this->filters, array_flip((array)$filters[Route::BEFORE]));
}
if (isset($filters[Route::AFTER]... | [
"protected",
"function",
"parseFilters",
"(",
"$",
"filters",
")",
"{",
"$",
"beforeFilter",
"=",
"array",
"(",
")",
";",
"$",
"afterFilter",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"filters",
"[",
"Route",
"::",
"BEFORE",
"]",
")"... | Normalise the array filters attached to the route and merge with any global filters.
@param $filters
@return array | [
"Normalise",
"the",
"array",
"filters",
"attached",
"to",
"the",
"route",
"and",
"merge",
"with",
"any",
"global",
"filters",
"."
] | 6528c127d6aa2e506813891c6147fb341ed80e7c | https://github.com/bereczkybalazs/brick-core/blob/6528c127d6aa2e506813891c6147fb341ed80e7c/src/RouteDispatcher.php#L148-L162 |
236,123 | bereczkybalazs/brick-core | src/RouteDispatcher.php | RouteDispatcher.dispatchRoute | protected function dispatchRoute($httpMethod, $uri)
{
if (isset($this->staticRouteMap[$uri])) {
return $this->dispatchStaticRoute($httpMethod, $uri);
}
return $this->dispatchVariableRoute($httpMethod, $uri);
} | php | protected function dispatchRoute($httpMethod, $uri)
{
if (isset($this->staticRouteMap[$uri])) {
return $this->dispatchStaticRoute($httpMethod, $uri);
}
return $this->dispatchVariableRoute($httpMethod, $uri);
} | [
"protected",
"function",
"dispatchRoute",
"(",
"$",
"httpMethod",
",",
"$",
"uri",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"staticRouteMap",
"[",
"$",
"uri",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"dispatchStaticRoute",
"(",
"$"... | Perform the route dispatching. Check static routes first followed by variable routes.
@param $httpMethod
@param $uri
@throws HttpRouteNotFoundException | [
"Perform",
"the",
"route",
"dispatching",
".",
"Check",
"static",
"routes",
"first",
"followed",
"by",
"variable",
"routes",
"."
] | 6528c127d6aa2e506813891c6147fb341ed80e7c | https://github.com/bereczkybalazs/brick-core/blob/6528c127d6aa2e506813891c6147fb341ed80e7c/src/RouteDispatcher.php#L171-L178 |
236,124 | bereczkybalazs/brick-core | src/RouteDispatcher.php | RouteDispatcher.dispatchStaticRoute | protected function dispatchStaticRoute($httpMethod, $uri)
{
$routes = $this->staticRouteMap[$uri];
if (!isset($routes[$httpMethod])) {
$httpMethod = $this->checkFallbacks($routes, $httpMethod);
}
return $routes[$httpMethod];
} | php | protected function dispatchStaticRoute($httpMethod, $uri)
{
$routes = $this->staticRouteMap[$uri];
if (!isset($routes[$httpMethod])) {
$httpMethod = $this->checkFallbacks($routes, $httpMethod);
}
return $routes[$httpMethod];
} | [
"protected",
"function",
"dispatchStaticRoute",
"(",
"$",
"httpMethod",
",",
"$",
"uri",
")",
"{",
"$",
"routes",
"=",
"$",
"this",
"->",
"staticRouteMap",
"[",
"$",
"uri",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"routes",
"[",
"$",
"httpMethod",
... | Handle the dispatching of static routes.
@param $httpMethod
@param $uri
@return mixed
@throws HttpMethodNotAllowedException | [
"Handle",
"the",
"dispatching",
"of",
"static",
"routes",
"."
] | 6528c127d6aa2e506813891c6147fb341ed80e7c | https://github.com/bereczkybalazs/brick-core/blob/6528c127d6aa2e506813891c6147fb341ed80e7c/src/RouteDispatcher.php#L188-L197 |
236,125 | bereczkybalazs/brick-core | src/RouteDispatcher.php | RouteDispatcher.dispatchVariableRoute | protected function dispatchVariableRoute($httpMethod, $uri)
{
foreach ($this->variableRouteData as $data) {
if (!preg_match($data['regex'], $uri, $matches)) {
continue;
}
$count = count($matches);
while (!isset($data['routeMap'][$count++])) {... | php | protected function dispatchVariableRoute($httpMethod, $uri)
{
foreach ($this->variableRouteData as $data) {
if (!preg_match($data['regex'], $uri, $matches)) {
continue;
}
$count = count($matches);
while (!isset($data['routeMap'][$count++])) {... | [
"protected",
"function",
"dispatchVariableRoute",
"(",
"$",
"httpMethod",
",",
"$",
"uri",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"variableRouteData",
"as",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"$",
"data",
"[",
"'regex'",
"]",... | Handle the dispatching of variable routes.
@param $httpMethod
@param $uri
@throws HttpMethodNotAllowedException
@throws HttpRouteNotFoundException | [
"Handle",
"the",
"dispatching",
"of",
"variable",
"routes",
"."
] | 6528c127d6aa2e506813891c6147fb341ed80e7c | https://github.com/bereczkybalazs/brick-core/blob/6528c127d6aa2e506813891c6147fb341ed80e7c/src/RouteDispatcher.php#L233-L264 |
236,126 | CampusUnion/Sked | src/Database/SkeModelPDO.php | SkeModelPDO.find | public function find(int $iId)
{
$oSelect = $this->oConnector->prepare('SELECT * FROM sked_events WHERE id = :id');
if (!$oSelect->execute([':id' => $iId]))
throw new \Exception(__METHOD__ . ' - ' . $oSelect->errorInfo()[2]);
return $oSelect->fetch(\PDO::FETCH_ASSOC);
} | php | public function find(int $iId)
{
$oSelect = $this->oConnector->prepare('SELECT * FROM sked_events WHERE id = :id');
if (!$oSelect->execute([':id' => $iId]))
throw new \Exception(__METHOD__ . ' - ' . $oSelect->errorInfo()[2]);
return $oSelect->fetch(\PDO::FETCH_ASSOC);
} | [
"public",
"function",
"find",
"(",
"int",
"$",
"iId",
")",
"{",
"$",
"oSelect",
"=",
"$",
"this",
"->",
"oConnector",
"->",
"prepare",
"(",
"'SELECT * FROM sked_events WHERE id = :id'",
")",
";",
"if",
"(",
"!",
"$",
"oSelect",
"->",
"execute",
"(",
"[",
... | Retrieve an event from the database.
@param int $iId
@return array | [
"Retrieve",
"an",
"event",
"from",
"the",
"database",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/Database/SkeModelPDO.php#L46-L52 |
236,127 | CampusUnion/Sked | src/Database/SkeModelPDO.php | SkeModelPDO.queryDay | protected function queryDay(string $strDateStart, string $strDateEnd)
{
$strQuery = $this->querySelectFrom($strDateStart)
. $this->queryJoin()
. $this->queryWhereNotExpired();
// Happening today
$strQuery .= ' AND (';
// Original date matches
... | php | protected function queryDay(string $strDateStart, string $strDateEnd)
{
$strQuery = $this->querySelectFrom($strDateStart)
. $this->queryJoin()
. $this->queryWhereNotExpired();
// Happening today
$strQuery .= ' AND (';
// Original date matches
... | [
"protected",
"function",
"queryDay",
"(",
"string",
"$",
"strDateStart",
",",
"string",
"$",
"strDateEnd",
")",
"{",
"$",
"strQuery",
"=",
"$",
"this",
"->",
"querySelectFrom",
"(",
"$",
"strDateStart",
")",
".",
"$",
"this",
"->",
"queryJoin",
"(",
")",
... | Build the events query for today.
@param string $strDateStart Datetime that today starts.
@param string $strDateEnd Datetime that today ends.
@return array | [
"Build",
"the",
"events",
"query",
"for",
"today",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/Database/SkeModelPDO.php#L61-L138 |
236,128 | CampusUnion/Sked | src/Database/SkeModelPDO.php | SkeModelPDO.queryPDO | private function queryPDO(string $strQuery, array $aParams = [])
{
$oStmt = $this->oConnector->prepare($strQuery);
if (!$oStmt->execute($aParams))
throw new \Exception(__METHOD__ . ' - ' . $oStmt->errorInfo()[2]);
list($strMethod) = explode(' ', trim($strQuery));
switch ... | php | private function queryPDO(string $strQuery, array $aParams = [])
{
$oStmt = $this->oConnector->prepare($strQuery);
if (!$oStmt->execute($aParams))
throw new \Exception(__METHOD__ . ' - ' . $oStmt->errorInfo()[2]);
list($strMethod) = explode(' ', trim($strQuery));
switch ... | [
"private",
"function",
"queryPDO",
"(",
"string",
"$",
"strQuery",
",",
"array",
"$",
"aParams",
"=",
"[",
"]",
")",
"{",
"$",
"oStmt",
"=",
"$",
"this",
"->",
"oConnector",
"->",
"prepare",
"(",
"$",
"strQuery",
")",
";",
"if",
"(",
"!",
"$",
"oSt... | Execute the query with PDO and return results.
@param string $strQuery SQL query.
@param array $aParams Array of parameters to bind.
@return array|int|bool | [
"Execute",
"the",
"query",
"with",
"PDO",
"and",
"return",
"results",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/Database/SkeModelPDO.php#L310-L336 |
236,129 | CampusUnion/Sked | src/Database/SkeModelPDO.php | SkeModelPDO.saveEventMembers | protected function saveEventMembers(int $iEventId, array $aMembers)
{
if (!empty($aMembers)) {
$aExecParams[':sked_event_id'] = $iEventId;
$strQuery = 'INSERT IGNORE INTO `sked_event_members`
(`sked_event_id`, `member_id`, `owner`, `lead_time`, `created_at`) VALUES ';... | php | protected function saveEventMembers(int $iEventId, array $aMembers)
{
if (!empty($aMembers)) {
$aExecParams[':sked_event_id'] = $iEventId;
$strQuery = 'INSERT IGNORE INTO `sked_event_members`
(`sked_event_id`, `member_id`, `owner`, `lead_time`, `created_at`) VALUES ';... | [
"protected",
"function",
"saveEventMembers",
"(",
"int",
"$",
"iEventId",
",",
"array",
"$",
"aMembers",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"aMembers",
")",
")",
"{",
"$",
"aExecParams",
"[",
"':sked_event_id'",
"]",
"=",
"$",
"iEventId",
";",
... | Persist event member data to the database.
@param int $iEventId Event that owns the tags.
@param array $aMembers Array of data to persist.
@return bool Success/failure. | [
"Persist",
"event",
"member",
"data",
"to",
"the",
"database",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/Database/SkeModelPDO.php#L394-L420 |
236,130 | CampusUnion/Sked | src/Database/SkeModelPDO.php | SkeModelPDO.saveEventTags | protected function saveEventTags(int $iEventId, array $aTags)
{
// Delete existing tags
$this->queryPDO(
'DELETE FROM `sked_event_tags` WHERE `sked_event_id` = ?',
[$iEventId]
);
// Create new tags
if (!empty($aTags)) {
$aValueSets = [];
... | php | protected function saveEventTags(int $iEventId, array $aTags)
{
// Delete existing tags
$this->queryPDO(
'DELETE FROM `sked_event_tags` WHERE `sked_event_id` = ?',
[$iEventId]
);
// Create new tags
if (!empty($aTags)) {
$aValueSets = [];
... | [
"protected",
"function",
"saveEventTags",
"(",
"int",
"$",
"iEventId",
",",
"array",
"$",
"aTags",
")",
"{",
"// Delete existing tags",
"$",
"this",
"->",
"queryPDO",
"(",
"'DELETE FROM `sked_event_tags` WHERE `sked_event_id` = ?'",
",",
"[",
"$",
"iEventId",
"]",
"... | Persist event tag data to the database.
@param int $iEventId Event that owns the tags.
@param array $aTags Array of data to persist.
@return bool true On success.
@throws \Exception On failure. | [
"Persist",
"event",
"tag",
"data",
"to",
"the",
"database",
"."
] | 5b51afdb56c0f607e54364635c4725627b19ecc6 | https://github.com/CampusUnion/Sked/blob/5b51afdb56c0f607e54364635c4725627b19ecc6/src/Database/SkeModelPDO.php#L444-L470 |
236,131 | motamonteiro/helpers | src/Traits/DataHelper.php | DataHelper.dataFormatoDestino | public function dataFormatoDestino($data, $formatoDestino)
{
$dataFormatada = false;
if (!$dataFormatada && $this->validarDataPorFormato($data, $this->FORMATO_DATA_SQL)) {
$dataFormatada = $this->dataFormatoOrigemDestino($data, $this->FORMATO_DATA_SQL, $formatoDestino);
}
... | php | public function dataFormatoDestino($data, $formatoDestino)
{
$dataFormatada = false;
if (!$dataFormatada && $this->validarDataPorFormato($data, $this->FORMATO_DATA_SQL)) {
$dataFormatada = $this->dataFormatoOrigemDestino($data, $this->FORMATO_DATA_SQL, $formatoDestino);
}
... | [
"public",
"function",
"dataFormatoDestino",
"(",
"$",
"data",
",",
"$",
"formatoDestino",
")",
"{",
"$",
"dataFormatada",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"dataFormatada",
"&&",
"$",
"this",
"->",
"validarDataPorFormato",
"(",
"$",
"data",
",",
"$",... | Converter uma data identificando o formato origem para o formato destino informado.
@param \DateTime|string $data
@return false|string | [
"Converter",
"uma",
"data",
"identificando",
"o",
"formato",
"origem",
"para",
"o",
"formato",
"destino",
"informado",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/DataHelper.php#L74-L95 |
236,132 | motamonteiro/helpers | src/Traits/DataHelper.php | DataHelper.dataFormatoOrigemDestino | public function dataFormatoOrigemDestino($data, $formatoOrigem, $formatoDestino)
{
$data = $this->converterParaDateTime($data, $formatoOrigem);
if (!$data) {
return false;
}
return ($data->format($formatoDestino));
} | php | public function dataFormatoOrigemDestino($data, $formatoOrigem, $formatoDestino)
{
$data = $this->converterParaDateTime($data, $formatoOrigem);
if (!$data) {
return false;
}
return ($data->format($formatoDestino));
} | [
"public",
"function",
"dataFormatoOrigemDestino",
"(",
"$",
"data",
",",
"$",
"formatoOrigem",
",",
"$",
"formatoDestino",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"converterParaDateTime",
"(",
"$",
"data",
",",
"$",
"formatoOrigem",
")",
";",
"if",
... | Converter uma data de um formato origem para um formato destino.
@param \DateTime|string $data
@param $formatoOrigem
@param $formatoDestino
@return false|string | [
"Converter",
"uma",
"data",
"de",
"um",
"formato",
"origem",
"para",
"um",
"formato",
"destino",
"."
] | 4cd246d454968865758e74c5be383063e0f7ccd4 | https://github.com/motamonteiro/helpers/blob/4cd246d454968865758e74c5be383063e0f7ccd4/src/Traits/DataHelper.php#L105-L113 |
236,133 | jayaregalinada/chikka | src/Chikka.php | Chikka.send | public function send($mobileNumber, $message, $messageId = null)
{
return $this->app['chikka.sender']->send($mobileNumber, $message, $messageId);
} | php | public function send($mobileNumber, $message, $messageId = null)
{
return $this->app['chikka.sender']->send($mobileNumber, $message, $messageId);
} | [
"public",
"function",
"send",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
",",
"$",
"messageId",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"[",
"'chikka.sender'",
"]",
"->",
"send",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
","... | Send capability.
@param string $mobileNumber
@param string $message
@param string $messageId
@return \GuzzleHttp\Promise\Promise | [
"Send",
"capability",
"."
] | eefd52c6a7c0e22fe82cef00c52874865456dddf | https://github.com/jayaregalinada/chikka/blob/eefd52c6a7c0e22fe82cef00c52874865456dddf/src/Chikka.php#L63-L66 |
236,134 | jayaregalinada/chikka | src/Chikka.php | Chikka.sendAsync | public function sendAsync($mobileNumber, $message, $messageId = null)
{
return $this->app['chikka.sender']->sendAsync($mobileNumber, $message, $messageId);
} | php | public function sendAsync($mobileNumber, $message, $messageId = null)
{
return $this->app['chikka.sender']->sendAsync($mobileNumber, $message, $messageId);
} | [
"public",
"function",
"sendAsync",
"(",
"$",
"mobileNumber",
",",
"$",
"message",
",",
"$",
"messageId",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"[",
"'chikka.sender'",
"]",
"->",
"sendAsync",
"(",
"$",
"mobileNumber",
",",
"$",
"messa... | Send capability without async.
@param string $mobileNumber
@param string $message
@param string $messageId [description]
@return [type] [description] | [
"Send",
"capability",
"without",
"async",
"."
] | eefd52c6a7c0e22fe82cef00c52874865456dddf | https://github.com/jayaregalinada/chikka/blob/eefd52c6a7c0e22fe82cef00c52874865456dddf/src/Chikka.php#L75-L78 |
236,135 | atelierspierrot/library | src/Library/Helper/File.php | File.getUniqFilename | public static function getUniqFilename($filename = '', $dir = null, $force_file = true, $extension = 'txt')
{
if (empty($filename)) {
return '';
}
$extension = trim($extension, '.');
if (empty($filename)){
$filename = uniqid();
if ($force_file) $f... | php | public static function getUniqFilename($filename = '', $dir = null, $force_file = true, $extension = 'txt')
{
if (empty($filename)) {
return '';
}
$extension = trim($extension, '.');
if (empty($filename)){
$filename = uniqid();
if ($force_file) $f... | [
"public",
"static",
"function",
"getUniqFilename",
"(",
"$",
"filename",
"=",
"''",
",",
"$",
"dir",
"=",
"null",
",",
"$",
"force_file",
"=",
"true",
",",
"$",
"extension",
"=",
"'txt'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
")",
")",
... | Returns a filename or directory that does not exist in the destination
@param string $filename The name of the file or folder you want to create
@param string $dir The destination directory
@param boolean $force_file Should we force the creation of a file, adding an extension? (TRUE by def... | [
"Returns",
"a",
"filename",
"or",
"directory",
"that",
"does",
"not",
"exist",
"in",
"the",
"destination"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/File.php#L51-L74 |
236,136 | atelierspierrot/library | src/Library/Helper/File.php | File.formatFilename | public static function formatFilename($filename = '', $lowercase = false, $delimiter = '-')
{
if (empty($filename)) {
return '';
}
$_ext = self::getExtension($filename, true);
if ($_ext) {
$filename = str_replace($_ext, '', $filename);
}
$str... | php | public static function formatFilename($filename = '', $lowercase = false, $delimiter = '-')
{
if (empty($filename)) {
return '';
}
$_ext = self::getExtension($filename, true);
if ($_ext) {
$filename = str_replace($_ext, '', $filename);
}
$str... | [
"public",
"static",
"function",
"formatFilename",
"(",
"$",
"filename",
"=",
"''",
",",
"$",
"lowercase",
"=",
"false",
",",
"$",
"delimiter",
"=",
"'-'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
")",
")",
"{",
"return",
"''",
";",
"}",
... | Formatting file names
@param string $filename The filename to format
@param boolean $lowercase Should we return the name un lowercase (FALSE by default)
@param string $delimiter The delimiter used for special chars substitution
@return string A filename valid on (almost) all systems | [
"Formatting",
"file",
"names"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/File.php#L84-L112 |
236,137 | atelierspierrot/library | src/Library/Helper/File.php | File.getExtension | public static function getExtension($filename = '', $dot = false)
{
if (empty($filename)) {
return '';
}
$exploded_file_name = explode('.', $filename);
return (strpos($filename, '.') ? ($dot ? '.' : '').end($exploded_file_name) : null);
} | php | public static function getExtension($filename = '', $dot = false)
{
if (empty($filename)) {
return '';
}
$exploded_file_name = explode('.', $filename);
return (strpos($filename, '.') ? ($dot ? '.' : '').end($exploded_file_name) : null);
} | [
"public",
"static",
"function",
"getExtension",
"(",
"$",
"filename",
"=",
"''",
",",
"$",
"dot",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
"exploded_file_name",
"=",
"explode",
"(... | Returns the extension of a file name
It basically returns everything after last dot. No validation is done.
@param string $filename The file_name to work on
@param bool $dot
@return null|string The extension if found, `null` otherwise | [
"Returns",
"the",
"extension",
"of",
"a",
"file",
"name"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/File.php#L123-L130 |
236,138 | atelierspierrot/library | src/Library/Helper/File.php | File.touch | public static function touch($file_path = null, array &$logs = array())
{
if (is_null($file_path)) {
return null;
}
if (!file_exists($file_path)) {
$target_dir = dirname($file_path);
$ok = !file_exists($target_dir) ? Directory::create($target_dir) : true;
... | php | public static function touch($file_path = null, array &$logs = array())
{
if (is_null($file_path)) {
return null;
}
if (!file_exists($file_path)) {
$target_dir = dirname($file_path);
$ok = !file_exists($target_dir) ? Directory::create($target_dir) : true;
... | [
"public",
"static",
"function",
"touch",
"(",
"$",
"file_path",
"=",
"null",
",",
"array",
"&",
"$",
"logs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"file_path",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",... | Create an empty file or touch an existing file
@param string $file_path
@param array $logs Logs registry passed by reference
@return bool | [
"Create",
"an",
"empty",
"file",
"or",
"touch",
"an",
"existing",
"file"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/File.php#L204-L222 |
236,139 | atelierspierrot/library | src/Library/Helper/File.php | File.remove | public static function remove($file_path = null, array &$logs = array())
{
if (is_null($file_path)) {
return null;
}
if (file_exists($file_path)) {
if (unlink($file_path)) {
clearstatcache();
return true;
} else {
... | php | public static function remove($file_path = null, array &$logs = array())
{
if (is_null($file_path)) {
return null;
}
if (file_exists($file_path)) {
if (unlink($file_path)) {
clearstatcache();
return true;
} else {
... | [
"public",
"static",
"function",
"remove",
"(",
"$",
"file_path",
"=",
"null",
",",
"array",
"&",
"$",
"logs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"file_path",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"fi... | Remove a file if it exists
@param string $file_path
@param array $logs Logs registry passed by reference
@return bool | [
"Remove",
"a",
"file",
"if",
"it",
"exists"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/File.php#L231-L247 |
236,140 | atelierspierrot/library | src/Library/Helper/File.php | File.write | public static function write($file_path = null, $content, $type = 'a', $force = false, array &$logs = array())
{
if (is_null($file_path)) {
return null;
}
if (!file_exists($file_path)) {
if (true===$force) {
self::touch($file_path, $logs);
... | php | public static function write($file_path = null, $content, $type = 'a', $force = false, array &$logs = array())
{
if (is_null($file_path)) {
return null;
}
if (!file_exists($file_path)) {
if (true===$force) {
self::touch($file_path, $logs);
... | [
"public",
"static",
"function",
"write",
"(",
"$",
"file_path",
"=",
"null",
",",
"$",
"content",
",",
"$",
"type",
"=",
"'a'",
",",
"$",
"force",
"=",
"false",
",",
"array",
"&",
"$",
"logs",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_null... | Write a content in a file
@param string $file_path
@param string $content
@param string $type
@param bool $force
@param array $logs
@return bool | [
"Write",
"a",
"content",
"in",
"a",
"file"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/Helper/File.php#L295-L317 |
236,141 | webriq/core | module/Customize/src/Grid/Customize/Model/Sheet/Mapper.php | Mapper.find | public function find( $primaryKeys )
{
if ( is_array( $primaryKeys ) )
{
$primaryKeys = reset( $primaryKeys );
}
$rootId = ( (int) $primaryKeys ) ?: null;
return $this->createStructure( array(
'rootId' => $rootId,
'extra' => $this-... | php | public function find( $primaryKeys )
{
if ( is_array( $primaryKeys ) )
{
$primaryKeys = reset( $primaryKeys );
}
$rootId = ( (int) $primaryKeys ) ?: null;
return $this->createStructure( array(
'rootId' => $rootId,
'extra' => $this-... | [
"public",
"function",
"find",
"(",
"$",
"primaryKeys",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"primaryKeys",
")",
")",
"{",
"$",
"primaryKeys",
"=",
"reset",
"(",
"$",
"primaryKeys",
")",
";",
"}",
"$",
"rootId",
"=",
"(",
"(",
"int",
")",
"$",... | Find a structure by root paragraph id
@param int|array $primaryKeys
@return Structure | [
"Find",
"a",
"structure",
"by",
"root",
"paragraph",
"id"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/Sheet/Mapper.php#L240-L259 |
236,142 | webriq/core | module/Customize/src/Grid/Customize/Model/Sheet/Mapper.php | Mapper.findByExtra | public function findByExtra( ExtraStructure $extra )
{
$rootId = $extra->rootParagraphId;
return $this->createStructure( array(
'rootId' => $rootId,
'extra' => $extra,
'rules' => $this->getRuleMapper()
->findAllByRoot(
... | php | public function findByExtra( ExtraStructure $extra )
{
$rootId = $extra->rootParagraphId;
return $this->createStructure( array(
'rootId' => $rootId,
'extra' => $extra,
'rules' => $this->getRuleMapper()
->findAllByRoot(
... | [
"public",
"function",
"findByExtra",
"(",
"ExtraStructure",
"$",
"extra",
")",
"{",
"$",
"rootId",
"=",
"$",
"extra",
"->",
"rootParagraphId",
";",
"return",
"$",
"this",
"->",
"createStructure",
"(",
"array",
"(",
"'rootId'",
"=>",
"$",
"rootId",
",",
"'e... | Find a structure by its extra structure
@param int|array $primaryKeys
@return Structure | [
"Find",
"a",
"structure",
"by",
"its",
"extra",
"structure"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Customize/src/Grid/Customize/Model/Sheet/Mapper.php#L267-L280 |
236,143 | hschulz/data-structures | src/Queue/PriorityQueue.php | PriorityQueue.toArray | public function toArray(): array
{
/* Enable extraction of data and priority */
$this->setExtractFlags(self::EXTR_BOTH);
/* Prepare output */
$data = [];
/* Iterate yourself */
foreach ($this as $item) {
$data[] = $item;
}
return $data;
... | php | public function toArray(): array
{
/* Enable extraction of data and priority */
$this->setExtractFlags(self::EXTR_BOTH);
/* Prepare output */
$data = [];
/* Iterate yourself */
foreach ($this as $item) {
$data[] = $item;
}
return $data;
... | [
"public",
"function",
"toArray",
"(",
")",
":",
"array",
"{",
"/* Enable extraction of data and priority */",
"$",
"this",
"->",
"setExtractFlags",
"(",
"self",
"::",
"EXTR_BOTH",
")",
";",
"/* Prepare output */",
"$",
"data",
"=",
"[",
"]",
";",
"/* Iterate yours... | Iterates the queue and returns an array containing each item with
the data and priority set.
@return array The array representation of the queue | [
"Iterates",
"the",
"queue",
"and",
"returns",
"an",
"array",
"containing",
"each",
"item",
"with",
"the",
"data",
"and",
"priority",
"set",
"."
] | b563be1ecde746fe32dd8bcbf72cbbf4ea522075 | https://github.com/hschulz/data-structures/blob/b563be1ecde746fe32dd8bcbf72cbbf4ea522075/src/Queue/PriorityQueue.php#L27-L41 |
236,144 | hschulz/data-structures | src/Queue/PriorityQueue.php | PriorityQueue.insert | public function insert($data, $priority = self::PIRORITY_DEFAULT): void
{
parent::insert($data, $priority);
} | php | public function insert($data, $priority = self::PIRORITY_DEFAULT): void
{
parent::insert($data, $priority);
} | [
"public",
"function",
"insert",
"(",
"$",
"data",
",",
"$",
"priority",
"=",
"self",
"::",
"PIRORITY_DEFAULT",
")",
":",
"void",
"{",
"parent",
"::",
"insert",
"(",
"$",
"data",
",",
"$",
"priority",
")",
";",
"}"
] | Allows inserting data into the queue without explicitly setting a
priority value. Inserts without a priority will use the PRIORITY_DEFAULT
value.
@param mixed $data The data to insert
@param mixed $priority The priority
@return void | [
"Allows",
"inserting",
"data",
"into",
"the",
"queue",
"without",
"explicitly",
"setting",
"a",
"priority",
"value",
".",
"Inserts",
"without",
"a",
"priority",
"will",
"use",
"the",
"PRIORITY_DEFAULT",
"value",
"."
] | b563be1ecde746fe32dd8bcbf72cbbf4ea522075 | https://github.com/hschulz/data-structures/blob/b563be1ecde746fe32dd8bcbf72cbbf4ea522075/src/Queue/PriorityQueue.php#L52-L55 |
236,145 | hschulz/data-structures | src/Queue/PriorityQueue.php | PriorityQueue.unserialize | public function unserialize($queue)
{
foreach (unserialize($queue) as $item) {
$this->insert($item['data'], $item['priority']);
}
} | php | public function unserialize($queue)
{
foreach (unserialize($queue) as $item) {
$this->insert($item['data'], $item['priority']);
}
} | [
"public",
"function",
"unserialize",
"(",
"$",
"queue",
")",
"{",
"foreach",
"(",
"unserialize",
"(",
"$",
"queue",
")",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"insert",
"(",
"$",
"item",
"[",
"'data'",
"]",
",",
"$",
"item",
"[",
"'priori... | Unserializes the queue.
@param string $queue The serialized queue data
@return void | [
"Unserializes",
"the",
"queue",
"."
] | b563be1ecde746fe32dd8bcbf72cbbf4ea522075 | https://github.com/hschulz/data-structures/blob/b563be1ecde746fe32dd8bcbf72cbbf4ea522075/src/Queue/PriorityQueue.php#L73-L78 |
236,146 | hschulz/data-structures | src/Queue/PriorityQueue.php | PriorityQueue.merge | public function merge(self $queue): void
{
$data = $queue->toArray();
foreach ($data as $item) {
$this->insert($item['data'], $item['priority']);
}
} | php | public function merge(self $queue): void
{
$data = $queue->toArray();
foreach ($data as $item) {
$this->insert($item['data'], $item['priority']);
}
} | [
"public",
"function",
"merge",
"(",
"self",
"$",
"queue",
")",
":",
"void",
"{",
"$",
"data",
"=",
"$",
"queue",
"->",
"toArray",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"item",
")",
"{",
"$",
"this",
"->",
"insert",
"(",
"$",
"i... | Merges the given queue data into this queue.
@param PriorityQueue $queue The queue to merge
@return void | [
"Merges",
"the",
"given",
"queue",
"data",
"into",
"this",
"queue",
"."
] | b563be1ecde746fe32dd8bcbf72cbbf4ea522075 | https://github.com/hschulz/data-structures/blob/b563be1ecde746fe32dd8bcbf72cbbf4ea522075/src/Queue/PriorityQueue.php#L86-L93 |
236,147 | ItinerisLtd/preflight-command | src/CLI/ResultCollectionPresenter.php | ResultCollectionPresenter.display | public static function display(array $assocArgs, ResultCollection $resultCollection): void
{
// TODO: Use null coalescing assignment operator.
$assocArgs['fields'] = $assocArgs['fields'] ?? self::DEFAULT_FIELDS;
$formatter = new Formatter($assocArgs, $assocArgs['fields']);
$formatte... | php | public static function display(array $assocArgs, ResultCollection $resultCollection): void
{
// TODO: Use null coalescing assignment operator.
$assocArgs['fields'] = $assocArgs['fields'] ?? self::DEFAULT_FIELDS;
$formatter = new Formatter($assocArgs, $assocArgs['fields']);
$formatte... | [
"public",
"static",
"function",
"display",
"(",
"array",
"$",
"assocArgs",
",",
"ResultCollection",
"$",
"resultCollection",
")",
":",
"void",
"{",
"// TODO: Use null coalescing assignment operator.",
"$",
"assocArgs",
"[",
"'fields'",
"]",
"=",
"$",
"assocArgs",
"[... | Display a result collection in a given format.
@param array $assocArgs Associative CLI argument.
@param ResultCollection $resultCollection The checker collection instance. | [
"Display",
"a",
"result",
"collection",
"in",
"a",
"given",
"format",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/CLI/ResultCollectionPresenter.php#L28-L38 |
236,148 | ItinerisLtd/preflight-command | src/CLI/ResultCollectionPresenter.php | ResultCollectionPresenter.toTable | private static function toTable(ResultCollection $resultCollection): array
{
return array_map(function (ResultInterface $result): array {
return self::toRow($result);
}, $resultCollection->all());
} | php | private static function toTable(ResultCollection $resultCollection): array
{
return array_map(function (ResultInterface $result): array {
return self::toRow($result);
}, $resultCollection->all());
} | [
"private",
"static",
"function",
"toTable",
"(",
"ResultCollection",
"$",
"resultCollection",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"ResultInterface",
"$",
"result",
")",
":",
"array",
"{",
"return",
"self",
"::",
"toRow",
"(",
... | Converts the underlying results into a plain PHP array which printable on console tables.
@param ResultCollection $resultCollection The result collection instance.
@return array | [
"Converts",
"the",
"underlying",
"results",
"into",
"a",
"plain",
"PHP",
"array",
"which",
"printable",
"on",
"console",
"tables",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/CLI/ResultCollectionPresenter.php#L47-L52 |
236,149 | ItinerisLtd/preflight-command | src/CLI/ResultCollectionPresenter.php | ResultCollectionPresenter.toRow | private static function toRow(ResultInterface $result): array
{
$row = [
'id' => $result->getChecker()->getId(),
'link' => $result->getChecker()->getLink(),
'description' => $result->getChecker()->getDescription(),
'status' => $result->getStatus(),
... | php | private static function toRow(ResultInterface $result): array
{
$row = [
'id' => $result->getChecker()->getId(),
'link' => $result->getChecker()->getLink(),
'description' => $result->getChecker()->getDescription(),
'status' => $result->getStatus(),
... | [
"private",
"static",
"function",
"toRow",
"(",
"ResultInterface",
"$",
"result",
")",
":",
"array",
"{",
"$",
"row",
"=",
"[",
"'id'",
"=>",
"$",
"result",
"->",
"getChecker",
"(",
")",
"->",
"getId",
"(",
")",
",",
"'link'",
"=>",
"$",
"result",
"->... | Converts the underlying result into a plain PHP array which printable as console table row.
Note: One checker might yields multiple result instances.
@param ResultInterface $result The result instance.
@return array | [
"Converts",
"the",
"underlying",
"result",
"into",
"a",
"plain",
"PHP",
"array",
"which",
"printable",
"as",
"console",
"table",
"row",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/CLI/ResultCollectionPresenter.php#L63-L77 |
236,150 | ItinerisLtd/preflight-command | src/CLI/ResultCollectionPresenter.php | ResultCollectionPresenter.colorize | private static function colorize(ResultInterface $result, string $text): string
{
$colors = [
Success::class => '%G',
Disabled::class => '%P',
Failure::class => '%R',
Error::class => '%1%w',
'reset' => '%n',
];
$color = $colors[get... | php | private static function colorize(ResultInterface $result, string $text): string
{
$colors = [
Success::class => '%G',
Disabled::class => '%P',
Failure::class => '%R',
Error::class => '%1%w',
'reset' => '%n',
];
$color = $colors[get... | [
"private",
"static",
"function",
"colorize",
"(",
"ResultInterface",
"$",
"result",
",",
"string",
"$",
"text",
")",
":",
"string",
"{",
"$",
"colors",
"=",
"[",
"Success",
"::",
"class",
"=>",
"'%G'",
",",
"Disabled",
"::",
"class",
"=>",
"'%P'",
",",
... | Colorize a string for output.
@param ResultInterface $result The result instance.
@param string $text The text to be printed.
@return string | [
"Colorize",
"a",
"string",
"for",
"output",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/CLI/ResultCollectionPresenter.php#L87-L100 |
236,151 | nirix/radium | src/Http/Response.php | Response.header | public function header($header, $value, $replace = true)
{
$this->headers[] = array($header, $value, $replace);
} | php | public function header($header, $value, $replace = true)
{
$this->headers[] = array($header, $value, $replace);
} | [
"public",
"function",
"header",
"(",
"$",
"header",
",",
"$",
"value",
",",
"$",
"replace",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"headers",
"[",
"]",
"=",
"array",
"(",
"$",
"header",
",",
"$",
"value",
",",
"$",
"replace",
")",
";",
"}"
] | Sets a response header.
@param string $header
@param string $value | [
"Sets",
"a",
"response",
"header",
"."
] | cc6907bfee296b64a7630b0b188e233d7cdb86fd | https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Http/Response.php#L89-L92 |
236,152 | heyday/heystack-ecommerce-core | src/Currency/Input/Processor.php | Processor.process | public function process(\SS_HTTPRequest $request)
{
if ($identifier = $request->param('ID')) {
if ($this->currencyService->setActiveCurrency(new Identifier($identifier))) {
return [
'Success' => true
];
}
}
return [... | php | public function process(\SS_HTTPRequest $request)
{
if ($identifier = $request->param('ID')) {
if ($this->currencyService->setActiveCurrency(new Identifier($identifier))) {
return [
'Success' => true
];
}
}
return [... | [
"public",
"function",
"process",
"(",
"\\",
"SS_HTTPRequest",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"identifier",
"=",
"$",
"request",
"->",
"param",
"(",
"'ID'",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currencyService",
"->",
"setActiveCurrenc... | Method to determine how to handle the request.
Uses the currency service to set the active currency
@param \SS_HTTPRequest $request
@return array | [
"Method",
"to",
"determine",
"how",
"to",
"handle",
"the",
"request",
".",
"Uses",
"the",
"currency",
"service",
"to",
"set",
"the",
"active",
"currency"
] | b56c83839cd3396da6bc881d843fcb4f28b74685 | https://github.com/heyday/heystack-ecommerce-core/blob/b56c83839cd3396da6bc881d843fcb4f28b74685/src/Currency/Input/Processor.php#L58-L71 |
236,153 | sellerlabs/nucleus | src/SellerLabs/Nucleus/Transformation/TransformPipeline.php | TransformPipeline.run | public function run(array $input)
{
return Std::foldl(function ($current, TransformInterface $input) {
return $input->run($current);
}, $input, $this->transforms);
} | php | public function run(array $input)
{
return Std::foldl(function ($current, TransformInterface $input) {
return $input->run($current);
}, $input, $this->transforms);
} | [
"public",
"function",
"run",
"(",
"array",
"$",
"input",
")",
"{",
"return",
"Std",
"::",
"foldl",
"(",
"function",
"(",
"$",
"current",
",",
"TransformInterface",
"$",
"input",
")",
"{",
"return",
"$",
"input",
"->",
"run",
"(",
"$",
"current",
")",
... | Run the input through the pipeline.
@param array $input
@return array | [
"Run",
"the",
"input",
"through",
"the",
"pipeline",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Transformation/TransformPipeline.php#L73-L78 |
236,154 | takatost/php-pubsub-cmq | src/CMQPubSubAdapter.php | CMQPubSubAdapter.subscribe | public function subscribe($topicQueueName, callable $handler)
{
$isSubscriptionLoopActive = true;
while ($isSubscriptionLoopActive) {
$request = new SubscribeMessageRequest([
'queueName' => $topicQueueName,
'pollingWaitSeconds' => 0,
]... | php | public function subscribe($topicQueueName, callable $handler)
{
$isSubscriptionLoopActive = true;
while ($isSubscriptionLoopActive) {
$request = new SubscribeMessageRequest([
'queueName' => $topicQueueName,
'pollingWaitSeconds' => 0,
]... | [
"public",
"function",
"subscribe",
"(",
"$",
"topicQueueName",
",",
"callable",
"$",
"handler",
")",
"{",
"$",
"isSubscriptionLoopActive",
"=",
"true",
";",
"while",
"(",
"$",
"isSubscriptionLoopActive",
")",
"{",
"$",
"request",
"=",
"new",
"SubscribeMessageReq... | Subscribe a handler to a topic queue.
@param string $topicQueueName
@param callable $handler
@throws RequestException
@throws ResponseException
@throws \Exception | [
"Subscribe",
"a",
"handler",
"to",
"a",
"topic",
"queue",
"."
] | 74c980b5dd4e98150d01b8e50d3dfb9a02c7d4fd | https://github.com/takatost/php-pubsub-cmq/blob/74c980b5dd4e98150d01b8e50d3dfb9a02c7d4fd/src/CMQPubSubAdapter.php#L50-L87 |
236,155 | titon/model | src/Titon/Model/Relation.php | Relation.detectForeignKey | public function detectForeignKey($config, $class) {
$foreignKey = $this->getConfig($config);
if (!$foreignKey) {
$foreignKey = $this->buildForeignKey($class);
$this->setConfig($config, $foreignKey);
}
return $foreignKey;
} | php | public function detectForeignKey($config, $class) {
$foreignKey = $this->getConfig($config);
if (!$foreignKey) {
$foreignKey = $this->buildForeignKey($class);
$this->setConfig($config, $foreignKey);
}
return $foreignKey;
} | [
"public",
"function",
"detectForeignKey",
"(",
"$",
"config",
",",
"$",
"class",
")",
"{",
"$",
"foreignKey",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"$",
"config",
")",
";",
"if",
"(",
"!",
"$",
"foreignKey",
")",
"{",
"$",
"foreignKey",
"=",
"$",... | Return a foreign key either for the primary or related model.
If no foreign key is defined, automatically inflect one and set it.
@param string $config
@param string $class
@return string | [
"Return",
"a",
"foreign",
"key",
"either",
"for",
"the",
"primary",
"or",
"related",
"model",
".",
"If",
"no",
"foreign",
"key",
"is",
"defined",
"automatically",
"inflect",
"one",
"and",
"set",
"it",
"."
] | 274e3810c2cfbb6818a388daaa462ff05de99cbd | https://github.com/titon/model/blob/274e3810c2cfbb6818a388daaa462ff05de99cbd/src/Titon/Model/Relation.php#L142-L152 |
236,156 | titon/model | src/Titon/Model/Relation.php | Relation.getPrimaryModel | public function getPrimaryModel() {
if ($model = $this->_model) {
return $model;
}
$class = $this->getPrimaryClass();
if (!$class) {
return null;
}
$this->setPrimaryModel(new $class());
return $this->_model;
} | php | public function getPrimaryModel() {
if ($model = $this->_model) {
return $model;
}
$class = $this->getPrimaryClass();
if (!$class) {
return null;
}
$this->setPrimaryModel(new $class());
return $this->_model;
} | [
"public",
"function",
"getPrimaryModel",
"(",
")",
"{",
"if",
"(",
"$",
"model",
"=",
"$",
"this",
"->",
"_model",
")",
"{",
"return",
"$",
"model",
";",
"}",
"$",
"class",
"=",
"$",
"this",
"->",
"getPrimaryClass",
"(",
")",
";",
"if",
"(",
"!",
... | Return a primary model object.
@return \Titon\Model\Model | [
"Return",
"a",
"primary",
"model",
"object",
"."
] | 274e3810c2cfbb6818a388daaa462ff05de99cbd | https://github.com/titon/model/blob/274e3810c2cfbb6818a388daaa462ff05de99cbd/src/Titon/Model/Relation.php#L232-L246 |
236,157 | titon/model | src/Titon/Model/Relation.php | Relation.getRelatedModel | public function getRelatedModel() {
if ($model = $this->_relatedModel) {
return $model;
}
$class = $this->getRelatedClass();
$this->setRelatedModel(new $class());
return $this->_relatedModel;
} | php | public function getRelatedModel() {
if ($model = $this->_relatedModel) {
return $model;
}
$class = $this->getRelatedClass();
$this->setRelatedModel(new $class());
return $this->_relatedModel;
} | [
"public",
"function",
"getRelatedModel",
"(",
")",
"{",
"if",
"(",
"$",
"model",
"=",
"$",
"this",
"->",
"_relatedModel",
")",
"{",
"return",
"$",
"model",
";",
"}",
"$",
"class",
"=",
"$",
"this",
"->",
"getRelatedClass",
"(",
")",
";",
"$",
"this",... | Return a related model object.
@return \Titon\Model\Model | [
"Return",
"a",
"related",
"model",
"object",
"."
] | 274e3810c2cfbb6818a388daaa462ff05de99cbd | https://github.com/titon/model/blob/274e3810c2cfbb6818a388daaa462ff05de99cbd/src/Titon/Model/Relation.php#L271-L281 |
236,158 | titon/model | src/Titon/Model/Relation.php | Relation.setPrimaryModel | public function setPrimaryModel(Model $model) {
$this->_model = $model;
$this->setPrimaryClass(get_class($model));
return $this;
} | php | public function setPrimaryModel(Model $model) {
$this->_model = $model;
$this->setPrimaryClass(get_class($model));
return $this;
} | [
"public",
"function",
"setPrimaryModel",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"_model",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"setPrimaryClass",
"(",
"get_class",
"(",
"$",
"model",
")",
")",
";",
"return",
"$",
"this",
";",
... | Set the primary model object.
@param \Titon\Model\Model $model
@return $this | [
"Set",
"the",
"primary",
"model",
"object",
"."
] | 274e3810c2cfbb6818a388daaa462ff05de99cbd | https://github.com/titon/model/blob/274e3810c2cfbb6818a388daaa462ff05de99cbd/src/Titon/Model/Relation.php#L420-L425 |
236,159 | titon/model | src/Titon/Model/Relation.php | Relation.setRelatedModel | public function setRelatedModel(Model $model) {
$this->_relatedModel = $model;
$this->setRelatedClass(get_class($model));
return $this;
} | php | public function setRelatedModel(Model $model) {
$this->_relatedModel = $model;
$this->setRelatedClass(get_class($model));
return $this;
} | [
"public",
"function",
"setRelatedModel",
"(",
"Model",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"_relatedModel",
"=",
"$",
"model",
";",
"$",
"this",
"->",
"setRelatedClass",
"(",
"get_class",
"(",
"$",
"model",
")",
")",
";",
"return",
"$",
"this",
... | Set the related model object.
@param \Titon\Model\Model $model
@return $this | [
"Set",
"the",
"related",
"model",
"object",
"."
] | 274e3810c2cfbb6818a388daaa462ff05de99cbd | https://github.com/titon/model/blob/274e3810c2cfbb6818a388daaa462ff05de99cbd/src/Titon/Model/Relation.php#L457-L462 |
236,160 | remote-office/libx | src/External/SimplePay/User.php | User.setHash | public function setHash($hash)
{
if(!is_string($hash) || strlen(trim($hash)) == 0)
throw new InvalidArgumentException(__METHOD__ . '; Invalid hash, must be a non empty string');
$this->hash = $hash;
} | php | public function setHash($hash)
{
if(!is_string($hash) || strlen(trim($hash)) == 0)
throw new InvalidArgumentException(__METHOD__ . '; Invalid hash, must be a non empty string');
$this->hash = $hash;
} | [
"public",
"function",
"setHash",
"(",
"$",
"hash",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"hash",
")",
"||",
"strlen",
"(",
"trim",
"(",
"$",
"hash",
")",
")",
"==",
"0",
")",
"throw",
"new",
"InvalidArgumentException",
"(",
"__METHOD__",
"... | Set hash of this User
@param string $hash
@return void | [
"Set",
"hash",
"of",
"this",
"User"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/External/SimplePay/User.php#L72-L78 |
236,161 | consigliere/components | src/Publishing/Publisher.php | Publisher.publish | public function publish()
{
if (!$this->console instanceof Command) {
$message = "The 'console' property must instance of \\Illuminate\\Console\\Command.";
throw new \RuntimeException($message);
}
if (!$this->getFilesystem()->isDirectory($sourcePath = $this->getSour... | php | public function publish()
{
if (!$this->console instanceof Command) {
$message = "The 'console' property must instance of \\Illuminate\\Console\\Command.";
throw new \RuntimeException($message);
}
if (!$this->getFilesystem()->isDirectory($sourcePath = $this->getSour... | [
"public",
"function",
"publish",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"console",
"instanceof",
"Command",
")",
"{",
"$",
"message",
"=",
"\"The 'console' property must instance of \\\\Illuminate\\\\Console\\\\Command.\"",
";",
"throw",
"new",
"\\",
"Run... | Publish something. | [
"Publish",
"something",
"."
] | 9b08bb111f0b55b0a860ed9c3407eda0d9cc1252 | https://github.com/consigliere/components/blob/9b08bb111f0b55b0a860ed9c3407eda0d9cc1252/src/Publishing/Publisher.php#L173-L196 |
236,162 | dbtlr/php-env-builder | src/EnvWriter.php | EnvWriter.save | public function save(array $answers)
{
$path = $this->directory . DIRECTORY_SEPARATOR . $this->file;
if (!file_exists($path)) {
if (!is_writable($this->directory)) {
throw new WritableException(
sprintf(
'The env file is not pr... | php | public function save(array $answers)
{
$path = $this->directory . DIRECTORY_SEPARATOR . $this->file;
if (!file_exists($path)) {
if (!is_writable($this->directory)) {
throw new WritableException(
sprintf(
'The env file is not pr... | [
"public",
"function",
"save",
"(",
"array",
"$",
"answers",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"directory",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"this",
"->",
"file",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
")",
")",
"{",
... | Save the given answers to the env file.
@throws WritableException
@param array $answers | [
"Save",
"the",
"given",
"answers",
"to",
"the",
"env",
"file",
"."
] | 94b78bcd308d58dc7994164a87e80fe39ed871c7 | https://github.com/dbtlr/php-env-builder/blob/94b78bcd308d58dc7994164a87e80fe39ed871c7/src/EnvWriter.php#L32-L59 |
236,163 | oaugustus/direct-silex-provider | src/Direct/Router/Request.php | Request.getCalls | public function getCalls()
{
if (null == $this->calls) {
$this->calls = $this->extractCalls();
}
return $this->calls;
} | php | public function getCalls()
{
if (null == $this->calls) {
$this->calls = $this->extractCalls();
}
return $this->calls;
} | [
"public",
"function",
"getCalls",
"(",
")",
"{",
"if",
"(",
"null",
"==",
"$",
"this",
"->",
"calls",
")",
"{",
"$",
"this",
"->",
"calls",
"=",
"$",
"this",
"->",
"extractCalls",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"calls",
";",
"}"... | Get the direct calls object.
@return array | [
"Get",
"the",
"direct",
"calls",
"object",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Request.php#L96-L103 |
236,164 | oaugustus/direct-silex-provider | src/Direct/Router/Request.php | Request.extractCalls | public function extractCalls()
{
$calls = array();
if ('form' == $this->callType) {
$calls[] = new Call($this->post, 'form');
} else {
$decoded = json_decode($this->rawPost);
$decoded = !is_array($decoded) ? array($decoded)... | php | public function extractCalls()
{
$calls = array();
if ('form' == $this->callType) {
$calls[] = new Call($this->post, 'form');
} else {
$decoded = json_decode($this->rawPost);
$decoded = !is_array($decoded) ? array($decoded)... | [
"public",
"function",
"extractCalls",
"(",
")",
"{",
"$",
"calls",
"=",
"array",
"(",
")",
";",
"if",
"(",
"'form'",
"==",
"$",
"this",
"->",
"callType",
")",
"{",
"$",
"calls",
"[",
"]",
"=",
"new",
"Call",
"(",
"$",
"this",
"->",
"post",
",",
... | Extract the ExtDirect calls from request.
@return array | [
"Extract",
"the",
"ExtDirect",
"calls",
"from",
"request",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Request.php#L110-L131 |
236,165 | oaugustus/direct-silex-provider | src/Direct/Router/Request.php | Request.parseRawToArray | private function parseRawToArray(&$value, &$key)
{
// parse a json string to an array
if (is_string($value)) {
$pos = substr($value,0,1);
if ($pos == '[' || $pos == '(' || $pos == '{') {
$json = json_decode($value);
} else {
... | php | private function parseRawToArray(&$value, &$key)
{
// parse a json string to an array
if (is_string($value)) {
$pos = substr($value,0,1);
if ($pos == '[' || $pos == '(' || $pos == '{') {
$json = json_decode($value);
} else {
... | [
"private",
"function",
"parseRawToArray",
"(",
"&",
"$",
"value",
",",
"&",
"$",
"key",
")",
"{",
"// parse a json string to an array",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"$",
"pos",
"=",
"substr",
"(",
"$",
"value",
",",
"0",
",... | Parse a raw http post to a php array.
@param mixed $value
@param string $key | [
"Parse",
"a",
"raw",
"http",
"post",
"to",
"a",
"php",
"array",
"."
] | 8d92afdf5ede04c3048cde82b9879de7e1d6c153 | https://github.com/oaugustus/direct-silex-provider/blob/8d92afdf5ede04c3048cde82b9879de7e1d6c153/src/Direct/Router/Request.php#L152-L187 |
236,166 | SagePHP/System | src/SagePHP/System/Exec.php | Exec.run | public function run()
{
$process = $this->getProcessExecutor();
$process->setCommandLine($this->getCommand());
$logger = function ($error, $line) {
call_user_func_array(array($this, 'logLine'), array($error, $line));
};
return $process->run($logger);
} | php | public function run()
{
$process = $this->getProcessExecutor();
$process->setCommandLine($this->getCommand());
$logger = function ($error, $line) {
call_user_func_array(array($this, 'logLine'), array($error, $line));
};
return $process->run($logger);
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"process",
"=",
"$",
"this",
"->",
"getProcessExecutor",
"(",
")",
";",
"$",
"process",
"->",
"setCommandLine",
"(",
"$",
"this",
"->",
"getCommand",
"(",
")",
")",
";",
"$",
"logger",
"=",
"function",
... | executes the command.
@return integer the return code of the executed command | [
"executes",
"the",
"command",
"."
] | 4fbac093c16c65607e75dc31b54be9593b82c56a | https://github.com/SagePHP/System/blob/4fbac093c16c65607e75dc31b54be9593b82c56a/src/SagePHP/System/Exec.php#L98-L108 |
236,167 | SagePHP/System | src/SagePHP/System/Exec.php | Exec.logLine | protected function logLine($messageType, $messageText)
{
switch ($messageType) {
case Process::ERR:
$typeStr = "[Error]";
break;
default:
$typeStr = "";
break;
}
echo sprintf("\n%s %s\n", $typeStr, $mess... | php | protected function logLine($messageType, $messageText)
{
switch ($messageType) {
case Process::ERR:
$typeStr = "[Error]";
break;
default:
$typeStr = "";
break;
}
echo sprintf("\n%s %s\n", $typeStr, $mess... | [
"protected",
"function",
"logLine",
"(",
"$",
"messageType",
",",
"$",
"messageText",
")",
"{",
"switch",
"(",
"$",
"messageType",
")",
"{",
"case",
"Process",
"::",
"ERR",
":",
"$",
"typeStr",
"=",
"\"[Error]\"",
";",
"break",
";",
"default",
":",
"$",
... | logs a line from the command output
@return [type] | [
"logs",
"a",
"line",
"from",
"the",
"command",
"output"
] | 4fbac093c16c65607e75dc31b54be9593b82c56a | https://github.com/SagePHP/System/blob/4fbac093c16c65607e75dc31b54be9593b82c56a/src/SagePHP/System/Exec.php#L137-L149 |
236,168 | kreta-plugins/VCS | src/Kreta/Component/VCS/EventSubscriber/DoctrineEventSubscriber.php | DoctrineEventSubscriber.postPersist | public function postPersist(LifecycleEventArgs $args)
{
if ($args->getObject() instanceof CommitInterface) {
$this->dispatcher->dispatch(NewCommitEvent::NAME, new NewCommitEvent($args->getObject()));
} elseif ($args->getObject() instanceof BranchInterface) {
$this->dispatcher... | php | public function postPersist(LifecycleEventArgs $args)
{
if ($args->getObject() instanceof CommitInterface) {
$this->dispatcher->dispatch(NewCommitEvent::NAME, new NewCommitEvent($args->getObject()));
} elseif ($args->getObject() instanceof BranchInterface) {
$this->dispatcher... | [
"public",
"function",
"postPersist",
"(",
"LifecycleEventArgs",
"$",
"args",
")",
"{",
"if",
"(",
"$",
"args",
"->",
"getObject",
"(",
")",
"instanceof",
"CommitInterface",
")",
"{",
"$",
"this",
"->",
"dispatcher",
"->",
"dispatch",
"(",
"NewCommitEvent",
"... | Handles postPersist event triggered by doctrine.
@param \Doctrine\ORM\Event\LifecycleEventArgs $args The arguments | [
"Handles",
"postPersist",
"event",
"triggered",
"by",
"doctrine",
"."
] | 0b6daae2b8044d9250adc8009d03a6745370cd2e | https://github.com/kreta-plugins/VCS/blob/0b6daae2b8044d9250adc8009d03a6745370cd2e/src/Kreta/Component/VCS/EventSubscriber/DoctrineEventSubscriber.php#L62-L69 |
236,169 | NitroXy/php-forms | src/lib/FormUtils.php | FormUtils.serializeAttr | public static function serializeAttr(array $data, array $order=[]){
$attr = [];
/* convert data to sorted array */
$sorted = static::sortedAttr($data, $order);
foreach ( $sorted as list($key, $value) ){
if ( is_array($value) ){
/* ignore empty arrays */
if ( count($value) === 0 ){
continue;
... | php | public static function serializeAttr(array $data, array $order=[]){
$attr = [];
/* convert data to sorted array */
$sorted = static::sortedAttr($data, $order);
foreach ( $sorted as list($key, $value) ){
if ( is_array($value) ){
/* ignore empty arrays */
if ( count($value) === 0 ){
continue;
... | [
"public",
"static",
"function",
"serializeAttr",
"(",
"array",
"$",
"data",
",",
"array",
"$",
"order",
"=",
"[",
"]",
")",
"{",
"$",
"attr",
"=",
"[",
"]",
";",
"/* convert data to sorted array */",
"$",
"sorted",
"=",
"static",
"::",
"sortedAttr",
"(",
... | Takes key-value array and serializes them to a string as
'key="value" foo="bar"'.
['foo' => 'bar'] becomes foo="bar".
['class' => ['foo', 'bar'] becomes class="foo bar"
['data' => ['foo' => 'bar'] becomes data-foo="bar"
@param $data Data to serializeattr
@param $order Array with predefined order keys shou... | [
"Takes",
"key",
"-",
"value",
"array",
"and",
"serializes",
"them",
"to",
"a",
"string",
"as",
"key",
"=",
"value",
"foo",
"=",
"bar",
"."
] | 28970779c3b438372c83f4f651a9897a542c1e54 | https://github.com/NitroXy/php-forms/blob/28970779c3b438372c83f4f651a9897a542c1e54/src/lib/FormUtils.php#L18-L46 |
236,170 | zicht/version | src/Zicht/Version/Constraint.php | Constraint.fromString | public static function fromString($constraintExpression)
{
if (!preg_match('/^(==?|\!=?|~|[<>]=?)?((?:\*|[0-9]+)(?:.(?:\*|[0-9]+))*)(?:\@(\w+))?$/', $constraintExpression, $m)) {
throw new \InvalidArgumentException("Constraint expression '$constraintExpression' could not be parsed");
}
... | php | public static function fromString($constraintExpression)
{
if (!preg_match('/^(==?|\!=?|~|[<>]=?)?((?:\*|[0-9]+)(?:.(?:\*|[0-9]+))*)(?:\@(\w+))?$/', $constraintExpression, $m)) {
throw new \InvalidArgumentException("Constraint expression '$constraintExpression' could not be parsed");
}
... | [
"public",
"static",
"function",
"fromString",
"(",
"$",
"constraintExpression",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^(==?|\\!=?|~|[<>]=?)?((?:\\*|[0-9]+)(?:.(?:\\*|[0-9]+))*)(?:\\@(\\w+))?$/'",
",",
"$",
"constraintExpression",
",",
"$",
"m",
")",
")",
"{",
... | Construct a Constraint instance based on the passed string constraint.
@param string $constraintExpression
@return Constraint
@throws \InvalidArgumentException | [
"Construct",
"a",
"Constraint",
"instance",
"based",
"on",
"the",
"passed",
"string",
"constraint",
"."
] | 2653209f2620e1d4a8baf17a0b5b74fd339abba3 | https://github.com/zicht/version/blob/2653209f2620e1d4a8baf17a0b5b74fd339abba3/src/Zicht/Version/Constraint.php#L43-L53 |
236,171 | zicht/version | src/Zicht/Version/Constraint.php | Constraint.match | public function match(Version $version)
{
$versionStabilityIndex = array_search($version->getStability(), Version::$stabilities);
$constraintStabilityIndex = array_search($this->stability, Version::$stabilities);
if ($this->compare($versionStabilityIndex, $constraintStabilityIndex) !== 0) {... | php | public function match(Version $version)
{
$versionStabilityIndex = array_search($version->getStability(), Version::$stabilities);
$constraintStabilityIndex = array_search($this->stability, Version::$stabilities);
if ($this->compare($versionStabilityIndex, $constraintStabilityIndex) !== 0) {... | [
"public",
"function",
"match",
"(",
"Version",
"$",
"version",
")",
"{",
"$",
"versionStabilityIndex",
"=",
"array_search",
"(",
"$",
"version",
"->",
"getStability",
"(",
")",
",",
"Version",
"::",
"$",
"stabilities",
")",
";",
"$",
"constraintStabilityIndex"... | Match the constraint against the passed version.
@param Version $version
@return bool
@throws \UnexpectedValueException | [
"Match",
"the",
"constraint",
"against",
"the",
"passed",
"version",
"."
] | 2653209f2620e1d4a8baf17a0b5b74fd339abba3 | https://github.com/zicht/version/blob/2653209f2620e1d4a8baf17a0b5b74fd339abba3/src/Zicht/Version/Constraint.php#L83-L129 |
236,172 | Attibee/Bumble-Form | src/Element/Element.php | Element.setAttribute | public function setAttribute( $attr, $value ) {
//data-* attribute or in valid attribute array
if( strpos( $attr, 'data-' ) === 0 || in_array( $attr, $this->validAttributes ) ) {
$this->attrs[$attr] = $value;
} else {
throw new Exception\InvalidAttributeException( $a... | php | public function setAttribute( $attr, $value ) {
//data-* attribute or in valid attribute array
if( strpos( $attr, 'data-' ) === 0 || in_array( $attr, $this->validAttributes ) ) {
$this->attrs[$attr] = $value;
} else {
throw new Exception\InvalidAttributeException( $a... | [
"public",
"function",
"setAttribute",
"(",
"$",
"attr",
",",
"$",
"value",
")",
"{",
"//data-* attribute or in valid attribute array\r",
"if",
"(",
"strpos",
"(",
"$",
"attr",
",",
"'data-'",
")",
"===",
"0",
"||",
"in_array",
"(",
"$",
"attr",
",",
"$",
"... | Sets an attribute given the name and value.
@param $attr the name of the attribute
@param $value the value of the attribute
@throws Exception\InvalidAttributeException if an invalid attribute is provided | [
"Sets",
"an",
"attribute",
"given",
"the",
"name",
"and",
"value",
"."
] | 546c4b01806c68d8ffc09766f74dc157d9ab4960 | https://github.com/Attibee/Bumble-Form/blob/546c4b01806c68d8ffc09766f74dc157d9ab4960/src/Element/Element.php#L57-L64 |
236,173 | Attibee/Bumble-Form | src/Element/Element.php | Element.getAttribute | public function getAttribute( $name ) {
if( key_exists( $name, $this->attrs ) ) {
return $this->attrs[$name];
} else {
return null;
}
} | php | public function getAttribute( $name ) {
if( key_exists( $name, $this->attrs ) ) {
return $this->attrs[$name];
} else {
return null;
}
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"attrs",
")",
")",
"{",
"return",
"$",
"this",
"->",
"attrs",
"[",
"$",
"name",
"]",
";",
"}",
"else",
"{",
"retu... | Gets an attribute given the attribute name.
@param $name The name of the attribute. | [
"Gets",
"an",
"attribute",
"given",
"the",
"attribute",
"name",
"."
] | 546c4b01806c68d8ffc09766f74dc157d9ab4960 | https://github.com/Attibee/Bumble-Form/blob/546c4b01806c68d8ffc09766f74dc157d9ab4960/src/Element/Element.php#L83-L89 |
236,174 | Attibee/Bumble-Form | src/Element/Element.php | Element.getHTML | public function getHTML() {
$tag = "<" . $this->name;
$q = $this->quoteType;
//build attribute strings
foreach( $this->attrs as $name=>$value ) {
//if true, such as CHECKED, we just add the name
if( $value === true ) {
$tag .= " $name";
... | php | public function getHTML() {
$tag = "<" . $this->name;
$q = $this->quoteType;
//build attribute strings
foreach( $this->attrs as $name=>$value ) {
//if true, such as CHECKED, we just add the name
if( $value === true ) {
$tag .= " $name";
... | [
"public",
"function",
"getHTML",
"(",
")",
"{",
"$",
"tag",
"=",
"\"<\"",
".",
"$",
"this",
"->",
"name",
";",
"$",
"q",
"=",
"$",
"this",
"->",
"quoteType",
";",
"//build attribute strings\r",
"foreach",
"(",
"$",
"this",
"->",
"attrs",
"as",
"$",
"... | Parses the class data and outputs the HTML.
@return the HTML string of the element | [
"Parses",
"the",
"class",
"data",
"and",
"outputs",
"the",
"HTML",
"."
] | 546c4b01806c68d8ffc09766f74dc157d9ab4960 | https://github.com/Attibee/Bumble-Form/blob/546c4b01806c68d8ffc09766f74dc157d9ab4960/src/Element/Element.php#L96-L131 |
236,175 | Attibee/Bumble-Form | src/Element/Element.php | Element.setQuote | public function setQuote( $type ) {
$this->quoteType = $quoteType == self::SINGLE_QUOTE ? self::SINGLE_QUOTE : self::DOUBLE_QUOTE;
} | php | public function setQuote( $type ) {
$this->quoteType = $quoteType == self::SINGLE_QUOTE ? self::SINGLE_QUOTE : self::DOUBLE_QUOTE;
} | [
"public",
"function",
"setQuote",
"(",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"quoteType",
"=",
"$",
"quoteType",
"==",
"self",
"::",
"SINGLE_QUOTE",
"?",
"self",
"::",
"SINGLE_QUOTE",
":",
"self",
"::",
"DOUBLE_QUOTE",
";",
"}"
] | Sets the type of quote to use. Default quote type is double quotes.
@param $type Element::DOUBLE_QUOTE or Element::SINGLE_QUOTE | [
"Sets",
"the",
"type",
"of",
"quote",
"to",
"use",
".",
"Default",
"quote",
"type",
"is",
"double",
"quotes",
"."
] | 546c4b01806c68d8ffc09766f74dc157d9ab4960 | https://github.com/Attibee/Bumble-Form/blob/546c4b01806c68d8ffc09766f74dc157d9ab4960/src/Element/Element.php#L137-L139 |
236,176 | Attibee/Bumble-Form | src/Element/Element.php | Element.addValidAttributes | protected function addValidAttributes( $attrs ) {
foreach( $attrs as $attr ) {
//add if string
if( is_string( $attr ) ) {
$this->validAttributes[] = $attr;
}
}
} | php | protected function addValidAttributes( $attrs ) {
foreach( $attrs as $attr ) {
//add if string
if( is_string( $attr ) ) {
$this->validAttributes[] = $attr;
}
}
} | [
"protected",
"function",
"addValidAttributes",
"(",
"$",
"attrs",
")",
"{",
"foreach",
"(",
"$",
"attrs",
"as",
"$",
"attr",
")",
"{",
"//add if string\r",
"if",
"(",
"is_string",
"(",
"$",
"attr",
")",
")",
"{",
"$",
"this",
"->",
"validAttributes",
"["... | Adds array of attributes to the valid attributes.
@param $attrs an array of attributes | [
"Adds",
"array",
"of",
"attributes",
"to",
"the",
"valid",
"attributes",
"."
] | 546c4b01806c68d8ffc09766f74dc157d9ab4960 | https://github.com/Attibee/Bumble-Form/blob/546c4b01806c68d8ffc09766f74dc157d9ab4960/src/Element/Element.php#L155-L162 |
236,177 | agalbourdin/agl-core | src/Mysql/Query/Select.php | Select._formatOrder | private function _formatOrder()
{
$orders = array();
if (isset($this->_order[DbInterface::ORDER_RAND])) {
$orders[] = 'RAND()';
} else {
foreach ($this->_order as $field => $order) {
$orders[] = "`$field` $order";
}
}
retu... | php | private function _formatOrder()
{
$orders = array();
if (isset($this->_order[DbInterface::ORDER_RAND])) {
$orders[] = 'RAND()';
} else {
foreach ($this->_order as $field => $order) {
$orders[] = "`$field` $order";
}
}
retu... | [
"private",
"function",
"_formatOrder",
"(",
")",
"{",
"$",
"orders",
"=",
"array",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_order",
"[",
"DbInterface",
"::",
"ORDER_RAND",
"]",
")",
")",
"{",
"$",
"orders",
"[",
"]",
"=",
"'RAND... | Format the order fields to be included into the query.
@return string | [
"Format",
"the",
"order",
"fields",
"to",
"be",
"included",
"into",
"the",
"query",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Mysql/Query/Select.php#L36-L49 |
236,178 | agalbourdin/agl-core | src/Mysql/Query/Select.php | Select._doQuery | private function _doQuery($pLimitOne)
{
try {
if (empty($this->_fields)) {
$fields = '*';
} else {
$fields = '`' . implode('`, `', $this->_fields) . '`';
}
$query = "
SELECT
$fields
... | php | private function _doQuery($pLimitOne)
{
try {
if (empty($this->_fields)) {
$fields = '*';
} else {
$fields = '`' . implode('`, `', $this->_fields) . '`';
}
$query = "
SELECT
$fields
... | [
"private",
"function",
"_doQuery",
"(",
"$",
"pLimitOne",
")",
"{",
"try",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_fields",
")",
")",
"{",
"$",
"fields",
"=",
"'*'",
";",
"}",
"else",
"{",
"$",
"fields",
"=",
"'`'",
".",
"implode",
"("... | Commit the select query to the database.
@return Select | [
"Commit",
"the",
"select",
"query",
"to",
"the",
"database",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Mysql/Query/Select.php#L78-L127 |
236,179 | agalbourdin/agl-core | src/Mysql/Query/Select.php | Select.fetchAll | public function fetchAll($pSingle = false)
{
if ($this->_stm === false) {
return array();
}
if ($pSingle) {
return $this->_stm->fetch(PDO::FETCH_ASSOC);
}
return $this->_stm->fetchAll(PDO::FETCH_ASSOC);
} | php | public function fetchAll($pSingle = false)
{
if ($this->_stm === false) {
return array();
}
if ($pSingle) {
return $this->_stm->fetch(PDO::FETCH_ASSOC);
}
return $this->_stm->fetchAll(PDO::FETCH_ASSOC);
} | [
"public",
"function",
"fetchAll",
"(",
"$",
"pSingle",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_stm",
"===",
"false",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"$",
"pSingle",
")",
"{",
"return",
"$",
"this",
"->"... | Fetch all the results as array.
@param bool $pSingle Return a single row or an array of rows.
@return array | [
"Fetch",
"all",
"the",
"results",
"as",
"array",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Mysql/Query/Select.php#L169-L180 |
236,180 | agalbourdin/agl-core | src/Mysql/Query/Select.php | Select.fetchAllAsItems | public function fetchAllAsItems($pSingle = false)
{
$data = array();
if ($this->_stm === false) {
return $data;
}
while ($row = $this->_stm->fetch(PDO::FETCH_ASSOC)) {
if ($pSingle) {
return Agl::getModel($this->_dbContainer, $row);
... | php | public function fetchAllAsItems($pSingle = false)
{
$data = array();
if ($this->_stm === false) {
return $data;
}
while ($row = $this->_stm->fetch(PDO::FETCH_ASSOC)) {
if ($pSingle) {
return Agl::getModel($this->_dbContainer, $row);
... | [
"public",
"function",
"fetchAllAsItems",
"(",
"$",
"pSingle",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_stm",
"===",
"false",
")",
"{",
"return",
"$",
"data",
";",
"}",
"while",
"(",
"$",
"r... | Fetch all the results as array of items.
@param bool $pSingle Return a single Item or an array of Items.
@return array|Item | [
"Fetch",
"all",
"the",
"results",
"as",
"array",
"of",
"items",
"."
] | 1db556f9a49488aa9fab6887fefb7141a79ad97d | https://github.com/agalbourdin/agl-core/blob/1db556f9a49488aa9fab6887fefb7141a79ad97d/src/Mysql/Query/Select.php#L188-L205 |
236,181 | gios-asu/nectary | src/configuration/configuration.php | Configuration.add | public function add( $key, $value ) {
if ( ! array_key_exists( $key, $this->attributes ) ) {
$this->attributes[ $key ] = $value;
} else {
if ( ! \is_array( $this->attributes[ $key ] ) ) {
$this->attributes[ $key ] = array( $this->attributes[ $key ], $value );
} else {
$this->attributes[ $key ][] = ... | php | public function add( $key, $value ) {
if ( ! array_key_exists( $key, $this->attributes ) ) {
$this->attributes[ $key ] = $value;
} else {
if ( ! \is_array( $this->attributes[ $key ] ) ) {
$this->attributes[ $key ] = array( $this->attributes[ $key ], $value );
} else {
$this->attributes[ $key ][] = ... | [
"public",
"function",
"add",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"attributes",
")",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"$",
"key",
"]",
"=",
"$",
... | Add to an new or existing value.
This will promote scalar values into an array to contain multiple values.
@param string $key
@param mixed $value | [
"Add",
"to",
"an",
"new",
"or",
"existing",
"value",
".",
"This",
"will",
"promote",
"scalar",
"values",
"into",
"an",
"array",
"to",
"contain",
"multiple",
"values",
"."
] | f972c737a9036a3090652950a1309a62c07d86c0 | https://github.com/gios-asu/nectary/blob/f972c737a9036a3090652950a1309a62c07d86c0/src/configuration/configuration.php#L48-L58 |
236,182 | maestrano/maestrano-php | lib/Saml/Response.php | Maestrano_Saml_Response.getAttributes | public function getAttributes()
{
if ($this->cachedAttributes != null) {
return $this->cachedAttributes;
}
$entries = $this->_queryAssertion('/saml:AttributeStatement/saml:Attribute');
$this->cachedAttributes = array();
/** $entry DOMNode */
foreach ($entr... | php | public function getAttributes()
{
if ($this->cachedAttributes != null) {
return $this->cachedAttributes;
}
$entries = $this->_queryAssertion('/saml:AttributeStatement/saml:Attribute');
$this->cachedAttributes = array();
/** $entry DOMNode */
foreach ($entr... | [
"public",
"function",
"getAttributes",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cachedAttributes",
"!=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"cachedAttributes",
";",
"}",
"$",
"entries",
"=",
"$",
"this",
"->",
"_queryAssertion",
"(",
"'/... | Return the attributes of a SAML response
@return array | [
"Return",
"the",
"attributes",
"of",
"a",
"SAML",
"response"
] | 757cbefb0f0bf07cb35ea7442041d9bfdcce1558 | https://github.com/maestrano/maestrano-php/blob/757cbefb0f0bf07cb35ea7442041d9bfdcce1558/lib/Saml/Response.php#L79-L102 |
236,183 | rikby/console-helper | src/Helper/SimpleQuestionHelper.php | SimpleQuestionHelper.getFormattedQuestion | public function getFormattedQuestion($question, $default, array $options)
{
if ($this->isList($options)) {
/**
* Options list mode
*/
return $this->getFormattedListQuestion($question, $default, $options);
} else {
/**
* Simpl... | php | public function getFormattedQuestion($question, $default, array $options)
{
if ($this->isList($options)) {
/**
* Options list mode
*/
return $this->getFormattedListQuestion($question, $default, $options);
} else {
/**
* Simpl... | [
"public",
"function",
"getFormattedQuestion",
"(",
"$",
"question",
",",
"$",
"default",
",",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isList",
"(",
"$",
"options",
")",
")",
"{",
"/**\n * Options list mode\n */",... | Get formatted question
@param string $question
@param string $default
@param array $options
@return string | [
"Get",
"formatted",
"question"
] | c618daf79e01439ea6cd60a75c9ff5b09de9b75d | https://github.com/rikby/console-helper/blob/c618daf79e01439ea6cd60a75c9ff5b09de9b75d/src/Helper/SimpleQuestionHelper.php#L94-L107 |
236,184 | rikby/console-helper | src/Helper/SimpleQuestionHelper.php | SimpleQuestionHelper.getFormattedListQuestion | protected function getFormattedListQuestion($question, $default, array $options)
{
$list = '';
foreach ($options as $key => $title) {
$list .= " $key - $title".($default == $key ? ' (Default)' : '').PHP_EOL;
}
return $question.":\n".$list;
} | php | protected function getFormattedListQuestion($question, $default, array $options)
{
$list = '';
foreach ($options as $key => $title) {
$list .= " $key - $title".($default == $key ? ' (Default)' : '').PHP_EOL;
}
return $question.":\n".$list;
} | [
"protected",
"function",
"getFormattedListQuestion",
"(",
"$",
"question",
",",
"$",
"default",
",",
"array",
"$",
"options",
")",
"{",
"$",
"list",
"=",
"''",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"title",
")",
"{",
"$",
... | Get formatted "list" question
@param array $question
@param string|int $default
@param array $options
@return string | [
"Get",
"formatted",
"list",
"question"
] | c618daf79e01439ea6cd60a75c9ff5b09de9b75d | https://github.com/rikby/console-helper/blob/c618daf79e01439ea6cd60a75c9ff5b09de9b75d/src/Helper/SimpleQuestionHelper.php#L128-L136 |
236,185 | rikby/console-helper | src/Helper/SimpleQuestionHelper.php | SimpleQuestionHelper.getFormattedSimpleQuestion | protected function getFormattedSimpleQuestion($question, $default, array $options)
{
$question .= '%s';
$question = sprintf(
$question,
($options ? ' ('.implode('/', $options).')' : '')
);
return $question;
} | php | protected function getFormattedSimpleQuestion($question, $default, array $options)
{
$question .= '%s';
$question = sprintf(
$question,
($options ? ' ('.implode('/', $options).')' : '')
);
return $question;
} | [
"protected",
"function",
"getFormattedSimpleQuestion",
"(",
"$",
"question",
",",
"$",
"default",
",",
"array",
"$",
"options",
")",
"{",
"$",
"question",
".=",
"'%s'",
";",
"$",
"question",
"=",
"sprintf",
"(",
"$",
"question",
",",
"(",
"$",
"options",
... | Get formatted "simple" question
@param string $question
@param string $default
@param array $options
@return string | [
"Get",
"formatted",
"simple",
"question"
] | c618daf79e01439ea6cd60a75c9ff5b09de9b75d | https://github.com/rikby/console-helper/blob/c618daf79e01439ea6cd60a75c9ff5b09de9b75d/src/Helper/SimpleQuestionHelper.php#L146-L155 |
236,186 | rikby/console-helper | src/Helper/SimpleQuestionHelper.php | SimpleQuestionHelper.getValidator | protected function getValidator(array $options, $required, $optionValueIsAnswer)
{
// @codingStandardsIgnoreStart
if ($options) {
$useValue = $this->isList($options) && $optionValueIsAnswer;
return function ($value) use ($options, $useValue) {
if ($useValue &... | php | protected function getValidator(array $options, $required, $optionValueIsAnswer)
{
// @codingStandardsIgnoreStart
if ($options) {
$useValue = $this->isList($options) && $optionValueIsAnswer;
return function ($value) use ($options, $useValue) {
if ($useValue &... | [
"protected",
"function",
"getValidator",
"(",
"array",
"$",
"options",
",",
"$",
"required",
",",
"$",
"optionValueIsAnswer",
")",
"{",
"// @codingStandardsIgnoreStart",
"if",
"(",
"$",
"options",
")",
"{",
"$",
"useValue",
"=",
"$",
"this",
"->",
"isList",
... | Get value validator
@param array $options
@param bool $required
@param bool $optionValueIsAnswer Value from options should be considered as an answer
@return \Closure
@throws LogicException | [
"Get",
"value",
"validator"
] | c618daf79e01439ea6cd60a75c9ff5b09de9b75d | https://github.com/rikby/console-helper/blob/c618daf79e01439ea6cd60a75c9ff5b09de9b75d/src/Helper/SimpleQuestionHelper.php#L166-L191 |
236,187 | chEbba/HttpApiAuth | src/Che/HttpApiAuth/CustomRequest.php | CustomRequest.copy | public static function copy(HttpRequest $request)
{
return new self(
$request->getHost(),
$request->getUri(),
$request->getMethod(),
$request->getHeaders(),
$request->getBody()
);
} | php | public static function copy(HttpRequest $request)
{
return new self(
$request->getHost(),
$request->getUri(),
$request->getMethod(),
$request->getHeaders(),
$request->getBody()
);
} | [
"public",
"static",
"function",
"copy",
"(",
"HttpRequest",
"$",
"request",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"request",
"->",
"getHost",
"(",
")",
",",
"$",
"request",
"->",
"getUri",
"(",
")",
",",
"$",
"request",
"->",
"getMethod",
"(",
... | Create copy from request
@param HttpRequest $request
@return CustomRequest | [
"Create",
"copy",
"from",
"request"
] | 99d017b2149a4956f5e942241e8b6c6efced7ea8 | https://github.com/chEbba/HttpApiAuth/blob/99d017b2149a4956f5e942241e8b6c6efced7ea8/src/Che/HttpApiAuth/CustomRequest.php#L49-L58 |
236,188 | chEbba/HttpApiAuth | src/Che/HttpApiAuth/CustomRequest.php | CustomRequest.jsonSerialize | public function jsonSerialize()
{
return [
'host' => $this->host,
'uri' => $this->uri,
'method' => $this->method,
'headers' => $this->headers,
'body' => $this->body
];
} | php | public function jsonSerialize()
{
return [
'host' => $this->host,
'uri' => $this->uri,
'method' => $this->method,
'headers' => $this->headers,
'body' => $this->body
];
} | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"return",
"[",
"'host'",
"=>",
"$",
"this",
"->",
"host",
",",
"'uri'",
"=>",
"$",
"this",
"->",
"uri",
",",
"'method'",
"=>",
"$",
"this",
"->",
"method",
",",
"'headers'",
"=>",
"$",
"this",
"->... | Serialize request properties for JSON as array
@return array | [
"Serialize",
"request",
"properties",
"for",
"JSON",
"as",
"array"
] | 99d017b2149a4956f5e942241e8b6c6efced7ea8 | https://github.com/chEbba/HttpApiAuth/blob/99d017b2149a4956f5e942241e8b6c6efced7ea8/src/Che/HttpApiAuth/CustomRequest.php#L105-L114 |
236,189 | tmquang6805/phalex | library/Phalex/Di/Di.php | Di.setEventsManager | protected function setEventsManager()
{
$ev = new EventsManager();
$ev->enablePriorities(true);
$ev->collectResponses(true);
$this->set('eventsManager', $ev, true);
return $this;
} | php | protected function setEventsManager()
{
$ev = new EventsManager();
$ev->enablePriorities(true);
$ev->collectResponses(true);
$this->set('eventsManager', $ev, true);
return $this;
} | [
"protected",
"function",
"setEventsManager",
"(",
")",
"{",
"$",
"ev",
"=",
"new",
"EventsManager",
"(",
")",
";",
"$",
"ev",
"->",
"enablePriorities",
"(",
"true",
")",
";",
"$",
"ev",
"->",
"collectResponses",
"(",
"true",
")",
";",
"$",
"this",
"->"... | Override events manager default in Phalcon
@return \Phalex\Di\Di | [
"Override",
"events",
"manager",
"default",
"in",
"Phalcon"
] | 6452b4e695b456838d9d553d96f2b114e1c110b4 | https://github.com/tmquang6805/phalex/blob/6452b4e695b456838d9d553d96f2b114e1c110b4/library/Phalex/Di/Di.php#L37-L44 |
236,190 | Niirrty/Niirrty.Translation | src/Sources/AbstractFileSource.php | AbstractFileSource.setData | public function setData( array $data, bool $doReload = true )
{
$this->logInfo( 'Manual set new data' . ( $doReload ? ' and reload.' : '.' ), __CLASS__ );
$this->_options[ 'data' ] = $data;
if ( $doReload )
{
$this->reload();
}
return $this;
} | php | public function setData( array $data, bool $doReload = true )
{
$this->logInfo( 'Manual set new data' . ( $doReload ? ' and reload.' : '.' ), __CLASS__ );
$this->_options[ 'data' ] = $data;
if ( $doReload )
{
$this->reload();
}
return $this;
} | [
"public",
"function",
"setData",
"(",
"array",
"$",
"data",
",",
"bool",
"$",
"doReload",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"logInfo",
"(",
"'Manual set new data'",
".",
"(",
"$",
"doReload",
"?",
"' and reload.'",
":",
"'.'",
")",
",",
"__CLASS_... | Sets a new array with translation data that should be used.
The array keys are the identifiers (string|int) the values must be arrays with items 'text' and optionally
with 'category' or the values is a string that will be converted to [ 'text' => $value ]
@param array $data
@param bool $doReload
@return \Niirrty\Tra... | [
"Sets",
"a",
"new",
"array",
"with",
"translation",
"data",
"that",
"should",
"be",
"used",
"."
] | 5b1ad27fb87c14435edd2dc03e9af46dd5062de8 | https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Sources/AbstractFileSource.php#L152-L166 |
236,191 | Niirrty/Niirrty.Translation | src/Sources/AbstractFileSource.php | AbstractFileSource.read | public function read( $identifier, $defaultTranslation = false )
{
if ( ! isset( $this->_options[ 'data' ] ) )
{
$this->reload();
}
if ( ! \is_int( $identifier ) && ! \is_string( $identifier ) )
{
// No identifier => RETURN ALL REGISTERED TRANSLATIONS
return... | php | public function read( $identifier, $defaultTranslation = false )
{
if ( ! isset( $this->_options[ 'data' ] ) )
{
$this->reload();
}
if ( ! \is_int( $identifier ) && ! \is_string( $identifier ) )
{
// No identifier => RETURN ALL REGISTERED TRANSLATIONS
return... | [
"public",
"function",
"read",
"(",
"$",
"identifier",
",",
"$",
"defaultTranslation",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_options",
"[",
"'data'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"reload",
"(",
")",
";"... | Reads one or more translation values.
@param string|int $identifier
@param mixed $defaultTranslation Is returned if no translation was found for defined identifier.
@return mixed | [
"Reads",
"one",
"or",
"more",
"translation",
"values",
"."
] | 5b1ad27fb87c14435edd2dc03e9af46dd5062de8 | https://github.com/Niirrty/Niirrty.Translation/blob/5b1ad27fb87c14435edd2dc03e9af46dd5062de8/src/Sources/AbstractFileSource.php#L182-L205 |
236,192 | jannisfink/config | src/Configuration.php | Configuration.addConfigurationLoader | public static function addConfigurationLoader($id, $loader) {
if (array_key_exists($id, self::$configurationLoaders)) {
throw new \Exception("there is already a configuration loader for id $id");
}
$reflection = new \ReflectionClass($loader);
if (!$reflection->implementsInterface(ConfigurationLoa... | php | public static function addConfigurationLoader($id, $loader) {
if (array_key_exists($id, self::$configurationLoaders)) {
throw new \Exception("there is already a configuration loader for id $id");
}
$reflection = new \ReflectionClass($loader);
if (!$reflection->implementsInterface(ConfigurationLoa... | [
"public",
"static",
"function",
"addConfigurationLoader",
"(",
"$",
"id",
",",
"$",
"loader",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"self",
"::",
"$",
"configurationLoaders",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
... | Add a new configuration loader to the list of supported configuration loaders
@param int $id id of the new loader. Must be unique
@param string $loader class name of the loader to use for this id
@throws \Exception if there is a configuration loader present for the given id or the given class name is no
configuration... | [
"Add",
"a",
"new",
"configuration",
"loader",
"to",
"the",
"list",
"of",
"supported",
"configuration",
"loaders"
] | 54dc18c6125c971c46ded9f9484f6802112aab44 | https://github.com/jannisfink/config/blob/54dc18c6125c971c46ded9f9484f6802112aab44/src/Configuration.php#L157-L169 |
236,193 | Chill-project/Report | DataFixtures/ORM/LoadCustomFieldsGroup.php | LoadCustomFieldsGroup.createReport | private function createReport(
ObjectManager $manager,
array $name,
array $options = array())
{
echo $name['fr']." \n";
$cFGroup = (new CustomFieldsGroup())
->setName($name)
->setEntity('Chill\ReportBundle\Entity\Report')
-... | php | private function createReport(
ObjectManager $manager,
array $name,
array $options = array())
{
echo $name['fr']." \n";
$cFGroup = (new CustomFieldsGroup())
->setName($name)
->setEntity('Chill\ReportBundle\Entity\Report')
-... | [
"private",
"function",
"createReport",
"(",
"ObjectManager",
"$",
"manager",
",",
"array",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"echo",
"$",
"name",
"[",
"'fr'",
"]",
".",
"\" \\n\"",
";",
"$",
"cFGroup",
"=",
... | create a report and persist in the db
@param ObjectManager $manager
@param array $name
@return CustomFieldsGroup | [
"create",
"a",
"report",
"and",
"persist",
"in",
"the",
"db"
] | ef718fe93a34f93a4827b3642e5da17c1566f6ae | https://github.com/Chill-project/Report/blob/ef718fe93a34f93a4827b3642e5da17c1566f6ae/DataFixtures/ORM/LoadCustomFieldsGroup.php#L73-L88 |
236,194 | DevGroup-ru/dotplant-entity-structure | src/commands/StructureController.php | StructureController.actionRegenerateSlugs | public function actionRegenerateSlugs()
{
$this->elements = (new Query())
->select(['id', 'parent_id'])
->from(BaseStructure::tableName())
->orderBy(['parent_id' => SORT_ASC])
->indexBy('id')
->all();
foreach ($this->elements as &$element)... | php | public function actionRegenerateSlugs()
{
$this->elements = (new Query())
->select(['id', 'parent_id'])
->from(BaseStructure::tableName())
->orderBy(['parent_id' => SORT_ASC])
->indexBy('id')
->all();
foreach ($this->elements as &$element)... | [
"public",
"function",
"actionRegenerateSlugs",
"(",
")",
"{",
"$",
"this",
"->",
"elements",
"=",
"(",
"new",
"Query",
"(",
")",
")",
"->",
"select",
"(",
"[",
"'id'",
",",
"'parent_id'",
"]",
")",
"->",
"from",
"(",
"BaseStructure",
"::",
"tableName",
... | Check and regenerate compiled urls | [
"Check",
"and",
"regenerate",
"compiled",
"urls"
] | 43e3354b5ebf9171e9afef38d82dccb02357bfed | https://github.com/DevGroup-ru/dotplant-entity-structure/blob/43e3354b5ebf9171e9afef38d82dccb02357bfed/src/commands/StructureController.php#L24-L38 |
236,195 | antarctica/laravel-base-exceptions | src/Exception/InvalidArgumentTypeException.php | InvalidArgumentTypeException.constructException | private function constructException()
{
$this->details['argument_type_error'][$this->argument] = $this->details['argument_type_error']['ARG'];
$this->details['argument_type_error'][$this->argument] = str_replace(['VAR_TYPE', 'ARG_TYPE'], [$this->argumentValueType, $this->argumentType], $this->detail... | php | private function constructException()
{
$this->details['argument_type_error'][$this->argument] = $this->details['argument_type_error']['ARG'];
$this->details['argument_type_error'][$this->argument] = str_replace(['VAR_TYPE', 'ARG_TYPE'], [$this->argumentValueType, $this->argumentType], $this->detail... | [
"private",
"function",
"constructException",
"(",
")",
"{",
"$",
"this",
"->",
"details",
"[",
"'argument_type_error'",
"]",
"[",
"$",
"this",
"->",
"argument",
"]",
"=",
"$",
"this",
"->",
"details",
"[",
"'argument_type_error'",
"]",
"[",
"'ARG'",
"]",
"... | Fill in 'templates' with given values | [
"Fill",
"in",
"templates",
"with",
"given",
"values"
] | c5747b51dcf31e91ccc038302a0bb9a74d3daefc | https://github.com/antarctica/laravel-base-exceptions/blob/c5747b51dcf31e91ccc038302a0bb9a74d3daefc/src/Exception/InvalidArgumentTypeException.php#L59-L66 |
236,196 | ampersa/safebrowsing | src/SafeBrowsing.php | SafeBrowsing.listed | public function listed(string $url, $returnType = false)
{
if (empty($this->apiKey)) {
throw new Exception('A Google Safebrowsing API key has not been specified');
}
// Retrieve the result from SafeBrowsing
$result = $this->getSafebrowsingResult($url);
// Check ... | php | public function listed(string $url, $returnType = false)
{
if (empty($this->apiKey)) {
throw new Exception('A Google Safebrowsing API key has not been specified');
}
// Retrieve the result from SafeBrowsing
$result = $this->getSafebrowsingResult($url);
// Check ... | [
"public",
"function",
"listed",
"(",
"string",
"$",
"url",
",",
"$",
"returnType",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"apiKey",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'A Google Safebrowsing API key has not been spe... | Return listed status from Google Safebrowsing. Returns true on listed status
@param string $url
@param bool $returnType
@return bool|string | [
"Return",
"listed",
"status",
"from",
"Google",
"Safebrowsing",
".",
"Returns",
"true",
"on",
"listed",
"status"
] | 6fb83626ba7441d10f431a701718fe7365def6b3 | https://github.com/ampersa/safebrowsing/blob/6fb83626ba7441d10f431a701718fe7365def6b3/src/SafeBrowsing.php#L39-L64 |
236,197 | ampersa/safebrowsing | src/SafeBrowsing.php | SafeBrowsing.getSafebrowsingResult | protected function getSafebrowsingResult(string $url)
{
// Prepare the Safebrowsing API URL and
// populate the API key for the request
$safebrowsingUrl = sprintf('https://safebrowsing.googleapis.com/v4/threatMatches:find?key=%s', $this->apiKey);
// Prepare the payload that will be ... | php | protected function getSafebrowsingResult(string $url)
{
// Prepare the Safebrowsing API URL and
// populate the API key for the request
$safebrowsingUrl = sprintf('https://safebrowsing.googleapis.com/v4/threatMatches:find?key=%s', $this->apiKey);
// Prepare the payload that will be ... | [
"protected",
"function",
"getSafebrowsingResult",
"(",
"string",
"$",
"url",
")",
"{",
"// Prepare the Safebrowsing API URL and",
"// populate the API key for the request",
"$",
"safebrowsingUrl",
"=",
"sprintf",
"(",
"'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=%s... | Prepare the request to Google Safebrowsing, retrieve the result
and decode before returning.
@param string $url
@return object | [
"Prepare",
"the",
"request",
"to",
"Google",
"Safebrowsing",
"retrieve",
"the",
"result",
"and",
"decode",
"before",
"returning",
"."
] | 6fb83626ba7441d10f431a701718fe7365def6b3 | https://github.com/ampersa/safebrowsing/blob/6fb83626ba7441d10f431a701718fe7365def6b3/src/SafeBrowsing.php#L72-L119 |
236,198 | eix/core | src/php/main/Eix/Core/User.php | User.checkAuthorisation | public function checkAuthorisation($object, $functionName)
{
// Check whether the user has authenticated.
if ($this->isAuthenticated()) {
// The user is authenticated. Proceed.
$class = $object;
if (is_object($class)) {
$class = get_class($class);
... | php | public function checkAuthorisation($object, $functionName)
{
// Check whether the user has authenticated.
if ($this->isAuthenticated()) {
// The user is authenticated. Proceed.
$class = $object;
if (is_object($class)) {
$class = get_class($class);
... | [
"public",
"function",
"checkAuthorisation",
"(",
"$",
"object",
",",
"$",
"functionName",
")",
"{",
"// Check whether the user has authenticated.",
"if",
"(",
"$",
"this",
"->",
"isAuthenticated",
"(",
")",
")",
"{",
"// The user is authenticated. Proceed.",
"$",
"cla... | Checks whether a user is allowed to execute a particular function in a
class.
@param mixed $object the object or class name that contains the function.
@param type $functionName the function name to execute.
@throws NotAuthorisedException | [
"Checks",
"whether",
"a",
"user",
"is",
"allowed",
"to",
"execute",
"a",
"particular",
"function",
"in",
"a",
"class",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/User.php#L121-L151 |
236,199 | eix/core | src/php/main/Eix/Core/User.php | User.destroy | public function destroy()
{
parent::destroy();
Logger::get()->debug('Destroying user ' . $this->id);
// If this user is the one stored in the session, destroy that too.
if (!empty($_SESSION) && ($_SESSION['current_user'] == $this)) {
unset($_SESSION['current_user']);
... | php | public function destroy()
{
parent::destroy();
Logger::get()->debug('Destroying user ' . $this->id);
// If this user is the one stored in the session, destroy that too.
if (!empty($_SESSION) && ($_SESSION['current_user'] == $this)) {
unset($_SESSION['current_user']);
... | [
"public",
"function",
"destroy",
"(",
")",
"{",
"parent",
"::",
"destroy",
"(",
")",
";",
"Logger",
"::",
"get",
"(",
")",
"->",
"debug",
"(",
"'Destroying user '",
".",
"$",
"this",
"->",
"id",
")",
";",
"// If this user is the one stored in the session, dest... | Flag the user as no longer in existence, so that it does not
automatically get saved in the session. | [
"Flag",
"the",
"user",
"as",
"no",
"longer",
"in",
"existence",
"so",
"that",
"it",
"does",
"not",
"automatically",
"get",
"saved",
"in",
"the",
"session",
"."
] | a5b4c09cc168221e85804fdfeb78e519a0415466 | https://github.com/eix/core/blob/a5b4c09cc168221e85804fdfeb78e519a0415466/src/php/main/Eix/Core/User.php#L157-L166 |
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.