repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
2amigos/yiifoundation | widgets/FlexVideo.php | FlexVideo.init | public function init()
{
if ($this->source === null) {
throw new InvalidConfigException('"source" cannot be null.');
}
Html::addCssClass($this->htmlOptions, Enum::VIDEO_FLEXVIDEO);
if ($this->widescreen) {
Html::addCssClass($this->htmlOptions, Enum::VIDEO_WIDE... | php | public function init()
{
if ($this->source === null) {
throw new InvalidConfigException('"source" cannot be null.');
}
Html::addCssClass($this->htmlOptions, Enum::VIDEO_FLEXVIDEO);
if ($this->widescreen) {
Html::addCssClass($this->htmlOptions, Enum::VIDEO_WIDE... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"source",
"===",
"null",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"'\"source\" cannot be null.'",
")",
";",
"}",
"Html",
"::",
"addCssClass",
"(",
"$",
"this",
"->",... | Initializes the widget
@throws InvalidConfigException | [
"Initializes",
"the",
"widget"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/FlexVideo.php#L55-L68 |
2amigos/yiifoundation | widgets/FlexVideo.php | FlexVideo.renderVideo | public function renderVideo()
{
$iframe = \CHtml::openTag(
'iframe',
array(
'height' => $this->height,
'width' => $this->width,
'src' => $this->source,
'allowfullscreen' => $this->allowFull... | php | public function renderVideo()
{
$iframe = \CHtml::openTag(
'iframe',
array(
'height' => $this->height,
'width' => $this->width,
'src' => $this->source,
'allowfullscreen' => $this->allowFull... | [
"public",
"function",
"renderVideo",
"(",
")",
"{",
"$",
"iframe",
"=",
"\\",
"CHtml",
"::",
"openTag",
"(",
"'iframe'",
",",
"array",
"(",
"'height'",
"=>",
"$",
"this",
"->",
"height",
",",
"'width'",
"=>",
"$",
"this",
"->",
"width",
",",
"'src'",
... | Renders video
@return string the resulting tag | [
"Renders",
"video"
] | train | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/FlexVideo.php#L82-L96 |
comodojo/cookies | src/Comodojo/Cookies/AbstractCookie.php | AbstractCookie.setName | public function setName($name) {
if ( empty($name) || !is_scalar($name) ) throw new CookieException("Invalid cookie name");
$this->name = $name;
return $this;
} | php | public function setName($name) {
if ( empty($name) || !is_scalar($name) ) throw new CookieException("Invalid cookie name");
$this->name = $name;
return $this;
} | [
"public",
"function",
"setName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
"||",
"!",
"is_scalar",
"(",
"$",
"name",
")",
")",
"throw",
"new",
"CookieException",
"(",
"\"Invalid cookie name\"",
")",
";",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/AbstractCookie.php#L114-L122 |
comodojo/cookies | src/Comodojo/Cookies/AbstractCookie.php | AbstractCookie.setDomain | public function setDomain($domain) {
if ( !is_scalar($domain) || !CookieTools::checkDomain($domain) ) throw new CookieException("Invalid domain attribute");
$this->domain = $domain;
return $this;
} | php | public function setDomain($domain) {
if ( !is_scalar($domain) || !CookieTools::checkDomain($domain) ) throw new CookieException("Invalid domain attribute");
$this->domain = $domain;
return $this;
} | [
"public",
"function",
"setDomain",
"(",
"$",
"domain",
")",
"{",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"domain",
")",
"||",
"!",
"CookieTools",
"::",
"checkDomain",
"(",
"$",
"domain",
")",
")",
"throw",
"new",
"CookieException",
"(",
"\"Invalid domain at... | {@inheritdoc} | [
"{"
] | train | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/AbstractCookie.php#L172-L180 |
comodojo/cookies | src/Comodojo/Cookies/AbstractCookie.php | AbstractCookie.save | public function save() {
if ( setcookie(
$this->name,
$this->value,
$this->expire,
$this->path,
$this->domain,
$this->secure,
$this->httponly
) === false ) throw new CookieException("Cannot set cookie: ".$this->name);
... | php | public function save() {
if ( setcookie(
$this->name,
$this->value,
$this->expire,
$this->path,
$this->domain,
$this->secure,
$this->httponly
) === false ) throw new CookieException("Cannot set cookie: ".$this->name);
... | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"setcookie",
"(",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"value",
",",
"$",
"this",
"->",
"expire",
",",
"$",
"this",
"->",
"path",
",",
"$",
"this",
"->",
"domain",
",",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/AbstractCookie.php#L207-L221 |
comodojo/cookies | src/Comodojo/Cookies/AbstractCookie.php | AbstractCookie.load | public function load() {
if ( !$this->exists() ) throw new CookieException("Cookie does not exists");
$this->value = $_COOKIE[$this->name];
return $this;
} | php | public function load() {
if ( !$this->exists() ) throw new CookieException("Cookie does not exists");
$this->value = $_COOKIE[$this->name];
return $this;
} | [
"public",
"function",
"load",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"throw",
"new",
"CookieException",
"(",
"\"Cookie does not exists\"",
")",
";",
"$",
"this",
"->",
"value",
"=",
"$",
"_COOKIE",
"[",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/AbstractCookie.php#L226-L234 |
comodojo/cookies | src/Comodojo/Cookies/AbstractCookie.php | AbstractCookie.delete | public function delete() {
if ( !$this->exists() ) return true;
if ( setcookie(
$this->name,
null,
time() - 86400,
null,
null,
$this->secure,
$this->httponly
) === false ) throw new CookieException("Cannot dele... | php | public function delete() {
if ( !$this->exists() ) return true;
if ( setcookie(
$this->name,
null,
time() - 86400,
null,
null,
$this->secure,
$this->httponly
) === false ) throw new CookieException("Cannot dele... | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
"(",
")",
")",
"return",
"true",
";",
"if",
"(",
"setcookie",
"(",
"$",
"this",
"->",
"name",
",",
"null",
",",
"time",
"(",
")",
"-",
"86400",
",",
"nu... | {@inheritdoc} | [
"{"
] | train | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/AbstractCookie.php#L239-L255 |
comodojo/cookies | src/Comodojo/Cookies/AbstractCookie.php | AbstractCookie.erase | public static function erase($name) {
try {
$class = get_called_class();
$cookie = new $class($name);
return $cookie->delete();
} catch (CookieException $ce) {
throw $ce;
}
} | php | public static function erase($name) {
try {
$class = get_called_class();
$cookie = new $class($name);
return $cookie->delete();
} catch (CookieException $ce) {
throw $ce;
}
} | [
"public",
"static",
"function",
"erase",
"(",
"$",
"name",
")",
"{",
"try",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"cookie",
"=",
"new",
"$",
"class",
"(",
"$",
"name",
")",
";",
"return",
"$",
"cookie",
"->",
"delete",
"("... | Static method to quickly delete a cookie
@param string $name
The cookie name
@return boolean
@throws CookieException | [
"Static",
"method",
"to",
"quickly",
"delete",
"a",
"cookie"
] | train | https://github.com/comodojo/cookies/blob/a81c7dff37d52c1a75462c0ad30db75d0c3b0081/src/Comodojo/Cookies/AbstractCookie.php#L275-L291 |
dms-org/package.blog | src/Cms/BlogCategoryModule.php | BlogCategoryModule.defineCrudModule | protected function defineCrudModule(CrudModuleDefinition $module)
{
$module->name('categories');
$module->metadata([
'icon' => 'list',
]);
$module->labelObjects()->fromProperty(BlogCategory::NAME);
$module->crudForm(function (CrudFormDefinition $form) {
... | php | protected function defineCrudModule(CrudModuleDefinition $module)
{
$module->name('categories');
$module->metadata([
'icon' => 'list',
]);
$module->labelObjects()->fromProperty(BlogCategory::NAME);
$module->crudForm(function (CrudFormDefinition $form) {
... | [
"protected",
"function",
"defineCrudModule",
"(",
"CrudModuleDefinition",
"$",
"module",
")",
"{",
"$",
"module",
"->",
"name",
"(",
"'categories'",
")",
";",
"$",
"module",
"->",
"metadata",
"(",
"[",
"'icon'",
"=>",
"'list'",
",",
"]",
")",
";",
"$",
"... | Defines the structure of this module.
@param CrudModuleDefinition $module | [
"Defines",
"the",
"structure",
"of",
"this",
"module",
"."
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Cms/BlogCategoryModule.php#L52-L104 |
aedart/laravel-helpers | src/Traits/Validation/ValidatorTrait.php | ValidatorTrait.getValidator | public function getValidator(): ?Factory
{
if (!$this->hasValidator()) {
$this->setValidator($this->getDefaultValidator());
}
return $this->validator;
} | php | public function getValidator(): ?Factory
{
if (!$this->hasValidator()) {
$this->setValidator($this->getDefaultValidator());
}
return $this->validator;
} | [
"public",
"function",
"getValidator",
"(",
")",
":",
"?",
"Factory",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasValidator",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setValidator",
"(",
"$",
"this",
"->",
"getDefaultValidator",
"(",
")",
")",
";",
"}"... | Get validator
If no validator has been set, this method will
set and return a default validator, if any such
value is available
@see getDefaultValidator()
@return Factory|null validator or null if none validator has been set | [
"Get",
"validator"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Validation/ValidatorTrait.php#L53-L59 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityReference.php | EntityReference.hydrate | public function hydrate() {
if (!isset($this->em)) {
$e = new EntityReferenceHydrationexception('Konnte Reference: '.$this->getEntityName().':'.$this->getIdentifier().' nicht auflösen. Da der EntityManager nicht gesetzt ist.');
$e->reference = $this;
throw $e;
}
try {
ret... | php | public function hydrate() {
if (!isset($this->em)) {
$e = new EntityReferenceHydrationexception('Konnte Reference: '.$this->getEntityName().':'.$this->getIdentifier().' nicht auflösen. Da der EntityManager nicht gesetzt ist.');
$e->reference = $this;
throw $e;
}
try {
ret... | [
"public",
"function",
"hydrate",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"em",
")",
")",
"{",
"$",
"e",
"=",
"new",
"EntityReferenceHydrationexception",
"(",
"'Konnte Reference: '",
".",
"$",
"this",
"->",
"getEntityName",
"(",
")... | Schmeisst eine Exception wenn die Reference nicht aufgelöst werden kann | [
"Schmeisst",
"eine",
"Exception",
"wenn",
"die",
"Reference",
"nicht",
"aufgelöst",
"werden",
"kann"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityReference.php#L32-L47 |
ClanCats/Core | src/bundles/Mail/Transporter/Sendmail.php | Transporter_Sendmail.setup_driver | protected function setup_driver( &$driver )
{
if ( !is_null( $this->config->path ) )
{
$driver->Sendmail = $this->config->path;
}
} | php | protected function setup_driver( &$driver )
{
if ( !is_null( $this->config->path ) )
{
$driver->Sendmail = $this->config->path;
}
} | [
"protected",
"function",
"setup_driver",
"(",
"&",
"$",
"driver",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"config",
"->",
"path",
")",
")",
"{",
"$",
"driver",
"->",
"Sendmail",
"=",
"$",
"this",
"->",
"config",
"->",
"path",
"... | Set the driver settings ( smtp / sendmail )
@param PHPMailer $driver
@return void | [
"Set",
"the",
"driver",
"settings",
"(",
"smtp",
"/",
"sendmail",
")"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/Transporter/Sendmail.php#L20-L26 |
forxer/tao | src/Tao/Triggers/Triggers.php | Triggers.registerTriggers | public function registerTriggers(array $aTriggers = [])
{
foreach ($aTriggers as $sTrigger => $mCallable) {
$this->registerTrigger($sTrigger, $mCallable);
}
} | php | public function registerTriggers(array $aTriggers = [])
{
foreach ($aTriggers as $sTrigger => $mCallable) {
$this->registerTrigger($sTrigger, $mCallable);
}
} | [
"public",
"function",
"registerTriggers",
"(",
"array",
"$",
"aTriggers",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"aTriggers",
"as",
"$",
"sTrigger",
"=>",
"$",
"mCallable",
")",
"{",
"$",
"this",
"->",
"registerTrigger",
"(",
"$",
"sTrigger",
",",... | Ajout de plusieurs nouveaux callables à la pile de déclencheurs.
@param array $aTriggers Tableaux des déclencheurs à ajouter
@return void | [
"Ajout",
"de",
"plusieurs",
"nouveaux",
"callables",
"à",
"la",
"pile",
"de",
"déclencheurs",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Triggers/Triggers.php#L34-L39 |
forxer/tao | src/Tao/Triggers/Triggers.php | Triggers.getTriggers | public function getTriggers($sTrigger = null)
{
if (empty($this->aTriggersStack)) {
return null;
}
if (null === $sTrigger) {
return $this->aTriggersStack;
}
if ($this->hasTrigger($sTrigger)) {
return $this->aTriggersStack[$sTrigger];
}
return null;
} | php | public function getTriggers($sTrigger = null)
{
if (empty($this->aTriggersStack)) {
return null;
}
if (null === $sTrigger) {
return $this->aTriggersStack;
}
if ($this->hasTrigger($sTrigger)) {
return $this->aTriggersStack[$sTrigger];
}
return null;
} | [
"public",
"function",
"getTriggers",
"(",
"$",
"sTrigger",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"aTriggersStack",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"sTrigger",
")",
"{",
"return",
... | Permet de récupérer la pile des déclencheurs
(ou un déclencheur si le paramètre est précisé).
@param string $sTrigger Nom du déclencheur
@return array | [
"Permet",
"de",
"récupérer",
"la",
"pile",
"des",
"déclencheurs",
"(",
"ou",
"un",
"déclencheur",
"si",
"le",
"paramètre",
"est",
"précisé",
")",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Triggers/Triggers.php#L95-L110 |
forxer/tao | src/Tao/Triggers/Triggers.php | Triggers.callTrigger | public function callTrigger($sTrigger)
{
if (!$this->hasTrigger($sTrigger)) {
return null;
}
$args = func_get_args();
array_shift($args);
$sReturn = '';
foreach ($this->aTriggersStack[$sTrigger] as $f) {
$sReturn .= call_user_func_array($f, $args);
}
return $sReturn;
} | php | public function callTrigger($sTrigger)
{
if (!$this->hasTrigger($sTrigger)) {
return null;
}
$args = func_get_args();
array_shift($args);
$sReturn = '';
foreach ($this->aTriggersStack[$sTrigger] as $f) {
$sReturn .= call_user_func_array($f, $args);
}
return $sReturn;
} | [
"public",
"function",
"callTrigger",
"(",
"$",
"sTrigger",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasTrigger",
"(",
"$",
"sTrigger",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(... | Appelle chaque callable dans la pile de déclencheurs pour
un déclencheur donné et retourne les résultats concaténés
de chaques callables.
@param string $sTrigger Nom du déclencheur
@return string | [
"Appelle",
"chaque",
"callable",
"dans",
"la",
"pile",
"de",
"déclencheurs",
"pour",
"un",
"déclencheur",
"donné",
"et",
"retourne",
"les",
"résultats",
"concaténés",
"de",
"chaques",
"callables",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Triggers/Triggers.php#L142-L157 |
dms-org/package.blog | src/Cms/BlogArticleModule.php | BlogArticleModule.defineCrudModule | protected function defineCrudModule(CrudModuleDefinition $module)
{
$module->name('articles');
$module->metadata([
'icon' => 'newspaper-o',
]);
$module->labelObjects()->fromProperty(BlogArticle::TITLE);
if ($this->blogConfiguration->getArticlePreviewCallback())... | php | protected function defineCrudModule(CrudModuleDefinition $module)
{
$module->name('articles');
$module->metadata([
'icon' => 'newspaper-o',
]);
$module->labelObjects()->fromProperty(BlogArticle::TITLE);
if ($this->blogConfiguration->getArticlePreviewCallback())... | [
"protected",
"function",
"defineCrudModule",
"(",
"CrudModuleDefinition",
"$",
"module",
")",
"{",
"$",
"module",
"->",
"name",
"(",
"'articles'",
")",
";",
"$",
"module",
"->",
"metadata",
"(",
"[",
"'icon'",
"=>",
"'newspaper-o'",
",",
"]",
")",
";",
"$"... | Defines the structure of this module.
@param CrudModuleDefinition $module | [
"Defines",
"the",
"structure",
"of",
"this",
"module",
"."
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Cms/BlogArticleModule.php#L77-L202 |
ammarfaizi2/Brainly | src/Brainly.php | Brainly.isPerfectCache | private function isPerfectCache()
{
if ($this->cacheMap[$this->hash] + 0x93a80 > time()) {
$this->cacheData = json_decode(
file_get_contents(
$this->cacheFile
),
true
);
return is_array($this->cacheData);
}
return false;
} | php | private function isPerfectCache()
{
if ($this->cacheMap[$this->hash] + 0x93a80 > time()) {
$this->cacheData = json_decode(
file_get_contents(
$this->cacheFile
),
true
);
return is_array($this->cacheData);
}
return false;
} | [
"private",
"function",
"isPerfectCache",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"cacheMap",
"[",
"$",
"this",
"->",
"hash",
"]",
"+",
"0x93a80",
">",
"time",
"(",
")",
")",
"{",
"$",
"this",
"->",
"cacheData",
"=",
"json_decode",
"(",
"file_get... | Check the current cache is perfect or not.
@return bool | [
"Check",
"the",
"current",
"cache",
"is",
"perfect",
"or",
"not",
"."
] | train | https://github.com/ammarfaizi2/Brainly/blob/fe543a58563ed4ff4294a6c8c21ff719dd487b89/src/Brainly.php#L107-L119 |
ammarfaizi2/Brainly | src/Brainly.php | Brainly._exec | private function _exec()
{
if ($this->isCached() && $this->isPerfectCache()) {
return $this->getCache();
} else {
return $this->fixer(
$this->search(
$this->query,
$this->limit
)
);
}
} | php | private function _exec()
{
if ($this->isCached() && $this->isPerfectCache()) {
return $this->getCache();
} else {
return $this->fixer(
$this->search(
$this->query,
$this->limit
)
);
}
} | [
"private",
"function",
"_exec",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isCached",
"(",
")",
"&&",
"$",
"this",
"->",
"isPerfectCache",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getCache",
"(",
")",
";",
"}",
"else",
"{",
"return",
... | Search data. | [
"Search",
"data",
"."
] | train | https://github.com/ammarfaizi2/Brainly/blob/fe543a58563ed4ff4294a6c8c21ff719dd487b89/src/Brainly.php#L137-L149 |
ammarfaizi2/Brainly | src/Brainly.php | Brainly.search | private static function search($query, $limit = 10)
{
$ch = curl_init(
"https://brainly.co.id/api/28/api_tasks/suggester?limit=".((int) $limit)."&query=".urlencode($query)
);
curl_setopt_array(
$ch,
[
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST =>... | php | private static function search($query, $limit = 10)
{
$ch = curl_init(
"https://brainly.co.id/api/28/api_tasks/suggester?limit=".((int) $limit)."&query=".urlencode($query)
);
curl_setopt_array(
$ch,
[
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST =>... | [
"private",
"static",
"function",
"search",
"(",
"$",
"query",
",",
"$",
"limit",
"=",
"10",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
"\"https://brainly.co.id/api/28/api_tasks/suggester?limit=\"",
".",
"(",
"(",
"int",
")",
"$",
"limit",
")",
".",
"\"&quer... | Online search
@param string $query
@param int $limit
@return string | [
"Online",
"search"
] | train | https://github.com/ammarfaizi2/Brainly/blob/fe543a58563ed4ff4294a6c8c21ff719dd487b89/src/Brainly.php#L158-L181 |
ammarfaizi2/Brainly | src/Brainly.php | Brainly.fixer | private function fixer($data, $noWrite = false)
{
if (
$noWrite or $this->writeCache($data)
) {
$data = $noWrite ? $data : json_decode($data, true);
if ($data['success'] === true) {
if (isset($data['data']['tasks']['items'])) {
$r = [];
foreach ($data['data']['tasks']['items'] as $k => $v) {... | php | private function fixer($data, $noWrite = false)
{
if (
$noWrite or $this->writeCache($data)
) {
$data = $noWrite ? $data : json_decode($data, true);
if ($data['success'] === true) {
if (isset($data['data']['tasks']['items'])) {
$r = [];
foreach ($data['data']['tasks']['items'] as $k => $v) {... | [
"private",
"function",
"fixer",
"(",
"$",
"data",
",",
"$",
"noWrite",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"noWrite",
"or",
"$",
"this",
"->",
"writeCache",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"$",
"noWrite",
"?",
"$",
"data",
... | Fix raw data.
@param string $data
@return array | [
"Fix",
"raw",
"data",
"."
] | train | https://github.com/ammarfaizi2/Brainly/blob/fe543a58563ed4ff4294a6c8c21ff719dd487b89/src/Brainly.php#L189-L215 |
ammarfaizi2/Brainly | src/Brainly.php | Brainly.writeCache | private function writeCache($data)
{
$this->cacheMap[$this->hash] = time();
$handle = fopen($this->cacheMapFile, "w");
flock($handle, LOCK_EX);
$write1 = fwrite($handle,
json_encode(
$this->cacheMap,
JSON_UNESCAPED_SLASHES
)
);
fclose($handle);
$handle = fopen($this->cacheFile, "w");
fl... | php | private function writeCache($data)
{
$this->cacheMap[$this->hash] = time();
$handle = fopen($this->cacheMapFile, "w");
flock($handle, LOCK_EX);
$write1 = fwrite($handle,
json_encode(
$this->cacheMap,
JSON_UNESCAPED_SLASHES
)
);
fclose($handle);
$handle = fopen($this->cacheFile, "w");
fl... | [
"private",
"function",
"writeCache",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"cacheMap",
"[",
"$",
"this",
"->",
"hash",
"]",
"=",
"time",
"(",
")",
";",
"$",
"handle",
"=",
"fopen",
"(",
"$",
"this",
"->",
"cacheMapFile",
",",
"\"w\"",
")",... | Write cache.
@param string $data
@return bool | [
"Write",
"cache",
"."
] | train | https://github.com/ammarfaizi2/Brainly/blob/fe543a58563ed4ff4294a6c8c21ff719dd487b89/src/Brainly.php#L223-L242 |
phpmob/changmin | src/PhpMob/CoreBundle/Model/WebUser.php | WebUser.setPicture | public function setPicture(?WebUserPictureInterface $picture = null): void
{
$this->picture = $picture ? ($picture->getFile() ? $picture : null) : null;
if ($this->picture) {
$picture->setOwner($this);
}
} | php | public function setPicture(?WebUserPictureInterface $picture = null): void
{
$this->picture = $picture ? ($picture->getFile() ? $picture : null) : null;
if ($this->picture) {
$picture->setOwner($this);
}
} | [
"public",
"function",
"setPicture",
"(",
"?",
"WebUserPictureInterface",
"$",
"picture",
"=",
"null",
")",
":",
"void",
"{",
"$",
"this",
"->",
"picture",
"=",
"$",
"picture",
"?",
"(",
"$",
"picture",
"->",
"getFile",
"(",
")",
"?",
"$",
"picture",
":... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/Model/WebUser.php#L82-L89 |
phpmob/changmin | src/PhpMob/CoreBundle/Model/WebUser.php | WebUser.getDisplayName | public function getDisplayName(): string
{
return (string)($this->displayName ? $this->displayName : (
$this->getFullName() ? $this->getFullName() : $this->username
));
} | php | public function getDisplayName(): string
{
return (string)($this->displayName ? $this->displayName : (
$this->getFullName() ? $this->getFullName() : $this->username
));
} | [
"public",
"function",
"getDisplayName",
"(",
")",
":",
"string",
"{",
"return",
"(",
"string",
")",
"(",
"$",
"this",
"->",
"displayName",
"?",
"$",
"this",
"->",
"displayName",
":",
"(",
"$",
"this",
"->",
"getFullName",
"(",
")",
"?",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/Model/WebUser.php#L94-L99 |
phpmob/changmin | src/PhpMob/CoreBundle/Model/WebUser.php | WebUser.setEmailCanonical | public function setEmailCanonical(?string $emailCanonical): void
{
parent::setEmailCanonical($emailCanonical);
if (!$this->email) {
$this->email = $emailCanonical;
}
if (!$this->usernameCanonical) {
$this->setUsernameCanonical($emailCanonical);
}
... | php | public function setEmailCanonical(?string $emailCanonical): void
{
parent::setEmailCanonical($emailCanonical);
if (!$this->email) {
$this->email = $emailCanonical;
}
if (!$this->usernameCanonical) {
$this->setUsernameCanonical($emailCanonical);
}
... | [
"public",
"function",
"setEmailCanonical",
"(",
"?",
"string",
"$",
"emailCanonical",
")",
":",
"void",
"{",
"parent",
"::",
"setEmailCanonical",
"(",
"$",
"emailCanonical",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"email",
")",
"{",
"$",
"this",
"->... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/Model/WebUser.php#L248-L259 |
phpmob/changmin | src/PhpMob/CoreBundle/Model/WebUser.php | WebUser.setUsernameCanonical | public function setUsernameCanonical(?string $usernameCanonical): void
{
parent::setUsernameCanonical($usernameCanonical);
if (!$this->username) {
$this->username = $usernameCanonical;
}
} | php | public function setUsernameCanonical(?string $usernameCanonical): void
{
parent::setUsernameCanonical($usernameCanonical);
if (!$this->username) {
$this->username = $usernameCanonical;
}
} | [
"public",
"function",
"setUsernameCanonical",
"(",
"?",
"string",
"$",
"usernameCanonical",
")",
":",
"void",
"{",
"parent",
"::",
"setUsernameCanonical",
"(",
"$",
"usernameCanonical",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"username",
")",
"{",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/Model/WebUser.php#L264-L271 |
shrink0r/workflux | src/Param/ParamHolderTrait.php | ParamHolderTrait.get | public function get(string $param_name, bool $treat_name_as_path = true)
{
if (!$treat_name_as_path) {
return $this->has($param_name) ? $this->params[$param_name] : null;
}
$params = $this->params;
$name_parts = array_reverse(explode('.', $param_name));
$cur_val =... | php | public function get(string $param_name, bool $treat_name_as_path = true)
{
if (!$treat_name_as_path) {
return $this->has($param_name) ? $this->params[$param_name] : null;
}
$params = $this->params;
$name_parts = array_reverse(explode('.', $param_name));
$cur_val =... | [
"public",
"function",
"get",
"(",
"string",
"$",
"param_name",
",",
"bool",
"$",
"treat_name_as_path",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"treat_name_as_path",
")",
"{",
"return",
"$",
"this",
"->",
"has",
"(",
"$",
"param_name",
")",
"?",
"$"... | @param string $param_name
@param bool $treat_name_as_path
@return mixed | [
"@param",
"string",
"$param_name",
"@param",
"bool",
"$treat_name_as_path"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Param/ParamHolderTrait.php#L30-L45 |
shrink0r/workflux | src/Param/ParamHolderTrait.php | ParamHolderTrait.withParam | public function withParam(string $param_name, $param_value, bool $treat_name_as_path = true): ParamHolderInterface
{
$param_holder = clone $this;
if ($treat_name_as_path) {
$name_parts = array_reverse(explode('.', $param_name));
$cur_val = &$param_holder->params;
... | php | public function withParam(string $param_name, $param_value, bool $treat_name_as_path = true): ParamHolderInterface
{
$param_holder = clone $this;
if ($treat_name_as_path) {
$name_parts = array_reverse(explode('.', $param_name));
$cur_val = &$param_holder->params;
... | [
"public",
"function",
"withParam",
"(",
"string",
"$",
"param_name",
",",
"$",
"param_value",
",",
"bool",
"$",
"treat_name_as_path",
"=",
"true",
")",
":",
"ParamHolderInterface",
"{",
"$",
"param_holder",
"=",
"clone",
"$",
"this",
";",
"if",
"(",
"$",
"... | @param string $param_name
@param mixed $param_value
@param bool $treat_name_as_path
@return self | [
"@param",
"string",
"$param_name",
"@param",
"mixed",
"$param_value",
"@param",
"bool",
"$treat_name_as_path"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Param/ParamHolderTrait.php#L64-L82 |
shrink0r/workflux | src/Param/ParamHolderTrait.php | ParamHolderTrait.withParams | public function withParams(array $params): ParamHolderInterface
{
$param_holder = clone $this;
$param_holder->params = array_merge($param_holder->params, $params);
return $param_holder;
} | php | public function withParams(array $params): ParamHolderInterface
{
$param_holder = clone $this;
$param_holder->params = array_merge($param_holder->params, $params);
return $param_holder;
} | [
"public",
"function",
"withParams",
"(",
"array",
"$",
"params",
")",
":",
"ParamHolderInterface",
"{",
"$",
"param_holder",
"=",
"clone",
"$",
"this",
";",
"$",
"param_holder",
"->",
"params",
"=",
"array_merge",
"(",
"$",
"param_holder",
"->",
"params",
",... | @param mixed[] $params
@return self | [
"@param",
"mixed",
"[]",
"$params"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Param/ParamHolderTrait.php#L89-L94 |
shrink0r/workflux | src/Param/ParamHolderTrait.php | ParamHolderTrait.withoutParam | public function withoutParam(string $param_name): ParamHolderInterface
{
if (!$this->has($param_name)) {
return $this;
}
$param_holder = clone $this;
unset($param_holder->params[$param_name]);
return $param_holder;
} | php | public function withoutParam(string $param_name): ParamHolderInterface
{
if (!$this->has($param_name)) {
return $this;
}
$param_holder = clone $this;
unset($param_holder->params[$param_name]);
return $param_holder;
} | [
"public",
"function",
"withoutParam",
"(",
"string",
"$",
"param_name",
")",
":",
"ParamHolderInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"param_name",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"param_holder",
"=",
"... | @param string $param_name
@return self | [
"@param",
"string",
"$param_name"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Param/ParamHolderTrait.php#L101-L109 |
shrink0r/workflux | src/Param/ParamHolderTrait.php | ParamHolderTrait.withoutParams | public function withoutParams(array $param_names): ParamHolderInterface
{
return array_reduce(
$param_names,
function (ParamHolderInterface $param_holder, $param_name) {
return $param_holder->withoutParam($param_name);
},
$this
);
} | php | public function withoutParams(array $param_names): ParamHolderInterface
{
return array_reduce(
$param_names,
function (ParamHolderInterface $param_holder, $param_name) {
return $param_holder->withoutParam($param_name);
},
$this
);
} | [
"public",
"function",
"withoutParams",
"(",
"array",
"$",
"param_names",
")",
":",
"ParamHolderInterface",
"{",
"return",
"array_reduce",
"(",
"$",
"param_names",
",",
"function",
"(",
"ParamHolderInterface",
"$",
"param_holder",
",",
"$",
"param_name",
")",
"{",
... | @param string[] $param_names
@return self | [
"@param",
"string",
"[]",
"$param_names"
] | train | https://github.com/shrink0r/workflux/blob/008f45c64f52b1f795ab7f6ddbfc1a55580254d9/src/Param/ParamHolderTrait.php#L116-L125 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Zmq/RequestReply/RequestReceiver.php | RequestReceiver.unbind | public function unbind()
{
if ($this->isBinded()) {
$this->getSocket()->unbind($this->dsn);
$this->dsn = null;
}
return $this;
} | php | public function unbind()
{
if ($this->isBinded()) {
$this->getSocket()->unbind($this->dsn);
$this->dsn = null;
}
return $this;
} | [
"public",
"function",
"unbind",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isBinded",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getSocket",
"(",
")",
"->",
"unbind",
"(",
"$",
"this",
"->",
"dsn",
")",
";",
"$",
"this",
"->",
"dsn",
"=",
"null... | Unbinds socket from current binded dsn
@return $this | [
"Unbinds",
"socket",
"from",
"current",
"binded",
"dsn"
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Zmq/RequestReply/RequestReceiver.php#L68-L76 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Zmq/RequestReply/RequestReceiver.php | RequestReceiver.receiveRequest | public function receiveRequest($wait = self::WAIT)
{
return $this->getSocket()->recv(($wait ? 0 : \ZMQ::MODE_DONTWAIT));
} | php | public function receiveRequest($wait = self::WAIT)
{
return $this->getSocket()->recv(($wait ? 0 : \ZMQ::MODE_DONTWAIT));
} | [
"public",
"function",
"receiveRequest",
"(",
"$",
"wait",
"=",
"self",
"::",
"WAIT",
")",
"{",
"return",
"$",
"this",
"->",
"getSocket",
"(",
")",
"->",
"recv",
"(",
"(",
"$",
"wait",
"?",
"0",
":",
"\\",
"ZMQ",
"::",
"MODE_DONTWAIT",
")",
")",
";"... | Getting next request from socket.
@param bool $wait If true call will waits for next request.
@return string
@throws \ZMQSocketException | [
"Getting",
"next",
"request",
"from",
"socket",
"."
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Zmq/RequestReply/RequestReceiver.php#L84-L87 |
SAREhub/PHP_Commons | src/SAREhub/Commons/Zmq/RequestReply/RequestReceiver.php | RequestReceiver.sendReply | public function sendReply($reply, $wait = self::WAIT)
{
$this->getSocket()->send($reply, ($wait ? 0 : \ZMQ::MODE_DONTWAIT));
return $this;
} | php | public function sendReply($reply, $wait = self::WAIT)
{
$this->getSocket()->send($reply, ($wait ? 0 : \ZMQ::MODE_DONTWAIT));
return $this;
} | [
"public",
"function",
"sendReply",
"(",
"$",
"reply",
",",
"$",
"wait",
"=",
"self",
"::",
"WAIT",
")",
"{",
"$",
"this",
"->",
"getSocket",
"(",
")",
"->",
"send",
"(",
"$",
"reply",
",",
"(",
"$",
"wait",
"?",
"0",
":",
"\\",
"ZMQ",
"::",
"MO... | Sending reply to ZMQ socket.
@param string $reply
@param bool $wait If true call will be waits for reply send done.
@return $this
@throws \ZMQSocketException | [
"Sending",
"reply",
"to",
"ZMQ",
"socket",
"."
] | train | https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Zmq/RequestReply/RequestReceiver.php#L96-L100 |
phpmob/changmin | src/PhpMob/CoreBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('phpmob_core');
$rootNode
->children()
->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end()
->arrayNode('gr... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('phpmob_core');
$rootNode
->children()
->scalarNode('driver')->defaultValue(SyliusResourceBundle::DRIVER_DOCTRINE_ORM)->end()
->arrayNode('gr... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'phpmob_core'",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/DependencyInjection/Configuration.php#L14-L105 |
gevans/phaker | lib/Phaker/Generator/Company.php | Company.catch_phrase | public function catch_phrase()
{
$buzzwords = static::translate('faker.company.buzzwords');
$words = array();
foreach ($buzzwords as $group)
{
$words[] = $group[array_rand($group)];
}
return implode(' ', $words);
} | php | public function catch_phrase()
{
$buzzwords = static::translate('faker.company.buzzwords');
$words = array();
foreach ($buzzwords as $group)
{
$words[] = $group[array_rand($group)];
}
return implode(' ', $words);
} | [
"public",
"function",
"catch_phrase",
"(",
")",
"{",
"$",
"buzzwords",
"=",
"static",
"::",
"translate",
"(",
"'faker.company.buzzwords'",
")",
";",
"$",
"words",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"buzzwords",
"as",
"$",
"group",
")",
"{"... | Generate a buzzword-laden catch phrase.
@return string | [
"Generate",
"a",
"buzzword",
"-",
"laden",
"catch",
"phrase",
"."
] | train | https://github.com/gevans/phaker/blob/b99f4a20a09188c219649127655e980d1e983274/lib/Phaker/Generator/Company.php#L36-L47 |
gevans/phaker | lib/Phaker/Generator/Company.php | Company.bs | public function bs()
{
$bs = static::translate('faker.company.buzzwords');
$words = array();
foreach ($bs as $group)
{
$words[] = $group[array_rand($group)];
}
return implode(' ', $words);
} | php | public function bs()
{
$bs = static::translate('faker.company.buzzwords');
$words = array();
foreach ($bs as $group)
{
$words[] = $group[array_rand($group)];
}
return implode(' ', $words);
} | [
"public",
"function",
"bs",
"(",
")",
"{",
"$",
"bs",
"=",
"static",
"::",
"translate",
"(",
"'faker.company.buzzwords'",
")",
";",
"$",
"words",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"bs",
"as",
"$",
"group",
")",
"{",
"$",
"words",
"[... | When a straight answer won't do, BS to the rescue!
@return string | [
"When",
"a",
"straight",
"answer",
"won",
"t",
"do",
"BS",
"to",
"the",
"rescue!"
] | train | https://github.com/gevans/phaker/blob/b99f4a20a09188c219649127655e980d1e983274/lib/Phaker/Generator/Company.php#L54-L65 |
fyuze/framework | src/Fyuze/Log/Logger.php | Logger.log | public function log($level, $message, array $context = [])
{
if (count($this->handlers) === 0) {
throw new RuntimeException('You must define at least one logging handler, none provided.');
}
foreach ($this->handlers as $handler) {
$this->logs[] = sprintf('[%s] %s', ... | php | public function log($level, $message, array $context = [])
{
if (count($this->handlers) === 0) {
throw new RuntimeException('You must define at least one logging handler, none provided.');
}
foreach ($this->handlers as $handler) {
$this->logs[] = sprintf('[%s] %s', ... | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"handlers",
")",
"===",
"0",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
... | Logs with an arbitrary level.
@param mixed $level
@param string $message
@param array $context
@return $this
@throws RuntimeException | [
"Logs",
"with",
"an",
"arbitrary",
"level",
"."
] | train | https://github.com/fyuze/framework/blob/89b3984f7225e24bfcdafb090ee197275b3222c9/src/Fyuze/Log/Logger.php#L53-L67 |
daithi-coombes/bluemix-personality-insights-php | lib/RestAPI.php | RestAPI.analyzeBlob | public function analyzeBlob($text)
{
$config = Config::getInstance();
$url = $config->getParams()['credentials']['url']
. '/v2/profile';
return $this->_worker->post(
$url,
array(
'body' => $text,
'headers' => array('Conte... | php | public function analyzeBlob($text)
{
$config = Config::getInstance();
$url = $config->getParams()['credentials']['url']
. '/v2/profile';
return $this->_worker->post(
$url,
array(
'body' => $text,
'headers' => array('Conte... | [
"public",
"function",
"analyzeBlob",
"(",
"$",
"text",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"getInstance",
"(",
")",
";",
"$",
"url",
"=",
"$",
"config",
"->",
"getParams",
"(",
")",
"[",
"'credentials'",
"]",
"[",
"'url'",
"]",
".",
"'/v2/p... | Analayze a blob of text.
@param string $text The text to analyze
@return object Returns the response object of the Client library used. | [
"Analayze",
"a",
"blob",
"of",
"text",
"."
] | train | https://github.com/daithi-coombes/bluemix-personality-insights-php/blob/171bd0a6deb3e1e9a7b38fc61c2a7ae601d76a9a/lib/RestAPI.php#L42-L56 |
daithi-coombes/bluemix-personality-insights-php | lib/RestAPI.php | RestAPI.getWorker | public function getWorker()
{
if ($this->_worker===null) {
$config = Config::getInstance();
$this->setupWorker($config);
}
return $this->_worker;
} | php | public function getWorker()
{
if ($this->_worker===null) {
$config = Config::getInstance();
$this->setupWorker($config);
}
return $this->_worker;
} | [
"public",
"function",
"getWorker",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_worker",
"===",
"null",
")",
"{",
"$",
"config",
"=",
"Config",
"::",
"getInstance",
"(",
")",
";",
"$",
"this",
"->",
"setupWorker",
"(",
"$",
"config",
")",
";",
"}... | Get the current worker.
@return object | [
"Get",
"the",
"current",
"worker",
"."
] | train | https://github.com/daithi-coombes/bluemix-personality-insights-php/blob/171bd0a6deb3e1e9a7b38fc61c2a7ae601d76a9a/lib/RestAPI.php#L62-L70 |
daithi-coombes/bluemix-personality-insights-php | lib/RestAPI.php | RestAPI.setupWorker | public function setupWorker(Config $config)
{
$credentials = $config->getParams()['credentials'];
$this->_worker = new \GuzzleHttp\Client(array(
'defaults' => array(
'auth' => array($credentials['username'], $credentials['password']),
),
));
} | php | public function setupWorker(Config $config)
{
$credentials = $config->getParams()['credentials'];
$this->_worker = new \GuzzleHttp\Client(array(
'defaults' => array(
'auth' => array($credentials['username'], $credentials['password']),
),
));
} | [
"public",
"function",
"setupWorker",
"(",
"Config",
"$",
"config",
")",
"{",
"$",
"credentials",
"=",
"$",
"config",
"->",
"getParams",
"(",
")",
"[",
"'credentials'",
"]",
";",
"$",
"this",
"->",
"_worker",
"=",
"new",
"\\",
"GuzzleHttp",
"\\",
"Client"... | Constructs the middleware REST client library.
@param Config $config The configuration singleton. | [
"Constructs",
"the",
"middleware",
"REST",
"client",
"library",
"."
] | train | https://github.com/daithi-coombes/bluemix-personality-insights-php/blob/171bd0a6deb3e1e9a7b38fc61c2a7ae601d76a9a/lib/RestAPI.php#L76-L86 |
spiral-modules/scaffolder | source/Scaffolder/Declarations/MiddlewareDeclaration.php | MiddlewareDeclaration.declareStructure | private function declareStructure()
{
$invoke = $this->method('__invoke')->setAccess(MethodDeclaration::ACCESS_PUBLIC);
$invoke->parameter('request')->setType('Request');
$invoke->parameter('response')->setType('Response');
$invoke->parameter('next')->setType('callable');
$... | php | private function declareStructure()
{
$invoke = $this->method('__invoke')->setAccess(MethodDeclaration::ACCESS_PUBLIC);
$invoke->parameter('request')->setType('Request');
$invoke->parameter('response')->setType('Response');
$invoke->parameter('next')->setType('callable');
$... | [
"private",
"function",
"declareStructure",
"(",
")",
"{",
"$",
"invoke",
"=",
"$",
"this",
"->",
"method",
"(",
"'__invoke'",
")",
"->",
"setAccess",
"(",
"MethodDeclaration",
"::",
"ACCESS_PUBLIC",
")",
";",
"$",
"invoke",
"->",
"parameter",
"(",
"'request'... | Declare default __invoke method body. | [
"Declare",
"default",
"__invoke",
"method",
"body",
"."
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Declarations/MiddlewareDeclaration.php#L49-L59 |
aedart/laravel-helpers | src/Traits/Console/ArtisanTrait.php | ArtisanTrait.getArtisan | public function getArtisan(): ?Kernel
{
if (!$this->hasArtisan()) {
$this->setArtisan($this->getDefaultArtisan());
}
return $this->artisan;
} | php | public function getArtisan(): ?Kernel
{
if (!$this->hasArtisan()) {
$this->setArtisan($this->getDefaultArtisan());
}
return $this->artisan;
} | [
"public",
"function",
"getArtisan",
"(",
")",
":",
"?",
"Kernel",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasArtisan",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setArtisan",
"(",
"$",
"this",
"->",
"getDefaultArtisan",
"(",
")",
")",
";",
"}",
"retu... | Get artisan
If no artisan has been set, this method will
set and return a default artisan, if any such
value is available
@see getDefaultArtisan()
@return Kernel|null artisan or null if none artisan has been set | [
"Get",
"artisan"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Console/ArtisanTrait.php#L53-L59 |
helthe/Chronos | CronExpression.php | CronExpression.setExpression | public function setExpression($expression)
{
$definitions = array(
'@yearly' => '0 0 1 1 *',
'@annually' => '0 0 1 1 *',
'@monthly' => '0 0 1 * *',
'@weekly' => '0 0 * * 0',
'@daily' => '0 0 * * *',
'@hourly' => '0 * * * *'
);
... | php | public function setExpression($expression)
{
$definitions = array(
'@yearly' => '0 0 1 1 *',
'@annually' => '0 0 1 1 *',
'@monthly' => '0 0 1 * *',
'@weekly' => '0 0 * * 0',
'@daily' => '0 0 * * *',
'@hourly' => '0 * * * *'
);
... | [
"public",
"function",
"setExpression",
"(",
"$",
"expression",
")",
"{",
"$",
"definitions",
"=",
"array",
"(",
"'@yearly'",
"=>",
"'0 0 1 1 *'",
",",
"'@annually'",
"=>",
"'0 0 1 1 *'",
",",
"'@monthly'",
"=>",
"'0 0 1 * *'",
",",
"'@weekly'",
"=>",
"'0 0 * * 0... | Set CRON expression.
@param string $expression
@throws \InvalidArgumentException | [
"Set",
"CRON",
"expression",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/CronExpression.php#L63-L90 |
helthe/Chronos | CronExpression.php | CronExpression.matches | public function matches(\DateTime $date)
{
foreach ($this->fields as $field) {
if (!$field->matches($date)) {
return false;
}
}
return true;
} | php | public function matches(\DateTime $date)
{
foreach ($this->fields as $field) {
if (!$field->matches($date)) {
return false;
}
}
return true;
} | [
"public",
"function",
"matches",
"(",
"\\",
"DateTime",
"$",
"date",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"fields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"$",
"field",
"->",
"matches",
"(",
"$",
"date",
")",
")",
"{",
"return",
"f... | Checks if the CRON expression matches the given date.
@param \DateTime $date
@return Boolean | [
"Checks",
"if",
"the",
"CRON",
"expression",
"matches",
"the",
"given",
"date",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/CronExpression.php#L109-L118 |
helthe/Chronos | CronExpression.php | CronExpression.getField | private function getField($position, $value)
{
switch ($position) {
case 0:
return new MinuteField($value);
case 1:
return new HourField($value);
case 2:
return new DayOfMonthField($value);
case 3:
... | php | private function getField($position, $value)
{
switch ($position) {
case 0:
return new MinuteField($value);
case 1:
return new HourField($value);
case 2:
return new DayOfMonthField($value);
case 3:
... | [
"private",
"function",
"getField",
"(",
"$",
"position",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"position",
")",
"{",
"case",
"0",
":",
"return",
"new",
"MinuteField",
"(",
"$",
"value",
")",
";",
"case",
"1",
":",
"return",
"new",
"HourFie... | Get the field object for the given position with the given value.
@param string $position
@param string $value
@return FieldInterface
@throws \InvalidArgumentException | [
"Get",
"the",
"field",
"object",
"for",
"the",
"given",
"position",
"with",
"the",
"given",
"value",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/CronExpression.php#L129-L147 |
phpmob/changmin | src/PhpMob/MediaBundle/Registry/ImageTypeRegistry.php | ImageTypeRegistry.makeTypeChoices | public static function makeTypeChoices(array $types, $section)
{
$sectionTypes = [];
foreach ($types as $type) {
$sectionTypes[] = new ImageType($section, $type['code'], $type['label'], $type['filter']);
}
return $sectionTypes;
} | php | public static function makeTypeChoices(array $types, $section)
{
$sectionTypes = [];
foreach ($types as $type) {
$sectionTypes[] = new ImageType($section, $type['code'], $type['label'], $type['filter']);
}
return $sectionTypes;
} | [
"public",
"static",
"function",
"makeTypeChoices",
"(",
"array",
"$",
"types",
",",
"$",
"section",
")",
"{",
"$",
"sectionTypes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"types",
"as",
"$",
"type",
")",
"{",
"$",
"sectionTypes",
"[",
"]",
"=",
"new... | @param array $types
@param $section
@return ImageType[] | [
"@param",
"array",
"$types",
"@param",
"$section"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/Registry/ImageTypeRegistry.php#L39-L48 |
phpmob/changmin | src/PhpMob/MediaBundle/Registry/ImageTypeRegistry.php | ImageTypeRegistry.getSectionType | public function getSectionType($section, $code)
{
if (!isset($this->types[$section])) {
return null;
}
$types = array_filter(
$this->types[$section],
function (ImageType $item) use ($code) {
return strtolower($code) === strtolower($item->g... | php | public function getSectionType($section, $code)
{
if (!isset($this->types[$section])) {
return null;
}
$types = array_filter(
$this->types[$section],
function (ImageType $item) use ($code) {
return strtolower($code) === strtolower($item->g... | [
"public",
"function",
"getSectionType",
"(",
"$",
"section",
",",
"$",
"code",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"types",
"[",
"$",
"section",
"]",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"types",
"=",
"array_filter... | @param $section
@param $code
@return null|ImageType | [
"@param",
"$section",
"@param",
"$code"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/Registry/ImageTypeRegistry.php#L70-L84 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanCommand.php | CoverFishScanCommand.configure | protected function configure()
{
$this
->setName('scan')
->setDescription('scan phpunit test files for static code analysis')
->setHelp($this->getHelpOutput())
->addArgument(
'phpunit-config',
InputArgument::OPTIONAL,
... | php | protected function configure()
{
$this
->setName('scan')
->setDescription('scan phpunit test files for static code analysis')
->setHelp($this->getHelpOutput())
->addArgument(
'phpunit-config',
InputArgument::OPTIONAL,
... | [
"protected",
"function",
"configure",
"(",
")",
"{",
"$",
"this",
"->",
"setName",
"(",
"'scan'",
")",
"->",
"setDescription",
"(",
"'scan phpunit test files for static code analysis'",
")",
"->",
"setHelp",
"(",
"$",
"this",
"->",
"getHelpOutput",
"(",
")",
")"... | additional options and arguments for our cli application | [
"additional",
"options",
"and",
"arguments",
"for",
"our",
"cli",
"application"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanCommand.php#L34-L99 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanCommand.php | CoverFishScanCommand.getHelpOutput | public function getHelpOutput()
{
// print out some "phpUnit-Mode" runtime samples
$help = sprintf('%sscan by using your "phpunit.xml" config-file inside "Tests/" directory and using test suite "My Test Suite" directly with normal output-level and no ansi-colors:%s', PHP_EOL, PHP_EOL);
$hel... | php | public function getHelpOutput()
{
// print out some "phpUnit-Mode" runtime samples
$help = sprintf('%sscan by using your "phpunit.xml" config-file inside "Tests/" directory and using test suite "My Test Suite" directly with normal output-level and no ansi-colors:%s', PHP_EOL, PHP_EOL);
$hel... | [
"public",
"function",
"getHelpOutput",
"(",
")",
"{",
"// print out some \"phpUnit-Mode\" runtime samples",
"$",
"help",
"=",
"sprintf",
"(",
"'%sscan by using your \"phpunit.xml\" config-file inside \"Tests/\" directory and using test suite \"My Test Suite\" directly with normal output-leve... | @codeCoverageIgnore
@return string | [
"@codeCoverageIgnore"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanCommand.php#L106-L121 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanCommand.php | CoverFishScanCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->showExecTitle($input, $output);
$this->prepareExecute($input);
$cliOptions = array(
'sys_phpunit_config' => $input->getArgument('phpunit-config'),
'sys_phpunit_config_test_suite' => $... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->showExecTitle($input, $output);
$this->prepareExecute($input);
$cliOptions = array(
'sys_phpunit_config' => $input->getArgument('phpunit-config'),
'sys_phpunit_config_test_suite' => $... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"showExecTitle",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"this",
"->",
"prepareExecute",
"(",
"$",
... | exec command "scan"
@param InputInterface $input
@param OutputInterface $output
@return string
@throws \Exception | [
"exec",
"command",
"scan"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanCommand.php#L183-L214 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanCommand.php | CoverFishScanCommand.prepareExecute | public function prepareExecute(InputInterface $input)
{
$this->coverFishHelper = new CoverFishHelper();
$phpUnitConfigFile = $input->getArgument('phpunit-config');
if (false === empty($phpUnitConfigFile) &&
false === $this->coverFishHelper->checkFileOrPath($phpUnitConfigFile)) {... | php | public function prepareExecute(InputInterface $input)
{
$this->coverFishHelper = new CoverFishHelper();
$phpUnitConfigFile = $input->getArgument('phpunit-config');
if (false === empty($phpUnitConfigFile) &&
false === $this->coverFishHelper->checkFileOrPath($phpUnitConfigFile)) {... | [
"public",
"function",
"prepareExecute",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"$",
"this",
"->",
"coverFishHelper",
"=",
"new",
"CoverFishHelper",
"(",
")",
";",
"$",
"phpUnitConfigFile",
"=",
"$",
"input",
"->",
"getArgument",
"(",
"'phpunit-config'",
... | prepare exec of command "scan"
@param InputInterface $input
@throws \Exception | [
"prepare",
"exec",
"of",
"command",
"scan"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanCommand.php#L223-L238 |
dreamfactorysoftware/df-file | src/Components/DfWebDavAdapter.php | DfWebDavAdapter.ensureDirectory | public function ensureDirectory($dirname)
{
if ( ! empty($dirname) && ! $this->has($dirname)) {
$this->createDir($dirname, new Config());
}
} | php | public function ensureDirectory($dirname)
{
if ( ! empty($dirname) && ! $this->has($dirname)) {
$this->createDir($dirname, new Config());
}
} | [
"public",
"function",
"ensureDirectory",
"(",
"$",
"dirname",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"dirname",
")",
"&&",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"dirname",
")",
")",
"{",
"$",
"this",
"->",
"createDir",
"(",
"$",
"dirname",... | Ensure a directory exists.
@param string $dirname | [
"Ensure",
"a",
"directory",
"exists",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Components/DfWebDavAdapter.php#L15-L20 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.migrate | public function migrate($request) {
$migrationTarget = isset($request['MigrationTarget']) ? $request['MigrationTarget'] : '';
$fileMigrationTarget = isset($request['FileMigrationTarget']) ? $request['FileMigrationTarget'] : '';
$includeSelected = isset($request['IncludeSelected']) ? $request['IncludeSelected... | php | public function migrate($request) {
$migrationTarget = isset($request['MigrationTarget']) ? $request['MigrationTarget'] : '';
$fileMigrationTarget = isset($request['FileMigrationTarget']) ? $request['FileMigrationTarget'] : '';
$includeSelected = isset($request['IncludeSelected']) ? $request['IncludeSelected... | [
"public",
"function",
"migrate",
"(",
"$",
"request",
")",
"{",
"$",
"migrationTarget",
"=",
"isset",
"(",
"$",
"request",
"[",
"'MigrationTarget'",
"]",
")",
"?",
"$",
"request",
"[",
"'MigrationTarget'",
"]",
":",
"''",
";",
"$",
"fileMigrationTarget",
"... | Action to migrate a selected object through to SS
@param array $request | [
"Action",
"to",
"migrate",
"a",
"selected",
"object",
"through",
"to",
"SS"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L150-L209 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.getRecord | public function getRecord($id) {
if(is_numeric($id)) {
return parent::getRecord($id);
} else {
return ExternalContent::getDataObjectFor($id);
}
} | php | public function getRecord($id) {
if(is_numeric($id)) {
return parent::getRecord($id);
} else {
return ExternalContent::getDataObjectFor($id);
}
} | [
"public",
"function",
"getRecord",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"id",
")",
")",
"{",
"return",
"parent",
"::",
"getRecord",
"(",
"$",
"id",
")",
";",
"}",
"else",
"{",
"return",
"ExternalContent",
"::",
"getDataObjectFor... | Return the record corresponding to the given ID.
Both the numeric IDs of ExternalContentSource records and the composite IDs of ExternalContentItem entries
are supported.
@param string $id The ID
@return Dataobject The relevant object | [
"Return",
"the",
"record",
"corresponding",
"to",
"the",
"given",
"ID",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L220-L226 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.EditForm | public function EditForm($request = null) {
HtmlEditorField::include_js();
$cur = $this->getCurrentPageID();
if ($cur) {
$record = $this->currentPage();
if (!$record)
return false;
if ($record && !$record->canView())
return Security::permissionFailure($this);
}
if ($this->hasMethod('getEdit... | php | public function EditForm($request = null) {
HtmlEditorField::include_js();
$cur = $this->getCurrentPageID();
if ($cur) {
$record = $this->currentPage();
if (!$record)
return false;
if ($record && !$record->canView())
return Security::permissionFailure($this);
}
if ($this->hasMethod('getEdit... | [
"public",
"function",
"EditForm",
"(",
"$",
"request",
"=",
"null",
")",
"{",
"HtmlEditorField",
"::",
"include_js",
"(",
")",
";",
"$",
"cur",
"=",
"$",
"this",
"->",
"getCurrentPageID",
"(",
")",
";",
"if",
"(",
"$",
"cur",
")",
"{",
"$",
"record",... | Return the edit form
@see cms/code/LeftAndMain#EditForm() | [
"Return",
"the",
"edit",
"form"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L233-L250 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.getEditForm | function getEditForm($id = null, $fields = null) {
$record = null;
if(!$id){
$id = $this->getCurrentPageID();
}
if ($id && $id != "root") {
$record = $this->getRecord($id);
}
if ($record) {
$fields = $record->getCMSFields();
// If we're editing an external source or item, and it can be impor... | php | function getEditForm($id = null, $fields = null) {
$record = null;
if(!$id){
$id = $this->getCurrentPageID();
}
if ($id && $id != "root") {
$record = $this->getRecord($id);
}
if ($record) {
$fields = $record->getCMSFields();
// If we're editing an external source or item, and it can be impor... | [
"function",
"getEditForm",
"(",
"$",
"id",
"=",
"null",
",",
"$",
"fields",
"=",
"null",
")",
"{",
"$",
"record",
"=",
"null",
";",
"if",
"(",
"!",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getCurrentPageID",
"(",
")",
";",
"}",
... | Return the form for editing | [
"Return",
"the",
"form",
"for",
"editing"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L256-L382 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.AddForm | public function AddForm() {
$classes = ClassInfo::subclassesFor(self::$tree_class);
array_shift($classes);
foreach ($classes as $key => $class) {
if (!singleton($class)->canCreate())
unset($classes[$key]);
$classes[$key] = FormField::name_to_label($class);
}
$fields = new FieldList(
new HiddenF... | php | public function AddForm() {
$classes = ClassInfo::subclassesFor(self::$tree_class);
array_shift($classes);
foreach ($classes as $key => $class) {
if (!singleton($class)->canCreate())
unset($classes[$key]);
$classes[$key] = FormField::name_to_label($class);
}
$fields = new FieldList(
new HiddenF... | [
"public",
"function",
"AddForm",
"(",
")",
"{",
"$",
"classes",
"=",
"ClassInfo",
"::",
"subclassesFor",
"(",
"self",
"::",
"$",
"tree_class",
")",
";",
"array_shift",
"(",
"$",
"classes",
")",
";",
"foreach",
"(",
"$",
"classes",
"as",
"$",
"key",
"=>... | Get the form used to create a new provider
@return Form | [
"Get",
"the",
"form",
"used",
"to",
"create",
"a",
"new",
"provider"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L390-L419 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.addprovider | public function addprovider() {
// Providers are ALWAYS at the root
$parent = 0;
$name = (isset($_REQUEST['Name'])) ? basename($_REQUEST['Name']) : _t('ExternalContent.NEWCONNECTOR', "New Connector");
$type = $_REQUEST['ProviderType'];
$providerClasses = ClassInfo::subclassesFor(self::$tree_class);
if (!... | php | public function addprovider() {
// Providers are ALWAYS at the root
$parent = 0;
$name = (isset($_REQUEST['Name'])) ? basename($_REQUEST['Name']) : _t('ExternalContent.NEWCONNECTOR', "New Connector");
$type = $_REQUEST['ProviderType'];
$providerClasses = ClassInfo::subclassesFor(self::$tree_class);
if (!... | [
"public",
"function",
"addprovider",
"(",
")",
"{",
"// Providers are ALWAYS at the root",
"$",
"parent",
"=",
"0",
";",
"$",
"name",
"=",
"(",
"isset",
"(",
"$",
"_REQUEST",
"[",
"'Name'",
"]",
")",
")",
"?",
"basename",
"(",
"$",
"_REQUEST",
"[",
"'Nam... | Add a new provider (triggered by the ExternalContentAdmin_left template)
@return unknown_type | [
"Add",
"a",
"new",
"provider",
"(",
"triggered",
"by",
"the",
"ExternalContentAdmin_left",
"template",
")"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L426-L470 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.DeleteItemsForm | function DeleteItemsForm() {
$form = new Form(
$this,
'DeleteItemsForm',
new FieldList(
new LiteralField('SelectedPagesNote',
sprintf('<p>%s</p>', _t('ExternalContentAdmin.SELECT_CONNECTORS', 'Select the connectors that you want to delete and then click the button below'))
... | php | function DeleteItemsForm() {
$form = new Form(
$this,
'DeleteItemsForm',
new FieldList(
new LiteralField('SelectedPagesNote',
sprintf('<p>%s</p>', _t('ExternalContentAdmin.SELECT_CONNECTORS', 'Select the connectors that you want to delete and then click the button below'))
... | [
"function",
"DeleteItemsForm",
"(",
")",
"{",
"$",
"form",
"=",
"new",
"Form",
"(",
"$",
"this",
",",
"'DeleteItemsForm'",
",",
"new",
"FieldList",
"(",
"new",
"LiteralField",
"(",
"'SelectedPagesNote'",
",",
"sprintf",
"(",
"'<p>%s</p>'",
",",
"_t",
"(",
... | Copied from AssetAdmin...
@return Form | [
"Copied",
"from",
"AssetAdmin",
"..."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L479-L497 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.deleteprovider | public function deleteprovider() {
$script = '';
$ids = split(' *, *', $_REQUEST['csvIDs']);
$script = '';
if (!$ids)
return false;
foreach ($ids as $id) {
if (is_numeric($id)) {
$record = ExternalContent::getDataObjectFor($id);
if ($record) {
$script .= $this->deleteTreeNodeJS($record);
... | php | public function deleteprovider() {
$script = '';
$ids = split(' *, *', $_REQUEST['csvIDs']);
$script = '';
if (!$ids)
return false;
foreach ($ids as $id) {
if (is_numeric($id)) {
$record = ExternalContent::getDataObjectFor($id);
if ($record) {
$script .= $this->deleteTreeNodeJS($record);
... | [
"public",
"function",
"deleteprovider",
"(",
")",
"{",
"$",
"script",
"=",
"''",
";",
"$",
"ids",
"=",
"split",
"(",
"' *, *'",
",",
"$",
"_REQUEST",
"[",
"'csvIDs'",
"]",
")",
";",
"$",
"script",
"=",
"''",
";",
"if",
"(",
"!",
"$",
"ids",
")",
... | Delete a folder | [
"Delete",
"a",
"folder"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L502-L530 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.generatePageIconsCss | public function generatePageIconsCss() {
$css = '';
$sourceClasses = ClassInfo::subclassesFor('ExternalContentSource');
$itemClasses = ClassInfo::subclassesFor('ExternalContentItem');
$classes = array_merge($sourceClasses, $itemClasses);
foreach($classes as $class) {
$obj = singleton($class);
$ico... | php | public function generatePageIconsCss() {
$css = '';
$sourceClasses = ClassInfo::subclassesFor('ExternalContentSource');
$itemClasses = ClassInfo::subclassesFor('ExternalContentItem');
$classes = array_merge($sourceClasses, $itemClasses);
foreach($classes as $class) {
$obj = singleton($class);
$ico... | [
"public",
"function",
"generatePageIconsCss",
"(",
")",
"{",
"$",
"css",
"=",
"''",
";",
"$",
"sourceClasses",
"=",
"ClassInfo",
"::",
"subclassesFor",
"(",
"'ExternalContentSource'",
")",
";",
"$",
"itemClasses",
"=",
"ClassInfo",
"::",
"subclassesFor",
"(",
... | Include CSS for page icons. We're not using the JSTree 'types' option
because it causes too much performance overhead just to add some icons.
@return String CSS | [
"Include",
"CSS",
"for",
"page",
"icons",
".",
"We",
"re",
"not",
"using",
"the",
"JSTree",
"types",
"option",
"because",
"it",
"causes",
"too",
"much",
"performance",
"overhead",
"just",
"to",
"add",
"some",
"icons",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L583-L622 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.save | public function save($urlParams, $form) {
// Retrieve the record.
$record = null;
if (isset($urlParams['ID'])) {
$record = ExternalContent::getDataObjectFor($urlParams['ID']);
}
if (!$record) {
return parent::save($urlParams, $form);
}
if ($record->canEdit()) {
// lets load the params that hav... | php | public function save($urlParams, $form) {
// Retrieve the record.
$record = null;
if (isset($urlParams['ID'])) {
$record = ExternalContent::getDataObjectFor($urlParams['ID']);
}
if (!$record) {
return parent::save($urlParams, $form);
}
if ($record->canEdit()) {
// lets load the params that hav... | [
"public",
"function",
"save",
"(",
"$",
"urlParams",
",",
"$",
"form",
")",
"{",
"// Retrieve the record.",
"$",
"record",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"urlParams",
"[",
"'ID'",
"]",
")",
")",
"{",
"$",
"record",
"=",
"ExternalConten... | Save the content source/item. | [
"Save",
"the",
"content",
"source",
"/",
"item",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L627-L657 |
nyeholt/silverstripe-external-content | code/controllers/ExternalContentAdmin.php | ExternalContentAdmin.delete | public function delete($data, $form) {
$className = $this->stat('tree_class');
$record = DataObject::get_by_id($className, Convert::raw2sql($data['ID']));
if($record && !$record->canDelete()) return Security::permissionFailure();
if(!$record || !$record->ID) $this->httpError(404, "Bad record ID #" . (int)$data... | php | public function delete($data, $form) {
$className = $this->stat('tree_class');
$record = DataObject::get_by_id($className, Convert::raw2sql($data['ID']));
if($record && !$record->canDelete()) return Security::permissionFailure();
if(!$record || !$record->ID) $this->httpError(404, "Bad record ID #" . (int)$data... | [
"public",
"function",
"delete",
"(",
"$",
"data",
",",
"$",
"form",
")",
"{",
"$",
"className",
"=",
"$",
"this",
"->",
"stat",
"(",
"'tree_class'",
")",
";",
"$",
"record",
"=",
"DataObject",
"::",
"get_by_id",
"(",
"$",
"className",
",",
"Convert",
... | Delete the content source/item. | [
"Delete",
"the",
"content",
"source",
"/",
"item",
"."
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/code/controllers/ExternalContentAdmin.php#L662-L679 |
factorio-item-browser/export-data | src/Utils/EntityUtils.php | EntityUtils.calculateHashOfArray | public static function calculateHashOfArray(array $data): string
{
return self::calculateHash((string) json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
} | php | public static function calculateHashOfArray(array $data): string
{
return self::calculateHash((string) json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE));
} | [
"public",
"static",
"function",
"calculateHashOfArray",
"(",
"array",
"$",
"data",
")",
":",
"string",
"{",
"return",
"self",
"::",
"calculateHash",
"(",
"(",
"string",
")",
"json_encode",
"(",
"$",
"data",
",",
"JSON_UNESCAPED_SLASHES",
"|",
"JSON_UNESCAPED_UNI... | Calculates the hash of the specified data array.
@param array $data
@return string | [
"Calculates",
"the",
"hash",
"of",
"the",
"specified",
"data",
"array",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Utils/EntityUtils.php#L40-L43 |
PeekAndPoke/psi | src/Operation/FullSet/UniqueOperation.php | UniqueOperation.apply | public function apply(\Iterator $set)
{
$result = [];
foreach ($set as $item) {
if (! in_array($item, $result, $this->strict)) {
$result[] = $item;
}
}
return new \ArrayIterator($result);
} | php | public function apply(\Iterator $set)
{
$result = [];
foreach ($set as $item) {
if (! in_array($item, $result, $this->strict)) {
$result[] = $item;
}
}
return new \ArrayIterator($result);
} | [
"public",
"function",
"apply",
"(",
"\\",
"Iterator",
"$",
"set",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"set",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"item",
",",
"$",
"result",
",",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Operation/FullSet/UniqueOperation.php#L33-L44 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.read | public function read($read)
{
$data = null;
if (isset($_REQUEST[$read])) {
$data = (string) preg_replace('/[^A-Z_]/i', '', $_REQUEST[$read]);
}
return $data;
} | php | public function read($read)
{
$data = null;
if (isset($_REQUEST[$read])) {
$data = (string) preg_replace('/[^A-Z_]/i', '', $_REQUEST[$read]);
}
return $data;
} | [
"public",
"function",
"read",
"(",
"$",
"read",
")",
"{",
"$",
"data",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"_REQUEST",
"[",
"$",
"read",
"]",
")",
")",
"{",
"$",
"data",
"=",
"(",
"string",
")",
"preg_replace",
"(",
"'/[^A-Z_]/i'",
",... | @param $read
@return string | [
"@param",
"$read"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L81-L88 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.getExecuteURL | public function getExecuteURL($class, $task, $return)
{
$url = $this->url . '?jftask=' . $task . '&jfclass=' . $class . '&jftype=execute&jfreturn=' . base64_encode($return);
if ($this->sid) {
$url .= '&PHPSESSID=' . $this->sid;
}
return $url;
} | php | public function getExecuteURL($class, $task, $return)
{
$url = $this->url . '?jftask=' . $task . '&jfclass=' . $class . '&jftype=execute&jfreturn=' . base64_encode($return);
if ($this->sid) {
$url .= '&PHPSESSID=' . $this->sid;
}
return $url;
} | [
"public",
"function",
"getExecuteURL",
"(",
"$",
"class",
",",
"$",
"task",
",",
"$",
"return",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"url",
".",
"'?jftask='",
".",
"$",
"task",
".",
"'&jfclass='",
".",
"$",
"class",
".",
"'&jftype=execute&jfre... | @param $class
@param $task
@param $return
@return string | [
"@param",
"$class",
"@param",
"$task",
"@param",
"$return"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L173-L180 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.execute | public function execute($class, $task, $payload = array(), $return = '')
{
if (!empty($return)) {
header('Location: ' . $this->getExecuteURL($class, $task, $return) . '&jfpayload=' . base64_encode(json_encode($payload)));
return true;
} else {
return $this->raw('execute', $class, $task, $payload);
}
} | php | public function execute($class, $task, $payload = array(), $return = '')
{
if (!empty($return)) {
header('Location: ' . $this->getExecuteURL($class, $task, $return) . '&jfpayload=' . base64_encode(json_encode($payload)));
return true;
} else {
return $this->raw('execute', $class, $task, $payload);
}
} | [
"public",
"function",
"execute",
"(",
"$",
"class",
",",
"$",
"task",
",",
"$",
"payload",
"=",
"array",
"(",
")",
",",
"$",
"return",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"return",
")",
")",
"{",
"header",
"(",
"'Location: '",... | @param $class
@param $task
@param array $payload
@param string $return
@return bool | [
"@param",
"$class",
"@param",
"$task",
"@param",
"array",
"$payload",
"@param",
"string",
"$return"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L214-L222 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.raw | private function raw($type, $class, $task, $payload = array())
{
$key = true;
$c = $this->createClass($class);
if ($c && $c->encrypt) {
$key = $this->retrieveKey();
}
if ($key) {
$result = $this->post($class, $type, $task, $payload);
$result = $this->getOutput($result);
if (empty($this->error)) ... | php | private function raw($type, $class, $task, $payload = array())
{
$key = true;
$c = $this->createClass($class);
if ($c && $c->encrypt) {
$key = $this->retrieveKey();
}
if ($key) {
$result = $this->post($class, $type, $task, $payload);
$result = $this->getOutput($result);
if (empty($this->error)) ... | [
"private",
"function",
"raw",
"(",
"$",
"type",
",",
"$",
"class",
",",
"$",
"task",
",",
"$",
"payload",
"=",
"array",
"(",
")",
")",
"{",
"$",
"key",
"=",
"true",
";",
"$",
"c",
"=",
"$",
"this",
"->",
"createClass",
"(",
"$",
"class",
")",
... | @param string $type
@param string $class
@param string $task
@param array $payload
@return mixed | [
"@param",
"string",
"$type",
"@param",
"string",
"$class",
"@param",
"string",
"$task",
"@param",
"array",
"$payload"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L232-L250 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.getSession | static function getSession($class, $delete = false)
{
$return = null;
if (isset($_SESSION['Api'])) {
if (isset($_SESSION['Api'][$class])) {
$return = $_SESSION['Api'][$class];
if ($delete) {
unset($_SESSION['Api'][$class]);
}
}
}
return $return;
} | php | static function getSession($class, $delete = false)
{
$return = null;
if (isset($_SESSION['Api'])) {
if (isset($_SESSION['Api'][$class])) {
$return = $_SESSION['Api'][$class];
if ($delete) {
unset($_SESSION['Api'][$class]);
}
}
}
return $return;
} | [
"static",
"function",
"getSession",
"(",
"$",
"class",
",",
"$",
"delete",
"=",
"false",
")",
"{",
"$",
"return",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"_SESSION",
"[",
"'Api'",
"]",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"_SESSIO... | @static
@param string $class
@param bool $delete
@return mixed | [
"@static",
"@param",
"string",
"$class",
"@param",
"bool",
"$delete"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L259-L271 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.encrypt | public static function encrypt($keyinfo, $payload=array())
{
if (isset($keyinfo->secret) && isset($keyinfo->hash) && function_exists('mcrypt_encrypt')) {
$encrypted = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $keyinfo->secret, json_encode($payload), MCRYPT_MODE_NOFB, $keyinfo->hash)));
} else {
... | php | public static function encrypt($keyinfo, $payload=array())
{
if (isset($keyinfo->secret) && isset($keyinfo->hash) && function_exists('mcrypt_encrypt')) {
$encrypted = trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $keyinfo->secret, json_encode($payload), MCRYPT_MODE_NOFB, $keyinfo->hash)));
} else {
... | [
"public",
"static",
"function",
"encrypt",
"(",
"$",
"keyinfo",
",",
"$",
"payload",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"keyinfo",
"->",
"secret",
")",
"&&",
"isset",
"(",
"$",
"keyinfo",
"->",
"hash",
")",
"&&",
"funct... | @static
@param $keyinfo
@param array $payload
@return null|string | [
"@static",
"@param",
"$keyinfo",
"@param",
"array",
"$payload"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L304-L312 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.decrypt | public static function decrypt($keyinfo, $payload)
{
if (isset($keyinfo->secret) && isset($keyinfo->hash) && function_exists('mcrypt_decrypt')) {
ob_start();
$decrypted = json_decode(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $keyinfo->secret, base64_decode($payload), MCRYPT_MODE_NOFB, $keyinfo->hash)), true);
... | php | public static function decrypt($keyinfo, $payload)
{
if (isset($keyinfo->secret) && isset($keyinfo->hash) && function_exists('mcrypt_decrypt')) {
ob_start();
$decrypted = json_decode(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $keyinfo->secret, base64_decode($payload), MCRYPT_MODE_NOFB, $keyinfo->hash)), true);
... | [
"public",
"static",
"function",
"decrypt",
"(",
"$",
"keyinfo",
",",
"$",
"payload",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"keyinfo",
"->",
"secret",
")",
"&&",
"isset",
"(",
"$",
"keyinfo",
"->",
"hash",
")",
"&&",
"function_exists",
"(",
"'mcrypt_d... | @static
@param $keyinfo
@param $payload
@return bool|array | [
"@static",
"@param",
"$keyinfo",
"@param",
"$payload"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L321-L331 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.post | private function post($class, $type, $task, $payload = array())
{
$this->error = array();
$this->debug = array();
$result = false;
//check to see if cURL is loaded
if (!function_exists('curl_init')) {
$this->error[] = 'JfusionAPI: sorry cURL is needed for Api';
} elseif (!function_exists('mcrypt_decrypt... | php | private function post($class, $type, $task, $payload = array())
{
$this->error = array();
$this->debug = array();
$result = false;
//check to see if cURL is loaded
if (!function_exists('curl_init')) {
$this->error[] = 'JfusionAPI: sorry cURL is needed for Api';
} elseif (!function_exists('mcrypt_decrypt... | [
"private",
"function",
"post",
"(",
"$",
"class",
",",
"$",
"type",
",",
"$",
"task",
",",
"$",
"payload",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"error",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"debug",
"=",
"array",
"(",... | @param string $class
@param string $type
@param string $task
@param array $payload
@return string|bool | [
"@param",
"string",
"$class",
"@param",
"string",
"$type",
"@param",
"string",
"$task",
"@param",
"array",
"$payload"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L341-L380 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.doOutput | private function doOutput($output, $encrypt = false)
{
$output->PHPSESSID = $this->sid;
$output->error = $this->error;
$output->debug = $this->debug;
$result = null;
if ($encrypt) {
$result = Api::encrypt($this->createkey() , $output);
if ($result == null) {
$output->error = 'Encryption failed';
... | php | private function doOutput($output, $encrypt = false)
{
$output->PHPSESSID = $this->sid;
$output->error = $this->error;
$output->debug = $this->debug;
$result = null;
if ($encrypt) {
$result = Api::encrypt($this->createkey() , $output);
if ($result == null) {
$output->error = 'Encryption failed';
... | [
"private",
"function",
"doOutput",
"(",
"$",
"output",
",",
"$",
"encrypt",
"=",
"false",
")",
"{",
"$",
"output",
"->",
"PHPSESSID",
"=",
"$",
"this",
"->",
"sid",
";",
"$",
"output",
"->",
"error",
"=",
"$",
"this",
"->",
"error",
";",
"$",
"outp... | @param stdClass $output
@param bool $encrypt
@return void | [
"@param",
"stdClass",
"$output",
"@param",
"bool",
"$encrypt"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L388-L405 |
jfusion/org.jfusion.framework | src/Api/Api.php | Api.getOutput | private function getOutput($input)
{
$return = Api::decrypt($this->createkey() , $input);
if (!is_array($return)) {
ob_start();
$return = json_decode(trim(base64_decode($input)), true);
ob_end_clean();
}
if (!is_array($return)) {
$this->error[] = 'JfusionAPI: error output: ' . $input;
return fal... | php | private function getOutput($input)
{
$return = Api::decrypt($this->createkey() , $input);
if (!is_array($return)) {
ob_start();
$return = json_decode(trim(base64_decode($input)), true);
ob_end_clean();
}
if (!is_array($return)) {
$this->error[] = 'JfusionAPI: error output: ' . $input;
return fal... | [
"private",
"function",
"getOutput",
"(",
"$",
"input",
")",
"{",
"$",
"return",
"=",
"Api",
"::",
"decrypt",
"(",
"$",
"this",
"->",
"createkey",
"(",
")",
",",
"$",
"input",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"return",
")",
")",
"{"... | @param $input
@return bool|mixed | [
"@param",
"$input"
] | train | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Api/Api.php#L412-L436 |
devmobgroup/postcodes | src/Address/Address.php | Address.setPostcode | protected function setPostcode(string $postcode): void
{
if (! preg_match(self::POSTCODE_FORMAT, $postcode)) {
throw new InvalidArgumentException('Postcode must match the expected format: ' . self::POSTCODE_FORMAT);
}
$this->postcode = $postcode;
} | php | protected function setPostcode(string $postcode): void
{
if (! preg_match(self::POSTCODE_FORMAT, $postcode)) {
throw new InvalidArgumentException('Postcode must match the expected format: ' . self::POSTCODE_FORMAT);
}
$this->postcode = $postcode;
} | [
"protected",
"function",
"setPostcode",
"(",
"string",
"$",
"postcode",
")",
":",
"void",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"self",
"::",
"POSTCODE_FORMAT",
",",
"$",
"postcode",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Postcod... | Set postcode.
@param string $postcode
@return void | [
"Set",
"postcode",
"."
] | train | https://github.com/devmobgroup/postcodes/blob/1a8438fd960a8f50ec28d61af94560892b529f12/src/Address/Address.php#L103-L110 |
webforge-labs/psc-cms | lib/Psc/Doctrine/Mocks/EntityManager.php | EntityManager.merge | public function merge($entity) {
// add to merged
if (!$this->merged->contains($entity)) {
$this->merged->add($entity);
}
// remove from removed,detached
// nicht remove from persisted
if ($this->removed->contains($entity)) {
$this->removed->removeElement($entity);
}
if ... | php | public function merge($entity) {
// add to merged
if (!$this->merged->contains($entity)) {
$this->merged->add($entity);
}
// remove from removed,detached
// nicht remove from persisted
if ($this->removed->contains($entity)) {
$this->removed->removeElement($entity);
}
if ... | [
"public",
"function",
"merge",
"(",
"$",
"entity",
")",
"{",
"// add to merged",
"if",
"(",
"!",
"$",
"this",
"->",
"merged",
"->",
"contains",
"(",
"$",
"entity",
")",
")",
"{",
"$",
"this",
"->",
"merged",
"->",
"add",
"(",
"$",
"entity",
")",
";... | Der Parameter von merge wird nicht im EntityManager persisted | [
"Der",
"Parameter",
"von",
"merge",
"wird",
"nicht",
"im",
"EntityManager",
"persisted"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Mocks/EntityManager.php#L86-L104 |
ripaclub/zf2-sphinxsearch-tool | src/Config/Writer/SphinxConf.php | SphinxConf.substituteVars | protected function substituteVars(Config $config, $prefix = '{', $suffix = '}')
{
$arrayConfig = $config->toArray();
if (isset($arrayConfig['variables'])) {
$vars = array_map(
function ($x) use ($prefix, $suffix) {
return $prefix . $x . $suffix;
... | php | protected function substituteVars(Config $config, $prefix = '{', $suffix = '}')
{
$arrayConfig = $config->toArray();
if (isset($arrayConfig['variables'])) {
$vars = array_map(
function ($x) use ($prefix, $suffix) {
return $prefix . $x . $suffix;
... | [
"protected",
"function",
"substituteVars",
"(",
"Config",
"$",
"config",
",",
"$",
"prefix",
"=",
"'{'",
",",
"$",
"suffix",
"=",
"'}'",
")",
"{",
"$",
"arrayConfig",
"=",
"$",
"config",
"->",
"toArray",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
... | Substitute defined variables, if any found and return the new configuration object
@param Config $config
@param string $prefix
@param string $suffix
@return Config | [
"Substitute",
"defined",
"variables",
"if",
"any",
"found",
"and",
"return",
"the",
"new",
"configuration",
"object"
] | train | https://github.com/ripaclub/zf2-sphinxsearch-tool/blob/4cb51341ccf1db9942e3e578855a579afd608d69/src/Config/Writer/SphinxConf.php#L72-L91 |
ripaclub/zf2-sphinxsearch-tool | src/Config/Writer/SphinxConf.php | SphinxConf.getCommandConfig | protected function getCommandConfig(Config $config, $command)
{
$string = '';
if (isset($config[$command])) {
/** @var Config $config */
$config = $config[$command];
if ($config->count() > 0) {
$config = $config->toArray();
/** @var... | php | protected function getCommandConfig(Config $config, $command)
{
$string = '';
if (isset($config[$command])) {
/** @var Config $config */
$config = $config[$command];
if ($config->count() > 0) {
$config = $config->toArray();
/** @var... | [
"protected",
"function",
"getCommandConfig",
"(",
"Config",
"$",
"config",
",",
"$",
"command",
")",
"{",
"$",
"string",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"$",
"command",
"]",
")",
")",
"{",
"/** @var Config $config */",
"$",
... | Creates the config part of the specified command
@param Config $config
@param string $command
@return string | [
"Creates",
"the",
"config",
"part",
"of",
"the",
"specified",
"command"
] | train | https://github.com/ripaclub/zf2-sphinxsearch-tool/blob/4cb51341ccf1db9942e3e578855a579afd608d69/src/Config/Writer/SphinxConf.php#L100-L115 |
ripaclub/zf2-sphinxsearch-tool | src/Config/Writer/SphinxConf.php | SphinxConf.getValuesString | private function getValuesString(array $values, $tab = true)
{
$glue = $tab ? PHP_EOL . "\t" : PHP_EOL;
return implode(
$glue,
array_map(
function ($key) use ($values, $glue) {
if (!is_array($values[$key])) {
$return... | php | private function getValuesString(array $values, $tab = true)
{
$glue = $tab ? PHP_EOL . "\t" : PHP_EOL;
return implode(
$glue,
array_map(
function ($key) use ($values, $glue) {
if (!is_array($values[$key])) {
$return... | [
"private",
"function",
"getValuesString",
"(",
"array",
"$",
"values",
",",
"$",
"tab",
"=",
"true",
")",
"{",
"$",
"glue",
"=",
"$",
"tab",
"?",
"PHP_EOL",
".",
"\"\\t\"",
":",
"PHP_EOL",
";",
"return",
"implode",
"(",
"$",
"glue",
",",
"array_map",
... | Construct a string representation from configuration associative values
@param array $values
@param bool $tab
@return string | [
"Construct",
"a",
"string",
"representation",
"from",
"configuration",
"associative",
"values"
] | train | https://github.com/ripaclub/zf2-sphinxsearch-tool/blob/4cb51341ccf1db9942e3e578855a579afd608d69/src/Config/Writer/SphinxConf.php#L124-L153 |
ripaclub/zf2-sphinxsearch-tool | src/Config/Writer/SphinxConf.php | SphinxConf.getSectionConfig | protected function getSectionConfig(Config $config, $section)
{
$string = '';
if (isset($config[$section])) {
/** @var Config $config */
$config = $config[$section];
// If there is at least one section
if ($config->count() > 0) {
/** @v... | php | protected function getSectionConfig(Config $config, $section)
{
$string = '';
if (isset($config[$section])) {
/** @var Config $config */
$config = $config[$section];
// If there is at least one section
if ($config->count() > 0) {
/** @v... | [
"protected",
"function",
"getSectionConfig",
"(",
"Config",
"$",
"config",
",",
"$",
"section",
")",
"{",
"$",
"string",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"$",
"section",
"]",
")",
")",
"{",
"/** @var Config $config */",
"$",
... | Creates the config parts of the specified section
@param Config $config
@param $section
@return string | [
"Creates",
"the",
"config",
"parts",
"of",
"the",
"specified",
"section"
] | train | https://github.com/ripaclub/zf2-sphinxsearch-tool/blob/4cb51341ccf1db9942e3e578855a579afd608d69/src/Config/Writer/SphinxConf.php#L162-L181 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._arrayInclude | protected function _arrayInclude($path, array $options = [], $type = 'css')
{
$doc = $this->Document;
if (is_array($path)) {
$out = '';
foreach ($path as $i) {
$out .= $this->{$type}($i, $options);
}
if (empty($options['block'])) {
... | php | protected function _arrayInclude($path, array $options = [], $type = 'css')
{
$doc = $this->Document;
if (is_array($path)) {
$out = '';
foreach ($path as $i) {
$out .= $this->{$type}($i, $options);
}
if (empty($options['block'])) {
... | [
"protected",
"function",
"_arrayInclude",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"type",
"=",
"'css'",
")",
"{",
"$",
"doc",
"=",
"$",
"this",
"->",
"Document",
";",
"if",
"(",
"is_array",
"(",
"$",
"path",
")",
... | Include array paths.
@param array|string $path
@param array $options
@param string $type
@return bool|null|string | [
"Include",
"array",
"paths",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L43-L60 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._getCssOutput | protected function _getCssOutput(array $options, $url)
{
if ($options['rel'] === 'import') {
return $this->formatTemplate('style', [
'attrs' => $this->templater()->formatAttributes($options, ['rel', 'block', 'weight', 'alias']),
'content' => '@import url(' . $ur... | php | protected function _getCssOutput(array $options, $url)
{
if ($options['rel'] === 'import') {
return $this->formatTemplate('style', [
'attrs' => $this->templater()->formatAttributes($options, ['rel', 'block', 'weight', 'alias']),
'content' => '@import url(' . $ur... | [
"protected",
"function",
"_getCssOutput",
"(",
"array",
"$",
"options",
",",
"$",
"url",
")",
"{",
"if",
"(",
"$",
"options",
"[",
"'rel'",
"]",
"===",
"'import'",
")",
"{",
"return",
"$",
"this",
"->",
"formatTemplate",
"(",
"'style'",
",",
"[",
"'att... | Get current css output.
@param array $options
@param string $url
@return string | [
"Get",
"current",
"css",
"output",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L80-L94 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._getCurrentUrlAndOptions | protected function _getCurrentUrlAndOptions($path, array $options, $type, $external)
{
if (strpos($path, '//') !== false) {
$url = $path;
$external = true;
unset($options['fullBase']);
} else {
$url = $this->Url->{$type}($path, $options);
... | php | protected function _getCurrentUrlAndOptions($path, array $options, $type, $external)
{
if (strpos($path, '//') !== false) {
$url = $path;
$external = true;
unset($options['fullBase']);
} else {
$url = $this->Url->{$type}($path, $options);
... | [
"protected",
"function",
"_getCurrentUrlAndOptions",
"(",
"$",
"path",
",",
"array",
"$",
"options",
",",
"$",
"type",
",",
"$",
"external",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"path",
",",
"'//'",
")",
"!==",
"false",
")",
"{",
"$",
"url",
"=",... | Get current options and url asset.
@param string $path
@param array $options
@param string $type
@param bool $external
@return array | [
"Get",
"current",
"options",
"and",
"url",
"asset",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L117-L129 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._getScriptOutput | protected function _getScriptOutput(array $options, $url)
{
return $this->formatTemplate('javascriptlink', [
'url' => $url,
'attrs' => $this->templater()->formatAttributes($options, ['block', 'once', 'weight', 'alias']),
]);
} | php | protected function _getScriptOutput(array $options, $url)
{
return $this->formatTemplate('javascriptlink', [
'url' => $url,
'attrs' => $this->templater()->formatAttributes($options, ['block', 'once', 'weight', 'alias']),
]);
} | [
"protected",
"function",
"_getScriptOutput",
"(",
"array",
"$",
"options",
",",
"$",
"url",
")",
"{",
"return",
"$",
"this",
"->",
"formatTemplate",
"(",
"'javascriptlink'",
",",
"[",
"'url'",
"=>",
"$",
"url",
",",
"'attrs'",
"=>",
"$",
"this",
"->",
"t... | Get current script output.
@param array $options
@param string $url
@return string | [
"Get",
"current",
"script",
"output",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L138-L144 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._getTypeOutput | protected function _getTypeOutput(array $options, $url, $type)
{
$type = Str::low($type);
if ($type === 'css') {
return $this->_getCssOutput($options, $url);
}
return $this->_getScriptOutput($options, $url);
} | php | protected function _getTypeOutput(array $options, $url, $type)
{
$type = Str::low($type);
if ($type === 'css') {
return $this->_getCssOutput($options, $url);
}
return $this->_getScriptOutput($options, $url);
} | [
"protected",
"function",
"_getTypeOutput",
"(",
"array",
"$",
"options",
",",
"$",
"url",
",",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"Str",
"::",
"low",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"type",
"===",
"'css'",
")",
"{",
"return",
"$... | Get current output by type.
@param array $options
@param string $url
@param string $type
@return string | [
"Get",
"current",
"output",
"by",
"type",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L154-L162 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._hasAsset | protected function _hasAsset($path, $type, $external)
{
return !$this->Url->assetPath($path, $this->_getAssetType($type)) && $external === false;
} | php | protected function _hasAsset($path, $type, $external)
{
return !$this->Url->assetPath($path, $this->_getAssetType($type)) && $external === false;
} | [
"protected",
"function",
"_hasAsset",
"(",
"$",
"path",
",",
"$",
"type",
",",
"$",
"external",
")",
"{",
"return",
"!",
"$",
"this",
"->",
"Url",
"->",
"assetPath",
"(",
"$",
"path",
",",
"$",
"this",
"->",
"_getAssetType",
"(",
"$",
"type",
")",
... | Check has asset.
@param string $path
@param string $type
@param bool $external
@return bool | [
"Check",
"has",
"asset",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L172-L175 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._include | protected function _include($path, array $options = [], $type = 'css')
{
$doc = $this->Document;
$options += ['once' => true, 'block' => null, 'fullBase' => true, 'weight' => 10];
$external = false;
$assetArray = $this->_arrayInclude($path, $options, $type);
if ($assetArray)... | php | protected function _include($path, array $options = [], $type = 'css')
{
$doc = $this->Document;
$options += ['once' => true, 'block' => null, 'fullBase' => true, 'weight' => 10];
$external = false;
$assetArray = $this->_arrayInclude($path, $options, $type);
if ($assetArray)... | [
"protected",
"function",
"_include",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"type",
"=",
"'css'",
")",
"{",
"$",
"doc",
"=",
"$",
"this",
"->",
"Document",
";",
"$",
"options",
"+=",
"[",
"'once'",
"=>",
"true",
... | Include asset.
@param string|array $path
@param array $options
@param string $type
@return bool|null|string | [
"Include",
"asset",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L185-L231 |
CakeCMS/Core | src/View/Helper/Traits/IncludeTrait.php | IncludeTrait._isOnceIncluded | protected function _isOnceIncluded($path, $type, array $options = [])
{
return $options['once'] && isset($this->_includedAssets[$type][$path]);
} | php | protected function _isOnceIncluded($path, $type, array $options = [])
{
return $options['once'] && isset($this->_includedAssets[$type][$path]);
} | [
"protected",
"function",
"_isOnceIncluded",
"(",
"$",
"path",
",",
"$",
"type",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"options",
"[",
"'once'",
"]",
"&&",
"isset",
"(",
"$",
"this",
"->",
"_includedAssets",
"[",
"$",
"... | Check asset on once include.
@param string $path
@param string $type
@param array $options
@return bool | [
"Check",
"asset",
"on",
"once",
"include",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/IncludeTrait.php#L241-L244 |
dafiti/datajet-client | src/Datajet/Resource/Batch.php | Batch.finish | public function finish()
{
$response = $this->client->post("{$this->uriImport}fullimport/finish", [
'query' => [
'key' => $this->config['data']['key'],
],
]);
$response = json_decode($response->getBody(), true);
return isset($response['status... | php | public function finish()
{
$response = $this->client->post("{$this->uriImport}fullimport/finish", [
'query' => [
'key' => $this->config['data']['key'],
],
]);
$response = json_decode($response->getBody(), true);
return isset($response['status... | [
"public",
"function",
"finish",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"post",
"(",
"\"{$this->uriImport}fullimport/finish\"",
",",
"[",
"'query'",
"=>",
"[",
"'key'",
"=>",
"$",
"this",
"->",
"config",
"[",
"'data'",
"]",
... | Close import queue.
@throws \GuzzleHttp\Exception\GuzzleException
@return bool | [
"Close",
"import",
"queue",
"."
] | train | https://github.com/dafiti/datajet-client/blob/c8555362521690b95451d2006d891b30facd8a46/src/Datajet/Resource/Batch.php#L69-L80 |
webforge-labs/psc-cms | lib/Psc/System/Console/GenericCompileCommand.php | GenericCompileCommand.getConstructorFields | public function getConstructorFields($gClass) {
if (!isset($this->constructorFields)) {
$this->constructorFields = array();
if ($gClass->hasMethod('__construct')) {
foreach ($gClass->getMethod('__construct')->getParameters() as $parameter) {
$this->constructorFields[] = $paramet... | php | public function getConstructorFields($gClass) {
if (!isset($this->constructorFields)) {
$this->constructorFields = array();
if ($gClass->hasMethod('__construct')) {
foreach ($gClass->getMethod('__construct')->getParameters() as $parameter) {
$this->constructorFields[] = $paramet... | [
"public",
"function",
"getConstructorFields",
"(",
"$",
"gClass",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"constructorFields",
")",
")",
"{",
"$",
"this",
"->",
"constructorFields",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"gClas... | Gibt die Felder zurück, die dem Entity per Constructor übergeben werden
@return string[] | [
"Gibt",
"die",
"Felder",
"zurück",
"die",
"dem",
"Entity",
"per",
"Constructor",
"übergeben",
"werden"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/System/Console/GenericCompileCommand.php#L76-L88 |
yuncms/framework | src/admin/models/AdminSearch.php | AdminSearch.search | public function search($params)
{
$query = Admin::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!($this->load($params) && $this->validate())) {
... | php | public function search($params)
{
$query = Admin::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!($this->load($params) && $this->validate())) {
... | [
"public",
"function",
"search",
"(",
"$",
"params",
")",
"{",
"$",
"query",
"=",
"Admin",
"::",
"find",
"(",
")",
";",
"// add conditions that should always apply here",
"$",
"dataProvider",
"=",
"new",
"ActiveDataProvider",
"(",
"[",
"'query'",
"=>",
"$",
"qu... | Creates data provider instance with search query applied
@param array $params
@return ActiveDataProvider | [
"Creates",
"data",
"provider",
"instance",
"with",
"search",
"query",
"applied"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/models/AdminSearch.php#L45-L83 |
xicrow/php-debug | src/Debugger.php | Debugger.output | public static function output($data, array $options = [])
{
$options = array_merge([
'trace_offset' => 0,
], $options);
if (!self::$output || !is_string($data)) {
return;
}
if (php_sapi_name() == 'cli') {
echo str_pad(' DEBUG ', 100, '-',... | php | public static function output($data, array $options = [])
{
$options = array_merge([
'trace_offset' => 0,
], $options);
if (!self::$output || !is_string($data)) {
return;
}
if (php_sapi_name() == 'cli') {
echo str_pad(' DEBUG ', 100, '-',... | [
"public",
"static",
"function",
"output",
"(",
"$",
"data",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'trace_offset'",
"=>",
"0",
",",
"]",
",",
"$",
"options",
")",
";",
"if",
"(",
"!",
... | @param string $data
@param array $options
@codeCoverageIgnore | [
"@param",
"string",
"$data",
"@param",
"array",
"$options"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L45-L70 |
xicrow/php-debug | src/Debugger.php | Debugger.debug | public static function debug($data, array $options = [])
{
$options = array_merge([
'trace_offset' => 0,
], $options);
self::output(self::getDebugInformation($data), $options);
} | php | public static function debug($data, array $options = [])
{
$options = array_merge([
'trace_offset' => 0,
], $options);
self::output(self::getDebugInformation($data), $options);
} | [
"public",
"static",
"function",
"debug",
"(",
"$",
"data",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'trace_offset'",
"=>",
"0",
",",
"]",
",",
"$",
"options",
")",
";",
"self",
"::",
"out... | @param mixed $data
@param array $options
@codeCoverageIgnore | [
"@param",
"mixed",
"$data",
"@param",
"array",
"$options"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L78-L85 |
xicrow/php-debug | src/Debugger.php | Debugger.showTrace | public static function showTrace(array $options = [])
{
$options = array_merge([
'trace_offset' => 0,
'reverse' => false,
], $options);
$backtrace = ($options['reverse'] ? array_reverse(debug_backtrace()) : debug_backtrace());
$output = '';
... | php | public static function showTrace(array $options = [])
{
$options = array_merge([
'trace_offset' => 0,
'reverse' => false,
], $options);
$backtrace = ($options['reverse'] ? array_reverse(debug_backtrace()) : debug_backtrace());
$output = '';
... | [
"public",
"static",
"function",
"showTrace",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'trace_offset'",
"=>",
"0",
",",
"'reverse'",
"=>",
"false",
",",
"]",
",",
"$",
"options",
")",
";",
"... | @param array $options
@codeCoverageIgnore | [
"@param",
"array",
"$options"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L92-L112 |
xicrow/php-debug | src/Debugger.php | Debugger.reflectClass | public static function reflectClass($class, $output = true)
{
$data = '';
$reflectionClass = new \ReflectionClass($class);
$comment = $reflectionClass->getDocComment();
if (!empty($comment)) {
$data .= $comment;
$data .= "\n";
}
$data ... | php | public static function reflectClass($class, $output = true)
{
$data = '';
$reflectionClass = new \ReflectionClass($class);
$comment = $reflectionClass->getDocComment();
if (!empty($comment)) {
$data .= $comment;
$data .= "\n";
}
$data ... | [
"public",
"static",
"function",
"reflectClass",
"(",
"$",
"class",
",",
"$",
"output",
"=",
"true",
")",
"{",
"$",
"data",
"=",
"''",
";",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"comment",
"=",
... | @param string $class
@param bool $output
@return string | [
"@param",
"string",
"$class",
"@param",
"bool",
"$output"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L120-L159 |
xicrow/php-debug | src/Debugger.php | Debugger.reflectClassProperty | public static function reflectClassProperty($class, $property, $output = true)
{
$data = '';
$reflectionClass = new \ReflectionClass($class);
$reflectionProperty = new \ReflectionProperty($class, $property);
$defaultPropertyValues = $reflectionClass->getDefaultProperties();
... | php | public static function reflectClassProperty($class, $property, $output = true)
{
$data = '';
$reflectionClass = new \ReflectionClass($class);
$reflectionProperty = new \ReflectionProperty($class, $property);
$defaultPropertyValues = $reflectionClass->getDefaultProperties();
... | [
"public",
"static",
"function",
"reflectClassProperty",
"(",
"$",
"class",
",",
"$",
"property",
",",
"$",
"output",
"=",
"true",
")",
"{",
"$",
"data",
"=",
"''",
";",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
... | @param string $class
@param string $property
@return string | [
"@param",
"string",
"$class",
"@param",
"string",
"$property"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L167-L200 |
xicrow/php-debug | src/Debugger.php | Debugger.reflectClassMethod | public static function reflectClassMethod($class, $method, $output = true)
{
$data = '';
$reflectionMethod = new \ReflectionMethod($class, $method);
$comment = $reflectionMethod->getDocComment();
if (!empty($comment)) {
$data .= "\n";
$data .= "\t";
... | php | public static function reflectClassMethod($class, $method, $output = true)
{
$data = '';
$reflectionMethod = new \ReflectionMethod($class, $method);
$comment = $reflectionMethod->getDocComment();
if (!empty($comment)) {
$data .= "\n";
$data .= "\t";
... | [
"public",
"static",
"function",
"reflectClassMethod",
"(",
"$",
"class",
",",
"$",
"method",
",",
"$",
"output",
"=",
"true",
")",
"{",
"$",
"data",
"=",
"''",
";",
"$",
"reflectionMethod",
"=",
"new",
"\\",
"ReflectionMethod",
"(",
"$",
"class",
",",
... | @param string $class
@param string $method
@param bool $output
@return string | [
"@param",
"string",
"$class",
"@param",
"string",
"$method",
"@param",
"bool",
"$output"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L209-L247 |
xicrow/php-debug | src/Debugger.php | Debugger.getCalledFrom | public static function getCalledFrom($index = 0)
{
$backtrace = debug_backtrace();
if (!isset($backtrace[$index])) {
return 'Unknown trace with index: ' . $index;
}
return self::getCalledFromTrace($backtrace[$index]);
} | php | public static function getCalledFrom($index = 0)
{
$backtrace = debug_backtrace();
if (!isset($backtrace[$index])) {
return 'Unknown trace with index: ' . $index;
}
return self::getCalledFromTrace($backtrace[$index]);
} | [
"public",
"static",
"function",
"getCalledFrom",
"(",
"$",
"index",
"=",
"0",
")",
"{",
"$",
"backtrace",
"=",
"debug_backtrace",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"backtrace",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"'Unknow... | @param int $index
@return string | [
"@param",
"int",
"$index"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L254-L263 |
xicrow/php-debug | src/Debugger.php | Debugger.getCalledFromTrace | public static function getCalledFromTrace($trace)
{
// Get file and line number
$calledFromFile = '';
if (isset($trace['file'])) {
$calledFromFile .= $trace['file'] . ' line ' . $trace['line'];
$calledFromFile = str_replace('\\', '/', $calledFromFile);
$ca... | php | public static function getCalledFromTrace($trace)
{
// Get file and line number
$calledFromFile = '';
if (isset($trace['file'])) {
$calledFromFile .= $trace['file'] . ' line ' . $trace['line'];
$calledFromFile = str_replace('\\', '/', $calledFromFile);
$ca... | [
"public",
"static",
"function",
"getCalledFromTrace",
"(",
"$",
"trace",
")",
"{",
"// Get file and line number",
"$",
"calledFromFile",
"=",
"''",
";",
"if",
"(",
"isset",
"(",
"$",
"trace",
"[",
"'file'",
"]",
")",
")",
"{",
"$",
"calledFromFile",
".=",
... | @param array $trace
@return string | [
"@param",
"array",
"$trace"
] | train | https://github.com/xicrow/php-debug/blob/b027be3249c0ce1a2a8d8ef50a05cd5805eaf45a/src/Debugger.php#L270-L297 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.