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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7,400 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.getResponseHeader | public function getResponseHeader ($name) {
$this->throwIfNotSubmitted();
if (isset($this->responseHeaders[$name])) {
return $this->responseHeaders[$name];
} else {
return null;
}
} | php | public function getResponseHeader ($name) {
$this->throwIfNotSubmitted();
if (isset($this->responseHeaders[$name])) {
return $this->responseHeaders[$name];
} else {
return null;
}
} | [
"public",
"function",
"getResponseHeader",
"(",
"$",
"name",
")",
"{",
"$",
"this",
"->",
"throwIfNotSubmitted",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"responseHeaders",
"[",
"$",
"name",
"]",
")",
")",
"{",
"return",
"$",
"this",
... | Get a particular HTTP response header sent by the server.
@param string $name Header name
@return mixed Header value or null if not found. Value may be an array if
the named header occured more than once in the server's response.
@throws \RuntimeException If request has not been submitted. | [
"Get",
"a",
"particular",
"HTTP",
"response",
"header",
"sent",
"by",
"the",
"server",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L503-L510 |
7,401 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.submit | public function submit ($failIfNot200 = null) {
if ($this->wasSubmitted()) {
throw new Exception("Request be reused!");
}
$ch = $this->createCurlRequest();
$raw = curl_exec($ch);
$this->processCurlResponse($ch, curl_errno($ch), curl_error($ch), $raw);
$this->validateResponse($failIfNot200)... | php | public function submit ($failIfNot200 = null) {
if ($this->wasSubmitted()) {
throw new Exception("Request be reused!");
}
$ch = $this->createCurlRequest();
$raw = curl_exec($ch);
$this->processCurlResponse($ch, curl_errno($ch), curl_error($ch), $raw);
$this->validateResponse($failIfNot200)... | [
"public",
"function",
"submit",
"(",
"$",
"failIfNot200",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"wasSubmitted",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"Request be reused!\"",
")",
";",
"}",
"$",
"ch",
"=",
"$",
"this",
... | Submit this request.
This request will be updated with the results of the request which can
then be retrieved using getResponseHttpCode() and releated methods.
@param bool $failIfNot200 Throw an exception if a non-200 status was sent?
@return Request Request with response data populated
@throws Exception On cURL fail... | [
"Submit",
"this",
"request",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L575-L584 |
7,402 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.createCurlRequest | protected function createCurlRequest () {
// merge any custom cURL options into the default set
$curlOpts = Util::mergeCurlOptions(
self::$defaultCurlOpts, $this->getCurlOptions());
// set basic options that we always want to use
$curlOpts[CURLOPT_RETURNTRANSFER] = true;
$curlOpts[CURLOPT_H... | php | protected function createCurlRequest () {
// merge any custom cURL options into the default set
$curlOpts = Util::mergeCurlOptions(
self::$defaultCurlOpts, $this->getCurlOptions());
// set basic options that we always want to use
$curlOpts[CURLOPT_RETURNTRANSFER] = true;
$curlOpts[CURLOPT_H... | [
"protected",
"function",
"createCurlRequest",
"(",
")",
"{",
"// merge any custom cURL options into the default set",
"$",
"curlOpts",
"=",
"Util",
"::",
"mergeCurlOptions",
"(",
"self",
"::",
"$",
"defaultCurlOpts",
",",
"$",
"this",
"->",
"getCurlOptions",
"(",
")",... | Prepare a cURL handle for this request.
@return resource Curl handle ready to be submitted | [
"Prepare",
"a",
"cURL",
"handle",
"for",
"this",
"request",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L591-L655 |
7,403 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.processCurlResponse | protected function processCurlResponse ($ch, $errCode, $errMsg, $rawResp) {
// check error codes
$this->responseCurlErr = $errCode;
$this->responseCurlErrMessage = $errMsg;
if (CURLE_OK == $errCode) {
$info = curl_getinfo($ch);
$hdrSize = $info['header_size'];
$respCode = (int) $info[... | php | protected function processCurlResponse ($ch, $errCode, $errMsg, $rawResp) {
// check error codes
$this->responseCurlErr = $errCode;
$this->responseCurlErrMessage = $errMsg;
if (CURLE_OK == $errCode) {
$info = curl_getinfo($ch);
$hdrSize = $info['header_size'];
$respCode = (int) $info[... | [
"protected",
"function",
"processCurlResponse",
"(",
"$",
"ch",
",",
"$",
"errCode",
",",
"$",
"errMsg",
",",
"$",
"rawResp",
")",
"{",
"// check error codes",
"$",
"this",
"->",
"responseCurlErr",
"=",
"$",
"errCode",
";",
"$",
"this",
"->",
"responseCurlEr... | Process an submitted cURL response.
@param resource $ch Curl handle
@param int $errCode Curl error code
@param string $errMsg Curl error message
@param string $rawResp Raw response
@return Request Request with response data populated | [
"Process",
"an",
"submitted",
"cURL",
"response",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L666-L719 |
7,404 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.validateResponse | public function validateResponse ($failIfNot200 = null) {
if (null === $failIfNot200) {
$failIfNot200 = $this->defaultFailIfNot200;
}
if (CURLE_OK != $this->responseCurlErr) {
$exClazz = 'Moar\Net\Http\Exception';
switch ($this->responseCurlErr) {
case CURLE_UNSUPPORTED_PROTOCOL:... | php | public function validateResponse ($failIfNot200 = null) {
if (null === $failIfNot200) {
$failIfNot200 = $this->defaultFailIfNot200;
}
if (CURLE_OK != $this->responseCurlErr) {
$exClazz = 'Moar\Net\Http\Exception';
switch ($this->responseCurlErr) {
case CURLE_UNSUPPORTED_PROTOCOL:... | [
"public",
"function",
"validateResponse",
"(",
"$",
"failIfNot200",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"failIfNot200",
")",
"{",
"$",
"failIfNot200",
"=",
"$",
"this",
"->",
"defaultFailIfNot200",
";",
"}",
"if",
"(",
"CURLE_OK",
"!=",
... | Check the cURL response code and throw an exception if it is an error.
@param bool $failIfNot200 Throw an exception if a non-200 status was sent?
@return void
@throws Exception On cURL failure | [
"Check",
"the",
"cURL",
"response",
"code",
"and",
"throw",
"an",
"exception",
"if",
"it",
"is",
"an",
"error",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L728-L788 |
7,405 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.parallelSubmit | public static function parallelSubmit ($requests) {
$handles = array();
$mh = curl_multi_init();
// make a curl handle for each request
foreach ($requests as $req) {
$ch = $req->createCurlRequest();
$handles[(string) $ch] = $req;
curl_multi_add_handle($mh, $ch);
}
$reqsRunnin... | php | public static function parallelSubmit ($requests) {
$handles = array();
$mh = curl_multi_init();
// make a curl handle for each request
foreach ($requests as $req) {
$ch = $req->createCurlRequest();
$handles[(string) $ch] = $req;
curl_multi_add_handle($mh, $ch);
}
$reqsRunnin... | [
"public",
"static",
"function",
"parallelSubmit",
"(",
"$",
"requests",
")",
"{",
"$",
"handles",
"=",
"array",
"(",
")",
";",
"$",
"mh",
"=",
"curl_multi_init",
"(",
")",
";",
"// make a curl handle for each request",
"foreach",
"(",
"$",
"requests",
"as",
... | Submit a group of requests in parallel.
Uses the curl_multi_exec engine to fire off several requests in parallel
and waits for all responses to finish before returing the collective
results.
@param array $requests List of requests to submit
@return array List of submitted requests
@throws Exception If a fatal multi e... | [
"Submit",
"a",
"group",
"of",
"requests",
"in",
"parallel",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L802-L853 |
7,406 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.get | public static function get ($url, $parms = null, $options = null) {
$url = Util::addQueryData($url, $parms);
$r = new Request($url, self::METHOD_GET, null, null, $options);
return $r->submit();
} | php | public static function get ($url, $parms = null, $options = null) {
$url = Util::addQueryData($url, $parms);
$r = new Request($url, self::METHOD_GET, null, null, $options);
return $r->submit();
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"parms",
"=",
"null",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"url",
"=",
"Util",
"::",
"addQueryData",
"(",
"$",
"url",
",",
"$",
"parms",
")",
";",
"$",
"r",
"=",
"new... | Convenience method to perform a GET request.
Provided parameters will be "application/x-www-form-urlencoded" encoded
and appended to the provided URL.
@param string $url URL to get (eg https://www.keynetics.com/page.php)
@param array $parms Array of key => value pairs to send
@param array $options Array of extra opti... | [
"Convenience",
"method",
"to",
"perform",
"a",
"GET",
"request",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L894-L898 |
7,407 | bd808/moar-net-http | src/Moar/Net/Http/Request.php | Request.postContent | public static function postContent (
$url, $content, $contentType = 'text/xml', $options = null) {
$headers = array("Content-type: {$contentType}");
$r = new Request(
$url, self::METHOD_POST, $content, $headers, $options);
return $r->submit();
} | php | public static function postContent (
$url, $content, $contentType = 'text/xml', $options = null) {
$headers = array("Content-type: {$contentType}");
$r = new Request(
$url, self::METHOD_POST, $content, $headers, $options);
return $r->submit();
} | [
"public",
"static",
"function",
"postContent",
"(",
"$",
"url",
",",
"$",
"content",
",",
"$",
"contentType",
"=",
"'text/xml'",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
"\"Content-type: {$contentType}\"",
")",
";",
"$... | Convenience method to POST content in the form of a raw string to a URL.
This is useful for manually constructed SOAP requests and other document
body type operations. Default content type is text/xml.
@param string $url Full URL to post to (eg
https://www.keynetics.com/page.php)
@param string $content Raw HTTP reque... | [
"Convenience",
"method",
"to",
"POST",
"content",
"in",
"the",
"form",
"of",
"a",
"raw",
"string",
"to",
"a",
"URL",
"."
] | 828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf | https://github.com/bd808/moar-net-http/blob/828ddb020f6f6b87d0e5e4506c17b5b9c0c25eaf/src/Moar/Net/Http/Request.php#L936-L942 |
7,408 | philelson/VagrantTransient | src/Environments.php | Environments.getEnvironmentMessages | public function getEnvironmentMessages()
{
$messages = array();
foreach ($this->getEnvironments() as $environment) {
$style = 'general';
if (false == $this->vagrentExists($environment)) {
$style = 'warning';
}
$messages[$environment] = ... | php | public function getEnvironmentMessages()
{
$messages = array();
foreach ($this->getEnvironments() as $environment) {
$style = 'general';
if (false == $this->vagrentExists($environment)) {
$style = 'warning';
}
$messages[$environment] = ... | [
"public",
"function",
"getEnvironmentMessages",
"(",
")",
"{",
"$",
"messages",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getEnvironments",
"(",
")",
"as",
"$",
"environment",
")",
"{",
"$",
"style",
"=",
"'general'",
";",
"if",
... | This method returns an array of messages
@return array | [
"This",
"method",
"returns",
"an",
"array",
"of",
"messages"
] | cd82523e175ee3786c1a262fb7e75c38f24c0eb1 | https://github.com/philelson/VagrantTransient/blob/cd82523e175ee3786c1a262fb7e75c38f24c0eb1/src/Environments.php#L94-L105 |
7,409 | zepi/turbo-base | Zepi/Web/UserInterface/src/Renderer/Pagination.php | Pagination.prepare | public function prepare(DataRequest $dataRequest, $paginationUrl, $numberOfEntries, $numberOfEntriesPerPage = 10)
{
$this->paginationUrl = $paginationUrl;
$neededPages = ceil($numberOfEntries / $numberOfEntriesPerPage);
$activePage = $dataRequest->getPage();
$pagination = new Pagina... | php | public function prepare(DataRequest $dataRequest, $paginationUrl, $numberOfEntries, $numberOfEntriesPerPage = 10)
{
$this->paginationUrl = $paginationUrl;
$neededPages = ceil($numberOfEntries / $numberOfEntriesPerPage);
$activePage = $dataRequest->getPage();
$pagination = new Pagina... | [
"public",
"function",
"prepare",
"(",
"DataRequest",
"$",
"dataRequest",
",",
"$",
"paginationUrl",
",",
"$",
"numberOfEntries",
",",
"$",
"numberOfEntriesPerPage",
"=",
"10",
")",
"{",
"$",
"this",
"->",
"paginationUrl",
"=",
"$",
"paginationUrl",
";",
"$",
... | Prepares the Pagination object for the given DataRequest and number of entries per page
@access public
@param \Zepi\DataSource\Core\Entity\DataRequest $dataRequest
@param string $paginationUrl
@param integer $numberOfEntries
@param integer $numberOfEntriesPerPage
@return \Zepi\Web\UserInterface\Pagination\Pagination | [
"Prepares",
"the",
"Pagination",
"object",
"for",
"the",
"given",
"DataRequest",
"and",
"number",
"of",
"entries",
"per",
"page"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Renderer/Pagination.php#L71-L103 |
7,410 | zepi/turbo-base | Zepi/Web/UserInterface/src/Renderer/Pagination.php | Pagination.addPages | protected function addPages(PaginationObject $pagination, $activePage, $neededPages)
{
// Add the pages
for ($i = 1; $i <= $neededPages; $i++) {
if ($i == $activePage) {
$page = new ActivePage($i, $this->buildUrl($i));
$pagination->addEntry($page);
... | php | protected function addPages(PaginationObject $pagination, $activePage, $neededPages)
{
// Add the pages
for ($i = 1; $i <= $neededPages; $i++) {
if ($i == $activePage) {
$page = new ActivePage($i, $this->buildUrl($i));
$pagination->addEntry($page);
... | [
"protected",
"function",
"addPages",
"(",
"PaginationObject",
"$",
"pagination",
",",
"$",
"activePage",
",",
"$",
"neededPages",
")",
"{",
"// Add the pages",
"for",
"(",
"$",
"i",
"=",
"1",
";",
"$",
"i",
"<=",
"$",
"neededPages",
";",
"$",
"i",
"++",
... | Add the pages to the pagination
@param \Zepi\Web\UserInterface\Pagination\Pagination $pagination
@param integer $activePage
@param integer $neededPages | [
"Add",
"the",
"pages",
"to",
"the",
"pagination"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Web/UserInterface/src/Renderer/Pagination.php#L112-L127 |
7,411 | robertboloc/zf2-components-list-generator | src/Zf2ComponentsList.php | Zf2ComponentsList.toFile | public function toFile($file)
{
$composer = json_decode(file_get_contents($file), true);
// Remove the zendframework/zendframework
unset($composer['require']['zendframework/zendframework']);
// Add all the found components
foreach (array_keys($this->components) as $componen... | php | public function toFile($file)
{
$composer = json_decode(file_get_contents($file), true);
// Remove the zendframework/zendframework
unset($composer['require']['zendframework/zendframework']);
// Add all the found components
foreach (array_keys($this->components) as $componen... | [
"public",
"function",
"toFile",
"(",
"$",
"file",
")",
"{",
"$",
"composer",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"file",
")",
",",
"true",
")",
";",
"// Remove the zendframework/zendframework",
"unset",
"(",
"$",
"composer",
"[",
"'require'... | Updates the composer.json file with the new components list.
@param string $file | [
"Updates",
"the",
"composer",
".",
"json",
"file",
"with",
"the",
"new",
"components",
"list",
"."
] | 320bbced30af4e93c32a602b0a93f684682d9b12 | https://github.com/robertboloc/zf2-components-list-generator/blob/320bbced30af4e93c32a602b0a93f684682d9b12/src/Zf2ComponentsList.php#L100-L113 |
7,412 | robertboloc/zf2-components-list-generator | src/Zf2ComponentsList.php | Zf2ComponentsList.toConsole | public function toConsole()
{
$this->getConsole()->writeLine(
'Replace "zendframework/zendframework" in your composer.json file with :', Color::YELLOW
);
$componentsCount = count($this->components);
$count = 0;
foreach (array_keys($this->components) as $compo... | php | public function toConsole()
{
$this->getConsole()->writeLine(
'Replace "zendframework/zendframework" in your composer.json file with :', Color::YELLOW
);
$componentsCount = count($this->components);
$count = 0;
foreach (array_keys($this->components) as $compo... | [
"public",
"function",
"toConsole",
"(",
")",
"{",
"$",
"this",
"->",
"getConsole",
"(",
")",
"->",
"writeLine",
"(",
"'Replace \"zendframework/zendframework\" in your composer.json file with :'",
",",
"Color",
"::",
"YELLOW",
")",
";",
"$",
"componentsCount",
"=",
"... | Sends the components list to the console. | [
"Sends",
"the",
"components",
"list",
"to",
"the",
"console",
"."
] | 320bbced30af4e93c32a602b0a93f684682d9b12 | https://github.com/robertboloc/zf2-components-list-generator/blob/320bbced30af4e93c32a602b0a93f684682d9b12/src/Zf2ComponentsList.php#L118-L135 |
7,413 | fusible/fusible.authrole | src/AuthRoleTrait.php | AuthRoleTrait.getRoleFromAuth | protected function getRoleFromAuth(AuraAuth $auth)
{
if (! $auth->isValid()) {
return $this->guestRole;
}
$data = $auth->getUserData();
return isset($data[$this->roleKey])
? $data[$this->roleKey]
: $this->memberRole;
} | php | protected function getRoleFromAuth(AuraAuth $auth)
{
if (! $auth->isValid()) {
return $this->guestRole;
}
$data = $auth->getUserData();
return isset($data[$this->roleKey])
? $data[$this->roleKey]
: $this->memberRole;
} | [
"protected",
"function",
"getRoleFromAuth",
"(",
"AuraAuth",
"$",
"auth",
")",
"{",
"if",
"(",
"!",
"$",
"auth",
"->",
"isValid",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"guestRole",
";",
"}",
"$",
"data",
"=",
"$",
"auth",
"->",
"getUserDat... | Get Role from Auth
@param AuraAuth $auth Auth object
@return string
@access protected | [
"Get",
"Role",
"from",
"Auth"
] | f4fafaf47f320254a0820a7f6088ce0581f1ca53 | https://github.com/fusible/fusible.authrole/blob/f4fafaf47f320254a0820a7f6088ce0581f1ca53/src/AuthRoleTrait.php#L120-L131 |
7,414 | Dhii/data-container-base | src/CreateContainerExceptionCapableTrait.php | CreateContainerExceptionCapableTrait._createContainerException | protected function _createContainerException(
$message = null,
$code = null,
RootException $previous = null,
BaseContainerInterface $container = null
) {
return new ContainerException($message, $code, $previous, $container);
} | php | protected function _createContainerException(
$message = null,
$code = null,
RootException $previous = null,
BaseContainerInterface $container = null
) {
return new ContainerException($message, $code, $previous, $container);
} | [
"protected",
"function",
"_createContainerException",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"code",
"=",
"null",
",",
"RootException",
"$",
"previous",
"=",
"null",
",",
"BaseContainerInterface",
"$",
"container",
"=",
"null",
")",
"{",
"return",
"new",
... | Creates a new container exception.
@param string|Stringable|null $message The exception message, if any.
@param int|string|Stringable|null $code The numeric exception code, if any.
@param RootException|null $previous The inner exception, if any.
@param BaseContainerInterface|null $container The ... | [
"Creates",
"a",
"new",
"container",
"exception",
"."
] | ed3289171827cdc910d74c5ef76aab5f5985dace | https://github.com/Dhii/data-container-base/blob/ed3289171827cdc910d74c5ef76aab5f5985dace/src/CreateContainerExceptionCapableTrait.php#L24-L31 |
7,415 | lucidphp/xml | src/Parser.php | Parser.getPhpValue | public static function getPhpValue($val, $default = null, ParserInterface $parser = null)
{
if ($val instanceof DOMElement) {
$parser = $parser ?: new static;
return $parser->parseDomElement($val);
}
if (0 === strlen($val)) {
return $default;
}
... | php | public static function getPhpValue($val, $default = null, ParserInterface $parser = null)
{
if ($val instanceof DOMElement) {
$parser = $parser ?: new static;
return $parser->parseDomElement($val);
}
if (0 === strlen($val)) {
return $default;
}
... | [
"public",
"static",
"function",
"getPhpValue",
"(",
"$",
"val",
",",
"$",
"default",
"=",
"null",
",",
"ParserInterface",
"$",
"parser",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"val",
"instanceof",
"DOMElement",
")",
"{",
"$",
"parser",
"=",
"$",
"parse... | Get the php equivalent of an input value derived from any king of xml.
@param mixed $val
@param mixed $default
@param ParserInterface $parser
@return mixed | [
"Get",
"the",
"php",
"equivalent",
"of",
"an",
"input",
"value",
"derived",
"from",
"any",
"king",
"of",
"xml",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L238-L263 |
7,416 | lucidphp/xml | src/Parser.php | Parser.getElementText | public static function getElementText(DOMElement $element, $concat = true)
{
$textNodes = [];
foreach ($element->xpath('./text()') as $text) {
if ($value = static::clearValue($text->nodeValue)) {
$textNodes[] = $value;
}
}
return $concat ? imp... | php | public static function getElementText(DOMElement $element, $concat = true)
{
$textNodes = [];
foreach ($element->xpath('./text()') as $text) {
if ($value = static::clearValue($text->nodeValue)) {
$textNodes[] = $value;
}
}
return $concat ? imp... | [
"public",
"static",
"function",
"getElementText",
"(",
"DOMElement",
"$",
"element",
",",
"$",
"concat",
"=",
"true",
")",
"{",
"$",
"textNodes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"element",
"->",
"xpath",
"(",
"'./text()'",
")",
"as",
"$",
"tex... | Get the text of a `DOMElement` excluding the contents
of its child elements.
@param DOMElement $element
@param bool $concat
@return string|array returns an array of strings if `$concat` is `false` | [
"Get",
"the",
"text",
"of",
"a",
"DOMElement",
"excluding",
"the",
"contents",
"of",
"its",
"child",
"elements",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L274-L284 |
7,417 | lucidphp/xml | src/Parser.php | Parser.isListKey | protected function isListKey($name, $prefix = null)
{
return $this->prefixKey($this->getIndexKey(), $prefix) === $name;
} | php | protected function isListKey($name, $prefix = null)
{
return $this->prefixKey($this->getIndexKey(), $prefix) === $name;
} | [
"protected",
"function",
"isListKey",
"(",
"$",
"name",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"prefixKey",
"(",
"$",
"this",
"->",
"getIndexKey",
"(",
")",
",",
"$",
"prefix",
")",
"===",
"$",
"name",
";",
"}"
] | Check if a given string is the list identifier.
@param string $name
@param string $prefix
@return bool | [
"Check",
"if",
"a",
"given",
"string",
"is",
"the",
"list",
"identifier",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L318-L321 |
7,418 | lucidphp/xml | src/Parser.php | Parser.normalizeKey | protected function normalizeKey($key)
{
if (null !== $this->keyNormalizer) {
return call_user_func($this->keyNormalizer, $key);
}
return static::fixNodeName($key);
} | php | protected function normalizeKey($key)
{
if (null !== $this->keyNormalizer) {
return call_user_func($this->keyNormalizer, $key);
}
return static::fixNodeName($key);
} | [
"protected",
"function",
"normalizeKey",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"keyNormalizer",
")",
"{",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"keyNormalizer",
",",
"$",
"key",
")",
";",
"}",
"return",
"... | Normalize a node key
@param mixed $key
@return mixed | [
"Normalize",
"a",
"node",
"key"
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L356-L363 |
7,419 | lucidphp/xml | src/Parser.php | Parser.prepareTextValue | private function prepareTextValue(DOMElement $xml, array $attributes = null)
{
$text = static::getElementText($xml, true);
return (isset($attributes['type']) && 'text' === $attributes['type']) ?
static::clearValue($text) :
static::getPhpValue($text, null, $this);
} | php | private function prepareTextValue(DOMElement $xml, array $attributes = null)
{
$text = static::getElementText($xml, true);
return (isset($attributes['type']) && 'text' === $attributes['type']) ?
static::clearValue($text) :
static::getPhpValue($text, null, $this);
} | [
"private",
"function",
"prepareTextValue",
"(",
"DOMElement",
"$",
"xml",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"$",
"text",
"=",
"static",
"::",
"getElementText",
"(",
"$",
"xml",
",",
"true",
")",
";",
"return",
"(",
"isset",
"(",
"... | Convert bool like and numeric values to their php equivalent values.
@param DOMElement $xml the element to get the value from
@param array $attributes
@return mixed | [
"Convert",
"bool",
"like",
"and",
"numeric",
"values",
"to",
"their",
"php",
"equivalent",
"values",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L372-L379 |
7,420 | lucidphp/xml | src/Parser.php | Parser.parseElementNodes | private function parseElementNodes($children, $parentName = null)
{
$result = [];
foreach ($children as $child) {
$prefix = $child->prefix ?: null;
$oname = $this->normalizeKey($child->nodeName);
$name = $this->prefixKey($oname, $prefix);
if (isse... | php | private function parseElementNodes($children, $parentName = null)
{
$result = [];
foreach ($children as $child) {
$prefix = $child->prefix ?: null;
$oname = $this->normalizeKey($child->nodeName);
$name = $this->prefixKey($oname, $prefix);
if (isse... | [
"private",
"function",
"parseElementNodes",
"(",
"$",
"children",
",",
"$",
"parentName",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"children",
"as",
"$",
"child",
")",
"{",
"$",
"prefix",
"=",
"$",
"child",
"->",... | Parse a nodelist into a array
@param \DOMNodeList|array $children elements to parse
@param string $parentName node name of the parent element
@return array | [
"Parse",
"a",
"nodelist",
"into",
"a",
"array"
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L389-L407 |
7,421 | lucidphp/xml | src/Parser.php | Parser.parseSetResultNodes | private function parseSetResultNodes(DOMElement $child, $name, array &$result = null)
{
if (!(is_array($result[$name]) && $this->valueIsList($result[$name]))) {
return false;
}
$value = static::getPhpValue($child, null, $this);
if (is_array($value) && $this->valueIsList... | php | private function parseSetResultNodes(DOMElement $child, $name, array &$result = null)
{
if (!(is_array($result[$name]) && $this->valueIsList($result[$name]))) {
return false;
}
$value = static::getPhpValue($child, null, $this);
if (is_array($value) && $this->valueIsList... | [
"private",
"function",
"parseSetResultNodes",
"(",
"DOMElement",
"$",
"child",
",",
"$",
"name",
",",
"array",
"&",
"$",
"result",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"is_array",
"(",
"$",
"result",
"[",
"$",
"name",
"]",
")",
"&&",
"$",
"t... | Parse a `DOMElement` if a result key is set.
@param DOMElement $child
@param string $name
@param array $result
@return mixed|bool the result, else `false` if no result. | [
"Parse",
"a",
"DOMElement",
"if",
"a",
"result",
"key",
"is",
"set",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L418-L431 |
7,422 | lucidphp/xml | src/Parser.php | Parser.parseUnsetResultNodes | private function parseUnsetResultNodes(DOMElement $child, $name, $oname, $pName, array &$result, $prefix = null)
{
if ($this->isListKey($name, $prefix) || $this->isEqualOrPluralOf($this->normalizeKey($pName), $oname)) {
// if attributes index is set, use it as index
if (($index = $ch... | php | private function parseUnsetResultNodes(DOMElement $child, $name, $oname, $pName, array &$result, $prefix = null)
{
if ($this->isListKey($name, $prefix) || $this->isEqualOrPluralOf($this->normalizeKey($pName), $oname)) {
// if attributes index is set, use it as index
if (($index = $ch... | [
"private",
"function",
"parseUnsetResultNodes",
"(",
"DOMElement",
"$",
"child",
",",
"$",
"name",
",",
"$",
"oname",
",",
"$",
"pName",
",",
"array",
"&",
"$",
"result",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLis... | Parse a `DOMElement` if a result key is unset.
@param DOMElement $child
@param string $name
@param string $oname
@param string $pName
@param array $result
@param string $prefix
@param array $attrs
@return mixed the result | [
"Parse",
"a",
"DOMElement",
"if",
"a",
"result",
"key",
"is",
"unset",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L446-L466 |
7,423 | lucidphp/xml | src/Parser.php | Parser.parseElementAttributes | private function parseElementAttributes(DOMElement $xml)
{
$attrs = [];
$elementAttrs = $xml->xpath('./@*');
if (0 === $elementAttrs->length) {
return $attrs;
}
foreach ($elementAttrs as $key => $attribute) {
$value = static::getPhpValue($attr... | php | private function parseElementAttributes(DOMElement $xml)
{
$attrs = [];
$elementAttrs = $xml->xpath('./@*');
if (0 === $elementAttrs->length) {
return $attrs;
}
foreach ($elementAttrs as $key => $attribute) {
$value = static::getPhpValue($attr... | [
"private",
"function",
"parseElementAttributes",
"(",
"DOMElement",
"$",
"xml",
")",
"{",
"$",
"attrs",
"=",
"[",
"]",
";",
"$",
"elementAttrs",
"=",
"$",
"xml",
"->",
"xpath",
"(",
"'./@*'",
")",
";",
"if",
"(",
"0",
"===",
"$",
"elementAttrs",
"->",
... | Parse element attributes into an array.
@param DOMElement $xml
@return array | [
"Parse",
"element",
"attributes",
"into",
"an",
"array",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L475-L491 |
7,424 | lucidphp/xml | src/Parser.php | Parser.isEqualOrPluralOf | private function isEqualOrPluralOf($name, $singular)
{
return 0 === strnatcmp($name, $singular) || 0 === strnatcmp($name, $this->pluralize($singular));
} | php | private function isEqualOrPluralOf($name, $singular)
{
return 0 === strnatcmp($name, $singular) || 0 === strnatcmp($name, $this->pluralize($singular));
} | [
"private",
"function",
"isEqualOrPluralOf",
"(",
"$",
"name",
",",
"$",
"singular",
")",
"{",
"return",
"0",
"===",
"strnatcmp",
"(",
"$",
"name",
",",
"$",
"singular",
")",
"||",
"0",
"===",
"strnatcmp",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"pl... | Check if the input string is a plural or equal to a given comparative string.
@param string $name the input string
@param string $singular the string to compare with
@return bool | [
"Check",
"if",
"the",
"input",
"string",
"is",
"a",
"plural",
"or",
"equal",
"to",
"a",
"given",
"comparative",
"string",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L501-L504 |
7,425 | lucidphp/xml | src/Parser.php | Parser.pluralize | private function pluralize($singular)
{
if (null === $this->pluralizer) {
return $singular;
}
return call_user_func($this->pluralizer, $singular);
} | php | private function pluralize($singular)
{
if (null === $this->pluralizer) {
return $singular;
}
return call_user_func($this->pluralizer, $singular);
} | [
"private",
"function",
"pluralize",
"(",
"$",
"singular",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pluralizer",
")",
"{",
"return",
"$",
"singular",
";",
"}",
"return",
"call_user_func",
"(",
"$",
"this",
"->",
"pluralizer",
",",
"$",
"s... | Attempt to pluralize a string.
@param string $singular
@return string | [
"Attempt",
"to",
"pluralize",
"a",
"string",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L513-L520 |
7,426 | lucidphp/xml | src/Parser.php | Parser.getEqualNodes | private function getEqualNodes(DOMElement $node, $prefix = null)
{
$name = $this->prefixKey($node->nodeName, $prefix);
return $node->xpath(
sprintf(".|following-sibling::*[name() = '%s']|preceding-sibling::*[name() = '%s']", $name, $name)
);
} | php | private function getEqualNodes(DOMElement $node, $prefix = null)
{
$name = $this->prefixKey($node->nodeName, $prefix);
return $node->xpath(
sprintf(".|following-sibling::*[name() = '%s']|preceding-sibling::*[name() = '%s']", $name, $name)
);
} | [
"private",
"function",
"getEqualNodes",
"(",
"DOMElement",
"$",
"node",
",",
"$",
"prefix",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"prefixKey",
"(",
"$",
"node",
"->",
"nodeName",
",",
"$",
"prefix",
")",
";",
"return",
"$",
"nod... | A lookahead to find sibling elements with similar names.
@param DOMElement $node the node in charge.
@param string $prefix the element prefix
@return \DOMNodeList | [
"A",
"lookahead",
"to",
"find",
"sibling",
"elements",
"with",
"similar",
"names",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L530-L537 |
7,427 | lucidphp/xml | src/Parser.php | Parser.convertDocument | private function convertDocument(\DOMDocument $xml)
{
return $this->loader->load($xml->saveXML(), [LoaderInterface::FROM_STRING => true]);
} | php | private function convertDocument(\DOMDocument $xml)
{
return $this->loader->load($xml->saveXML(), [LoaderInterface::FROM_STRING => true]);
} | [
"private",
"function",
"convertDocument",
"(",
"\\",
"DOMDocument",
"$",
"xml",
")",
"{",
"return",
"$",
"this",
"->",
"loader",
"->",
"load",
"(",
"$",
"xml",
"->",
"saveXML",
"(",
")",
",",
"[",
"LoaderInterface",
"::",
"FROM_STRING",
"=>",
"true",
"]"... | Converts a `\DOMDocument`that is not an instance of
`Selene\Module\Dom\DOMDocument`.
@param \DOMDocument $xml the document to convert
@return DOMDocument | [
"Converts",
"a",
"\\",
"DOMDocument",
"that",
"is",
"not",
"an",
"instance",
"of",
"Selene",
"\\",
"Module",
"\\",
"Dom",
"\\",
"DOMDocument",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Parser.php#L562-L565 |
7,428 | mlocati/composer-patcher | src/PatchExecutor/PatchPatcher.php | PatchPatcher.patchIsAlreadyApplied | public function patchIsAlreadyApplied(Patch $patch, $baseDirectory, $patchLevel)
{
$command = $this->buildCommand($patch->getLocalPath(), $baseDirectory, $patchLevel, true);
list($rc, $stdOut, $stdErr) = $this->run($command);
if ($stdErr === '') {
$stdErr = $stdOut;
}
... | php | public function patchIsAlreadyApplied(Patch $patch, $baseDirectory, $patchLevel)
{
$command = $this->buildCommand($patch->getLocalPath(), $baseDirectory, $patchLevel, true);
list($rc, $stdOut, $stdErr) = $this->run($command);
if ($stdErr === '') {
$stdErr = $stdOut;
}
... | [
"public",
"function",
"patchIsAlreadyApplied",
"(",
"Patch",
"$",
"patch",
",",
"$",
"baseDirectory",
",",
"$",
"patchLevel",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"buildCommand",
"(",
"$",
"patch",
"->",
"getLocalPath",
"(",
")",
",",
"$",
"... | Check if a patch is already applied.
@param \ComposerPatcher\Patch $patch the patch to be analyzed
@param string $baseDirectory the directory where the patch should be applied
@param string $patchLevel the patch level
@return bool | [
"Check",
"if",
"a",
"patch",
"is",
"already",
"applied",
"."
] | d8ba45c10b5cf8ac8da3591e09b6afd47fc10667 | https://github.com/mlocati/composer-patcher/blob/d8ba45c10b5cf8ac8da3591e09b6afd47fc10667/src/PatchExecutor/PatchPatcher.php#L57-L69 |
7,429 | mlocati/composer-patcher | src/PatchExecutor/PatchPatcher.php | PatchPatcher.initializeWindows | private function initializeWindows()
{
$gitFolder = $this->findWindowsGitFolder();
if ($gitFolder !== '') {
$patchPath = "{$gitFolder}\\usr\\bin\\patch.exe";
if (is_file($patchPath)) {
try {
$patchPath = escapeshellarg($patchPath);
... | php | private function initializeWindows()
{
$gitFolder = $this->findWindowsGitFolder();
if ($gitFolder !== '') {
$patchPath = "{$gitFolder}\\usr\\bin\\patch.exe";
if (is_file($patchPath)) {
try {
$patchPath = escapeshellarg($patchPath);
... | [
"private",
"function",
"initializeWindows",
"(",
")",
"{",
"$",
"gitFolder",
"=",
"$",
"this",
"->",
"findWindowsGitFolder",
"(",
")",
";",
"if",
"(",
"$",
"gitFolder",
"!==",
"''",
")",
"{",
"$",
"patchPath",
"=",
"\"{$gitFolder}\\\\usr\\\\bin\\\\patch.exe\"",
... | Configure the instance for Windows.
@throws \ComposerPatcher\Exception\CommandNotFound when the patch command is not available | [
"Configure",
"the",
"instance",
"for",
"Windows",
"."
] | d8ba45c10b5cf8ac8da3591e09b6afd47fc10667 | https://github.com/mlocati/composer-patcher/blob/d8ba45c10b5cf8ac8da3591e09b6afd47fc10667/src/PatchExecutor/PatchPatcher.php#L108-L138 |
7,430 | mlocati/composer-patcher | src/PatchExecutor/PatchPatcher.php | PatchPatcher.findWindowsGitFolder | private function findWindowsGitFolder()
{
list($rc, $stdOut) = $this->run('where git.exe');
if ($rc !== 0) {
return '';
}
$stdOut = str_replace("\r\n", "\n", $stdOut);
foreach (explode("\n", trim($stdOut)) as $path) {
$easierPath = str_replace('\\', '/... | php | private function findWindowsGitFolder()
{
list($rc, $stdOut) = $this->run('where git.exe');
if ($rc !== 0) {
return '';
}
$stdOut = str_replace("\r\n", "\n", $stdOut);
foreach (explode("\n", trim($stdOut)) as $path) {
$easierPath = str_replace('\\', '/... | [
"private",
"function",
"findWindowsGitFolder",
"(",
")",
"{",
"list",
"(",
"$",
"rc",
",",
"$",
"stdOut",
")",
"=",
"$",
"this",
"->",
"run",
"(",
"'where git.exe'",
")",
";",
"if",
"(",
"$",
"rc",
"!==",
"0",
")",
"{",
"return",
"''",
";",
"}",
... | Search the path where git is installed on Windows.
@return string Empty string if not found | [
"Search",
"the",
"path",
"where",
"git",
"is",
"installed",
"on",
"Windows",
"."
] | d8ba45c10b5cf8ac8da3591e09b6afd47fc10667 | https://github.com/mlocati/composer-patcher/blob/d8ba45c10b5cf8ac8da3591e09b6afd47fc10667/src/PatchExecutor/PatchPatcher.php#L145-L161 |
7,431 | d1maz/simple_pdo | src/WrapperPDO.php | WrapperPDO.getHits | public function getHits()
{
if ($this->hits === null) {
$this->hits = $this->stmt->rowCount();
}
return $this->hits;
} | php | public function getHits()
{
if ($this->hits === null) {
$this->hits = $this->stmt->rowCount();
}
return $this->hits;
} | [
"public",
"function",
"getHits",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hits",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"hits",
"=",
"$",
"this",
"->",
"stmt",
"->",
"rowCount",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"hits",
... | Get number of results.
@api
@return int | [
"Get",
"number",
"of",
"results",
"."
] | 58943ca8140267d98f3a2342efaca1497ca25b8b | https://github.com/d1maz/simple_pdo/blob/58943ca8140267d98f3a2342efaca1497ca25b8b/src/WrapperPDO.php#L131-L138 |
7,432 | d1maz/simple_pdo | src/WrapperPDO.php | WrapperPDO.getResults | public function getResults()
{
if (empty($this->results)) {
$this->results = $this->stmt->fetchAll();
}
return $this->results;
} | php | public function getResults()
{
if (empty($this->results)) {
$this->results = $this->stmt->fetchAll();
}
return $this->results;
} | [
"public",
"function",
"getResults",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"results",
")",
")",
"{",
"$",
"this",
"->",
"results",
"=",
"$",
"this",
"->",
"stmt",
"->",
"fetchAll",
"(",
")",
";",
"}",
"return",
"$",
"this",
"-... | Get all results from the SELECT-Statement.
@api
@return mixed[] | [
"Get",
"all",
"results",
"from",
"the",
"SELECT",
"-",
"Statement",
"."
] | 58943ca8140267d98f3a2342efaca1497ca25b8b | https://github.com/d1maz/simple_pdo/blob/58943ca8140267d98f3a2342efaca1497ca25b8b/src/WrapperPDO.php#L146-L153 |
7,433 | d1maz/simple_pdo | src/WrapperPDO.php | WrapperPDO.getFirstResult | public function getFirstResult($field = null)
{
if (empty($this->results)) {
$this->results = isset($field) ? $this->stmt->fetch()[$field] : $this->stmt->fetch();
}
return $this->results;
} | php | public function getFirstResult($field = null)
{
if (empty($this->results)) {
$this->results = isset($field) ? $this->stmt->fetch()[$field] : $this->stmt->fetch();
}
return $this->results;
} | [
"public",
"function",
"getFirstResult",
"(",
"$",
"field",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"results",
")",
")",
"{",
"$",
"this",
"->",
"results",
"=",
"isset",
"(",
"$",
"field",
")",
"?",
"$",
"this",
"->",
"s... | Get the first result from the SELECT-Statement.
@api
@param string $field
@return mixed | [
"Get",
"the",
"first",
"result",
"from",
"the",
"SELECT",
"-",
"Statement",
"."
] | 58943ca8140267d98f3a2342efaca1497ca25b8b | https://github.com/d1maz/simple_pdo/blob/58943ca8140267d98f3a2342efaca1497ca25b8b/src/WrapperPDO.php#L164-L171 |
7,434 | traq/installer | src/Controllers/Checks.php | Checks.licenseAgreementAction | public function licenseAgreementAction()
{
$this->title("License Agreement");
// Get license
$license = file_get_contents(dirname(dirname(__DIR__)) . '/COPYING');
$this->set("license", $license);
return $this->render("license_agreement.phtml");
} | php | public function licenseAgreementAction()
{
$this->title("License Agreement");
// Get license
$license = file_get_contents(dirname(dirname(__DIR__)) . '/COPYING');
$this->set("license", $license);
return $this->render("license_agreement.phtml");
} | [
"public",
"function",
"licenseAgreementAction",
"(",
")",
"{",
"$",
"this",
"->",
"title",
"(",
"\"License Agreement\"",
")",
";",
"// Get license",
"$",
"license",
"=",
"file_get_contents",
"(",
"dirname",
"(",
"dirname",
"(",
"__DIR__",
")",
")",
".",
"'/COP... | License agreement page. | [
"License",
"agreement",
"page",
"."
] | 7d82ee13d11c59cb63bcb7739962c85a994271ef | https://github.com/traq/installer/blob/7d82ee13d11c59cb63bcb7739962c85a994271ef/src/Controllers/Checks.php#L35-L44 |
7,435 | andela-womokoro/potato-orm | src/Base.php | Base.findByPosition | public static function findByPosition($position)
{
try {
$offset = $position - 1;
$tableName = self::getTableName();
$conn = self::getConnection();
$stmt = $conn->query('SELECT * FROM '.$tableName.' LIMIT '.$offset.', 1'); //mysql syntax
if(! $stm... | php | public static function findByPosition($position)
{
try {
$offset = $position - 1;
$tableName = self::getTableName();
$conn = self::getConnection();
$stmt = $conn->query('SELECT * FROM '.$tableName.' LIMIT '.$offset.', 1'); //mysql syntax
if(! $stm... | [
"public",
"static",
"function",
"findByPosition",
"(",
"$",
"position",
")",
"{",
"try",
"{",
"$",
"offset",
"=",
"$",
"position",
"-",
"1",
";",
"$",
"tableName",
"=",
"self",
"::",
"getTableName",
"(",
")",
";",
"$",
"conn",
"=",
"self",
"::",
"get... | Finds a record in the database table in the position denoted by the parameter passed
@param integer $position | [
"Finds",
"a",
"record",
"in",
"the",
"database",
"table",
"in",
"the",
"position",
"denoted",
"by",
"the",
"parameter",
"passed"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L46-L66 |
7,436 | andela-womokoro/potato-orm | src/Base.php | Base.findById | public static function findById($id)
{
try {
$tableName = self::getTableName();
$conn = self::getConnection();
$stmt = $conn->query('SELECT * FROM '.$tableName.' WHERE id='.$id);
return self::find($stmt);
}
catch(PDOException $pe) {
... | php | public static function findById($id)
{
try {
$tableName = self::getTableName();
$conn = self::getConnection();
$stmt = $conn->query('SELECT * FROM '.$tableName.' WHERE id='.$id);
return self::find($stmt);
}
catch(PDOException $pe) {
... | [
"public",
"static",
"function",
"findById",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"tableName",
"=",
"self",
"::",
"getTableName",
"(",
")",
";",
"$",
"conn",
"=",
"self",
"::",
"getConnection",
"(",
")",
";",
"$",
"stmt",
"=",
"$",
"conn",
"->... | Finds a record in the database table that has the id passed in as a parameter
@param integer $id | [
"Finds",
"a",
"record",
"in",
"the",
"database",
"table",
"that",
"has",
"the",
"id",
"passed",
"in",
"as",
"a",
"parameter"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L72-L88 |
7,437 | andela-womokoro/potato-orm | src/Base.php | Base.find | public static function find($stmt)
{
try {
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if(! $result) {
throw new Exception(" Record not found.");
}
$object = new static;
$object->id = $result['id'];
$object->result = jso... | php | public static function find($stmt)
{
try {
$result = $stmt->fetch(PDO::FETCH_ASSOC);
if(! $result) {
throw new Exception(" Record not found.");
}
$object = new static;
$object->id = $result['id'];
$object->result = jso... | [
"public",
"static",
"function",
"find",
"(",
"$",
"stmt",
")",
"{",
"try",
"{",
"$",
"result",
"=",
"$",
"stmt",
"->",
"fetch",
"(",
"PDO",
"::",
"FETCH_ASSOC",
")",
";",
"if",
"(",
"!",
"$",
"result",
")",
"{",
"throw",
"new",
"Exception",
"(",
... | Finds a record in the database using the statement object passed in
@param PDO statement $stmt | [
"Finds",
"a",
"record",
"in",
"the",
"database",
"using",
"the",
"statement",
"object",
"passed",
"in"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L94-L114 |
7,438 | andela-womokoro/potato-orm | src/Base.php | Base.getAll | public static function getAll()
{
try {
$tableName = self::getTableName();
$conn = self::getConnection();
$stmt = $conn->query('SELECT * FROM '.$tableName);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
catch(PDOException $pe) {
ret... | php | public static function getAll()
{
try {
$tableName = self::getTableName();
$conn = self::getConnection();
$stmt = $conn->query('SELECT * FROM '.$tableName);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
}
catch(PDOException $pe) {
ret... | [
"public",
"static",
"function",
"getAll",
"(",
")",
"{",
"try",
"{",
"$",
"tableName",
"=",
"self",
"::",
"getTableName",
"(",
")",
";",
"$",
"conn",
"=",
"self",
"::",
"getConnection",
"(",
")",
";",
"$",
"stmt",
"=",
"$",
"conn",
"->",
"query",
"... | This method fetches all the records in the database table and returns them in an array | [
"This",
"method",
"fetches",
"all",
"the",
"records",
"in",
"the",
"database",
"table",
"and",
"returns",
"them",
"in",
"an",
"array"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L119-L135 |
7,439 | andela-womokoro/potato-orm | src/Base.php | Base.save | public static function save()
{
try {
$tableName = self::getTableName();
$affectedRows = 0;
$conn = self::getConnection();
if(array_key_exists("id", self::$fields)){
//update an existing record
$sql = self::makeUpdateSQL();
... | php | public static function save()
{
try {
$tableName = self::getTableName();
$affectedRows = 0;
$conn = self::getConnection();
if(array_key_exists("id", self::$fields)){
//update an existing record
$sql = self::makeUpdateSQL();
... | [
"public",
"static",
"function",
"save",
"(",
")",
"{",
"try",
"{",
"$",
"tableName",
"=",
"self",
"::",
"getTableName",
"(",
")",
";",
"$",
"affectedRows",
"=",
"0",
";",
"$",
"conn",
"=",
"self",
"::",
"getConnection",
"(",
")",
";",
"if",
"(",
"a... | This method inserts a new record into the database table or updates an already existing record | [
"This",
"method",
"inserts",
"a",
"new",
"record",
"into",
"the",
"database",
"table",
"or",
"updates",
"an",
"already",
"existing",
"record"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L140-L168 |
7,440 | andela-womokoro/potato-orm | src/Base.php | Base.makeUpdateSQL | public static function makeUpdateSQL()
{
$tableName = self::getTableName();
$setClause = "";
$whereClause = "";
$keysCount = count(self::$fields);
$iterations = 1;
foreach(self::$fields as $key => $val)
{
if($key == "id") {
$whereC... | php | public static function makeUpdateSQL()
{
$tableName = self::getTableName();
$setClause = "";
$whereClause = "";
$keysCount = count(self::$fields);
$iterations = 1;
foreach(self::$fields as $key => $val)
{
if($key == "id") {
$whereC... | [
"public",
"static",
"function",
"makeUpdateSQL",
"(",
")",
"{",
"$",
"tableName",
"=",
"self",
"::",
"getTableName",
"(",
")",
";",
"$",
"setClause",
"=",
"\"\"",
";",
"$",
"whereClause",
"=",
"\"\"",
";",
"$",
"keysCount",
"=",
"count",
"(",
"self",
"... | This method generates the SQL statement used to update a record in the database | [
"This",
"method",
"generates",
"the",
"SQL",
"statement",
"used",
"to",
"update",
"a",
"record",
"in",
"the",
"database"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L173-L199 |
7,441 | andela-womokoro/potato-orm | src/Base.php | Base.destroy | public static function destroy($record)
{
if(is_string($record)) {
return $record;
}
$id = $record->id;
try {
$tableName = self::getTableName();
$conn = self::getConnection();
$sql = "DELETE FROM ".$tableName ." WHERE id = ".$id;
... | php | public static function destroy($record)
{
if(is_string($record)) {
return $record;
}
$id = $record->id;
try {
$tableName = self::getTableName();
$conn = self::getConnection();
$sql = "DELETE FROM ".$tableName ." WHERE id = ".$id;
... | [
"public",
"static",
"function",
"destroy",
"(",
"$",
"record",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"record",
")",
")",
"{",
"return",
"$",
"record",
";",
"}",
"$",
"id",
"=",
"$",
"record",
"->",
"id",
";",
"try",
"{",
"$",
"tableName",
"... | This method deletes a record from the database table
@param integer $position | [
"This",
"method",
"deletes",
"a",
"record",
"from",
"the",
"database",
"table"
] | b8e8757fa8e520efdd61583c2ba489bc76f291ae | https://github.com/andela-womokoro/potato-orm/blob/b8e8757fa8e520efdd61583c2ba489bc76f291ae/src/Base.php#L227-L249 |
7,442 | gregorybesson/PlaygroundPartnership | src/Service/Partner.php | Partner.verifyProtocol | public function verifyProtocol($url, $append = 'http://')
{
if (strpos($url, 'http://') === false && strpos($url, 'https://') === false) {
$url = $append.$url;
}
return $url;
} | php | public function verifyProtocol($url, $append = 'http://')
{
if (strpos($url, 'http://') === false && strpos($url, 'https://') === false) {
$url = $append.$url;
}
return $url;
} | [
"public",
"function",
"verifyProtocol",
"(",
"$",
"url",
",",
"$",
"append",
"=",
"'http://'",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"url",
",",
"'http://'",
")",
"===",
"false",
"&&",
"strpos",
"(",
"$",
"url",
",",
"'https://'",
")",
"===",
"fal... | Add protocol to an url if missing
@param url
@param append
@return string | [
"Add",
"protocol",
"to",
"an",
"url",
"if",
"missing"
] | f08f92ded3335726b87bed19cebb5fbf05eec696 | https://github.com/gregorybesson/PlaygroundPartnership/blob/f08f92ded3335726b87bed19cebb5fbf05eec696/src/Service/Partner.php#L295-L302 |
7,443 | factorio-item-browser/api-database | src/Entity/RecipeIngredient.php | RecipeIngredient.setAmount | public function setAmount(float $amount): self
{
$this->amount = (int) ($amount * self::FACTOR_AMOUNT);
return $this;
} | php | public function setAmount(float $amount): self
{
$this->amount = (int) ($amount * self::FACTOR_AMOUNT);
return $this;
} | [
"public",
"function",
"setAmount",
"(",
"float",
"$",
"amount",
")",
":",
"self",
"{",
"$",
"this",
"->",
"amount",
"=",
"(",
"int",
")",
"(",
"$",
"amount",
"*",
"self",
"::",
"FACTOR_AMOUNT",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the amount required for the recipe.
@param float $amount
@return $this Implementing fluent interface. | [
"Sets",
"the",
"amount",
"required",
"for",
"the",
"recipe",
"."
] | c3a27e5673462a58b5afafc0ea0e0002f6db9803 | https://github.com/factorio-item-browser/api-database/blob/c3a27e5673462a58b5afafc0ea0e0002f6db9803/src/Entity/RecipeIngredient.php#L100-L104 |
7,444 | ddliu/requery | src/ContextCollection.php | ContextCollection.find | public function find($re, $filter = null) {
$result = null;
$this->each(function($context) use ($re, $filter, &$result) {
$r = $context->find($re, $filter);
if (!$r->isEmpty()) {
$result = $r;
return false;
}
});
return... | php | public function find($re, $filter = null) {
$result = null;
$this->each(function($context) use ($re, $filter, &$result) {
$r = $context->find($re, $filter);
if (!$r->isEmpty()) {
$result = $r;
return false;
}
});
return... | [
"public",
"function",
"find",
"(",
"$",
"re",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"this",
"->",
"each",
"(",
"function",
"(",
"$",
"context",
")",
"use",
"(",
"$",
"re",
",",
"$",
"filter",
",",
"&",... | Find the first matching context in the collection
@param string $re
@param callable $filter
@return Context | [
"Find",
"the",
"first",
"matching",
"context",
"in",
"the",
"collection"
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/ContextCollection.php#L39-L50 |
7,445 | ddliu/requery | src/ContextCollection.php | ContextCollection.mustFind | public function mustFind($re, $filter = null) {
$result = $this->find($re, $filter);
if ($result->isEmpty()) {
throw new QueryException('No match for regexp: '.$re);
}
return $result;
} | php | public function mustFind($re, $filter = null) {
$result = $this->find($re, $filter);
if ($result->isEmpty()) {
throw new QueryException('No match for regexp: '.$re);
}
return $result;
} | [
"public",
"function",
"mustFind",
"(",
"$",
"re",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"re",
",",
"$",
"filter",
")",
";",
"if",
"(",
"$",
"result",
"->",
"isEmpty",
"(",
")",
")",
... | Find with assertion
@param string $re
@param callable $filter
@return Context
@throws QueryException If nothing found. | [
"Find",
"with",
"assertion"
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/ContextCollection.php#L59-L66 |
7,446 | ddliu/requery | src/ContextCollection.php | ContextCollection.findAll | public function findAll($re, $filter = null) {
$result = array();
$this->each(function($context) use ($re, $filter, &$result) {
$context->findAll($re, $filter)->each(
function($context) use (&$result) {
$result[] = $context;
}
)... | php | public function findAll($re, $filter = null) {
$result = array();
$this->each(function($context) use ($re, $filter, &$result) {
$context->findAll($re, $filter)->each(
function($context) use (&$result) {
$result[] = $context;
}
)... | [
"public",
"function",
"findAll",
"(",
"$",
"re",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"each",
"(",
"function",
"(",
"$",
"context",
")",
"use",
"(",
"$",
"re",
",",
"$",
"filt... | Find all matching contexts in the collection
@param string $re
@param callable $filter
@return ContextCollection | [
"Find",
"all",
"matching",
"contexts",
"in",
"the",
"collection"
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/ContextCollection.php#L74-L85 |
7,447 | ddliu/requery | src/ContextCollection.php | ContextCollection.mustFindAll | public function mustFindAll($re, $filter = null) {
$result = $this->findAll($re, $filter);
if ($result->count() == 0) {
throw new QueryException('No match for regexp: '.$re);
}
return $result;
} | php | public function mustFindAll($re, $filter = null) {
$result = $this->findAll($re, $filter);
if ($result->count() == 0) {
throw new QueryException('No match for regexp: '.$re);
}
return $result;
} | [
"public",
"function",
"mustFindAll",
"(",
"$",
"re",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"findAll",
"(",
"$",
"re",
",",
"$",
"filter",
")",
";",
"if",
"(",
"$",
"result",
"->",
"count",
"(",
")",
"... | Find all with assertion
@param string $re
@param callable $filter
@return ContextCollection
@throws QueryException If nothing found. | [
"Find",
"all",
"with",
"assertion"
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/ContextCollection.php#L94-L101 |
7,448 | ddliu/requery | src/ContextCollection.php | ContextCollection.extract | public function extract($parts = null) {
if ($parts === null) {
return $this->data;
}
if (is_array($parts)) {
$result = array();
foreach ($this->data as $match) {
$row = array();
foreach ($parts as $key) {
... | php | public function extract($parts = null) {
if ($parts === null) {
return $this->data;
}
if (is_array($parts)) {
$result = array();
foreach ($this->data as $match) {
$row = array();
foreach ($parts as $key) {
... | [
"public",
"function",
"extract",
"(",
"$",
"parts",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"parts",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"data",
";",
"}",
"if",
"(",
"is_array",
"(",
"$",
"parts",
")",
")",
"{",
"$",
"result",
... | Extract result parts of the collection.
@param mixed $parts
@return mixed | [
"Extract",
"result",
"parts",
"of",
"the",
"collection",
"."
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/ContextCollection.php#L118-L146 |
7,449 | ddliu/requery | src/ContextCollection.php | ContextCollection.each | public function each($cb) {
foreach ($this->data as $context) {
$context = new Context($context);
if (false === $cb($context)) {
break;
}
}
return $this;
} | php | public function each($cb) {
foreach ($this->data as $context) {
$context = new Context($context);
if (false === $cb($context)) {
break;
}
}
return $this;
} | [
"public",
"function",
"each",
"(",
"$",
"cb",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"context",
")",
"{",
"$",
"context",
"=",
"new",
"Context",
"(",
"$",
"context",
")",
";",
"if",
"(",
"false",
"===",
"$",
"cb",
"(",
... | Walk through the collection
@param callable $cb
@return ContextCollection | [
"Walk",
"through",
"the",
"collection"
] | ed1a8d45644965cf464b5eb1eede6ed8236ae6e8 | https://github.com/ddliu/requery/blob/ed1a8d45644965cf464b5eb1eede6ed8236ae6e8/src/ContextCollection.php#L153-L163 |
7,450 | spiral/validation | src/Checker/FileChecker.php | FileChecker.size | public function size($file, int $size): bool
{
if (empty($filename = $this->resolveFilename($file))) {
return false;
}
return $this->files->size($filename) <= ($size * 1024);
} | php | public function size($file, int $size): bool
{
if (empty($filename = $this->resolveFilename($file))) {
return false;
}
return $this->files->size($filename) <= ($size * 1024);
} | [
"public",
"function",
"size",
"(",
"$",
"file",
",",
"int",
"$",
"size",
")",
":",
"bool",
"{",
"if",
"(",
"empty",
"(",
"$",
"filename",
"=",
"$",
"this",
"->",
"resolveFilename",
"(",
"$",
"file",
")",
")",
")",
"{",
"return",
"false",
";",
"}"... | Check if file size less that specified value in KB.
@param mixed $file Local file or uploaded file array.
@param int $size Size in KBytes.
@return bool | [
"Check",
"if",
"file",
"size",
"less",
"that",
"specified",
"value",
"in",
"KB",
"."
] | aa8977dfe93904acfcce354e000d7d384579e2e3 | https://github.com/spiral/validation/blob/aa8977dfe93904acfcce354e000d7d384579e2e3/src/Checker/FileChecker.php#L80-L87 |
7,451 | spiral/validation | src/Checker/FileChecker.php | FileChecker.extension | public function extension($file, $extensions): bool
{
if (!is_array($extensions)) {
$extensions = array_slice(func_get_args(), 1);
}
if ($file instanceof UploadedFileInterface) {
return in_array(
$this->files->extension($file->getClientFilename()),
... | php | public function extension($file, $extensions): bool
{
if (!is_array($extensions)) {
$extensions = array_slice(func_get_args(), 1);
}
if ($file instanceof UploadedFileInterface) {
return in_array(
$this->files->extension($file->getClientFilename()),
... | [
"public",
"function",
"extension",
"(",
"$",
"file",
",",
"$",
"extensions",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"extensions",
")",
")",
"{",
"$",
"extensions",
"=",
"array_slice",
"(",
"func_get_args",
"(",
")",
",",
"1",
")... | Check if file extension in whitelist. Client name of uploaded file will be used!
It is recommended to use external validation like media type based on file mimetype or
ensure that resource is properly converted.
@param mixed $file
@param array|string $extensions
@return bool | [
"Check",
"if",
"file",
"extension",
"in",
"whitelist",
".",
"Client",
"name",
"of",
"uploaded",
"file",
"will",
"be",
"used!",
"It",
"is",
"recommended",
"to",
"use",
"external",
"validation",
"like",
"media",
"type",
"based",
"on",
"file",
"mimetype",
"or",... | aa8977dfe93904acfcce354e000d7d384579e2e3 | https://github.com/spiral/validation/blob/aa8977dfe93904acfcce354e000d7d384579e2e3/src/Checker/FileChecker.php#L99-L113 |
7,452 | synapsestudios/synapse-base | src/Synapse/Validator/ValidationErrorFormatter.php | ValidationErrorFormatter.addViolationToOutput | protected function addViolationToOutput(array $errors, ConstraintViolationInterface $violation)
{
$path = $this->getPropertyPathAsArray($violation);
// Drill into errors and find where the error message should be added, building nonexistent portions of the path
$currentPointer = &$errors;
... | php | protected function addViolationToOutput(array $errors, ConstraintViolationInterface $violation)
{
$path = $this->getPropertyPathAsArray($violation);
// Drill into errors and find where the error message should be added, building nonexistent portions of the path
$currentPointer = &$errors;
... | [
"protected",
"function",
"addViolationToOutput",
"(",
"array",
"$",
"errors",
",",
"ConstraintViolationInterface",
"$",
"violation",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getPropertyPathAsArray",
"(",
"$",
"violation",
")",
";",
"// Drill into errors and f... | Add a single constraint violation to a partially-built array of errors
in the format described in `groupViolationsByField`
@param array $errors Array of errors
@param ConstraintViolationInterface $violation Violation to add | [
"Add",
"a",
"single",
"constraint",
"violation",
"to",
"a",
"partially",
"-",
"built",
"array",
"of",
"errors",
"in",
"the",
"format",
"described",
"in",
"groupViolationsByField"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Validator/ValidationErrorFormatter.php#L65-L96 |
7,453 | synapsestudios/synapse-base | src/Synapse/Validator/ValidationErrorFormatter.php | ValidationErrorFormatter.getPropertyPathAsArray | protected function getPropertyPathAsArray(ConstraintViolationInterface $violation)
{
$path = $violation->getPropertyPath();
// Remove outer brackets and explode fields into array
$path = substr($path, 1, strlen($path) - 2);
return explode('][', $path);
} | php | protected function getPropertyPathAsArray(ConstraintViolationInterface $violation)
{
$path = $violation->getPropertyPath();
// Remove outer brackets and explode fields into array
$path = substr($path, 1, strlen($path) - 2);
return explode('][', $path);
} | [
"protected",
"function",
"getPropertyPathAsArray",
"(",
"ConstraintViolationInterface",
"$",
"violation",
")",
"{",
"$",
"path",
"=",
"$",
"violation",
"->",
"getPropertyPath",
"(",
")",
";",
"// Remove outer brackets and explode fields into array",
"$",
"path",
"=",
"s... | Given a constraint violation, return its property path as an array
Example:
Property path of violation: "[foo][0][bar][baz]"
Return value: array('foo', '0', 'bar', 'baz')
@param ConstraintViolationInterface $violation Violation whose path to return
@return array | [
"Given",
"a",
"constraint",
"violation",
"return",
"its",
"property",
"path",
"as",
"an",
"array"
] | 60c830550491742a077ab063f924e2f0b63825da | https://github.com/synapsestudios/synapse-base/blob/60c830550491742a077ab063f924e2f0b63825da/src/Synapse/Validator/ValidationErrorFormatter.php#L108-L116 |
7,454 | avoo/FrameworkInstallerBundle | Command/InstallCommand.php | InstallCommand.install | protected function install()
{
$this->setupCore();
$this->setupBackend();
$this->initializeDatabase();
$this->runCommand('cache:clear', array('--no-warmup' => true));
} | php | protected function install()
{
$this->setupCore();
$this->setupBackend();
$this->initializeDatabase();
$this->runCommand('cache:clear', array('--no-warmup' => true));
} | [
"protected",
"function",
"install",
"(",
")",
"{",
"$",
"this",
"->",
"setupCore",
"(",
")",
";",
"$",
"this",
"->",
"setupBackend",
"(",
")",
";",
"$",
"this",
"->",
"initializeDatabase",
"(",
")",
";",
"$",
"this",
"->",
"runCommand",
"(",
"'cache:cl... | Install Avoo framework | [
"Install",
"Avoo",
"framework"
] | 402032e01467359b176de19731ebbff744cc52f5 | https://github.com/avoo/FrameworkInstallerBundle/blob/402032e01467359b176de19731ebbff744cc52f5/Command/InstallCommand.php#L65-L71 |
7,455 | avoo/FrameworkInstallerBundle | Command/InstallCommand.php | InstallCommand.isDatabaseExist | private function isDatabaseExist()
{
$databaseName = $this->getContainer()->getParameter('database_name');
try {
/** @var MySqlSchemaManager $schemaManager */
$schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
... | php | private function isDatabaseExist()
{
$databaseName = $this->getContainer()->getParameter('database_name');
try {
/** @var MySqlSchemaManager $schemaManager */
$schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
... | [
"private",
"function",
"isDatabaseExist",
"(",
")",
"{",
"$",
"databaseName",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"getParameter",
"(",
"'database_name'",
")",
";",
"try",
"{",
"/** @var MySqlSchemaManager $schemaManager */",
"$",
"schemaManager",... | Is database exist
@return bool
@throws \Exception | [
"Is",
"database",
"exist"
] | 402032e01467359b176de19731ebbff744cc52f5 | https://github.com/avoo/FrameworkInstallerBundle/blob/402032e01467359b176de19731ebbff744cc52f5/Command/InstallCommand.php#L106-L127 |
7,456 | bfitech/zaplate | src/Template.php | Template.load | public function load($template, $args=[], $filter_args=[], $buffered=null) {
if ($buffered)
ob_start();
if ($filter_args) {
foreach ($filter_args as $filter) {
$args = array_map($filter, $args);
}
}
extract($args, EXTR_SKIP);
require($template);
if ($buffered)
return ob_get_clean();
} | php | public function load($template, $args=[], $filter_args=[], $buffered=null) {
if ($buffered)
ob_start();
if ($filter_args) {
foreach ($filter_args as $filter) {
$args = array_map($filter, $args);
}
}
extract($args, EXTR_SKIP);
require($template);
if ($buffered)
return ob_get_clean();
} | [
"public",
"function",
"load",
"(",
"$",
"template",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"filter_args",
"=",
"[",
"]",
",",
"$",
"buffered",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"buffered",
")",
"ob_start",
"(",
")",
";",
"if",
"(",
"$"... | Template loader.
@param string $template Path to template file, a regular PHP file
containing variables registered in $args.
@param array $args Associative arrays with keys corresponding variables
in the $template. Each element can nest another array. It depends
on the template to render it.
@param array $filter_args ... | [
"Template",
"loader",
"."
] | 0165b262ade42b00e7beba7b94ddad14e0b1ecb1 | https://github.com/bfitech/zaplate/blob/0165b262ade42b00e7beba7b94ddad14e0b1ecb1/src/Template.php#L69-L86 |
7,457 | chigix/chiji-frontend | src/File/AbstractResourceFile.php | AbstractResourceFile.getRelativePath | public function getRelativePath(File $base_dir) {
return FileSystem::getFileSystem()->makePathRelative($this->file->getAbsoluteFile()->getParent(), $base_dir->getAbsolutePath()) . $this->file->getName();
} | php | public function getRelativePath(File $base_dir) {
return FileSystem::getFileSystem()->makePathRelative($this->file->getAbsoluteFile()->getParent(), $base_dir->getAbsolutePath()) . $this->file->getName();
} | [
"public",
"function",
"getRelativePath",
"(",
"File",
"$",
"base_dir",
")",
"{",
"return",
"FileSystem",
"::",
"getFileSystem",
"(",
")",
"->",
"makePathRelative",
"(",
"$",
"this",
"->",
"file",
"->",
"getAbsoluteFile",
"(",
")",
"->",
"getParent",
"(",
")"... | Returns the relative path
@param File $base_dir The base_dir to be based upon for relative path calculation
@return string the relative path | [
"Returns",
"the",
"relative",
"path"
] | 5407f98c21ee99f8bbef43c97a231c0f81ed3e74 | https://github.com/chigix/chiji-frontend/blob/5407f98c21ee99f8bbef43c97a231c0f81ed3e74/src/File/AbstractResourceFile.php#L66-L68 |
7,458 | chigix/chiji-frontend | src/File/AbstractResourceFile.php | AbstractResourceFile.getParentProject | public final function getParentProject() {
$result = \Chigi\Chiji\Util\ProjectUtil::searchRelativeProject($this);
if (count($result) < 1) {
throw new \Chigi\Chiji\Exception\ProjectMemberNotFoundException("MEMBER NOT FOUND");
}
return $result[0];
} | php | public final function getParentProject() {
$result = \Chigi\Chiji\Util\ProjectUtil::searchRelativeProject($this);
if (count($result) < 1) {
throw new \Chigi\Chiji\Exception\ProjectMemberNotFoundException("MEMBER NOT FOUND");
}
return $result[0];
} | [
"public",
"final",
"function",
"getParentProject",
"(",
")",
"{",
"$",
"result",
"=",
"\\",
"Chigi",
"\\",
"Chiji",
"\\",
"Util",
"\\",
"ProjectUtil",
"::",
"searchRelativeProject",
"(",
"$",
"this",
")",
";",
"if",
"(",
"count",
"(",
"$",
"result",
")",... | Gets the parent project of this registered resource.
@return \Chigi\Chiji\Project\Project The Parent Project of this resource.
@throws \Chigi\Chiji\Exception\ProjectMemberNotFoundException | [
"Gets",
"the",
"parent",
"project",
"of",
"this",
"registered",
"resource",
"."
] | 5407f98c21ee99f8bbef43c97a231c0f81ed3e74 | https://github.com/chigix/chiji-frontend/blob/5407f98c21ee99f8bbef43c97a231c0f81ed3e74/src/File/AbstractResourceFile.php#L107-L113 |
7,459 | chigix/chiji-frontend | src/File/AbstractResourceFile.php | AbstractResourceFile.getFinalCache | public final function getFinalCache() {
$resource = $this;
while (true) {
$cache_file = $this->getParentProject()->getCacheManager()->getCacheBuilt($resource);
if (\is_null($cache_file) ||
\is_null($this->getParentProject()->getResourceByFile($cache_file)) ||
... | php | public final function getFinalCache() {
$resource = $this;
while (true) {
$cache_file = $this->getParentProject()->getCacheManager()->getCacheBuilt($resource);
if (\is_null($cache_file) ||
\is_null($this->getParentProject()->getResourceByFile($cache_file)) ||
... | [
"public",
"final",
"function",
"getFinalCache",
"(",
")",
"{",
"$",
"resource",
"=",
"$",
"this",
";",
"while",
"(",
"true",
")",
"{",
"$",
"cache_file",
"=",
"$",
"this",
"->",
"getParentProject",
"(",
")",
"->",
"getCacheManager",
"(",
")",
"->",
"ge... | Returns the final cache resource built from this.
@return \Chigi\Chiji\File\AbstractResourceFile | [
"Returns",
"the",
"final",
"cache",
"resource",
"built",
"from",
"this",
"."
] | 5407f98c21ee99f8bbef43c97a231c0f81ed3e74 | https://github.com/chigix/chiji-frontend/blob/5407f98c21ee99f8bbef43c97a231c0f81ed3e74/src/File/AbstractResourceFile.php#L120-L132 |
7,460 | nodes-php/core | src/Support/UserAgent/Agents/Original.php | Original.parse | protected function parse()
{
try {
$data = app(Browscap::class)->getBrowser($this->userAgent);
} catch (Exception $e) {
return;
}
foreach ($data as $key => $value) {
// Force lowercase on key
$key = strtolower($key);
// Re... | php | protected function parse()
{
try {
$data = app(Browscap::class)->getBrowser($this->userAgent);
} catch (Exception $e) {
return;
}
foreach ($data as $key => $value) {
// Force lowercase on key
$key = strtolower($key);
// Re... | [
"protected",
"function",
"parse",
"(",
")",
"{",
"try",
"{",
"$",
"data",
"=",
"app",
"(",
"Browscap",
"::",
"class",
")",
"->",
"getBrowser",
"(",
"$",
"this",
"->",
"userAgent",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
"{",
"retur... | Parse user agent with the help from Browscap.
@author Morten Rugaard <moru@nodes.dk>
@return void | [
"Parse",
"user",
"agent",
"with",
"the",
"help",
"from",
"Browscap",
"."
] | fc788bb3e9668872573838099f868ab162eb8a96 | https://github.com/nodes-php/core/blob/fc788bb3e9668872573838099f868ab162eb8a96/src/Support/UserAgent/Agents/Original.php#L134-L192 |
7,461 | nodes-php/core | src/Support/UserAgent/Agents/Original.php | Original.setVersion | protected function setVersion($version)
{
// Set version of browser
$this->version = $version;
// If major and minor versions hasn't been set
// we'll set them by parsing version.
//
// If version doesn't contain a "." then we'll only
// set the major version... | php | protected function setVersion($version)
{
// Set version of browser
$this->version = $version;
// If major and minor versions hasn't been set
// we'll set them by parsing version.
//
// If version doesn't contain a "." then we'll only
// set the major version... | [
"protected",
"function",
"setVersion",
"(",
"$",
"version",
")",
"{",
"// Set version of browser",
"$",
"this",
"->",
"version",
"=",
"$",
"version",
";",
"// If major and minor versions hasn't been set",
"// we'll set them by parsing version.",
"//",
"// If version doesn't c... | Set version of browser.
@author Morten Rugaard <moru@nodes.dk>
@param string $version
@return $this | [
"Set",
"version",
"of",
"browser",
"."
] | fc788bb3e9668872573838099f868ab162eb8a96 | https://github.com/nodes-php/core/blob/fc788bb3e9668872573838099f868ab162eb8a96/src/Support/UserAgent/Agents/Original.php#L203-L225 |
7,462 | gossi/trixionary | src/model/Map/FunctionPhaseTableMap.php | FunctionPhaseTableMap.doInsert | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(FunctionPhaseTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // r... | php | public static function doInsert($criteria, ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(FunctionPhaseTableMap::DATABASE_NAME);
}
if ($criteria instanceof Criteria) {
$criteria = clone $criteria; // r... | [
"public",
"static",
"function",
"doInsert",
"(",
"$",
"criteria",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"con",
")",
"{",
"$",
"con",
"=",
"Propel",
"::",
"getServiceContainer",
"(",
")",
"->",
"ge... | Performs an INSERT on the database, given a FunctionPhase or Criteria object.
@param mixed $criteria Criteria or FunctionPhase object containing data that is used to create the INSERT statement.
@param ConnectionInterface $con the ConnectionInterface connection to use
@return mixed The new prim... | [
"Performs",
"an",
"INSERT",
"on",
"the",
"database",
"given",
"a",
"FunctionPhase",
"or",
"Criteria",
"object",
"."
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Map/FunctionPhaseTableMap.php#L428-L449 |
7,463 | aedart/model | src/Traits/Strings/OutputPathTrait.php | OutputPathTrait.getOutputPath | public function getOutputPath() : ?string
{
if ( ! $this->hasOutputPath()) {
$this->setOutputPath($this->getDefaultOutputPath());
}
return $this->outputPath;
} | php | public function getOutputPath() : ?string
{
if ( ! $this->hasOutputPath()) {
$this->setOutputPath($this->getDefaultOutputPath());
}
return $this->outputPath;
} | [
"public",
"function",
"getOutputPath",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasOutputPath",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setOutputPath",
"(",
"$",
"this",
"->",
"getDefaultOutputPath",
"(",
")",
")",
";",
... | Get output path
If no "output path" value has been set, this method will
set and return a default "output path" value,
if any such value is available
@see getDefaultOutputPath()
@return string|null output path or null if no output path has been set | [
"Get",
"output",
"path"
] | 9a562c1c53a276d01ace0ab71f5305458bea542f | https://github.com/aedart/model/blob/9a562c1c53a276d01ace0ab71f5305458bea542f/src/Traits/Strings/OutputPathTrait.php#L48-L54 |
7,464 | alfredoem/ragnarok | app/Ragnarok/SecUsers/SecUser.php | SecUser.populate | public function populate($data)
{
$this->userId = $data->userId;
$this->email = $data->email;
$this->firstName = $data->firstName;
$this->lastName = $data->lastName;
$this->status = $data->status;
$this->remember_token = $data->remember_token;
$this->userSessi... | php | public function populate($data)
{
$this->userId = $data->userId;
$this->email = $data->email;
$this->firstName = $data->firstName;
$this->lastName = $data->lastName;
$this->status = $data->status;
$this->remember_token = $data->remember_token;
$this->userSessi... | [
"public",
"function",
"populate",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"userId",
"=",
"$",
"data",
"->",
"userId",
";",
"$",
"this",
"->",
"email",
"=",
"$",
"data",
"->",
"email",
";",
"$",
"this",
"->",
"firstName",
"=",
"$",
"data",
... | Fill the user attributes
@param $data | [
"Fill",
"the",
"user",
"attributes"
] | e7de18cbe7a64e6ce480093d9d98d64078d35dff | https://github.com/alfredoem/ragnarok/blob/e7de18cbe7a64e6ce480093d9d98d64078d35dff/app/Ragnarok/SecUsers/SecUser.php#L35-L48 |
7,465 | mrferos/Email-Stripper | src/EmailStripper/EmailStripper.php | EmailStripper.addStripper | public function addStripper($stripper)
{
if (is_string($stripper)) {
if (!class_exists($stripper)) {
$stripper = '\\' . __NAMESPACE__ . '\\Stripper\\' . $stripper;
if (!class_exists($stripper)) {
throw new \InvalidArgumentException('Class ' . $... | php | public function addStripper($stripper)
{
if (is_string($stripper)) {
if (!class_exists($stripper)) {
$stripper = '\\' . __NAMESPACE__ . '\\Stripper\\' . $stripper;
if (!class_exists($stripper)) {
throw new \InvalidArgumentException('Class ' . $... | [
"public",
"function",
"addStripper",
"(",
"$",
"stripper",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"stripper",
")",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"stripper",
")",
")",
"{",
"$",
"stripper",
"=",
"'\\\\'",
".",
"__NAMESPACE__",... | Accept an object or class name that implements StripperInterface
@param string|StripperInterface $stripper | [
"Accept",
"an",
"object",
"or",
"class",
"name",
"that",
"implements",
"StripperInterface"
] | 2c13ddb736c563dedc4686da474dd6dd2d7bad25 | https://github.com/mrferos/Email-Stripper/blob/2c13ddb736c563dedc4686da474dd6dd2d7bad25/src/EmailStripper/EmailStripper.php#L43-L63 |
7,466 | uthando-cms/uthando-file-manager | src/UthandoFileManager/View/File.php | File.fileExists | public function fileExists($directory = null)
{
$directory = ($directory) ?: $this->fileDirectory;
$fileExists = file_exists($this->publicDirectory . $directory . $this->file);
return $fileExists;
} | php | public function fileExists($directory = null)
{
$directory = ($directory) ?: $this->fileDirectory;
$fileExists = file_exists($this->publicDirectory . $directory . $this->file);
return $fileExists;
} | [
"public",
"function",
"fileExists",
"(",
"$",
"directory",
"=",
"null",
")",
"{",
"$",
"directory",
"=",
"(",
"$",
"directory",
")",
"?",
":",
"$",
"this",
"->",
"fileDirectory",
";",
"$",
"fileExists",
"=",
"file_exists",
"(",
"$",
"this",
"->",
"publ... | Checks to see if file exists
@param null $directory
@return bool | [
"Checks",
"to",
"see",
"if",
"file",
"exists"
] | e0b562e9b79f93ffef33a1e4d5a8f400895e7588 | https://github.com/uthando-cms/uthando-file-manager/blob/e0b562e9b79f93ffef33a1e4d5a8f400895e7588/src/UthandoFileManager/View/File.php#L59-L64 |
7,467 | uthando-cms/uthando-file-manager | src/UthandoFileManager/View/File.php | File.isFile | public function isFile($directory = null)
{
$directory = ($directory) ?: $this->fileDirectory;
$isFile = is_file($this->publicDirectory . $directory . $this->file);
return $isFile;
} | php | public function isFile($directory = null)
{
$directory = ($directory) ?: $this->fileDirectory;
$isFile = is_file($this->publicDirectory . $directory . $this->file);
return $isFile;
} | [
"public",
"function",
"isFile",
"(",
"$",
"directory",
"=",
"null",
")",
"{",
"$",
"directory",
"=",
"(",
"$",
"directory",
")",
"?",
":",
"$",
"this",
"->",
"fileDirectory",
";",
"$",
"isFile",
"=",
"is_file",
"(",
"$",
"this",
"->",
"publicDirectory"... | Checks to see if file is a file
@param null $directory
@return bool | [
"Checks",
"to",
"see",
"if",
"file",
"is",
"a",
"file"
] | e0b562e9b79f93ffef33a1e4d5a8f400895e7588 | https://github.com/uthando-cms/uthando-file-manager/blob/e0b562e9b79f93ffef33a1e4d5a8f400895e7588/src/UthandoFileManager/View/File.php#L72-L77 |
7,468 | phlexible/phlexible | src/Phlexible/Bundle/QueueBundle/Controller/DataController.php | DataController.indexAction | public function indexAction(Request $request)
{
$jobManager = $this->get('phlexible_queue.job_manager');
$limit = $request->get('limit', 25);
$offset = $request->get('start', 0);
$data = [];
foreach ($jobManager->findBy([], ['createdAt' => 'DESC'], $limit, $offset) as $queu... | php | public function indexAction(Request $request)
{
$jobManager = $this->get('phlexible_queue.job_manager');
$limit = $request->get('limit', 25);
$offset = $request->get('start', 0);
$data = [];
foreach ($jobManager->findBy([], ['createdAt' => 'DESC'], $limit, $offset) as $queu... | [
"public",
"function",
"indexAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"jobManager",
"=",
"$",
"this",
"->",
"get",
"(",
"'phlexible_queue.job_manager'",
")",
";",
"$",
"limit",
"=",
"$",
"request",
"->",
"get",
"(",
"'limit'",
",",
"25",
")... | Job list.
@param Request $request
@return JsonResponse
@Route("/list", name="queue_list") | [
"Job",
"list",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/QueueBundle/Controller/DataController.php#L37-L61 |
7,469 | arvici/framework | src/Arvici/Exception/Response/HttpException.php | HttpException.toResponse | public function toResponse()
{
$response = Http::getInstance()->response();
$response->reset();
$response->status($this->code);
if (is_string($this->details)) {
$response->body($this->details);
} elseif (is_string($this->message)) {
$response->body($th... | php | public function toResponse()
{
$response = Http::getInstance()->response();
$response->reset();
$response->status($this->code);
if (is_string($this->details)) {
$response->body($this->details);
} elseif (is_string($this->message)) {
$response->body($th... | [
"public",
"function",
"toResponse",
"(",
")",
"{",
"$",
"response",
"=",
"Http",
"::",
"getInstance",
"(",
")",
"->",
"response",
"(",
")",
";",
"$",
"response",
"->",
"reset",
"(",
")",
";",
"$",
"response",
"->",
"status",
"(",
"$",
"this",
"->",
... | Converts the error to a response object.
@return Response response object. | [
"Converts",
"the",
"error",
"to",
"a",
"response",
"object",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Exception/Response/HttpException.php#L33-L45 |
7,470 | monolyth-php/cesession | src/Session.php | Session.registerHandler | public function registerHandler(Handler $handler, int $chainProbability = 0) : void
{
static $first = true;
if ($first) {
$this->handlers = [];
$first = false;
}
$this->handlers[] = [$handler, $chainProbability];
} | php | public function registerHandler(Handler $handler, int $chainProbability = 0) : void
{
static $first = true;
if ($first) {
$this->handlers = [];
$first = false;
}
$this->handlers[] = [$handler, $chainProbability];
} | [
"public",
"function",
"registerHandler",
"(",
"Handler",
"$",
"handler",
",",
"int",
"$",
"chainProbability",
"=",
"0",
")",
":",
"void",
"{",
"static",
"$",
"first",
"=",
"true",
";",
"if",
"(",
"$",
"first",
")",
"{",
"$",
"this",
"->",
"handlers",
... | Register a session handler.
@param Cesession\Handler $handler Handler object to use.
@param int $chainProbability The probability, expressed as a percentage,
that calls on this handler will afterwards be forwarded to the next
handler in the chain.
@return void
@see Cesession\Handler | [
"Register",
"a",
"session",
"handler",
"."
] | 4b1660396dab801177d34271154f7f6d286de6fa | https://github.com/monolyth-php/cesession/blob/4b1660396dab801177d34271154f7f6d286de6fa/src/Session.php#L37-L45 |
7,471 | monolyth-php/cesession | src/Session.php | Session.walk | private function walk(string $method, int $highProbability = null, array $args = [])
{
$result = false;
foreach ($this->handlers as $data) {
list($handler, $chainProbability) = $data;
$probability = isset($highProbability) ?
$highProbability :
... | php | private function walk(string $method, int $highProbability = null, array $args = [])
{
$result = false;
foreach ($this->handlers as $data) {
list($handler, $chainProbability) = $data;
$probability = isset($highProbability) ?
$highProbability :
... | [
"private",
"function",
"walk",
"(",
"string",
"$",
"method",
",",
"int",
"$",
"highProbability",
"=",
"null",
",",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"result",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"handlers",
"as",
... | Internal method to walk the handler chain.
@param string $method Method name to call on each handler. Note that the
method definitions on handlers differ from those in
SessionHandlerInterface.
@param int|null $highProbability Override to the handler's defined
$chainProbability. Defaults to null, i.e. not used.
@param ... | [
"Internal",
"method",
"to",
"walk",
"the",
"handler",
"chain",
"."
] | 4b1660396dab801177d34271154f7f6d286de6fa | https://github.com/monolyth-php/cesession/blob/4b1660396dab801177d34271154f7f6d286de6fa/src/Session.php#L58-L72 |
7,472 | monolyth-php/cesession | src/Session.php | Session.read | public function read($id) : string
{
if ($session = $this->walk('read', null, [$id])) {
self::$session = $session;
return self::$session['data'];
}
return '';
} | php | public function read($id) : string
{
if ($session = $this->walk('read', null, [$id])) {
self::$session = $session;
return self::$session['data'];
}
return '';
} | [
"public",
"function",
"read",
"(",
"$",
"id",
")",
":",
"string",
"{",
"if",
"(",
"$",
"session",
"=",
"$",
"this",
"->",
"walk",
"(",
"'read'",
",",
"null",
",",
"[",
"$",
"id",
"]",
")",
")",
"{",
"self",
"::",
"$",
"session",
"=",
"$",
"se... | Read the requested session.
@param string $id The session ID.
@return string The read data. | [
"Read",
"the",
"requested",
"session",
"."
] | 4b1660396dab801177d34271154f7f6d286de6fa | https://github.com/monolyth-php/cesession/blob/4b1660396dab801177d34271154f7f6d286de6fa/src/Session.php#L119-L126 |
7,473 | monolyth-php/cesession | src/Session.php | Session.write | public function write($id, $data) : bool
{
return (bool)$this->walk(
'write',
null,
[$id, compact('data') + self::$session]
);
} | php | public function write($id, $data) : bool
{
return (bool)$this->walk(
'write',
null,
[$id, compact('data') + self::$session]
);
} | [
"public",
"function",
"write",
"(",
"$",
"id",
",",
"$",
"data",
")",
":",
"bool",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"walk",
"(",
"'write'",
",",
"null",
",",
"[",
"$",
"id",
",",
"compact",
"(",
"'data'",
")",
"+",
"self",
":... | Write the requested session.
@param string $id The session ID.
@param string $data The serialized session data as passed by PHP.
@return boolean True on success, else false. | [
"Write",
"the",
"requested",
"session",
"."
] | 4b1660396dab801177d34271154f7f6d286de6fa | https://github.com/monolyth-php/cesession/blob/4b1660396dab801177d34271154f7f6d286de6fa/src/Session.php#L135-L142 |
7,474 | MAXakaWIZARD/MoReader | src/Reader.php | Reader.readMsgId | protected function readMsgId($index)
{
$msgId = $this->readStringFromTable($index, $this->msgIdTable);
if (false === $msgId) {
$msgId = array('');
}
return $msgId;
} | php | protected function readMsgId($index)
{
$msgId = $this->readStringFromTable($index, $this->msgIdTable);
if (false === $msgId) {
$msgId = array('');
}
return $msgId;
} | [
"protected",
"function",
"readMsgId",
"(",
"$",
"index",
")",
"{",
"$",
"msgId",
"=",
"$",
"this",
"->",
"readStringFromTable",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"msgIdTable",
")",
";",
"if",
"(",
"false",
"===",
"$",
"msgId",
")",
"{",
"$",... | Reads specified message id record
@param int $index
@return array | [
"Reads",
"specified",
"message",
"id",
"record"
] | 873bdc08c9c9e561405f6c99cda2999f31ab0b2f | https://github.com/MAXakaWIZARD/MoReader/blob/873bdc08c9c9e561405f6c99cda2999f31ab0b2f/src/Reader.php#L128-L136 |
7,475 | MAXakaWIZARD/MoReader | src/Reader.php | Reader.readTranslation | protected function readTranslation($index)
{
$msgStr = $this->readStringFromTable($index, $this->msgStrTable);
if (false === $msgStr) {
$msgStr = array();
}
return $msgStr;
} | php | protected function readTranslation($index)
{
$msgStr = $this->readStringFromTable($index, $this->msgStrTable);
if (false === $msgStr) {
$msgStr = array();
}
return $msgStr;
} | [
"protected",
"function",
"readTranslation",
"(",
"$",
"index",
")",
"{",
"$",
"msgStr",
"=",
"$",
"this",
"->",
"readStringFromTable",
"(",
"$",
"index",
",",
"$",
"this",
"->",
"msgStrTable",
")",
";",
"if",
"(",
"false",
"===",
"$",
"msgStr",
")",
"{... | Reads specified translation record
@param int $index
@return array | [
"Reads",
"specified",
"translation",
"record"
] | 873bdc08c9c9e561405f6c99cda2999f31ab0b2f | https://github.com/MAXakaWIZARD/MoReader/blob/873bdc08c9c9e561405f6c99cda2999f31ab0b2f/src/Reader.php#L145-L153 |
7,476 | MAXakaWIZARD/MoReader | src/Reader.php | Reader.openFile | protected function openFile($filename)
{
$this->filename = $filename;
if (!is_file($this->filename)) {
throw new \Exception(
sprintf(
'File %s does not exist',
$this->filename
)
);
}
$th... | php | protected function openFile($filename)
{
$this->filename = $filename;
if (!is_file($this->filename)) {
throw new \Exception(
sprintf(
'File %s does not exist',
$this->filename
)
);
}
$th... | [
"protected",
"function",
"openFile",
"(",
"$",
"filename",
")",
"{",
"$",
"this",
"->",
"filename",
"=",
"$",
"filename",
";",
"if",
"(",
"!",
"is_file",
"(",
"$",
"this",
"->",
"filename",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"spri... | Prepare file for reading
@param $filename
@throws \Exception | [
"Prepare",
"file",
"for",
"reading"
] | 873bdc08c9c9e561405f6c99cda2999f31ab0b2f | https://github.com/MAXakaWIZARD/MoReader/blob/873bdc08c9c9e561405f6c99cda2999f31ab0b2f/src/Reader.php#L192-L214 |
7,477 | MAXakaWIZARD/MoReader | src/Reader.php | Reader.determineByteOrder | protected function determineByteOrder()
{
$orderHeader = fread($this->file, 4);
if ($orderHeader == "\x95\x04\x12\xde") {
$this->littleEndian = false;
} elseif ($orderHeader == "\xde\x12\x04\x95") {
$this->littleEndian = true;
} else {
fclose($thi... | php | protected function determineByteOrder()
{
$orderHeader = fread($this->file, 4);
if ($orderHeader == "\x95\x04\x12\xde") {
$this->littleEndian = false;
} elseif ($orderHeader == "\xde\x12\x04\x95") {
$this->littleEndian = true;
} else {
fclose($thi... | [
"protected",
"function",
"determineByteOrder",
"(",
")",
"{",
"$",
"orderHeader",
"=",
"fread",
"(",
"$",
"this",
"->",
"file",
",",
"4",
")",
";",
"if",
"(",
"$",
"orderHeader",
"==",
"\"\\x95\\x04\\x12\\xde\"",
")",
"{",
"$",
"this",
"->",
"littleEndian"... | Determines byte order
@throws \Exception | [
"Determines",
"byte",
"order"
] | 873bdc08c9c9e561405f6c99cda2999f31ab0b2f | https://github.com/MAXakaWIZARD/MoReader/blob/873bdc08c9c9e561405f6c99cda2999f31ab0b2f/src/Reader.php#L221-L238 |
7,478 | MAXakaWIZARD/MoReader | src/Reader.php | Reader.readInteger | protected function readInteger()
{
if ($this->littleEndian) {
$result = unpack('Vint', fread($this->file, 4));
} else {
$result = unpack('Nint', fread($this->file, 4));
}
return $result['int'];
} | php | protected function readInteger()
{
if ($this->littleEndian) {
$result = unpack('Vint', fread($this->file, 4));
} else {
$result = unpack('Nint', fread($this->file, 4));
}
return $result['int'];
} | [
"protected",
"function",
"readInteger",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"littleEndian",
")",
"{",
"$",
"result",
"=",
"unpack",
"(",
"'Vint'",
",",
"fread",
"(",
"$",
"this",
"->",
"file",
",",
"4",
")",
")",
";",
"}",
"else",
"{",
"... | Read a single integer from the current file.
@return int | [
"Read",
"a",
"single",
"integer",
"from",
"the",
"current",
"file",
"."
] | 873bdc08c9c9e561405f6c99cda2999f31ab0b2f | https://github.com/MAXakaWIZARD/MoReader/blob/873bdc08c9c9e561405f6c99cda2999f31ab0b2f/src/Reader.php#L265-L274 |
7,479 | MAXakaWIZARD/MoReader | src/Reader.php | Reader.readIntegerList | protected function readIntegerList($num)
{
if ($this->littleEndian) {
return unpack('V' . $num, fread($this->file, 4 * $num));
}
return unpack('N' . $num, fread($this->file, 4 * $num));
} | php | protected function readIntegerList($num)
{
if ($this->littleEndian) {
return unpack('V' . $num, fread($this->file, 4 * $num));
}
return unpack('N' . $num, fread($this->file, 4 * $num));
} | [
"protected",
"function",
"readIntegerList",
"(",
"$",
"num",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"littleEndian",
")",
"{",
"return",
"unpack",
"(",
"'V'",
".",
"$",
"num",
",",
"fread",
"(",
"$",
"this",
"->",
"file",
",",
"4",
"*",
"$",
"num",... | Read an integer from the current file.
@param int $num
@return array | [
"Read",
"an",
"integer",
"from",
"the",
"current",
"file",
"."
] | 873bdc08c9c9e561405f6c99cda2999f31ab0b2f | https://github.com/MAXakaWIZARD/MoReader/blob/873bdc08c9c9e561405f6c99cda2999f31ab0b2f/src/Reader.php#L282-L289 |
7,480 | thecodingmachine/integration.wordpress.moufpress | src/Mouf/Integration/Wordpress/Moufpress/MoufpressWidget.php | MoufpressWidget.widget | public function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? null : apply_filters('widget_title', $instance['title']);
if (!empty($title)) {
echo $before_title.$title.$after_title;
};
Mouf... | php | public function widget($args, $instance)
{
extract($args, EXTR_SKIP);
echo $before_widget;
$title = empty($instance['title']) ? null : apply_filters('widget_title', $instance['title']);
if (!empty($title)) {
echo $before_title.$title.$after_title;
};
Mouf... | [
"public",
"function",
"widget",
"(",
"$",
"args",
",",
"$",
"instance",
")",
"{",
"extract",
"(",
"$",
"args",
",",
"EXTR_SKIP",
")",
";",
"echo",
"$",
"before_widget",
";",
"$",
"title",
"=",
"empty",
"(",
"$",
"instance",
"[",
"'title'",
"]",
")",
... | Display widget. | [
"Display",
"widget",
"."
] | c0a3d7944d38450227d2cf4533410e3597bd2c3c | https://github.com/thecodingmachine/integration.wordpress.moufpress/blob/c0a3d7944d38450227d2cf4533410e3597bd2c3c/src/Mouf/Integration/Wordpress/Moufpress/MoufpressWidget.php#L30-L42 |
7,481 | thecodingmachine/integration.wordpress.moufpress | src/Mouf/Integration/Wordpress/Moufpress/MoufpressWidget.php | MoufpressWidget.form | public function form($instance)
{
$default = array(
'title' => '',
'instance' => null,
);
$instance = wp_parse_args((array) $instance, $default);
$title_id = $this->get_field_id('title');
$title_name = $this->get_field_name('title');
ec... | php | public function form($instance)
{
$default = array(
'title' => '',
'instance' => null,
);
$instance = wp_parse_args((array) $instance, $default);
$title_id = $this->get_field_id('title');
$title_name = $this->get_field_name('title');
ec... | [
"public",
"function",
"form",
"(",
"$",
"instance",
")",
"{",
"$",
"default",
"=",
"array",
"(",
"'title'",
"=>",
"''",
",",
"'instance'",
"=>",
"null",
",",
")",
";",
"$",
"instance",
"=",
"wp_parse_args",
"(",
"(",
"array",
")",
"$",
"instance",
",... | admin control form. | [
"admin",
"control",
"form",
"."
] | c0a3d7944d38450227d2cf4533410e3597bd2c3c | https://github.com/thecodingmachine/integration.wordpress.moufpress/blob/c0a3d7944d38450227d2cf4533410e3597bd2c3c/src/Mouf/Integration/Wordpress/Moufpress/MoufpressWidget.php#L59-L101 |
7,482 | kore/CTXParser | src/php/CTXParser/Stack.php | Stack.offsetGet | public function offsetGet($key)
{
$key = $this->count - $key - 1;
if (!isset($this->data[$key])) {
throw new \OutOfRangeException("Out of range.");
}
return $this->data[$key];
} | php | public function offsetGet($key)
{
$key = $this->count - $key - 1;
if (!isset($this->data[$key])) {
throw new \OutOfRangeException("Out of range.");
}
return $this->data[$key];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"count",
"-",
"$",
"key",
"-",
"1",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
")",
"{",
"throw",
... | Returns the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the
data of this object as if it was an array.
@param string $key
@return mixed
@throws ezcBasePropertyNotFoundException
If no dataset with identifier exists | [
"Returns",
"the",
"element",
"with",
"the",
"given",
"offset",
"."
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Stack.php#L84-L92 |
7,483 | kore/CTXParser | src/php/CTXParser/Stack.php | Stack.offsetSet | public function offsetSet($key, $value)
{
$key = $this->count - $key - 1;
if (!isset($this->data[$key])) {
throw new \OutOfRangeException("Out of range.");
}
$this->data[$key] = $value;
} | php | public function offsetSet($key, $value)
{
$key = $this->count - $key - 1;
if (!isset($this->data[$key])) {
throw new \OutOfRangeException("Out of range.");
}
$this->data[$key] = $value;
} | [
"public",
"function",
"offsetSet",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"count",
"-",
"$",
"key",
"-",
"1",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"$",
"key",
"]",
")",
... | Set the element with the given offset.
This method is part of the ArrayAccess interface to allow access to the
data of this object as if it was an array.
Setting of not yet existing offsets in the stack is not allowed and will
return a ezcBaseValueException.
@param string $key
@param mixed $value
@return void
@thro... | [
"Set",
"the",
"element",
"with",
"the",
"given",
"offset",
"."
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Stack.php#L110-L118 |
7,484 | ItinerisLtd/preflight-command | src/Runner.php | Runner.check | public static function check(
ConfigCollection $configCollection,
CheckerCollection $checkerCollection
): ResultCollection {
$resultCollection = new ResultCollection();
foreach ($checkerCollection->all() as $id => $checker) {
$resultCollection->add(
$chec... | php | public static function check(
ConfigCollection $configCollection,
CheckerCollection $checkerCollection
): ResultCollection {
$resultCollection = new ResultCollection();
foreach ($checkerCollection->all() as $id => $checker) {
$resultCollection->add(
$chec... | [
"public",
"static",
"function",
"check",
"(",
"ConfigCollection",
"$",
"configCollection",
",",
"CheckerCollection",
"$",
"checkerCollection",
")",
":",
"ResultCollection",
"{",
"$",
"resultCollection",
"=",
"new",
"ResultCollection",
"(",
")",
";",
"foreach",
"(",
... | Run all the checkers according to their configs.
@param ConfigCollection $configCollection The config collection instance.
@param CheckerCollection $checkerCollection The checker collection instance.
@return ResultCollection | [
"Run",
"all",
"the",
"checkers",
"according",
"to",
"their",
"configs",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/Runner.php#L16-L31 |
7,485 | thecmsthread/theme | src/API.php | API.run | public function run(): array
{
try {
$result = null;
if ($this->match !== false && is_callable($this->match['target']) === true) {
if (func_num_args() > 0) {
foreach (func_get_args() as $argument) {
$this->match['params'][] ... | php | public function run(): array
{
try {
$result = null;
if ($this->match !== false && is_callable($this->match['target']) === true) {
if (func_num_args() > 0) {
foreach (func_get_args() as $argument) {
$this->match['params'][] ... | [
"public",
"function",
"run",
"(",
")",
":",
"array",
"{",
"try",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"match",
"!==",
"false",
"&&",
"is_callable",
"(",
"$",
"this",
"->",
"match",
"[",
"'target'",
"]",
")",
"===",
... | Runs the API function and returns the result
@return array | [
"Runs",
"the",
"API",
"function",
"and",
"returns",
"the",
"result"
] | 5031373d5af50cbd2d8862b919b1e1190cd4c84f | https://github.com/thecmsthread/theme/blob/5031373d5af50cbd2d8862b919b1e1190cd4c84f/src/API.php#L300-L365 |
7,486 | thecmsthread/theme | src/API.php | API.set | public function set(string $link = null, string $method = null): \TheCMSThread\Classes\API
{
if ($link === null) {
if (isset($_SERVER['REQUEST_URI']) === false) {
$_SERVER['REQUEST_URI'] = '/';
}
$link = str_replace("?" . $_SERVER["QUERY_STRING"], "", $_SE... | php | public function set(string $link = null, string $method = null): \TheCMSThread\Classes\API
{
if ($link === null) {
if (isset($_SERVER['REQUEST_URI']) === false) {
$_SERVER['REQUEST_URI'] = '/';
}
$link = str_replace("?" . $_SERVER["QUERY_STRING"], "", $_SE... | [
"public",
"function",
"set",
"(",
"string",
"$",
"link",
"=",
"null",
",",
"string",
"$",
"method",
"=",
"null",
")",
":",
"\\",
"TheCMSThread",
"\\",
"Classes",
"\\",
"API",
"{",
"if",
"(",
"$",
"link",
"===",
"null",
")",
"{",
"if",
"(",
"isset",... | Set the active API link
@param string $link The route to be set to.
@param string $method The method to be set to.
@return TheCMSThread\Classes\API | [
"Set",
"the",
"active",
"API",
"link"
] | 5031373d5af50cbd2d8862b919b1e1190cd4c84f | https://github.com/thecmsthread/theme/blob/5031373d5af50cbd2d8862b919b1e1190cd4c84f/src/API.php#L375-L398 |
7,487 | milkyway-multimedia/ss-mwm-core | code/Core/Extensions/DBField.php | DBField.HTMLID | public function HTMLID($lowercase = false) {
$str = trim(str_replace(' ', '-', ucwords(str_replace(['_', '-', '/'], ' ', $this->owner->value))), '-');
return $lowercase ? strtolower($str) : $str;
} | php | public function HTMLID($lowercase = false) {
$str = trim(str_replace(' ', '-', ucwords(str_replace(['_', '-', '/'], ' ', $this->owner->value))), '-');
return $lowercase ? strtolower($str) : $str;
} | [
"public",
"function",
"HTMLID",
"(",
"$",
"lowercase",
"=",
"false",
")",
"{",
"$",
"str",
"=",
"trim",
"(",
"str_replace",
"(",
"' '",
",",
"'-'",
",",
"ucwords",
"(",
"str_replace",
"(",
"[",
"'_'",
",",
"'-'",
",",
"'/'",
"]",
",",
"' '",
",",
... | Convert value to an appropriate HTML ID
@param bool $lowercase
@return string | [
"Convert",
"value",
"to",
"an",
"appropriate",
"HTML",
"ID"
] | e7216653b7100ead5a7d56736a124bee1c76fcd5 | https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/DBField.php#L53-L56 |
7,488 | milkyway-multimedia/ss-mwm-core | code/Core/Extensions/DBField.php | DBField.nl2list | public function nl2list($class = '', $liClass = '', $tag = 'ul') {
$val = trim($this->owner->XML(), "\n");
$val = str_replace("\n", sprintf('</li><li%s>', $liClass ? 'class="' . $liClass . '"' : ''), $val);
$val = $liClass ? '<li class="' . $liClass . '">' . $val . '</li>' : '<li>' . $val . '<... | php | public function nl2list($class = '', $liClass = '', $tag = 'ul') {
$val = trim($this->owner->XML(), "\n");
$val = str_replace("\n", sprintf('</li><li%s>', $liClass ? 'class="' . $liClass . '"' : ''), $val);
$val = $liClass ? '<li class="' . $liClass . '">' . $val . '</li>' : '<li>' . $val . '<... | [
"public",
"function",
"nl2list",
"(",
"$",
"class",
"=",
"''",
",",
"$",
"liClass",
"=",
"''",
",",
"$",
"tag",
"=",
"'ul'",
")",
"{",
"$",
"val",
"=",
"trim",
"(",
"$",
"this",
"->",
"owner",
"->",
"XML",
"(",
")",
",",
"\"\\n\"",
")",
";",
... | Convert new lines to a list
@param string $class
@param string $liClass
@param string $tag
@return string | [
"Convert",
"new",
"lines",
"to",
"a",
"list"
] | e7216653b7100ead5a7d56736a124bee1c76fcd5 | https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/DBField.php#L83-L91 |
7,489 | milkyway-multimedia/ss-mwm-core | code/Core/Extensions/DBField.php | DBField.FormatOrUnknown | public function FormatOrUnknown($format = 'Nice') {
return $this->owner->value && $this->owner->value != '0000-00-00 00:00:00' ? $this->owner->$format() : _t('_UNKNOWN_', '(unknown)');
} | php | public function FormatOrUnknown($format = 'Nice') {
return $this->owner->value && $this->owner->value != '0000-00-00 00:00:00' ? $this->owner->$format() : _t('_UNKNOWN_', '(unknown)');
} | [
"public",
"function",
"FormatOrUnknown",
"(",
"$",
"format",
"=",
"'Nice'",
")",
"{",
"return",
"$",
"this",
"->",
"owner",
"->",
"value",
"&&",
"$",
"this",
"->",
"owner",
"->",
"value",
"!=",
"'0000-00-00 00:00:00'",
"?",
"$",
"this",
"->",
"owner",
"-... | Format a field or return as unknown
@param string $format
@return string | [
"Format",
"a",
"field",
"or",
"return",
"as",
"unknown"
] | e7216653b7100ead5a7d56736a124bee1c76fcd5 | https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/DBField.php#L126-L128 |
7,490 | milkyway-multimedia/ss-mwm-core | code/Core/Extensions/DBField.php | DBField.FormatOrNot | public function FormatOrNot($format = 'Nice') {
return $this->owner->value && $this->owner->value != '0000-00-00 00:00:00' ? $this->owner->$format() : '<span class="ui-button-icon-primary ui-icon btn-icon-decline"></span>';
} | php | public function FormatOrNot($format = 'Nice') {
return $this->owner->value && $this->owner->value != '0000-00-00 00:00:00' ? $this->owner->$format() : '<span class="ui-button-icon-primary ui-icon btn-icon-decline"></span>';
} | [
"public",
"function",
"FormatOrNot",
"(",
"$",
"format",
"=",
"'Nice'",
")",
"{",
"return",
"$",
"this",
"->",
"owner",
"->",
"value",
"&&",
"$",
"this",
"->",
"owner",
"->",
"value",
"!=",
"'0000-00-00 00:00:00'",
"?",
"$",
"this",
"->",
"owner",
"->",
... | Format a field or return as cms false
@param string $format
@return string | [
"Format",
"a",
"field",
"or",
"return",
"as",
"cms",
"false"
] | e7216653b7100ead5a7d56736a124bee1c76fcd5 | https://github.com/milkyway-multimedia/ss-mwm-core/blob/e7216653b7100ead5a7d56736a124bee1c76fcd5/code/Core/Extensions/DBField.php#L136-L138 |
7,491 | budkit/budkit-framework | src/Budkit/Datastore/Table.php | Table.bindData | final public function bindData($data, $ignore = array(), $strict = true, $filter = array())
{
$validate = $this->validator;
if (!is_object($data) && !is_array($data)) {
throw new Exception(t("Data must be either an object or array"));
return false;
}
$dataA... | php | final public function bindData($data, $ignore = array(), $strict = true, $filter = array())
{
$validate = $this->validator;
if (!is_object($data) && !is_array($data)) {
throw new Exception(t("Data must be either an object or array"));
return false;
}
$dataA... | [
"final",
"public",
"function",
"bindData",
"(",
"$",
"data",
",",
"$",
"ignore",
"=",
"array",
"(",
")",
",",
"$",
"strict",
"=",
"true",
",",
"$",
"filter",
"=",
"array",
"(",
")",
")",
"{",
"$",
"validate",
"=",
"$",
"this",
"->",
"validator",
... | Binds user data to the table;
@param type $data
@param type $ignore
@param type $strict
@param type $filter
@return type | [
"Binds",
"user",
"data",
"to",
"the",
"table",
";"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Table.php#L166-L218 |
7,492 | budkit/budkit-framework | src/Budkit/Datastore/Table.php | Table.getRowFieldValue | final public function getRowFieldValue($field)
{
//If value exists;
if (array_key_exists($field, $this->schema)) {
return $this->schema[$field]->Value;
}
return null;
} | php | final public function getRowFieldValue($field)
{
//If value exists;
if (array_key_exists($field, $this->schema)) {
return $this->schema[$field]->Value;
}
return null;
} | [
"final",
"public",
"function",
"getRowFieldValue",
"(",
"$",
"field",
")",
"{",
"//If value exists;",
"if",
"(",
"array_key_exists",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"return",
"$",
"this",
"->",
"schema",
"[",
"$",
"fie... | Gets the value of a field in the current ROW
@param type $field | [
"Gets",
"the",
"value",
"of",
"a",
"field",
"in",
"the",
"current",
"ROW"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Table.php#L256-L264 |
7,493 | budkit/budkit-framework | src/Budkit/Datastore/Table.php | Table.setRowFieldValue | final public function setRowFieldValue($field, $value)
{
//If value exists;
if (array_key_exists($field, $this->schema)) {
$this->schema[$field]->Value = $value;
return true;
}
return false;
} | php | final public function setRowFieldValue($field, $value)
{
//If value exists;
if (array_key_exists($field, $this->schema)) {
$this->schema[$field]->Value = $value;
return true;
}
return false;
} | [
"final",
"public",
"function",
"setRowFieldValue",
"(",
"$",
"field",
",",
"$",
"value",
")",
"{",
"//If value exists;",
"if",
"(",
"array_key_exists",
"(",
"$",
"field",
",",
"$",
"this",
"->",
"schema",
")",
")",
"{",
"$",
"this",
"->",
"schema",
"[",
... | Sets a field value in the current row
@param type $field | [
"Sets",
"a",
"field",
"value",
"in",
"the",
"current",
"row"
] | 0635061815fe07a8c63f9514b845d199b3c0d485 | https://github.com/budkit/budkit-framework/blob/0635061815fe07a8c63f9514b845d199b3c0d485/src/Budkit/Datastore/Table.php#L271-L280 |
7,494 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/email/classes/email/driver/mail.php | Email_Driver_Mail._send | protected function _send()
{
$message = $this->build_message();
$return_path = ($this->config['return_path'] !== false) ? $this->config['return_path'] : $this->config['from']['email'];
if ( ! @mail(static::format_addresses($this->to), $this->subject, $message['body'], $message['header'], '-oi -f '.$return_path))... | php | protected function _send()
{
$message = $this->build_message();
$return_path = ($this->config['return_path'] !== false) ? $this->config['return_path'] : $this->config['from']['email'];
if ( ! @mail(static::format_addresses($this->to), $this->subject, $message['body'], $message['header'], '-oi -f '.$return_path))... | [
"protected",
"function",
"_send",
"(",
")",
"{",
"$",
"message",
"=",
"$",
"this",
"->",
"build_message",
"(",
")",
";",
"$",
"return_path",
"=",
"(",
"$",
"this",
"->",
"config",
"[",
"'return_path'",
"]",
"!==",
"false",
")",
"?",
"$",
"this",
"->"... | Send the email using php's mail function.
@throws \EmailSendingFailedException Failed sending email
@return bool success boolean. | [
"Send",
"the",
"email",
"using",
"php",
"s",
"mail",
"function",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/email/classes/email/driver/mail.php#L27-L36 |
7,495 | bishopb/vanilla | applications/dashboard/models/class.dbamodel.php | DBAModel.HtmlEntityDecode | public function HtmlEntityDecode($Table, $Column, $Limit = 100) {
// Construct a model to save the results.
$Model = $this->CreateModel($Table);
// Get the data to decode.
$Data = $this->SQL
->Select($Model->PrimaryKey)
->Select($Column)
->From($Table)
... | php | public function HtmlEntityDecode($Table, $Column, $Limit = 100) {
// Construct a model to save the results.
$Model = $this->CreateModel($Table);
// Get the data to decode.
$Data = $this->SQL
->Select($Model->PrimaryKey)
->Select($Column)
->From($Table)
... | [
"public",
"function",
"HtmlEntityDecode",
"(",
"$",
"Table",
",",
"$",
"Column",
",",
"$",
"Limit",
"=",
"100",
")",
"{",
"// Construct a model to save the results.",
"$",
"Model",
"=",
"$",
"this",
"->",
"CreateModel",
"(",
"$",
"Table",
")",
";",
"// Get t... | Remove html entities from a column in the database.
@param string $Table The name of the table.
@param array $Column The column to decode.
@param int $Limit The number of records to work on. | [
"Remove",
"html",
"entities",
"from",
"a",
"column",
"in",
"the",
"database",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.dbamodel.php#L105-L141 |
7,496 | bishopb/vanilla | applications/dashboard/models/class.dbamodel.php | DBAModel.PrimaryKeyRange | public function PrimaryKeyRange($Table) {
$Model = $this->CreateModel($Table);
$Data = $this->SQL
->Select($Model->PrimaryKey, 'min', 'MinValue')
->Select($Model->PrimaryKey, 'max', 'MaxValue')
->From($Table)
->Get()->FirstRow(DATASET_TYPE_ARRAY);
if (... | php | public function PrimaryKeyRange($Table) {
$Model = $this->CreateModel($Table);
$Data = $this->SQL
->Select($Model->PrimaryKey, 'min', 'MinValue')
->Select($Model->PrimaryKey, 'max', 'MaxValue')
->From($Table)
->Get()->FirstRow(DATASET_TYPE_ARRAY);
if (... | [
"public",
"function",
"PrimaryKeyRange",
"(",
"$",
"Table",
")",
"{",
"$",
"Model",
"=",
"$",
"this",
"->",
"CreateModel",
"(",
"$",
"Table",
")",
";",
"$",
"Data",
"=",
"$",
"this",
"->",
"SQL",
"->",
"Select",
"(",
"$",
"Model",
"->",
"PrimaryKey",... | Return the min and max values of a table's primary key.
@param string $Table The name of the table to look at.
@return array An array in the form (min, max). | [
"Return",
"the",
"min",
"and",
"max",
"values",
"of",
"a",
"table",
"s",
"primary",
"key",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/dashboard/models/class.dbamodel.php#L214-L227 |
7,497 | plvhx/psr7-http-message | src/ServerRequestFactory.php | ServerRequestFactory.aggregateHeaderFromServer | private static function aggregateHeaderFromServer($server = [])
{
$header = [];
if (isset($server['HTTP_HOST'])) {
$header['Host'] = $server['HTTP_HOST'];
}
if (isset($server['HTTP_USER_AGENT'])) {
$header['User-Agent'] = $server['HTTP_USER_AGENT'];
... | php | private static function aggregateHeaderFromServer($server = [])
{
$header = [];
if (isset($server['HTTP_HOST'])) {
$header['Host'] = $server['HTTP_HOST'];
}
if (isset($server['HTTP_USER_AGENT'])) {
$header['User-Agent'] = $server['HTTP_USER_AGENT'];
... | [
"private",
"static",
"function",
"aggregateHeaderFromServer",
"(",
"$",
"server",
"=",
"[",
"]",
")",
"{",
"$",
"header",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"server",
"[",
"'HTTP_HOST'",
"]",
")",
")",
"{",
"$",
"header",
"[",
"'Host'"... | Aggregate request header information from server variables.
@param $server The server variables
@return array | [
"Aggregate",
"request",
"header",
"information",
"from",
"server",
"variables",
"."
] | d4f5ca4cc08c4e48bed596ead3b58e006ab57d6f | https://github.com/plvhx/psr7-http-message/blob/d4f5ca4cc08c4e48bed596ead3b58e006ab57d6f/src/ServerRequestFactory.php#L43-L76 |
7,498 | plvhx/psr7-http-message | src/ServerRequestFactory.php | ServerRequestFactory.aggregateHttpProtocolVersionFromServer | private static function aggregateHttpProtocolVersionFromServer($server)
{
if (!isset($server['SERVER_PROTOCOL'])) {
return null;
}
$pattern = '/^(?P<scheme>HTTP)\/(?P<protocol_version>1\.(0|1))$/';
if (!preg_match($pattern, $server['SERVER_PROTOCOL'], $q)) {
... | php | private static function aggregateHttpProtocolVersionFromServer($server)
{
if (!isset($server['SERVER_PROTOCOL'])) {
return null;
}
$pattern = '/^(?P<scheme>HTTP)\/(?P<protocol_version>1\.(0|1))$/';
if (!preg_match($pattern, $server['SERVER_PROTOCOL'], $q)) {
... | [
"private",
"static",
"function",
"aggregateHttpProtocolVersionFromServer",
"(",
"$",
"server",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"server",
"[",
"'SERVER_PROTOCOL'",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"pattern",
"=",
"'/^(?P<schem... | Get HTTP protocol version from server variables.
@param $server The server variables.
@return string | [
"Get",
"HTTP",
"protocol",
"version",
"from",
"server",
"variables",
"."
] | d4f5ca4cc08c4e48bed596ead3b58e006ab57d6f | https://github.com/plvhx/psr7-http-message/blob/d4f5ca4cc08c4e48bed596ead3b58e006ab57d6f/src/ServerRequestFactory.php#L84-L97 |
7,499 | plvhx/psr7-http-message | src/ServerRequestFactory.php | ServerRequestFactory.aggregateUriFromServer | private static function aggregateUriFromServer($server)
{
$uri = new Uri();
$scheme = 'http';
$uri = $uri->withScheme($scheme);
if (isset($server['SERVER_NAME'])) {
$uri = $uri->withHost($server['SERVER_NAME']);
}
if (isset($server['SERVER_PORT'])) {
... | php | private static function aggregateUriFromServer($server)
{
$uri = new Uri();
$scheme = 'http';
$uri = $uri->withScheme($scheme);
if (isset($server['SERVER_NAME'])) {
$uri = $uri->withHost($server['SERVER_NAME']);
}
if (isset($server['SERVER_PORT'])) {
... | [
"private",
"static",
"function",
"aggregateUriFromServer",
"(",
"$",
"server",
")",
"{",
"$",
"uri",
"=",
"new",
"Uri",
"(",
")",
";",
"$",
"scheme",
"=",
"'http'",
";",
"$",
"uri",
"=",
"$",
"uri",
"->",
"withScheme",
"(",
"$",
"scheme",
")",
";",
... | Aggregate URI component from server variables.
@param $server The server variables.
@return UriInterface | [
"Aggregate",
"URI",
"component",
"from",
"server",
"variables",
"."
] | d4f5ca4cc08c4e48bed596ead3b58e006ab57d6f | https://github.com/plvhx/psr7-http-message/blob/d4f5ca4cc08c4e48bed596ead3b58e006ab57d6f/src/ServerRequestFactory.php#L105-L133 |
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.