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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
23,400 | glynnforrest/blockade | src/Blockade/Firewall.php | Firewall.setPermissionNames | public function setPermissionNames($any, $none, $user, $anon)
{
if ($any) {
$this->any = $any;
}
if ($none) {
$this->none = $none;
}
if ($user) {
$this->user = $user;
}
if ($anon) {
$this->anon = $anon;
}... | php | public function setPermissionNames($any, $none, $user, $anon)
{
if ($any) {
$this->any = $any;
}
if ($none) {
$this->none = $none;
}
if ($user) {
$this->user = $user;
}
if ($anon) {
$this->anon = $anon;
}... | [
"public",
"function",
"setPermissionNames",
"(",
"$",
"any",
",",
"$",
"none",
",",
"$",
"user",
",",
"$",
"anon",
")",
"{",
"if",
"(",
"$",
"any",
")",
"{",
"$",
"this",
"->",
"any",
"=",
"$",
"any",
";",
"}",
"if",
"(",
"$",
"none",
")",
"{... | Set the names of the permissions to use for any, none, user and
anonymous rules. Set any of these to null to continue using the
current name.
@param string $any The rule that allows any request
@param string $none The rule that blocks any request
@param string $user The rule that allows any authentication
@param stri... | [
"Set",
"the",
"names",
"of",
"the",
"permissions",
"to",
"use",
"for",
"any",
"none",
"user",
"and",
"anonymous",
"rules",
".",
"Set",
"any",
"of",
"these",
"to",
"null",
"to",
"continue",
"using",
"the",
"current",
"name",
"."
] | 5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/Firewall.php#L79-L93 |
23,401 | glynnforrest/blockade | src/Blockade/Firewall.php | Firewall.check | public function check(Request $request)
{
//first check the exemptions. If the request passes any of
//these, skip all other rules and grant explicit access.
foreach ($this->exemptions as $exemption) {
try {
if (true === $this->checkRule($request, $exemption)) {
... | php | public function check(Request $request)
{
//first check the exemptions. If the request passes any of
//these, skip all other rules and grant explicit access.
foreach ($this->exemptions as $exemption) {
try {
if (true === $this->checkRule($request, $exemption)) {
... | [
"public",
"function",
"check",
"(",
"Request",
"$",
"request",
")",
"{",
"//first check the exemptions. If the request passes any of",
"//these, skip all other rules and grant explicit access.",
"foreach",
"(",
"$",
"this",
"->",
"exemptions",
"as",
"$",
"exemption",
")",
"... | Check if a Request has permission to access a resource.
@param Request $request The request to check
@return Boolean true if the request is granted explicit access
via an exemption, false if the request passed but has not been
granted explicit access (allowing other firewalls to check)
@throws AuthenticationException... | [
"Check",
"if",
"a",
"Request",
"has",
"permission",
"to",
"access",
"a",
"resource",
"."
] | 5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/Firewall.php#L117-L141 |
23,402 | mmanos/laravel-casset | src/Mmanos/Casset/Compressors/Css.php | Css._commentCB | protected function _commentCB($m)
{
$hasSurroundingWs = (trim($m[0]) !== $m[1]);
$m = $m[1];
// $m is the comment content w/o the surrounding tokens,
// but the return value will replace the entire comment.
if ($m === 'keep') {
return '/**/';
}
i... | php | protected function _commentCB($m)
{
$hasSurroundingWs = (trim($m[0]) !== $m[1]);
$m = $m[1];
// $m is the comment content w/o the surrounding tokens,
// but the return value will replace the entire comment.
if ($m === 'keep') {
return '/**/';
}
i... | [
"protected",
"function",
"_commentCB",
"(",
"$",
"m",
")",
"{",
"$",
"hasSurroundingWs",
"=",
"(",
"trim",
"(",
"$",
"m",
"[",
"0",
"]",
")",
"!==",
"$",
"m",
"[",
"1",
"]",
")",
";",
"$",
"m",
"=",
"$",
"m",
"[",
"1",
"]",
";",
"// $m is the... | Process a comment and return a replacement
@param array $m regex matches
@return string | [
"Process",
"a",
"comment",
"and",
"return",
"a",
"replacement"
] | 0f7db71211c1daa99bde30afa41da2692a39b81c | https://github.com/mmanos/laravel-casset/blob/0f7db71211c1daa99bde30afa41da2692a39b81c/src/Mmanos/Casset/Compressors/Css.php#L173-L224 |
23,403 | netvlies/NetvliesFormBundle | EventListener/SubmitListener.php | SubmitListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
if ($request->isMethod('post')) {
$formId = $request->request->getInt('form[form_id]', 0, true);
if ($formId > 0) {
$form = $this->container->get('netvlies.form')->ge... | php | public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
if ($request->isMethod('post')) {
$formId = $request->request->getInt('form[form_id]', 0, true);
if ($formId > 0) {
$form = $this->container->get('netvlies.form')->ge... | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"$",
"request",
"->",
"isMethod",
"(",
"'post'",
")",
")",
"{",
"$",
"formId",
"=... | Checks if a form post request was mad. If so, it validates the form input
and upon success dispatches the form success event, which can be used for
further custom handling of the received data.
@param $event | [
"Checks",
"if",
"a",
"form",
"post",
"request",
"was",
"mad",
".",
"If",
"so",
"it",
"validates",
"the",
"form",
"input",
"and",
"upon",
"success",
"dispatches",
"the",
"form",
"success",
"event",
"which",
"can",
"be",
"used",
"for",
"further",
"custom",
... | 93f9a3321d9925040111374e7c1014a6400a2d08 | https://github.com/netvlies/NetvliesFormBundle/blob/93f9a3321d9925040111374e7c1014a6400a2d08/EventListener/SubmitListener.php#L27-L51 |
23,404 | hametuha/wpametu | src/WPametu/Service/Akismet.php | Akismet.is_spam | public static function is_spam( array $values = [] ){
$query_string = self::make_request( $values );
// If Akismet is not active, always return error
if( !class_exists('Akismet') || ! \Akismet::get_api_key() ){
return new \WP_Error(500, 'Akismet is not active.');
}
// Make request
add_filter('akismet_ua'... | php | public static function is_spam( array $values = [] ){
$query_string = self::make_request( $values );
// If Akismet is not active, always return error
if( !class_exists('Akismet') || ! \Akismet::get_api_key() ){
return new \WP_Error(500, 'Akismet is not active.');
}
// Make request
add_filter('akismet_ua'... | [
"public",
"static",
"function",
"is_spam",
"(",
"array",
"$",
"values",
"=",
"[",
"]",
")",
"{",
"$",
"query_string",
"=",
"self",
"::",
"make_request",
"(",
"$",
"values",
")",
";",
"// If Akismet is not active, always return error",
"if",
"(",
"!",
"class_ex... | Check if data is spam
@param array $values
@return bool|\WP_Error | [
"Check",
"if",
"data",
"is",
"spam"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Service/Akismet.php#L24-L52 |
23,405 | hametuha/wpametu | src/WPametu/Service/Akismet.php | Akismet.make_request | public static function make_request( array $args = [] ){
$args = wp_parse_args([
'blog' => get_option( 'home' ),
'blog_lang' => get_locale(),
'blog_charset' => get_option( 'blog_charset' ),
'user_ip' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '',
'user_agent' => isset($_SERVER['HTTP_... | php | public static function make_request( array $args = [] ){
$args = wp_parse_args([
'blog' => get_option( 'home' ),
'blog_lang' => get_locale(),
'blog_charset' => get_option( 'blog_charset' ),
'user_ip' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '',
'user_agent' => isset($_SERVER['HTTP_... | [
"public",
"static",
"function",
"make_request",
"(",
"array",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"$",
"args",
"=",
"wp_parse_args",
"(",
"[",
"'blog'",
"=>",
"get_option",
"(",
"'home'",
")",
",",
"'blog_lang'",
"=>",
"get_locale",
"(",
")",
",",
"'... | Make request arguments
@param array $args
@return string | [
"Make",
"request",
"arguments"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Service/Akismet.php#L61-L87 |
23,406 | surebert/surebert-framework | src/sb/Gitlab/Client.php | Client.get | public function get($url, $data = [], $method = 'post') {
$ch = curl_init($this->gitlab_host . '/api/v3' . $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'PRIVATE-TOKEN:' . $this->private_key
));
if($this->debug){
... | php | public function get($url, $data = [], $method = 'post') {
$ch = curl_init($this->gitlab_host . '/api/v3' . $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'PRIVATE-TOKEN:' . $this->private_key
));
if($this->debug){
... | [
"public",
"function",
"get",
"(",
"$",
"url",
",",
"$",
"data",
"=",
"[",
"]",
",",
"$",
"method",
"=",
"'post'",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
"$",
"this",
"->",
"gitlab_host",
".",
"'/api/v3'",
".",
"$",
"url",
")",
";",
"curl_set... | GRabs data from a URL and json_decodes it
@param string $url URL to grab
@param array $data http data to pass
@param string $method post, put delete, default post
@return object
@throws Exception | [
"GRabs",
"data",
"from",
"a",
"URL",
"and",
"json_decodes",
"it"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Gitlab/Client.php#L63-L108 |
23,407 | heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Example/Finder.php | Finder.getExampleFileContents | private function getExampleFileContents($filename)
{
$normalizedPath = null;
foreach ($this->exampleDirectories as $directory) {
$exampleFileFromConfig = $this->constructExamplePath($directory, $filename);
if (is_readable($exampleFileFromConfig)) {
$normalize... | php | private function getExampleFileContents($filename)
{
$normalizedPath = null;
foreach ($this->exampleDirectories as $directory) {
$exampleFileFromConfig = $this->constructExamplePath($directory, $filename);
if (is_readable($exampleFileFromConfig)) {
$normalize... | [
"private",
"function",
"getExampleFileContents",
"(",
"$",
"filename",
")",
"{",
"$",
"normalizedPath",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"exampleDirectories",
"as",
"$",
"directory",
")",
"{",
"$",
"exampleFileFromConfig",
"=",
"$",
"this",... | Attempts to find the requested example file and returns its contents or null if no file was found.
This method will try several methods in search of the given example file, the first one it encounters is
returned:
1. Iterates through all examples folders for the given filename
2. Checks the source folder for the give... | [
"Attempts",
"to",
"find",
"the",
"requested",
"example",
"file",
"and",
"returns",
"its",
"contents",
"or",
"null",
"if",
"no",
"file",
"was",
"found",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Example/Finder.php#L103-L126 |
23,408 | novaway/open-graph | src/Metadata/ClassMetadata.php | ClassMetadata.addGraphMetadata | public function addGraphMetadata(GraphNode $node, GraphMetadataInterface $data)
{
$this->nodes[] = [
'node' => $node,
'object' => $data,
];
return $this;
} | php | public function addGraphMetadata(GraphNode $node, GraphMetadataInterface $data)
{
$this->nodes[] = [
'node' => $node,
'object' => $data,
];
return $this;
} | [
"public",
"function",
"addGraphMetadata",
"(",
"GraphNode",
"$",
"node",
",",
"GraphMetadataInterface",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"nodes",
"[",
"]",
"=",
"[",
"'node'",
"=>",
"$",
"node",
",",
"'object'",
"=>",
"$",
"data",
",",
"]",
";... | Add OpenGraph metadata
@param GraphNode $type
@param GraphMetadataInterface $data
@return ClassMetadata | [
"Add",
"OpenGraph",
"metadata"
] | 19817bee4b91cf26ca3fe44883ad58b32328e464 | https://github.com/novaway/open-graph/blob/19817bee4b91cf26ca3fe44883ad58b32328e464/src/Metadata/ClassMetadata.php#L51-L59 |
23,409 | shtrihstr/simple-rest-api | src/Router.php | Router.match | public function match( $method, $path, callable $callback ) {
$route = new Route( mb_strtoupper( $method ), $path, $callback );
$this->_routes[] = $route;
return $route;
} | php | public function match( $method, $path, callable $callback ) {
$route = new Route( mb_strtoupper( $method ), $path, $callback );
$this->_routes[] = $route;
return $route;
} | [
"public",
"function",
"match",
"(",
"$",
"method",
",",
"$",
"path",
",",
"callable",
"$",
"callback",
")",
"{",
"$",
"route",
"=",
"new",
"Route",
"(",
"mb_strtoupper",
"(",
"$",
"method",
")",
",",
"$",
"path",
",",
"$",
"callback",
")",
";",
"$"... | Maps a request to a callable.
@param string $method Request method
@param string $path Matched route path
@param callable $callback Callback that returns the response when matched
@return Route | [
"Maps",
"a",
"request",
"to",
"a",
"callable",
"."
] | e59c87a604065525729486de3081d4a44aa2468e | https://github.com/shtrihstr/simple-rest-api/blob/e59c87a604065525729486de3081d4a44aa2468e/src/Router.php#L111-L115 |
23,410 | infinity-next/sleuth | src/Traits/DetectiveTrait.php | DetectiveTrait.check | public function check($file, $verify = null)
{
if ($this->prepareFile($file))
{
$leads = $this->leads();
if (!is_null($verify))
{
if (isset($leads[$verify]))
{
return $this->checkLead($leads[$verify]);
}
return false;
}
else
{
foreach ($leads as $lead)
... | php | public function check($file, $verify = null)
{
if ($this->prepareFile($file))
{
$leads = $this->leads();
if (!is_null($verify))
{
if (isset($leads[$verify]))
{
return $this->checkLead($leads[$verify]);
}
return false;
}
else
{
foreach ($leads as $lead)
... | [
"public",
"function",
"check",
"(",
"$",
"file",
",",
"$",
"verify",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"prepareFile",
"(",
"$",
"file",
")",
")",
"{",
"$",
"leads",
"=",
"$",
"this",
"->",
"leads",
"(",
")",
";",
"if",
"(",
... | Check the the file against our leads.
@param mixed $file File to check.
@param string|null $verify Extension to verify against. Checks all possible if unset.
@return boolean True if we solved the case, false if not. | [
"Check",
"the",
"the",
"file",
"against",
"our",
"leads",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Traits/DetectiveTrait.php#L63-L99 |
23,411 | infinity-next/sleuth | src/Traits/DetectiveTrait.php | DetectiveTrait.closeCase | protected function closeCase($ext, $mime, array $meta = array())
{
$this->caseClosed = true;
$this->extension = $ext;
$this->mime = $mime;
$this->metadata = $meta;
return true;
} | php | protected function closeCase($ext, $mime, array $meta = array())
{
$this->caseClosed = true;
$this->extension = $ext;
$this->mime = $mime;
$this->metadata = $meta;
return true;
} | [
"protected",
"function",
"closeCase",
"(",
"$",
"ext",
",",
"$",
"mime",
",",
"array",
"$",
"meta",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"caseClosed",
"=",
"true",
";",
"$",
"this",
"->",
"extension",
"=",
"$",
"ext",
";",
"$",
"t... | Closes the case by setting protected properties.
@param string $ext File extension.
@param string $mime Mime type.
@param array $meta Meta data, optional. Must be array.
@return boolean | [
"Closes",
"the",
"case",
"by",
"setting",
"protected",
"properties",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Traits/DetectiveTrait.php#L120-L127 |
23,412 | infinity-next/sleuth | src/Traits/DetectiveTrait.php | DetectiveTrait.leads | protected function leads()
{
// Pull a list of methods that have the leadEXT syntax.
$leads = preg_grep('/^lead(?<ext>[A-Z0-9]+)$/', get_class_methods($this));
// Organize them as an array where keys and values are the same thing.
$leads = array_combine($leads, $leads);
// Try to find an extension meth... | php | protected function leads()
{
// Pull a list of methods that have the leadEXT syntax.
$leads = preg_grep('/^lead(?<ext>[A-Z0-9]+)$/', get_class_methods($this));
// Organize them as an array where keys and values are the same thing.
$leads = array_combine($leads, $leads);
// Try to find an extension meth... | [
"protected",
"function",
"leads",
"(",
")",
"{",
"// Pull a list of methods that have the leadEXT syntax.\r",
"$",
"leads",
"=",
"preg_grep",
"(",
"'/^lead(?<ext>[A-Z0-9]+)$/'",
",",
"get_class_methods",
"(",
"$",
"this",
")",
")",
";",
"// Organize them as an array where k... | Returns an array of file extensions this detective has leads on.
@return array Of file extensions. | [
"Returns",
"an",
"array",
"of",
"file",
"extensions",
"this",
"detective",
"has",
"leads",
"on",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Traits/DetectiveTrait.php#L229-L250 |
23,413 | FrenzelGmbH/cm-address | controllers/base/CountryController.php | CountryController.actionCreate | public function actionCreate()
{
$model = new Country;
try {
if ($model->load($_POST) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} elseif (!\Yii::$app->request->isPost) {
$model->load($_GET);
}
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();... | php | public function actionCreate()
{
$model = new Country;
try {
if ($model->load($_POST) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} elseif (!\Yii::$app->request->isPost) {
$model->load($_GET);
}
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();... | [
"public",
"function",
"actionCreate",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"Country",
";",
"try",
"{",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"$",
"_POST",
")",
"&&",
"$",
"model",
"->",
"save",
"(",
")",
")",
"{",
"return",
"$",
"this",... | Creates a new Country model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed | [
"Creates",
"a",
"new",
"Country",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/base/CountryController.php#L71-L86 |
23,414 | FrenzelGmbH/cm-address | controllers/base/CountryController.php | CountryController.actionUpdate | public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load($_POST) && $model->save()) {
return $this->redirect(Url::previous());
} else {
return $this->render('update', [
'model' => $model,
]);
}
} | php | public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load($_POST) && $model->save()) {
return $this->redirect(Url::previous());
} else {
return $this->render('update', [
'model' => $model,
]);
}
} | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"$",
"_POST",
")",
"&&",
"$",
"model",
"->",
"save",
"(",
"... | Updates an existing Country model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Country",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"view",
"page",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/base/CountryController.php#L94-L105 |
23,415 | FrenzelGmbH/cm-address | controllers/base/CountryController.php | CountryController.actionDelete | public function actionDelete($id)
{
try {
$this->findModel($id)->delete();
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();
\Yii::$app->getSession()->addFlash('error', $msg);
return $this->redirect(Url::previous());
}
// TODO: improve detection
$isPivot = strstr('$id',',');... | php | public function actionDelete($id)
{
try {
$this->findModel($id)->delete();
} catch (\Exception $e) {
$msg = (isset($e->errorInfo[2]))?$e->errorInfo[2]:$e->getMessage();
\Yii::$app->getSession()->addFlash('error', $msg);
return $this->redirect(Url::previous());
}
// TODO: improve detection
$isPivot = strstr('$id',',');... | [
"public",
"function",
"actionDelete",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
"->",
"delete",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"msg",
"=",
"(",
"iss... | Deletes an existing Country model.
If deletion is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Deletes",
"an",
"existing",
"Country",
"model",
".",
"If",
"deletion",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | 4295671dc603beed4bea6c5a7f77dac9846127f3 | https://github.com/FrenzelGmbH/cm-address/blob/4295671dc603beed4bea6c5a7f77dac9846127f3/controllers/base/CountryController.php#L113-L136 |
23,416 | chippyash/Assembly-Builder | src/chippyash/Assembler/Assembler.php | Assembler.create | public static function create(array $params = [])
{
$assembler = new static();
if (!empty($params)) {
array_walk($params, function($v, $k) use ($assembler) {
$assembler->$k(function() use($v) {return $v;});
});
$assembler->assemble();
}
... | php | public static function create(array $params = [])
{
$assembler = new static();
if (!empty($params)) {
array_walk($params, function($v, $k) use ($assembler) {
$assembler->$k(function() use($v) {return $v;});
});
$assembler->assemble();
}
... | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"assembler",
"=",
"new",
"static",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"params",
")",
")",
"{",
"array_walk",
"(",
"$",
"params",
"... | Static Assembler constructor
Returns a new Assembler
@param array $params Immutable parameters to send into the assembler
@return static | [
"Static",
"Assembler",
"constructor",
"Returns",
"a",
"new",
"Assembler"
] | be477306b7a1c09b48ce9e100f9f6680035d0df3 | https://github.com/chippyash/Assembly-Builder/blob/be477306b7a1c09b48ce9e100f9f6680035d0df3/src/chippyash/Assembler/Assembler.php#L48-L59 |
23,417 | chippyash/Assembly-Builder | src/chippyash/Assembler/Assembler.php | Assembler.get | public static function get(array $params = [])
{
if (empty(self::$singleton)) {
self::$singleton = static::create($params);
}
return self::$singleton;
} | php | public static function get(array $params = [])
{
if (empty(self::$singleton)) {
self::$singleton = static::create($params);
}
return self::$singleton;
} | [
"public",
"static",
"function",
"get",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"singleton",
")",
")",
"{",
"self",
"::",
"$",
"singleton",
"=",
"static",
"::",
"create",
"(",
"$",
"params",
... | Return Singleton instance of Assembler
@param array $params Immutable parameters to send into the assembler
@return Assembler | [
"Return",
"Singleton",
"instance",
"of",
"Assembler"
] | be477306b7a1c09b48ce9e100f9f6680035d0df3 | https://github.com/chippyash/Assembly-Builder/blob/be477306b7a1c09b48ce9e100f9f6680035d0df3/src/chippyash/Assembler/Assembler.php#L68-L75 |
23,418 | chippyash/Assembly-Builder | src/chippyash/Assembler/Assembler.php | Assembler.assemble | public function assemble()
{
foreach ($this->placeHolders as $name => $placeholder) {
if (!isset($this->values[$name])) {
$this->values[$name] = $this->addVars($placeholder);
}
}
return $this;
} | php | public function assemble()
{
foreach ($this->placeHolders as $name => $placeholder) {
if (!isset($this->values[$name])) {
$this->values[$name] = $this->addVars($placeholder);
}
}
return $this;
} | [
"public",
"function",
"assemble",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"placeHolders",
"as",
"$",
"name",
"=>",
"$",
"placeholder",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"values",
"[",
"$",
"name",
"]",
")",
")",
... | Run the Assembly not returning any value.
Assembly will not overwrite anything already assembled
@return $this | [
"Run",
"the",
"Assembly",
"not",
"returning",
"any",
"value",
".",
"Assembly",
"will",
"not",
"overwrite",
"anything",
"already",
"assembled"
] | be477306b7a1c09b48ce9e100f9f6680035d0df3 | https://github.com/chippyash/Assembly-Builder/blob/be477306b7a1c09b48ce9e100f9f6680035d0df3/src/chippyash/Assembler/Assembler.php#L129-L138 |
23,419 | chippyash/Assembly-Builder | src/chippyash/Assembler/Assembler.php | Assembler.merge | public function merge(Assembler $other)
{
//N.B. reflection used so as to not expose values
//via some public method
$refl = new \ReflectionObject($other);
$reflValues = $refl->getProperty('values');
$reflValues->setAccessible(true);
$oValues = $reflValues->getValue($... | php | public function merge(Assembler $other)
{
//N.B. reflection used so as to not expose values
//via some public method
$refl = new \ReflectionObject($other);
$reflValues = $refl->getProperty('values');
$reflValues->setAccessible(true);
$oValues = $reflValues->getValue($... | [
"public",
"function",
"merge",
"(",
"Assembler",
"$",
"other",
")",
"{",
"//N.B. reflection used so as to not expose values",
"//via some public method",
"$",
"refl",
"=",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"other",
")",
";",
"$",
"reflValues",
"=",
"$",
"... | Merge this assembly with another.
Obeys the rules of array_merge
@param Assembler $other
@return $this | [
"Merge",
"this",
"assembly",
"with",
"another",
".",
"Obeys",
"the",
"rules",
"of",
"array_merge"
] | be477306b7a1c09b48ce9e100f9f6680035d0df3 | https://github.com/chippyash/Assembly-Builder/blob/be477306b7a1c09b48ce9e100f9f6680035d0df3/src/chippyash/Assembler/Assembler.php#L148-L163 |
23,420 | chippyash/Assembly-Builder | src/chippyash/Assembler/Assembler.php | Assembler.addVars | protected function addVars(\Closure $func)
{
$args = (new \ReflectionFunction($func))->getParameters();
if (count($args) === 0) {
return $func();
}
$fArgs = array_map(function($key) {
return $this->values[$key];
},
array_map(function($arg)... | php | protected function addVars(\Closure $func)
{
$args = (new \ReflectionFunction($func))->getParameters();
if (count($args) === 0) {
return $func();
}
$fArgs = array_map(function($key) {
return $this->values[$key];
},
array_map(function($arg)... | [
"protected",
"function",
"addVars",
"(",
"\\",
"Closure",
"$",
"func",
")",
"{",
"$",
"args",
"=",
"(",
"new",
"\\",
"ReflectionFunction",
"(",
"$",
"func",
")",
")",
"->",
"getParameters",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
... | Execute the function assigned to the value, binding in values created earlier
in the assembly
@param \Closure $func
@return mixed | [
"Execute",
"the",
"function",
"assigned",
"to",
"the",
"value",
"binding",
"in",
"values",
"created",
"earlier",
"in",
"the",
"assembly"
] | be477306b7a1c09b48ce9e100f9f6680035d0df3 | https://github.com/chippyash/Assembly-Builder/blob/be477306b7a1c09b48ce9e100f9f6680035d0df3/src/chippyash/Assembler/Assembler.php#L173-L191 |
23,421 | infinity-next/sleuth | src/Detectives/svgDetective.php | svgDetective.leadSVG | protected function leadSVG()
{
// Create a new sanitizer instance
$sanitizer = new Sanitizer();
// Load the dirty svg
$dirtySVG = file_get_contents($this->file);
// Pass it to the sanitizer and get it back clean
$cleanSVG = $sanitizer->sanitize($dirtySVG);
if (is_string($cleanSVG))
{
... | php | protected function leadSVG()
{
// Create a new sanitizer instance
$sanitizer = new Sanitizer();
// Load the dirty svg
$dirtySVG = file_get_contents($this->file);
// Pass it to the sanitizer and get it back clean
$cleanSVG = $sanitizer->sanitize($dirtySVG);
if (is_string($cleanSVG))
{
... | [
"protected",
"function",
"leadSVG",
"(",
")",
"{",
"// Create a new sanitizer instance\r",
"$",
"sanitizer",
"=",
"new",
"Sanitizer",
"(",
")",
";",
"// Load the dirty svg\r",
"$",
"dirtySVG",
"=",
"file_get_contents",
"(",
"$",
"this",
"->",
"file",
")",
";",
"... | Checks if thise file is a valid SVG.
@return boolean|null | [
"Checks",
"if",
"thise",
"file",
"is",
"a",
"valid",
"SVG",
"."
] | 924b82e4d60f042fddd6b093b324cfa4bb885a13 | https://github.com/infinity-next/sleuth/blob/924b82e4d60f042fddd6b093b324cfa4bb885a13/src/Detectives/svgDetective.php#L16-L33 |
23,422 | brianium/nomnom | src/Nomnom/UnitResolver.php | UnitResolver.resolve | public static function resolve($key)
{
if ($key == 'B') return 0;
$dict = static::$metric;
if (preg_match(static::IEC_PATTERN, $key))
$dict = static::$binary;
if (array_key_exists($key, $dict)) return $dict[$key];
throw new UnitNotFoundException(sprintf('Unit "%s"... | php | public static function resolve($key)
{
if ($key == 'B') return 0;
$dict = static::$metric;
if (preg_match(static::IEC_PATTERN, $key))
$dict = static::$binary;
if (array_key_exists($key, $dict)) return $dict[$key];
throw new UnitNotFoundException(sprintf('Unit "%s"... | [
"public",
"static",
"function",
"resolve",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"key",
"==",
"'B'",
")",
"return",
"0",
";",
"$",
"dict",
"=",
"static",
"::",
"$",
"metric",
";",
"if",
"(",
"preg_match",
"(",
"static",
"::",
"IEC_PATTERN",
",... | Lookup the exponent based on prefix
@param $key
@throws UnitNotFoundException
@return int | [
"Lookup",
"the",
"exponent",
"based",
"on",
"prefix"
] | 012e3a6ad17fe2393b6a9db1a4b14c91ab91adcd | https://github.com/brianium/nomnom/blob/012e3a6ad17fe2393b6a9db1a4b14c91ab91adcd/src/Nomnom/UnitResolver.php#L57-L65 |
23,423 | brianium/nomnom | src/Nomnom/UnitResolver.php | UnitResolver.unitsAreDifferent | public static function unitsAreDifferent($first, $second)
{
return
(preg_match(UnitResolver::SI_PATTERN, $first) && preg_match(UnitResolver::IEC_PATTERN, $second)) ||
(preg_match(UnitResolver::IEC_PATTERN, $first) && preg_match(UnitResolver::SI_PATTERN, $second));
} | php | public static function unitsAreDifferent($first, $second)
{
return
(preg_match(UnitResolver::SI_PATTERN, $first) && preg_match(UnitResolver::IEC_PATTERN, $second)) ||
(preg_match(UnitResolver::IEC_PATTERN, $first) && preg_match(UnitResolver::SI_PATTERN, $second));
} | [
"public",
"static",
"function",
"unitsAreDifferent",
"(",
"$",
"first",
",",
"$",
"second",
")",
"{",
"return",
"(",
"preg_match",
"(",
"UnitResolver",
"::",
"SI_PATTERN",
",",
"$",
"first",
")",
"&&",
"preg_match",
"(",
"UnitResolver",
"::",
"IEC_PATTERN",
... | Check if two units are in the same
family
@param string $first
@param string $second
@return bool | [
"Check",
"if",
"two",
"units",
"are",
"in",
"the",
"same",
"family"
] | 012e3a6ad17fe2393b6a9db1a4b14c91ab91adcd | https://github.com/brianium/nomnom/blob/012e3a6ad17fe2393b6a9db1a4b14c91ab91adcd/src/Nomnom/UnitResolver.php#L76-L81 |
23,424 | thiagodp/rtti | lib/RTTI.php | RTTI.getAttributes | static function getAttributes(
$obj
, $visibilityFlags = null
, $getterPrefix = 'get'
, $useCamelCase = true
, $convertInternalObjects = false
) {
if ( ! isset( $obj ) ) {
return array();
}
$flags = null === $visibilityFlags ? self::allFlags() : $visibilityFlags;
$attributes = array();
$reflect... | php | static function getAttributes(
$obj
, $visibilityFlags = null
, $getterPrefix = 'get'
, $useCamelCase = true
, $convertInternalObjects = false
) {
if ( ! isset( $obj ) ) {
return array();
}
$flags = null === $visibilityFlags ? self::allFlags() : $visibilityFlags;
$attributes = array();
$reflect... | [
"static",
"function",
"getAttributes",
"(",
"$",
"obj",
",",
"$",
"visibilityFlags",
"=",
"null",
",",
"$",
"getterPrefix",
"=",
"'get'",
",",
"$",
"useCamelCase",
"=",
"true",
",",
"$",
"convertInternalObjects",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"... | Retrieve names and values from the attributes of a object, as a map.
@param object $obj The object.
@param int $visibilityFlags Filter visibility flags. Can be added.
Example: RTTI::IS_PRIVATE | RTTI::IS_PROTECTED
Optional, defaults to RTTI::allFlags().
@param string $getterPrefix The prefix for getter publi... | [
"Retrieve",
"names",
"and",
"values",
"from",
"the",
"attributes",
"of",
"a",
"object",
"as",
"a",
"map",
"."
] | 513056bb2843bbf495a83f8a1481c9aaec120c4b | https://github.com/thiagodp/rtti/blob/513056bb2843bbf495a83f8a1481c9aaec120c4b/lib/RTTI.php#L56-L126 |
23,425 | thiagodp/rtti | lib/RTTI.php | RTTI.getPrivateAttributes | static function getPrivateAttributes( $obj, $getterPrefix = 'get', $useCamelCase = true ) {
return self::getAttributes( $obj, self::IS_PRIVATE, $getterPrefix, $useCamelCase );
} | php | static function getPrivateAttributes( $obj, $getterPrefix = 'get', $useCamelCase = true ) {
return self::getAttributes( $obj, self::IS_PRIVATE, $getterPrefix, $useCamelCase );
} | [
"static",
"function",
"getPrivateAttributes",
"(",
"$",
"obj",
",",
"$",
"getterPrefix",
"=",
"'get'",
",",
"$",
"useCamelCase",
"=",
"true",
")",
"{",
"return",
"self",
"::",
"getAttributes",
"(",
"$",
"obj",
",",
"self",
"::",
"IS_PRIVATE",
",",
"$",
"... | Retrieve names and values from the private attributes of a object, as a map.
This method has been kept for backward compatibility.
@param object $obj The object.
@param string $getterPrefix The prefix for getter public methods (defaults to 'get').
@param bool $useCamelCase If true, private attributes will be acc... | [
"Retrieve",
"names",
"and",
"values",
"from",
"the",
"private",
"attributes",
"of",
"a",
"object",
"as",
"a",
"map",
".",
"This",
"method",
"has",
"been",
"kept",
"for",
"backward",
"compatibility",
"."
] | 513056bb2843bbf495a83f8a1481c9aaec120c4b | https://github.com/thiagodp/rtti/blob/513056bb2843bbf495a83f8a1481c9aaec120c4b/lib/RTTI.php#L137-L139 |
23,426 | thiagodp/rtti | lib/RTTI.php | RTTI.setAttributes | static function setAttributes(
array $map
, &$obj
, $visibilityFlags = null
, $setterPrefix = 'set'
, $useCamelCase = true
) {
$flags = null === $visibilityFlags ? self::allFlags() : $visibilityFlags;
$reflectionObject = new \ReflectionObject( $obj );
$currentClass = new \ReflectionClass( $obj );
wh... | php | static function setAttributes(
array $map
, &$obj
, $visibilityFlags = null
, $setterPrefix = 'set'
, $useCamelCase = true
) {
$flags = null === $visibilityFlags ? self::allFlags() : $visibilityFlags;
$reflectionObject = new \ReflectionObject( $obj );
$currentClass = new \ReflectionClass( $obj );
wh... | [
"static",
"function",
"setAttributes",
"(",
"array",
"$",
"map",
",",
"&",
"$",
"obj",
",",
"$",
"visibilityFlags",
"=",
"null",
",",
"$",
"setterPrefix",
"=",
"'set'",
",",
"$",
"useCamelCase",
"=",
"true",
")",
"{",
"$",
"flags",
"=",
"null",
"===",
... | Set the attribute values of a object.
@param array $map A map with the attribute names and values to be changed.
@param object $obj The object to be changed.
@param int $visibilityFlags Filter visibility flags. Can be added.
Example: RTTI::IS_PRIVATE | RTTI::IS_PROTECTED
Optional, defaults to RTTI::allFlags... | [
"Set",
"the",
"attribute",
"values",
"of",
"a",
"object",
"."
] | 513056bb2843bbf495a83f8a1481c9aaec120c4b | https://github.com/thiagodp/rtti/blob/513056bb2843bbf495a83f8a1481c9aaec120c4b/lib/RTTI.php#L157-L214 |
23,427 | thiagodp/rtti | lib/RTTI.php | RTTI.setPrivateAttributes | static function setPrivateAttributes(
array $map, &$obj, $setterPrefix = 'set', $useCamelCase = true
) {
self::setAttributes( $map, $obj, \RTTI::IS_PRIVATE, $setterPrefix, $useCamelCase );
} | php | static function setPrivateAttributes(
array $map, &$obj, $setterPrefix = 'set', $useCamelCase = true
) {
self::setAttributes( $map, $obj, \RTTI::IS_PRIVATE, $setterPrefix, $useCamelCase );
} | [
"static",
"function",
"setPrivateAttributes",
"(",
"array",
"$",
"map",
",",
"&",
"$",
"obj",
",",
"$",
"setterPrefix",
"=",
"'set'",
",",
"$",
"useCamelCase",
"=",
"true",
")",
"{",
"self",
"::",
"setAttributes",
"(",
"$",
"map",
",",
"$",
"obj",
",",... | Set the attribute values of a object.
This method has been kept for backward compatibility.
@param array $map A map with the attribute names and values to be changed.
@param object $obj The object to be changed.
@param string $setterPrefix The prefix for setter public methods (defaults to 'set').
@param boo... | [
"Set",
"the",
"attribute",
"values",
"of",
"a",
"object",
".",
"This",
"method",
"has",
"been",
"kept",
"for",
"backward",
"compatibility",
"."
] | 513056bb2843bbf495a83f8a1481c9aaec120c4b | https://github.com/thiagodp/rtti/blob/513056bb2843bbf495a83f8a1481c9aaec120c4b/lib/RTTI.php#L229-L233 |
23,428 | Eresus/EresusCMS | src/core/framework/core/3rdparty/dwoo/Dwoo/Template/File.php | Dwoo_Template_File.getResourceIdentifier | public function getResourceIdentifier()
{
if ($this->resolvedPath !== null) {
return $this->resolvedPath;
} elseif ($this->includePath === null) {
return $this->file;
} else {
foreach ($this->includePath as $path) {
$path = rtrim($path, DIRECTORY_SEPARATOR);
if (file_exists($path.DIRECTORY_SEPAR... | php | public function getResourceIdentifier()
{
if ($this->resolvedPath !== null) {
return $this->resolvedPath;
} elseif ($this->includePath === null) {
return $this->file;
} else {
foreach ($this->includePath as $path) {
$path = rtrim($path, DIRECTORY_SEPARATOR);
if (file_exists($path.DIRECTORY_SEPAR... | [
"public",
"function",
"getResourceIdentifier",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resolvedPath",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"resolvedPath",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"includePath",
"===",
"null",
")... | returns this template's source filename
@return string | [
"returns",
"this",
"template",
"s",
"source",
"filename"
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/dwoo/Dwoo/Template/File.php#L138-L155 |
23,429 | welderlourenco/laravel-seeder | src/WelderLourenco/LaravelSeeder/LaravelSeeder.php | LaravelSeeder.read | private function read()
{
$files = $this->getFilesystem()->allFiles(app_path() . '/database/seeds');
$filtered = [];
foreach ($files as $file)
{
if (strpos(file_get_contents($file->getPathName()), 'extends Seeder') != false)
{
if ($file->getFileName() != 'DatabaseSeeder.php')
{
$filtered[]... | php | private function read()
{
$files = $this->getFilesystem()->allFiles(app_path() . '/database/seeds');
$filtered = [];
foreach ($files as $file)
{
if (strpos(file_get_contents($file->getPathName()), 'extends Seeder') != false)
{
if ($file->getFileName() != 'DatabaseSeeder.php')
{
$filtered[]... | [
"private",
"function",
"read",
"(",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"getFilesystem",
"(",
")",
"->",
"allFiles",
"(",
"app_path",
"(",
")",
".",
"'/database/seeds'",
")",
";",
"$",
"filtered",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
... | Get an array of all the files that is actually compatible with the files we're looking for. | [
"Get",
"an",
"array",
"of",
"all",
"the",
"files",
"that",
"is",
"actually",
"compatible",
"with",
"the",
"files",
"we",
"re",
"looking",
"for",
"."
] | 165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad | https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/LaravelSeeder.php#L147-L165 |
23,430 | welderlourenco/laravel-seeder | src/WelderLourenco/LaravelSeeder/LaravelSeeder.php | LaravelSeeder.write | private function write()
{
$content = '';
foreach ($this->getFiles() as $file)
{
$content .= '$this->call(\'' . str_replace('.php', '', $file) . '\');';
}
$databaseSeeder = str_replace('{calls}', $content, $this->getPattern());
$this->getFilesystem()->put(app_path() . '/database/seeds/DatabaseSeed... | php | private function write()
{
$content = '';
foreach ($this->getFiles() as $file)
{
$content .= '$this->call(\'' . str_replace('.php', '', $file) . '\');';
}
$databaseSeeder = str_replace('{calls}', $content, $this->getPattern());
$this->getFilesystem()->put(app_path() . '/database/seeds/DatabaseSeed... | [
"private",
"function",
"write",
"(",
")",
"{",
"$",
"content",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"getFiles",
"(",
")",
"as",
"$",
"file",
")",
"{",
"$",
"content",
".=",
"'$this->call(\\''",
".",
"str_replace",
"(",
"'.php'",
",",
"'... | Write the new DatabaseSeeder.php | [
"Write",
"the",
"new",
"DatabaseSeeder",
".",
"php"
] | 165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad | https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/LaravelSeeder.php#L171-L183 |
23,431 | welderlourenco/laravel-seeder | src/WelderLourenco/LaravelSeeder/LaravelSeeder.php | LaravelSeeder.restore | public function restore()
{
$this->getFilesystem()->put(app_path() . '/database/seeds/DatabaseSeeder.php', $this->getCopied());
$this->getFilesystem()->delete(app_path() . '/database/seeds/DatabaseSeeder.old');
} | php | public function restore()
{
$this->getFilesystem()->put(app_path() . '/database/seeds/DatabaseSeeder.php', $this->getCopied());
$this->getFilesystem()->delete(app_path() . '/database/seeds/DatabaseSeeder.old');
} | [
"public",
"function",
"restore",
"(",
")",
"{",
"$",
"this",
"->",
"getFilesystem",
"(",
")",
"->",
"put",
"(",
"app_path",
"(",
")",
".",
"'/database/seeds/DatabaseSeeder.php'",
",",
"$",
"this",
"->",
"getCopied",
"(",
")",
")",
";",
"$",
"this",
"->",... | Restore the DatabaseSeeder.php file to it's previous version. | [
"Restore",
"the",
"DatabaseSeeder",
".",
"php",
"file",
"to",
"it",
"s",
"previous",
"version",
"."
] | 165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad | https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/LaravelSeeder.php#L189-L194 |
23,432 | welderlourenco/laravel-seeder | src/WelderLourenco/LaravelSeeder/LaravelSeeder.php | LaravelSeeder.getList | public function getList($list)
{
$filteredList = [];
foreach (explode(',', $list) as $item)
{
if ($item != '')
{
$filteredList[] = $item;
}
}
return $filteredList;
} | php | public function getList($list)
{
$filteredList = [];
foreach (explode(',', $list) as $item)
{
if ($item != '')
{
$filteredList[] = $item;
}
}
return $filteredList;
} | [
"public",
"function",
"getList",
"(",
"$",
"list",
")",
"{",
"$",
"filteredList",
"=",
"[",
"]",
";",
"foreach",
"(",
"explode",
"(",
"','",
",",
"$",
"list",
")",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"!=",
"''",
")",
"{",
"$",
... | Recieves the string list entered by the developer, explode it and only return the ones filtered.
@param string $list
@return array | [
"Recieves",
"the",
"string",
"list",
"entered",
"by",
"the",
"developer",
"explode",
"it",
"and",
"only",
"return",
"the",
"ones",
"filtered",
"."
] | 165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad | https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/LaravelSeeder.php#L221-L234 |
23,433 | welderlourenco/laravel-seeder | src/WelderLourenco/LaravelSeeder/LaravelSeeder.php | LaravelSeeder.only | public function only($list)
{
$this->copy();
$this->readForOnly($list);
$this->write();
$this->setSeeded(count($this->getFiles()));
return true;
} | php | public function only($list)
{
$this->copy();
$this->readForOnly($list);
$this->write();
$this->setSeeded(count($this->getFiles()));
return true;
} | [
"public",
"function",
"only",
"(",
"$",
"list",
")",
"{",
"$",
"this",
"->",
"copy",
"(",
")",
";",
"$",
"this",
"->",
"readForOnly",
"(",
"$",
"list",
")",
";",
"$",
"this",
"->",
"write",
"(",
")",
";",
"$",
"this",
"->",
"setSeeded",
"(",
"c... | Copy the current DatabaseSeeder.php file, loop through each file and verify it's idententy with ther
files array, write the new DatabaseSeeder.php file and return true if it's alright.
@param string $list
@return boolean | [
"Copy",
"the",
"current",
"DatabaseSeeder",
".",
"php",
"file",
"loop",
"through",
"each",
"file",
"and",
"verify",
"it",
"s",
"idententy",
"with",
"ther",
"files",
"array",
"write",
"the",
"new",
"DatabaseSeeder",
".",
"php",
"file",
"and",
"return",
"true"... | 165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad | https://github.com/welderlourenco/laravel-seeder/blob/165d1f3bd596e985d5ef6ddd5fe3ad21589f17ad/src/WelderLourenco/LaravelSeeder/LaravelSeeder.php#L268-L279 |
23,434 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.get | public function get($content, array $variables = [])
{
$replacements = [];
$instruction = 'foreach';
foreach ($variables as $key => $values) {
$inner = $this->getInnerInstruction($content, $instruction);
foreach ($inner as $config) {
if (!str_contai... | php | public function get($content, array $variables = [])
{
$replacements = [];
$instruction = 'foreach';
foreach ($variables as $key => $values) {
$inner = $this->getInnerInstruction($content, $instruction);
foreach ($inner as $config) {
if (!str_contai... | [
"public",
"function",
"get",
"(",
"$",
"content",
",",
"array",
"$",
"variables",
"=",
"[",
"]",
")",
"{",
"$",
"replacements",
"=",
"[",
"]",
";",
"$",
"instruction",
"=",
"'foreach'",
";",
"foreach",
"(",
"$",
"variables",
"as",
"$",
"key",
"=>",
... | Gets variables filled notification content
@param string $content
@param array $variables
@return String | [
"Gets",
"variables",
"filled",
"notification",
"content"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L49-L85 |
23,435 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.fill | public function fill($content)
{
if ($this->hasInstructions($content)) {
$instructions = $this->getInstructions();
foreach ($instructions as $instruction) {
$content = $this->parseInstructions($content, $instruction);
}
}
return $this->fill... | php | public function fill($content)
{
if ($this->hasInstructions($content)) {
$instructions = $this->getInstructions();
foreach ($instructions as $instruction) {
$content = $this->parseInstructions($content, $instruction);
}
}
return $this->fill... | [
"public",
"function",
"fill",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasInstructions",
"(",
"$",
"content",
")",
")",
"{",
"$",
"instructions",
"=",
"$",
"this",
"->",
"getInstructions",
"(",
")",
";",
"foreach",
"(",
"$",
"ins... | fill notification notification content with variables
@param String $content
@return String | [
"fill",
"notification",
"notification",
"content",
"with",
"variables"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L127-L136 |
23,436 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.hasInstructions | protected function hasInstructions($content)
{
$instructionKeys = $this->getInstructions();
foreach ($instructionKeys as $instructionKey) {
if (str_contains($content, ['[[' . $instructionKey . ']]', '[[/' . $instructionKey . ']]'])) {
return true;
}
}
... | php | protected function hasInstructions($content)
{
$instructionKeys = $this->getInstructions();
foreach ($instructionKeys as $instructionKey) {
if (str_contains($content, ['[[' . $instructionKey . ']]', '[[/' . $instructionKey . ']]'])) {
return true;
}
}
... | [
"protected",
"function",
"hasInstructions",
"(",
"$",
"content",
")",
"{",
"$",
"instructionKeys",
"=",
"$",
"this",
"->",
"getInstructions",
"(",
")",
";",
"foreach",
"(",
"$",
"instructionKeys",
"as",
"$",
"instructionKey",
")",
"{",
"if",
"(",
"str_contai... | whether notification has instructions
@param String $content
@return boolean | [
"whether",
"notification",
"has",
"instructions"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L158-L167 |
23,437 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.parseInstructions | protected function parseInstructions($content, $instruction)
{
$twig = new Twig_Environment(new Twig_Loader_String());
$sources = $this->getStringsBetween($content, "[[{$instruction}]]", "[[/{$instruction}]]");
foreach ($sources as $source) {
$toReplace = $source;
... | php | protected function parseInstructions($content, $instruction)
{
$twig = new Twig_Environment(new Twig_Loader_String());
$sources = $this->getStringsBetween($content, "[[{$instruction}]]", "[[/{$instruction}]]");
foreach ($sources as $source) {
$toReplace = $source;
... | [
"protected",
"function",
"parseInstructions",
"(",
"$",
"content",
",",
"$",
"instruction",
")",
"{",
"$",
"twig",
"=",
"new",
"Twig_Environment",
"(",
"new",
"Twig_Loader_String",
"(",
")",
")",
";",
"$",
"sources",
"=",
"$",
"this",
"->",
"getStringsBetwee... | parsing instructions in notification content
@param String $content
@param String $instruction
@return String | [
"parsing",
"instructions",
"in",
"notification",
"content"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L176-L197 |
23,438 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.clearCondition | protected function clearCondition($source)
{
$line = $this->getStringBetween($source, '{%', '%}');
if (strlen($line) > 0) {
return str_replace([''', ' '], ["'", ' '], $source);
}
return $source;
} | php | protected function clearCondition($source)
{
$line = $this->getStringBetween($source, '{%', '%}');
if (strlen($line) > 0) {
return str_replace([''', ' '], ["'", ' '], $source);
}
return $source;
} | [
"protected",
"function",
"clearCondition",
"(",
"$",
"source",
")",
"{",
"$",
"line",
"=",
"$",
"this",
"->",
"getStringBetween",
"(",
"$",
"source",
",",
"'{%'",
",",
"'%}'",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"line",
")",
">",
"0",
")",
"{"... | clear conditions in notification
@param String $source
@return String | [
"clear",
"conditions",
"in",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L205-L212 |
23,439 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.getStringsBetween | public function getStringsBetween($string, $start, $end)
{
$lastPos = 0;
$positions = array();
while (($lastPos = strpos($string, $start, $lastPos)) !== false) {
$positions[] = $lastPos;
$lastPos += strlen($start);
}
$lastPos = 0;
$... | php | public function getStringsBetween($string, $start, $end)
{
$lastPos = 0;
$positions = array();
while (($lastPos = strpos($string, $start, $lastPos)) !== false) {
$positions[] = $lastPos;
$lastPos += strlen($start);
}
$lastPos = 0;
$... | [
"public",
"function",
"getStringsBetween",
"(",
"$",
"string",
",",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"lastPos",
"=",
"0",
";",
"$",
"positions",
"=",
"array",
"(",
")",
";",
"while",
"(",
"(",
"$",
"lastPos",
"=",
"strpos",
"(",
"$",
... | gets list of occurences between two strings
@param String $string
@param String $start
@param String $end
@return array | [
"gets",
"list",
"of",
"occurences",
"between",
"two",
"strings"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L222-L242 |
23,440 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.extractVariables | protected function extractVariables($content)
{
preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
if (!isset($matches[0], $matches[1])) {
return [];
}
$return = [];
$notifications = \Antares\Foundation\Notification::getInstance()->all();
fore... | php | protected function extractVariables($content)
{
preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
if (!isset($matches[0], $matches[1])) {
return [];
}
$return = [];
$notifications = \Antares\Foundation\Notification::getInstance()->all();
fore... | [
"protected",
"function",
"extractVariables",
"(",
"$",
"content",
")",
"{",
"preg_match_all",
"(",
"'/\\[\\[(.*?)\\]\\]/'",
",",
"$",
"content",
",",
"$",
"matches",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"matches",
"[",
"0",
"]",
",",
"$",
"matche... | extract variables from notification
@param String $content
@return array | [
"extract",
"variables",
"from",
"notification"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L273-L296 |
23,441 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.fillContent | protected function fillContent($content)
{
preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
if (!isset($matches[0]) or ! isset($matches[1])) {
return $content;
}
$notifications = \Antares\Foundation\Notification::getInstance()->all();
foreach ( (array) $mat... | php | protected function fillContent($content)
{
preg_match_all('/\[\[(.*?)\]\]/', $content, $matches);
if (!isset($matches[0]) or ! isset($matches[1])) {
return $content;
}
$notifications = \Antares\Foundation\Notification::getInstance()->all();
foreach ( (array) $mat... | [
"protected",
"function",
"fillContent",
"(",
"$",
"content",
")",
"{",
"preg_match_all",
"(",
"'/\\[\\[(.*?)\\]\\]/'",
",",
"$",
"content",
",",
"$",
"matches",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"matches",
"[",
"0",
"]",
")",
"or",
"!",
"iss... | fills content with notification variables values
@param String $content
@return String | [
"fills",
"content",
"with",
"notification",
"variables",
"values"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L304-L330 |
23,442 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.resolveValue | protected function resolveValue($name, $variables)
{
if (!empty($variables)) {
foreach ($variables as $container => $vars) {
foreach ($vars as $subname => $var) {
$value = $var['value'];
if(is_callable($value) && $var['name'] === $name) {
... | php | protected function resolveValue($name, $variables)
{
if (!empty($variables)) {
foreach ($variables as $container => $vars) {
foreach ($vars as $subname => $var) {
$value = $var['value'];
if(is_callable($value) && $var['name'] === $name) {
... | [
"protected",
"function",
"resolveValue",
"(",
"$",
"name",
",",
"$",
"variables",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"variables",
")",
")",
"{",
"foreach",
"(",
"$",
"variables",
"as",
"$",
"container",
"=>",
"$",
"vars",
")",
"{",
"foreach... | resolve notification variable value
@param String $name
@param array $variables
@return mixed | [
"resolve",
"notification",
"variable",
"value"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L339-L373 |
23,443 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.resolveDataProviderValue | protected function resolveDataProviderValue($dataProvider)
{
preg_match("/(.*)@(.*)/", $dataProvider, $matches);
if (!isset($matches[1]) and ! isset($matches[2])) {
return false;
}
if (!class_exists($matches[1])) {
return false;
}
try {
... | php | protected function resolveDataProviderValue($dataProvider)
{
preg_match("/(.*)@(.*)/", $dataProvider, $matches);
if (!isset($matches[1]) and ! isset($matches[2])) {
return false;
}
if (!class_exists($matches[1])) {
return false;
}
try {
... | [
"protected",
"function",
"resolveDataProviderValue",
"(",
"$",
"dataProvider",
")",
"{",
"preg_match",
"(",
"\"/(.*)@(.*)/\"",
",",
"$",
"dataProvider",
",",
"$",
"matches",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"matches",
"[",
"1",
"]",
")",
"and",... | resolve notification variable value from data provider
@param mixed $dataProvider
@return boolean|Collection | [
"resolve",
"notification",
"variable",
"value",
"from",
"data",
"provider"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L381-L403 |
23,444 | antaresproject/notifications | src/Adapter/VariablesAdapter.php | VariablesAdapter.findExtensionName | protected function findExtensionName($name)
{
if ($name == 'foundation') {
return $name;
}
$extensions = app('antares.memory')->make('component')->get('extensions.active');
foreach ($extensions as $keyname => $extension) {
if ($name == $extension['name']) {
... | php | protected function findExtensionName($name)
{
if ($name == 'foundation') {
return $name;
}
$extensions = app('antares.memory')->make('component')->get('extensions.active');
foreach ($extensions as $keyname => $extension) {
if ($name == $extension['name']) {
... | [
"protected",
"function",
"findExtensionName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"'foundation'",
")",
"{",
"return",
"$",
"name",
";",
"}",
"$",
"extensions",
"=",
"app",
"(",
"'antares.memory'",
")",
"->",
"make",
"(",
"'component... | get extension key name by name from manifest
@param type $name
@return boolean|String | [
"get",
"extension",
"key",
"name",
"by",
"name",
"from",
"manifest"
] | 60de743477b7e9cbb51de66da5fd9461adc9dd8a | https://github.com/antaresproject/notifications/blob/60de743477b7e9cbb51de66da5fd9461adc9dd8a/src/Adapter/VariablesAdapter.php#L411-L423 |
23,445 | weew/http | src/Weew/Http/Cookies.php | Cookies.searchCookiesInHeaders | protected function searchCookiesInHeaders() {
$headers = $this->holder->getHeaders()->get('set-cookie');
foreach ($headers as $header) {
$cookie = $this->createCookieFromHeader($header);
if ($cookie !== null) {
$this->storeCookie($cookie);
}
... | php | protected function searchCookiesInHeaders() {
$headers = $this->holder->getHeaders()->get('set-cookie');
foreach ($headers as $header) {
$cookie = $this->createCookieFromHeader($header);
if ($cookie !== null) {
$this->storeCookie($cookie);
}
... | [
"protected",
"function",
"searchCookiesInHeaders",
"(",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"holder",
"->",
"getHeaders",
"(",
")",
"->",
"get",
"(",
"'set-cookie'",
")",
";",
"foreach",
"(",
"$",
"headers",
"as",
"$",
"header",
")",
"{",
... | Parse headers for cookies. | [
"Parse",
"headers",
"for",
"cookies",
"."
] | fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/Cookies.php#L99-L109 |
23,446 | surebert/surebert-framework | src/sb/Logger/Syslog.php | Syslog.save | public function save($log_dir = '')
{
if (empty($log_dir)) {
$log_dir = \ROOT . '/private/logs/syslog/';
}
if (!is_dir($log_dir)) {
mkdir($log_dir, 0777, true);
}
return file_put_contents($log_dir . date('Y_m_d') . '.log',
$this->mess... | php | public function save($log_dir = '')
{
if (empty($log_dir)) {
$log_dir = \ROOT . '/private/logs/syslog/';
}
if (!is_dir($log_dir)) {
mkdir($log_dir, 0777, true);
}
return file_put_contents($log_dir . date('Y_m_d') . '.log',
$this->mess... | [
"public",
"function",
"save",
"(",
"$",
"log_dir",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"log_dir",
")",
")",
"{",
"$",
"log_dir",
"=",
"\\",
"ROOT",
".",
"'/private/logs/syslog/'",
";",
"}",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"log_di... | Saves data to local logs dir when syslog server is not available
@param string $log_dir The log dir the data is written to
@param string $log_type The log_type being written to
@return boolean If the data was written or not | [
"Saves",
"data",
"to",
"local",
"logs",
"dir",
"when",
"syslog",
"server",
"is",
"not",
"available"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Logger/Syslog.php#L199-L211 |
23,447 | surebert/surebert-framework | src/sb/Logger/Syslog.php | Syslog.checkLength | protected function checkLength($str, $max_length = '', $type = 'packet')
{
$max_length = $max_length ? $max_length : $this->max_length;
if ($max_length == -1) {
return $str;
}
$strlen = strlen($str);
if ($strlen > $max_length) {
throw new \Exception("... | php | protected function checkLength($str, $max_length = '', $type = 'packet')
{
$max_length = $max_length ? $max_length : $this->max_length;
if ($max_length == -1) {
return $str;
}
$strlen = strlen($str);
if ($strlen > $max_length) {
throw new \Exception("... | [
"protected",
"function",
"checkLength",
"(",
"$",
"str",
",",
"$",
"max_length",
"=",
"''",
",",
"$",
"type",
"=",
"'packet'",
")",
"{",
"$",
"max_length",
"=",
"$",
"max_length",
"?",
"$",
"max_length",
":",
"$",
"this",
"->",
"max_length",
";",
"if",... | Checks to make sure the length of something is expected or warn and truncate
@param string $str The string to check
@param int $max_length The maximun length to check for, -1 means infinite length
@param string $type The type of thing to check packet or process
@return string The string truncated to max length | [
"Checks",
"to",
"make",
"sure",
"the",
"length",
"of",
"something",
"is",
"expected",
"or",
"warn",
"and",
"truncate"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Logger/Syslog.php#L262-L276 |
23,448 | xiewulong/yii2-fileupload | oss/libs/symfony/yaml/Symfony/Component/Yaml/Yaml.php | Yaml.parse | public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false)
{
// if input is a file, process it
$file = '';
if (strpos($input, "\n") === false && is_file($input)) {
if (false === is_readable($input)) {
throw new ParseException(spr... | php | public static function parse($input, $exceptionOnInvalidType = false, $objectSupport = false)
{
// if input is a file, process it
$file = '';
if (strpos($input, "\n") === false && is_file($input)) {
if (false === is_readable($input)) {
throw new ParseException(spr... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"input",
",",
"$",
"exceptionOnInvalidType",
"=",
"false",
",",
"$",
"objectSupport",
"=",
"false",
")",
"{",
"// if input is a file, process it",
"$",
"file",
"=",
"''",
";",
"if",
"(",
"strpos",
"(",
"$",
... | Parses YAML into a PHP array.
The parse method, when supplied with a YAML stream (string or file),
will do its best to convert YAML in a file into a PHP array.
Usage:
<code>
$array = Yaml::parse('config.yml');
print_r($array);
</code>
As this method accepts both plain strings and file names as an input,
you must val... | [
"Parses",
"YAML",
"into",
"a",
"PHP",
"array",
"."
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/symfony/yaml/Symfony/Component/Yaml/Yaml.php#L51-L75 |
23,449 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Viewer/Json.php | Json.getSpacerType | protected function getSpacerType()
{
$type = "";
if(!$this->currObj instanceof Channel || !$this->currObj->isSpacer())
{
return "none";
}
switch($this->currObj->spacerGetType())
{
case (string) TeamSpeak3::SPACER_SOLIDLINE:
$type .= "solidline";
break;
case... | php | protected function getSpacerType()
{
$type = "";
if(!$this->currObj instanceof Channel || !$this->currObj->isSpacer())
{
return "none";
}
switch($this->currObj->spacerGetType())
{
case (string) TeamSpeak3::SPACER_SOLIDLINE:
$type .= "solidline";
break;
case... | [
"protected",
"function",
"getSpacerType",
"(",
")",
"{",
"$",
"type",
"=",
"\"\"",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"currObj",
"instanceof",
"Channel",
"||",
"!",
"$",
"this",
"->",
"currObj",
"->",
"isSpacer",
"(",
")",
")",
"{",
"return",
"\... | Returns an individual type for a spacer.
@return string | [
"Returns",
"an",
"individual",
"type",
"for",
"a",
"spacer",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Viewer/Json.php#L266-L323 |
23,450 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Viewer/Json.php | Json.getName | protected function getName()
{
if($this->currObj instanceof Channel && $this->currObj->isSpacer())
{
return $this->currObj["channel_name"]->section("]", 1, 99)->toString();
}
elseif($this->currObj instanceof Client)
{
$before = array();
$behind = array();
foreach($this->cu... | php | protected function getName()
{
if($this->currObj instanceof Channel && $this->currObj->isSpacer())
{
return $this->currObj["channel_name"]->section("]", 1, 99)->toString();
}
elseif($this->currObj instanceof Client)
{
$before = array();
$behind = array();
foreach($this->cu... | [
"protected",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"currObj",
"instanceof",
"Channel",
"&&",
"$",
"this",
"->",
"currObj",
"->",
"isSpacer",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"currObj",
"[",
"\"channel_name\""... | Returns a string for the current corpus element which contains the display name
for the current TeamSpeak_Node_Abstract object.
@return string | [
"Returns",
"a",
"string",
"for",
"the",
"current",
"corpus",
"element",
"which",
"contains",
"the",
"display",
"name",
"for",
"the",
"current",
"TeamSpeak_Node_Abstract",
"object",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Viewer/Json.php#L331-L358 |
23,451 | surebert/surebert-framework | src/sb/Cache/APC.php | APC.store | public function store($key, $data, $lifetime = 0)
{
$key = $this->namespace . $key;
$store = apc_store($key, $data, $lifetime);
if ($store && $key != $this->namespace . $this->catalog_key) {
$this->catalogKeyAdd($key, $lifetime);
}
return $store;
} | php | public function store($key, $data, $lifetime = 0)
{
$key = $this->namespace . $key;
$store = apc_store($key, $data, $lifetime);
if ($store && $key != $this->namespace . $this->catalog_key) {
$this->catalogKeyAdd($key, $lifetime);
}
return $store;
} | [
"public",
"function",
"store",
"(",
"$",
"key",
",",
"$",
"data",
",",
"$",
"lifetime",
"=",
"0",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"namespace",
".",
"$",
"key",
";",
"$",
"store",
"=",
"apc_store",
"(",
"$",
"key",
",",
"$",
"data"... | Store the cache data in APC | [
"Store",
"the",
"cache",
"data",
"in",
"APC"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/APC.php#L41-L51 |
23,452 | surebert/surebert-framework | src/sb/Cache/APC.php | APC.catalogKeyAdd | private function catalogKeyAdd($key, $lifetime)
{
$catalog = $this->fetch($this->catalog_key);
$catalog = is_array($catalog) ? $catalog : Array();
$catalog[$key] = ($lifetime == 0) ? $lifetime : $lifetime + time();
return $this->store($this->catalog_key, $catalog);
} | php | private function catalogKeyAdd($key, $lifetime)
{
$catalog = $this->fetch($this->catalog_key);
$catalog = is_array($catalog) ? $catalog : Array();
$catalog[$key] = ($lifetime == 0) ? $lifetime : $lifetime + time();
return $this->store($this->catalog_key, $catalog);
} | [
"private",
"function",
"catalogKeyAdd",
"(",
"$",
"key",
",",
"$",
"lifetime",
")",
"{",
"$",
"catalog",
"=",
"$",
"this",
"->",
"fetch",
"(",
"$",
"this",
"->",
"catalog_key",
")",
";",
"$",
"catalog",
"=",
"is_array",
"(",
"$",
"catalog",
")",
"?",... | Keeps track of the data stored in the cache to make deleting groups of
data possible
@param $key
@return boolean If the catalog is stored or not | [
"Keeps",
"track",
"of",
"the",
"data",
"stored",
"in",
"the",
"cache",
"to",
"make",
"deleting",
"groups",
"of",
"data",
"possible"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Cache/APC.php#L101-L108 |
23,453 | webdevvie/pheanstalk-task-queue-bundle | TaskDescription/AbstractTaskDescription.php | AbstractTaskDescription.getOptions | public function getOptions()
{
$options = array();
foreach ($this->commandOptions as $key => $value) {
$options[$key]=$this->$value;
}
return $options;
} | php | public function getOptions()
{
$options = array();
foreach ($this->commandOptions as $key => $value) {
$options[$key]=$this->$value;
}
return $options;
} | [
"public",
"function",
"getOptions",
"(",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"commandOptions",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"options",
"[",
"$",
"key",
"]",
"=",
"$",
"... | Returns a two dimensional array of options to pass to the command
The key is the
@return array | [
"Returns",
"a",
"two",
"dimensional",
"array",
"of",
"options",
"to",
"pass",
"to",
"the",
"command",
"The",
"key",
"is",
"the"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/TaskDescription/AbstractTaskDescription.php#L68-L75 |
23,454 | webdevvie/pheanstalk-task-queue-bundle | TaskDescription/AbstractTaskDescription.php | AbstractTaskDescription.getArguments | public function getArguments()
{
$arguments = array();
foreach ($this->commandArguments as $argument) {
$arguments[] = $this->$argument;
}
return $arguments;
} | php | public function getArguments()
{
$arguments = array();
foreach ($this->commandArguments as $argument) {
$arguments[] = $this->$argument;
}
return $arguments;
} | [
"public",
"function",
"getArguments",
"(",
")",
"{",
"$",
"arguments",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"commandArguments",
"as",
"$",
"argument",
")",
"{",
"$",
"arguments",
"[",
"]",
"=",
"$",
"this",
"->",
"$",
"argu... | Returns a one dimensional array of arguments to pass to the command
@return array | [
"Returns",
"a",
"one",
"dimensional",
"array",
"of",
"arguments",
"to",
"pass",
"to",
"the",
"command"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/TaskDescription/AbstractTaskDescription.php#L82-L89 |
23,455 | DevGroup-ru/yii2-users-module | src/models/UserModuleConfiguration.php | UserModuleConfiguration.commonApplicationAttributes | public function commonApplicationAttributes()
{
return [
'modules' => [
'users' => [
'emailConfirmationNeeded' => (bool)$this->emailConfirmationNeeded,
'allowLoginInactiveAccounts' => (bool)$this->allowLoginInactiveAccounts,
... | php | public function commonApplicationAttributes()
{
return [
'modules' => [
'users' => [
'emailConfirmationNeeded' => (bool)$this->emailConfirmationNeeded,
'allowLoginInactiveAccounts' => (bool)$this->allowLoginInactiveAccounts,
... | [
"public",
"function",
"commonApplicationAttributes",
"(",
")",
"{",
"return",
"[",
"'modules'",
"=>",
"[",
"'users'",
"=>",
"[",
"'emailConfirmationNeeded'",
"=>",
"(",
"bool",
")",
"$",
"this",
"->",
"emailConfirmationNeeded",
",",
"'allowLoginInactiveAccounts'",
"... | Returns array of module configuration that should be stored in application config.
Array should be ready to merge in app config.
Used both for web and console.
@return array | [
"Returns",
"array",
"of",
"module",
"configuration",
"that",
"should",
"be",
"stored",
"in",
"application",
"config",
".",
"Array",
"should",
"be",
"ready",
"to",
"merge",
"in",
"app",
"config",
".",
"Used",
"both",
"for",
"web",
"and",
"console",
"."
] | ff0103dc55c3462627ccc704c33e70c96053f750 | https://github.com/DevGroup-ru/yii2-users-module/blob/ff0103dc55c3462627ccc704c33e70c96053f750/src/models/UserModuleConfiguration.php#L54-L70 |
23,456 | GrupaZero/social | src/Gzero/Social/Controller/SocialAuthController.php | SocialAuthController.socialLogin | public function socialLogin($serviceName)
{
if (config('services.' . $serviceName)) {
$this->setDynamicRedirectUrl($serviceName);
return $this->socialite->driver($serviceName)->redirect();
}
return redirect('/');
} | php | public function socialLogin($serviceName)
{
if (config('services.' . $serviceName)) {
$this->setDynamicRedirectUrl($serviceName);
return $this->socialite->driver($serviceName)->redirect();
}
return redirect('/');
} | [
"public",
"function",
"socialLogin",
"(",
"$",
"serviceName",
")",
"{",
"if",
"(",
"config",
"(",
"'services.'",
".",
"$",
"serviceName",
")",
")",
"{",
"$",
"this",
"->",
"setDynamicRedirectUrl",
"(",
"$",
"serviceName",
")",
";",
"return",
"$",
"this",
... | Function responsible for login the user by the given social service.
@param $serviceName string social service name
@return \Illuminate\Http\RedirectResponse|\Symfony\Component\HttpFoundation\RedirectResponse | [
"Function",
"responsible",
"for",
"login",
"the",
"user",
"by",
"the",
"given",
"social",
"service",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Social/Controller/SocialAuthController.php#L48-L55 |
23,457 | GrupaZero/social | src/Gzero/Social/Controller/SocialAuthController.php | SocialAuthController.socialCallback | public function socialCallback(Request $request, $serviceName)
{
try {
$this->setDynamicRedirectUrl($serviceName);
$user = $this->socialite->driver($serviceName)->user();
$this->authService->login($serviceName, $user);
return redirect(session('url.intended', '... | php | public function socialCallback(Request $request, $serviceName)
{
try {
$this->setDynamicRedirectUrl($serviceName);
$user = $this->socialite->driver($serviceName)->user();
$this->authService->login($serviceName, $user);
return redirect(session('url.intended', '... | [
"public",
"function",
"socialCallback",
"(",
"Request",
"$",
"request",
",",
"$",
"serviceName",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"setDynamicRedirectUrl",
"(",
"$",
"serviceName",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"socialite",
"->",
... | Function responsible for handle a callback request from the given social service.
@param Request $request Request object
@param string $serviceName string social service name
@return \Illuminate\Http\RedirectResponse | [
"Function",
"responsible",
"for",
"handle",
"a",
"callback",
"request",
"from",
"the",
"given",
"social",
"service",
"."
] | f7cbf50765bd228010a2c61d950f915828306cf7 | https://github.com/GrupaZero/social/blob/f7cbf50765bd228010a2c61d950f915828306cf7/src/Gzero/Social/Controller/SocialAuthController.php#L65-L92 |
23,458 | philippfrenzel/yii2instafeed | yii2instafeed.php | yii2instafeed.registerPlugin | protected function registerPlugin()
{
$id = $this->options['id'];
//get the displayed view and register the needed assets
$view = $this->getView();
yii2instafeedAsset::register($view);
$js = array();
$options = Json::encode($this->clientOptions);
$j... | php | protected function registerPlugin()
{
$id = $this->options['id'];
//get the displayed view and register the needed assets
$view = $this->getView();
yii2instafeedAsset::register($view);
$js = array();
$options = Json::encode($this->clientOptions);
$j... | [
"protected",
"function",
"registerPlugin",
"(",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"options",
"[",
"'id'",
"]",
";",
"//get the displayed view and register the needed assets",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"yii2instaf... | Registers a specific dhtmlx widget and the related events
@param string $name the name of the dhtmlx plugin | [
"Registers",
"a",
"specific",
"dhtmlx",
"widget",
"and",
"the",
"related",
"events"
] | 8578ce03db39088590e931b8e336d7aca863ed6f | https://github.com/philippfrenzel/yii2instafeed/blob/8578ce03db39088590e931b8e336d7aca863ed6f/yii2instafeed.php#L71-L86 |
23,459 | phpnfe/tools | src/Certificado/Certificado.php | Certificado.salvarArquivo | public function salvarArquivo($arquivo)
{
// Verificando se a chave pública está nula
$this->verificaChaveNula();
$xml = file_get_contents(__DIR__ . '/../Templates/certificado.xml');
$xml = str_replace('{{chave_pub}}', $this->chavePub, $xml);
$xml = str_replace('{{chave_pri}... | php | public function salvarArquivo($arquivo)
{
// Verificando se a chave pública está nula
$this->verificaChaveNula();
$xml = file_get_contents(__DIR__ . '/../Templates/certificado.xml');
$xml = str_replace('{{chave_pub}}', $this->chavePub, $xml);
$xml = str_replace('{{chave_pri}... | [
"public",
"function",
"salvarArquivo",
"(",
"$",
"arquivo",
")",
"{",
"// Verificando se a chave pública está nula",
"$",
"this",
"->",
"verificaChaveNula",
"(",
")",
";",
"$",
"xml",
"=",
"file_get_contents",
"(",
"__DIR__",
".",
"'/../Templates/certificado.xml'",
")... | Salva um arquivo com as propriedades do certificado.
@param $arquivo
@return bool | [
"Salva",
"um",
"arquivo",
"com",
"as",
"propriedades",
"do",
"certificado",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Certificado.php#L69-L81 |
23,460 | phpnfe/tools | src/Certificado/Certificado.php | Certificado.getValidade | public function getValidade()
{
$this->verificaChaveNula();
$data = openssl_x509_read($this->chavePub);
$certData = openssl_x509_parse($data);
return Carbon::createFromFormat('ymdHis', str_replace('Z', '', $certData['validTo']));
} | php | public function getValidade()
{
$this->verificaChaveNula();
$data = openssl_x509_read($this->chavePub);
$certData = openssl_x509_parse($data);
return Carbon::createFromFormat('ymdHis', str_replace('Z', '', $certData['validTo']));
} | [
"public",
"function",
"getValidade",
"(",
")",
"{",
"$",
"this",
"->",
"verificaChaveNula",
"(",
")",
";",
"$",
"data",
"=",
"openssl_x509_read",
"(",
"$",
"this",
"->",
"chavePub",
")",
";",
"$",
"certData",
"=",
"openssl_x509_parse",
"(",
"$",
"data",
... | Retorna a data e hora da validade do certificado.
@return Carbon | [
"Retorna",
"a",
"data",
"e",
"hora",
"da",
"validade",
"do",
"certificado",
"."
] | 303ca311989e0b345071f61b71d2b3bf7ee80454 | https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Certificado.php#L110-L118 |
23,461 | raideer/twitch-api | src/Resources/Follows.php | Follows.getFollows | public function getFollows($user, $params = [])
{
$defaults = [
'limit' => 25,
'offset' => 0,
'direction' => 'desc',
'sortby' => 'created_at',
];
return $this->wrapper->request('GET', "users/$user/follows/channels", ['query' => $this->resolveOptions($params, $default... | php | public function getFollows($user, $params = [])
{
$defaults = [
'limit' => 25,
'offset' => 0,
'direction' => 'desc',
'sortby' => 'created_at',
];
return $this->wrapper->request('GET', "users/$user/follows/channels", ['query' => $this->resolveOptions($params, $default... | [
"public",
"function",
"getFollows",
"(",
"$",
"user",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'limit'",
"=>",
"25",
",",
"'offset'",
"=>",
"0",
",",
"'direction'",
"=>",
"'desc'",
",",
"'sortby'",
"=>",
"'created_at'",
... | Returns a list of follows objects.
Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/follows.md#get-usersuserfollowschannels
@param string $user Target user
@param array $params List of parameters
@return object | [
"Returns",
"a",
"list",
"of",
"follows",
"objects",
"."
] | 27ebf1dcb0315206300d507600b6a82ebe33d57e | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Follows.php#L54-L64 |
23,462 | Rxnet/rabbitmq | Client.php | Client.channel | public function channel($bind = []): Observable
{
$this->bunny = $this->bunny ?? new BaseAsynchClient($this->loop, $this->configuration);
if (!\is_array($bind)) {
$bind = \func_get_args();
}
return Observable::fromPromise(
$this->bunny
->conn... | php | public function channel($bind = []): Observable
{
$this->bunny = $this->bunny ?? new BaseAsynchClient($this->loop, $this->configuration);
if (!\is_array($bind)) {
$bind = \func_get_args();
}
return Observable::fromPromise(
$this->bunny
->conn... | [
"public",
"function",
"channel",
"(",
"$",
"bind",
"=",
"[",
"]",
")",
":",
"Observable",
"{",
"$",
"this",
"->",
"bunny",
"=",
"$",
"this",
"->",
"bunny",
"??",
"new",
"BaseAsynchClient",
"(",
"$",
"this",
"->",
"loop",
",",
"$",
"this",
"->",
"co... | Open a new channel and attribute it to given queues or exchanges.
@param Queue[]|Exchange[] $bind | [
"Open",
"a",
"new",
"channel",
"and",
"attribute",
"it",
"to",
"given",
"queues",
"or",
"exchanges",
"."
] | 16e2fa39daddb6cca70716b8895470c4691a6f9e | https://github.com/Rxnet/rabbitmq/blob/16e2fa39daddb6cca70716b8895470c4691a6f9e/Client.php#L64-L86 |
23,463 | Rxnet/rabbitmq | Client.php | Client.consume | public function consume($queue, $prefetchCount = null, $prefetchSize = null, $consumerId = null): Observable
{
return $this->channel()
->do(function (Channel $channel) use ($prefetchCount, $prefetchSize) {
$channel->qos($prefetchSize, $prefetchCount);
})
-... | php | public function consume($queue, $prefetchCount = null, $prefetchSize = null, $consumerId = null): Observable
{
return $this->channel()
->do(function (Channel $channel) use ($prefetchCount, $prefetchSize) {
$channel->qos($prefetchSize, $prefetchCount);
})
-... | [
"public",
"function",
"consume",
"(",
"$",
"queue",
",",
"$",
"prefetchCount",
"=",
"null",
",",
"$",
"prefetchSize",
"=",
"null",
",",
"$",
"consumerId",
"=",
"null",
")",
":",
"Observable",
"{",
"return",
"$",
"this",
"->",
"channel",
"(",
")",
"->",... | Consume given queue at. | [
"Consume",
"given",
"queue",
"at",
"."
] | 16e2fa39daddb6cca70716b8895470c4691a6f9e | https://github.com/Rxnet/rabbitmq/blob/16e2fa39daddb6cca70716b8895470c4691a6f9e/Client.php#L91-L103 |
23,464 | php-comp/lite-database | src/LitePdo.php | LitePdo.insertBatch | public function insertBatch(string $from, array $dataSet, array $options = [])
{
list($statement, $bindings) = $this->compileInsert($from, $dataSet, $options['columns'] ?? [], true);
if (isset($options['returnSql'])) {
return [$statement, $bindings];
}
return $this->fet... | php | public function insertBatch(string $from, array $dataSet, array $options = [])
{
list($statement, $bindings) = $this->compileInsert($from, $dataSet, $options['columns'] ?? [], true);
if (isset($options['returnSql'])) {
return [$statement, $bindings];
}
return $this->fet... | [
"public",
"function",
"insertBatch",
"(",
"string",
"$",
"from",
",",
"array",
"$",
"dataSet",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"list",
"(",
"$",
"statement",
",",
"$",
"bindings",
")",
"=",
"$",
"this",
"->",
"compileInsert",
"... | Run a statement for insert multi row
@param string $from
@param array $dataSet
@param array $options
- returnSql Will not be executed, just return the built SQL.
- columns Setting the table columns to insert.
@return int|array
@throws \PDOException
@throws \InvalidArgumentException | [
"Run",
"a",
"statement",
"for",
"insert",
"multi",
"row"
] | af5f73cb89e0e6cd24dd464f7a48fb5088eaafca | https://github.com/php-comp/lite-database/blob/af5f73cb89e0e6cd24dd464f7a48fb5088eaafca/src/LitePdo.php#L343-L352 |
23,465 | php-comp/lite-database | src/LitePdo.php | LitePdo.update | public function update(string $from, $wheres, array $values, array $options = [])
{
list($where, $bindings) = DBHelper::handleConditions($wheres, $this);
$options['update'] = $this->qn($from);
$options['where'] = $where;
$statement = $this->compileUpdate($values, $bindings, $option... | php | public function update(string $from, $wheres, array $values, array $options = [])
{
list($where, $bindings) = DBHelper::handleConditions($wheres, $this);
$options['update'] = $this->qn($from);
$options['where'] = $where;
$statement = $this->compileUpdate($values, $bindings, $option... | [
"public",
"function",
"update",
"(",
"string",
"$",
"from",
",",
"$",
"wheres",
",",
"array",
"$",
"values",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"list",
"(",
"$",
"where",
",",
"$",
"bindings",
")",
"=",
"DBHelper",
"::",
"handle... | Run a update statement
@param string $from
@param array|string $wheres
@param array $values
@param array $options
@return int|array
@throws \InvalidArgumentException | [
"Run",
"a",
"update",
"statement"
] | af5f73cb89e0e6cd24dd464f7a48fb5088eaafca | https://github.com/php-comp/lite-database/blob/af5f73cb89e0e6cd24dd464f7a48fb5088eaafca/src/LitePdo.php#L363-L377 |
23,466 | skmetaly/laravel-twitch-restful-api | src/API/Users.php | Users.authenticatedUser | public function authenticatedUser($token = null)
{
$token = $this->getToken($token);
$user = $this->client->get('https://api.twitch.tv/kraken/user?oauth_token=' . $token);
return $user->json();
} | php | public function authenticatedUser($token = null)
{
$token = $this->getToken($token);
$user = $this->client->get('https://api.twitch.tv/kraken/user?oauth_token=' . $token);
return $user->json();
} | [
"public",
"function",
"authenticatedUser",
"(",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"token",
")",
";",
"$",
"user",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"'https://api.twitch.tv... | Returns a user object.
Authenticated, required scope: user_read
@param null $token
@return json | [
"Returns",
"a",
"user",
"object",
"."
] | 70c83e441deb411ade2e343ad5cb0339c90dc6c2 | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Users.php#L39-L46 |
23,467 | surebert/surebert-framework | src/sb/Application/Debugger.php | Debugger.errorHandler | public static function errorHandler($code, $message, $file, $line)
{
if (error_reporting() === 0) {
// This error code is not included in error_reporting
return false;
}
throw new \sb\Exception($code, $message, $file, $line);
} | php | public static function errorHandler($code, $message, $file, $line)
{
if (error_reporting() === 0) {
// This error code is not included in error_reporting
return false;
}
throw new \sb\Exception($code, $message, $file, $line);
} | [
"public",
"static",
"function",
"errorHandler",
"(",
"$",
"code",
",",
"$",
"message",
",",
"$",
"file",
",",
"$",
"line",
")",
"{",
"if",
"(",
"error_reporting",
"(",
")",
"===",
"0",
")",
"{",
"// This error code is not included in error_reporting",
"return"... | Converts errors into exceptions
@param integer $code The error code
@param string $message The error message
@param string $file The file the error occurred in
@param integer $line The line the error occurred on | [
"Converts",
"errors",
"into",
"exceptions"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Application/Debugger.php#L29-L37 |
23,468 | surebert/surebert-framework | src/sb/Application/Debugger.php | Debugger.exceptionHandler | public static function exceptionHandler($e)
{
$message = 'Code: ' . $e->getCode() . "\n" .
'Path: ' . \sb\Gateway::$request->path . "\n" .
'Message: ' . $e->getMessage() . "\n" .
'Location: ' . $e->getFile() . "\n" .
'Line: ' . $e->getLine() .... | php | public static function exceptionHandler($e)
{
$message = 'Code: ' . $e->getCode() . "\n" .
'Path: ' . \sb\Gateway::$request->path . "\n" .
'Message: ' . $e->getMessage() . "\n" .
'Location: ' . $e->getFile() . "\n" .
'Line: ' . $e->getLine() .... | [
"public",
"static",
"function",
"exceptionHandler",
"(",
"$",
"e",
")",
"{",
"$",
"message",
"=",
"'Code: '",
".",
"$",
"e",
"->",
"getCode",
"(",
")",
".",
"\"\\n\"",
".",
"'Path: '",
".",
"\\",
"sb",
"\\",
"Gateway",
"::",
"$",
"request",
"->",
"pa... | Handles acceptions and turns them into strings
@param Throwable|Exception $e A PHP exception or another class that implements the Throwable interface in PHP 7 | [
"Handles",
"acceptions",
"and",
"turns",
"them",
"into",
"strings"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Application/Debugger.php#L43-L86 |
23,469 | surebert/surebert-framework | src/sb/Application/Debugger.php | Debugger.shutdown | public static function shutdown()
{
if (\is_null($e = \error_get_last()) === false) {
self::exceptionHandler(new \sb\Exception($e['type'], $e['message'], $e['file'], $e['line']));
}
} | php | public static function shutdown()
{
if (\is_null($e = \error_get_last()) === false) {
self::exceptionHandler(new \sb\Exception($e['type'], $e['message'], $e['file'], $e['line']));
}
} | [
"public",
"static",
"function",
"shutdown",
"(",
")",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"e",
"=",
"\\",
"error_get_last",
"(",
")",
")",
"===",
"false",
")",
"{",
"self",
"::",
"exceptionHandler",
"(",
"new",
"\\",
"sb",
"\\",
"Exception",
"... | Shutdown function catches additional parse errors | [
"Shutdown",
"function",
"catches",
"additional",
"parse",
"errors"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Application/Debugger.php#L91-L96 |
23,470 | surebert/surebert-framework | src/sb/Application/Debugger.php | Debugger.init | public static function init($error_reporting_level = E_ALL, $display_errors = true, $show_trace = true)
{
\error_reporting($error_reporting_level);
\ini_set("display_errors", $display_errors ? true : false);
self::$show_trace = $show_trace ? true : false;
\set_error_handler('\sb\App... | php | public static function init($error_reporting_level = E_ALL, $display_errors = true, $show_trace = true)
{
\error_reporting($error_reporting_level);
\ini_set("display_errors", $display_errors ? true : false);
self::$show_trace = $show_trace ? true : false;
\set_error_handler('\sb\App... | [
"public",
"static",
"function",
"init",
"(",
"$",
"error_reporting_level",
"=",
"E_ALL",
",",
"$",
"display_errors",
"=",
"true",
",",
"$",
"show_trace",
"=",
"true",
")",
"{",
"\\",
"error_reporting",
"(",
"$",
"error_reporting_level",
")",
";",
"\\",
"ini_... | Sets up debugger
@param string $error_reporting_level The error level like
@param boolean $display_errors Should errors be dumped to output
@param type $show_trace Should trace message be shown | [
"Sets",
"up",
"debugger"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Application/Debugger.php#L103-L112 |
23,471 | PayBreak/foundation | src/Data/Value.php | Value.availableTypes | public static function availableTypes()
{
return [
self::VALUE_INT,
self::VALUE_STRING,
self::VALUE_BOOL,
self::VALUE_FLOAT,
self::VALUE_DEFAULT,
self::VALUE_NON_EXISTS,
self::VALUE_EMPTY,
self::VALUE_ARRAY,
... | php | public static function availableTypes()
{
return [
self::VALUE_INT,
self::VALUE_STRING,
self::VALUE_BOOL,
self::VALUE_FLOAT,
self::VALUE_DEFAULT,
self::VALUE_NON_EXISTS,
self::VALUE_EMPTY,
self::VALUE_ARRAY,
... | [
"public",
"static",
"function",
"availableTypes",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"VALUE_INT",
",",
"self",
"::",
"VALUE_STRING",
",",
"self",
"::",
"VALUE_BOOL",
",",
"self",
"::",
"VALUE_FLOAT",
",",
"self",
"::",
"VALUE_DEFAULT",
",",
"self",
... | Get Available Value Types
@author WN
@return array | [
"Get",
"Available",
"Value",
"Types"
] | 3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4 | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/Data/Value.php#L56-L68 |
23,472 | PayBreak/foundation | src/Data/Value.php | Value.availableDefaultValues | public static function availableDefaultValues()
{
return [
self::DEFAULT_NULL,
self::DEFAULT_OUT_OF_BOUNDS,
self::DEFAULT_NOT_DERIVABLE,
self::DEFAULT_NOT_GIVEN,
self::DEFAULT_NOT_ASKED,
self::DEFAULT_NOT_PERMITTED,
];
} | php | public static function availableDefaultValues()
{
return [
self::DEFAULT_NULL,
self::DEFAULT_OUT_OF_BOUNDS,
self::DEFAULT_NOT_DERIVABLE,
self::DEFAULT_NOT_GIVEN,
self::DEFAULT_NOT_ASKED,
self::DEFAULT_NOT_PERMITTED,
];
} | [
"public",
"static",
"function",
"availableDefaultValues",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"DEFAULT_NULL",
",",
"self",
"::",
"DEFAULT_OUT_OF_BOUNDS",
",",
"self",
"::",
"DEFAULT_NOT_DERIVABLE",
",",
"self",
"::",
"DEFAULT_NOT_GIVEN",
",",
"self",
"::",... | Get Available Default Values
@author WN
@return array | [
"Get",
"Available",
"Default",
"Values"
] | 3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4 | https://github.com/PayBreak/foundation/blob/3dc5a5791e0c95abefa2a415a7f9fdb5abb62ca4/src/Data/Value.php#L76-L86 |
23,473 | mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/UserToIntegerTransformer.php | UserToIntegerTransformer.transform | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof User)) {
throw new TransformationFailedException('Expected an instance of a concrete5 user object.');
}
return intval($value->getUserID())... | php | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof User)) {
throw new TransformationFailedException('Expected an instance of a concrete5 user object.');
}
return intval($value->getUserID())... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"User",
")",
")",
"{",
... | Converts a concrete5 user object to an integer.
@param \Concrete\Core\User\User $value The user object value
@return int The integer value
@throws TransformationFailedException If the given value is not an
instance of Concrete\Core\User\User. | [
"Converts",
"a",
"concrete5",
"user",
"object",
"to",
"an",
"integer",
"."
] | 41a93c293d986574ec5cade8a7c8700e083dbaaa | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/UserToIntegerTransformer.php#L33-L42 |
23,474 | superjimpupcake/Pupcake | src/Pupcake/Plugin.php | Plugin.help | public function help($event_name, $callback)
{
if (!isset($this->event_helpers[$event_name]))
{
$this->event_helpers[$event_name] = $callback;
}
} | php | public function help($event_name, $callback)
{
if (!isset($this->event_helpers[$event_name]))
{
$this->event_helpers[$event_name] = $callback;
}
} | [
"public",
"function",
"help",
"(",
"$",
"event_name",
",",
"$",
"callback",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"event_helpers",
"[",
"$",
"event_name",
"]",
")",
")",
"{",
"$",
"this",
"->",
"event_helpers",
"[",
"$",
"event_n... | add a helper callback to an event | [
"add",
"a",
"helper",
"callback",
"to",
"an",
"event"
] | 2f962818646e4e1d65f5d008eeb953cb41ebb3e0 | https://github.com/superjimpupcake/Pupcake/blob/2f962818646e4e1d65f5d008eeb953cb41ebb3e0/src/Pupcake/Plugin.php#L46-L52 |
23,475 | old-town/workflow-designer-server | src/Listener/SendApiProblemResponseListener.php | SendApiProblemResponseListener.sendContent | public function sendContent(SendResponseEvent $e)
{
$response = $e->getResponse();
if (!$response instanceof ApiProblemResponse) {
return $this;
}
$response->getApiProblem()->setDetailIncludesStackTrace($this->displayExceptions());
/** @var Request $request */
... | php | public function sendContent(SendResponseEvent $e)
{
$response = $e->getResponse();
if (!$response instanceof ApiProblemResponse) {
return $this;
}
$response->getApiProblem()->setDetailIncludesStackTrace($this->displayExceptions());
/** @var Request $request */
... | [
"public",
"function",
"sendContent",
"(",
"SendResponseEvent",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"$",
"e",
"->",
"getResponse",
"(",
")",
";",
"if",
"(",
"!",
"$",
"response",
"instanceof",
"ApiProblemResponse",
")",
"{",
"return",
"$",
"this",
"... | Send the response content
Sets the composed ApiProblem's flag for including the stack trace in the
detail based on the display exceptions flag, and then sends content.
@param SendResponseEvent $e
@return self
@throws \Zend\Config\Exception\RuntimeException | [
"Send",
"the",
"response",
"content"
] | 6389c5a515861cc8e0b769f1ca7be12c6b78c611 | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/Listener/SendApiProblemResponseListener.php#L63-L102 |
23,476 | old-town/workflow-designer-server | src/Listener/SendApiProblemResponseListener.php | SendApiProblemResponseListener.sendHeaders | public function sendHeaders(SendResponseEvent $e)
{
$response = $e->getResponse();
if (!$response instanceof ApiProblemResponse) {
return $this;
}
/** @var Request $request */
$request = $this->getMvcEvent()->getRequest();
/** @var Accept $accept */
... | php | public function sendHeaders(SendResponseEvent $e)
{
$response = $e->getResponse();
if (!$response instanceof ApiProblemResponse) {
return $this;
}
/** @var Request $request */
$request = $this->getMvcEvent()->getRequest();
/** @var Accept $accept */
... | [
"public",
"function",
"sendHeaders",
"(",
"SendResponseEvent",
"$",
"e",
")",
"{",
"$",
"response",
"=",
"$",
"e",
"->",
"getResponse",
"(",
")",
";",
"if",
"(",
"!",
"$",
"response",
"instanceof",
"ApiProblemResponse",
")",
"{",
"return",
"$",
"this",
"... | Send HTTP response headers
If an application response is composed, and is an HTTP response, merges
its headers with the ApiProblemResponse headers prior to sending them.
@param SendResponseEvent $e
@return self
@throws \Zend\Http\Exception\InvalidArgumentException | [
"Send",
"HTTP",
"response",
"headers"
] | 6389c5a515861cc8e0b769f1ca7be12c6b78c611 | https://github.com/old-town/workflow-designer-server/blob/6389c5a515861cc8e0b769f1ca7be12c6b78c611/src/Listener/SendApiProblemResponseListener.php#L115-L143 |
23,477 | ellipsephp/session-validation | src/ValidateSessionMiddleware.php | ValidateSessionMiddleware.process | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
// Get a valid signature.
$signature = ($this->signature)($request);
if (! is_array($signature)) {
throw new OwnershipSignatureTypeException($signature);
}
... | php | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
// Get a valid signature.
$signature = ($this->signature)($request);
if (! is_array($signature)) {
throw new OwnershipSignatureTypeException($signature);
}
... | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"RequestHandlerInterface",
"$",
"handler",
")",
":",
"ResponseInterface",
"{",
"// Get a valid signature.",
"$",
"signature",
"=",
"(",
"$",
"this",
"->",
"signature",
")",
"(",
"... | Build a signature and compare it to the ownership metadata stored in
session. Invalidate the session when any key does not match. Process the
request and save the current signature in session.
@param \Psr\Http\Message\ServerRequestInterface $request
@param \Psr\Http\Server\RequestHandlerInterface $handler
@return \P... | [
"Build",
"a",
"signature",
"and",
"compare",
"it",
"to",
"the",
"ownership",
"metadata",
"stored",
"in",
"session",
".",
"Invalidate",
"the",
"session",
"when",
"any",
"key",
"does",
"not",
"match",
".",
"Process",
"the",
"request",
"and",
"save",
"the",
"... | c5d8bd0aed23abe0933f649b9e20ff48ab9efbc9 | https://github.com/ellipsephp/session-validation/blob/c5d8bd0aed23abe0933f649b9e20ff48ab9efbc9/src/ValidateSessionMiddleware.php#L47-L74 |
23,478 | ellipsephp/session-validation | src/ValidateSessionMiddleware.php | ValidateSessionMiddleware.compare | private function compare(array $signature, array $metadata): bool
{
foreach ($signature as $key => $v1) {
$v2 = $metadata[$key] ?? null;
if (! is_null($v2) && $v1 !== $v2) return false;
}
return true;
} | php | private function compare(array $signature, array $metadata): bool
{
foreach ($signature as $key => $v1) {
$v2 = $metadata[$key] ?? null;
if (! is_null($v2) && $v1 !== $v2) return false;
}
return true;
} | [
"private",
"function",
"compare",
"(",
"array",
"$",
"signature",
",",
"array",
"$",
"metadata",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"signature",
"as",
"$",
"key",
"=>",
"$",
"v1",
")",
"{",
"$",
"v2",
"=",
"$",
"metadata",
"[",
"$",
"key",... | Return whether all keys of the given signature match the given metadata.
@param array $signature
@param array $metadata
@return bool | [
"Return",
"whether",
"all",
"keys",
"of",
"the",
"given",
"signature",
"match",
"the",
"given",
"metadata",
"."
] | c5d8bd0aed23abe0933f649b9e20ff48ab9efbc9 | https://github.com/ellipsephp/session-validation/blob/c5d8bd0aed23abe0933f649b9e20ff48ab9efbc9/src/ValidateSessionMiddleware.php#L83-L94 |
23,479 | heidelpay/PhpDoc | src/phpDocumentor/Application.php | Application.configureLogger | public function configureLogger($logger, $level, $logPath = null)
{
/** @var Logger $monolog */
$monolog = $logger;
switch ($level) {
case 'emergency':
case 'emerg':
$level = Logger::EMERGENCY;
break;
case 'alert':
... | php | public function configureLogger($logger, $level, $logPath = null)
{
/** @var Logger $monolog */
$monolog = $logger;
switch ($level) {
case 'emergency':
case 'emerg':
$level = Logger::EMERGENCY;
break;
case 'alert':
... | [
"public",
"function",
"configureLogger",
"(",
"$",
"logger",
",",
"$",
"level",
",",
"$",
"logPath",
"=",
"null",
")",
"{",
"/** @var Logger $monolog */",
"$",
"monolog",
"=",
"$",
"logger",
";",
"switch",
"(",
"$",
"level",
")",
"{",
"case",
"'emergency'"... | Removes all logging handlers and replaces them with handlers that can write to the given logPath and level.
@param Logger $logger The logger instance that needs to be configured.
@param integer $level The minimum level that will be written to the normal logfile; matches one of the
constants in {@see \Mon... | [
"Removes",
"all",
"logging",
"handlers",
"and",
"replaces",
"them",
"with",
"handlers",
"that",
"can",
"write",
"to",
"the",
"given",
"logPath",
"and",
"level",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Application.php#L94-L161 |
23,480 | heidelpay/PhpDoc | src/phpDocumentor/Application.php | Application.addLogging | protected function addLogging()
{
$this->register(
new MonologServiceProvider(),
array(
'monolog.name' => 'phpDocumentor',
'monolog.logfile' => sys_get_temp_dir() . '/phpdoc.log',
'monolog.debugfile' => sys_get_temp_dir() . '/php... | php | protected function addLogging()
{
$this->register(
new MonologServiceProvider(),
array(
'monolog.name' => 'phpDocumentor',
'monolog.logfile' => sys_get_temp_dir() . '/phpdoc.log',
'monolog.debugfile' => sys_get_temp_dir() . '/php... | [
"protected",
"function",
"addLogging",
"(",
")",
"{",
"$",
"this",
"->",
"register",
"(",
"new",
"MonologServiceProvider",
"(",
")",
",",
"array",
"(",
"'monolog.name'",
"=>",
"'phpDocumentor'",
",",
"'monolog.logfile'",
"=>",
"sys_get_temp_dir",
"(",
")",
".",
... | Adds a logging provider to the container of phpDocumentor.
@return void | [
"Adds",
"a",
"logging",
"provider",
"to",
"the",
"container",
"of",
"phpDocumentor",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Application.php#L240-L275 |
23,481 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/helper.php | ezcDbSchemaOracleHelper.generateSuffixedIdentName | public static function generateSuffixedIdentName( array $identNames, $suffix )
{
$ident = implode( "_", $identNames ) . "_" . $suffix;
$i = 0;
$last = -1;
while ( strlen( $ident ) > self::IDENTIFIER_MAX_LENGTH )
{
if ( strlen( $identNames[$i] ) > 1 || $last == $i... | php | public static function generateSuffixedIdentName( array $identNames, $suffix )
{
$ident = implode( "_", $identNames ) . "_" . $suffix;
$i = 0;
$last = -1;
while ( strlen( $ident ) > self::IDENTIFIER_MAX_LENGTH )
{
if ( strlen( $identNames[$i] ) > 1 || $last == $i... | [
"public",
"static",
"function",
"generateSuffixedIdentName",
"(",
"array",
"$",
"identNames",
",",
"$",
"suffix",
")",
"{",
"$",
"ident",
"=",
"implode",
"(",
"\"_\"",
",",
"$",
"identNames",
")",
".",
"\"_\"",
".",
"$",
"suffix",
";",
"$",
"i",
"=",
"... | Generate single identifier name for constraints for example obeying oracle 30 chars ident restriction.
@param array $identNames
@param string $suffix
@return string | [
"Generate",
"single",
"identifier",
"name",
"for",
"constraints",
"for",
"example",
"obeying",
"oracle",
"30",
"chars",
"ident",
"restriction",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/oracle/helper.php#L46-L63 |
23,482 | mothership-ec/composer | src/Composer/DependencyResolver/RuleSetGenerator.php | RuleSetGenerator.createInstallOneOfRule | protected function createInstallOneOfRule(array $packages, $reason, $job)
{
$literals = array();
foreach ($packages as $package) {
$literals[] = $package->id;
}
return new Rule($literals, $reason, $job['packageName'], $job);
} | php | protected function createInstallOneOfRule(array $packages, $reason, $job)
{
$literals = array();
foreach ($packages as $package) {
$literals[] = $package->id;
}
return new Rule($literals, $reason, $job['packageName'], $job);
} | [
"protected",
"function",
"createInstallOneOfRule",
"(",
"array",
"$",
"packages",
",",
"$",
"reason",
",",
"$",
"job",
")",
"{",
"$",
"literals",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"packages",
"as",
"$",
"package",
")",
"{",
"$",
"litera... | Creates a rule to install at least one of a set of packages
The rule is (A|B|C) with A, B and C different packages. If the given
set of packages is empty an impossible rule is generated.
@param array $packages The set of packages to choose from
@param int $reason A RULE_* constant describing the reason for
gene... | [
"Creates",
"a",
"rule",
"to",
"install",
"at",
"least",
"one",
"of",
"a",
"set",
"of",
"packages"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/RuleSetGenerator.php#L79-L87 |
23,483 | mothership-ec/composer | src/Composer/DependencyResolver/RuleSetGenerator.php | RuleSetGenerator.createRemoveRule | protected function createRemoveRule(PackageInterface $package, $reason, $job)
{
return new Rule(array(-$package->id), $reason, $job['packageName'], $job);
} | php | protected function createRemoveRule(PackageInterface $package, $reason, $job)
{
return new Rule(array(-$package->id), $reason, $job['packageName'], $job);
} | [
"protected",
"function",
"createRemoveRule",
"(",
"PackageInterface",
"$",
"package",
",",
"$",
"reason",
",",
"$",
"job",
")",
"{",
"return",
"new",
"Rule",
"(",
"array",
"(",
"-",
"$",
"package",
"->",
"id",
")",
",",
"$",
"reason",
",",
"$",
"job",
... | Creates a rule to remove a package
The rule for a package A is (-A).
@param PackageInterface $package The package to be removed
@param int $reason A RULE_* constant describing the
reason for generating this rule
@param array $job The job this rule was created from
@return Rule ... | [
"Creates",
"a",
"rule",
"to",
"remove",
"a",
"package"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/RuleSetGenerator.php#L100-L103 |
23,484 | mothership-ec/composer | src/Composer/DependencyResolver/RuleSetGenerator.php | RuleSetGenerator.createConflictRule | protected function createConflictRule(PackageInterface $issuer, PackageInterface $provider, $reason, $reasonData = null)
{
// ignore self conflict
if ($issuer === $provider) {
return null;
}
return new Rule(array(-$issuer->id, -$provider->id), $reason, $reasonData);
... | php | protected function createConflictRule(PackageInterface $issuer, PackageInterface $provider, $reason, $reasonData = null)
{
// ignore self conflict
if ($issuer === $provider) {
return null;
}
return new Rule(array(-$issuer->id, -$provider->id), $reason, $reasonData);
... | [
"protected",
"function",
"createConflictRule",
"(",
"PackageInterface",
"$",
"issuer",
",",
"PackageInterface",
"$",
"provider",
",",
"$",
"reason",
",",
"$",
"reasonData",
"=",
"null",
")",
"{",
"// ignore self conflict",
"if",
"(",
"$",
"issuer",
"===",
"$",
... | Creates a rule for two conflicting packages
The rule for conflicting packages A and B is (-A|-B). A is called the issuer
and B the provider.
@param PackageInterface $issuer The package declaring the conflict
@param PackageInterface $provider The package causing the conflict
@param int $reason ... | [
"Creates",
"a",
"rule",
"for",
"two",
"conflicting",
"packages"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/RuleSetGenerator.php#L119-L127 |
23,485 | mothership-ec/composer | src/Composer/DependencyResolver/RuleSetGenerator.php | RuleSetGenerator.addRule | private function addRule($type, Rule $newRule = null)
{
if (!$newRule || $this->rules->containsEqual($newRule)) {
return;
}
$this->rules->add($newRule, $type);
} | php | private function addRule($type, Rule $newRule = null)
{
if (!$newRule || $this->rules->containsEqual($newRule)) {
return;
}
$this->rules->add($newRule, $type);
} | [
"private",
"function",
"addRule",
"(",
"$",
"type",
",",
"Rule",
"$",
"newRule",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"newRule",
"||",
"$",
"this",
"->",
"rules",
"->",
"containsEqual",
"(",
"$",
"newRule",
")",
")",
"{",
"return",
";",
"}",... | Adds a rule unless it duplicates an existing one of any type
To be able to directly pass in the result of one of the rule creation
methods null is allowed which will not insert a rule.
@param int $type A TYPE_* constant defining the rule type
@param Rule $newRule The rule about to be added | [
"Adds",
"a",
"rule",
"unless",
"it",
"duplicates",
"an",
"existing",
"one",
"of",
"any",
"type"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/DependencyResolver/RuleSetGenerator.php#L138-L145 |
23,486 | eXistenZNL/PermCheck | src/Config/Loader/Xml.php | Xml.parse | public function parse()
{
if (!is_string($this->data)) {
throw new \RuntimeException('The given data is no valid string');
}
libxml_use_internal_errors(true);
$xml = simplexml_load_string($this->data);
if ($xml === false) {
throw new \RuntimeException(... | php | public function parse()
{
if (!is_string($this->data)) {
throw new \RuntimeException('The given data is no valid string');
}
libxml_use_internal_errors(true);
$xml = simplexml_load_string($this->data);
if ($xml === false) {
throw new \RuntimeException(... | [
"public",
"function",
"parse",
"(",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"this",
"->",
"data",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'The given data is no valid string'",
")",
";",
"}",
"libxml_use_internal_errors",
"(",
... | Load the configuration and return it in an easy to use config bag.
@throws \RuntimeException When an error occurs.
@return ConfigInterface | [
"Load",
"the",
"configuration",
"and",
"return",
"it",
"in",
"an",
"easy",
"to",
"use",
"config",
"bag",
"."
] | f22f2936350f6b440222fb6ea37dfc382fc4550e | https://github.com/eXistenZNL/PermCheck/blob/f22f2936350f6b440222fb6ea37dfc382fc4550e/src/Config/Loader/Xml.php#L20-L47 |
23,487 | hametuha/wpametu | src/WPametu/UI/Field/Multiple.php | Multiple.build_input | protected function build_input($data, array $fields = []){
$input = $this->get_open_tag($data, $fields);
$counter = 1;
foreach( $this->get_options() as $key => $label ){
$input .= $this->get_option($key, $label, $counter, $data, $fields);
$counter++;
}
$in... | php | protected function build_input($data, array $fields = []){
$input = $this->get_open_tag($data, $fields);
$counter = 1;
foreach( $this->get_options() as $key => $label ){
$input .= $this->get_option($key, $label, $counter, $data, $fields);
$counter++;
}
$in... | [
"protected",
"function",
"build_input",
"(",
"$",
"data",
",",
"array",
"$",
"fields",
"=",
"[",
"]",
")",
"{",
"$",
"input",
"=",
"$",
"this",
"->",
"get_open_tag",
"(",
"$",
"data",
",",
"$",
"fields",
")",
";",
"$",
"counter",
"=",
"1",
";",
"... | Show input labels
@param mixed $data
@param array $fields
@return string | [
"Show",
"input",
"labels"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Field/Multiple.php#L61-L70 |
23,488 | dcsg/EventbriteApiConnector | lib/EventbriteApiConnector/Eventbrite.php | Eventbrite.get | public function get($method, array $params, array $options = array())
{
$this->parseOptions($options);
$params = array_merge($params, $this->apiKeys);
$response = $this->httpAdapter->getContent(
sprintf(self::API_ENDPOINT, $this->scheme, $this->outputFormat, $method .'?'. http_... | php | public function get($method, array $params, array $options = array())
{
$this->parseOptions($options);
$params = array_merge($params, $this->apiKeys);
$response = $this->httpAdapter->getContent(
sprintf(self::API_ENDPOINT, $this->scheme, $this->outputFormat, $method .'?'. http_... | [
"public",
"function",
"get",
"(",
"$",
"method",
",",
"array",
"$",
"params",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"parseOptions",
"(",
"$",
"options",
")",
";",
"$",
"params",
"=",
"array_merge",
"(",
... | Calls the Eventbrite API via GET
@param string $method Eventbrite API method
@param array $params API method params
@param array $options Options for calling the API like scheme, headers and output format
@return string The content | [
"Calls",
"the",
"Eventbrite",
"API",
"via",
"GET"
] | 3926f6dee8d824601cad7155bc2b5f9748218236 | https://github.com/dcsg/EventbriteApiConnector/blob/3926f6dee8d824601cad7155bc2b5f9748218236/lib/EventbriteApiConnector/Eventbrite.php#L79-L91 |
23,489 | dcsg/EventbriteApiConnector | lib/EventbriteApiConnector/Eventbrite.php | Eventbrite.parseOptions | private function parseOptions(array $options)
{
if (isset($options['headers']) && is_array($options['headers'])) {
$this->headers = $options['headers'];
}
if (isset($options['scheme']) && strtolower($options['scheme']) === 'http') {
$this->scheme = 'http';
}
... | php | private function parseOptions(array $options)
{
if (isset($options['headers']) && is_array($options['headers'])) {
$this->headers = $options['headers'];
}
if (isset($options['scheme']) && strtolower($options['scheme']) === 'http') {
$this->scheme = 'http';
}
... | [
"private",
"function",
"parseOptions",
"(",
"array",
"$",
"options",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'headers'",
"]",
")",
"&&",
"is_array",
"(",
"$",
"options",
"[",
"'headers'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"heade... | Parser for options like scheme, headers and output format.
@param array $options
@return null | [
"Parser",
"for",
"options",
"like",
"scheme",
"headers",
"and",
"output",
"format",
"."
] | 3926f6dee8d824601cad7155bc2b5f9748218236 | https://github.com/dcsg/EventbriteApiConnector/blob/3926f6dee8d824601cad7155bc2b5f9748218236/lib/EventbriteApiConnector/Eventbrite.php#L126-L139 |
23,490 | dcsg/EventbriteApiConnector | lib/EventbriteApiConnector/Eventbrite.php | Eventbrite.responseHandler | private function responseHandler($responseBody)
{
if ('json' === $this->outputFormat) {
return $this->validateJsonResponse($responseBody);
}
return $this->validateXmlResponse($responseBody);
} | php | private function responseHandler($responseBody)
{
if ('json' === $this->outputFormat) {
return $this->validateJsonResponse($responseBody);
}
return $this->validateXmlResponse($responseBody);
} | [
"private",
"function",
"responseHandler",
"(",
"$",
"responseBody",
")",
"{",
"if",
"(",
"'json'",
"===",
"$",
"this",
"->",
"outputFormat",
")",
"{",
"return",
"$",
"this",
"->",
"validateJsonResponse",
"(",
"$",
"responseBody",
")",
";",
"}",
"return",
"... | Handler for validate the response body.
@param string $responseBody Content body of the response
@return string | [
"Handler",
"for",
"validate",
"the",
"response",
"body",
"."
] | 3926f6dee8d824601cad7155bc2b5f9748218236 | https://github.com/dcsg/EventbriteApiConnector/blob/3926f6dee8d824601cad7155bc2b5f9748218236/lib/EventbriteApiConnector/Eventbrite.php#L148-L155 |
23,491 | dcsg/EventbriteApiConnector | lib/EventbriteApiConnector/Eventbrite.php | Eventbrite.validateJsonResponse | private function validateJsonResponse($responseBody)
{
$data = json_decode($responseBody);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \Exception('Error decoding JSON.');
}
if (isset($data->error)) {
throw new \Exception($data->error->error_messag... | php | private function validateJsonResponse($responseBody)
{
$data = json_decode($responseBody);
if (json_last_error() !== JSON_ERROR_NONE) {
throw new \Exception('Error decoding JSON.');
}
if (isset($data->error)) {
throw new \Exception($data->error->error_messag... | [
"private",
"function",
"validateJsonResponse",
"(",
"$",
"responseBody",
")",
"{",
"$",
"data",
"=",
"json_decode",
"(",
"$",
"responseBody",
")",
";",
"if",
"(",
"json_last_error",
"(",
")",
"!==",
"JSON_ERROR_NONE",
")",
"{",
"throw",
"new",
"\\",
"Excepti... | Parses the response content for the JSON output format
@param string $responseBody
@return string
@throws \Exception | [
"Parses",
"the",
"response",
"content",
"for",
"the",
"JSON",
"output",
"format"
] | 3926f6dee8d824601cad7155bc2b5f9748218236 | https://github.com/dcsg/EventbriteApiConnector/blob/3926f6dee8d824601cad7155bc2b5f9748218236/lib/EventbriteApiConnector/Eventbrite.php#L165-L182 |
23,492 | dcsg/EventbriteApiConnector | lib/EventbriteApiConnector/Eventbrite.php | Eventbrite.validateXmlResponse | private function validateXmlResponse($responseBody)
{
$data = simplexml_load_string($responseBody);
if (isset($data->error_type)) {
throw new \Exception($data->error_message);
}
return $responseBody;
} | php | private function validateXmlResponse($responseBody)
{
$data = simplexml_load_string($responseBody);
if (isset($data->error_type)) {
throw new \Exception($data->error_message);
}
return $responseBody;
} | [
"private",
"function",
"validateXmlResponse",
"(",
"$",
"responseBody",
")",
"{",
"$",
"data",
"=",
"simplexml_load_string",
"(",
"$",
"responseBody",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"->",
"error_type",
")",
")",
"{",
"throw",
"new",
"\\",
... | Parses the response content for the XML output format
@param string $responseBody
@return string
@throws \Exception | [
"Parses",
"the",
"response",
"content",
"for",
"the",
"XML",
"output",
"format"
] | 3926f6dee8d824601cad7155bc2b5f9748218236 | https://github.com/dcsg/EventbriteApiConnector/blob/3926f6dee8d824601cad7155bc2b5f9748218236/lib/EventbriteApiConnector/Eventbrite.php#L192-L201 |
23,493 | getuisdk/getui-php-sdk | src/PBMessage.php | PBMessage.getTypes | public function getTypes($number)
{
$binstring = decbin((int) $number);
$types = array();
$mlen = strlen($binstring) - 3;
$low = substr($binstring, $mlen, strlen($binstring));
$high = substr($binstring, 0, $mlen) . '0000';
$types['wired'] = bindec($low);
... | php | public function getTypes($number)
{
$binstring = decbin((int) $number);
$types = array();
$mlen = strlen($binstring) - 3;
$low = substr($binstring, $mlen, strlen($binstring));
$high = substr($binstring, 0, $mlen) . '0000';
$types['wired'] = bindec($low);
... | [
"public",
"function",
"getTypes",
"(",
"$",
"number",
")",
"{",
"$",
"binstring",
"=",
"decbin",
"(",
"(",
"int",
")",
"$",
"number",
")",
";",
"$",
"types",
"=",
"array",
"(",
")",
";",
"$",
"mlen",
"=",
"strlen",
"(",
"$",
"binstring",
")",
"-"... | Get the wired_type and field_type
@param $number
@return array wired_type, field_type | [
"Get",
"the",
"wired_type",
"and",
"field_type"
] | e91773b099bcbfd7492a44086b373d1c9fee37e2 | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBMessage.php#L77-L87 |
23,494 | getuisdk/getui-php-sdk | src/PBMessage.php | PBMessage.serializeToString | public function serializeToString($rec = -1)
{
$string = '';
// wired and type
if ($rec > -1) {
$string .= $this->base128->setValue($rec << 3 | $this->wired_type);
}
$stringinner = '';
foreach ($this->fields as $index => $field) {
... | php | public function serializeToString($rec = -1)
{
$string = '';
// wired and type
if ($rec > -1) {
$string .= $this->base128->setValue($rec << 3 | $this->wired_type);
}
$stringinner = '';
foreach ($this->fields as $index => $field) {
... | [
"public",
"function",
"serializeToString",
"(",
"$",
"rec",
"=",
"-",
"1",
")",
"{",
"$",
"string",
"=",
"''",
";",
"// wired and type\r",
"if",
"(",
"$",
"rec",
">",
"-",
"1",
")",
"{",
"$",
"string",
".=",
"$",
"this",
"->",
"base128",
"->",
"set... | Encodes a Message
@param mixed $rec
@return string the encoded message | [
"Encodes",
"a",
"Message"
] | e91773b099bcbfd7492a44086b373d1c9fee37e2 | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBMessage.php#L95-L135 |
23,495 | getuisdk/getui-php-sdk | src/PBMessage.php | PBMessage.addArrValue | protected function addArrValue($index)
{
$class_name = $this->fields[$index];
$real_class_name = __NAMESPACE__ . "\\" . $class_name;
return $this->values[$index][] = new $real_class_name();
} | php | protected function addArrValue($index)
{
$class_name = $this->fields[$index];
$real_class_name = __NAMESPACE__ . "\\" . $class_name;
return $this->values[$index][] = new $real_class_name();
} | [
"protected",
"function",
"addArrValue",
"(",
"$",
"index",
")",
"{",
"$",
"class_name",
"=",
"$",
"this",
"->",
"fields",
"[",
"$",
"index",
"]",
";",
"$",
"real_class_name",
"=",
"__NAMESPACE__",
".",
"\"\\\\\"",
".",
"$",
"class_name",
";",
"return",
"... | Add an array value
@param int - index of the field | [
"Add",
"an",
"array",
"value"
] | e91773b099bcbfd7492a44086b373d1c9fee37e2 | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBMessage.php#L236-L241 |
23,496 | getuisdk/getui-php-sdk | src/PBMessage.php | PBMessage.setValue | protected function setValue($index, $value)
{
if (gettype($value) === 'object') {
$this->values[$index] = $value;
} else {
$class_name = $this->fields[$index];
$real_class_name = __NAMESPACE__ . "\\" . $class_name;
$this->values[$index] = new $r... | php | protected function setValue($index, $value)
{
if (gettype($value) === 'object') {
$this->values[$index] = $value;
} else {
$class_name = $this->fields[$index];
$real_class_name = __NAMESPACE__ . "\\" . $class_name;
$this->values[$index] = new $r... | [
"protected",
"function",
"setValue",
"(",
"$",
"index",
",",
"$",
"value",
")",
"{",
"if",
"(",
"gettype",
"(",
"$",
"value",
")",
"===",
"'object'",
")",
"{",
"$",
"this",
"->",
"values",
"[",
"$",
"index",
"]",
"=",
"$",
"value",
";",
"}",
"els... | Set an value
@param int - index of the field
@param Mixed $value
@return mixed | [
"Set",
"an",
"value"
] | e91773b099bcbfd7492a44086b373d1c9fee37e2 | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBMessage.php#L269-L280 |
23,497 | getuisdk/getui-php-sdk | src/PBMessage.php | PBMessage.saveString | protected function saveString($ch, $string)
{
$this->dString .= $string;
$content_length = strlen($this->dString);
return strlen($string);
} | php | protected function saveString($ch, $string)
{
$this->dString .= $string;
$content_length = strlen($this->dString);
return strlen($string);
} | [
"protected",
"function",
"saveString",
"(",
"$",
"ch",
",",
"$",
"string",
")",
"{",
"$",
"this",
"->",
"dString",
".=",
"$",
"string",
";",
"$",
"content_length",
"=",
"strlen",
"(",
"$",
"this",
"->",
"dString",
")",
";",
"return",
"strlen",
"(",
"... | Helper method for send string | [
"Helper",
"method",
"for",
"send",
"string"
] | e91773b099bcbfd7492a44086b373d1c9fee37e2 | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBMessage.php#L319-L324 |
23,498 | pinepain/amqpy | src/AMQPy/AbstractConsumer.php | AbstractConsumer.failure | public function failure(Exception $e, Delivery $delivery, AbstractListener $listener)
{
$listener->resend($delivery);
} | php | public function failure(Exception $e, Delivery $delivery, AbstractListener $listener)
{
$listener->resend($delivery);
} | [
"public",
"function",
"failure",
"(",
"Exception",
"$",
"e",
",",
"Delivery",
"$",
"delivery",
",",
"AbstractListener",
"$",
"listener",
")",
"{",
"$",
"listener",
"->",
"resend",
"(",
"$",
"delivery",
")",
";",
"}"
] | Handle any exception during queued message data processing. | [
"Handle",
"any",
"exception",
"during",
"queued",
"message",
"data",
"processing",
"."
] | fc61dacc37a97a100caf67232a72be32dd7cc896 | https://github.com/pinepain/amqpy/blob/fc61dacc37a97a100caf67232a72be32dd7cc896/src/AMQPy/AbstractConsumer.php#L37-L40 |
23,499 | SporkCode/Spork | src/View/Helper/HeadScript.php | HeadScript.toString | public function toString($indent = null)
{
$helperManager = $this->getView()->getHelperPluginManager();
if ($helperManager->has('dojo')) {
$dojo = $helperManager->get('dojo');
$dojo->initialize();
}
return parent::toString($indent);
} | php | public function toString($indent = null)
{
$helperManager = $this->getView()->getHelperPluginManager();
if ($helperManager->has('dojo')) {
$dojo = $helperManager->get('dojo');
$dojo->initialize();
}
return parent::toString($indent);
} | [
"public",
"function",
"toString",
"(",
"$",
"indent",
"=",
"null",
")",
"{",
"$",
"helperManager",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
"->",
"getHelperPluginManager",
"(",
")",
";",
"if",
"(",
"$",
"helperManager",
"->",
"has",
"(",
"'dojo'",
... | Find an initialize Dojo helper before rendering head scripts
@see \Zend\View\Helper\HeadScript::toString()
@param string $indent
@return string | [
"Find",
"an",
"initialize",
"Dojo",
"helper",
"before",
"rendering",
"head",
"scripts"
] | 7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a | https://github.com/SporkCode/Spork/blob/7f569efdc0ceb4a9c1c7a8b648b6a7ed50d2088a/src/View/Helper/HeadScript.php#L22-L30 |
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.