repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
sanovskiy/traitlib | src/Traits/ArrayAccess.php | ArrayAccess.offsetSet | public function offsetSet($offset, $value)
{
if (is_null($offset) || empty($offset)) {
return null;
}
return $this->records[$offset] = $value;
} | php | public function offsetSet($offset, $value)
{
if (is_null($offset) || empty($offset)) {
return null;
}
return $this->records[$offset] = $value;
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"offset",
")",
"||",
"empty",
"(",
"$",
"offset",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"records",... | @param mixed $offset
@param mixed $value
@return mixed | [
"@param",
"mixed",
"$offset",
"@param",
"mixed",
"$value"
] | train | https://github.com/sanovskiy/traitlib/blob/d3384da78fc2ac029cc9e835f7a5fa00d8aa6c23/src/Traits/ArrayAccess.php#L51-L57 |
gries/rcon | src/Connection.php | Connection.sendMessage | public function sendMessage(Message $message)
{
$this->currentId++;
$messageData = $message->convertToRconData($this->currentId);
$this->client->write($messageData);
return $this->getResponseMessage();
} | php | public function sendMessage(Message $message)
{
$this->currentId++;
$messageData = $message->convertToRconData($this->currentId);
$this->client->write($messageData);
return $this->getResponseMessage();
} | [
"public",
"function",
"sendMessage",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"currentId",
"++",
";",
"$",
"messageData",
"=",
"$",
"message",
"->",
"convertToRconData",
"(",
"$",
"this",
"->",
"currentId",
")",
";",
"$",
"this",
"->"... | Send a RCON message.
@param Message $message
@return Message | [
"Send",
"a",
"RCON",
"message",
"."
] | train | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L55-L62 |
gries/rcon | src/Connection.php | Connection.getResponseMessage | protected function getResponseMessage()
{
// read the first 4 bytes which include the length of the response
$lengthEncoded = $this->client->read(4);
if (strlen($lengthEncoded) < 4) {
return new Message('', Message::TYPE_RESPONSE_VALUE);
}
$lengthInBytes = unpa... | php | protected function getResponseMessage()
{
// read the first 4 bytes which include the length of the response
$lengthEncoded = $this->client->read(4);
if (strlen($lengthEncoded) < 4) {
return new Message('', Message::TYPE_RESPONSE_VALUE);
}
$lengthInBytes = unpa... | [
"protected",
"function",
"getResponseMessage",
"(",
")",
"{",
"// read the first 4 bytes which include the length of the response",
"$",
"lengthEncoded",
"=",
"$",
"this",
"->",
"client",
"->",
"read",
"(",
"4",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"lengthEncode... | Get the response value of the server.
@return string | [
"Get",
"the",
"response",
"value",
"of",
"the",
"server",
"."
] | train | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L69-L100 |
gries/rcon | src/Connection.php | Connection.authenticate | protected function authenticate($password)
{
$message = new Message($password, Message::TYPE_AUTH);
$response = $this->sendMessage($message);
if ($response->getType() === Message::TYPE_AUTH_FAILURE) {
throw new AuthenticationFailedException('Could not authenticate to the server.... | php | protected function authenticate($password)
{
$message = new Message($password, Message::TYPE_AUTH);
$response = $this->sendMessage($message);
if ($response->getType() === Message::TYPE_AUTH_FAILURE) {
throw new AuthenticationFailedException('Could not authenticate to the server.... | [
"protected",
"function",
"authenticate",
"(",
"$",
"password",
")",
"{",
"$",
"message",
"=",
"new",
"Message",
"(",
"$",
"password",
",",
"Message",
"::",
"TYPE_AUTH",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"sendMessage",
"(",
"$",
"message"... | Authenticate with the server.
@param $password
@throws Exception\AuthenticationFailedException | [
"Authenticate",
"with",
"the",
"server",
"."
] | train | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L109-L117 |
gries/rcon | src/Connection.php | Connection.handleFragmentedResponse | protected function handleFragmentedResponse(Message $responseMessage)
{
do {
usleep(20000); // some servers stop responding if we send to many packages so we wait 20ms
$this->client->write(Message::TYPE_RESPONSE_VALUE);
$responseData = $this->client->read(4096);
... | php | protected function handleFragmentedResponse(Message $responseMessage)
{
do {
usleep(20000); // some servers stop responding if we send to many packages so we wait 20ms
$this->client->write(Message::TYPE_RESPONSE_VALUE);
$responseData = $this->client->read(4096);
... | [
"protected",
"function",
"handleFragmentedResponse",
"(",
"Message",
"$",
"responseMessage",
")",
"{",
"do",
"{",
"usleep",
"(",
"20000",
")",
";",
"// some servers stop responding if we send to many packages so we wait 20ms",
"$",
"this",
"->",
"client",
"->",
"write",
... | This handles a fragmented response.
(https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Multiple-packet_Responses)
We basically send a RESPONSE_VALUE Message to the server to force the response of the rest of the package,
until we receive another package or an empty response.
All the received data is then ... | [
"This",
"handles",
"a",
"fragmented",
"response",
".",
"(",
"https",
":",
"//",
"developer",
".",
"valvesoftware",
".",
"com",
"/",
"wiki",
"/",
"Source_RCON_Protocol#Multiple",
"-",
"packet_Responses",
")"
] | train | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L131-L151 |
vufind-org/vufinddate | src/Converter.php | Converter.convert | public function convert($inputFormat, $outputFormat, $dateString)
{
// These are date formats that we definitely know how to handle, and some
// benefit from special processing. However, items not found in this list
// will still be attempted in a generic fashion before giving up.
$v... | php | public function convert($inputFormat, $outputFormat, $dateString)
{
// These are date formats that we definitely know how to handle, and some
// benefit from special processing. However, items not found in this list
// will still be attempted in a generic fashion before giving up.
$v... | [
"public",
"function",
"convert",
"(",
"$",
"inputFormat",
",",
"$",
"outputFormat",
",",
"$",
"dateString",
")",
"{",
"// These are date formats that we definitely know how to handle, and some",
"// benefit from special processing. However, items not found in this list",
"// will sti... | Generic method for conversion of a time / date string
@param string $inputFormat The format of the time string to be changed
@param string $outputFormat The desired output format
@param string $dateString The date string
@throws DateException
@return string A re-formatted time string | [
"Generic",
"method",
"for",
"conversion",
"of",
"a",
"time",
"/",
"date",
"string"
] | train | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L95-L138 |
vufind-org/vufinddate | src/Converter.php | Converter.getDateExceptionMessage | protected function getDateExceptionMessage($details)
{
$errors = "Date/time problem: Details: ";
if (is_array($details['errors']) && $details['error_count'] > 0) {
foreach ($details['errors'] as $error) {
$errors .= $error . " ";
}
} elseif (is_array($... | php | protected function getDateExceptionMessage($details)
{
$errors = "Date/time problem: Details: ";
if (is_array($details['errors']) && $details['error_count'] > 0) {
foreach ($details['errors'] as $error) {
$errors .= $error . " ";
}
} elseif (is_array($... | [
"protected",
"function",
"getDateExceptionMessage",
"(",
"$",
"details",
")",
"{",
"$",
"errors",
"=",
"\"Date/time problem: Details: \"",
";",
"if",
"(",
"is_array",
"(",
"$",
"details",
"[",
"'errors'",
"]",
")",
"&&",
"$",
"details",
"[",
"'error_count'",
"... | Build an exception message from a detailed error array.
@param array $details Error details
@return string | [
"Build",
"an",
"exception",
"message",
"from",
"a",
"detailed",
"error",
"array",
"."
] | train | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L147-L160 |
vufind-org/vufinddate | src/Converter.php | Converter.convertToDisplayDateAndTime | public function convertToDisplayDateAndTime($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayDate($createFormat, $timeString)
. $separator . $this->convertToDisplayTime($createFormat, $timeString);
} | php | public function convertToDisplayDateAndTime($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayDate($createFormat, $timeString)
. $separator . $this->convertToDisplayTime($createFormat, $timeString);
} | [
"public",
"function",
"convertToDisplayDateAndTime",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
",",
"$",
"separator",
"=",
"' '",
")",
"{",
"return",
"$",
"this",
"->",
"convertToDisplayDate",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
")",
".",... | Public method for getting a date prepended to a time.
@param string $createFormat The format of the time string to be changed
@param string $timeString The time string
@param string $separator String between time/date
@throws DateException
@return string A re-formatted time string | [
"Public",
"method",
"for",
"getting",
"a",
"date",
"prepended",
"to",
"a",
"time",
"."
] | train | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L218-L223 |
vufind-org/vufinddate | src/Converter.php | Converter.convertToDisplayTimeAndDate | public function convertToDisplayTimeAndDate($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayTime($createFormat, $timeString)
. $separator . $this->convertToDisplayDate($createFormat, $timeString);
} | php | public function convertToDisplayTimeAndDate($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayTime($createFormat, $timeString)
. $separator . $this->convertToDisplayDate($createFormat, $timeString);
} | [
"public",
"function",
"convertToDisplayTimeAndDate",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
",",
"$",
"separator",
"=",
"' '",
")",
"{",
"return",
"$",
"this",
"->",
"convertToDisplayTime",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
")",
".",... | Public method for getting a time prepended to a date.
@param string $createFormat The format of the time string to be changed
@param string $timeString The time string
@param string $separator String between time/date
@throws DateException
@return string A re-formatted time string | [
"Public",
"method",
"for",
"getting",
"a",
"time",
"prepended",
"to",
"a",
"date",
"."
] | train | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L235-L240 |
flextype-components/form | Form.php | Form.open | public static function open($action = '', array $attributes = null) : string
{
// Add the form action to the attributes
$attributes['action'] = $action;
if ( ! isset($attributes['method'])) {
// Use POST method
$attributes['method'] = 'post';
}
retu... | php | public static function open($action = '', array $attributes = null) : string
{
// Add the form action to the attributes
$attributes['action'] = $action;
if ( ! isset($attributes['method'])) {
// Use POST method
$attributes['method'] = 'post';
}
retu... | [
"public",
"static",
"function",
"open",
"(",
"$",
"action",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Add the form action to the attributes",
"$",
"attributes",
"[",
"'action'",
"]",
"=",
"$",
"action",
";",
"if",
... | Create an opening HTML form tag.
// Form will submit back to the current page using POST
echo Form::open();
// Form will submit to 'search' using GET
echo Form::open('search', array('method' => 'get'));
// When "file" inputs are present, you must include the "enctype"
echo Form::open(null, array('enctype' => 'multip... | [
"Create",
"an",
"opening",
"HTML",
"form",
"tag",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L72-L84 |
flextype-components/form | Form.php | Form.input | public static function input(string $name, string $value = '', array $attributes = null) : string
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;
// Set the input value
... | php | public static function input(string $name, string $value = '', array $attributes = null) : string
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;
// Set the input value
... | [
"public",
"static",
"function",
"input",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"]",
"=",
"$",
... | Create a form input.
Text is default input type.
echo Form::input('username', $username);
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@return string | [
"Create",
"a",
"form",
"input",
".",
"Text",
"is",
"default",
"input",
"type",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L97-L115 |
flextype-components/form | Form.php | Form.hidden | public static function hidden(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'hidden';
return Form::input($name, $value, $attributes);
} | php | public static function hidden(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'hidden';
return Form::input($name, $value, $attributes);
} | [
"public",
"static",
"function",
"hidden",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'hi... | Create a hidden form input.
echo Form::hidden('user_id', $user_id);
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@return string | [
"Create",
"a",
"hidden",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L127-L133 |
flextype-components/form | Form.php | Form.password | public static function password(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'password';
return Form::input($name, $value, $attributes);
} | php | public static function password(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'password';
return Form::input($name, $value, $attributes);
} | [
"public",
"static",
"function",
"password",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'... | Creates a password form input.
echo Form::password('password');
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@return string | [
"Creates",
"a",
"password",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L145-L151 |
flextype-components/form | Form.php | Form.file | public static function file(string $name, array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'file';
return Form::input($name, '', $attributes);
} | php | public static function file(string $name, array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'file';
return Form::input($name, '', $attributes);
} | [
"public",
"static",
"function",
"file",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'file'",
";",
"return",
"Form",
"::",
"input",
... | Creates a file upload form input.
echo Form::file('image');
@param string $name Input name
@param array $attributes HTML attributes
@return string | [
"Creates",
"a",
"file",
"upload",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L162-L168 |
flextype-components/form | Form.php | Form.checkbox | public static function checkbox($name, $value = '', $checked = false, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'checkbox';
if ($checked === true) {
// Make the checkbox active
$attributes['checked'] = 'checked';
}
retur... | php | public static function checkbox($name, $value = '', $checked = false, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'checkbox';
if ($checked === true) {
// Make the checkbox active
$attributes['checked'] = 'checked';
}
retur... | [
"public",
"static",
"function",
"checkbox",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
",",
"$",
"checked",
"=",
"false",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
... | Creates a checkbox form input.
echo Form::checkbox('i_am_not_a_robot');
@param string $name Input name
@param string $input Input value
@param boolean $checked Checked status
@param array $attributes HTML attributes
@uses Form::input
@return string | [
"Creates",
"a",
"checkbox",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L182-L193 |
flextype-components/form | Form.php | Form.radio | public static function radio($name, $value = '', $checked = null, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'radio';
if ($checked === true) {
// Make the radio active
$attributes['checked'] = 'checked';
}
return Form::in... | php | public static function radio($name, $value = '', $checked = null, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'radio';
if ($checked === true) {
// Make the radio active
$attributes['checked'] = 'checked';
}
return Form::in... | [
"public",
"static",
"function",
"radio",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
",",
"$",
"checked",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'ra... | Creates a radio form input.
echo Form::radio('i_am_not_a_robot');
@param string $name Input name
@param string $value Input value
@param boolean $checked Checked status
@param array $attributes HTML attributes
@uses Form::input
@return string | [
"Creates",
"a",
"radio",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L207-L218 |
flextype-components/form | Form.php | Form.textarea | public static function textarea($name, $body = '', array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
return '<textarea'.Html::attributes($attributes).'>'... | php | public static function textarea($name, $body = '', array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
return '<textarea'.Html::attributes($attributes).'>'... | [
"public",
"static",
"function",
"textarea",
"(",
"$",
"name",
",",
"$",
"body",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"// Set the input id",... | Creates a textarea form input.
echo Form::textarea('text', $text);
@param string $name Name
@param string $body Body
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"textarea",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L231-L240 |
flextype-components/form | Form.php | Form.select | public static function select($name, array $options = null, $selected = null, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
$options_output = '';
... | php | public static function select($name, array $options = null, $selected = null, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
$options_output = '';
... | [
"public",
"static",
"function",
"select",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"null",
",",
"$",
"selected",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"... | Creates a select form input.
<code>
echo Form::select('themes', array('default', 'classic', 'modern'));
</code>
@param string $name Name
@param array $options Options array
@param string $selected Selected option
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"select",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L256-L272 |
flextype-components/form | Form.php | Form.submit | public static function submit($name, $value, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'submit';
return Form::input($name, $value, $attributes);
} | php | public static function submit($name, $value, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'submit';
return Form::input($name, $value, $attributes);
} | [
"public",
"static",
"function",
"submit",
"(",
"$",
"name",
",",
"$",
"value",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'submit'",
";",
"return",
"Form",
"::",
"input",
... | Creates a submit form input.
<code>
echo Form::submit('save', 'Save');
</code>
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@uses Form::input
@return string | [
"Creates",
"a",
"submit",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L287-L293 |
flextype-components/form | Form.php | Form.button | public static function button($name, $body, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
return '<button'.Html::attributes($attributes).'>'.$body.'</button>';
} | php | public static function button($name, $body, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
return '<button'.Html::attributes($attributes).'>'.$body.'</button>';
} | [
"public",
"static",
"function",
"button",
"(",
"$",
"name",
",",
"$",
"body",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"return",
"'<button'",
".",
"Html... | Creates a button form input.
echo Form::button('save', 'Save Profile', array('type' => 'submit'));
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"button",
"form",
"input",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L306-L312 |
flextype-components/form | Form.php | Form.label | public static function label($input, $text, array $attributes = null)
{
// Set the label target
$attributes['for'] = $input;
return '<label'.Html::attributes($attributes).'>'.$text.'</label>';
} | php | public static function label($input, $text, array $attributes = null)
{
// Set the label target
$attributes['for'] = $input;
return '<label'.Html::attributes($attributes).'>'.$text.'</label>';
} | [
"public",
"static",
"function",
"label",
"(",
"$",
"input",
",",
"$",
"text",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the label target",
"$",
"attributes",
"[",
"'for'",
"]",
"=",
"$",
"input",
";",
"return",
"'<label'",
".",
"Htm... | Creates a form label.
echo Form::label('username', 'Username');
@param string $input Target input
@param string $text Label text
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"form",
"label",
"."
] | train | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L325-L331 |
4devs/ElfinderPhpConnector | Connector.php | Connector.run | public function run($cmd, array $args)
{
if (!isset($this->commands[$cmd])) {
$this->error(sprintf('command %s not exists', $cmd));
}
$response = new Response();
$driverId = isset($args['target']) ? $this->getDriverId($args['target']) : '';
$driverId = !$driverId ... | php | public function run($cmd, array $args)
{
if (!isset($this->commands[$cmd])) {
$this->error(sprintf('command %s not exists', $cmd));
}
$response = new Response();
$driverId = isset($args['target']) ? $this->getDriverId($args['target']) : '';
$driverId = !$driverId ... | [
"public",
"function",
"run",
"(",
"$",
"cmd",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"commands",
"[",
"$",
"cmd",
"]",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(",
"sprintf",
"(",
"'command %s not... | run command.
@param string $cmd
@param array $args
@return Response|HttpResponse | [
"run",
"command",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L105-L140 |
4devs/ElfinderPhpConnector | Connector.php | Connector.getResponse | public function getResponse($cmd, array $args)
{
$data = $this->run($cmd, $args);
return $data instanceof HttpResponse ? $data : new JsonResponse($data->toArray());
} | php | public function getResponse($cmd, array $args)
{
$data = $this->run($cmd, $args);
return $data instanceof HttpResponse ? $data : new JsonResponse($data->toArray());
} | [
"public",
"function",
"getResponse",
"(",
"$",
"cmd",
",",
"array",
"$",
"args",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"run",
"(",
"$",
"cmd",
",",
"$",
"args",
")",
";",
"return",
"$",
"data",
"instanceof",
"HttpResponse",
"?",
"$",
"data... | @param string $cmd
@param array $args
@return Response|JsonResponse | [
"@param",
"string",
"$cmd",
"@param",
"array",
"$args"
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L148-L153 |
4devs/ElfinderPhpConnector | Connector.php | Connector.addDriver | public function addDriver(DriverInterface $driver)
{
$driver->setConnector($this);
$this->driverList[$driver->getDriverId()] = $driver;
return $this;
} | php | public function addDriver(DriverInterface $driver)
{
$driver->setConnector($this);
$this->driverList[$driver->getDriverId()] = $driver;
return $this;
} | [
"public",
"function",
"addDriver",
"(",
"DriverInterface",
"$",
"driver",
")",
"{",
"$",
"driver",
"->",
"setConnector",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"driverList",
"[",
"$",
"driver",
"->",
"getDriverId",
"(",
")",
"]",
"=",
"$",
"dri... | add Driver.
@param DriverInterface $driver
@return $this | [
"add",
"Driver",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L176-L182 |
4devs/ElfinderPhpConnector | Connector.php | Connector.setDrivers | public function setDrivers(array $drivers)
{
$this->driverList = array();
foreach ($drivers as $driver) {
$this->addDriver($driver);
}
return $this;
} | php | public function setDrivers(array $drivers)
{
$this->driverList = array();
foreach ($drivers as $driver) {
$this->addDriver($driver);
}
return $this;
} | [
"public",
"function",
"setDrivers",
"(",
"array",
"$",
"drivers",
")",
"{",
"$",
"this",
"->",
"driverList",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"drivers",
"as",
"$",
"driver",
")",
"{",
"$",
"this",
"->",
"addDriver",
"(",
"$",
"driver... | set All Drivers.
@param array $drivers
@return $this | [
"set",
"All",
"Drivers",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L191-L199 |
4devs/ElfinderPhpConnector | Connector.php | Connector.error | public function error($message)
{
if ($this->logger) {
$this->logger->error($message);
}
if (!$this->debug) {
throw new \RuntimeException($message);
}
} | php | public function error($message)
{
if ($this->logger) {
$this->logger->error($message);
}
if (!$this->debug) {
throw new \RuntimeException($message);
}
} | [
"public",
"function",
"error",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"$",
"message",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"debug",
")",
"{"... | error Handling.
@param string $message
@throws \RuntimeException | [
"error",
"Handling",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L208-L216 |
4devs/ElfinderPhpConnector | Connector.php | Connector.getDriverId | public function getDriverId($targetHash)
{
if (is_array($targetHash)) {
$targetHash = current($targetHash);
}
return substr($targetHash, 0, strpos($targetHash, '_'));
} | php | public function getDriverId($targetHash)
{
if (is_array($targetHash)) {
$targetHash = current($targetHash);
}
return substr($targetHash, 0, strpos($targetHash, '_'));
} | [
"public",
"function",
"getDriverId",
"(",
"$",
"targetHash",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"targetHash",
")",
")",
"{",
"$",
"targetHash",
"=",
"current",
"(",
"$",
"targetHash",
")",
";",
"}",
"return",
"substr",
"(",
"$",
"targetHash",
"... | get Driver Id from hash target.
@param string $targetHash
@return string | [
"get",
"Driver",
"Id",
"from",
"hash",
"target",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L239-L246 |
4devs/ElfinderPhpConnector | Connector.php | Connector.runCmd | private function runCmd(DriverInterface $driver, $cmd, array $args, Response $response)
{
$data = null;
try {
if ($driver->isAllowedCommand($cmd)) {
$data = call_user_func_array(
array($driver, $cmd),
$this->getArgs($args, $cmd, $re... | php | private function runCmd(DriverInterface $driver, $cmd, array $args, Response $response)
{
$data = null;
try {
if ($driver->isAllowedCommand($cmd)) {
$data = call_user_func_array(
array($driver, $cmd),
$this->getArgs($args, $cmd, $re... | [
"private",
"function",
"runCmd",
"(",
"DriverInterface",
"$",
"driver",
",",
"$",
"cmd",
",",
"array",
"$",
"args",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"$",
"driver",
"->",
"isAllowedCommand... | run cmd.
@param DriverInterface $driver
@param string $cmd
@param array $args
@param Response $response
@return Response | [
"run",
"cmd",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L258-L275 |
4devs/ElfinderPhpConnector | Connector.php | Connector.addDisabledCommand | private function addDisabledCommand(AbstractDriver $driver)
{
foreach ($this->commands as $name => $command) {
$interface = $this->getInterfaceByCmd($name);
if (!$driver instanceof $interface) {
$driver->addDisabledCmd($name);
}
}
return $... | php | private function addDisabledCommand(AbstractDriver $driver)
{
foreach ($this->commands as $name => $command) {
$interface = $this->getInterfaceByCmd($name);
if (!$driver instanceof $interface) {
$driver->addDisabledCmd($name);
}
}
return $... | [
"private",
"function",
"addDisabledCommand",
"(",
"AbstractDriver",
"$",
"driver",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"commands",
"as",
"$",
"name",
"=>",
"$",
"command",
")",
"{",
"$",
"interface",
"=",
"$",
"this",
"->",
"getInterfaceByCmd",
"(... | add Disabled Command.
@param AbstractDriver $driver
@return $this | [
"add",
"Disabled",
"Command",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L296-L306 |
4devs/ElfinderPhpConnector | Connector.php | Connector.getArgs | private function getArgs(array $args, $cmd, $response, $driverId)
{
$response = array($response);
$allowedArgs = $this->commands[$cmd];
unset($allowedArgs['interface']);
foreach ($allowedArgs as $key => $value) {
if (isset($args[$key])) {
$response[$key] =... | php | private function getArgs(array $args, $cmd, $response, $driverId)
{
$response = array($response);
$allowedArgs = $this->commands[$cmd];
unset($allowedArgs['interface']);
foreach ($allowedArgs as $key => $value) {
if (isset($args[$key])) {
$response[$key] =... | [
"private",
"function",
"getArgs",
"(",
"array",
"$",
"args",
",",
"$",
"cmd",
",",
"$",
"response",
",",
"$",
"driverId",
")",
"{",
"$",
"response",
"=",
"array",
"(",
"$",
"response",
")",
";",
"$",
"allowedArgs",
"=",
"$",
"this",
"->",
"commands",... | get Allowed Arguments.
@param array $args
@param string $cmd
@param Response $response
@param string $driverId
@return array | [
"get",
"Allowed",
"Arguments",
"."
] | train | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L318-L344 |
jfusion/org.jfusion.framework | src/Plugin/Auth.php | Auth.checkPassword | function checkPassword(Userinfo $userinfo) {
return $this->comparePassword($userinfo->password, $this->generateEncryptedPassword($userinfo));
} | php | function checkPassword(Userinfo $userinfo) {
return $this->comparePassword($userinfo->password, $this->generateEncryptedPassword($userinfo));
} | [
"function",
"checkPassword",
"(",
"Userinfo",
"$",
"userinfo",
")",
"{",
"return",
"$",
"this",
"->",
"comparePassword",
"(",
"$",
"userinfo",
"->",
"password",
",",
"$",
"this",
"->",
"generateEncryptedPassword",
"(",
"$",
"userinfo",
")",
")",
";",
"}"
] | used by framework to ensure a password test
@param Userinfo $userinfo userdata object containing the userdata
@return boolean | [
"used",
"by",
"framework",
"to",
"ensure",
"a",
"password",
"test"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Auth.php#L61-L63 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.byteSplit | protected static function byteSplit($x, $bytes)
{
if (is_int($x)) {
if ($x < 0) {
$x = sprintf("%u", $x);
}
}
$res = array();
while ($bytes > 0) {
$b = bcmod($x, '256');
$res[] = (int)$b;
$x = bcdiv($x, '25... | php | protected static function byteSplit($x, $bytes)
{
if (is_int($x)) {
if ($x < 0) {
$x = sprintf("%u", $x);
}
}
$res = array();
while ($bytes > 0) {
$b = bcmod($x, '256');
$res[] = (int)$b;
$x = bcdiv($x, '25... | [
"protected",
"static",
"function",
"byteSplit",
"(",
"$",
"x",
",",
"$",
"bytes",
")",
"{",
"if",
"(",
"is_int",
"(",
"$",
"x",
")",
")",
"{",
"if",
"(",
"$",
"x",
"<",
"0",
")",
"{",
"$",
"x",
"=",
"sprintf",
"(",
"\"%u\"",
",",
"$",
"x",
... | Splits number (could be either int or string) into array of byte
values (represented as integers) in big-endian byte order.
@static
@param $x
@param $bytes
@return array
@throws \Exception | [
"Splits",
"number",
"(",
"could",
"be",
"either",
"int",
"or",
"string",
")",
"into",
"array",
"of",
"byte",
"values",
"(",
"represented",
"as",
"integers",
")",
"in",
"big",
"-",
"endian",
"byte",
"order",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L50-L74 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeOctet | public function writeOctet($n)
{
if ($n < 0 || $n > 255) {
throw new \InvalidArgumentException('Octet out of range 0..255');
}
$this->flushBits();
$this->out .= chr($n);
return $this;
} | php | public function writeOctet($n)
{
if ($n < 0 || $n > 255) {
throw new \InvalidArgumentException('Octet out of range 0..255');
}
$this->flushBits();
$this->out .= chr($n);
return $this;
} | [
"public",
"function",
"writeOctet",
"(",
"$",
"n",
")",
"{",
"if",
"(",
"$",
"n",
"<",
"0",
"||",
"$",
"n",
">",
"255",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Octet out of range 0..255'",
")",
";",
"}",
"$",
"this",
"->",
... | Write an integer as an unsigned 8-bit value.
@param $n
@return Writer
@throws \InvalidArgumentException | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"8",
"-",
"bit",
"value",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L138-L147 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeShort | public function writeShort($n)
{
if ($n < 0 || $n > 65535) {
throw new \InvalidArgumentException('Octet out of range 0..65535');
}
$this->flushBits();
$this->out .= pack('n', $n);
return $this;
} | php | public function writeShort($n)
{
if ($n < 0 || $n > 65535) {
throw new \InvalidArgumentException('Octet out of range 0..65535');
}
$this->flushBits();
$this->out .= pack('n', $n);
return $this;
} | [
"public",
"function",
"writeShort",
"(",
"$",
"n",
")",
"{",
"if",
"(",
"$",
"n",
"<",
"0",
"||",
"$",
"n",
">",
"65535",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Octet out of range 0..65535'",
")",
";",
"}",
"$",
"this",
"->"... | Write an integer as an unsigned 16-bit value.
@param $n
@return Writer
@throws \InvalidArgumentException | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"16",
"-",
"bit",
"value",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L157-L166 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeLong | public function writeLong($n)
{
$this->flushBits();
$this->out .= implode('', Writer::chrByteSplit($n, 4));
return $this;
} | php | public function writeLong($n)
{
$this->flushBits();
$this->out .= implode('', Writer::chrByteSplit($n, 4));
return $this;
} | [
"public",
"function",
"writeLong",
"(",
"$",
"n",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"$",
"this",
"->",
"out",
".=",
"implode",
"(",
"''",
",",
"Writer",
"::",
"chrByteSplit",
"(",
"$",
"n",
",",
"4",
")",
")",
";",
"return"... | Write an integer as an unsigned 32-bit value.
@param $n
@return Writer | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"32",
"-",
"bit",
"value",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L175-L180 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeLongLong | public function writeLongLong($n)
{
$this->flushBits();
$this->out .= implode('', Writer::chrByteSplit($n, 8));
return $this;
} | php | public function writeLongLong($n)
{
$this->flushBits();
$this->out .= implode('', Writer::chrByteSplit($n, 8));
return $this;
} | [
"public",
"function",
"writeLongLong",
"(",
"$",
"n",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"$",
"this",
"->",
"out",
".=",
"implode",
"(",
"''",
",",
"Writer",
"::",
"chrByteSplit",
"(",
"$",
"n",
",",
"8",
")",
")",
";",
"ret... | Write an integer as an unsigned 64-bit value.
@param $n
@return Writer | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"64",
"-",
"bit",
"value",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L201-L206 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeShortStr | public function writeShortStr($s)
{
$this->flushBits();
if (strlen($s) > 255) {
throw new \InvalidArgumentException('String too long');
}
$this->writeOctet(strlen($s));
$this->out .= $s;
return $this;
} | php | public function writeShortStr($s)
{
$this->flushBits();
if (strlen($s) > 255) {
throw new \InvalidArgumentException('String too long');
}
$this->writeOctet(strlen($s));
$this->out .= $s;
return $this;
} | [
"public",
"function",
"writeShortStr",
"(",
"$",
"s",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"s",
")",
">",
"255",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'String too long'",
")... | Write a string up to 255 bytes long after encoding.
Assume UTF-8 encoding.
@param $s
@return Writer
@throws \InvalidArgumentException | [
"Write",
"a",
"string",
"up",
"to",
"255",
"bytes",
"long",
"after",
"encoding",
".",
"Assume",
"UTF",
"-",
"8",
"encoding",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L217-L227 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeLongStr | public function writeLongStr($s)
{
$this->flushBits();
$this->writeLong(strlen($s));
$this->out .= $s;
return $this;
} | php | public function writeLongStr($s)
{
$this->flushBits();
$this->writeLong(strlen($s));
$this->out .= $s;
return $this;
} | [
"public",
"function",
"writeLongStr",
"(",
"$",
"s",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"$",
"this",
"->",
"writeLong",
"(",
"strlen",
"(",
"$",
"s",
")",
")",
";",
"$",
"this",
"->",
"out",
".=",
"$",
"s",
";",
"return",
... | Write a string up to 2**32 bytes long. Assume UTF-8 encoding.
@param $s
@return Writer | [
"Write",
"a",
"string",
"up",
"to",
"2",
"**",
"32",
"bytes",
"long",
".",
"Assume",
"UTF",
"-",
"8",
"encoding",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L236-L242 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeArray | public function writeArray($a)
{
$this->flushBits();
$data = new Writer();
foreach ($a as $v) {
if (is_string($v)) {
$data->write('S');
$data->writeLongStr($v);
} else if (is_int($v)) {
$data->write('I');
... | php | public function writeArray($a)
{
$this->flushBits();
$data = new Writer();
foreach ($a as $v) {
if (is_string($v)) {
$data->write('S');
$data->writeLongStr($v);
} else if (is_int($v)) {
$data->write('I');
... | [
"public",
"function",
"writeArray",
"(",
"$",
"a",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"$",
"data",
"=",
"new",
"Writer",
"(",
")",
";",
"foreach",
"(",
"$",
"a",
"as",
"$",
"v",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
... | Supports the writing of Array types, so that you can implement
array methods, like Rabbitmq's HA parameters
@param array $a
@return self | [
"Supports",
"the",
"writing",
"of",
"Array",
"types",
"so",
"that",
"you",
"can",
"implement",
"array",
"methods",
"like",
"Rabbitmq",
"s",
"HA",
"parameters"
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L252-L278 |
zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeTable | public function writeTable($d)
{
$this->flushBits();
$table_data = new Writer();
foreach ($d as $k => $va) {
list($ftype, $v) = $va;
$table_data->writeShortStr($k);
if ($ftype == 'S') {
$table_data->write('S');
$table_data->... | php | public function writeTable($d)
{
$this->flushBits();
$table_data = new Writer();
foreach ($d as $k => $va) {
list($ftype, $v) = $va;
$table_data->writeShortStr($k);
if ($ftype == 'S') {
$table_data->write('S');
$table_data->... | [
"public",
"function",
"writeTable",
"(",
"$",
"d",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"$",
"table_data",
"=",
"new",
"Writer",
"(",
")",
";",
"foreach",
"(",
"$",
"d",
"as",
"$",
"k",
"=>",
"$",
"va",
")",
"{",
"list",
"("... | Write PHP array, as table. Input array format: keys are strings,
values are (type,value) tuples.
@param $d
@return Writer | [
"Write",
"PHP",
"array",
"as",
"table",
".",
"Input",
"array",
"format",
":",
"keys",
"are",
"strings",
"values",
"are",
"(",
"type",
"value",
")",
"tuples",
"."
] | train | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L301-L335 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/IOFactory.php | PHPWord_IOFactory.createWriter | public static function createWriter(PHPWord $PHPWord, $writerType = '') {
$searchType = 'IWriter';
foreach (self::$_searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $writerType, $searchLocation['class']);
$classFile = str_replace... | php | public static function createWriter(PHPWord $PHPWord, $writerType = '') {
$searchType = 'IWriter';
foreach (self::$_searchLocations as $searchLocation) {
if ($searchLocation['type'] == $searchType) {
$className = str_replace('{0}', $writerType, $searchLocation['class']);
$classFile = str_replace... | [
"public",
"static",
"function",
"createWriter",
"(",
"PHPWord",
"$",
"PHPWord",
",",
"$",
"writerType",
"=",
"''",
")",
"{",
"$",
"searchType",
"=",
"'IWriter'",
";",
"foreach",
"(",
"self",
"::",
"$",
"_searchLocations",
"as",
"$",
"searchLocation",
")",
... | Create PHPWord_Writer_IWriter
@param PHPWord $PHPWord
@param string $writerType Example: Word2007
@return PHPWord_Writer_IWriter | [
"Create",
"PHPWord_Writer_IWriter"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/IOFactory.php#L102-L118 |
webforge-labs/psc-cms | lib/Psc/Form/I18nWrapperValidatorRule.php | I18nWrapperValidatorRule.validate | public function validate($data) {
if ($data === NULL) throw $this->emptyException();
if (!is_array($data)) throw $this->invalidArgument(1, $data, 'Array', __FUNCTION__);
foreach ($this->languages as $lang) {
if (!array_key_exists($lang, $data)) {
throw $this->emptyException();
}
... | php | public function validate($data) {
if ($data === NULL) throw $this->emptyException();
if (!is_array($data)) throw $this->invalidArgument(1, $data, 'Array', __FUNCTION__);
foreach ($this->languages as $lang) {
if (!array_key_exists($lang, $data)) {
throw $this->emptyException();
}
... | [
"public",
"function",
"validate",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"data",
"===",
"NULL",
")",
"throw",
"$",
"this",
"->",
"emptyException",
"(",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"data",
")",
")",
"throw",
"$",
"this",
"... | Validiert alle für alle sprachen der Data die Daten der Inneren Componente
@return $data | [
"Validiert",
"alle",
"für",
"alle",
"sprachen",
"der",
"Data",
"die",
"Daten",
"der",
"Inneren",
"Componente"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/I18nWrapperValidatorRule.php#L30-L47 |
GrahamDeprecated/CMS-Core | src/CMSCoreServiceProvider.php | CMSCoreServiceProvider.setupViewer | protected function setupViewer()
{
$this->app->bindShared('viewer', function ($app) {
$view = $app['view'];
$credentials = $app['credentials'];
$navigation = $app['navigation'];
$pageprovider = $app['pageprovider'];
$name = $app['config']['platform... | php | protected function setupViewer()
{
$this->app->bindShared('viewer', function ($app) {
$view = $app['view'];
$credentials = $app['credentials'];
$navigation = $app['navigation'];
$pageprovider = $app['pageprovider'];
$name = $app['config']['platform... | [
"protected",
"function",
"setupViewer",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bindShared",
"(",
"'viewer'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"view",
"=",
"$",
"app",
"[",
"'view'",
"]",
";",
"$",
"credentials",
"=",
"$",
"... | Setup the viewer class.
@return void | [
"Setup",
"the",
"viewer",
"class",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/CMSCoreServiceProvider.php#L56-L68 |
GrahamDeprecated/CMS-Core | src/CMSCoreServiceProvider.php | CMSCoreServiceProvider.registerCommentProvider | protected function registerCommentProvider()
{
$this->app->bindShared('commentprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::comment'];
$comment = new $model();
return new Providers\CommentProvider($comment);
});
} | php | protected function registerCommentProvider()
{
$this->app->bindShared('commentprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::comment'];
$comment = new $model();
return new Providers\CommentProvider($comment);
});
} | [
"protected",
"function",
"registerCommentProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bindShared",
"(",
"'commentprovider'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"model",
"=",
"$",
"app",
"[",
"'config'",
"]",
"[",
"'graham-campbe... | Register the comment provider class.
@return void | [
"Register",
"the",
"comment",
"provider",
"class",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/CMSCoreServiceProvider.php#L88-L96 |
GrahamDeprecated/CMS-Core | src/CMSCoreServiceProvider.php | CMSCoreServiceProvider.registerEventProvider | protected function registerEventProvider()
{
$this->app->bindShared('eventprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::event'];
$event = new $model();
return new Providers\EventProvider($event);
});
} | php | protected function registerEventProvider()
{
$this->app->bindShared('eventprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::event'];
$event = new $model();
return new Providers\EventProvider($event);
});
} | [
"protected",
"function",
"registerEventProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bindShared",
"(",
"'eventprovider'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"model",
"=",
"$",
"app",
"[",
"'config'",
"]",
"[",
"'graham-campbell/c... | Register the event provider class.
@return void | [
"Register",
"the",
"event",
"provider",
"class",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/CMSCoreServiceProvider.php#L103-L111 |
GrahamDeprecated/CMS-Core | src/CMSCoreServiceProvider.php | CMSCoreServiceProvider.registerPageProvider | protected function registerPageProvider()
{
$this->app->bindShared('pageprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::page'];
$page = new $model();
return new Providers\PageProvider($page);
});
} | php | protected function registerPageProvider()
{
$this->app->bindShared('pageprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::page'];
$page = new $model();
return new Providers\PageProvider($page);
});
} | [
"protected",
"function",
"registerPageProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bindShared",
"(",
"'pageprovider'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"model",
"=",
"$",
"app",
"[",
"'config'",
"]",
"[",
"'graham-campbell/cms... | Register the page provider class.
@return void | [
"Register",
"the",
"page",
"provider",
"class",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/CMSCoreServiceProvider.php#L118-L126 |
GrahamDeprecated/CMS-Core | src/CMSCoreServiceProvider.php | CMSCoreServiceProvider.registerPostProvider | protected function registerPostProvider()
{
$this->app->bindShared('postprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::post'];
$post = new $model();
return new Providers\PostProvider($post);
});
} | php | protected function registerPostProvider()
{
$this->app->bindShared('postprovider', function ($app) {
$model = $app['config']['graham-campbell/cms-core::post'];
$post = new $model();
return new Providers\PostProvider($post);
});
} | [
"protected",
"function",
"registerPostProvider",
"(",
")",
"{",
"$",
"this",
"->",
"app",
"->",
"bindShared",
"(",
"'postprovider'",
",",
"function",
"(",
"$",
"app",
")",
"{",
"$",
"model",
"=",
"$",
"app",
"[",
"'config'",
"]",
"[",
"'graham-campbell/cms... | Register the post provider class.
@return void | [
"Register",
"the",
"post",
"provider",
"class",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/CMSCoreServiceProvider.php#L133-L141 |
phore/phore-filesystem | src/FileStream.php | FileStream.getMetadata | public function getMetadata($key = null)
{
if ($key !== null)
return stream_get_meta_data($this->res)[$key];
return stream_get_meta_data($this->res);
} | php | public function getMetadata($key = null)
{
if ($key !== null)
return stream_get_meta_data($this->res)[$key];
return stream_get_meta_data($this->res);
} | [
"public",
"function",
"getMetadata",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"!==",
"null",
")",
"return",
"stream_get_meta_data",
"(",
"$",
"this",
"->",
"res",
")",
"[",
"$",
"key",
"]",
";",
"return",
"stream_get_meta_data",
"... | Get stream metadata as an associative array or retrieve a specific key.
The keys returned are identical to the keys returned from PHP's
stream_get_meta_data() function.
@link http://php.net/manual/en/function.stream-get-meta-data.php
@param string $key Specific metadata to retrieve.
@return array|mixed|null Returns a... | [
"Get",
"stream",
"metadata",
"as",
"an",
"associative",
"array",
"or",
"retrieve",
"a",
"specific",
"key",
"."
] | train | https://github.com/phore/phore-filesystem/blob/be7d4d3f6d21fd08fdb4eb24120a45050d9422e2/src/FileStream.php#L298-L303 |
forkiss/pharest | src/Pharest/Model.php | Model.firstOrFail | public static function firstOrFail($parameters, $message = '')
{
$query = parent::findFirst($parameters);
if (!$query) {
if (!$message) {
$message = 'data can not be found';
}
throw new \Pharest\Exception\ModelException($message, 100091);
... | php | public static function firstOrFail($parameters, $message = '')
{
$query = parent::findFirst($parameters);
if (!$query) {
if (!$message) {
$message = 'data can not be found';
}
throw new \Pharest\Exception\ModelException($message, 100091);
... | [
"public",
"static",
"function",
"firstOrFail",
"(",
"$",
"parameters",
",",
"$",
"message",
"=",
"''",
")",
"{",
"$",
"query",
"=",
"parent",
"::",
"findFirst",
"(",
"$",
"parameters",
")",
";",
"if",
"(",
"!",
"$",
"query",
")",
"{",
"if",
"(",
"!... | Allows to query the first record that match the specified conditions
@param mixed $parameters
@param string $message
@return static | [
"Allows",
"to",
"query",
"the",
"first",
"record",
"that",
"match",
"the",
"specified",
"conditions"
] | train | https://github.com/forkiss/pharest/blob/f8b444f9bba446bf7994d98f27585529aefed565/src/Pharest/Model.php#L60-L74 |
Lansoweb/LosBase | src/LosBase/DBAL/Types/UtcDateTimeType.php | UtcDateTimeType.convertToDatabaseValue | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$formatString = $platform->getDateTimeFormatString();
$formatted = $value->setTimezone(new \DateTimeZone('UTC'))->format($formatString);
return $... | php | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$formatString = $platform->getDateTimeFormatString();
$formatted = $value->setTimezone(new \DateTimeZone('UTC'))->format($formatString);
return $... | [
"public",
"function",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"formatString",
"=",
"$",
"platform",
"->",
"getDateTimeFormatSt... | @param DateTime $value
@param Doctrine\DBAL\Platforms\AbstractPlatform $platform
@return string | [
"@param",
"DateTime",
"$value",
"@param",
"Doctrine",
"\\",
"DBAL",
"\\",
"Platforms",
"\\",
"AbstractPlatform",
"$platform"
] | train | https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/DBAL/Types/UtcDateTimeType.php#L17-L27 |
Lansoweb/LosBase | src/LosBase/DBAL/Types/UtcDateTimeType.php | UtcDateTimeType.convertToPHPValue | public function convertToPHPValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$val = \DateTime::createFromFormat(
$platform->getDateTimeFormatString(),
$value,
new \DateTimeZone('UTC')
);
if (!$val) {... | php | public function convertToPHPValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$val = \DateTime::createFromFormat(
$platform->getDateTimeFormatString(),
$value,
new \DateTimeZone('UTC')
);
if (!$val) {... | [
"public",
"function",
"convertToPHPValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"val",
"=",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"$",... | @param string $value
@param DoctrineDBALPlatformsAbstractPlatform $platform
@return DateTime|mixed|null
@throws DoctrineDBALTypesConversionException | [
"@param",
"string",
"$value",
"@param",
"DoctrineDBALPlatformsAbstractPlatform",
"$platform"
] | train | https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/DBAL/Types/UtcDateTimeType.php#L37-L53 |
forxer/tao | src/Tao/Templating/Helpers/TitleTag.php | TitleTag.add | public function add($sTitle, $bPrepend = false)
{
if ($bPrepend)
{
$this->aTitles = array_reverse($this->aTitles, true);
$this->aTitles[$sTitle] = $sTitle;
$this->aTitles = array_reverse($this->aTitles, true);
}
else {
$this->aTitles[$sTitle] = $sTitle;
}
} | php | public function add($sTitle, $bPrepend = false)
{
if ($bPrepend)
{
$this->aTitles = array_reverse($this->aTitles, true);
$this->aTitles[$sTitle] = $sTitle;
$this->aTitles = array_reverse($this->aTitles, true);
}
else {
$this->aTitles[$sTitle] = $sTitle;
}
} | [
"public",
"function",
"add",
"(",
"$",
"sTitle",
",",
"$",
"bPrepend",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"bPrepend",
")",
"{",
"$",
"this",
"->",
"aTitles",
"=",
"array_reverse",
"(",
"$",
"this",
"->",
"aTitles",
",",
"true",
")",
";",
"$",
... | Add a title tag to the titles tag stack.
@param string $sTitle
@param boolean $bPrepend | [
"Add",
"a",
"title",
"tag",
"to",
"the",
"titles",
"tag",
"stack",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/TitleTag.php#L16-L27 |
forxer/tao | src/Tao/Templating/Helpers/TitleTag.php | TitleTag.has | public function has($sTitle = null)
{
if (null === $sTitle) {
return !empty($this->aTitles);
}
return isset($this->aTitles[$sTitle]);
} | php | public function has($sTitle = null)
{
if (null === $sTitle) {
return !empty($this->aTitles);
}
return isset($this->aTitles[$sTitle]);
} | [
"public",
"function",
"has",
"(",
"$",
"sTitle",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"sTitle",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"aTitles",
")",
";",
"}",
"return",
"isset",
"(",
"$",
"this",
"->",
"aTitl... | Indicate if a given title tag exists or if there are items in the titles tag stack.
@param string $sTitle
@return boolean | [
"Indicate",
"if",
"a",
"given",
"title",
"tag",
"exists",
"or",
"if",
"there",
"are",
"items",
"in",
"the",
"titles",
"tag",
"stack",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Templating/Helpers/TitleTag.php#L47-L54 |
VincentChalnot/SidusEAVFilterBundle | Filter/Type/AbstractEAVFilterType.php | AbstractEAVFilterType.getFormOptions | public function getFormOptions(QueryHandlerInterface $queryHandler, FilterInterface $filter): array
{
if (!$queryHandler instanceof EAVQueryHandlerInterface) {
throw new BadQueryHandlerException($queryHandler, EAVQueryHandlerInterface::class);
}
return array_merge(
$... | php | public function getFormOptions(QueryHandlerInterface $queryHandler, FilterInterface $filter): array
{
if (!$queryHandler instanceof EAVQueryHandlerInterface) {
throw new BadQueryHandlerException($queryHandler, EAVQueryHandlerInterface::class);
}
return array_merge(
$... | [
"public",
"function",
"getFormOptions",
"(",
"QueryHandlerInterface",
"$",
"queryHandler",
",",
"FilterInterface",
"$",
"filter",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"queryHandler",
"instanceof",
"EAVQueryHandlerInterface",
")",
"{",
"throw",
"new",
"BadQ... | {@inheritdoc} | [
"{"
] | train | https://github.com/VincentChalnot/SidusEAVFilterBundle/blob/25a9e0495fae30cb96ecded56c50cf7fe70c9032/Filter/Type/AbstractEAVFilterType.php#L40-L50 |
VincentChalnot/SidusEAVFilterBundle | Filter/Type/AbstractEAVFilterType.php | AbstractEAVFilterType.getDefaultFormOptions | protected function getDefaultFormOptions(EAVQueryHandlerInterface $queryHandler, FilterInterface $filter): array
{
$formOptions = $this->formOptions;
try {
$attributes = $queryHandler->getEAVAttributes($filter);
} catch (MissingAttributeException $e) {
return $formOpt... | php | protected function getDefaultFormOptions(EAVQueryHandlerInterface $queryHandler, FilterInterface $filter): array
{
$formOptions = $this->formOptions;
try {
$attributes = $queryHandler->getEAVAttributes($filter);
} catch (MissingAttributeException $e) {
return $formOpt... | [
"protected",
"function",
"getDefaultFormOptions",
"(",
"EAVQueryHandlerInterface",
"$",
"queryHandler",
",",
"FilterInterface",
"$",
"filter",
")",
":",
"array",
"{",
"$",
"formOptions",
"=",
"$",
"this",
"->",
"formOptions",
";",
"try",
"{",
"$",
"attributes",
... | @param EAVQueryHandlerInterface $queryHandler
@param FilterInterface $filter
@return array | [
"@param",
"EAVQueryHandlerInterface",
"$queryHandler",
"@param",
"FilterInterface",
"$filter"
] | train | https://github.com/VincentChalnot/SidusEAVFilterBundle/blob/25a9e0495fae30cb96ecded56c50cf7fe70c9032/Filter/Type/AbstractEAVFilterType.php#L58-L77 |
joomla-framework/crypt | src/Cipher/OpenSSL.php | OpenSSL.decrypt | public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'openssl')
{
throw new InvalidKeyTypeException('openssl', $key->getType());
}
$cleartext = openssl_decrypt($data, $this->method, $key->getPrivate(), true, $this->iv);
if ($cleartext === false)
{
throw new \Runtime... | php | public function decrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'openssl')
{
throw new InvalidKeyTypeException('openssl', $key->getType());
}
$cleartext = openssl_decrypt($data, $this->method, $key->getPrivate(), true, $this->iv);
if ($cleartext === false)
{
throw new \Runtime... | [
"public",
"function",
"decrypt",
"(",
"$",
"data",
",",
"Key",
"$",
"key",
")",
"{",
"// Validate key.",
"if",
"(",
"$",
"key",
"->",
"getType",
"(",
")",
"!==",
"'openssl'",
")",
"{",
"throw",
"new",
"InvalidKeyTypeException",
"(",
"'openssl'",
",",
"$"... | Method to decrypt a data string.
@param string $data The encrypted string to decrypt.
@param Key $key The key object to use for decryption.
@return string The decrypted data string.
@since __DEPLOY_VERSION__
@throws \InvalidArgumentException
@throws \RuntimeException | [
"Method",
"to",
"decrypt",
"a",
"data",
"string",
"."
] | train | https://github.com/joomla-framework/crypt/blob/5b24370bd5f07d2b305f66e62294c6d10a3f619d/src/Cipher/OpenSSL.php#L64-L80 |
joomla-framework/crypt | src/Cipher/OpenSSL.php | OpenSSL.encrypt | public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'openssl')
{
throw new InvalidKeyTypeException('openssl', $key->getType());
}
$encrypted = openssl_encrypt($data, $this->method, $key->getPrivate(), true, $this->iv);
if ($encrypted === false)
{
throw new \Runtime... | php | public function encrypt($data, Key $key)
{
// Validate key.
if ($key->getType() !== 'openssl')
{
throw new InvalidKeyTypeException('openssl', $key->getType());
}
$encrypted = openssl_encrypt($data, $this->method, $key->getPrivate(), true, $this->iv);
if ($encrypted === false)
{
throw new \Runtime... | [
"public",
"function",
"encrypt",
"(",
"$",
"data",
",",
"Key",
"$",
"key",
")",
"{",
"// Validate key.",
"if",
"(",
"$",
"key",
"->",
"getType",
"(",
")",
"!==",
"'openssl'",
")",
"{",
"throw",
"new",
"InvalidKeyTypeException",
"(",
"'openssl'",
",",
"$"... | Method to encrypt a data string.
@param string $data The data string to encrypt.
@param Key $key The key object to use for encryption.
@return string The encrypted data string.
@since __DEPLOY_VERSION__
@throws \InvalidArgumentException
@throws \RuntimeException | [
"Method",
"to",
"encrypt",
"a",
"data",
"string",
"."
] | train | https://github.com/joomla-framework/crypt/blob/5b24370bd5f07d2b305f66e62294c6d10a3f619d/src/Cipher/OpenSSL.php#L94-L110 |
joomla-framework/crypt | src/Cipher/OpenSSL.php | OpenSSL.generateKey | public function generateKey(array $options = [])
{
$passphrase = $options['passphrase'] ?? false;
if ($passphrase === false)
{
throw new \RuntimeException('Missing passphrase file');
}
return new Key('openssl', $passphrase, 'unused');
} | php | public function generateKey(array $options = [])
{
$passphrase = $options['passphrase'] ?? false;
if ($passphrase === false)
{
throw new \RuntimeException('Missing passphrase file');
}
return new Key('openssl', $passphrase, 'unused');
} | [
"public",
"function",
"generateKey",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"passphrase",
"=",
"$",
"options",
"[",
"'passphrase'",
"]",
"??",
"false",
";",
"if",
"(",
"$",
"passphrase",
"===",
"false",
")",
"{",
"throw",
"new",
... | Method to generate a new encryption key object.
@param array $options Key generation options.
@return Key
@since __DEPLOY_VERSION__
@throws \RuntimeException | [
"Method",
"to",
"generate",
"a",
"new",
"encryption",
"key",
"object",
"."
] | train | https://github.com/joomla-framework/crypt/blob/5b24370bd5f07d2b305f66e62294c6d10a3f619d/src/Cipher/OpenSSL.php#L122-L132 |
christianvizarra/laravel-service-provider | src/Publisher/MigrationPublisher.php | MigrationPublisher.getSource | protected function getSource($packagePath)
{
$sources = [
"{$packagePath}/resources/database/migrations",
"{$packagePath}/resources/migrations",
"{$packagePath}/migrations",
];
// iterate through all possible locations
foreach ($sources as $source... | php | protected function getSource($packagePath)
{
$sources = [
"{$packagePath}/resources/database/migrations",
"{$packagePath}/resources/migrations",
"{$packagePath}/migrations",
];
// iterate through all possible locations
foreach ($sources as $source... | [
"protected",
"function",
"getSource",
"(",
"$",
"packagePath",
")",
"{",
"$",
"sources",
"=",
"[",
"\"{$packagePath}/resources/database/migrations\"",
",",
"\"{$packagePath}/resources/migrations\"",
",",
"\"{$packagePath}/migrations\"",
",",
"]",
";",
"// iterate through all ... | Get the source assets directory to publish.
@param string $packagePath
@return string
@throws \InvalidArgumentException | [
"Get",
"the",
"source",
"assets",
"directory",
"to",
"publish",
"."
] | train | https://github.com/christianvizarra/laravel-service-provider/blob/73e6b664c34ce228d4a3a48ed3b96cf2546ccfee/src/Publisher/MigrationPublisher.php#L27-L58 |
zephia/pilot-api-client | src/Model/LeadData.php | LeadData.toArray | public function toArray()
{
$this->validate();
return [
'pilot_firstname' => $this->getFirstname(),
'pilot_lastname' => $this->getLastname(),
'pilot_phone' => $this->getPhone(),
'pilot_cellphone' => $this->getCellphone(),
'pilot_email' => $... | php | public function toArray()
{
$this->validate();
return [
'pilot_firstname' => $this->getFirstname(),
'pilot_lastname' => $this->getLastname(),
'pilot_phone' => $this->getPhone(),
'pilot_cellphone' => $this->getCellphone(),
'pilot_email' => $... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"this",
"->",
"validate",
"(",
")",
";",
"return",
"[",
"'pilot_firstname'",
"=>",
"$",
"this",
"->",
"getFirstname",
"(",
")",
",",
"'pilot_lastname'",
"=>",
"$",
"this",
"->",
"getLastname",
"(",
")"... | Object to array
@return array | [
"Object",
"to",
"array"
] | train | https://github.com/zephia/pilot-api-client/blob/218fbf2fc5892e2ffc554ddd01fa95d63d6e3c0f/src/Model/LeadData.php#L51-L77 |
zephia/pilot-api-client | src/Model/LeadData.php | LeadData.validate | private function validate()
{
$required = '';
$validations = [
'FirstnameOrLastname',
'PhoneCellphoneOrEmail',
'ContactTypeId',
'BusinessTypeId',
'SuboriginId',
];
for ($i = 0; $i < count($validations) && empty($required);... | php | private function validate()
{
$required = '';
$validations = [
'FirstnameOrLastname',
'PhoneCellphoneOrEmail',
'ContactTypeId',
'BusinessTypeId',
'SuboriginId',
];
for ($i = 0; $i < count($validations) && empty($required);... | [
"private",
"function",
"validate",
"(",
")",
"{",
"$",
"required",
"=",
"''",
";",
"$",
"validations",
"=",
"[",
"'FirstnameOrLastname'",
",",
"'PhoneCellphoneOrEmail'",
",",
"'ContactTypeId'",
",",
"'BusinessTypeId'",
",",
"'SuboriginId'",
",",
"]",
";",
"for",... | Validate
@throws InvalidArgumentException | [
"Validate"
] | train | https://github.com/zephia/pilot-api-client/blob/218fbf2fc5892e2ffc554ddd01fa95d63d6e3c0f/src/Model/LeadData.php#L84-L105 |
zephia/pilot-api-client | src/Model/LeadData.php | LeadData.set | private function set($key, $value = "")
{
if (property_exists($this, $key)) {
$key = implode('', array_map('ucfirst', explode('_', $key)));
$this->{'set' . $key}($value);
}
} | php | private function set($key, $value = "")
{
if (property_exists($this, $key)) {
$key = implode('', array_map('ucfirst', explode('_', $key)));
$this->{'set' . $key}($value);
}
} | [
"private",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"\"\"",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"key",
")",
")",
"{",
"$",
"key",
"=",
"implode",
"(",
"''",
",",
"array_map",
"(",
"'ucfirst'",
",... | Set
@param $key
@param string $value | [
"Set"
] | train | https://github.com/zephia/pilot-api-client/blob/218fbf2fc5892e2ffc554ddd01fa95d63d6e3c0f/src/Model/LeadData.php#L157-L163 |
turanct/showpad-api | src/Showpad/Client.php | Client.assetsList | public function assetsList($limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/assets.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | php | public function assetsList($limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/assets.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | [
"public",
"function",
"assetsList",
"(",
"$",
"limit",
"=",
"25",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"'/assets.json'",
",",
"array",
"(",
"'query'",
"=>",
"array",
"(",
"'l... | Get a list of existing assets
GET /assets.json
@param int $limit The max number of items we want to retrieve
@param int $offset The number of items to skip from the top of the list
@return array | [
"Get",
"a",
"list",
"of",
"existing",
"assets"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L44-L51 |
turanct/showpad-api | src/Showpad/Client.php | Client.assetsAdd | public function assetsAdd($file)
{
$resource = '/assets.json';
$parameters = array(
'file' => '@' . $file,
);
// Create request
$data = $this->auth->request(
'POST',
$resource,
$parameters
);
return $data;
... | php | public function assetsAdd($file)
{
$resource = '/assets.json';
$parameters = array(
'file' => '@' . $file,
);
// Create request
$data = $this->auth->request(
'POST',
$resource,
$parameters
);
return $data;
... | [
"public",
"function",
"assetsAdd",
"(",
"$",
"file",
")",
"{",
"$",
"resource",
"=",
"'/assets.json'",
";",
"$",
"parameters",
"=",
"array",
"(",
"'file'",
"=>",
"'@'",
".",
"$",
"file",
",",
")",
";",
"// Create request",
"$",
"data",
"=",
"$",
"this"... | Add an asset
POST /assets.json
@param string $file The path to the file
@return array | [
"Add",
"an",
"asset"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L62-L78 |
turanct/showpad-api | src/Showpad/Client.php | Client.assetsGet | public function assetsGet($id)
{
$resource = '/assets/' . $id . '.json';
// Create request
$data = $this->auth->request('GET', $resource);
return $data;
} | php | public function assetsGet($id)
{
$resource = '/assets/' . $id . '.json';
// Create request
$data = $this->auth->request('GET', $resource);
return $data;
} | [
"public",
"function",
"assetsGet",
"(",
"$",
"id",
")",
"{",
"$",
"resource",
"=",
"'/assets/'",
".",
"$",
"id",
".",
"'.json'",
";",
"// Create request",
"$",
"data",
"=",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"$",
"resource",... | Get an asset by id
GET /assets/{id}.json
@param string $id The asset id
@return array | [
"Get",
"an",
"asset",
"by",
"id"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L89-L97 |
turanct/showpad-api | src/Showpad/Client.php | Client.assetsDelete | public function assetsDelete($id)
{
$resource = '/assets/' . $id . '.json';
// Create request
$data = $this->auth->request('DELETE', $resource);
return $data;
} | php | public function assetsDelete($id)
{
$resource = '/assets/' . $id . '.json';
// Create request
$data = $this->auth->request('DELETE', $resource);
return $data;
} | [
"public",
"function",
"assetsDelete",
"(",
"$",
"id",
")",
"{",
"$",
"resource",
"=",
"'/assets/'",
".",
"$",
"id",
".",
"'.json'",
";",
"// Create request",
"$",
"data",
"=",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'DELETE'",
",",
"$",
"reso... | Delete asset by id
DELETE /assets/{id}.json
@param string $id The asset id
@return array | [
"Delete",
"asset",
"by",
"id"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L108-L116 |
turanct/showpad-api | src/Showpad/Client.php | Client.assetsTagsAddById | public function assetsTagsAddById($id, $tag)
{
$resource = '/assets/' . $id . '/tags/' . $tag . '.json';
$parameters = array(
'query' => array('method' => 'link'),
);
// Create request
$data = $this->auth->request(
'GET',
$resource,
... | php | public function assetsTagsAddById($id, $tag)
{
$resource = '/assets/' . $id . '/tags/' . $tag . '.json';
$parameters = array(
'query' => array('method' => 'link'),
);
// Create request
$data = $this->auth->request(
'GET',
$resource,
... | [
"public",
"function",
"assetsTagsAddById",
"(",
"$",
"id",
",",
"$",
"tag",
")",
"{",
"$",
"resource",
"=",
"'/assets/'",
".",
"$",
"id",
".",
"'/tags/'",
".",
"$",
"tag",
".",
"'.json'",
";",
"$",
"parameters",
"=",
"array",
"(",
"'query'",
"=>",
"a... | Add a tag to an asset by tag id
POST /assets/{id}/tags.json
@param string $id The asset id
@param string $tag The tag id
@return array | [
"Add",
"a",
"tag",
"to",
"an",
"asset",
"by",
"tag",
"id"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L156-L172 |
turanct/showpad-api | src/Showpad/Client.php | Client.assetsTagsList | public function assetsTagsList($assetId, $limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/assets/' . $assetId . '/tags.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | php | public function assetsTagsList($assetId, $limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/assets/' . $assetId . '/tags.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | [
"public",
"function",
"assetsTagsList",
"(",
"$",
"assetId",
",",
"$",
"limit",
"=",
"25",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"'/assets/'",
".",
"$",
"assetId",
".",
"'/tag... | Get a list of existing assets
GET /assets/{id}/tags.json
@param int $assetId The id of the asset
@param int $limit The max number of items we want to retrieve
@param int $offset The number of items to skip from the top of the list
@return array | [
"Get",
"a",
"list",
"of",
"existing",
"assets"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L206-L213 |
turanct/showpad-api | src/Showpad/Client.php | Client.tagsList | public function tagsList($limit = 25, $offset = 0)
{
$resource = '/tags.json';
// Create request
$data = $this->auth->request(
'GET',
$resource,
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
return $data;
... | php | public function tagsList($limit = 25, $offset = 0)
{
$resource = '/tags.json';
// Create request
$data = $this->auth->request(
'GET',
$resource,
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
return $data;
... | [
"public",
"function",
"tagsList",
"(",
"$",
"limit",
"=",
"25",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"$",
"resource",
"=",
"'/tags.json'",
";",
"// Create request",
"$",
"data",
"=",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"... | Get a list of existing tags
GET /tags.json
@param int $limit The max number of items we want to retrieve
@param int $offset The number of items to skip from the top of the list
@return array | [
"Get",
"a",
"list",
"of",
"existing",
"tags"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L225-L237 |
turanct/showpad-api | src/Showpad/Client.php | Client.ticketsGet | public function ticketsGet($id)
{
$resource = '/tickets/' . $id . '.json';
// Create request
$data = $this->auth->request('GET', $resource);
return $data;
} | php | public function ticketsGet($id)
{
$resource = '/tickets/' . $id . '.json';
// Create request
$data = $this->auth->request('GET', $resource);
return $data;
} | [
"public",
"function",
"ticketsGet",
"(",
"$",
"id",
")",
"{",
"$",
"resource",
"=",
"'/tickets/'",
".",
"$",
"id",
".",
"'.json'",
";",
"// Create request",
"$",
"data",
"=",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"$",
"resource... | Get a ticket by id
GET /tickets/{id}.json
@param string $id The ticket id
@return array | [
"Get",
"a",
"ticket",
"by",
"id"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L266-L274 |
turanct/showpad-api | src/Showpad/Client.php | Client.tagAssetsList | public function tagAssetsList($tagId, $limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/tags/' . $tagId . '/assets.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | php | public function tagAssetsList($tagId, $limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/tags/' . $tagId . '/assets.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | [
"public",
"function",
"tagAssetsList",
"(",
"$",
"tagId",
",",
"$",
"limit",
"=",
"25",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"'/tags/'",
".",
"$",
"tagId",
".",
"'/assets.jso... | Get a list of assets coupled to a certain tag
GET /tags/{id}/assets.json
@param int $limit The max number of items we want to retrieve
@param int $offset The number of items to skip from the top of the list
@return array | [
"Get",
"a",
"list",
"of",
"assets",
"coupled",
"to",
"a",
"certain",
"tag"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L286-L293 |
turanct/showpad-api | src/Showpad/Client.php | Client.channelsList | public function channelsList($limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/channels.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | php | public function channelsList($limit = 25, $offset = 0)
{
return $this->auth->request(
'GET',
'/channels.json',
array('query' => array('limit' => (int) $limit, 'offset' => (int) $offset))
);
} | [
"public",
"function",
"channelsList",
"(",
"$",
"limit",
"=",
"25",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"auth",
"->",
"request",
"(",
"'GET'",
",",
"'/channels.json'",
",",
"array",
"(",
"'query'",
"=>",
"array",
"(",
... | Get a list of existing channels
@note: this works only with API v3
GET /channels.json
@param int $limit The max number of items we want to retrieve
@param int $offset The number of items to skip from the top of the list
@return array | [
"Get",
"a",
"list",
"of",
"existing",
"channels"
] | train | https://github.com/turanct/showpad-api/blob/6b17a2bb3609b3696529014911287688b54bea19/src/Showpad/Client.php#L307-L314 |
GrahamDeprecated/CMS-Core | src/Models/User.php | User.beforeDelete | public function beforeDelete()
{
$this->invites()->sync(array());
$this->deletePages();
$this->deletePosts();
$this->deleteEvents();
$this->deleteComments();
} | php | public function beforeDelete()
{
$this->invites()->sync(array());
$this->deletePages();
$this->deletePosts();
$this->deleteEvents();
$this->deleteComments();
} | [
"public",
"function",
"beforeDelete",
"(",
")",
"{",
"$",
"this",
"->",
"invites",
"(",
")",
"->",
"sync",
"(",
"array",
"(",
")",
")",
";",
"$",
"this",
"->",
"deletePages",
"(",
")",
";",
"$",
"this",
"->",
"deletePosts",
"(",
")",
";",
"$",
"t... | Before deleting an existing model.
@return mixed | [
"Before",
"deleting",
"an",
"existing",
"model",
"."
] | train | https://github.com/GrahamDeprecated/CMS-Core/blob/5603e2bfa2fac6cf46ca3ed62d21518f2f653675/src/Models/User.php#L49-L56 |
2amigos/yiifoundation | helpers/Alert.php | Alert.success | public static function success($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', Enum::COLOR_SUCCESS, $htmlOptions);
return static::alert($content, $htmlOptions, $close);
} | php | public static function success($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', Enum::COLOR_SUCCESS, $htmlOptions);
return static::alert($content, $htmlOptions, $close);
} | [
"public",
"static",
"function",
"success",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"close",
"=",
"'×'",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"Enum",
"::",
"COLOR_SUCCESS",
",",
"$",
... | Generates a success alert
@param string $content the text within the alert box
@param array $htmlOptions the HTML attributes of the alert box
@param string $close the label for the close button. Set to false if you don't wish to display it.
@return string the alert box | [
"Generates",
"a",
"success",
"alert"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Alert.php#L28-L32 |
2amigos/yiifoundation | helpers/Alert.php | Alert.important | public static function important($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', Enum::COLOR_ALERT, $htmlOptions);
return static::alert($content, $htmlOptions, $close);
} | php | public static function important($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', Enum::COLOR_ALERT, $htmlOptions);
return static::alert($content, $htmlOptions, $close);
} | [
"public",
"static",
"function",
"important",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"close",
"=",
"'×'",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"Enum",
"::",
"COLOR_ALERT",
",",
"$",
... | Generates an red coloured alert box
@param string $content the text within the alert box
@param array $htmlOptions the HTML attributes of the alert box
@param string $close the label for the close button. Set to false if you don't wish to display it.
@return string the alert box | [
"Generates",
"an",
"red",
"coloured",
"alert",
"box"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Alert.php#L42-L46 |
2amigos/yiifoundation | helpers/Alert.php | Alert.secondary | public static function secondary($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', Enum::COLOR_SECONDARY, $htmlOptions);
return static::alert($content, $htmlOptions, $close);
} | php | public static function secondary($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', Enum::COLOR_SECONDARY, $htmlOptions);
return static::alert($content, $htmlOptions, $close);
} | [
"public",
"static",
"function",
"secondary",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"close",
"=",
"'×'",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"Enum",
"::",
"COLOR_SECONDARY",
",",
"... | Generates a secondary alert box
@param string $content the text within the alert box
@param array $htmlOptions the HTML attributes of the alert box
@param string $close the label for the close button. Set to false if you don't wish to display it.
@return string the alert box | [
"Generates",
"a",
"secondary",
"alert",
"box"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Alert.php#L56-L60 |
2amigos/yiifoundation | helpers/Alert.php | Alert.alert | public static function alert($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', 'alert-box', $htmlOptions);
ob_start();
echo '<div data-alert ' . \CHtml::renderAttributes($htmlOptions) . '>';
echo $content;
if ($close !== false)
... | php | public static function alert($content, $htmlOptions = array(), $close = '×')
{
ArrayHelper::addValue('class', 'alert-box', $htmlOptions);
ob_start();
echo '<div data-alert ' . \CHtml::renderAttributes($htmlOptions) . '>';
echo $content;
if ($close !== false)
... | [
"public",
"static",
"function",
"alert",
"(",
"$",
"content",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
",",
"$",
"close",
"=",
"'×'",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"'alert-box'",
",",
"$",
"htmlOptions",
")"... | Returns an alert box
@param string $content the text within the alert box
@param array $htmlOptions the HTML attributes of the alert box
@param string $close the label for the close button. Set to false if you don't wish to display it.
@return string the alert box
@see http://foundation.zurb.com/docs/components/alert-... | [
"Returns",
"an",
"alert",
"box"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Alert.php#L71-L82 |
2amigos/yiifoundation | helpers/Alert.php | Alert.closeLink | public static function closeLink($label = '×', $htmlOptions = array())
{
$htmlOptions = ArrayHelper::defaultValue('href', '#', $htmlOptions);
ArrayHelper::addValue('class', 'close', $htmlOptions);
return \CHtml::openTag('a', $htmlOptions) . $label . \CHtml::closeTag('a');
} | php | public static function closeLink($label = '×', $htmlOptions = array())
{
$htmlOptions = ArrayHelper::defaultValue('href', '#', $htmlOptions);
ArrayHelper::addValue('class', 'close', $htmlOptions);
return \CHtml::openTag('a', $htmlOptions) . $label . \CHtml::closeTag('a');
} | [
"public",
"static",
"function",
"closeLink",
"(",
"$",
"label",
"=",
"'×'",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"htmlOptions",
"=",
"ArrayHelper",
"::",
"defaultValue",
"(",
"'href'",
",",
"'#'",
",",
"$",
"htmlOptions",
... | Generates a close link.
@param string $label the link label text.
@param array $htmlOptions additional HTML attributes.
@return string the generated link. | [
"Generates",
"a",
"close",
"link",
"."
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Alert.php#L90-L95 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php | ContentTypeGroupSubManager.loadContentTypeGroupsByIdentifiers | public function loadContentTypeGroupsByIdentifiers(array $identifiers)
{
$contentTypeGroups = array_map(
function ($identifier) {
try {
return $this->contentTypeService->loadContentTypeGroupByIdentifier($identifier);
} catch (NotFoundException ... | php | public function loadContentTypeGroupsByIdentifiers(array $identifiers)
{
$contentTypeGroups = array_map(
function ($identifier) {
try {
return $this->contentTypeService->loadContentTypeGroupByIdentifier($identifier);
} catch (NotFoundException ... | [
"public",
"function",
"loadContentTypeGroupsByIdentifiers",
"(",
"array",
"$",
"identifiers",
")",
"{",
"$",
"contentTypeGroups",
"=",
"array_map",
"(",
"function",
"(",
"$",
"identifier",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"contentTypeService",
... | /*
@param array $identifiers
@return ContentTypeGroup[] | [
"/",
"*",
"@param",
"array",
"$identifiers"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php#L62-L76 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php | ContentTypeGroupSubManager.createContentTypeGroupByIdentifier | private function createContentTypeGroupByIdentifier($contentTypeGroupIdentifier)
{
$contentTypeGroupCreateStruct = new ContentTypeGroupCreateStruct();
$contentTypeGroupCreateStruct->identifier = $contentTypeGroupIdentifier;
return $this->contentTypeService->createContentTypeGroup($contentTy... | php | private function createContentTypeGroupByIdentifier($contentTypeGroupIdentifier)
{
$contentTypeGroupCreateStruct = new ContentTypeGroupCreateStruct();
$contentTypeGroupCreateStruct->identifier = $contentTypeGroupIdentifier;
return $this->contentTypeService->createContentTypeGroup($contentTy... | [
"private",
"function",
"createContentTypeGroupByIdentifier",
"(",
"$",
"contentTypeGroupIdentifier",
")",
"{",
"$",
"contentTypeGroupCreateStruct",
"=",
"new",
"ContentTypeGroupCreateStruct",
"(",
")",
";",
"$",
"contentTypeGroupCreateStruct",
"->",
"identifier",
"=",
"$",
... | @param string $contentTypeGroupIdentifier
@return ContentTypeGroup | [
"@param",
"string",
"$contentTypeGroupIdentifier"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php#L83-L89 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php | ContentTypeGroupSubManager.updateContentTypeGroupsAssignment | public function updateContentTypeGroupsAssignment(ContentTypeObject $object)
{
// Load contenttype
$contentType = $this->contentTypeService->loadContentTypeByIdentifier($object->data['identifier']);
// Get identifiers of current contenttypegroups
$currentContentTypeGroupIdentifiers ... | php | public function updateContentTypeGroupsAssignment(ContentTypeObject $object)
{
// Load contenttype
$contentType = $this->contentTypeService->loadContentTypeByIdentifier($object->data['identifier']);
// Get identifiers of current contenttypegroups
$currentContentTypeGroupIdentifiers ... | [
"public",
"function",
"updateContentTypeGroupsAssignment",
"(",
"ContentTypeObject",
"$",
"object",
")",
"{",
"// Load contenttype",
"$",
"contentType",
"=",
"$",
"this",
"->",
"contentTypeService",
"->",
"loadContentTypeByIdentifier",
"(",
"$",
"object",
"->",
"data",
... | @param ContentTypeObject $object
@return bool
@throws NotFoundException
@throws \Exception | [
"@param",
"ContentTypeObject",
"$object"
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php#L99-L123 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php | ContentTypeGroupSubManager.attachContentTypeGroupsByIdentifiers | private function attachContentTypeGroupsByIdentifiers(ContentType $contentType, array $contentTypeGroupsIdentifiers)
{
$contentTypeGroups = $this->loadContentTypeGroupsByIdentifiers($contentTypeGroupsIdentifiers);
foreach ($contentTypeGroups as $contentTypeGroup) {
$this->contentTypeServ... | php | private function attachContentTypeGroupsByIdentifiers(ContentType $contentType, array $contentTypeGroupsIdentifiers)
{
$contentTypeGroups = $this->loadContentTypeGroupsByIdentifiers($contentTypeGroupsIdentifiers);
foreach ($contentTypeGroups as $contentTypeGroup) {
$this->contentTypeServ... | [
"private",
"function",
"attachContentTypeGroupsByIdentifiers",
"(",
"ContentType",
"$",
"contentType",
",",
"array",
"$",
"contentTypeGroupsIdentifiers",
")",
"{",
"$",
"contentTypeGroups",
"=",
"$",
"this",
"->",
"loadContentTypeGroupsByIdentifiers",
"(",
"$",
"contentTy... | Load (and create if not exists) new contenttype groups, and assign them to a contenttype.
@param ContentType $contentType
@param array $contentTypeGroupsIdentifiers
@throws NotFoundException | [
"Load",
"(",
"and",
"create",
"if",
"not",
"exists",
")",
"new",
"contenttype",
"groups",
"and",
"assign",
"them",
"to",
"a",
"contenttype",
"."
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php#L133-L139 |
transfer-framework/ezplatform | src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php | ContentTypeGroupSubManager.detachContentTypeGroupsByIdentifiers | private function detachContentTypeGroupsByIdentifiers(ContentType $contentType, array $contentTypeGroupsIdentifiers)
{
$contentTypeGroups = $this->loadContentTypeGroupsByIdentifiers($contentTypeGroupsIdentifiers);
foreach ($contentTypeGroups as $contentTypeGroup) {
$this->contentTypeServ... | php | private function detachContentTypeGroupsByIdentifiers(ContentType $contentType, array $contentTypeGroupsIdentifiers)
{
$contentTypeGroups = $this->loadContentTypeGroupsByIdentifiers($contentTypeGroupsIdentifiers);
foreach ($contentTypeGroups as $contentTypeGroup) {
$this->contentTypeServ... | [
"private",
"function",
"detachContentTypeGroupsByIdentifiers",
"(",
"ContentType",
"$",
"contentType",
",",
"array",
"$",
"contentTypeGroupsIdentifiers",
")",
"{",
"$",
"contentTypeGroups",
"=",
"$",
"this",
"->",
"loadContentTypeGroupsByIdentifiers",
"(",
"$",
"contentTy... | Load contenttype groups, and unassign them from a contenttype.
@param ContentType $contentType
@param array $contentTypeGroupsIdentifiers
@throws NotFoundException | [
"Load",
"contenttype",
"groups",
"and",
"unassign",
"them",
"from",
"a",
"contenttype",
"."
] | train | https://github.com/transfer-framework/ezplatform/blob/1b2d87caa1a6b79fd8fc78109c26a2d1d6359c2f/src/Transfer/EzPlatform/Repository/Manager/Sub/ContentTypeGroupSubManager.php#L149-L155 |
php-rise/rise | src/Router/UrlGenerator.php | UrlGenerator.generate | public function generate($name, $params = []) {
$url = '';
$path = $this->generatePath($name, $params);
if ($path) {
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
&& $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'
) {
$scheme = 'https';
} else {
$scheme = 'http';
}
$url = $scheme . '://... | php | public function generate($name, $params = []) {
$url = '';
$path = $this->generatePath($name, $params);
if ($path) {
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
&& $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'
) {
$scheme = 'https';
} else {
$scheme = 'http';
}
$url = $scheme . '://... | [
"public",
"function",
"generate",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"url",
"=",
"''",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"generatePath",
"(",
"$",
"name",
",",
"$",
"params",
")",
";",
"if",
"(",
"$",
... | Generate URL.
@param string $name
@param array $params
@return string | [
"Generate",
"URL",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Router/UrlGenerator.php#L46-L62 |
php-rise/rise | src/Router/UrlGenerator.php | UrlGenerator.compile | protected function compile($name) {
if (!isset($this->raw[$name])) {
return;
}
$count = preg_match_all(
self::ROUTE_PARAM_PATTERN,
$this->raw[$name],
$matches,
PREG_OFFSET_CAPTURE
);
if ($count === 0) {
$this->compiled[$name] = $this->raw[$name];
} else if ($count > 0) {
$routePath = ... | php | protected function compile($name) {
if (!isset($this->raw[$name])) {
return;
}
$count = preg_match_all(
self::ROUTE_PARAM_PATTERN,
$this->raw[$name],
$matches,
PREG_OFFSET_CAPTURE
);
if ($count === 0) {
$this->compiled[$name] = $this->raw[$name];
} else if ($count > 0) {
$routePath = ... | [
"protected",
"function",
"compile",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"raw",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"count",
"=",
"preg_match_all",
"(",
"self",
"::",
"ROUTE_PARAM_P... | Compile raw route to a format for generation.
@param string $name | [
"Compile",
"raw",
"route",
"to",
"a",
"format",
"for",
"generation",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Router/UrlGenerator.php#L69-L100 |
php-rise/rise | src/Router/UrlGenerator.php | UrlGenerator.getCompiledRoute | protected function getCompiledRoute($name) {
if (!isset($this->compiled[$name])) {
$this->compile($name);
}
return isset($this->compiled[$name]) ? $this->compiled[$name] : null;
} | php | protected function getCompiledRoute($name) {
if (!isset($this->compiled[$name])) {
$this->compile($name);
}
return isset($this->compiled[$name]) ? $this->compiled[$name] : null;
} | [
"protected",
"function",
"getCompiledRoute",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"compiled",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"compile",
"(",
"$",
"name",
")",
";",
"}",
"return",
"... | Get a compiled route.
@param string $name
@return string|array|null | [
"Get",
"a",
"compiled",
"route",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Router/UrlGenerator.php#L108-L114 |
php-rise/rise | src/Router/UrlGenerator.php | UrlGenerator.generatePath | protected function generatePath($name, $params = []) {
$result = '';
$compiledRoute = $this->getCompiledRoute($name);
if (is_string($compiledRoute)) {
$result = $compiledRoute;
} else if (is_array($compiledRoute)) {
$chunks = $compiledRoute['chunks'];
foreach ($params as $paramName => $value) {
if... | php | protected function generatePath($name, $params = []) {
$result = '';
$compiledRoute = $this->getCompiledRoute($name);
if (is_string($compiledRoute)) {
$result = $compiledRoute;
} else if (is_array($compiledRoute)) {
$chunks = $compiledRoute['chunks'];
foreach ($params as $paramName => $value) {
if... | [
"protected",
"function",
"generatePath",
"(",
"$",
"name",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"compiledRoute",
"=",
"$",
"this",
"->",
"getCompiledRoute",
"(",
"$",
"name",
")",
";",
"if",
"(",
"is_string... | Generate path from compiled route.
@param string $name
@param array $params
@return string | [
"Generate",
"path",
"from",
"compiled",
"route",
"."
] | train | https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Router/UrlGenerator.php#L123-L141 |
webforge-labs/psc-cms | lib/Psc/Form/HTML.php | HTML.select | public static function select($name, $options, $selected = NULL, Array $attributes = NULL) {
$name = self::getName($name);
if (is_string($options)) {
// nothing, wir haben hier vermutlich schon was zusammengebaut, was so hinkommt
} else {
$options = self::selectOptions($options, $selected);... | php | public static function select($name, $options, $selected = NULL, Array $attributes = NULL) {
$name = self::getName($name);
if (is_string($options)) {
// nothing, wir haben hier vermutlich schon was zusammengebaut, was so hinkommt
} else {
$options = self::selectOptions($options, $selected);... | [
"public",
"static",
"function",
"select",
"(",
"$",
"name",
",",
"$",
"options",
",",
"$",
"selected",
"=",
"NULL",
",",
"Array",
"$",
"attributes",
"=",
"NULL",
")",
"{",
"$",
"name",
"=",
"self",
"::",
"getName",
"(",
"$",
"name",
")",
";",
"if",... | Erstellt ein Select Element
@param string $name
@param HTMLTag[] $options
@param mixed $selected das Ausgewählte elemt (muss die value einer option sein)
@param Array $attributes
@return HTMLTag | [
"Erstellt",
"ein",
"Select",
"Element"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/HTML.php#L90-L104 |
webforge-labs/psc-cms | lib/Psc/Form/HTML.php | HTML.selectOptions | public static function selectOptions($optionsArray, $selected = NULL) {
$ret = array();
foreach ($optionsArray as $value => $label) {
if ($label instanceof HTMLTag) {
$tag = $label;
if ($tag->getAttribute('value') === $selected)
$tag->setAttribute('selected','selected');... | php | public static function selectOptions($optionsArray, $selected = NULL) {
$ret = array();
foreach ($optionsArray as $value => $label) {
if ($label instanceof HTMLTag) {
$tag = $label;
if ($tag->getAttribute('value') === $selected)
$tag->setAttribute('selected','selected');... | [
"public",
"static",
"function",
"selectOptions",
"(",
"$",
"optionsArray",
",",
"$",
"selected",
"=",
"NULL",
")",
"{",
"$",
"ret",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"optionsArray",
"as",
"$",
"value",
"=>",
"$",
"label",
")",
"{",
"i... | Erstellt einen Array von <option> Elementen für select
@param array $optionsArray $value => $label , $label wird escaped
@param mixed $selected die Value von dem Element welches selected="selected" als attribut haben soll
@return HTMLTag[] | [
"Erstellt",
"einen",
"Array",
"von",
"<option",
">",
"Elementen",
"für",
"select"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/HTML.php#L158-L183 |
webforge-labs/psc-cms | lib/Psc/Form/HTML.php | HTML.tag | public static function tag($name, $content = NULL, Array $attributes = NULL) {
$tag = new HTMLTag($name, $content, $attributes);
return $tag;
} | php | public static function tag($name, $content = NULL, Array $attributes = NULL) {
$tag = new HTMLTag($name, $content, $attributes);
return $tag;
} | [
"public",
"static",
"function",
"tag",
"(",
"$",
"name",
",",
"$",
"content",
"=",
"NULL",
",",
"Array",
"$",
"attributes",
"=",
"NULL",
")",
"{",
"$",
"tag",
"=",
"new",
"HTMLTag",
"(",
"$",
"name",
",",
"$",
"content",
",",
"$",
"attributes",
")"... | Erzeugt ein neues Tag
@param string $name
@param mixed $content
@param Array $attributes
@return HTMLTag | [
"Erzeugt",
"ein",
"neues",
"Tag"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Form/HTML.php#L201-L204 |
crypto-markets/common | src/Common/GatewayFactory.php | GatewayFactory.create | public function create($abstract, array $options = [])
{
$concrete = $this->getConcrete($abstract);
if (class_exists($concrete)) {
return new $concrete($options);
}
throw new InvalidArgumentException("The gateway of [$abstract] not supported.");
} | php | public function create($abstract, array $options = [])
{
$concrete = $this->getConcrete($abstract);
if (class_exists($concrete)) {
return new $concrete($options);
}
throw new InvalidArgumentException("The gateway of [$abstract] not supported.");
} | [
"public",
"function",
"create",
"(",
"$",
"abstract",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"concrete",
"=",
"$",
"this",
"->",
"getConcrete",
"(",
"$",
"abstract",
")",
";",
"if",
"(",
"class_exists",
"(",
"$",
"concrete",
")",... | Create an instance of the specified market driver.
@param string $abstract
@param array $options
@return \CryptoMarkets\Common\Gateway
@throws \InvalidArgumentException | [
"Create",
"an",
"instance",
"of",
"the",
"specified",
"market",
"driver",
"."
] | train | https://github.com/crypto-markets/common/blob/206b1d9b88502d3fb73cef1323cd086156d3e633/src/Common/GatewayFactory.php#L18-L27 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Uri.php | Zend_Uri.setConfig | static public function setConfig(array $config)
{
foreach ($config as $k => $v) {
self::$_config[$k] = $v;
}
} | php | static public function setConfig(array $config)
{
foreach ($config as $k => $v) {
self::$_config[$k] = $v;
}
} | [
"static",
"public",
"function",
"setConfig",
"(",
"array",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"self",
"::",
"$",
"_config",
"[",
"$",
"k",
"]",
"=",
"$",
"v",
";",
"}",
"}"
] | Set global configuration options
@param array $config | [
"Set",
"global",
"configuration",
"options"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Uri.php#L156-L161 |
boekkooi/tactician-amqp | src/Publisher/MessageCapturer.php | MessageCapturer.fetchMessages | public function fetchMessages($clear = true)
{
$messages = $this->messages;
if ($clear) {
$this->clear();
}
return $messages;
} | php | public function fetchMessages($clear = true)
{
$messages = $this->messages;
if ($clear) {
$this->clear();
}
return $messages;
} | [
"public",
"function",
"fetchMessages",
"(",
"$",
"clear",
"=",
"true",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"messages",
";",
"if",
"(",
"$",
"clear",
")",
"{",
"$",
"this",
"->",
"clear",
"(",
")",
";",
"}",
"return",
"$",
"messages",... | Fetch the captured messages.
@param bool $clear Clear the stored messages
@return Message[] | [
"Fetch",
"the",
"captured",
"messages",
"."
] | train | https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/Publisher/MessageCapturer.php#L33-L41 |
inc2734/wp-share-buttons | src/App/Model/Count_Cache.php | Count_Cache.get | public function get() {
$cache = get_post_meta( $this->post_id, '_inc2734_count_cache_' . $this->service_name, true );
if ( '' !== $cache && time() <= $cache['expiration'] ) {
return $cache['count'];
}
} | php | public function get() {
$cache = get_post_meta( $this->post_id, '_inc2734_count_cache_' . $this->service_name, true );
if ( '' !== $cache && time() <= $cache['expiration'] ) {
return $cache['count'];
}
} | [
"public",
"function",
"get",
"(",
")",
"{",
"$",
"cache",
"=",
"get_post_meta",
"(",
"$",
"this",
"->",
"post_id",
",",
"'_inc2734_count_cache_'",
".",
"$",
"this",
"->",
"service_name",
",",
"true",
")",
";",
"if",
"(",
"''",
"!==",
"$",
"cache",
"&&"... | Return count cache
@return null|int | [
"Return",
"count",
"cache"
] | train | https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Model/Count_Cache.php#L39-L44 |
inc2734/wp-share-buttons | src/App/Model/Count_Cache.php | Count_Cache.get_cache_expiration | public function get_cache_expiration() {
$cache = get_post_meta( $this->post_id, '_inc2734_count_cache_' . $this->service_name, true );
if ( ! empty( $cache['expiration'] ) ) {
return date_i18n( 'm-d-Y H:i:s', $cache['expiration'] );
}
} | php | public function get_cache_expiration() {
$cache = get_post_meta( $this->post_id, '_inc2734_count_cache_' . $this->service_name, true );
if ( ! empty( $cache['expiration'] ) ) {
return date_i18n( 'm-d-Y H:i:s', $cache['expiration'] );
}
} | [
"public",
"function",
"get_cache_expiration",
"(",
")",
"{",
"$",
"cache",
"=",
"get_post_meta",
"(",
"$",
"this",
"->",
"post_id",
",",
"'_inc2734_count_cache_'",
".",
"$",
"this",
"->",
"service_name",
",",
"true",
")",
";",
"if",
"(",
"!",
"empty",
"(",... | Return count cache
@return null|int | [
"Return",
"count",
"cache"
] | train | https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Model/Count_Cache.php#L51-L56 |
inc2734/wp-share-buttons | src/App/Model/Count_Cache.php | Count_Cache.update | public function update( $count ) {
update_post_meta(
$this->post_id,
'_inc2734_count_cache_' . $this->service_name,
[
'count' => $count,
'expiration' => time() + (int) apply_filters( 'inc2734_wp_share_buttons_count_cache_seconds', 60 * 5 ),
]
);
} | php | public function update( $count ) {
update_post_meta(
$this->post_id,
'_inc2734_count_cache_' . $this->service_name,
[
'count' => $count,
'expiration' => time() + (int) apply_filters( 'inc2734_wp_share_buttons_count_cache_seconds', 60 * 5 ),
]
);
} | [
"public",
"function",
"update",
"(",
"$",
"count",
")",
"{",
"update_post_meta",
"(",
"$",
"this",
"->",
"post_id",
",",
"'_inc2734_count_cache_'",
".",
"$",
"this",
"->",
"service_name",
",",
"[",
"'count'",
"=>",
"$",
"count",
",",
"'expiration'",
"=>",
... | Update count cache
@return bool | [
"Update",
"count",
"cache"
] | train | https://github.com/inc2734/wp-share-buttons/blob/cd032893ca083a343f5871e855cce68f4ede3a17/src/App/Model/Count_Cache.php#L73-L82 |
austinkregel/Warden | src/Warden/WardenServiceProvider.php | WardenServiceProvider.register | public function register()
{
// Register the FormModel Provider.
$this->app->register(\Kregel\FormModel\FormModelServiceProvider::class);
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
// Register the alias.
$loader->alias('FormModel', \Kregel\FormModel\FormMode... | php | public function register()
{
// Register the FormModel Provider.
$this->app->register(\Kregel\FormModel\FormModelServiceProvider::class);
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
// Register the alias.
$loader->alias('FormModel', \Kregel\FormModel\FormMode... | [
"public",
"function",
"register",
"(",
")",
"{",
"// Register the FormModel Provider.",
"$",
"this",
"->",
"app",
"->",
"register",
"(",
"\\",
"Kregel",
"\\",
"FormModel",
"\\",
"FormModelServiceProvider",
"::",
"class",
")",
";",
"$",
"loader",
"=",
"\\",
"Il... | Register the service provider. | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/WardenServiceProvider.php#L27-L34 |
austinkregel/Warden | src/Warden/WardenServiceProvider.php | WardenServiceProvider.boot | public function boot(Router $router)
{
$this->defineRoutes($router);
$this->loadViewsFrom(__DIR__.'/../resources/views', 'warden');
$this->publishes([
__DIR__.'/../resources/views' => base_path('resources/views/vendor/warden'),
], 'views');
$this->publishes([
... | php | public function boot(Router $router)
{
$this->defineRoutes($router);
$this->loadViewsFrom(__DIR__.'/../resources/views', 'warden');
$this->publishes([
__DIR__.'/../resources/views' => base_path('resources/views/vendor/warden'),
], 'views');
$this->publishes([
... | [
"public",
"function",
"boot",
"(",
"Router",
"$",
"router",
")",
"{",
"$",
"this",
"->",
"defineRoutes",
"(",
"$",
"router",
")",
";",
"$",
"this",
"->",
"loadViewsFrom",
"(",
"__DIR__",
".",
"'/../resources/views'",
",",
"'warden'",
")",
";",
"$",
"this... | Bootstrap any application services. | [
"Bootstrap",
"any",
"application",
"services",
"."
] | train | https://github.com/austinkregel/Warden/blob/6f5a98bd79a488f0f300f4851061ac6f7d19f8a3/src/Warden/WardenServiceProvider.php#L39-L50 |
dms-org/package.blog | src/Domain/Services/Loader/BlogArticleLoader.php | BlogArticleLoader.getAmountOfArticles | public function getAmountOfArticles(Criteria $criteria = null) : int
{
return $this->blogArticleRepo->countMatching($criteria ?? $this->criteria());
} | php | public function getAmountOfArticles(Criteria $criteria = null) : int
{
return $this->blogArticleRepo->countMatching($criteria ?? $this->criteria());
} | [
"public",
"function",
"getAmountOfArticles",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
")",
":",
"int",
"{",
"return",
"$",
"this",
"->",
"blogArticleRepo",
"->",
"countMatching",
"(",
"$",
"criteria",
"??",
"$",
"this",
"->",
"criteria",
"(",
")",
")... | @param Criteria $criteria
@return int | [
"@param",
"Criteria",
"$criteria"
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Domain/Services/Loader/BlogArticleLoader.php#L63-L66 |
dms-org/package.blog | src/Domain/Services/Loader/BlogArticleLoader.php | BlogArticleLoader.loadFromSlug | public function loadFromSlug(string $slug) : BlogArticle
{
$categories = $this->blogArticleRepo->matching(
$this->blogArticleRepo->criteria()
->where(BlogArticle::SLUG, '=', $slug)
->where(BlogArticle::PUBLISHED, '=', true)
);
if (!$categories) {
... | php | public function loadFromSlug(string $slug) : BlogArticle
{
$categories = $this->blogArticleRepo->matching(
$this->blogArticleRepo->criteria()
->where(BlogArticle::SLUG, '=', $slug)
->where(BlogArticle::PUBLISHED, '=', true)
);
if (!$categories) {
... | [
"public",
"function",
"loadFromSlug",
"(",
"string",
"$",
"slug",
")",
":",
"BlogArticle",
"{",
"$",
"categories",
"=",
"$",
"this",
"->",
"blogArticleRepo",
"->",
"matching",
"(",
"$",
"this",
"->",
"blogArticleRepo",
"->",
"criteria",
"(",
")",
"->",
"wh... | @param string $slug
@return BlogArticle
@throws EntityNotFoundException | [
"@param",
"string",
"$slug"
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Domain/Services/Loader/BlogArticleLoader.php#L86-L99 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.