id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
228,600 | gurukami/php-array | src/Arrays.php | Arrays.delete | public static function delete($key, &$array)
{
if (!is_array($array)) {
return false;
}
if ($key == '') {
unset($array[$key]);
return true;
}
if ($key === '[]') {
return false;
}
return self::parseAndValidateKeys... | php | public static function delete($key, &$array)
{
if (!is_array($array)) {
return false;
}
if ($key == '') {
unset($array[$key]);
return true;
}
if ($key === '[]') {
return false;
}
return self::parseAndValidateKeys... | [
"public",
"static",
"function",
"delete",
"(",
"$",
"key",
",",
"&",
"$",
"array",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"key",
"==",
"''",
")",
"{",
"unset",
"(",
... | Delete element from the array by a string representation
@param string $key <p>Name key in the array. Example: key[sub_key][sub_sub_key]</p>
@param array $array <p>The array. This array is passed by reference</p>
@return bool returns true if success, false otherwise | [
"Delete",
"element",
"from",
"the",
"array",
"by",
"a",
"string",
"representation"
] | 634715e70efd67edfb99d2a74e09cec809280abd | https://github.com/gurukami/php-array/blob/634715e70efd67edfb99d2a74e09cec809280abd/src/Arrays.php#L93-L106 |
228,601 | antaresproject/core | src/components/view/src/Notification/AbstractNotificationTemplate.php | AbstractNotificationTemplate.getRecipients | public function getRecipients()
{
if (empty($this->recipients)) {
return [];
}
$recipients = ($this->recipients instanceof Collection) ? $this->recipients->toArray() : $this->recipients;
if (!is_array($recipients)) {
return $recipients;
}
$r... | php | public function getRecipients()
{
if (empty($this->recipients)) {
return [];
}
$recipients = ($this->recipients instanceof Collection) ? $this->recipients->toArray() : $this->recipients;
if (!is_array($recipients)) {
return $recipients;
}
$r... | [
"public",
"function",
"getRecipients",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"recipients",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"recipients",
"=",
"(",
"$",
"this",
"->",
"recipients",
"instanceof",
"Collection",
")",
... | notification recipients values getter
@return mixed | [
"notification",
"recipients",
"values",
"getter"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/view/src/Notification/AbstractNotificationTemplate.php#L203-L234 |
228,602 | antaresproject/core | src/components/view/src/Notification/AbstractNotificationTemplate.php | AbstractNotificationTemplate.getVariables | public function getVariables()
{
$variables = app()->make('antares.notifications')->all();
$extensions = app()->make('antares.memory')->make('component')->get('extensions.active');
if (empty($variables)) {
return [];
}
$return = [];
foreach ($variables a... | php | public function getVariables()
{
$variables = app()->make('antares.notifications')->all();
$extensions = app()->make('antares.memory')->make('component')->get('extensions.active');
if (empty($variables)) {
return [];
}
$return = [];
foreach ($variables a... | [
"public",
"function",
"getVariables",
"(",
")",
"{",
"$",
"variables",
"=",
"app",
"(",
")",
"->",
"make",
"(",
"'antares.notifications'",
")",
"->",
"all",
"(",
")",
";",
"$",
"extensions",
"=",
"app",
"(",
")",
"->",
"make",
"(",
"'antares.memory'",
... | get available variables
@return array | [
"get",
"available",
"variables"
] | b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2 | https://github.com/antaresproject/core/blob/b6d088d9f8a0642e71e8ff7a93997f1f34bc5ca2/src/components/view/src/Notification/AbstractNotificationTemplate.php#L319-L341 |
228,603 | minmb/phpmailer | class.phpmailer.php | PHPMailer.PreSend | public function PreSend() {
try {
$this->mailHeader = "";
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL);
}
// Set whether the message is multipart/alternative
if(!empty($th... | php | public function PreSend() {
try {
$this->mailHeader = "";
if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL);
}
// Set whether the message is multipart/alternative
if(!empty($th... | [
"public",
"function",
"PreSend",
"(",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"mailHeader",
"=",
"\"\"",
";",
"if",
"(",
"(",
"count",
"(",
"$",
"this",
"->",
"to",
")",
"+",
"count",
"(",
"$",
"this",
"->",
"cc",
")",
"+",
"count",
"(",
"$",
... | Prep mail by constructing all message entities
@return bool | [
"Prep",
"mail",
"by",
"constructing",
"all",
"message",
"entities"
] | df443234ad0ca10cbf91a0c0a728b256afcab1d1 | https://github.com/minmb/phpmailer/blob/df443234ad0ca10cbf91a0c0a728b256afcab1d1/class.phpmailer.php#L705-L756 |
228,604 | minmb/phpmailer | class.phpmailer.php | PHPMailer.PostSend | public function PostSend() {
$rtn = false;
try {
// Choose the mailer and send through it
switch($this->Mailer) {
case 'sendmail':
$rtn = $this->SendmailSend($this->MIMEHeader, $this->MIMEBody);
break;
case 'smtp':
$rtn = $this->SmtpSend($this->MIMEHeade... | php | public function PostSend() {
$rtn = false;
try {
// Choose the mailer and send through it
switch($this->Mailer) {
case 'sendmail':
$rtn = $this->SendmailSend($this->MIMEHeader, $this->MIMEBody);
break;
case 'smtp':
$rtn = $this->SmtpSend($this->MIMEHeade... | [
"public",
"function",
"PostSend",
"(",
")",
"{",
"$",
"rtn",
"=",
"false",
";",
"try",
"{",
"// Choose the mailer and send through it",
"switch",
"(",
"$",
"this",
"->",
"Mailer",
")",
"{",
"case",
"'sendmail'",
":",
"$",
"rtn",
"=",
"$",
"this",
"->",
"... | Actual Email transport function
Send the email via the selected mechanism
@return bool | [
"Actual",
"Email",
"transport",
"function",
"Send",
"the",
"email",
"via",
"the",
"selected",
"mechanism"
] | df443234ad0ca10cbf91a0c0a728b256afcab1d1 | https://github.com/minmb/phpmailer/blob/df443234ad0ca10cbf91a0c0a728b256afcab1d1/class.phpmailer.php#L763-L793 |
228,605 | minmb/phpmailer | class.phpmailer.php | PHPMailer.GetMailMIME | public function GetMailMIME() {
$result = '';
switch($this->message_type) {
case 'inline':
$result .= $this->HeaderLine('Content-Type', 'multipart/related;');
$result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
break;
case 'attach':
case 'inline_atta... | php | public function GetMailMIME() {
$result = '';
switch($this->message_type) {
case 'inline':
$result .= $this->HeaderLine('Content-Type', 'multipart/related;');
$result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
break;
case 'attach':
case 'inline_atta... | [
"public",
"function",
"GetMailMIME",
"(",
")",
"{",
"$",
"result",
"=",
"''",
";",
"switch",
"(",
"$",
"this",
"->",
"message_type",
")",
"{",
"case",
"'inline'",
":",
"$",
"result",
".=",
"$",
"this",
"->",
"HeaderLine",
"(",
"'Content-Type'",
",",
"'... | Returns the message MIME.
@access public
@return string | [
"Returns",
"the",
"message",
"MIME",
"."
] | df443234ad0ca10cbf91a0c0a728b256afcab1d1 | https://github.com/minmb/phpmailer/blob/df443234ad0ca10cbf91a0c0a728b256afcab1d1/class.phpmailer.php#L1379-L1410 |
228,606 | minmb/phpmailer | class.phpmailer.php | PHPMailer.AttachAll | protected function AttachAll($disposition_type, $boundary) {
// Return text of body
$mime = array();
$cidUniq = array();
$incl = array();
// Add all attachments
foreach ($this->attachment as $attachment) {
// CHECK IF IT IS A VALID DISPOSITION_FILTER
if($attachment[6] == $dispositio... | php | protected function AttachAll($disposition_type, $boundary) {
// Return text of body
$mime = array();
$cidUniq = array();
$incl = array();
// Add all attachments
foreach ($this->attachment as $attachment) {
// CHECK IF IT IS A VALID DISPOSITION_FILTER
if($attachment[6] == $dispositio... | [
"protected",
"function",
"AttachAll",
"(",
"$",
"disposition_type",
",",
"$",
"boundary",
")",
"{",
"// Return text of body",
"$",
"mime",
"=",
"array",
"(",
")",
";",
"$",
"cidUniq",
"=",
"array",
"(",
")",
";",
"$",
"incl",
"=",
"array",
"(",
")",
";... | Attaches all fs, string, and binary attachments to the message.
Returns an empty string on failure.
@access protected
@return string | [
"Attaches",
"all",
"fs",
"string",
"and",
"binary",
"attachments",
"to",
"the",
"message",
".",
"Returns",
"an",
"empty",
"string",
"on",
"failure",
"."
] | df443234ad0ca10cbf91a0c0a728b256afcab1d1 | https://github.com/minmb/phpmailer/blob/df443234ad0ca10cbf91a0c0a728b256afcab1d1/class.phpmailer.php#L1684-L1744 |
228,607 | minmb/phpmailer | class.phpmailer.php | PHPMailer.SetError | protected function SetError($msg) {
$this->error_count++;
if (($this->Mailer == 'smtp') and ($this->smtp !== null)) {
$lasterror = $this->smtp->getError();
if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) {
$msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'... | php | protected function SetError($msg) {
$this->error_count++;
if (($this->Mailer == 'smtp') and ($this->smtp !== null)) {
$lasterror = $this->smtp->getError();
if (!empty($lasterror) and array_key_exists('smtp_msg', $lasterror)) {
$msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'... | [
"protected",
"function",
"SetError",
"(",
"$",
"msg",
")",
"{",
"$",
"this",
"->",
"error_count",
"++",
";",
"if",
"(",
"(",
"$",
"this",
"->",
"Mailer",
"==",
"'smtp'",
")",
"and",
"(",
"$",
"this",
"->",
"smtp",
"!==",
"null",
")",
")",
"{",
"$... | Adds the error message to the error container.
@access protected
@return void | [
"Adds",
"the",
"error",
"message",
"to",
"the",
"error",
"container",
"."
] | df443234ad0ca10cbf91a0c0a728b256afcab1d1 | https://github.com/minmb/phpmailer/blob/df443234ad0ca10cbf91a0c0a728b256afcab1d1/class.phpmailer.php#L2252-L2261 |
228,608 | minmb/phpmailer | class.phpmailer.php | PHPMailer.ServerHostname | protected function ServerHostname() {
if (!empty($this->Hostname)) {
$result = $this->Hostname;
} elseif (isset($_SERVER['SERVER_NAME'])) {
$result = $_SERVER['SERVER_NAME'];
} else {
$result = 'localhost.localdomain';
}
return $result;
} | php | protected function ServerHostname() {
if (!empty($this->Hostname)) {
$result = $this->Hostname;
} elseif (isset($_SERVER['SERVER_NAME'])) {
$result = $_SERVER['SERVER_NAME'];
} else {
$result = 'localhost.localdomain';
}
return $result;
} | [
"protected",
"function",
"ServerHostname",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"Hostname",
")",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"Hostname",
";",
"}",
"elseif",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'S... | Returns the server hostname or 'localhost.localdomain' if unknown.
@access protected
@return string | [
"Returns",
"the",
"server",
"hostname",
"or",
"localhost",
".",
"localdomain",
"if",
"unknown",
"."
] | df443234ad0ca10cbf91a0c0a728b256afcab1d1 | https://github.com/minmb/phpmailer/blob/df443234ad0ca10cbf91a0c0a728b256afcab1d1/class.phpmailer.php#L2284-L2294 |
228,609 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.write_version | public function write_version()
{
$this->_version_written = true;
if (!is_null($this->version())) {
return $this->writeLine('version: '.$this->version().PHP_EOL, 'Net_LDAP2_LDIF error: unable to write version');
}
} | php | public function write_version()
{
$this->_version_written = true;
if (!is_null($this->version())) {
return $this->writeLine('version: '.$this->version().PHP_EOL, 'Net_LDAP2_LDIF error: unable to write version');
}
} | [
"public",
"function",
"write_version",
"(",
")",
"{",
"$",
"this",
"->",
"_version_written",
"=",
"true",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"version",
"(",
")",
")",
")",
"{",
"return",
"$",
"this",
"->",
"writeLine",
"(",
"'ver... | Write version to LDIF
If the object's version is defined, this method allows to explicitely write the version before an entry is written.
If not called explicitely, it gets called automatically when writing the first entry.
@return void | [
"Write",
"version",
"to",
"LDIF"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L428-L434 |
228,610 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.version | public function version($version = null)
{
if ($version !== null) {
if ($version != 1) {
$this->dropError('Net_LDAP2_LDIF error: illegal LDIF version set');
} else {
$this->_options['version'] = $version;
}
}
return $this->_... | php | public function version($version = null)
{
if ($version !== null) {
if ($version != 1) {
$this->dropError('Net_LDAP2_LDIF error: illegal LDIF version set');
} else {
$this->_options['version'] = $version;
}
}
return $this->_... | [
"public",
"function",
"version",
"(",
"$",
"version",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"version",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"version",
"!=",
"1",
")",
"{",
"$",
"this",
"->",
"dropError",
"(",
"'Net_LDAP2_LDIF error: illegal LDIF ver... | Get or set LDIF version
If called without arguments it returns the version of the LDIF file or NULL if no version has been set.
If called with an argument it sets the LDIF version to VERSION.
According to RFC 2849 currently the only legal value for VERSION is 1.
@param int $version (optional) LDIF version to set
@re... | [
"Get",
"or",
"set",
"LDIF",
"version"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L447-L457 |
228,611 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.& | public function &handle()
{
if (!is_resource($this->_FH)) {
$this->dropError('Net_LDAP2_LDIF error: invalid file resource');
$null = null;
return $null;
} else {
return $this->_FH;
}
} | php | public function &handle()
{
if (!is_resource($this->_FH)) {
$this->dropError('Net_LDAP2_LDIF error: invalid file resource');
$null = null;
return $null;
} else {
return $this->_FH;
}
} | [
"public",
"function",
"&",
"handle",
"(",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"this",
"->",
"_FH",
")",
")",
"{",
"$",
"this",
"->",
"dropError",
"(",
"'Net_LDAP2_LDIF error: invalid file resource'",
")",
";",
"$",
"null",
"=",
"null",
";"... | Returns the file handle the Net_LDAP2_LDIF object reads from or writes to.
You can, for example, use this to fetch the content of the LDIF file yourself
@return null|resource | [
"Returns",
"the",
"file",
"handle",
"the",
"Net_LDAP2_LDIF",
"object",
"reads",
"from",
"or",
"writes",
"to",
"."
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L466-L475 |
228,612 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.error | public function error($as_string = false)
{
if (Net_LDAP2::isError($this->_error['error'])) {
return ($as_string)? $this->_error['error']->getMessage() : $this->_error['error'];
} else {
return false;
}
} | php | public function error($as_string = false)
{
if (Net_LDAP2::isError($this->_error['error'])) {
return ($as_string)? $this->_error['error']->getMessage() : $this->_error['error'];
} else {
return false;
}
} | [
"public",
"function",
"error",
"(",
"$",
"as_string",
"=",
"false",
")",
"{",
"if",
"(",
"Net_LDAP2",
"::",
"isError",
"(",
"$",
"this",
"->",
"_error",
"[",
"'error'",
"]",
")",
")",
"{",
"return",
"(",
"$",
"as_string",
")",
"?",
"$",
"this",
"->... | Returns last error message if error was found.
Example:
<code>
$ldif->someAction();
if ($ldif->error()) {
echo "Error: ".$ldif->error()." at input line: ".$ldif->error_lines();
}
</code>
@param boolean $as_string If set to true, only the message is returned
@return false|Net_LDAP2_Error | [
"Returns",
"last",
"error",
"message",
"if",
"error",
"was",
"found",
"."
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L514-L521 |
228,613 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.parseLines | public function parseLines($lines)
{
// parse lines into an array of attributes and build the entry
$attributes = array();
$dn = false;
foreach ($lines as $line) {
if (preg_match('/^(\w+(;binary)?)(:|::|:<)\s(.+)$/', $line, $matches)) {
$attr =& $matches[... | php | public function parseLines($lines)
{
// parse lines into an array of attributes and build the entry
$attributes = array();
$dn = false;
foreach ($lines as $line) {
if (preg_match('/^(\w+(;binary)?)(:|::|:<)\s(.+)$/', $line, $matches)) {
$attr =& $matches[... | [
"public",
"function",
"parseLines",
"(",
"$",
"lines",
")",
"{",
"// parse lines into an array of attributes and build the entry",
"$",
"attributes",
"=",
"array",
"(",
")",
";",
"$",
"dn",
"=",
"false",
";",
"foreach",
"(",
"$",
"lines",
"as",
"$",
"line",
")... | Parse LDIF lines of one entry into an Net_LDAP2_Entry object
@param array $lines LDIF lines for one entry
@return Net_LDAP2_Entry|false Net_LDAP2_Entry object for those lines
@todo what about file inclusions and urls? "jpegphoto:< file:///usr/local/directory/photos/fiona.jpg" | [
"Parse",
"LDIF",
"lines",
"of",
"one",
"entry",
"into",
"an",
"Net_LDAP2_Entry",
"object"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L554-L604 |
228,614 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.convertAttribute | protected function convertAttribute($attr_name, $attr_value)
{
// Handle empty attribute or process
if (strlen($attr_value) == 0) {
$attr_value = " ";
} else {
$base64 = false;
// ASCII-chars that are NOT safe for the
// start and for being ins... | php | protected function convertAttribute($attr_name, $attr_value)
{
// Handle empty attribute or process
if (strlen($attr_value) == 0) {
$attr_value = " ";
} else {
$base64 = false;
// ASCII-chars that are NOT safe for the
// start and for being ins... | [
"protected",
"function",
"convertAttribute",
"(",
"$",
"attr_name",
",",
"$",
"attr_value",
")",
"{",
"// Handle empty attribute or process",
"if",
"(",
"strlen",
"(",
"$",
"attr_value",
")",
"==",
"0",
")",
"{",
"$",
"attr_value",
"=",
"\" \"",
";",
"}",
"e... | Convert an attribute and value to LDIF string representation
It honors correct encoding of values according to RFC 2849.
Line wrapping will occur at the configured maximum but only if
the value is greater than 40 chars.
@param string $attr_name Name of the attribute
@param string $attr_value Value of the attribute
... | [
"Convert",
"an",
"attribute",
"and",
"value",
"to",
"LDIF",
"string",
"representation"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L738-L787 |
228,615 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.convertDN | protected function convertDN($dn)
{
$base64 = false;
// ASCII-chars that are NOT safe for the
// start and for being inside the dn.
// These are the int values of those chars.
$unsafe_init = array(0, 10, 13, 32, 58, 60);
$unsafe = array(0, 10, 13);
// Te... | php | protected function convertDN($dn)
{
$base64 = false;
// ASCII-chars that are NOT safe for the
// start and for being inside the dn.
// These are the int values of those chars.
$unsafe_init = array(0, 10, 13, 32, 58, 60);
$unsafe = array(0, 10, 13);
// Te... | [
"protected",
"function",
"convertDN",
"(",
"$",
"dn",
")",
"{",
"$",
"base64",
"=",
"false",
";",
"// ASCII-chars that are NOT safe for the",
"// start and for being inside the dn.",
"// These are the int values of those chars.",
"$",
"unsafe_init",
"=",
"array",
"(",
"0",
... | Convert an entries DN to LDIF string representation
It honors correct encoding of values according to RFC 2849.
@param string $dn UTF8-Encoded DN
@access protected
@return string LDIF string for that DN
@todo I am not sure, if the UTF8 stuff is correctly handled right now | [
"Convert",
"an",
"entries",
"DN",
"to",
"LDIF",
"string",
"representation"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L800-L830 |
228,616 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.writeAttribute | protected function writeAttribute($attr_name, $attr_values)
{
// write out attribute content
if (!is_array($attr_values)) {
$attr_values = array($attr_values);
}
foreach ($attr_values as $attr_val) {
$line = $this->convertAttribute($attr_name, $attr_val).PHP_E... | php | protected function writeAttribute($attr_name, $attr_values)
{
// write out attribute content
if (!is_array($attr_values)) {
$attr_values = array($attr_values);
}
foreach ($attr_values as $attr_val) {
$line = $this->convertAttribute($attr_name, $attr_val).PHP_E... | [
"protected",
"function",
"writeAttribute",
"(",
"$",
"attr_name",
",",
"$",
"attr_values",
")",
"{",
"// write out attribute content",
"if",
"(",
"!",
"is_array",
"(",
"$",
"attr_values",
")",
")",
"{",
"$",
"attr_values",
"=",
"array",
"(",
"$",
"attr_values"... | Writes an attribute to the filehandle
@param string $attr_name Name of the attribute
@param string|array $attr_values Single attribute value or array with attribute values
@access protected
@return void | [
"Writes",
"an",
"attribute",
"to",
"the",
"filehandle"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L841-L851 |
228,617 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.writeDN | protected function writeDN($dn)
{
// prepare DN
if ($this->_options['encode'] == 'base64') {
$dn = $this->convertDN($dn).PHP_EOL;
} elseif ($this->_options['encode'] == 'canonical') {
$dn = Net_LDAP2_Util::canonical_dn($dn, array('casefold' => 'none')).PHP_EOL;
... | php | protected function writeDN($dn)
{
// prepare DN
if ($this->_options['encode'] == 'base64') {
$dn = $this->convertDN($dn).PHP_EOL;
} elseif ($this->_options['encode'] == 'canonical') {
$dn = Net_LDAP2_Util::canonical_dn($dn, array('casefold' => 'none')).PHP_EOL;
... | [
"protected",
"function",
"writeDN",
"(",
"$",
"dn",
")",
"{",
"// prepare DN",
"if",
"(",
"$",
"this",
"->",
"_options",
"[",
"'encode'",
"]",
"==",
"'base64'",
")",
"{",
"$",
"dn",
"=",
"$",
"this",
"->",
"convertDN",
"(",
"$",
"dn",
")",
".",
"PH... | Writes a DN to the filehandle
@param string $dn DN to write
@access protected
@return void | [
"Writes",
"a",
"DN",
"to",
"the",
"filehandle"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L861-L872 |
228,618 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.writeLine | protected function writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle')
{
if (is_resource($this->handle()) && fwrite($this->handle(), $line, strlen($line)) === false) {
$this->dropError($error);
return false;
} else {
return true;
... | php | protected function writeLine($line, $error = 'Net_LDAP2_LDIF error: unable to write to filehandle')
{
if (is_resource($this->handle()) && fwrite($this->handle(), $line, strlen($line)) === false) {
$this->dropError($error);
return false;
} else {
return true;
... | [
"protected",
"function",
"writeLine",
"(",
"$",
"line",
",",
"$",
"error",
"=",
"'Net_LDAP2_LDIF error: unable to write to filehandle'",
")",
"{",
"if",
"(",
"is_resource",
"(",
"$",
"this",
"->",
"handle",
"(",
")",
")",
"&&",
"fwrite",
"(",
"$",
"this",
"-... | Just write an arbitary line to the filehandle
@param string $line Content to write
@param string $error If error occurs, drop this message
@access protected
@return true|false | [
"Just",
"write",
"an",
"arbitary",
"line",
"to",
"the",
"filehandle"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L894-L902 |
228,619 | pear/Net_LDAP2 | Net/LDAP2/LDIF.php | Net_LDAP2_LDIF.dropError | protected function dropError($msg, $line = null)
{
$this->_error['error'] = new Net_LDAP2_Error($msg);
if ($line !== null) $this->_error['line'] = $line;
if ($this->_options['onerror'] == 'die') {
die($msg.PHP_EOL);
} elseif ($this->_options['onerror'] == 'warn') {
... | php | protected function dropError($msg, $line = null)
{
$this->_error['error'] = new Net_LDAP2_Error($msg);
if ($line !== null) $this->_error['line'] = $line;
if ($this->_options['onerror'] == 'die') {
die($msg.PHP_EOL);
} elseif ($this->_options['onerror'] == 'warn') {
... | [
"protected",
"function",
"dropError",
"(",
"$",
"msg",
",",
"$",
"line",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_error",
"[",
"'error'",
"]",
"=",
"new",
"Net_LDAP2_Error",
"(",
"$",
"msg",
")",
";",
"if",
"(",
"$",
"line",
"!==",
"null",
")",
... | Optionally raises an error and pushes the error on the error cache
@param string $msg Errortext
@param int $line Line in the LDIF that caused the error
@access protected
@return void | [
"Optionally",
"raises",
"an",
"error",
"and",
"pushes",
"the",
"error",
"on",
"the",
"error",
"cache"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/LDIF.php#L913-L923 |
228,620 | mariano/disque-php | src/Connection/Response/ErrorResponse.php | ErrorResponse.getExceptionClass | private function getExceptionClass($error)
{
$errors = [
'PAUSED' => QueuePausedResponseException::class
];
$exceptionClass = ResponseException::class;
list($errorCode) = explode(" ", $error);
if (!empty($errorCode) && isset($errors[$errorCode])) {
$ex... | php | private function getExceptionClass($error)
{
$errors = [
'PAUSED' => QueuePausedResponseException::class
];
$exceptionClass = ResponseException::class;
list($errorCode) = explode(" ", $error);
if (!empty($errorCode) && isset($errors[$errorCode])) {
$ex... | [
"private",
"function",
"getExceptionClass",
"(",
"$",
"error",
")",
"{",
"$",
"errors",
"=",
"[",
"'PAUSED'",
"=>",
"QueuePausedResponseException",
"::",
"class",
"]",
";",
"$",
"exceptionClass",
"=",
"ResponseException",
"::",
"class",
";",
"list",
"(",
"$",
... | Creates ResponseException based off error
@param string $error Error
@return string Class Name | [
"Creates",
"ResponseException",
"based",
"off",
"error"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Response/ErrorResponse.php#L24-L35 |
228,621 | sop/crypto-types | lib/CryptoTypes/Asymmetric/PublicKeyInfo.php | PublicKeyInfo.publicKey | public function publicKey(): PublicKey
{
$algo = $this->algorithmIdentifier();
switch ($algo->oid()) {
// RSA
case AlgorithmIdentifier::OID_RSA_ENCRYPTION:
return RSA\RSAPublicKey::fromDER($this->_publicKeyData);
// elliptic curve
case ... | php | public function publicKey(): PublicKey
{
$algo = $this->algorithmIdentifier();
switch ($algo->oid()) {
// RSA
case AlgorithmIdentifier::OID_RSA_ENCRYPTION:
return RSA\RSAPublicKey::fromDER($this->_publicKeyData);
// elliptic curve
case ... | [
"public",
"function",
"publicKey",
"(",
")",
":",
"PublicKey",
"{",
"$",
"algo",
"=",
"$",
"this",
"->",
"algorithmIdentifier",
"(",
")",
";",
"switch",
"(",
"$",
"algo",
"->",
"oid",
"(",
")",
")",
"{",
"// RSA",
"case",
"AlgorithmIdentifier",
"::",
"... | Get public key.
@throws \RuntimeException
@return PublicKey | [
"Get",
"public",
"key",
"."
] | 1d36250a110b07300aeb003a20aeaadfc6445501 | https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/PublicKeyInfo.php#L130-L148 |
228,622 | sop/crypto-types | lib/CryptoTypes/Asymmetric/PublicKeyInfo.php | PublicKeyInfo.keyIdentifier64 | public function keyIdentifier64(): string
{
$id = substr($this->keyIdentifier(), -8);
$c = (ord($id[0]) & 0x0f) | 0x40;
$id[0] = chr($c);
return $id;
} | php | public function keyIdentifier64(): string
{
$id = substr($this->keyIdentifier(), -8);
$c = (ord($id[0]) & 0x0f) | 0x40;
$id[0] = chr($c);
return $id;
} | [
"public",
"function",
"keyIdentifier64",
"(",
")",
":",
"string",
"{",
"$",
"id",
"=",
"substr",
"(",
"$",
"this",
"->",
"keyIdentifier",
"(",
")",
",",
"-",
"8",
")",
";",
"$",
"c",
"=",
"(",
"ord",
"(",
"$",
"id",
"[",
"0",
"]",
")",
"&",
"... | Get key identifier using method 2 as described by RFC 5280.
@link https://tools.ietf.org/html/rfc5280#section-4.2.1.2
@return string 8 bytes (64 bits) long identifier | [
"Get",
"key",
"identifier",
"using",
"method",
"2",
"as",
"described",
"by",
"RFC",
"5280",
"."
] | 1d36250a110b07300aeb003a20aeaadfc6445501 | https://github.com/sop/crypto-types/blob/1d36250a110b07300aeb003a20aeaadfc6445501/lib/CryptoTypes/Asymmetric/PublicKeyInfo.php#L167-L173 |
228,623 | mlaphp/mlaphp | src/Mlaphp/Di.php | Di.set | public function set($name, $callable)
{
$name = ltrim($name, '\\');
$this->callables[$name] = $callable;
unset($this->instances[$name]);
} | php | public function set($name, $callable)
{
$name = ltrim($name, '\\');
$this->callables[$name] = $callable;
unset($this->instances[$name]);
} | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"callable",
")",
"{",
"$",
"name",
"=",
"ltrim",
"(",
"$",
"name",
",",
"'\\\\'",
")",
";",
"$",
"this",
"->",
"callables",
"[",
"$",
"name",
"]",
"=",
"$",
"callable",
";",
"unset",
"(",
... | Sets a callable to create an object by name; removes any existing
shared instance under that name.
@param string $name The object name.
@param callable $callable A callable that returns an object.
@return null | [
"Sets",
"a",
"callable",
"to",
"create",
"an",
"object",
"by",
"name",
";",
"removes",
"any",
"existing",
"shared",
"instance",
"under",
"that",
"name",
"."
] | c0c90e7217c598c82bb65e5304e8076da381c1f8 | https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/Di.php#L104-L109 |
228,624 | mlaphp/mlaphp | src/Mlaphp/Di.php | Di.get | public function get($name)
{
$name = ltrim($name, '\\');
if (! isset($this->instances[$name])) {
$this->instances[$name] = $this->newInstance($name);
}
return $this->instances[$name];
} | php | public function get($name)
{
$name = ltrim($name, '\\');
if (! isset($this->instances[$name])) {
$this->instances[$name] = $this->newInstance($name);
}
return $this->instances[$name];
} | [
"public",
"function",
"get",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"ltrim",
"(",
"$",
"name",
",",
"'\\\\'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"-... | Gets a shared instance by object name; if it has not been created yet,
its callable will be invoked and the instance will be retained.
@param string $name The name of the shared instance to retrieve.
@return object The shared object instance. | [
"Gets",
"a",
"shared",
"instance",
"by",
"object",
"name",
";",
"if",
"it",
"has",
"not",
"been",
"created",
"yet",
"its",
"callable",
"will",
"be",
"invoked",
"and",
"the",
"instance",
"will",
"be",
"retained",
"."
] | c0c90e7217c598c82bb65e5304e8076da381c1f8 | https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/Di.php#L130-L137 |
228,625 | mlaphp/mlaphp | src/Mlaphp/Di.php | Di.newInstance | public function newInstance($name)
{
$name = ltrim($name, '\\');
if (! $this->has($name)) {
throw new UnexpectedValueException($name);
}
return call_user_func($this->callables[$name], $this);
} | php | public function newInstance($name)
{
$name = ltrim($name, '\\');
if (! $this->has($name)) {
throw new UnexpectedValueException($name);
}
return call_user_func($this->callables[$name], $this);
} | [
"public",
"function",
"newInstance",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"ltrim",
"(",
"$",
"name",
",",
"'\\\\'",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"new",
"UnexpectedValueExcept... | Returns a new instance using the named callable.
@param string $name The name of the callable to invoke.
@return object A new object instance.
@throws UnexpectedValueException | [
"Returns",
"a",
"new",
"instance",
"using",
"the",
"named",
"callable",
"."
] | c0c90e7217c598c82bb65e5304e8076da381c1f8 | https://github.com/mlaphp/mlaphp/blob/c0c90e7217c598c82bb65e5304e8076da381c1f8/src/Mlaphp/Di.php#L146-L153 |
228,626 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.fromArray | public static function fromArray(array $arr): self
{
$prop = $arr + (new self($arr['fallback'] ?? ''))->toArray();
return self::__set_state($prop);
} | php | public static function fromArray(array $arr): self
{
$prop = $arr + (new self($arr['fallback'] ?? ''))->toArray();
return self::__set_state($prop);
} | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"arr",
")",
":",
"self",
"{",
"$",
"prop",
"=",
"$",
"arr",
"+",
"(",
"new",
"self",
"(",
"$",
"arr",
"[",
"'fallback'",
"]",
"??",
"''",
")",
")",
"->",
"toArray",
"(",
")",
";",
... | Returns a new instance from an array.
@param array $arr
@return self | [
"Returns",
"a",
"new",
"instance",
"from",
"an",
"array",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L87-L92 |
228,627 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setFallback | public function setFallback(string $fallback): self
{
$fallback = trim($fallback);
if ('' === $fallback) {
throw new Exception('The fallback text can not be empty');
}
$this->fallback = $fallback;
return $this;
} | php | public function setFallback(string $fallback): self
{
$fallback = trim($fallback);
if ('' === $fallback) {
throw new Exception('The fallback text can not be empty');
}
$this->fallback = $fallback;
return $this;
} | [
"public",
"function",
"setFallback",
"(",
"string",
"$",
"fallback",
")",
":",
"self",
"{",
"$",
"fallback",
"=",
"trim",
"(",
"$",
"fallback",
")",
";",
"if",
"(",
"''",
"===",
"$",
"fallback",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The fallbac... | Returns an instance with the specified fallback.
A required plain-text summary of the post.
This is used in notifications, and in clients that don’t support formatted text (eg IRC).
@param string $fallback
@throws Exception if the fallback is an empty string
@return self | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"fallback",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L248-L258 |
228,628 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setAuthor | public function setAuthor(string $author_name, $author_link = '', $author_icon = ''): self
{
$this->author_name = trim($author_name);
$this->author_link = filter_uri($author_link, 'author_link');
$this->author_icon = filter_uri($author_icon, 'author_icon');
if ('' === $this->author_n... | php | public function setAuthor(string $author_name, $author_link = '', $author_icon = ''): self
{
$this->author_name = trim($author_name);
$this->author_link = filter_uri($author_link, 'author_link');
$this->author_icon = filter_uri($author_icon, 'author_icon');
if ('' === $this->author_n... | [
"public",
"function",
"setAuthor",
"(",
"string",
"$",
"author_name",
",",
"$",
"author_link",
"=",
"''",
",",
"$",
"author_icon",
"=",
"''",
")",
":",
"self",
"{",
"$",
"this",
"->",
"author_name",
"=",
"trim",
"(",
"$",
"author_name",
")",
";",
"$",
... | Returns an instance with the specified author.
It will be included in a small section at the top of the attachment.
@param string $author_name An optional name used to identify the author.
@param string|UriInterface $author_link An optional URL used to hyperlink the author_name.
If no author_name is spe... | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"author",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L331-L342 |
228,629 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setAuthorName | public function setAuthorName(string $author_name): self
{
return $this->setAuthor($author_name, $this->author_link, $this->author_icon);
} | php | public function setAuthorName(string $author_name): self
{
return $this->setAuthor($author_name, $this->author_link, $this->author_icon);
} | [
"public",
"function",
"setAuthorName",
"(",
"string",
"$",
"author_name",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"setAuthor",
"(",
"$",
"author_name",
",",
"$",
"this",
"->",
"author_link",
",",
"$",
"this",
"->",
"author_icon",
")",
";",
"}... | Sets the author name.
@param string $author_name
DEPRECATION WARNING! This method will be removed in the next major point release
@deprecated deprecated since version 2.1.0
@see Attachment::setAuthor
@return self | [
"Sets",
"the",
"author",
"name",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L356-L359 |
228,630 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setAuthorLink | public function setAuthorLink($author_link): self
{
return $this->setAuthor($this->author_name, $author_link, $this->author_icon);
} | php | public function setAuthorLink($author_link): self
{
return $this->setAuthor($this->author_name, $author_link, $this->author_icon);
} | [
"public",
"function",
"setAuthorLink",
"(",
"$",
"author_link",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"setAuthor",
"(",
"$",
"this",
"->",
"author_name",
",",
"$",
"author_link",
",",
"$",
"this",
"->",
"author_icon",
")",
";",
"}"
] | Sets the author link URI.
@param string|UriInterface $author_link
DEPRECATION WARNING! This method will be removed in the next major point release
@deprecated deprecated since version 2.1.0
@see Attachment::setAuthor
@return self | [
"Sets",
"the",
"author",
"link",
"URI",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L373-L376 |
228,631 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setAuthorIcon | public function setAuthorIcon($author_icon): self
{
return $this->setAuthor($this->author_name, $this->author_link, $author_icon);
} | php | public function setAuthorIcon($author_icon): self
{
return $this->setAuthor($this->author_name, $this->author_link, $author_icon);
} | [
"public",
"function",
"setAuthorIcon",
"(",
"$",
"author_icon",
")",
":",
"self",
"{",
"return",
"$",
"this",
"->",
"setAuthor",
"(",
"$",
"this",
"->",
"author_name",
",",
"$",
"this",
"->",
"author_link",
",",
"$",
"author_icon",
")",
";",
"}"
] | Sets the author name icon URI.
@param string|UriInterface $author_icon
DEPRECATION WARNING! This method will be removed in the next major point release
@deprecated deprecated since version 2.1.0
@see Attachment::setAuthor
@return self | [
"Sets",
"the",
"author",
"name",
"icon",
"URI",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L390-L393 |
228,632 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setTitle | public function setTitle(string $title, $title_link = ''): self
{
$this->title = trim($title);
$this->title_link = filter_uri($title_link, 'title_link');
if ('' === $this->title) {
$this->title_link = '';
}
return $this;
} | php | public function setTitle(string $title, $title_link = ''): self
{
$this->title = trim($title);
$this->title_link = filter_uri($title_link, 'title_link');
if ('' === $this->title) {
$this->title_link = '';
}
return $this;
} | [
"public",
"function",
"setTitle",
"(",
"string",
"$",
"title",
",",
"$",
"title_link",
"=",
"''",
")",
":",
"self",
"{",
"$",
"this",
"->",
"title",
"=",
"trim",
"(",
"$",
"title",
")",
";",
"$",
"this",
"->",
"title_link",
"=",
"filter_uri",
"(",
... | Returns an instance with the specified title.
@param string $title An optional title displayed below the author information
in the attachment.
@param string|UriInterface $title_link An optional URL used to hyperlink the title.
If no title is specified, this field does nothing.
@return self | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"title",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L405-L414 |
228,633 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.setFields | public function setFields($fields): self
{
if (!is_iterable($fields)) {
throw new Exception(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($fields)));
}
$this->fields = [];
foreach ($fields as $field) {
$this->addField(..... | php | public function setFields($fields): self
{
if (!is_iterable($fields)) {
throw new Exception(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($fields)));
}
$this->fields = [];
foreach ($fields as $field) {
$this->addField(..... | [
"public",
"function",
"setFields",
"(",
"$",
"fields",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_iterable",
"(",
"$",
"fields",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",
"'%s() expects argument passed to be iterable, %s given'",
",",
"_... | Returns an instance with the specified fields.
Fields can be included as an optional array within attachments,
and are used to display information in a table format inside the attachment.
@param array|Traversable $fields
@return self | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"fields",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L426-L438 |
228,634 | carpediem/mattermost-webhook | src/Attachment.php | Attachment.addField | public function addField(string $title, string $value, bool $short = true): self
{
$this->fields[] = ['title' => trim($title), 'value' => trim($value), 'short' => $short];
return $this;
} | php | public function addField(string $title, string $value, bool $short = true): self
{
$this->fields[] = ['title' => trim($title), 'value' => trim($value), 'short' => $short];
return $this;
} | [
"public",
"function",
"addField",
"(",
"string",
"$",
"title",
",",
"string",
"$",
"value",
",",
"bool",
"$",
"short",
"=",
"true",
")",
":",
"self",
"{",
"$",
"this",
"->",
"fields",
"[",
"]",
"=",
"[",
"'title'",
"=>",
"trim",
"(",
"$",
"title",
... | Returns an instance with the added field to the attachment
Adds a single field to the object fields collection.
@param string $title A title shown in the table above the value.
@param string $value The text value of the field. It can be formatted using markdown.
@param bool $short to indicate whether the value is s... | [
"Returns",
"an",
"instance",
"with",
"the",
"added",
"field",
"to",
"the",
"attachment"
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Attachment.php#L452-L457 |
228,635 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.findToken | public function findToken($search, $offset = 0)
{
if ($search === null)
{
throw new \InvalidArgumentException('A token cannot be searched for with a null value.');
}
elseif (!is_int($offset))
{
throw new \InvalidArgumentException('On offset must be spe... | php | public function findToken($search, $offset = 0)
{
if ($search === null)
{
throw new \InvalidArgumentException('A token cannot be searched for with a null value.');
}
elseif (!is_int($offset))
{
throw new \InvalidArgumentException('On offset must be spe... | [
"public",
"function",
"findToken",
"(",
"$",
"search",
",",
"$",
"offset",
"=",
"0",
")",
"{",
"if",
"(",
"$",
"search",
"===",
"null",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'A token cannot be searched for with a null value.'",
")",
... | Find a token in the tokenizer. You can search by the token's literal code or name. You can also specify on
offset for the search. If the offset is negative, the search will be done starting from the end.
@param string|integer $search The token's literal code or name.
@param integer $offset The offset to start searchin... | [
"Find",
"a",
"token",
"in",
"the",
"tokenizer",
".",
"You",
"can",
"search",
"by",
"the",
"token",
"s",
"literal",
"code",
"or",
"name",
".",
"You",
"can",
"also",
"specify",
"on",
"offset",
"for",
"the",
"search",
".",
"If",
"the",
"offset",
"is",
"... | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L114-L164 |
228,636 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.getTokenRange | public function getTokenRange($start, $finish)
{
$tokens = array_slice($this->tokens, (integer) $start, (integer) $finish - (integer) $start);
return new Tokenizer($tokens);
} | php | public function getTokenRange($start, $finish)
{
$tokens = array_slice($this->tokens, (integer) $start, (integer) $finish - (integer) $start);
return new Tokenizer($tokens);
} | [
"public",
"function",
"getTokenRange",
"(",
"$",
"start",
",",
"$",
"finish",
")",
"{",
"$",
"tokens",
"=",
"array_slice",
"(",
"$",
"this",
"->",
"tokens",
",",
"(",
"integer",
")",
"$",
"start",
",",
"(",
"integer",
")",
"$",
"finish",
"-",
"(",
... | Returns a new tokenizer that consists of a subset of the tokens specified by the provided range.
@param integer $start The starting offset of the range
@param integer $finish The ending offset of the range
@return \FunctionParser\Tokenizer A tokenizer with a subset of tokens | [
"Returns",
"a",
"new",
"tokenizer",
"that",
"consists",
"of",
"a",
"subset",
"of",
"the",
"tokens",
"specified",
"by",
"the",
"provided",
"range",
"."
] | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L184-L189 |
228,637 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.prependTokens | public function prependTokens(Tokenizer $new_tokens)
{
$this->tokens = array_merge($new_tokens->asArray(), $this->tokens);
$this->rewind();
return $this;
} | php | public function prependTokens(Tokenizer $new_tokens)
{
$this->tokens = array_merge($new_tokens->asArray(), $this->tokens);
$this->rewind();
return $this;
} | [
"public",
"function",
"prependTokens",
"(",
"Tokenizer",
"$",
"new_tokens",
")",
"{",
"$",
"this",
"->",
"tokens",
"=",
"array_merge",
"(",
"$",
"new_tokens",
"->",
"asArray",
"(",
")",
",",
"$",
"this",
"->",
"tokens",
")",
";",
"$",
"this",
"->",
"re... | Prepends a tokenizer to the beginning of this tokenizer.
@param \FunctionParser\Tokenizer $new_tokens The tokenizer to prepend.
@return \FunctionParser\Tokenizer | [
"Prepends",
"a",
"tokenizer",
"to",
"the",
"beginning",
"of",
"this",
"tokenizer",
"."
] | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L197-L203 |
228,638 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.appendTokens | public function appendTokens(Tokenizer $new_tokens)
{
$this->tokens = array_merge($this->tokens, $new_tokens->asArray());
$this->rewind();
return $this;
} | php | public function appendTokens(Tokenizer $new_tokens)
{
$this->tokens = array_merge($this->tokens, $new_tokens->asArray());
$this->rewind();
return $this;
} | [
"public",
"function",
"appendTokens",
"(",
"Tokenizer",
"$",
"new_tokens",
")",
"{",
"$",
"this",
"->",
"tokens",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"tokens",
",",
"$",
"new_tokens",
"->",
"asArray",
"(",
")",
")",
";",
"$",
"this",
"->",
"rew... | Appends a tokenizer to the beginning of this tokenizer.
@param \FunctionParser\Tokenizer $new_tokens The tokenizer to append.
@return \FunctionParser\Tokenizer | [
"Appends",
"a",
"tokenizer",
"to",
"the",
"beginning",
"of",
"this",
"tokenizer",
"."
] | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L211-L217 |
228,639 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.offsetSet | public function offsetSet($offset, $value)
{
if (!(is_integer($offset) && $offset >= 0 && $offset <= $this->count()))
{
throw new \InvalidArgumentException('The offset must be a valid, positive integer.');
}
if (!$value instanceof Token)
{
throw new \... | php | public function offsetSet($offset, $value)
{
if (!(is_integer($offset) && $offset >= 0 && $offset <= $this->count()))
{
throw new \InvalidArgumentException('The offset must be a valid, positive integer.');
}
if (!$value instanceof Token)
{
throw new \... | [
"public",
"function",
"offsetSet",
"(",
"$",
"offset",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"is_integer",
"(",
"$",
"offset",
")",
"&&",
"$",
"offset",
">=",
"0",
"&&",
"$",
"offset",
"<=",
"$",
"this",
"->",
"count",
"(",
")",
")",
... | Sets the token at the specified offset.
@param integer $offset The offset to set.
@param \FunctionParser\Token The token to set.
@throws \InvalidArgumentException | [
"Sets",
"the",
"token",
"at",
"the",
"specified",
"offset",
"."
] | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L336-L349 |
228,640 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.offsetUnset | public function offsetUnset($offset)
{
if ($this->offsetExists($offset))
{
unset($this->tokens[$offset]);
// Re-index the tokens
$this->tokens = array_values($this->tokens);
// If the current index is now outside of the valid indeces, reset the index... | php | public function offsetUnset($offset)
{
if ($this->offsetExists($offset))
{
unset($this->tokens[$offset]);
// Re-index the tokens
$this->tokens = array_values($this->tokens);
// If the current index is now outside of the valid indeces, reset the index... | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"offsetExists",
"(",
"$",
"offset",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"tokens",
"[",
"$",
"offset",
"]",
")",
";",
"// Re-index the tokens",
... | Unsets the token at the specified offset.
@param integer $offset The offset to unset. | [
"Unsets",
"the",
"token",
"at",
"the",
"specified",
"offset",
"."
] | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L356-L371 |
228,641 | jeremeamia/FunctionParser | src/Tokenizer.php | Tokenizer.unserialize | public function unserialize($serialized)
{
$unserialized = unserialize($serialized);
$this->__construct($unserialized['tokens']);
$this->seek($unserialized['index']);
} | php | public function unserialize($serialized)
{
$unserialized = unserialize($serialized);
$this->__construct($unserialized['tokens']);
$this->seek($unserialized['index']);
} | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"unserialized",
"=",
"unserialize",
"(",
"$",
"serialized",
")",
";",
"$",
"this",
"->",
"__construct",
"(",
"$",
"unserialized",
"[",
"'tokens'",
"]",
")",
";",
"$",
"this",
"->... | Unserialize the tokenizer.
@param string $serialized The serialized tokenizer. | [
"Unserialize",
"the",
"tokenizer",
"."
] | 035b52000b88ea8d72a6647dd4cd39f080cf7ada | https://github.com/jeremeamia/FunctionParser/blob/035b52000b88ea8d72a6647dd4cd39f080cf7ada/src/Tokenizer.php#L401-L406 |
228,642 | arogozin/tagcloud | src/Arg/Tagcloud/Tagcloud.php | Tagcloud.htmlizeTag | public function htmlizeTag($arrayInfo, $sizeRange)
{
if ( isset($this->_htmlizeTagFunction) ) {
// this cannot be writen in one line or the PHP interpreter will puke
// appearantly, it's okay to have a function in a variable,
// but it's not okay to have it in an instance-varriable.
$htmlizer = $this->_h... | php | public function htmlizeTag($arrayInfo, $sizeRange)
{
if ( isset($this->_htmlizeTagFunction) ) {
// this cannot be writen in one line or the PHP interpreter will puke
// appearantly, it's okay to have a function in a variable,
// but it's not okay to have it in an instance-varriable.
$htmlizer = $this->_h... | [
"public",
"function",
"htmlizeTag",
"(",
"$",
"arrayInfo",
",",
"$",
"sizeRange",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_htmlizeTagFunction",
")",
")",
"{",
"// this cannot be writen in one line or the PHP interpreter will puke",
"// appearantly, it's o... | Convert a tag into an html-snippet
This function is mainly an anchor to decide if a user-supplied
custom function should be used or the normal output method.
This will most likely only work in PHP >= 5.3
@param array $arrayInfo
@param string $sizeRange
@return string | [
"Convert",
"a",
"tag",
"into",
"an",
"html",
"-",
"snippet"
] | aa5bf828ee5f5be28d4cd3ee1a19c75dcf924a83 | https://github.com/arogozin/tagcloud/blob/aa5bf828ee5f5be28d4cd3ee1a19c75dcf924a83/src/Arg/Tagcloud/Tagcloud.php#L362-L373 |
228,643 | contributte/social | src/Google/PlusOne/PlusOne.php | PlusOne.render | public function render(?string $url = null): void
{
// Get HTML element
$el = $this->getElementPrototype();
$el->size = $this->size;
$el->annotation = $this->annotation;
// Set given URL or filled url
if ($url !== null) {
Validators::assert($url, 'string|url');
$el->href = $url;
} else {
$el->h... | php | public function render(?string $url = null): void
{
// Get HTML element
$el = $this->getElementPrototype();
$el->size = $this->size;
$el->annotation = $this->annotation;
// Set given URL or filled url
if ($url !== null) {
Validators::assert($url, 'string|url');
$el->href = $url;
} else {
$el->h... | [
"public",
"function",
"render",
"(",
"?",
"string",
"$",
"url",
"=",
"null",
")",
":",
"void",
"{",
"// Get HTML element",
"$",
"el",
"=",
"$",
"this",
"->",
"getElementPrototype",
"(",
")",
";",
"$",
"el",
"->",
"size",
"=",
"$",
"this",
"->",
"size... | Render google +1 button | [
"Render",
"google",
"+",
"1",
"button"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Google/PlusOne/PlusOne.php#L201-L234 |
228,644 | contributte/social | src/Google/PlusOne/PlusOne.php | PlusOne.renderJs | public function renderJs(): void
{
if ($this->mode === self::MODE_DEFAULT) {
$el = Html::el('script type="text/javascript" async defer');
$el->src = self::GOOGLE_PLATFORM_URL;
$el->addText("{lang: '" . $this->lang . "'}");
echo $el;
} elseif ($this->mode === self::MODE_EXPLICIT) {
$wrapper = Html:... | php | public function renderJs(): void
{
if ($this->mode === self::MODE_DEFAULT) {
$el = Html::el('script type="text/javascript" async defer');
$el->src = self::GOOGLE_PLATFORM_URL;
$el->addText("{lang: '" . $this->lang . "'}");
echo $el;
} elseif ($this->mode === self::MODE_EXPLICIT) {
$wrapper = Html:... | [
"public",
"function",
"renderJs",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"mode",
"===",
"self",
"::",
"MODE_DEFAULT",
")",
"{",
"$",
"el",
"=",
"Html",
"::",
"el",
"(",
"'script type=\"text/javascript\" async defer'",
")",
";",
"$",
"e... | Render google javascript | [
"Render",
"google",
"javascript"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Google/PlusOne/PlusOne.php#L239-L269 |
228,645 | contributte/social | src/Twitter/TweetButton/TweetButton.php | TweetButton.setShareButton | public function setShareButton($text = null): void
{
$this->element->addClass('twitter-share-button');
$this->href = self::TWITTER_SHARE_URL;
if ($text) {
$this->elementText = 'Tweet ' . $text;
}
} | php | public function setShareButton($text = null): void
{
$this->element->addClass('twitter-share-button');
$this->href = self::TWITTER_SHARE_URL;
if ($text) {
$this->elementText = 'Tweet ' . $text;
}
} | [
"public",
"function",
"setShareButton",
"(",
"$",
"text",
"=",
"null",
")",
":",
"void",
"{",
"$",
"this",
"->",
"element",
"->",
"addClass",
"(",
"'twitter-share-button'",
")",
";",
"$",
"this",
"->",
"href",
"=",
"self",
"::",
"TWITTER_SHARE_URL",
";",
... | Configure share button
@param string $text [optional] | [
"Configure",
"share",
"button"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Twitter/TweetButton/TweetButton.php#L370-L378 |
228,646 | contributte/social | src/Twitter/TweetButton/TweetButton.php | TweetButton.setMentionButton | public function setMentionButton($mention = null): void
{
$this->element->addClass('twitter-mention-button');
// Build URL
$url = new Url(self::TWITTER_TWEET_URL);
$url->setQueryParameter('screen_name', $mention);
$this->href = (string) $url;
if ($mention) {
$this->elementText = 'Tweet to @' . $mentio... | php | public function setMentionButton($mention = null): void
{
$this->element->addClass('twitter-mention-button');
// Build URL
$url = new Url(self::TWITTER_TWEET_URL);
$url->setQueryParameter('screen_name', $mention);
$this->href = (string) $url;
if ($mention) {
$this->elementText = 'Tweet to @' . $mentio... | [
"public",
"function",
"setMentionButton",
"(",
"$",
"mention",
"=",
"null",
")",
":",
"void",
"{",
"$",
"this",
"->",
"element",
"->",
"addClass",
"(",
"'twitter-mention-button'",
")",
";",
"// Build URL",
"$",
"url",
"=",
"new",
"Url",
"(",
"self",
"::",
... | Configure mention button
@param string $mention | [
"Configure",
"mention",
"button"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Twitter/TweetButton/TweetButton.php#L385-L397 |
228,647 | contributte/social | src/Twitter/TweetButton/TweetButton.php | TweetButton.setHashtagButton | public function setHashtagButton($hashtag = null): void
{
$this->element->addClass('twitter-hashtag-button');
// Build URL
$url = new Url(self::TWITTER_TWEET_URL);
$url->setQueryParameter('button_hashtag', $hashtag);
$this->href = (string) $url;
if ($hashtag) {
$this->elementText = 'Tweet #' . $hashta... | php | public function setHashtagButton($hashtag = null): void
{
$this->element->addClass('twitter-hashtag-button');
// Build URL
$url = new Url(self::TWITTER_TWEET_URL);
$url->setQueryParameter('button_hashtag', $hashtag);
$this->href = (string) $url;
if ($hashtag) {
$this->elementText = 'Tweet #' . $hashta... | [
"public",
"function",
"setHashtagButton",
"(",
"$",
"hashtag",
"=",
"null",
")",
":",
"void",
"{",
"$",
"this",
"->",
"element",
"->",
"addClass",
"(",
"'twitter-hashtag-button'",
")",
";",
"// Build URL",
"$",
"url",
"=",
"new",
"Url",
"(",
"self",
"::",
... | Configure hashtag button
@param string $hashtag | [
"Configure",
"hashtag",
"button"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Twitter/TweetButton/TweetButton.php#L404-L416 |
228,648 | contributte/social | src/Twitter/TweetButton/TweetButton.php | TweetButton.render | public function render(?string $url = null): void
{
// Get HTML element
$el = $this->getElementPrototype();
$el->addText($this->getElementText());
$el->href($this->getHref());
// Set URL
if ($url !== null) {
Validators::assert($url, 'string|url');
$el->{'data-url'} = $url;
} elseif ($this->url !==... | php | public function render(?string $url = null): void
{
// Get HTML element
$el = $this->getElementPrototype();
$el->addText($this->getElementText());
$el->href($this->getHref());
// Set URL
if ($url !== null) {
Validators::assert($url, 'string|url');
$el->{'data-url'} = $url;
} elseif ($this->url !==... | [
"public",
"function",
"render",
"(",
"?",
"string",
"$",
"url",
"=",
"null",
")",
":",
"void",
"{",
"// Get HTML element",
"$",
"el",
"=",
"$",
"this",
"->",
"getElementPrototype",
"(",
")",
";",
"$",
"el",
"->",
"addText",
"(",
"$",
"this",
"->",
"g... | Render twitter tweet button | [
"Render",
"twitter",
"tweet",
"button"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Twitter/TweetButton/TweetButton.php#L423-L462 |
228,649 | contributte/social | src/Twitter/TweetButton/TweetButton.php | TweetButton.renderJs | public function renderJs(): void
{
$el = Html::el('script type="text/javascript"');
$el->addText('window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="' . self::TWITTER_PLATFORM_URL . '";fjs.parentNode.insertBefore(js,fjs);r... | php | public function renderJs(): void
{
$el = Html::el('script type="text/javascript"');
$el->addText('window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)){return}js=d.createElement(s);js.id=id;js.src="' . self::TWITTER_PLATFORM_URL . '";fjs.parentNode.insertBefore(js,fjs);r... | [
"public",
"function",
"renderJs",
"(",
")",
":",
"void",
"{",
"$",
"el",
"=",
"Html",
"::",
"el",
"(",
"'script type=\"text/javascript\"'",
")",
";",
"$",
"el",
"->",
"addText",
"(",
"'window.twttr=(function(d,s,id){var t,js,fjs=d.getElementsByTagName(s)[0];if(d.getElem... | Render twitter javascript | [
"Render",
"twitter",
"javascript"
] | c045978c6fe5fc179eaacb20cacc25d4c46b9153 | https://github.com/contributte/social/blob/c045978c6fe5fc179eaacb20cacc25d4c46b9153/src/Twitter/TweetButton/TweetButton.php#L467-L473 |
228,650 | mariano/disque-php | src/Client.php | Client.setConnectionManager | public function setConnectionManager(ManagerInterface $manager)
{
$this->connectionManager = $manager;
foreach ($this->servers as $server) {
$this->connectionManager->addServer($server);
}
} | php | public function setConnectionManager(ManagerInterface $manager)
{
$this->connectionManager = $manager;
foreach ($this->servers as $server) {
$this->connectionManager->addServer($server);
}
} | [
"public",
"function",
"setConnectionManager",
"(",
"ManagerInterface",
"$",
"manager",
")",
"{",
"$",
"this",
"->",
"connectionManager",
"=",
"$",
"manager",
";",
"foreach",
"(",
"$",
"this",
"->",
"servers",
"as",
"$",
"server",
")",
"{",
"$",
"this",
"->... | Set a connection manager
@param ManagerInterface $manager | [
"Set",
"a",
"connection",
"manager"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Client.php#L100-L106 |
228,651 | mariano/disque-php | src/Client.php | Client.registerCommand | public function registerCommand(CommandInterface $commandHandler)
{
$command = strtoupper($commandHandler->getCommand());
$this->commandHandlers[$command] = $commandHandler;
} | php | public function registerCommand(CommandInterface $commandHandler)
{
$command = strtoupper($commandHandler->getCommand());
$this->commandHandlers[$command] = $commandHandler;
} | [
"public",
"function",
"registerCommand",
"(",
"CommandInterface",
"$",
"commandHandler",
")",
"{",
"$",
"command",
"=",
"strtoupper",
"(",
"$",
"commandHandler",
"->",
"getCommand",
"(",
")",
")",
";",
"$",
"this",
"->",
"commandHandlers",
"[",
"$",
"command",... | Register a command handler
@param CommandInterface $commandHandler Command
@return void | [
"Register",
"a",
"command",
"handler"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Client.php#L161-L165 |
228,652 | mariano/disque-php | src/Client.php | Client.queue | public function queue($name)
{
if (!isset($this->queues[$name])) {
$this->queues[$name] = new Queue($this, $name);
}
return $this->queues[$name];
} | php | public function queue($name)
{
if (!isset($this->queues[$name])) {
$this->queues[$name] = new Queue($this, $name);
}
return $this->queues[$name];
} | [
"public",
"function",
"queue",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"queues",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"queues",
"[",
"$",
"name",
"]",
"=",
"new",
"Queue",
"(",
"$",
"th... | Get a queue
@param string $name Queue name
@return Queue Queue | [
"Get",
"a",
"queue"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Client.php#L173-L179 |
228,653 | mariano/disque-php | src/Queue/Queue.php | Queue.schedule | public function schedule(JobInterface $job, DateTime $when, array $options = [])
{
if (!isset($this->timeZone)) {
$this->timeZone = new DateTimeZone(self::DEFAULT_JOB_TIMEZONE);
}
$date = clone($when);
$date->setTimeZone($this->timeZone);
$now = new DateTime('now... | php | public function schedule(JobInterface $job, DateTime $when, array $options = [])
{
if (!isset($this->timeZone)) {
$this->timeZone = new DateTimeZone(self::DEFAULT_JOB_TIMEZONE);
}
$date = clone($when);
$date->setTimeZone($this->timeZone);
$now = new DateTime('now... | [
"public",
"function",
"schedule",
"(",
"JobInterface",
"$",
"job",
",",
"DateTime",
"$",
"when",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"timeZone",
")",
")",
"{",
"$",
"this",
"->",
... | Pushes a job into the queue, setting it to be up for processing only at
the specific date & time.
@param JobInterface $job Job
@param DateTime $when Date & time on when job should be ready for processing
@param array $options ADDJOB options sent to the client
@return JobInterface Job pushed
@throws InvalidArgumentExce... | [
"Pushes",
"a",
"job",
"into",
"the",
"queue",
"setting",
"it",
"to",
"be",
"up",
"for",
"processing",
"only",
"at",
"the",
"specific",
"date",
"&",
"time",
"."
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Queue/Queue.php#L89-L104 |
228,654 | mariano/disque-php | src/Queue/Queue.php | Queue.push | public function push(JobInterface $job, array $options = [])
{
$this->checkConnected();
$id = $this->client->addJob($this->name, $this->marshaler->marshal($job), $options);
$job->setId($id);
return $job;
} | php | public function push(JobInterface $job, array $options = [])
{
$this->checkConnected();
$id = $this->client->addJob($this->name, $this->marshaler->marshal($job), $options);
$job->setId($id);
return $job;
} | [
"public",
"function",
"push",
"(",
"JobInterface",
"$",
"job",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"checkConnected",
"(",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"client",
"->",
"addJob",
"(",
"$",
"this",... | Pushes a job into the queue
@param JobInterface $job Job
@param array $options ADDJOB options sent to the client
@return JobInterface Job pushed | [
"Pushes",
"a",
"job",
"into",
"the",
"queue"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Queue/Queue.php#L113-L119 |
228,655 | mariano/disque-php | src/Queue/Queue.php | Queue.processing | public function processing(JobInterface $job)
{
$this->checkConnected();
return $this->client->working($job->getId());
} | php | public function processing(JobInterface $job)
{
$this->checkConnected();
return $this->client->working($job->getId());
} | [
"public",
"function",
"processing",
"(",
"JobInterface",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"checkConnected",
"(",
")",
";",
"return",
"$",
"this",
"->",
"client",
"->",
"working",
"(",
"$",
"job",
"->",
"getId",
"(",
")",
")",
";",
"}"
] | Marks that a Job is still being processed
@param JobInterface $job Job
@return int Number of seconds that the job visibility was postponed | [
"Marks",
"that",
"a",
"Job",
"is",
"still",
"being",
"processed"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Queue/Queue.php#L158-L162 |
228,656 | mariano/disque-php | src/Queue/Queue.php | Queue.processed | public function processed(JobInterface $job)
{
$this->checkConnected();
$this->client->ackJob($job->getId());
} | php | public function processed(JobInterface $job)
{
$this->checkConnected();
$this->client->ackJob($job->getId());
} | [
"public",
"function",
"processed",
"(",
"JobInterface",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"checkConnected",
"(",
")",
";",
"$",
"this",
"->",
"client",
"->",
"ackJob",
"(",
"$",
"job",
"->",
"getId",
"(",
")",
")",
";",
"}"
] | Acknowledges a Job as properly handled
@param JobInterface $job Job
@return void | [
"Acknowledges",
"a",
"Job",
"as",
"properly",
"handled"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Queue/Queue.php#L170-L174 |
228,657 | mariano/disque-php | src/Queue/Queue.php | Queue.failed | public function failed(JobInterface $job)
{
$this->checkConnected();
$this->client->nack($job->getId());
} | php | public function failed(JobInterface $job)
{
$this->checkConnected();
$this->client->nack($job->getId());
} | [
"public",
"function",
"failed",
"(",
"JobInterface",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"checkConnected",
"(",
")",
";",
"$",
"this",
"->",
"client",
"->",
"nack",
"(",
"$",
"job",
"->",
"getId",
"(",
")",
")",
";",
"}"
] | Marks the job as failed and returns it to the queue
This increases the NACK counter of the job
@param JobInterface $job
@return void | [
"Marks",
"the",
"job",
"as",
"failed",
"and",
"returns",
"it",
"to",
"the",
"queue"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Queue/Queue.php#L184-L188 |
228,658 | dnunez24/craft-laravel-mix | models/Mix_HotModuleReplacementModel.php | Mix_HotModuleReplacementModel.getAssetPath | public function getAssetPath(string $path)
{
if (!$this->urlHelper->isFullUrl($path)) {
$path = $this->pathHelper->prefix($path);
}
return $this->urlHelper->getUrl(self::BASE_URL.$path);
} | php | public function getAssetPath(string $path)
{
if (!$this->urlHelper->isFullUrl($path)) {
$path = $this->pathHelper->prefix($path);
}
return $this->urlHelper->getUrl(self::BASE_URL.$path);
} | [
"public",
"function",
"getAssetPath",
"(",
"string",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"urlHelper",
"->",
"isFullUrl",
"(",
"$",
"path",
")",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"pathHelper",
"->",
"prefix",
"(",
... | Get asset path for hot module replacement mode
@param string $path
@return string | [
"Get",
"asset",
"path",
"for",
"hot",
"module",
"replacement",
"mode"
] | c2f060f87be351d30e7d00123bb0ac25dd035490 | https://github.com/dnunez24/craft-laravel-mix/blob/c2f060f87be351d30e7d00123bb0ac25dd035490/models/Mix_HotModuleReplacementModel.php#L51-L58 |
228,659 | dnunez24/craft-laravel-mix | models/Mix_HotModuleReplacementModel.php | Mix_HotModuleReplacementModel.isEnabled | public function isEnabled()
{
$path = $this->directory.'/'.self::FLAG_FILENAME;
return (bool)$this->pathHelper->getPublicPath($path);
} | php | public function isEnabled()
{
$path = $this->directory.'/'.self::FLAG_FILENAME;
return (bool)$this->pathHelper->getPublicPath($path);
} | [
"public",
"function",
"isEnabled",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"directory",
".",
"'/'",
".",
"self",
"::",
"FLAG_FILENAME",
";",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"pathHelper",
"->",
"getPublicPath",
"(",
"$",
"path... | Check if hot module replacement mode is enabled
@return bool | [
"Check",
"if",
"hot",
"module",
"replacement",
"mode",
"is",
"enabled"
] | c2f060f87be351d30e7d00123bb0ac25dd035490 | https://github.com/dnunez24/craft-laravel-mix/blob/c2f060f87be351d30e7d00123bb0ac25dd035490/models/Mix_HotModuleReplacementModel.php#L65-L69 |
228,660 | phlib/encrypt | src/Encryptor/OpenSsl.php | OpenSsl.deriveKeys | protected function deriveKeys($salt)
{
$key = hash_pbkdf2('sha256', $this->password, $salt, $this->pbkdf2Iterations, $this->keyLength * 2, true);
return str_split($key, $this->keyLength);
} | php | protected function deriveKeys($salt)
{
$key = hash_pbkdf2('sha256', $this->password, $salt, $this->pbkdf2Iterations, $this->keyLength * 2, true);
return str_split($key, $this->keyLength);
} | [
"protected",
"function",
"deriveKeys",
"(",
"$",
"salt",
")",
"{",
"$",
"key",
"=",
"hash_pbkdf2",
"(",
"'sha256'",
",",
"$",
"this",
"->",
"password",
",",
"$",
"salt",
",",
"$",
"this",
"->",
"pbkdf2Iterations",
",",
"$",
"this",
"->",
"keyLength",
"... | Derive the keys for encryption and authentication using the given salt, and the password
@param string $salt
@return array | [
"Derive",
"the",
"keys",
"for",
"encryption",
"and",
"authentication",
"using",
"the",
"given",
"salt",
"and",
"the",
"password"
] | e13f00a0c517ea8ece37490c4daa896ec29a2503 | https://github.com/phlib/encrypt/blob/e13f00a0c517ea8ece37490c4daa896ec29a2503/src/Encryptor/OpenSsl.php#L158-L163 |
228,661 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.fetch | public static function fetch($ldap, $dn = null)
{
if (!$ldap instanceof Net_LDAP2) {
return PEAR::raiseError("Unable to fetch Schema: Parameter \$ldap must be a Net_LDAP2 object!");
}
$schema_o = new Net_LDAP2_Schema();
if (is_null($dn)) {
// get the subsche... | php | public static function fetch($ldap, $dn = null)
{
if (!$ldap instanceof Net_LDAP2) {
return PEAR::raiseError("Unable to fetch Schema: Parameter \$ldap must be a Net_LDAP2 object!");
}
$schema_o = new Net_LDAP2_Schema();
if (is_null($dn)) {
// get the subsche... | [
"public",
"static",
"function",
"fetch",
"(",
"$",
"ldap",
",",
"$",
"dn",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"ldap",
"instanceof",
"Net_LDAP2",
")",
"{",
"return",
"PEAR",
"::",
"raiseError",
"(",
"\"Unable to fetch Schema: Parameter \\$ldap must be ... | Fetch the Schema from an LDAP connection
@param Net_LDAP2 $ldap LDAP connection
@param string $dn (optional) Subschema entry dn
@access public
@return Net_LDAP2_Schema|NET_LDAP2_Error | [
"Fetch",
"the",
"Schema",
"from",
"an",
"LDAP",
"connection"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L126-L185 |
228,662 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.& | public function &getAll($type)
{
$map = array('objectclasses' => &$this->_objectClasses,
'attributes' => &$this->_attributeTypes,
'ditcontentrules' => &$this->_dITContentRules,
'ditstructurerules' => &$this->_dITStructureRules,
... | php | public function &getAll($type)
{
$map = array('objectclasses' => &$this->_objectClasses,
'attributes' => &$this->_attributeTypes,
'ditcontentrules' => &$this->_dITContentRules,
'ditstructurerules' => &$this->_dITStructureRules,
... | [
"public",
"function",
"&",
"getAll",
"(",
"$",
"type",
")",
"{",
"$",
"map",
"=",
"array",
"(",
"'objectclasses'",
"=>",
"&",
"$",
"this",
"->",
"_objectClasses",
",",
"'attributes'",
"=>",
"&",
"$",
"this",
"->",
"_attributeTypes",
",",
"'ditcontentrules'... | Return a hash of entries for the given type
Returns a hash of entry for the givene type. Types may be:
objectclasses, attributes, ditcontentrules, ditstructurerules, matchingrules,
matchingruleuses, nameforms, syntaxes
@param string $type Type to fetch
@access public
@return array|Net_LDAP2_Error Array or Net_LDAP2_... | [
"Return",
"a",
"hash",
"of",
"entries",
"for",
"the",
"given",
"type"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L199-L213 |
228,663 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.& | public function &get($type, $name)
{
if ($this->_initialized) {
$type = strtolower($type);
if (false == key_exists($type, $this->types)) {
return PEAR::raiseError("No such type $type");
}
$name = strtolower($name);
$type_var = ... | php | public function &get($type, $name)
{
if ($this->_initialized) {
$type = strtolower($type);
if (false == key_exists($type, $this->types)) {
return PEAR::raiseError("No such type $type");
}
$name = strtolower($name);
$type_var = ... | [
"public",
"function",
"&",
"get",
"(",
"$",
"type",
",",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_initialized",
")",
"{",
"$",
"type",
"=",
"strtolower",
"(",
"$",
"type",
")",
";",
"if",
"(",
"false",
"==",
"key_exists",
"(",
"$",
... | Return a specific entry
@param string $type Type of name
@param string $name Name or OID to fetch
@access public
@return mixed Entry or Net_LDAP2_Error | [
"Return",
"a",
"specific",
"entry"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L224-L246 |
228,664 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema._getAttr | protected function _getAttr($oc, $attr)
{
$oc = strtolower($oc);
if (key_exists($oc, $this->_objectClasses) && key_exists($attr, $this->_objectClasses[$oc])) {
return $this->_objectClasses[$oc][$attr];
} elseif (key_exists($oc, $this->_oids) &&
$this->_oids[$oc]['... | php | protected function _getAttr($oc, $attr)
{
$oc = strtolower($oc);
if (key_exists($oc, $this->_objectClasses) && key_exists($attr, $this->_objectClasses[$oc])) {
return $this->_objectClasses[$oc][$attr];
} elseif (key_exists($oc, $this->_oids) &&
$this->_oids[$oc]['... | [
"protected",
"function",
"_getAttr",
"(",
"$",
"oc",
",",
"$",
"attr",
")",
"{",
"$",
"oc",
"=",
"strtolower",
"(",
"$",
"oc",
")",
";",
"if",
"(",
"key_exists",
"(",
"$",
"oc",
",",
"$",
"this",
"->",
"_objectClasses",
")",
"&&",
"key_exists",
"("... | Fetches the given attribute from the given objectclass
@param string $oc Name or OID of objectclass
@param string $attr Name of attribute to fetch
@access protected
@return array|Net_LDAP2_Error The attribute or Net_LDAP2_Error | [
"Fetches",
"the",
"given",
"attribute",
"from",
"the",
"given",
"objectclass"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L284-L296 |
228,665 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.parse | public function parse(&$entry)
{
foreach ($this->types as $type => $attr) {
// initialize map type to entry
$type_var = '_' . $attr;
$this->{$type_var} = array();
// get values for this type
if ($entry->exists($attr)) {
$v... | php | public function parse(&$entry)
{
foreach ($this->types as $type => $attr) {
// initialize map type to entry
$type_var = '_' . $attr;
$this->{$type_var} = array();
// get values for this type
if ($entry->exists($attr)) {
$v... | [
"public",
"function",
"parse",
"(",
"&",
"$",
"entry",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"types",
"as",
"$",
"type",
"=>",
"$",
"attr",
")",
"{",
"// initialize map type to entry",
"$",
"type_var",
"=",
"'_'",
".",
"$",
"attr",
";",
"$",
"... | Parses the schema of the given Subschema entry
@param Net_LDAP2_Entry &$entry Subschema entry
@access public
@return void | [
"Parses",
"the",
"schema",
"of",
"the",
"given",
"Subschema",
"entry"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L323-L358 |
228,666 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.& | protected function &_parse_entry($value)
{
// tokens that have no value associated
$noValue = array('single-value',
'obsolete',
'collective',
'no-user-modification',
'abstract',
... | php | protected function &_parse_entry($value)
{
// tokens that have no value associated
$noValue = array('single-value',
'obsolete',
'collective',
'no-user-modification',
'abstract',
... | [
"protected",
"function",
"&",
"_parse_entry",
"(",
"$",
"value",
")",
"{",
"// tokens that have no value associated",
"$",
"noValue",
"=",
"array",
"(",
"'single-value'",
",",
"'obsolete'",
",",
"'collective'",
",",
"'no-user-modification'",
",",
"'abstract'",
",",
... | Parses an attribute value into a schema entry
@param string $value Attribute value
@access protected
@return array|false Schema entry array or false | [
"Parses",
"an",
"attribute",
"value",
"into",
"a",
"schema",
"entry"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L368-L431 |
228,667 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema._tokenize | protected function _tokenize($value)
{
$tokens = array(); // array of tokens
$matches = array(); // matches[0] full pattern match, [1,2,3] subpatterns
// this one is taken from perl-ldap, modified for php
$pattern = "/\s* (?:([()]) | ([^'\s()]+) | '((?:[^']+|'[^\s)])*)'... | php | protected function _tokenize($value)
{
$tokens = array(); // array of tokens
$matches = array(); // matches[0] full pattern match, [1,2,3] subpatterns
// this one is taken from perl-ldap, modified for php
$pattern = "/\s* (?:([()]) | ([^'\s()]+) | '((?:[^']+|'[^\s)])*)'... | [
"protected",
"function",
"_tokenize",
"(",
"$",
"value",
")",
"{",
"$",
"tokens",
"=",
"array",
"(",
")",
";",
"// array of tokens",
"$",
"matches",
"=",
"array",
"(",
")",
";",
"// matches[0] full pattern match, [1,2,3] subpatterns",
"// this one is taken from perl-l... | Tokenizes the given value into an array of tokens
@param string $value String to parse
@access protected
@return array Array of tokens | [
"Tokenizes",
"the",
"given",
"value",
"into",
"an",
"array",
"of",
"tokens"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L441-L465 |
228,668 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.isBinary | public function isBinary($attribute)
{
$return = false; // default to false
// This list contains all syntax that should be treaten as
// containing binary values
// The Syntax Definitons go into constants at the top of this page
$syntax_binary = array(
... | php | public function isBinary($attribute)
{
$return = false; // default to false
// This list contains all syntax that should be treaten as
// containing binary values
// The Syntax Definitons go into constants at the top of this page
$syntax_binary = array(
... | [
"public",
"function",
"isBinary",
"(",
"$",
"attribute",
")",
"{",
"$",
"return",
"=",
"false",
";",
"// default to false",
"// This list contains all syntax that should be treaten as",
"// containing binary values",
"// The Syntax Definitons go into constants at the top of this page... | Returns wether a attribute syntax is binary or not
This method gets used by Net_LDAP2_Entry to decide which
PHP function needs to be used to fetch the value in the
proper format (e.g. binary or string)
@param string $attribute The name of the attribute (eg.: 'sn')
@access public
@return boolean | [
"Returns",
"wether",
"a",
"attribute",
"syntax",
"is",
"binary",
"or",
"not"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L479-L513 |
228,669 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.exists | public function exists($type, $name)
{
$entry = $this->get($type, $name);
if ($entry instanceof Net_LDAP2_ERROR) {
return false;
} else {
return true;
}
} | php | public function exists($type, $name)
{
$entry = $this->get($type, $name);
if ($entry instanceof Net_LDAP2_ERROR) {
return false;
} else {
return true;
}
} | [
"public",
"function",
"exists",
"(",
"$",
"type",
",",
"$",
"name",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"type",
",",
"$",
"name",
")",
";",
"if",
"(",
"$",
"entry",
"instanceof",
"Net_LDAP2_ERROR",
")",
"{",
"return",
... | See if an schema element exists
@param string $type Type of name, see get()
@param string $name Name or OID
@return boolean | [
"See",
"if",
"an",
"schema",
"element",
"exists"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L523-L531 |
228,670 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.getAssignedOCLs | public function getAssignedOCLs($attribute)
{
$may = array();
$must = array();
// Test if the attribute type is defined in the schema,
// if so, retrieve real name for lookups
$attr_entry = $this->get('attribute', $attribute);
if ($attr_entry instanceof Net_LDAP2_ER... | php | public function getAssignedOCLs($attribute)
{
$may = array();
$must = array();
// Test if the attribute type is defined in the schema,
// if so, retrieve real name for lookups
$attr_entry = $this->get('attribute', $attribute);
if ($attr_entry instanceof Net_LDAP2_ER... | [
"public",
"function",
"getAssignedOCLs",
"(",
"$",
"attribute",
")",
"{",
"$",
"may",
"=",
"array",
"(",
")",
";",
"$",
"must",
"=",
"array",
"(",
")",
";",
"// Test if the attribute type is defined in the schema,",
"// if so, retrieve real name for lookups",
"$",
"... | See to which ObjectClasses an attribute is assigned
The objectclasses are sorted into the keys 'may' and 'must'.
@param string $attribute Name or OID of the attribute
@return array|Net_LDAP2_Error Associative array with OCL names or Error | [
"See",
"to",
"which",
"ObjectClasses",
"an",
"attribute",
"is",
"assigned"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L565-L596 |
228,671 | pear/Net_LDAP2 | Net/LDAP2/Schema.php | Net_LDAP2_Schema.checkAttribute | public function checkAttribute($attribute, $ocls)
{
foreach ($ocls as $ocl) {
$ocl_entry = $this->get('objectclass', $ocl);
$ocl_may_attrs = $this->may($ocl);
$ocl_must_attrs = $this->must($ocl);
if (is_array($ocl_may_attrs) && in_array($attribute, $ocl_may_a... | php | public function checkAttribute($attribute, $ocls)
{
foreach ($ocls as $ocl) {
$ocl_entry = $this->get('objectclass', $ocl);
$ocl_may_attrs = $this->may($ocl);
$ocl_must_attrs = $this->must($ocl);
if (is_array($ocl_may_attrs) && in_array($attribute, $ocl_may_a... | [
"public",
"function",
"checkAttribute",
"(",
"$",
"attribute",
",",
"$",
"ocls",
")",
"{",
"foreach",
"(",
"$",
"ocls",
"as",
"$",
"ocl",
")",
"{",
"$",
"ocl_entry",
"=",
"$",
"this",
"->",
"get",
"(",
"'objectclass'",
",",
"$",
"ocl",
")",
";",
"$... | See if an attribute is available in a set of objectClasses
@param string $attribute Attribute name or OID
@param array $ocls Names of OCLs to check for
@return boolean TRUE, if the attribute is defined for at least one of the OCLs | [
"See",
"if",
"an",
"attribute",
"is",
"available",
"in",
"a",
"set",
"of",
"objectClasses"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Schema.php#L606-L620 |
228,672 | czim/laravel-cms-upload-module | src/Support/Security/SessionGuard.php | SessionGuard.link | public function link($fileId)
{
$links = session(static::SESSION_KEY, []);
$links[ $fileId ] = true;
session()->put(static::SESSION_KEY, $links);
return $this;
} | php | public function link($fileId)
{
$links = session(static::SESSION_KEY, []);
$links[ $fileId ] = true;
session()->put(static::SESSION_KEY, $links);
return $this;
} | [
"public",
"function",
"link",
"(",
"$",
"fileId",
")",
"{",
"$",
"links",
"=",
"session",
"(",
"static",
"::",
"SESSION_KEY",
",",
"[",
"]",
")",
";",
"$",
"links",
"[",
"$",
"fileId",
"]",
"=",
"true",
";",
"session",
"(",
")",
"->",
"put",
"(",... | Links a given ID to this session.
@param int $fileId
@return $this | [
"Links",
"a",
"given",
"ID",
"to",
"this",
"session",
"."
] | 3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3 | https://github.com/czim/laravel-cms-upload-module/blob/3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3/src/Support/Security/SessionGuard.php#L32-L41 |
228,673 | czim/laravel-cms-upload-module | src/Support/Security/SessionGuard.php | SessionGuard.unlink | public function unlink($fileId)
{
if ( ! $this->isIdLinked($fileId)) {
return $this;
}
$links = session(static::SESSION_KEY, []);
unset($links[ $fileId ]);
session()->put(static::SESSION_KEY, $links);
return $this;
} | php | public function unlink($fileId)
{
if ( ! $this->isIdLinked($fileId)) {
return $this;
}
$links = session(static::SESSION_KEY, []);
unset($links[ $fileId ]);
session()->put(static::SESSION_KEY, $links);
return $this;
} | [
"public",
"function",
"unlink",
"(",
"$",
"fileId",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isIdLinked",
"(",
"$",
"fileId",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"links",
"=",
"session",
"(",
"static",
"::",
"SESSION_KEY",
","... | Unlinks a given ID from this session.
@param int $fileId
@return $this | [
"Unlinks",
"a",
"given",
"ID",
"from",
"this",
"session",
"."
] | 3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3 | https://github.com/czim/laravel-cms-upload-module/blob/3599801efcfdcf9164e8c75c3e1b2c6e7e3692c3/src/Support/Security/SessionGuard.php#L49-L62 |
228,674 | dnunez24/craft-laravel-mix | services/MixService.php | MixService.getAssetPath | public function getAssetPath(string $path, $manifestDirectory = '')
{
$this->setManifestDirectory($manifestDirectory);
if ($this->isHotModuleReplacementEnabled()) {
return $this->getHotModuleReplacementAssetPath($path);
}
return $this->getManifestAssetPath($path);
} | php | public function getAssetPath(string $path, $manifestDirectory = '')
{
$this->setManifestDirectory($manifestDirectory);
if ($this->isHotModuleReplacementEnabled()) {
return $this->getHotModuleReplacementAssetPath($path);
}
return $this->getManifestAssetPath($path);
} | [
"public",
"function",
"getAssetPath",
"(",
"string",
"$",
"path",
",",
"$",
"manifestDirectory",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"setManifestDirectory",
"(",
"$",
"manifestDirectory",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isHotModuleReplacementEnabl... | Get the resolved asset path
@param string $path
@param string $manifestDirectory
@return string | [
"Get",
"the",
"resolved",
"asset",
"path"
] | c2f060f87be351d30e7d00123bb0ac25dd035490 | https://github.com/dnunez24/craft-laravel-mix/blob/c2f060f87be351d30e7d00123bb0ac25dd035490/services/MixService.php#L39-L48 |
228,675 | dnunez24/craft-laravel-mix | services/MixService.php | MixService.setManifestDirectory | protected function setManifestDirectory(string $manifestDirectory)
{
$this->manifest->directory = $manifestDirectory;
$this->hotModuleReplacement->directory = $manifestDirectory;
} | php | protected function setManifestDirectory(string $manifestDirectory)
{
$this->manifest->directory = $manifestDirectory;
$this->hotModuleReplacement->directory = $manifestDirectory;
} | [
"protected",
"function",
"setManifestDirectory",
"(",
"string",
"$",
"manifestDirectory",
")",
"{",
"$",
"this",
"->",
"manifest",
"->",
"directory",
"=",
"$",
"manifestDirectory",
";",
"$",
"this",
"->",
"hotModuleReplacement",
"->",
"directory",
"=",
"$",
"man... | Set the manifest directory for model dependencies
@param string $manifestDirectory
@return void | [
"Set",
"the",
"manifest",
"directory",
"for",
"model",
"dependencies"
] | c2f060f87be351d30e7d00123bb0ac25dd035490 | https://github.com/dnunez24/craft-laravel-mix/blob/c2f060f87be351d30e7d00123bb0ac25dd035490/services/MixService.php#L57-L61 |
228,676 | carpediem/mattermost-webhook | src/Message.php | Message.fromArray | public static function fromArray(array $arr): self
{
$prop = $arr + (new self($arr['text'] ?? ''))->toArray();
foreach ($prop['attachments'] as &$attachment) {
if (!$attachment instanceof AttachmentInterface) {
$attachment = Attachment::fromArray($attachment);
... | php | public static function fromArray(array $arr): self
{
$prop = $arr + (new self($arr['text'] ?? ''))->toArray();
foreach ($prop['attachments'] as &$attachment) {
if (!$attachment instanceof AttachmentInterface) {
$attachment = Attachment::fromArray($attachment);
... | [
"public",
"static",
"function",
"fromArray",
"(",
"array",
"$",
"arr",
")",
":",
"self",
"{",
"$",
"prop",
"=",
"$",
"arr",
"+",
"(",
"new",
"self",
"(",
"$",
"arr",
"[",
"'text'",
"]",
"??",
"''",
")",
")",
"->",
"toArray",
"(",
")",
";",
"for... | Returns a new instance from an array
@param array $arr
@return self | [
"Returns",
"a",
"new",
"instance",
"from",
"an",
"array"
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Message.php#L53-L64 |
228,677 | carpediem/mattermost-webhook | src/Message.php | Message.setText | public function setText(string $text): self
{
$text = trim($text);
if ('' === $text) {
throw new Exception('The text can not be empty');
}
$this->text = $text;
return $this;
} | php | public function setText(string $text): self
{
$text = trim($text);
if ('' === $text) {
throw new Exception('The text can not be empty');
}
$this->text = $text;
return $this;
} | [
"public",
"function",
"setText",
"(",
"string",
"$",
"text",
")",
":",
"self",
"{",
"$",
"text",
"=",
"trim",
"(",
"$",
"text",
")",
";",
"if",
"(",
"''",
"===",
"$",
"text",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The text can not be empty'",
... | Returns an instance with the specified message text.
@param string $text
@throws Exception if the text is an empty string
@return self | [
"Returns",
"an",
"instance",
"with",
"the",
"specified",
"message",
"text",
"."
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Message.php#L163-L173 |
228,678 | carpediem/mattermost-webhook | src/Message.php | Message.setAttachments | public function setAttachments($attachments): self
{
if (!is_iterable($attachments)) {
throw new Exception(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($attachments)));
}
$this->attachments = [];
foreach ($attachments as $attachmen... | php | public function setAttachments($attachments): self
{
if (!is_iterable($attachments)) {
throw new Exception(sprintf('%s() expects argument passed to be iterable, %s given', __METHOD__, gettype($attachments)));
}
$this->attachments = [];
foreach ($attachments as $attachmen... | [
"public",
"function",
"setAttachments",
"(",
"$",
"attachments",
")",
":",
"self",
"{",
"if",
"(",
"!",
"is_iterable",
"(",
"$",
"attachments",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"sprintf",
"(",
"'%s() expects argument passed to be iterable, %s given... | Override all attachements object with a iterable structure
@param array|Traversable $attachments
@return self | [
"Override",
"all",
"attachements",
"object",
"with",
"a",
"iterable",
"structure"
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Message.php#L238-L250 |
228,679 | coolcsn/CsnCms | src/CsnCms/Controller/TranslationController.php | TranslationController.indexAction | public function indexAction()
{
$id = (int) $this->params()->fromRoute('id', 0);
if (!$id) return $this->redirect()->toRoute('csn-cms/default', array('controller' => 'article', 'action' => 'index'));
$entityManager = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
... | php | public function indexAction()
{
$id = (int) $this->params()->fromRoute('id', 0);
if (!$id) return $this->redirect()->toRoute('csn-cms/default', array('controller' => 'article', 'action' => 'index'));
$entityManager = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');
... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"id",
"=",
"(",
"int",
")",
"$",
"this",
"->",
"params",
"(",
")",
"->",
"fromRoute",
"(",
"'id'",
",",
"0",
")",
";",
"if",
"(",
"!",
"$",
"id",
")",
"return",
"$",
"this",
"->",
"redire... | R - retriev | [
"R",
"-",
"retriev"
] | fd2b163e292836b9f672400694a86f75225b725a | https://github.com/coolcsn/CsnCms/blob/fd2b163e292836b9f672400694a86f75225b725a/src/CsnCms/Controller/TranslationController.php#L24-L37 |
228,680 | pear/Net_LDAP2 | Net/LDAP2/Filter.php | Net_LDAP2_Filter.create | public static function create($attr_name, $match, $value = '', $escape = true)
{
$leaf_filter = new Net_LDAP2_Filter();
if ($escape) {
$array = Net_LDAP2_Util::escape_filter_value(array($value));
$value = $array[0];
}
$match = strtolower($match);
// ... | php | public static function create($attr_name, $match, $value = '', $escape = true)
{
$leaf_filter = new Net_LDAP2_Filter();
if ($escape) {
$array = Net_LDAP2_Util::escape_filter_value(array($value));
$value = $array[0];
}
$match = strtolower($match);
// ... | [
"public",
"static",
"function",
"create",
"(",
"$",
"attr_name",
",",
"$",
"match",
",",
"$",
"value",
"=",
"''",
",",
"$",
"escape",
"=",
"true",
")",
"{",
"$",
"leaf_filter",
"=",
"new",
"Net_LDAP2_Filter",
"(",
")",
";",
"if",
"(",
"$",
"escape",
... | Constructor of a new part of a LDAP filter.
The following matching rules exists:
- equals: One of the attributes values is exactly $value
Please note that case sensitiviness is depends on the
attributes syntax configured in the server.
- begins: One of the attributes values must begin with $value
- end... | [
"Constructor",
"of",
"a",
"new",
"part",
"of",
"a",
"LDAP",
"filter",
"."
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Filter.php#L164-L232 |
228,681 | pear/Net_LDAP2 | Net/LDAP2/Filter.php | Net_LDAP2_Filter.& | public static function &combine($log_op, $filters)
{
if (PEAR::isError($filters)) {
return $filters;
}
// substitude named operators to logical operators
if ($log_op == 'and') $log_op = '&';
if ($log_op == 'or') $log_op = '|';
if ($log_op == 'not') $log_... | php | public static function &combine($log_op, $filters)
{
if (PEAR::isError($filters)) {
return $filters;
}
// substitude named operators to logical operators
if ($log_op == 'and') $log_op = '&';
if ($log_op == 'or') $log_op = '|';
if ($log_op == 'not') $log_... | [
"public",
"static",
"function",
"&",
"combine",
"(",
"$",
"log_op",
",",
"$",
"filters",
")",
"{",
"if",
"(",
"PEAR",
"::",
"isError",
"(",
"$",
"filters",
")",
")",
"{",
"return",
"$",
"filters",
";",
"}",
"// substitude named operators to logical operators... | Combine two or more filter objects using a logical operator
This static method combines two or more filter objects and returns one single
filter object that contains all the others.
Call this method statically: $filter = Net_LDAP2_Filter::combine('or', array($filter1, $filter2))
If the array contains filter strings in... | [
"Combine",
"two",
"or",
"more",
"filter",
"objects",
"using",
"a",
"logical",
"operator"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Filter.php#L248-L315 |
228,682 | pear/Net_LDAP2 | Net/LDAP2/Filter.php | Net_LDAP2_Filter.asString | public function asString()
{
if ($this->isLeaf()) {
$return = $this->_filter;
} else {
$return = '';
foreach ($this->_subfilters as $filter) {
$return = $return.$filter->asString();
}
$return = '(' . $this->_match . $return ... | php | public function asString()
{
if ($this->isLeaf()) {
$return = $this->_filter;
} else {
$return = '';
foreach ($this->_subfilters as $filter) {
$return = $return.$filter->asString();
}
$return = '(' . $this->_match . $return ... | [
"public",
"function",
"asString",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLeaf",
"(",
")",
")",
"{",
"$",
"return",
"=",
"$",
"this",
"->",
"_filter",
";",
"}",
"else",
"{",
"$",
"return",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"-... | Get the string representation of this filter
This method runs through all filter objects and creates
the string representation of the filter. If this
filter object is a leaf filter, then it will return
the string representation of this filter.
@return string|Net_LDAP2_Error | [
"Get",
"the",
"string",
"representation",
"of",
"this",
"filter"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Filter.php#L457-L469 |
228,683 | pear/Net_LDAP2 | Net/LDAP2/Filter.php | Net_LDAP2_Filter.printMe | public function printMe($FH = false)
{
if (!is_resource($FH)) {
if (PEAR::isError($FH)) {
return $FH;
}
$filter_str = $this->asString();
if (PEAR::isError($filter_str)) {
return $filter_str;
} else {
... | php | public function printMe($FH = false)
{
if (!is_resource($FH)) {
if (PEAR::isError($FH)) {
return $FH;
}
$filter_str = $this->asString();
if (PEAR::isError($filter_str)) {
return $filter_str;
} else {
... | [
"public",
"function",
"printMe",
"(",
"$",
"FH",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_resource",
"(",
"$",
"FH",
")",
")",
"{",
"if",
"(",
"PEAR",
"::",
"isError",
"(",
"$",
"FH",
")",
")",
"{",
"return",
"$",
"FH",
";",
"}",
"$",
"fil... | Print the text representation of the filter to FH, or the currently selected output handle if FH is not given
This method is only for compatibility to the perl interface.
However, the original method was called "print" but due to PHP language restrictions,
we can't have a print() method.
@param resource $FH (optional... | [
"Print",
"the",
"text",
"representation",
"of",
"the",
"filter",
"to",
"FH",
"or",
"the",
"currently",
"selected",
"output",
"handle",
"if",
"FH",
"is",
"not",
"given"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Filter.php#L493-L517 |
228,684 | pear/Net_LDAP2 | Net/LDAP2/Filter.php | Net_LDAP2_Filter.matches | function matches(&$entries, &$results=array()) {
$numOfMatches = 0;
if (!is_array($entries)) {
$all_entries = array(&$entries);
} else {
$all_entries = &$entries;
}
foreach ($all_entries as $entry) {
// look at the current entry and see if fi... | php | function matches(&$entries, &$results=array()) {
$numOfMatches = 0;
if (!is_array($entries)) {
$all_entries = array(&$entries);
} else {
$all_entries = &$entries;
}
foreach ($all_entries as $entry) {
// look at the current entry and see if fi... | [
"function",
"matches",
"(",
"&",
"$",
"entries",
",",
"&",
"$",
"results",
"=",
"array",
"(",
")",
")",
"{",
"$",
"numOfMatches",
"=",
"0",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"entries",
")",
")",
"{",
"$",
"all_entries",
"=",
"array",
"("... | Filter entries using this filter or see if a filter matches
@todo Currently slow and naive implementation with preg_match, could be optimized (esp. begins, ends filters etc)
@todo Currently only "="-based matches (equals, begins, ends, contains, any) implemented; Implement all the stuff!
@todo Implement expert code wi... | [
"Filter",
"entries",
"using",
"this",
"filter",
"or",
"see",
"if",
"a",
"filter",
"matches"
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Filter.php#L569-L642 |
228,685 | pear/Net_LDAP2 | Net/LDAP2/Filter.php | Net_LDAP2_Filter.getComponents | function getComponents() {
if ($this->isLeaf()) {
$raw_filter = preg_replace('/^\(|\)$/', '', $this->_filter);
$parts = Net_LDAP2_Util::split_attribute_string($raw_filter, true, true);
if (count($parts) != 3) {
return PEAR::raiseError("Net_LDAP2_Filter getComp... | php | function getComponents() {
if ($this->isLeaf()) {
$raw_filter = preg_replace('/^\(|\)$/', '', $this->_filter);
$parts = Net_LDAP2_Util::split_attribute_string($raw_filter, true, true);
if (count($parts) != 3) {
return PEAR::raiseError("Net_LDAP2_Filter getComp... | [
"function",
"getComponents",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLeaf",
"(",
")",
")",
"{",
"$",
"raw_filter",
"=",
"preg_replace",
"(",
"'/^\\(|\\)$/'",
",",
"''",
",",
"$",
"this",
"->",
"_filter",
")",
";",
"$",
"parts",
"=",
"Net_LDAP... | Retrieve this leaf-filters attribute, match and value component.
For leaf filters, this returns array(attr, match, value).
Match is be the logical operator, not the text representation,
eg "=" instead of "equals". Note that some operators are really
a combination of operator+value with wildcard, like
"begins": That wi... | [
"Retrieve",
"this",
"leaf",
"-",
"filters",
"attribute",
"match",
"and",
"value",
"component",
"."
] | 38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8 | https://github.com/pear/Net_LDAP2/blob/38f1b22a96dfbd7ec53852f0e1e7ec1a9a5eb0e8/Net/LDAP2/Filter.php#L659-L671 |
228,686 | mariano/disque-php | src/Command/BaseCommand.php | BaseCommand.toArguments | protected function toArguments(array $options)
{
if (empty($options)) {
return [];
} elseif (!empty(array_diff_key($options, $this->availableArguments))) {
throw new InvalidOptionException($this, $options);
}
// Pad, don't overwrite, the client provided optio... | php | protected function toArguments(array $options)
{
if (empty($options)) {
return [];
} elseif (!empty(array_diff_key($options, $this->availableArguments))) {
throw new InvalidOptionException($this, $options);
}
// Pad, don't overwrite, the client provided optio... | [
"protected",
"function",
"toArguments",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"options",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"elseif",
"(",
"!",
"empty",
"(",
"array_diff_key",
"(",
"$",
"options",
",",
"$",
... | Build command arguments out of options
Client-supplied options are amended with the default options defined
in $this->options. Options whose value is set to null or false are
ignored
@param array $options Command options
@return array Command arguments
@throws InvalidOptionException | [
"Build",
"command",
"arguments",
"out",
"of",
"options"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Command/BaseCommand.php#L181-L212 |
228,687 | carpediem/mattermost-webhook | src/Client.php | Client.send | public function send($url, Message $message, array $options = []): ResponseInterface
{
try {
unset($options['body']);
$options['json'] = $message;
$options['Content-Type'] = 'application/json';
return $this->client->request('POST', $url, $options);
} ... | php | public function send($url, Message $message, array $options = []): ResponseInterface
{
try {
unset($options['body']);
$options['json'] = $message;
$options['Content-Type'] = 'application/json';
return $this->client->request('POST', $url, $options);
} ... | [
"public",
"function",
"send",
"(",
"$",
"url",
",",
"Message",
"$",
"message",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"ResponseInterface",
"{",
"try",
"{",
"unset",
"(",
"$",
"options",
"[",
"'body'",
"]",
")",
";",
"$",
"options",
... | Send a message to a Mattermost Webhook
DEPRECATION WARNING! This method will be removed in the next major point release
@deprecated deprecated since version 1.1.0
@see Client::notify
@param string|UriInterface $url
@param MessageInterface $message
@param array $options additionals Guzzle options
@t... | [
"Send",
"a",
"message",
"to",
"a",
"Mattermost",
"Webhook"
] | 9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833 | https://github.com/carpediem/mattermost-webhook/blob/9192dbdd8150d7579e3f06da1cbf5bd4d1f8b833/src/Client.php#L76-L87 |
228,688 | coolcsn/CsnCms | src/CsnCms/Entity/Article.php | Article.addChildren | public function addChildren(Collection $children)
{
foreach ($children as $child) {
$this->addChild($child);
}
return $this;
} | php | public function addChildren(Collection $children)
{
foreach ($children as $child) {
$this->addChild($child);
}
return $this;
} | [
"public",
"function",
"addChildren",
"(",
"Collection",
"$",
"children",
")",
"{",
"foreach",
"(",
"$",
"children",
"as",
"$",
"child",
")",
"{",
"$",
"this",
"->",
"addChild",
"(",
"$",
"child",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
] | Add Child - translation
@param Collection $children
@return Article | [
"Add",
"Child",
"-",
"translation"
] | fd2b163e292836b9f672400694a86f75225b725a | https://github.com/coolcsn/CsnCms/blob/fd2b163e292836b9f672400694a86f75225b725a/src/CsnCms/Entity/Article.php#L520-L527 |
228,689 | contao-bootstrap/templates | src/EventListener/NavClassListener.php | NavClassListener.onIsVisibleElement | public function onIsVisibleElement(Model $element, $isVisible): bool
{
$isVisible = (bool) $isVisible;
// load module if it is a module include element
if ($element instanceof ContentModel && $element->type == 'module') {
$element = ModuleModel::findByPK($element->module);
... | php | public function onIsVisibleElement(Model $element, $isVisible): bool
{
$isVisible = (bool) $isVisible;
// load module if it is a module include element
if ($element instanceof ContentModel && $element->type == 'module') {
$element = ModuleModel::findByPK($element->module);
... | [
"public",
"function",
"onIsVisibleElement",
"(",
"Model",
"$",
"element",
",",
"$",
"isVisible",
")",
":",
"bool",
"{",
"$",
"isVisible",
"=",
"(",
"bool",
")",
"$",
"isVisible",
";",
"// load module if it is a module include element",
"if",
"(",
"$",
"element",... | Check if a module is loaded which make use the bs_nav_class value.
@param Model $element The given element.
@param bool $isVisible Visibility state.
@return bool | [
"Check",
"if",
"a",
"module",
"is",
"loaded",
"which",
"make",
"use",
"the",
"bs_nav_class",
"value",
"."
] | cf507af3a194895923c6b84d97aa224e8b5b6d2f | https://github.com/contao-bootstrap/templates/blob/cf507af3a194895923c6b84d97aa224e8b5b6d2f/src/EventListener/NavClassListener.php#L43-L60 |
228,690 | contao-bootstrap/templates | src/EventListener/NavClassListener.php | NavClassListener.onParseTemplate | public function onParseTemplate(Template $template): void
{
if (substr($template->getName(), 0, 4) !== 'nav_') {
return;
}
$template->navClass = (string) $this->navClass;
} | php | public function onParseTemplate(Template $template): void
{
if (substr($template->getName(), 0, 4) !== 'nav_') {
return;
}
$template->navClass = (string) $this->navClass;
} | [
"public",
"function",
"onParseTemplate",
"(",
"Template",
"$",
"template",
")",
":",
"void",
"{",
"if",
"(",
"substr",
"(",
"$",
"template",
"->",
"getName",
"(",
")",
",",
"0",
",",
"4",
")",
"!==",
"'nav_'",
")",
"{",
"return",
";",
"}",
"$",
"te... | Set the nav class in the nav template.
@param Template $template The template being parsed.
@return void | [
"Set",
"the",
"nav",
"class",
"in",
"the",
"nav",
"template",
"."
] | cf507af3a194895923c6b84d97aa224e8b5b6d2f | https://github.com/contao-bootstrap/templates/blob/cf507af3a194895923c6b84d97aa224e8b5b6d2f/src/EventListener/NavClassListener.php#L69-L76 |
228,691 | mariano/disque-php | src/Command/Argument/OptionChecker.php | OptionChecker.checkOptionsInt | protected function checkOptionsInt(array $options, array $keys)
{
foreach ($keys as $intOption) {
if (isset($options[$intOption]) && !is_int($options[$intOption])) {
throw new InvalidOptionException($this, $options);
}
}
} | php | protected function checkOptionsInt(array $options, array $keys)
{
foreach ($keys as $intOption) {
if (isset($options[$intOption]) && !is_int($options[$intOption])) {
throw new InvalidOptionException($this, $options);
}
}
} | [
"protected",
"function",
"checkOptionsInt",
"(",
"array",
"$",
"options",
",",
"array",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"intOption",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"$",
"intOption",
"]",
")",
"&... | Checks an array so that their keys are ints
@param array $options Options
@param array $keys Keys to check
@throw InvalidOptionException | [
"Checks",
"an",
"array",
"so",
"that",
"their",
"keys",
"are",
"ints"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Command/Argument/OptionChecker.php#L15-L22 |
228,692 | mariano/disque-php | src/Command/Argument/OptionChecker.php | OptionChecker.checkOptionsString | protected function checkOptionsString(array $options, array $keys)
{
foreach ($keys as $intOption) {
if (isset($options[$intOption]) && !is_string($options[$intOption])) {
throw new InvalidOptionException($this, $options);
}
}
} | php | protected function checkOptionsString(array $options, array $keys)
{
foreach ($keys as $intOption) {
if (isset($options[$intOption]) && !is_string($options[$intOption])) {
throw new InvalidOptionException($this, $options);
}
}
} | [
"protected",
"function",
"checkOptionsString",
"(",
"array",
"$",
"options",
",",
"array",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"intOption",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"$",
"intOption",
"]",
")",
... | Checks an array so that their keys are strings
@param array $options Options
@param array $keys Keys to check
@throw InvalidOptionException | [
"Checks",
"an",
"array",
"so",
"that",
"their",
"keys",
"are",
"strings"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Command/Argument/OptionChecker.php#L31-L38 |
228,693 | mariano/disque-php | src/Command/Argument/OptionChecker.php | OptionChecker.checkOptionsArray | protected function checkOptionsArray(array $options, array $keys)
{
foreach ($keys as $intOption) {
if (isset($options[$intOption]) && !is_array($options[$intOption])) {
throw new InvalidOptionException($this, $options);
}
}
} | php | protected function checkOptionsArray(array $options, array $keys)
{
foreach ($keys as $intOption) {
if (isset($options[$intOption]) && !is_array($options[$intOption])) {
throw new InvalidOptionException($this, $options);
}
}
} | [
"protected",
"function",
"checkOptionsArray",
"(",
"array",
"$",
"options",
",",
"array",
"$",
"keys",
")",
"{",
"foreach",
"(",
"$",
"keys",
"as",
"$",
"intOption",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"$",
"intOption",
"]",
")",
... | Checks an array so that their keys are arrays
@param array $options Options
@param array $keys Keys to check
@throw InvalidOptionException | [
"Checks",
"an",
"array",
"so",
"that",
"their",
"keys",
"are",
"arrays"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Command/Argument/OptionChecker.php#L47-L54 |
228,694 | hash-bang/RefLib | reflib.php | RefLib.LoadDriver | function LoadDriver($driver) {
$driver = strtolower($driver);
if ($driver == $this->_activeDriver) // Already loaded this driver
return TRUE;
if (!file_exists($file = dirname(__FILE__) . "/drivers/$driver.php"))
return;
require_once($file);
$driverName = "RefLib_" . ucfirst($driver);
$this->driver = n... | php | function LoadDriver($driver) {
$driver = strtolower($driver);
if ($driver == $this->_activeDriver) // Already loaded this driver
return TRUE;
if (!file_exists($file = dirname(__FILE__) . "/drivers/$driver.php"))
return;
require_once($file);
$driverName = "RefLib_" . ucfirst($driver);
$this->driver = n... | [
"function",
"LoadDriver",
"(",
"$",
"driver",
")",
"{",
"$",
"driver",
"=",
"strtolower",
"(",
"$",
"driver",
")",
";",
"if",
"(",
"$",
"driver",
"==",
"$",
"this",
"->",
"_activeDriver",
")",
"// Already loaded this driver",
"return",
"TRUE",
";",
"if",
... | Load a specific driver
@param string $driver The name of the driver to load. This should correspond to the driver name in drivers/*.php
@return bool TRUE if the driver is valid OR already loaded, FALSE if the driver cannot be loaded | [
"Load",
"a",
"specific",
"driver"
] | f53998da9adb36906fdc766c5043ddbe60f2310b | https://github.com/hash-bang/RefLib/blob/f53998da9adb36906fdc766c5043ddbe60f2310b/reflib.php#L118-L130 |
228,695 | hash-bang/RefLib | reflib.php | RefLib.IdentifyDriver | function IdentifyDriver() {
$types = func_get_args();
foreach ($types as $type) {
switch ($type) {
case 'xml':
case 'text/xml':
return 'endnotexml';
case 'ris':
return 'ris';
case 'csv':
case 'text/csv':
return 'csv';
case 'medline':
case 'nbib':
return 'medline';
... | php | function IdentifyDriver() {
$types = func_get_args();
foreach ($types as $type) {
switch ($type) {
case 'xml':
case 'text/xml':
return 'endnotexml';
case 'ris':
return 'ris';
case 'csv':
case 'text/csv':
return 'csv';
case 'medline':
case 'nbib':
return 'medline';
... | [
"function",
"IdentifyDriver",
"(",
")",
"{",
"$",
"types",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"types",
"as",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'xml'",
":",
"case",
"'text/xml'",
":",
"return"... | Tries to identify the correct driver to use based on an array of data
@param array $types,... An array of known data about the file. Usually this is the file extension (if any) and mime type
@return string Either a suitable driver name or boolean false | [
"Tries",
"to",
"identify",
"the",
"correct",
"driver",
"to",
"use",
"based",
"on",
"an",
"array",
"of",
"data"
] | f53998da9adb36906fdc766c5043ddbe60f2310b | https://github.com/hash-bang/RefLib/blob/f53998da9adb36906fdc766c5043ddbe60f2310b/reflib.php#L149-L181 |
228,696 | hash-bang/RefLib | reflib.php | RefLib.DownloadContents | function DownloadContents($filename = null, $driver = null) {
if ($filename && $driver) {
$this->LoadDriver($driver);
} elseif ($filename) { // $filename but no $driver - identify it from the filename
if (! $driver = $this->IdentifyDriver($filename)) {
trigger_error("Unknown reference driver to use with f... | php | function DownloadContents($filename = null, $driver = null) {
if ($filename && $driver) {
$this->LoadDriver($driver);
} elseif ($filename) { // $filename but no $driver - identify it from the filename
if (! $driver = $this->IdentifyDriver($filename)) {
trigger_error("Unknown reference driver to use with f... | [
"function",
"DownloadContents",
"(",
"$",
"filename",
"=",
"null",
",",
"$",
"driver",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"filename",
"&&",
"$",
"driver",
")",
"{",
"$",
"this",
"->",
"LoadDriver",
"(",
"$",
"driver",
")",
";",
"}",
"elseif",
"... | Generate an XML file and output it to the browser
This will force the user to save the file somewhere to be opened later by EndNote
@param string $filename The default filename to save as, if unspecifed the driver default will be used. The filename will be used with IdentifyDriver() if $driver is unspecified
@param str... | [
"Generate",
"an",
"XML",
"file",
"and",
"output",
"it",
"to",
"the",
"browser",
"This",
"will",
"force",
"the",
"user",
"to",
"save",
"the",
"file",
"somewhere",
"to",
"be",
"opened",
"later",
"by",
"EndNote"
] | f53998da9adb36906fdc766c5043ddbe60f2310b | https://github.com/hash-bang/RefLib/blob/f53998da9adb36906fdc766c5043ddbe60f2310b/reflib.php#L245-L260 |
228,697 | hash-bang/RefLib | reflib.php | RefLib.ToEpoc | function ToEpoc($date, $ref = null) {
if (preg_match('!^[0-9]{10,}$!', $date)) { // Unix time stamp
return $date;
} else if (preg_match('!^[0-9]{4}$!', $date)) { // Just year
return strtotime("$date-01-01");
} else if (preg_match('!^[0-9]{4}-[0-9]{2}$!', $date)) { // Year + month
return strtotime("$date-... | php | function ToEpoc($date, $ref = null) {
if (preg_match('!^[0-9]{10,}$!', $date)) { // Unix time stamp
return $date;
} else if (preg_match('!^[0-9]{4}$!', $date)) { // Just year
return strtotime("$date-01-01");
} else if (preg_match('!^[0-9]{4}-[0-9]{2}$!', $date)) { // Year + month
return strtotime("$date-... | [
"function",
"ToEpoc",
"(",
"$",
"date",
",",
"$",
"ref",
"=",
"null",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'!^[0-9]{10,}$!'",
",",
"$",
"date",
")",
")",
"{",
"// Unix time stamp",
"return",
"$",
"date",
";",
"}",
"else",
"if",
"(",
"preg_match",
... | Converts an incomming string to an epoc value suitable for use later on
@param string $date The raw string to be converted to an epoc
@param array|null $ref Optional additional reference information. This is used when the date needs more context e.g. 'Aug'
@return int An epoc value | [
"Converts",
"an",
"incomming",
"string",
"to",
"an",
"epoc",
"value",
"suitable",
"for",
"use",
"later",
"on"
] | f53998da9adb36906fdc766c5043ddbe60f2310b | https://github.com/hash-bang/RefLib/blob/f53998da9adb36906fdc766c5043ddbe60f2310b/reflib.php#L353-L367 |
228,698 | mariano/disque-php | src/Connection/Socket.php | Socket.send | public function send($data)
{
$this->shouldBeConnected();
do {
$length = strlen($data);
$bytes = fwrite($this->socket, $data);
if (empty($bytes)) {
throw new ConnectionException("Could not write {$length} bytes to client");
} elseif ($... | php | public function send($data)
{
$this->shouldBeConnected();
do {
$length = strlen($data);
$bytes = fwrite($this->socket, $data);
if (empty($bytes)) {
throw new ConnectionException("Could not write {$length} bytes to client");
} elseif ($... | [
"public",
"function",
"send",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"shouldBeConnected",
"(",
")",
";",
"do",
"{",
"$",
"length",
"=",
"strlen",
"(",
"$",
"data",
")",
";",
"$",
"bytes",
"=",
"fwrite",
"(",
"$",
"this",
"->",
"socket",
"... | Execute a command on the connection
@param string $data Data to send
@throws ConnectionException | [
"Execute",
"a",
"command",
"on",
"the",
"connection"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Socket.php#L114-L129 |
228,699 | mariano/disque-php | src/Connection/Socket.php | Socket.receive | public function receive($keepWaiting = false)
{
$this->shouldBeConnected();
$type = $this->getType($keepWaiting);
if (!array_key_exists($type, $this->responseHandlers)) {
throw new ResponseException("Don't know how to handle a response of type {$type}");
}
$resp... | php | public function receive($keepWaiting = false)
{
$this->shouldBeConnected();
$type = $this->getType($keepWaiting);
if (!array_key_exists($type, $this->responseHandlers)) {
throw new ResponseException("Don't know how to handle a response of type {$type}");
}
$resp... | [
"public",
"function",
"receive",
"(",
"$",
"keepWaiting",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"shouldBeConnected",
"(",
")",
";",
"$",
"type",
"=",
"$",
"this",
"->",
"getType",
"(",
"$",
"keepWaiting",
")",
";",
"if",
"(",
"!",
"array_key_exist... | Read data from connection
@param bool $keepWaiting If `true`, timeouts on stream read will be ignored
@return mixed Data received
@throws ConnectionException
@throws ResponseException | [
"Read",
"data",
"from",
"connection"
] | 56cf00d97e739fec861717484657dbef2888df60 | https://github.com/mariano/disque-php/blob/56cf00d97e739fec861717484657dbef2888df60/src/Connection/Socket.php#L140-L168 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.