id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
222,200 | peej/phpdoctor | classes/packageDoc.php | packageDoc.depth | public function depth()
{
$depth = substr_count($this->_name, '.');
$depth += substr_count($this->_name, '\\');
$depth += substr_count($this->_name, '/');
return $depth;
} | php | public function depth()
{
$depth = substr_count($this->_name, '.');
$depth += substr_count($this->_name, '\\');
$depth += substr_count($this->_name, '/');
return $depth;
} | [
"public",
"function",
"depth",
"(",
")",
"{",
"$",
"depth",
"=",
"substr_count",
"(",
"$",
"this",
"->",
"_name",
",",
"'.'",
")",
";",
"$",
"depth",
"+=",
"substr_count",
"(",
"$",
"this",
"->",
"_name",
",",
"'\\\\'",
")",
";",
"$",
"depth",
"+="... | Calculate the depth of this package from the root.
@return int | [
"Calculate",
"the",
"depth",
"of",
"this",
"package",
"from",
"the",
"root",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L95-L102 |
222,201 | peej/phpdoctor | classes/packageDoc.php | packageDoc.addClass | public function addClass(&$class)
{
if (isset($this->_classes[$class->name()])) {
$phpdoctor =& $this->_root->phpdoctor();
echo "\n";
$phpdoctor->warning('Found class '.$class->name().' again, overwriting previous version');
}
$this->_classes[$class->name(... | php | public function addClass(&$class)
{
if (isset($this->_classes[$class->name()])) {
$phpdoctor =& $this->_root->phpdoctor();
echo "\n";
$phpdoctor->warning('Found class '.$class->name().' again, overwriting previous version');
}
$this->_classes[$class->name(... | [
"public",
"function",
"addClass",
"(",
"&",
"$",
"class",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_classes",
"[",
"$",
"class",
"->",
"name",
"(",
")",
"]",
")",
")",
"{",
"$",
"phpdoctor",
"=",
"&",
"$",
"this",
"->",
"_root",
"... | Add a class to this package.
@param ClassDoc class | [
"Add",
"a",
"class",
"to",
"this",
"package",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L108-L116 |
222,202 | peej/phpdoctor | classes/packageDoc.php | packageDoc.addFunction | public function addFunction(&$function)
{
if (isset($this->_functions[$function->name()])) {
$phpdoctor =& $this->_root->phpdoctor();
echo "\n";
$phpdoctor->warning('Found function '.$function->name().' again, overwriting previous version');
}
$this->_func... | php | public function addFunction(&$function)
{
if (isset($this->_functions[$function->name()])) {
$phpdoctor =& $this->_root->phpdoctor();
echo "\n";
$phpdoctor->warning('Found function '.$function->name().' again, overwriting previous version');
}
$this->_func... | [
"public",
"function",
"addFunction",
"(",
"&",
"$",
"function",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_functions",
"[",
"$",
"function",
"->",
"name",
"(",
")",
"]",
")",
")",
"{",
"$",
"phpdoctor",
"=",
"&",
"$",
"this",
"->",
"... | Add a function to this package.
@param MethodDoc function | [
"Add",
"a",
"function",
"to",
"this",
"package",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L133-L141 |
222,203 | peej/phpdoctor | classes/packageDoc.php | packageDoc.& | function &exceptions()
{
$exceptions = NULL;
foreach ($this->_classes as $name => $exception) {
if ($exception->isException()) {
$exceptions[$name] =& $this->_classes[$name];
}
}
return $exceptions;
} | php | function &exceptions()
{
$exceptions = NULL;
foreach ($this->_classes as $name => $exception) {
if ($exception->isException()) {
$exceptions[$name] =& $this->_classes[$name];
}
}
return $exceptions;
} | [
"function",
"&",
"exceptions",
"(",
")",
"{",
"$",
"exceptions",
"=",
"NULL",
";",
"foreach",
"(",
"$",
"this",
"->",
"_classes",
"as",
"$",
"name",
"=>",
"$",
"exception",
")",
"{",
"if",
"(",
"$",
"exception",
"->",
"isException",
"(",
")",
")",
... | Get exceptions in this package.
@return ClassDoc[] An array of exceptions | [
"Get",
"exceptions",
"in",
"this",
"package",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L156-L166 |
222,204 | peej/phpdoctor | classes/packageDoc.php | packageDoc.& | function &interfaces()
{
$interfaces = NULL;
foreach ($this->_classes as $name => $interface) {
if ($interface->isInterface()) {
$interfaces[$name] =& $this->_classes[$name];
}
}
return $interfaces;
} | php | function &interfaces()
{
$interfaces = NULL;
foreach ($this->_classes as $name => $interface) {
if ($interface->isInterface()) {
$interfaces[$name] =& $this->_classes[$name];
}
}
return $interfaces;
} | [
"function",
"&",
"interfaces",
"(",
")",
"{",
"$",
"interfaces",
"=",
"NULL",
";",
"foreach",
"(",
"$",
"this",
"->",
"_classes",
"as",
"$",
"name",
"=>",
"$",
"interface",
")",
"{",
"if",
"(",
"$",
"interface",
"->",
"isInterface",
"(",
")",
")",
... | Get interfaces in this package.
@return ClassDoc[] An array of interfaces | [
"Get",
"interfaces",
"in",
"this",
"package",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L172-L182 |
222,205 | peej/phpdoctor | classes/packageDoc.php | packageDoc.& | function &traits()
{
$traits = NULL;
foreach ($this->_classes as $name => $trait) {
if ($trait->isTrait()) {
$traits[$name] =& $this->_classes[$name];
}
}
return $traits;
} | php | function &traits()
{
$traits = NULL;
foreach ($this->_classes as $name => $trait) {
if ($trait->isTrait()) {
$traits[$name] =& $this->_classes[$name];
}
}
return $traits;
} | [
"function",
"&",
"traits",
"(",
")",
"{",
"$",
"traits",
"=",
"NULL",
";",
"foreach",
"(",
"$",
"this",
"->",
"_classes",
"as",
"$",
"name",
"=>",
"$",
"trait",
")",
"{",
"if",
"(",
"$",
"trait",
"->",
"isTrait",
"(",
")",
")",
"{",
"$",
"trait... | Get traits in this package.
@return ClassDoc[] An array of traits | [
"Get",
"traits",
"in",
"this",
"package",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L188-L198 |
222,206 | peej/phpdoctor | classes/packageDoc.php | packageDoc.& | function &findClass($className)
{
$return = NULL;
if (isset($this->_classes[$className])) {
$return =& $this->_classes[$className];
}
return $return;
} | php | function &findClass($className)
{
$return = NULL;
if (isset($this->_classes[$className])) {
$return =& $this->_classes[$className];
}
return $return;
} | [
"function",
"&",
"findClass",
"(",
"$",
"className",
")",
"{",
"$",
"return",
"=",
"NULL",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_classes",
"[",
"$",
"className",
"]",
")",
")",
"{",
"$",
"return",
"=",
"&",
"$",
"this",
"->",
"_class... | Lookup for a class within this package.
@param str className Name of the class to lookup
@return ClassDoc A class | [
"Lookup",
"for",
"a",
"class",
"within",
"this",
"package",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/packageDoc.php#L239-L247 |
222,207 | peej/phpdoctor | classes/doc.php | doc.set | public function set($member, $value)
{
$member = '_'.$member;
$members = get_object_vars($this);
if (array_key_exists($member, $members)) {
if (is_array($this->$member)) {
$this->{$member}[] = $value;
} else {
$this->$member = $value;
... | php | public function set($member, $value)
{
$member = '_'.$member;
$members = get_object_vars($this);
if (array_key_exists($member, $members)) {
if (is_array($this->$member)) {
$this->{$member}[] = $value;
} else {
$this->$member = $value;
... | [
"public",
"function",
"set",
"(",
"$",
"member",
",",
"$",
"value",
")",
"{",
"$",
"member",
"=",
"'_'",
".",
"$",
"member",
";",
"$",
"members",
"=",
"get_object_vars",
"(",
"$",
"this",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"member",
... | Setter method.
@param str member Name of the member to set
@param mixed value The value to set member to
@return bool | [
"Setter",
"method",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/doc.php#L76-L91 |
222,208 | peej/phpdoctor | classes/doc.php | doc.getFileContents | public function getFileContents($filename)
{
if ($contents = file_get_contents($filename)) {
if (preg_match('/<body ?.*?>(.+)<\/body>/s', $contents, $matches)) {
return $matches[1];
} else { // it's not HTML, so output it as plain text
return $contents... | php | public function getFileContents($filename)
{
if ($contents = file_get_contents($filename)) {
if (preg_match('/<body ?.*?>(.+)<\/body>/s', $contents, $matches)) {
return $matches[1];
} else { // it's not HTML, so output it as plain text
return $contents... | [
"public",
"function",
"getFileContents",
"(",
"$",
"filename",
")",
"{",
"if",
"(",
"$",
"contents",
"=",
"file_get_contents",
"(",
"$",
"filename",
")",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/<body ?.*?>(.+)<\\/body>/s'",
",",
"$",
"contents",
",",
"$",... | Get body of a text document
@param str filename
@return str | [
"Get",
"body",
"of",
"a",
"text",
"document"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/doc.php#L351-L361 |
222,209 | peej/phpdoctor | classes/classDoc.php | classDoc.addConstant | public function addConstant(&$constant)
{
if (!isset($this->_constants[$constant->name()])) {
$this->_constants[$constant->name()] =& $constant;
}
} | php | public function addConstant(&$constant)
{
if (!isset($this->_constants[$constant->name()])) {
$this->_constants[$constant->name()] =& $constant;
}
} | [
"public",
"function",
"addConstant",
"(",
"&",
"$",
"constant",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_constants",
"[",
"$",
"constant",
"->",
"name",
"(",
")",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_constants",
"[",
"$",
... | Add a constant to this class.
@param FieldDoc field | [
"Add",
"a",
"constant",
"to",
"this",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/classDoc.php#L107-L112 |
222,210 | peej/phpdoctor | classes/classDoc.php | classDoc.addField | public function addField(&$field)
{
if (!isset($this->_fields[$field->name()])) {
$this->_fields[$field->name()] =& $field;
}
} | php | public function addField(&$field)
{
if (!isset($this->_fields[$field->name()])) {
$this->_fields[$field->name()] =& $field;
}
} | [
"public",
"function",
"addField",
"(",
"&",
"$",
"field",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_fields",
"[",
"$",
"field",
"->",
"name",
"(",
")",
"]",
")",
")",
"{",
"$",
"this",
"->",
"_fields",
"[",
"$",
"field",
"->"... | Add a field to this class.
@param FieldDoc field | [
"Add",
"a",
"field",
"to",
"this",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/classDoc.php#L118-L123 |
222,211 | peej/phpdoctor | classes/classDoc.php | classDoc.& | function &fieldNamed($fieldName)
{
$return = NULL;
if (isset($this->_fields[$fieldName])) {
$return =& $this->_fields[$fieldName];
}
return $return;
} | php | function &fieldNamed($fieldName)
{
$return = NULL;
if (isset($this->_fields[$fieldName])) {
$return =& $this->_fields[$fieldName];
}
return $return;
} | [
"function",
"&",
"fieldNamed",
"(",
"$",
"fieldName",
")",
"{",
"$",
"return",
"=",
"NULL",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_fields",
"[",
"$",
"fieldName",
"]",
")",
")",
"{",
"$",
"return",
"=",
"&",
"$",
"this",
"->",
"_field... | Return a field in this class.
@return FieldDoc | [
"Return",
"a",
"field",
"in",
"this",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/classDoc.php#L161-L169 |
222,212 | peej/phpdoctor | classes/classDoc.php | classDoc.& | function &methods($regularOnly = FALSE)
{
if ($regularOnly) {
$return = array();
foreach ($this->_methods as $method) {
if (!$method->isConstructor() && !$method->isDestructor()) {
$return[] = $method;
}
}
} else... | php | function &methods($regularOnly = FALSE)
{
if ($regularOnly) {
$return = array();
foreach ($this->_methods as $method) {
if (!$method->isConstructor() && !$method->isDestructor()) {
$return[] = $method;
}
}
} else... | [
"function",
"&",
"methods",
"(",
"$",
"regularOnly",
"=",
"FALSE",
")",
"{",
"if",
"(",
"$",
"regularOnly",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_methods",
"as",
"$",
"method",
")",
"{",
"if",
... | Return the methods in this class.
@param bool regularOnly Do not return constructors and destructors
@return MethodDoc[] | [
"Return",
"the",
"methods",
"in",
"this",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/classDoc.php#L176-L190 |
222,213 | peej/phpdoctor | classes/classDoc.php | classDoc.& | function &methodNamed($methodName)
{
$return = NULL;
if (isset($this->_methods[$methodName])) {
$return =& $this->_methods[$methodName];
}
return $return;
} | php | function &methodNamed($methodName)
{
$return = NULL;
if (isset($this->_methods[$methodName])) {
$return =& $this->_methods[$methodName];
}
return $return;
} | [
"function",
"&",
"methodNamed",
"(",
"$",
"methodName",
")",
"{",
"$",
"return",
"=",
"NULL",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_methods",
"[",
"$",
"methodName",
"]",
")",
")",
"{",
"$",
"return",
"=",
"&",
"$",
"this",
"->",
"_m... | Return a method in this class.
@return MethodDoc | [
"Return",
"a",
"method",
"in",
"this",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/classDoc.php#L196-L204 |
222,214 | peej/phpdoctor | classes/classDoc.php | classDoc.subclasses | public function subclasses()
{
$return = array();
foreach ($this->_root->classes() as $classDoc) {
if ($classDoc->subclassOf($this)) {
$return[] = $classDoc;
}
}
return $return;
} | php | public function subclasses()
{
$return = array();
foreach ($this->_root->classes() as $classDoc) {
if ($classDoc->subclassOf($this)) {
$return[] = $classDoc;
}
}
return $return;
} | [
"public",
"function",
"subclasses",
"(",
")",
"{",
"$",
"return",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_root",
"->",
"classes",
"(",
")",
"as",
"$",
"classDoc",
")",
"{",
"if",
"(",
"$",
"classDoc",
"->",
"subclassOf",
"... | Return the known subclasses of this class
@return classDoc[] | [
"Return",
"the",
"known",
"subclasses",
"of",
"this",
"class"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/classDoc.php#L375-L385 |
222,215 | peej/phpdoctor | classes/fieldDoc.php | fieldDoc.typeAsString | public function typeAsString()
{
$myPackage =& $this->containingPackage();
$classDoc =& $this->_type->asClassDoc();
if ($classDoc) {
$packageDoc =& $classDoc->containingPackage();
return '<a href="'.str_repeat('../', $myPackage->depth() + 1).$classDoc->asPath().'">'.... | php | public function typeAsString()
{
$myPackage =& $this->containingPackage();
$classDoc =& $this->_type->asClassDoc();
if ($classDoc) {
$packageDoc =& $classDoc->containingPackage();
return '<a href="'.str_repeat('../', $myPackage->depth() + 1).$classDoc->asPath().'">'.... | [
"public",
"function",
"typeAsString",
"(",
")",
"{",
"$",
"myPackage",
"=",
"&",
"$",
"this",
"->",
"containingPackage",
"(",
")",
";",
"$",
"classDoc",
"=",
"&",
"$",
"this",
"->",
"_type",
"->",
"asClassDoc",
"(",
")",
";",
"if",
"(",
"$",
"classDo... | Format a field type for outputting. Recognised types are turned into
HTML anchor tags to the documentation page for the class defining them.
@return str The string representation of the field type | [
"Format",
"a",
"field",
"type",
"for",
"outputting",
".",
"Recognised",
"types",
"are",
"turned",
"into",
"HTML",
"anchor",
"tags",
"to",
"the",
"documentation",
"page",
"for",
"the",
"class",
"defining",
"them",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/fieldDoc.php#L105-L116 |
222,216 | thedevsaddam/laravel-schema | src/Schema/Helper.php | Helper.getValueIfExist | public function getValueIfExist($queries, $keyString)
{
foreach ($queries as $query) {
if ($query->Variable_name == $keyString) {
return $query->Value;
}
}
} | php | public function getValueIfExist($queries, $keyString)
{
foreach ($queries as $query) {
if ($query->Variable_name == $keyString) {
return $query->Value;
}
}
} | [
"public",
"function",
"getValueIfExist",
"(",
"$",
"queries",
",",
"$",
"keyString",
")",
"{",
"foreach",
"(",
"$",
"queries",
"as",
"$",
"query",
")",
"{",
"if",
"(",
"$",
"query",
"->",
"Variable_name",
"==",
"$",
"keyString",
")",
"{",
"return",
"$"... | Fetch queries value if key exist
@param $queries
@param $keyString
@return mixed | [
"Fetch",
"queries",
"value",
"if",
"key",
"exist"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Schema/Helper.php#L86-L93 |
222,217 | petercoles/Betfair-Exchange | src/Api/Betting.php | Betting.prepare | public function prepare($params)
{
$this->params = !empty($params) ? $params[ 0 ] : [ ];
// force mandatory fields
$this->filter();
$this->maxRecords();
} | php | public function prepare($params)
{
$this->params = !empty($params) ? $params[ 0 ] : [ ];
// force mandatory fields
$this->filter();
$this->maxRecords();
} | [
"public",
"function",
"prepare",
"(",
"$",
"params",
")",
"{",
"$",
"this",
"->",
"params",
"=",
"!",
"empty",
"(",
"$",
"params",
")",
"?",
"$",
"params",
"[",
"0",
"]",
":",
"[",
"]",
";",
"// force mandatory fields",
"$",
"this",
"->",
"filter",
... | Prepare parameters for API requests, ensuring the mandatory requirments are satisfied
@param array $params | [
"Prepare",
"parameters",
"for",
"API",
"requests",
"ensuring",
"the",
"mandatory",
"requirments",
"are",
"satisfied"
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Betting.php#L19-L26 |
222,218 | petercoles/Betfair-Exchange | src/Api/Betting.php | Betting.filter | protected function filter()
{
$lists = [
'listCompetitions',
'listCountries',
'listEvents',
'listEventTypes',
'listMarketTypes',
'listVenues',
'listMarketCatalogue'
];
if (in_array($this->method, $lists) && ... | php | protected function filter()
{
$lists = [
'listCompetitions',
'listCountries',
'listEvents',
'listEventTypes',
'listMarketTypes',
'listVenues',
'listMarketCatalogue'
];
if (in_array($this->method, $lists) && ... | [
"protected",
"function",
"filter",
"(",
")",
"{",
"$",
"lists",
"=",
"[",
"'listCompetitions'",
",",
"'listCountries'",
",",
"'listEvents'",
",",
"'listEventTypes'",
",",
"'listMarketTypes'",
",",
"'listVenues'",
",",
"'listMarketCatalogue'",
"]",
";",
"if",
"(",
... | Ensure that a filter parameter is passed where mandatory | [
"Ensure",
"that",
"a",
"filter",
"parameter",
"is",
"passed",
"where",
"mandatory"
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Betting.php#L31-L46 |
222,219 | peej/phpdoctor | formatters/htmlStandardFormatter.php | htmlStandardFormatter._addListMarkupUL | public function _addListMarkupUL($txt)
{
// Create unordered lists. -, +, # and o are recogized as bullet points
// $li_rx: regex capturing a list entry, including those extending over multiple lines and
// those padded with empty lines
// $ul_rx: regex capturing an unordere... | php | public function _addListMarkupUL($txt)
{
// Create unordered lists. -, +, # and o are recogized as bullet points
// $li_rx: regex capturing a list entry, including those extending over multiple lines and
// those padded with empty lines
// $ul_rx: regex capturing an unordere... | [
"public",
"function",
"_addListMarkupUL",
"(",
"$",
"txt",
")",
"{",
"// Create unordered lists. -, +, # and o are recogized as bullet points",
"// $li_rx: regex capturing a list entry, including those extending over multiple lines and",
"// those padded with empty lines",
"// $ul_rx: ... | Detects unordered lists and adds the necessary markup.
@param string $txt the text to parse and modify
@return string | [
"Detects",
"unordered",
"lists",
"and",
"adds",
"the",
"necessary",
"markup",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/formatters/htmlStandardFormatter.php#L30-L60 |
222,220 | thedevsaddam/laravel-schema | src/Console/Commands/HelpSchema.php | HelpSchema.showHelp | public function showHelp()
{
$this->generateBody();
$this->info('Laravel Schema version: ' . $this->version);
$this->table($this->headers, $this->body);
$this->comment('Visit https://packagist.org/packages/thedevsaddam/laravel-schema for more details.');
} | php | public function showHelp()
{
$this->generateBody();
$this->info('Laravel Schema version: ' . $this->version);
$this->table($this->headers, $this->body);
$this->comment('Visit https://packagist.org/packages/thedevsaddam/laravel-schema for more details.');
} | [
"public",
"function",
"showHelp",
"(",
")",
"{",
"$",
"this",
"->",
"generateBody",
"(",
")",
";",
"$",
"this",
"->",
"info",
"(",
"'Laravel Schema version: '",
".",
"$",
"this",
"->",
"version",
")",
";",
"$",
"this",
"->",
"table",
"(",
"$",
"this",
... | Display schema help information in a table
@return bool | [
"Display",
"schema",
"help",
"information",
"in",
"a",
"table"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Console/Commands/HelpSchema.php#L62-L68 |
222,221 | thedevsaddam/laravel-schema | src/Console/Commands/HelpSchema.php | HelpSchema.generateBody | private function generateBody()
{
$data = $this->readHelpGuide();
$this->version = $data['version'];
foreach ($data['help'] as $key => $value) {
$data = [$key, $value];
array_push($this->body, $data);
}
} | php | private function generateBody()
{
$data = $this->readHelpGuide();
$this->version = $data['version'];
foreach ($data['help'] as $key => $value) {
$data = [$key, $value];
array_push($this->body, $data);
}
} | [
"private",
"function",
"generateBody",
"(",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"readHelpGuide",
"(",
")",
";",
"$",
"this",
"->",
"version",
"=",
"$",
"data",
"[",
"'version'",
"]",
";",
"foreach",
"(",
"$",
"data",
"[",
"'help'",
"]",
... | Generate the table body | [
"Generate",
"the",
"table",
"body"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Console/Commands/HelpSchema.php#L73-L82 |
222,222 | thedevsaddam/laravel-schema | src/Console/Commands/HelpSchema.php | HelpSchema.readHelpGuide | private function readHelpGuide()
{
try {
$help = file_get_contents(realpath(__DIR__ . "/../../Schema/help.json"));
return json_decode($help, true);
} catch (\Exception $e) {
$this->error($e->getMessage());
}
} | php | private function readHelpGuide()
{
try {
$help = file_get_contents(realpath(__DIR__ . "/../../Schema/help.json"));
return json_decode($help, true);
} catch (\Exception $e) {
$this->error($e->getMessage());
}
} | [
"private",
"function",
"readHelpGuide",
"(",
")",
"{",
"try",
"{",
"$",
"help",
"=",
"file_get_contents",
"(",
"realpath",
"(",
"__DIR__",
".",
"\"/../../Schema/help.json\"",
")",
")",
";",
"return",
"json_decode",
"(",
"$",
"help",
",",
"true",
")",
";",
... | Read help.json file
@return mixed | [
"Read",
"help",
".",
"json",
"file"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Console/Commands/HelpSchema.php#L88-L96 |
222,223 | SmarchSoftware/watchtower | src/Controllers/PermissionController.php | PermissionController.editRole | public function editRole($id)
{
if ( Shinobi::can( config('watchtower.acl.permission.role', false) ) ) {
$permission = Permission::findOrFail($id);
$roles = $permission->roles;
$available_roles = Role::whereDoesntHave('permissions', function ($query) use ($id) {
$query->where('permission_id', $... | php | public function editRole($id)
{
if ( Shinobi::can( config('watchtower.acl.permission.role', false) ) ) {
$permission = Permission::findOrFail($id);
$roles = $permission->roles;
$available_roles = Role::whereDoesntHave('permissions', function ($query) use ($id) {
$query->where('permission_id', $... | [
"public",
"function",
"editRole",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"Shinobi",
"::",
"can",
"(",
"config",
"(",
"'watchtower.acl.permission.role'",
",",
"false",
")",
")",
")",
"{",
"$",
"permission",
"=",
"Permission",
"::",
"findOrFail",
"(",
"$",
"... | Show the form for editing the permission roles.
@param int $id
@return Response | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"permission",
"roles",
"."
] | 4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da | https://github.com/SmarchSoftware/watchtower/blob/4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da/src/Controllers/PermissionController.php#L189-L204 |
222,224 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor._buildFileList | public function _buildFileList($files, $dir)
{
$list = array();
$dir = realpath($dir);
if (!$dir) {
return $list;
}
$dir = $this->fixPath($dir);
foreach ($files as $filename) {
$filename = $this->makeAbsolutePath(trim($filename), $dir);
... | php | public function _buildFileList($files, $dir)
{
$list = array();
$dir = realpath($dir);
if (!$dir) {
return $list;
}
$dir = $this->fixPath($dir);
foreach ($files as $filename) {
$filename = $this->makeAbsolutePath(trim($filename), $dir);
... | [
"public",
"function",
"_buildFileList",
"(",
"$",
"files",
",",
"$",
"dir",
")",
"{",
"$",
"list",
"=",
"array",
"(",
")",
";",
"$",
"dir",
"=",
"realpath",
"(",
"$",
"dir",
")",
";",
"if",
"(",
"!",
"$",
"dir",
")",
"{",
"return",
"$",
"list",... | Build a complete list of file to parse. Expand out wildcards and
traverse directories if asked to.
@param str[] files Array of filenames to expand | [
"Build",
"a",
"complete",
"list",
"of",
"file",
"to",
"parse",
".",
"Expand",
"out",
"wildcards",
"and",
"traverse",
"directories",
"if",
"asked",
"to",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L342-L390 |
222,225 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor.makeAbsolutePath | public function makeAbsolutePath($path, $prefix)
{
if (
substr($path, 0, 1) == '/' || // unix root
substr($path, 1, 2) == ':\\' || // windows root
substr($path, 0, 2) == '~/' || // unix home directory
substr($path, 0, 2) == '\\\\' || // windows network locatio... | php | public function makeAbsolutePath($path, $prefix)
{
if (
substr($path, 0, 1) == '/' || // unix root
substr($path, 1, 2) == ':\\' || // windows root
substr($path, 0, 2) == '~/' || // unix home directory
substr($path, 0, 2) == '\\\\' || // windows network locatio... | [
"public",
"function",
"makeAbsolutePath",
"(",
"$",
"path",
",",
"$",
"prefix",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"path",
",",
"0",
",",
"1",
")",
"==",
"'/'",
"||",
"// unix root",
"substr",
"(",
"$",
"path",
",",
"1",
",",
"2",
")",
"=="... | Turn path into an absolute path using the given prefix?
@param str path Path to make absolute
@param str prefix Absolute path to append to relative path
@return str | [
"Turn",
"path",
"into",
"an",
"absolute",
"path",
"using",
"the",
"given",
"prefix?"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L457-L479 |
222,226 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor.docletPath | public function docletPath()
{
//return $this->makeAbsolutePath($this->fixPath($this->_docletPath).$this->fixPath($this->_doclet), $this->_path);
return realpath($this->fixPath($this->_docletPath).$this->fixPath($this->_doclet)).'/';
} | php | public function docletPath()
{
//return $this->makeAbsolutePath($this->fixPath($this->_docletPath).$this->fixPath($this->_doclet), $this->_path);
return realpath($this->fixPath($this->_docletPath).$this->fixPath($this->_doclet)).'/';
} | [
"public",
"function",
"docletPath",
"(",
")",
"{",
"//return $this->makeAbsolutePath($this->fixPath($this->_docletPath).$this->fixPath($this->_doclet), $this->_path);",
"return",
"realpath",
"(",
"$",
"this",
"->",
"fixPath",
"(",
"$",
"this",
"->",
"_docletPath",
")",
".",
... | Return the path PHPDoctor is running from.
@return str | [
"Return",
"the",
"path",
"PHPDoctor",
"is",
"running",
"from",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L500-L504 |
222,227 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor.execute | public function execute(&$rootDoc)
{
$docletFile = $this->fixPath($this->_docletPath).$this->_doclet.'/'.$this->_doclet.'.php';
if (is_file($docletFile)) { // load doclet
$this->message('Loading doclet "'.$this->_doclet.'"');
require_once($this->fixPath($this->_docletPath).'/... | php | public function execute(&$rootDoc)
{
$docletFile = $this->fixPath($this->_docletPath).$this->_doclet.'/'.$this->_doclet.'.php';
if (is_file($docletFile)) { // load doclet
$this->message('Loading doclet "'.$this->_doclet.'"');
require_once($this->fixPath($this->_docletPath).'/... | [
"public",
"function",
"execute",
"(",
"&",
"$",
"rootDoc",
")",
"{",
"$",
"docletFile",
"=",
"$",
"this",
"->",
"fixPath",
"(",
"$",
"this",
"->",
"_docletPath",
")",
".",
"$",
"this",
"->",
"_doclet",
".",
"'/'",
".",
"$",
"this",
"->",
"_doclet",
... | Loads and runs the doclet.
@param RootDoc rootDoc
@return bool | [
"Loads",
"and",
"runs",
"the",
"doclet",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1189-L1201 |
222,228 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor.getFormatter | public function getFormatter()
{
$formatterFile = $this->fixPath($this->_formatterPath).$this->_formatter.'.php';
if (is_file($formatterFile)) {
require_once($formatterFile);
return new $this->_formatter();
} else {
$this->error('Could not find formatter ... | php | public function getFormatter()
{
$formatterFile = $this->fixPath($this->_formatterPath).$this->_formatter.'.php';
if (is_file($formatterFile)) {
require_once($formatterFile);
return new $this->_formatter();
} else {
$this->error('Could not find formatter ... | [
"public",
"function",
"getFormatter",
"(",
")",
"{",
"$",
"formatterFile",
"=",
"$",
"this",
"->",
"fixPath",
"(",
"$",
"this",
"->",
"_formatterPath",
")",
".",
"$",
"this",
"->",
"_formatter",
".",
"'.php'",
";",
"if",
"(",
"is_file",
"(",
"$",
"form... | Creates the formatter and returns it.
@return TextFormatter | [
"Creates",
"the",
"formatter",
"and",
"returns",
"it",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1207-L1218 |
222,229 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor._mergeArrays | public function _mergeArrays($one, $two)
{
foreach ($two as $key => $item) {
if (isset($one[$key]) && is_array($one[$key]) && is_array($item)) {
$one[$key] = $this->_mergeArrays($one[$key], $item);
} else {
$one[$key] = $item;
}
}
... | php | public function _mergeArrays($one, $two)
{
foreach ($two as $key => $item) {
if (isset($one[$key]) && is_array($one[$key]) && is_array($item)) {
$one[$key] = $this->_mergeArrays($one[$key], $item);
} else {
$one[$key] = $item;
}
}
... | [
"public",
"function",
"_mergeArrays",
"(",
"$",
"one",
",",
"$",
"two",
")",
"{",
"foreach",
"(",
"$",
"two",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"one",
"[",
"$",
"key",
"]",
")",
"&&",
"is_array",
"(",
... | Recursively merge two arrays into a single array. This differs
from the PHP function array_merge_recursive as it replaces values
with the same index from the first array with items from the
second.
@param mixed[] one Array one
@param mixed[] two Array two
@return mixed[] Merged array | [
"Recursively",
"merge",
"two",
"arrays",
"into",
"a",
"single",
"array",
".",
"This",
"differs",
"from",
"the",
"PHP",
"function",
"array_merge_recursive",
"as",
"it",
"replaces",
"values",
"with",
"the",
"same",
"index",
"from",
"the",
"first",
"array",
"with... | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1246-L1257 |
222,230 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor._getNext | public function _getNext(&$tokens, $key, $whatToGet, $maxDist=0)
{
$start = $key;
$key++;
if (!is_array($whatToGet)) $whatToGet = array($whatToGet);
while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
$key++;
if (!isset($tokens[$key]) || ... | php | public function _getNext(&$tokens, $key, $whatToGet, $maxDist=0)
{
$start = $key;
$key++;
if (!is_array($whatToGet)) $whatToGet = array($whatToGet);
while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
$key++;
if (!isset($tokens[$key]) || ... | [
"public",
"function",
"_getNext",
"(",
"&",
"$",
"tokens",
",",
"$",
"key",
",",
"$",
"whatToGet",
",",
"$",
"maxDist",
"=",
"0",
")",
"{",
"$",
"start",
"=",
"$",
"key",
";",
"$",
"key",
"++",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"whatTo... | Get next token of a certain type from token array
@param str[] tokens Token array to search
@param int key Key to start searching from
@param int whatToGet Type of token to look for
@param int maxDist Optional max distance from key to look at; default is 0 for all.
@return str Value of found token | [
"Get",
"next",
"token",
"of",
"a",
"certain",
"type",
"from",
"token",
"array"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1268-L1279 |
222,231 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor._getPrev | public function _getPrev(&$tokens, $key, $whatToGet)
{
$key--;
if (!is_array($whatToGet)) $whatToGet = array($whatToGet);
while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
$key--;
if (!isset($tokens[$key])) return FALSE;
}
... | php | public function _getPrev(&$tokens, $key, $whatToGet)
{
$key--;
if (!is_array($whatToGet)) $whatToGet = array($whatToGet);
while (!is_array($tokens[$key]) || !in_array($tokens[$key][0], $whatToGet)) {
$key--;
if (!isset($tokens[$key])) return FALSE;
}
... | [
"public",
"function",
"_getPrev",
"(",
"&",
"$",
"tokens",
",",
"$",
"key",
",",
"$",
"whatToGet",
")",
"{",
"$",
"key",
"--",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"whatToGet",
")",
")",
"$",
"whatToGet",
"=",
"array",
"(",
"$",
"whatToGet",
... | Get previous token of a certain type from token array
@param str[] tokens Token array to search
@param int key Key to start searching from
@param int whatToGet Type of token to look for
@return str Value of found token | [
"Get",
"previous",
"token",
"of",
"a",
"certain",
"type",
"from",
"token",
"array"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1289-L1299 |
222,232 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor._getProgramElementName | public function _getProgramElementName(&$tokens, $key)
{
$name = '';
$key++;
while (
$tokens[$key] && (
$tokens[$key] == '&' || (
isset($tokens[$key][0]) && isset($tokens[$key][1]) && (
$tokens[$key][0] == T_WHITESPACE ||
... | php | public function _getProgramElementName(&$tokens, $key)
{
$name = '';
$key++;
while (
$tokens[$key] && (
$tokens[$key] == '&' || (
isset($tokens[$key][0]) && isset($tokens[$key][1]) && (
$tokens[$key][0] == T_WHITESPACE ||
... | [
"public",
"function",
"_getProgramElementName",
"(",
"&",
"$",
"tokens",
",",
"$",
"key",
")",
"{",
"$",
"name",
"=",
"''",
";",
"$",
"key",
"++",
";",
"while",
"(",
"$",
"tokens",
"[",
"$",
"key",
"]",
"&&",
"(",
"$",
"tokens",
"[",
"$",
"key",
... | Get the next program element name from the token list
@param mixed[] tokens
@param int key
@return str | [
"Get",
"the",
"next",
"program",
"element",
"name",
"from",
"the",
"token",
"list"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1308-L1329 |
222,233 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor.processDocComment | public function processDocComment($comment, &$root)
{
if (substr(trim($comment), 0, 3) != '/**') return array(); // not doc comment, abort
$data = array(
'docComment' => $comment,
'tags' => array()
);
$explodedComment = preg_split('/\n[ \n\t\/]*\*+[ \t]*@/',... | php | public function processDocComment($comment, &$root)
{
if (substr(trim($comment), 0, 3) != '/**') return array(); // not doc comment, abort
$data = array(
'docComment' => $comment,
'tags' => array()
);
$explodedComment = preg_split('/\n[ \n\t\/]*\*+[ \t]*@/',... | [
"public",
"function",
"processDocComment",
"(",
"$",
"comment",
",",
"&",
"$",
"root",
")",
"{",
"if",
"(",
"substr",
"(",
"trim",
"(",
"$",
"comment",
")",
",",
"0",
",",
"3",
")",
"!=",
"'/**'",
")",
"return",
"array",
"(",
")",
";",
"// not doc ... | Process a doc comment into a doc tag array.
@param str comment The comment to process
@param RootDoc root The root object
@return mixed[] Array of doc comment data | [
"Process",
"a",
"doc",
"comment",
"into",
"a",
"doc",
"tag",
"array",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1338-L1403 |
222,234 | peej/phpdoctor | classes/phpDoctor.php | phpDoctor._includeElements | public function _includeElements(&$element)
{
if ($element->isGlobal() && !$element->isFinal() && !$this->_globals) {
return FALSE;
} elseif ($element->isGlobal() && $element->isFinal() && !$this->_constants) {
return FALSE;
} elseif (!$this->_private && $element->isP... | php | public function _includeElements(&$element)
{
if ($element->isGlobal() && !$element->isFinal() && !$this->_globals) {
return FALSE;
} elseif ($element->isGlobal() && $element->isFinal() && !$this->_constants) {
return FALSE;
} elseif (!$this->_private && $element->isP... | [
"public",
"function",
"_includeElements",
"(",
"&",
"$",
"element",
")",
"{",
"if",
"(",
"$",
"element",
"->",
"isGlobal",
"(",
")",
"&&",
"!",
"$",
"element",
"->",
"isFinal",
"(",
")",
"&&",
"!",
"$",
"this",
"->",
"_globals",
")",
"{",
"return",
... | Is an element private and we are including private elements, or element is
protected and we are including protected elements.
@param ProgramElementDoc element The element to check
@return bool | [
"Is",
"an",
"element",
"private",
"and",
"we",
"are",
"including",
"private",
"elements",
"or",
"element",
"is",
"protected",
"and",
"we",
"are",
"including",
"protected",
"elements",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/phpDoctor.php#L1451-L1468 |
222,235 | webtoucher/yii2-amqp | components/AmqpTrait.php | AmqpTrait.getAmqp | public function getAmqp()
{
if (empty($this->amqpContainer)) {
$this->amqpContainer = Yii::$app->amqp;
}
return $this->amqpContainer;
} | php | public function getAmqp()
{
if (empty($this->amqpContainer)) {
$this->amqpContainer = Yii::$app->amqp;
}
return $this->amqpContainer;
} | [
"public",
"function",
"getAmqp",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"amqpContainer",
")",
")",
"{",
"$",
"this",
"->",
"amqpContainer",
"=",
"Yii",
"::",
"$",
"app",
"->",
"amqp",
";",
"}",
"return",
"$",
"this",
"->",
"amqp... | Returns AMQP object.
@return Amqp | [
"Returns",
"AMQP",
"object",
"."
] | 7a060ce88f2e31d7324b036a6b1d113a0d75bf02 | https://github.com/webtoucher/yii2-amqp/blob/7a060ce88f2e31d7324b036a6b1d113a0d75bf02/components/AmqpTrait.php#L45-L51 |
222,236 | peej/phpdoctor | classes/methodDoc.php | methodDoc.returnTypeAsString | public function returnTypeAsString()
{
$myPackage =& $this->containingPackage();
$classDoc =& $this->_returnType->asClassDoc();
if ($classDoc) {
$packageDoc =& $classDoc->containingPackage();
return '<a href="'.str_repeat('../', $myPackage->depth() + 1).$classDoc->as... | php | public function returnTypeAsString()
{
$myPackage =& $this->containingPackage();
$classDoc =& $this->_returnType->asClassDoc();
if ($classDoc) {
$packageDoc =& $classDoc->containingPackage();
return '<a href="'.str_repeat('../', $myPackage->depth() + 1).$classDoc->as... | [
"public",
"function",
"returnTypeAsString",
"(",
")",
"{",
"$",
"myPackage",
"=",
"&",
"$",
"this",
"->",
"containingPackage",
"(",
")",
";",
"$",
"classDoc",
"=",
"&",
"$",
"this",
"->",
"_returnType",
"->",
"asClassDoc",
"(",
")",
";",
"if",
"(",
"$"... | Format a return type for outputting. Recognised types are turned into
HTML anchor tags to the documentation page for the class defining them.
@return str The string representation of the return type | [
"Format",
"a",
"return",
"type",
"for",
"outputting",
".",
"Recognised",
"types",
"are",
"turned",
"into",
"HTML",
"anchor",
"tags",
"to",
"the",
"documentation",
"page",
"for",
"the",
"class",
"defining",
"them",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/methodDoc.php#L83-L94 |
222,237 | yii2mod/yii2-cron-log | behaviors/CronLoggerBehavior.php | CronLoggerBehavior.getActionParams | private function getActionParams()
{
$result = '';
$requestParams = Yii::$app->request->getParams();
ArrayHelper::remove($requestParams, 0);
foreach ($requestParams as $key => $value) {
if (is_string($key)) {
$result .= " --{$key}={$value}";
}... | php | private function getActionParams()
{
$result = '';
$requestParams = Yii::$app->request->getParams();
ArrayHelper::remove($requestParams, 0);
foreach ($requestParams as $key => $value) {
if (is_string($key)) {
$result .= " --{$key}={$value}";
}... | [
"private",
"function",
"getActionParams",
"(",
")",
"{",
"$",
"result",
"=",
"''",
";",
"$",
"requestParams",
"=",
"Yii",
"::",
"$",
"app",
"->",
"request",
"->",
"getParams",
"(",
")",
";",
"ArrayHelper",
"::",
"remove",
"(",
"$",
"requestParams",
",",
... | Get action params
@return string | [
"Get",
"action",
"params"
] | 488d5907d6f9b26320e44078b08a8b5b6ed9b49c | https://github.com/yii2mod/yii2-cron-log/blob/488d5907d6f9b26320e44078b08a8b5b6ed9b49c/behaviors/CronLoggerBehavior.php#L113-L128 |
222,238 | petercoles/Betfair-Exchange | src/Api/Auth.php | Auth.init | public function init($appKey, $username, $password)
{
if ($appKey == self::$appKey && $this->sessionRemaining() > 5) {
$this->keepAlive();
} else {
$this->login($appKey, $username, $password);
}
} | php | public function init($appKey, $username, $password)
{
if ($appKey == self::$appKey && $this->sessionRemaining() > 5) {
$this->keepAlive();
} else {
$this->login($appKey, $username, $password);
}
} | [
"public",
"function",
"init",
"(",
"$",
"appKey",
",",
"$",
"username",
",",
"$",
"password",
")",
"{",
"if",
"(",
"$",
"appKey",
"==",
"self",
"::",
"$",
"appKey",
"&&",
"$",
"this",
"->",
"sessionRemaining",
"(",
")",
">",
"5",
")",
"{",
"$",
"... | Wrapper method for other methods to initiate and manage a Betfair session.
This method can be called safely multiple times in a script, or in a loop
for a long running process and will only trigger the authentication overhead
when really needed.
@param string $appKey
@param string $username
@param string $password | [
"Wrapper",
"method",
"for",
"other",
"methods",
"to",
"initiate",
"and",
"manage",
"a",
"Betfair",
"session",
".",
"This",
"method",
"can",
"be",
"called",
"safely",
"multiple",
"times",
"in",
"a",
"script",
"or",
"in",
"a",
"loop",
"for",
"a",
"long",
"... | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Auth.php#L49-L56 |
222,239 | petercoles/Betfair-Exchange | src/Api/Auth.php | Auth.persist | public function persist($appKey, $sessionToken)
{
if ($sessionToken === null) {
throw new Exception('Invalid session token');
}
self::$appKey = $appKey;
self::$sessionToken = $sessionToken;
return $this->keepAlive();
} | php | public function persist($appKey, $sessionToken)
{
if ($sessionToken === null) {
throw new Exception('Invalid session token');
}
self::$appKey = $appKey;
self::$sessionToken = $sessionToken;
return $this->keepAlive();
} | [
"public",
"function",
"persist",
"(",
"$",
"appKey",
",",
"$",
"sessionToken",
")",
"{",
"if",
"(",
"$",
"sessionToken",
"===",
"null",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Invalid session token'",
")",
";",
"}",
"self",
"::",
"$",
"appKey",
"="... | Accept app key and session token and extend session.
@param string $appKey
@param string $sessionToken
@return string | [
"Accept",
"app",
"key",
"and",
"session",
"token",
"and",
"extend",
"session",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Auth.php#L65-L75 |
222,240 | petercoles/Betfair-Exchange | src/Api/Auth.php | Auth.keepAlive | public function keepAlive()
{
$result = $this->execute($this->httpClient->setEndPoint(self::ENDPOINT.'keepAlive/'));
self::$lastLogin = time();
return $result->token;
} | php | public function keepAlive()
{
$result = $this->execute($this->httpClient->setEndPoint(self::ENDPOINT.'keepAlive/'));
self::$lastLogin = time();
return $result->token;
} | [
"public",
"function",
"keepAlive",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"execute",
"(",
"$",
"this",
"->",
"httpClient",
"->",
"setEndPoint",
"(",
"self",
"::",
"ENDPOINT",
".",
"'keepAlive/'",
")",
")",
";",
"self",
"::",
"$",
"lastLo... | Execute Betfair API call to extend the current session.
Implicitly uses the already set app key and session token.
@return string
@throws Exception | [
"Execute",
"Betfair",
"API",
"call",
"to",
"extend",
"the",
"current",
"session",
".",
"Implicitly",
"uses",
"the",
"already",
"set",
"app",
"key",
"and",
"session",
"token",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Auth.php#L111-L118 |
222,241 | petercoles/Betfair-Exchange | src/Api/Auth.php | Auth.logout | public function logout()
{
$this->execute($this->httpClient->setEndPoint(self::ENDPOINT.'logout/'));
self::$appKey = null;
self::$sessionToken = null;
self::$lastLogin = null;
} | php | public function logout()
{
$this->execute($this->httpClient->setEndPoint(self::ENDPOINT.'logout/'));
self::$appKey = null;
self::$sessionToken = null;
self::$lastLogin = null;
} | [
"public",
"function",
"logout",
"(",
")",
"{",
"$",
"this",
"->",
"execute",
"(",
"$",
"this",
"->",
"httpClient",
"->",
"setEndPoint",
"(",
"self",
"::",
"ENDPOINT",
".",
"'logout/'",
")",
")",
";",
"self",
"::",
"$",
"appKey",
"=",
"null",
";",
"se... | Execute Betfair API call to logout from their system.
Clear all local references to the session.
@throws Exception | [
"Execute",
"Betfair",
"API",
"call",
"to",
"logout",
"from",
"their",
"system",
".",
"Clear",
"all",
"local",
"references",
"to",
"the",
"session",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Auth.php#L126-L133 |
222,242 | petercoles/Betfair-Exchange | src/Api/Auth.php | Auth.execute | public function execute($request)
{
$result = $request->authHeaders()->send();
if ($result->status === self::API_STATUS_FAIL) {
throw new Exception('Error: '.$result->error);
}
return $result;
} | php | public function execute($request)
{
$result = $request->authHeaders()->send();
if ($result->status === self::API_STATUS_FAIL) {
throw new Exception('Error: '.$result->error);
}
return $result;
} | [
"public",
"function",
"execute",
"(",
"$",
"request",
")",
"{",
"$",
"result",
"=",
"$",
"request",
"->",
"authHeaders",
"(",
")",
"->",
"send",
"(",
")",
";",
"if",
"(",
"$",
"result",
"->",
"status",
"===",
"self",
"::",
"API_STATUS_FAIL",
")",
"{"... | Accept request, add auth headers and dispatch, then respond to any errors.
@param \PeterColes\Betfair\Http\Client $request
@return Mixed
@throws Exception | [
"Accept",
"request",
"add",
"auth",
"headers",
"and",
"dispatch",
"then",
"respond",
"to",
"any",
"errors",
"."
] | 58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2 | https://github.com/petercoles/Betfair-Exchange/blob/58a3d9e1521861d17b26b8c9c8f1dfc74d52c0c2/src/Api/Auth.php#L156-L165 |
222,243 | webtoucher/yii2-amqp | components/AmqpInterpreter.php | AmqpInterpreter.log | public function log($message, $type = self::MESSAGE_INFO) {
$format = [$type == self::MESSAGE_ERROR ? Console::FG_RED : Console::FG_BLUE];
Console::stdout(Console::ansiFormat($message . PHP_EOL, $format));
} | php | public function log($message, $type = self::MESSAGE_INFO) {
$format = [$type == self::MESSAGE_ERROR ? Console::FG_RED : Console::FG_BLUE];
Console::stdout(Console::ansiFormat($message . PHP_EOL, $format));
} | [
"public",
"function",
"log",
"(",
"$",
"message",
",",
"$",
"type",
"=",
"self",
"::",
"MESSAGE_INFO",
")",
"{",
"$",
"format",
"=",
"[",
"$",
"type",
"==",
"self",
"::",
"MESSAGE_ERROR",
"?",
"Console",
"::",
"FG_RED",
":",
"Console",
"::",
"FG_BLUE",... | Logs info and error messages.
@param $message
@param $type | [
"Logs",
"info",
"and",
"error",
"messages",
"."
] | 7a060ce88f2e31d7324b036a6b1d113a0d75bf02 | https://github.com/webtoucher/yii2-amqp/blob/7a060ce88f2e31d7324b036a6b1d113a0d75bf02/components/AmqpInterpreter.php#L30-L33 |
222,244 | SmarchSoftware/watchtower | src/Controllers/UserController.php | UserController.editUserRoles | public function editUserRoles($id)
{
if ( Shinobi::can( config('watchtower.acl.user.role', false) ) ) {
$user = $this->model::findOrFail($id);
$roles = $user->roles;
$available_roles = Role::whereDoesntHave('users', function ($query) use ($id) {
$query->where('user_id', $id);
})->get();
... | php | public function editUserRoles($id)
{
if ( Shinobi::can( config('watchtower.acl.user.role', false) ) ) {
$user = $this->model::findOrFail($id);
$roles = $user->roles;
$available_roles = Role::whereDoesntHave('users', function ($query) use ($id) {
$query->where('user_id', $id);
})->get();
... | [
"public",
"function",
"editUserRoles",
"(",
"$",
"id",
")",
"{",
"if",
"(",
"Shinobi",
"::",
"can",
"(",
"config",
"(",
"'watchtower.acl.user.role'",
",",
"false",
")",
")",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"model",
"::",
"findOrFail",
"(... | Show the form for editing the user roles.
@param int $id
@return Response | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"user",
"roles",
"."
] | 4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da | https://github.com/SmarchSoftware/watchtower/blob/4ac9368ff98dfa88d4a4c4c8ce1ff92e4d35b5da/src/Controllers/UserController.php#L189-L204 |
222,245 | peej/phpdoctor | doclets/modern/htmlWriter.php | HtmlWriter._processInlineTags | public function _processInlineTags(&$tag, $first = FALSE)
{
$description = '';
if (is_array($tag)) $tag = $tag[0];
if (is_object($tag)) {
if ($first) {
$tags =& $tag->firstSentenceTags($this->_doclet);
} else {
$tags =& $tag->inlineTags... | php | public function _processInlineTags(&$tag, $first = FALSE)
{
$description = '';
if (is_array($tag)) $tag = $tag[0];
if (is_object($tag)) {
if ($first) {
$tags =& $tag->firstSentenceTags($this->_doclet);
} else {
$tags =& $tag->inlineTags... | [
"public",
"function",
"_processInlineTags",
"(",
"&",
"$",
"tag",
",",
"$",
"first",
"=",
"FALSE",
")",
"{",
"$",
"description",
"=",
"''",
";",
"if",
"(",
"is_array",
"(",
"$",
"tag",
")",
")",
"$",
"tag",
"=",
"$",
"tag",
"[",
"0",
"]",
";",
... | Convert inline tags into a string for outputting.
@param Tag tag The text tag to process
@param bool first Process first line of tag only
@return str The string representation of the elements doc tags | [
"Convert",
"inline",
"tags",
"into",
"a",
"string",
"for",
"outputting",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/modern/htmlWriter.php#L233-L255 |
222,246 | peej/phpdoctor | doclets/modern/frameOutputWriter.php | FrameOutputWriter.frameOutputWriter | public function frameOutputWriter(&$doclet)
{
parent::HTMLWriter($doclet);
ob_start();
echo <<<END
<frameset cols="20%,80%" frameborder="1" border="1" bordercolor="#bbb" framespacing="1">
<frame src="frame.html" name="index">
<frame src="namespaces.html" name="main">
<noframes>
<bod... | php | public function frameOutputWriter(&$doclet)
{
parent::HTMLWriter($doclet);
ob_start();
echo <<<END
<frameset cols="20%,80%" frameborder="1" border="1" bordercolor="#bbb" framespacing="1">
<frame src="frame.html" name="index">
<frame src="namespaces.html" name="main">
<noframes>
<bod... | [
"public",
"function",
"frameOutputWriter",
"(",
"&",
"$",
"doclet",
")",
"{",
"parent",
"::",
"HTMLWriter",
"(",
"$",
"doclet",
")",
";",
"ob_start",
"(",
")",
";",
"echo",
" <<<END\n\n<frameset cols=\"20%,80%\" frameborder=\"1\" border=\"1\" bordercolor=\"#bbb\" framespa... | Build the HTML frameset.
@param Doclet doclet | [
"Build",
"the",
"HTML",
"frameset",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/modern/frameOutputWriter.php#L33-L62 |
222,247 | yii2mod/yii2-cron-log | actions/CronLogAction.php | CronLogAction.run | public function run()
{
$searchModel = Yii::createObject($this->searchClass);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->controller->render($this->view, [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
... | php | public function run()
{
$searchModel = Yii::createObject($this->searchClass);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->controller->render($this->view, [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"searchModel",
"=",
"Yii",
"::",
"createObject",
"(",
"$",
"this",
"->",
"searchClass",
")",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"Yii",
"::",
"$",
"app",
"->",
"reques... | Lists of all cron logs. | [
"Lists",
"of",
"all",
"cron",
"logs",
"."
] | 488d5907d6f9b26320e44078b08a8b5b6ed9b49c | https://github.com/yii2mod/yii2-cron-log/blob/488d5907d6f9b26320e44078b08a8b5b6ed9b49c/actions/CronLogAction.php#L28-L37 |
222,248 | peej/phpdoctor | classes/rootDoc.php | rootDoc.addSource | public function addSource($filename, $source, $fileData)
{
$this->_sources[substr($filename, strlen($this->_phpdoctor->sourcePath()) + 1)] = array(
$source, $fileData
);
} | php | public function addSource($filename, $source, $fileData)
{
$this->_sources[substr($filename, strlen($this->_phpdoctor->sourcePath()) + 1)] = array(
$source, $fileData
);
} | [
"public",
"function",
"addSource",
"(",
"$",
"filename",
",",
"$",
"source",
",",
"$",
"fileData",
")",
"{",
"$",
"this",
"->",
"_sources",
"[",
"substr",
"(",
"$",
"filename",
",",
"strlen",
"(",
"$",
"this",
"->",
"_phpdoctor",
"->",
"sourcePath",
"(... | Add a source file to this root.
@param str filename
@param str source
@param str[] fileData | [
"Add",
"a",
"source",
"file",
"to",
"this",
"root",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/rootDoc.php#L90-L95 |
222,249 | peej/phpdoctor | classes/rootDoc.php | rootDoc.& | function &classes()
{
$classes = array();
$packages = $this->packages(); // not by reference so as not to move the internal array pointer
foreach ($packages as $name => $package) {
$packageClasses = $this->_packages[$name]->allClasses(); // not by reference so as not to move the ... | php | function &classes()
{
$classes = array();
$packages = $this->packages(); // not by reference so as not to move the internal array pointer
foreach ($packages as $name => $package) {
$packageClasses = $this->_packages[$name]->allClasses(); // not by reference so as not to move the ... | [
"function",
"&",
"classes",
"(",
")",
"{",
"$",
"classes",
"=",
"array",
"(",
")",
";",
"$",
"packages",
"=",
"$",
"this",
"->",
"packages",
"(",
")",
";",
"// not by reference so as not to move the internal array pointer",
"foreach",
"(",
"$",
"packages",
"as... | Return a reference to the classes and interfaces to be documented.
@return ClassDoc[] | [
"Return",
"a",
"reference",
"to",
"the",
"classes",
"and",
"interfaces",
"to",
"be",
"documented",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/rootDoc.php#L137-L152 |
222,250 | peej/phpdoctor | classes/rootDoc.php | rootDoc.& | function &functions()
{
$functions = array();
$packages = $this->packages(); // not by reference so as not to move the internal array pointer
foreach ($packages as $name => $package) {
$packageFunctions = $this->_packages[$name]->functions(); // not by reference so as not to move... | php | function &functions()
{
$functions = array();
$packages = $this->packages(); // not by reference so as not to move the internal array pointer
foreach ($packages as $name => $package) {
$packageFunctions = $this->_packages[$name]->functions(); // not by reference so as not to move... | [
"function",
"&",
"functions",
"(",
")",
"{",
"$",
"functions",
"=",
"array",
"(",
")",
";",
"$",
"packages",
"=",
"$",
"this",
"->",
"packages",
"(",
")",
";",
"// not by reference so as not to move the internal array pointer",
"foreach",
"(",
"$",
"packages",
... | Return a reference to the functions to be documented.
@return MethodDoc[] | [
"Return",
"a",
"reference",
"to",
"the",
"functions",
"to",
"be",
"documented",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/rootDoc.php#L158-L172 |
222,251 | peej/phpdoctor | classes/rootDoc.php | rootDoc.& | function &globals()
{
$globals = array();
$packages = $this->packages(); // not by reference so as not to move the internal array pointer
foreach ($packages as $name => $package) {
$packageGlobals = $this->_packages[$name]->globals(); // not by reference so as not to move the int... | php | function &globals()
{
$globals = array();
$packages = $this->packages(); // not by reference so as not to move the internal array pointer
foreach ($packages as $name => $package) {
$packageGlobals = $this->_packages[$name]->globals(); // not by reference so as not to move the int... | [
"function",
"&",
"globals",
"(",
")",
"{",
"$",
"globals",
"=",
"array",
"(",
")",
";",
"$",
"packages",
"=",
"$",
"this",
"->",
"packages",
"(",
")",
";",
"// not by reference so as not to move the internal array pointer",
"foreach",
"(",
"$",
"packages",
"as... | Return a reference to the globals to be documented.
@return FieldDoc[] | [
"Return",
"a",
"reference",
"to",
"the",
"globals",
"to",
"be",
"documented",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/rootDoc.php#L178-L193 |
222,252 | peej/phpdoctor | classes/rootDoc.php | rootDoc.& | function &packageNamed($name, $create = FALSE)
{
$return = NULL;
if (isset($this->_packages[$name])) {
$return =& $this->_packages[$name];
} elseif ($create) {
$newPackage =& new packageDoc($name, $this);
$this->addPackage($newPackage);
$return... | php | function &packageNamed($name, $create = FALSE)
{
$return = NULL;
if (isset($this->_packages[$name])) {
$return =& $this->_packages[$name];
} elseif ($create) {
$newPackage =& new packageDoc($name, $this);
$this->addPackage($newPackage);
$return... | [
"function",
"&",
"packageNamed",
"(",
"$",
"name",
",",
"$",
"create",
"=",
"FALSE",
")",
"{",
"$",
"return",
"=",
"NULL",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_packages",
"[",
"$",
"name",
"]",
")",
")",
"{",
"$",
"return",
"=",
"... | Return a reference to a packageDoc for the specified package name. If a
package of the requested name does not exist, this method will create the
package object, add it to the root and return it.
@param str name Package name
@param bool create Create package if it does not exist
@return PackageDoc | [
"Return",
"a",
"reference",
"to",
"a",
"packageDoc",
"for",
"the",
"specified",
"package",
"name",
".",
"If",
"a",
"package",
"of",
"the",
"requested",
"name",
"does",
"not",
"exist",
"this",
"method",
"will",
"create",
"the",
"package",
"object",
"add",
"... | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/rootDoc.php#L203-L215 |
222,253 | yii2mod/yii2-cron-log | behaviors/MutexConsoleCommandBehavior.php | MutexConsoleCommandBehavior.checkIsMutexAction | public function checkIsMutexAction($action)
{
return in_array(strtolower($action), $this->mutexActions) || in_array('*', $this->mutexActions);
} | php | public function checkIsMutexAction($action)
{
return in_array(strtolower($action), $this->mutexActions) || in_array('*', $this->mutexActions);
} | [
"public",
"function",
"checkIsMutexAction",
"(",
"$",
"action",
")",
"{",
"return",
"in_array",
"(",
"strtolower",
"(",
"$",
"action",
")",
",",
"$",
"this",
"->",
"mutexActions",
")",
"||",
"in_array",
"(",
"'*'",
",",
"$",
"this",
"->",
"mutexActions",
... | Checks if specified action is among mutex actions.
@param string $action action name
@return bool whether action should be under mutex | [
"Checks",
"if",
"specified",
"action",
"is",
"among",
"mutex",
"actions",
"."
] | 488d5907d6f9b26320e44078b08a8b5b6ed9b49c | https://github.com/yii2mod/yii2-cron-log/blob/488d5907d6f9b26320e44078b08a8b5b6ed9b49c/behaviors/MutexConsoleCommandBehavior.php#L83-L86 |
222,254 | thedevsaddam/laravel-schema | src/Console/Commands/QuerySchema.php | QuerySchema.performQuery | public function performQuery()
{
//change connection if provide
if ($this->option('c')) {
$this->schema->setConnection($this->option('c'));
$this->schema->switchWrapper();
}
$rawQuery = $this->option('r');
if (empty($rawQuery)) {
$this->wa... | php | public function performQuery()
{
//change connection if provide
if ($this->option('c')) {
$this->schema->setConnection($this->option('c'));
$this->schema->switchWrapper();
}
$rawQuery = $this->option('r');
if (empty($rawQuery)) {
$this->wa... | [
"public",
"function",
"performQuery",
"(",
")",
"{",
"//change connection if provide",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
"'c'",
")",
")",
"{",
"$",
"this",
"->",
"schema",
"->",
"setConnection",
"(",
"$",
"this",
"->",
"option",
"(",
"'c'",
")... | Perform raw sql query
@return bool | [
"Perform",
"raw",
"sql",
"query"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Console/Commands/QuerySchema.php#L49-L68 |
222,255 | peej/phpdoctor | classes/seeTag.php | seeTag._linkText | public function _linkText($link, $doclet)
{
$element =& $this->_resolveLink();
if ($element && $this->_parent) {
$package =& $this->_parent->containingPackage();
$path = str_repeat('../', $package->depth() + 1).$element->asPath();
return $doclet->formatLink($path... | php | public function _linkText($link, $doclet)
{
$element =& $this->_resolveLink();
if ($element && $this->_parent) {
$package =& $this->_parent->containingPackage();
$path = str_repeat('../', $package->depth() + 1).$element->asPath();
return $doclet->formatLink($path... | [
"public",
"function",
"_linkText",
"(",
"$",
"link",
",",
"$",
"doclet",
")",
"{",
"$",
"element",
"=",
"&",
"$",
"this",
"->",
"_resolveLink",
"(",
")",
";",
"if",
"(",
"$",
"element",
"&&",
"$",
"this",
"->",
"_parent",
")",
"{",
"$",
"package",
... | Generate the text to go into the seeTag link
@param str link
@param Doclet doclet | [
"Generate",
"the",
"text",
"to",
"go",
"into",
"the",
"seeTag",
"link"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/classes/seeTag.php#L87-L100 |
222,256 | peej/phpdoctor | doclets/standard/classWriter.php | classWriter.inheritFields | public function inheritFields(&$element, &$rootDoc, &$package)
{
$fields =& $element->fields();
if ($fields) {
ksort($fields);
$num = count($fields); $foo = 0;
echo '<table class="inherit">', "\n";
echo '<tr><th colspan="2">Fields inherited from ', $el... | php | public function inheritFields(&$element, &$rootDoc, &$package)
{
$fields =& $element->fields();
if ($fields) {
ksort($fields);
$num = count($fields); $foo = 0;
echo '<table class="inherit">', "\n";
echo '<tr><th colspan="2">Fields inherited from ', $el... | [
"public",
"function",
"inheritFields",
"(",
"&",
"$",
"element",
",",
"&",
"$",
"rootDoc",
",",
"&",
"$",
"package",
")",
"{",
"$",
"fields",
"=",
"&",
"$",
"element",
"->",
"fields",
"(",
")",
";",
"if",
"(",
"$",
"fields",
")",
"{",
"ksort",
"(... | Display the inherited fields of an element. This method calls itself
recursively if the element has a parent class.
@param ProgramElementDoc element
@param RootDoc rootDoc
@param PackageDoc package | [
"Display",
"the",
"inherited",
"fields",
"of",
"an",
"element",
".",
"This",
"method",
"calls",
"itself",
"recursively",
"if",
"the",
"element",
"has",
"a",
"parent",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/classWriter.php#L394-L418 |
222,257 | peej/phpdoctor | doclets/standard/classWriter.php | classWriter.inheritMethods | public function inheritMethods(&$element, &$rootDoc, &$package)
{
$methods =& $element->methods();
if ($methods) {
ksort($methods);
$num = count($methods); $foo = 0;
echo '<table class="inherit">', "\n";
echo '<tr><th colspan="2">Methods inherited from... | php | public function inheritMethods(&$element, &$rootDoc, &$package)
{
$methods =& $element->methods();
if ($methods) {
ksort($methods);
$num = count($methods); $foo = 0;
echo '<table class="inherit">', "\n";
echo '<tr><th colspan="2">Methods inherited from... | [
"public",
"function",
"inheritMethods",
"(",
"&",
"$",
"element",
",",
"&",
"$",
"rootDoc",
",",
"&",
"$",
"package",
")",
"{",
"$",
"methods",
"=",
"&",
"$",
"element",
"->",
"methods",
"(",
")",
";",
"if",
"(",
"$",
"methods",
")",
"{",
"ksort",
... | Display the inherited methods of an element. This method calls itself
recursively if the element has a parent class.
@param ProgramElementDoc element
@param RootDoc rootDoc
@param PackageDoc package | [
"Display",
"the",
"inherited",
"methods",
"of",
"an",
"element",
".",
"This",
"method",
"calls",
"itself",
"recursively",
"if",
"the",
"element",
"has",
"a",
"parent",
"class",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/classWriter.php#L427-L451 |
222,258 | peej/phpdoctor | doclets/standard/htmlWriter.php | htmlWriter._nav | public function _nav($path)
{
$output = '<div class="header">'."\n";
$output .= '<h1>'.$this->_doclet->getHeader()."</h1>\n";
if ($this->_sections) {
$output .= "<ul>\n";
foreach ($this->_sections as $section) {
if (isset($section['selected']) && $sect... | php | public function _nav($path)
{
$output = '<div class="header">'."\n";
$output .= '<h1>'.$this->_doclet->getHeader()."</h1>\n";
if ($this->_sections) {
$output .= "<ul>\n";
foreach ($this->_sections as $section) {
if (isset($section['selected']) && $sect... | [
"public",
"function",
"_nav",
"(",
"$",
"path",
")",
"{",
"$",
"output",
"=",
"'<div class=\"header\">'",
".",
"\"\\n\"",
";",
"$",
"output",
".=",
"'<h1>'",
".",
"$",
"this",
"->",
"_doclet",
"->",
"getHeader",
"(",
")",
".",
"\"</h1>\\n\"",
";",
"if",
... | Build the navigation bar
@return str | [
"Build",
"the",
"navigation",
"bar"
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/htmlWriter.php#L148-L192 |
222,259 | peej/phpdoctor | doclets/standard/htmlWriter.php | htmlWriter._write | public function _write($path, $title, $shell)
{
$phpdoctor =& $this->_doclet->phpdoctor();
// make directory separators suitable to this platform
$path = str_replace('/', DIRECTORY_SEPARATOR, $path);
// make directories if they don't exist
$dirs = explode(DIRECTORY_SEPARATO... | php | public function _write($path, $title, $shell)
{
$phpdoctor =& $this->_doclet->phpdoctor();
// make directory separators suitable to this platform
$path = str_replace('/', DIRECTORY_SEPARATOR, $path);
// make directories if they don't exist
$dirs = explode(DIRECTORY_SEPARATO... | [
"public",
"function",
"_write",
"(",
"$",
"path",
",",
"$",
"title",
",",
"$",
"shell",
")",
"{",
"$",
"phpdoctor",
"=",
"&",
"$",
"this",
"->",
"_doclet",
"->",
"phpdoctor",
"(",
")",
";",
"// make directory separators suitable to this platform",
"$",
"path... | Write the HTML page to disk using the given path.
@param str path The path to write the file to
@param str title The title for this page
@param bool shell Include the page shell in the output | [
"Write",
"the",
"HTML",
"page",
"to",
"disk",
"using",
"the",
"given",
"path",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/htmlWriter.php#L210-L245 |
222,260 | peej/phpdoctor | doclets/standard/htmlWriter.php | htmlWriter._processTags | public function _processTags(&$tags)
{
$tagString = '';
foreach ($tags as $key => $tag) {
if ($key != '@text') {
if (is_array($tag)) {
$hasText = FALSE;
foreach ($tag as $key => $tagFromGroup) {
if ($tagFromG... | php | public function _processTags(&$tags)
{
$tagString = '';
foreach ($tags as $key => $tag) {
if ($key != '@text') {
if (is_array($tag)) {
$hasText = FALSE;
foreach ($tag as $key => $tagFromGroup) {
if ($tagFromG... | [
"public",
"function",
"_processTags",
"(",
"&",
"$",
"tags",
")",
"{",
"$",
"tagString",
"=",
"''",
";",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"key",
"=>",
"$",
"tag",
")",
"{",
"if",
"(",
"$",
"key",
"!=",
"'@text'",
")",
"{",
"if",
"(",
"is... | Format tags for output.
@param Tag[] tags
@return str The string representation of the elements doc tags | [
"Format",
"tags",
"for",
"output",
"."
] | 3eb646e3b93d411ba8faccd8e9691d6190a11379 | https://github.com/peej/phpdoctor/blob/3eb646e3b93d411ba8faccd8e9691d6190a11379/doclets/standard/htmlWriter.php#L252-L284 |
222,261 | yii2mod/yii2-cron-log | models/CronScheduleModel.php | CronScheduleModel.startCronSchedule | public function startCronSchedule($jobCode, $status = CronScheduleStatus::RUN, $messages = null)
{
$this->jobCode = $jobCode;
$this->status = $status;
$this->messages = $messages;
$this->dateCreated = Yii::$app->formatter->asDatetime(time(), 'php: Y-m-d H:i:s');
return $this... | php | public function startCronSchedule($jobCode, $status = CronScheduleStatus::RUN, $messages = null)
{
$this->jobCode = $jobCode;
$this->status = $status;
$this->messages = $messages;
$this->dateCreated = Yii::$app->formatter->asDatetime(time(), 'php: Y-m-d H:i:s');
return $this... | [
"public",
"function",
"startCronSchedule",
"(",
"$",
"jobCode",
",",
"$",
"status",
"=",
"CronScheduleStatus",
"::",
"RUN",
",",
"$",
"messages",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"jobCode",
"=",
"$",
"jobCode",
";",
"$",
"this",
"->",
"status",
... | Start cron schedule
@param string $jobCode
@param int $status
@param null $messages
@return bool | [
"Start",
"cron",
"schedule"
] | 488d5907d6f9b26320e44078b08a8b5b6ed9b49c | https://github.com/yii2mod/yii2-cron-log/blob/488d5907d6f9b26320e44078b08a8b5b6ed9b49c/models/CronScheduleModel.php#L66-L74 |
222,262 | yii2mod/yii2-cron-log | models/CronScheduleModel.php | CronScheduleModel.endCronSchedule | public function endCronSchedule($status, $messages = null)
{
if ($this->id) {
$this->dateFinished = Yii::$app->formatter->asDatetime(time(), 'php: Y-m-d H:i:s');
$this->status = $status;
$this->messages = $messages;
return $this->save();
}
re... | php | public function endCronSchedule($status, $messages = null)
{
if ($this->id) {
$this->dateFinished = Yii::$app->formatter->asDatetime(time(), 'php: Y-m-d H:i:s');
$this->status = $status;
$this->messages = $messages;
return $this->save();
}
re... | [
"public",
"function",
"endCronSchedule",
"(",
"$",
"status",
",",
"$",
"messages",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"id",
")",
"{",
"$",
"this",
"->",
"dateFinished",
"=",
"Yii",
"::",
"$",
"app",
"->",
"formatter",
"->",
"asDatet... | End cron schedule
@param string $status
@param null $messages
@return bool | [
"End",
"cron",
"schedule"
] | 488d5907d6f9b26320e44078b08a8b5b6ed9b49c | https://github.com/yii2mod/yii2-cron-log/blob/488d5907d6f9b26320e44078b08a8b5b6ed9b49c/models/CronScheduleModel.php#L84-L95 |
222,263 | thedevsaddam/laravel-schema | src/Console/Commands/ShowSchema.php | ShowSchema.showSchemaInTable | public function showSchemaInTable()
{
//change connection if provide
if ($this->option('c')) {
$this->schema->setConnection($this->option('c'));
$this->schema->switchWrapper();
}
$tables = $this->schema->databaseWrapper->getTables();
$headers = $this-... | php | public function showSchemaInTable()
{
//change connection if provide
if ($this->option('c')) {
$this->schema->setConnection($this->option('c'));
$this->schema->switchWrapper();
}
$tables = $this->schema->databaseWrapper->getTables();
$headers = $this-... | [
"public",
"function",
"showSchemaInTable",
"(",
")",
"{",
"//change connection if provide",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
"'c'",
")",
")",
"{",
"$",
"this",
"->",
"schema",
"->",
"setConnection",
"(",
"$",
"this",
"->",
"option",
"(",
"'c'",... | Display schema information in tabular form
@return bool | [
"Display",
"schema",
"information",
"in",
"tabular",
"form"
] | ce787b3b5d6f558cd5fb615f373beabb1939e724 | https://github.com/thedevsaddam/laravel-schema/blob/ce787b3b5d6f558cd5fb615f373beabb1939e724/src/Console/Commands/ShowSchema.php#L50-L87 |
222,264 | Rabbit-Converter/Rabbit-PHP | src/Rabbit.php | Rabbit.parseline | private static function parseline($string){
$string = str_replace(chr(10), "\\n", $string);
$string = str_replace(chr(13), "\\n", $string);
$string = str_replace("\f", "\\f", $string);
return $string;
} | php | private static function parseline($string){
$string = str_replace(chr(10), "\\n", $string);
$string = str_replace(chr(13), "\\n", $string);
$string = str_replace("\f", "\\f", $string);
return $string;
} | [
"private",
"static",
"function",
"parseline",
"(",
"$",
"string",
")",
"{",
"$",
"string",
"=",
"str_replace",
"(",
"chr",
"(",
"10",
")",
",",
"\"\\\\n\"",
",",
"$",
"string",
")",
";",
"$",
"string",
"=",
"str_replace",
"(",
"chr",
"(",
"13",
")",
... | Replace the line break to character to parse the data correctly
@param string $string
@return string | [
"Replace",
"the",
"line",
"break",
"to",
"character",
"to",
"parse",
"the",
"data",
"correctly"
] | 420e7889054cdf821553c27a082116513666bc5e | https://github.com/Rabbit-Converter/Rabbit-PHP/blob/420e7889054cdf821553c27a082116513666bc5e/src/Rabbit.php#L49-L54 |
222,265 | Rabbit-Converter/Rabbit-PHP | src/Rabbit.php | Rabbit.replaceWithRule | protected static function replaceWithRule($rule, $output)
{
foreach ($rule as $data) {
$from_json = $data["from"];
//search line break.
//if line break include , need to fix the line
if (strpos($from_json, chr(13)) !== false) {
$from_json = s... | php | protected static function replaceWithRule($rule, $output)
{
foreach ($rule as $data) {
$from_json = $data["from"];
//search line break.
//if line break include , need to fix the line
if (strpos($from_json, chr(13)) !== false) {
$from_json = s... | [
"protected",
"static",
"function",
"replaceWithRule",
"(",
"$",
"rule",
",",
"$",
"output",
")",
"{",
"foreach",
"(",
"$",
"rule",
"as",
"$",
"data",
")",
"{",
"$",
"from_json",
"=",
"$",
"data",
"[",
"\"from\"",
"]",
";",
"//search line break.",
"//if l... | Replace the string with rules.
@param array $rule
@param string $output
@return string | [
"Replace",
"the",
"string",
"with",
"rules",
"."
] | 420e7889054cdf821553c27a082116513666bc5e | https://github.com/Rabbit-Converter/Rabbit-PHP/blob/420e7889054cdf821553c27a082116513666bc5e/src/Rabbit.php#L63-L81 |
222,266 | nabbar/SwaggerValidator-PHP | src/Object/HeaderItem.php | HeaderItem.__storeData | protected function __storeData($key, $value = null)
{
if (property_exists($this, $key)) {
$this->$key = $value;
}
else {
parent::__storeData($key, $value);
}
} | php | protected function __storeData($key, $value = null)
{
if (property_exists($this, $key)) {
$this->$key = $value;
}
else {
parent::__storeData($key, $value);
}
} | [
"protected",
"function",
"__storeData",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"property_exists",
"(",
"$",
"this",
",",
"$",
"key",
")",
")",
"{",
"$",
"this",
"->",
"$",
"key",
"=",
"$",
"value",
";",
"}",
"else",... | Var Export Method | [
"Var",
"Export",
"Method"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/HeaderItem.php#L40-L48 |
222,267 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.jsonUnSerialize | public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
if (!is_object($jsonData)) {
$context->throwException('Mismatching type of JSON Data received', __METHOD__, __LINE__);
}
if (!($jsonData instanceof \stdClass)) {
$context->... | php | public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
if (!is_object($jsonData)) {
$context->throwException('Mismatching type of JSON Data received', __METHOD__, __LINE__);
}
if (!($jsonData instanceof \stdClass)) {
$context->... | [
"public",
"function",
"jsonUnSerialize",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
",",
"$",
"jsonData",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"jsonData",
")",
")",
"{",
"$",
"context",
"->",
"throwException... | Unserialize the JSON mixed data to this swagger object type
@param \SwaggerValidator\Common\Context $context
@param \stdClass $jsonData | [
"Unserialize",
"the",
"JSON",
"mixed",
"data",
"to",
"this",
"swagger",
"object",
"type"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L66-L92 |
222,268 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.jsonSerialize | public function jsonSerialize()
{
$keyDefinition = \SwaggerValidator\Common\FactorySwagger::KEY_DEFINITIONS;
$doc = json_decode(\SwaggerValidator\Common\Collection::jsonEncode(parent::jsonSerialize()));
$doc->$keyDefinition = json_decode(\SwaggerValidator\Common\Collect... | php | public function jsonSerialize()
{
$keyDefinition = \SwaggerValidator\Common\FactorySwagger::KEY_DEFINITIONS;
$doc = json_decode(\SwaggerValidator\Common\Collection::jsonEncode(parent::jsonSerialize()));
$doc->$keyDefinition = json_decode(\SwaggerValidator\Common\Collect... | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"$",
"keyDefinition",
"=",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"FactorySwagger",
"::",
"KEY_DEFINITIONS",
";",
"$",
"doc",
"=",
"json_decode",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
... | Method call when a json_encode of an instance of this object is used
@return \stdClass | [
"Method",
"call",
"when",
"a",
"json_encode",
"of",
"an",
"instance",
"of",
"this",
"object",
"is",
"used"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L98-L110 |
222,269 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.validate | public function validate(\SwaggerValidator\Common\Context $context)
{
if (!$this->validateBaseSwagger($context)) {
return false;
}
$keyPath = \SwaggerValidator\Common\FactorySwagger::KEY_PATHS;
$context->logValidate(get_class($this), __METHOD__, __LINE__);
... | php | public function validate(\SwaggerValidator\Common\Context $context)
{
if (!$this->validateBaseSwagger($context)) {
return false;
}
$keyPath = \SwaggerValidator\Common\FactorySwagger::KEY_PATHS;
$context->logValidate(get_class($this), __METHOD__, __LINE__);
... | [
"public",
"function",
"validate",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateBaseSwagger",
"(",
"$",
"context",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
... | Validate the Request or Response
@param \SwaggerValidator\Common\Context $context
@return boolean | [
"Validate",
"the",
"Request",
"or",
"Response"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L117-L139 |
222,270 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.checkSwaggerVersion | protected function checkSwaggerVersion(\SwaggerValidator\Common\Context $context)
{
if ($context->getDataValue() != '2.0') {
return $context->setValidationError(\SwaggerValidator\CustomIOHelper::VALIDATION_TYPE_SWAGGER_ERROR, 'Bad swagger version', __METHOD__, __LINE__);
}
... | php | protected function checkSwaggerVersion(\SwaggerValidator\Common\Context $context)
{
if ($context->getDataValue() != '2.0') {
return $context->setValidationError(\SwaggerValidator\CustomIOHelper::VALIDATION_TYPE_SWAGGER_ERROR, 'Bad swagger version', __METHOD__, __LINE__);
}
... | [
"protected",
"function",
"checkSwaggerVersion",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"context",
"->",
"getDataValue",
"(",
")",
"!=",
"'2.0'",
")",
"{",
"return",
"$",
"context",
"->",
"s... | Check the Swagger Version for validate method
@param \SwaggerValidator\Common\Context $context
@return boolean | [
"Check",
"the",
"Swagger",
"Version",
"for",
"validate",
"method"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L219-L226 |
222,271 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.checkSchemes | protected function checkSchemes(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->schemes)) {
return true;
}
foreach ($this->schemes as $oneScheme) {
if (strtolower($context->getDataValue()) && strtolower($oneScheme)) {
return tru... | php | protected function checkSchemes(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->schemes)) {
return true;
}
foreach ($this->schemes as $oneScheme) {
if (strtolower($context->getDataValue()) && strtolower($oneScheme)) {
return tru... | [
"protected",
"function",
"checkSchemes",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"schemes",
")",
")",
"{",
"return",
"true",
";",
"}",
"foreach",
"(",
"$... | Check the scheme used in the request URL for validate method
@param \SwaggerValidator\Common\Context $context
@return boolean | [
"Check",
"the",
"scheme",
"used",
"in",
"the",
"request",
"URL",
"for",
"validate",
"method"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L233-L246 |
222,272 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.checkHost | protected function checkHost(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->host)) {
return true;
}
if ($context->getDataValue() === null) {
return true;
}
if (strtolower($context->getDataValue()) && strtolower($this->host))... | php | protected function checkHost(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->host)) {
return true;
}
if ($context->getDataValue() === null) {
return true;
}
if (strtolower($context->getDataValue()) && strtolower($this->host))... | [
"protected",
"function",
"checkHost",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"host",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"$",
"conte... | Check the host used in the request URL for validate method
@param \SwaggerValidator\Common\Context $context
@return boolean | [
"Check",
"the",
"host",
"used",
"in",
"the",
"request",
"URL",
"for",
"validate",
"method"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L253-L268 |
222,273 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.checkBasePath | protected function checkBasePath(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->basePath) || $this->basePath == '/') {
$context->setBasePath(null);
$context->setRequestPath($context->getDataValue());
return $context;
}
if (substr($... | php | protected function checkBasePath(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->basePath) || $this->basePath == '/') {
$context->setBasePath(null);
$context->setRequestPath($context->getDataValue());
return $context;
}
if (substr($... | [
"protected",
"function",
"checkBasePath",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"basePath",
")",
"||",
"$",
"this",
"->",
"basePath",
"==",
"'/'",
")",
... | Check the basePath used in the request URL for validate method
@param \SwaggerValidator\Common\Context $context
@return \SwaggerValidator\Common\Context | [
"Check",
"the",
"basePath",
"used",
"in",
"the",
"request",
"URL",
"for",
"validate",
"method"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L275-L291 |
222,274 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.checkConsume | protected function checkConsume(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->consume)) {
return true;
}
$headers = $context->getRequestHeader();
$contentType = null;
$contentLength = 0;
if (array_key_exists('Content-Ty... | php | protected function checkConsume(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->consume)) {
return true;
}
$headers = $context->getRequestHeader();
$contentType = null;
$contentLength = 0;
if (array_key_exists('Content-Ty... | [
"protected",
"function",
"checkConsume",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"consume",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"headers",
"=... | Check the Content-Type used in the request regarding the consume definition for validate method
@param \SwaggerValidator\Common\Context $context
@return boolean | [
"Check",
"the",
"Content",
"-",
"Type",
"used",
"in",
"the",
"request",
"regarding",
"the",
"consume",
"definition",
"for",
"validate",
"method"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L298-L331 |
222,275 | nabbar/SwaggerValidator-PHP | src/Object/Swagger.php | Swagger.getModel | public function getModel(\SwaggerValidator\Common\Context $context)
{
$generalItems = $this->getMethodGeneric($context, __FUNCTION__);
$paths = \SwaggerValidator\Common\FactorySwagger::KEY_PATHS;
$context->logModel(__METHOD__, __LINE__);
return $this->$paths->getModel($... | php | public function getModel(\SwaggerValidator\Common\Context $context)
{
$generalItems = $this->getMethodGeneric($context, __FUNCTION__);
$paths = \SwaggerValidator\Common\FactorySwagger::KEY_PATHS;
$context->logModel(__METHOD__, __LINE__);
return $this->$paths->getModel($... | [
"public",
"function",
"getModel",
"(",
"\\",
"SwaggerValidator",
"\\",
"Common",
"\\",
"Context",
"$",
"context",
")",
"{",
"$",
"generalItems",
"=",
"$",
"this",
"->",
"getMethodGeneric",
"(",
"$",
"context",
",",
"__FUNCTION__",
")",
";",
"$",
"paths",
"... | Build a model following current definition instancied
@param \SwaggerValidator\Common\Context $context
@return array | [
"Build",
"a",
"model",
"following",
"current",
"definition",
"instancied"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Object/Swagger.php#L431-L438 |
222,276 | adshares/ads-php-client | src/Driver/CommandError.php | CommandError.getMessageByCode | public static function getMessageByCode(int $code): string
{
return (array_key_exists($code, self::MESSAGES)) ? self::MESSAGES[$code] : self::MESSAGES[self::UNKNOWN_ERROR];
} | php | public static function getMessageByCode(int $code): string
{
return (array_key_exists($code, self::MESSAGES)) ? self::MESSAGES[$code] : self::MESSAGES[self::UNKNOWN_ERROR];
} | [
"public",
"static",
"function",
"getMessageByCode",
"(",
"int",
"$",
"code",
")",
":",
"string",
"{",
"return",
"(",
"array_key_exists",
"(",
"$",
"code",
",",
"self",
"::",
"MESSAGES",
")",
")",
"?",
"self",
"::",
"MESSAGES",
"[",
"$",
"code",
"]",
":... | Returns error description for given code.
@param int $code error code
@return string error message | [
"Returns",
"error",
"description",
"for",
"given",
"code",
"."
] | b9a897219dfa60a316a29191dbeb836c5e1aa760 | https://github.com/adshares/ads-php-client/blob/b9a897219dfa60a316a29191dbeb836c5e1aa760/src/Driver/CommandError.php#L193-L196 |
222,277 | adshares/ads-php-client | src/Driver/CommandError.php | CommandError.getCodeByMessage | public static function getCodeByMessage(string $errorMessage): int
{
$code = array_search($errorMessage, self::MESSAGES);
if ($code === false) {
$code = self::UNKNOWN_ERROR;
}
return (int)$code;
} | php | public static function getCodeByMessage(string $errorMessage): int
{
$code = array_search($errorMessage, self::MESSAGES);
if ($code === false) {
$code = self::UNKNOWN_ERROR;
}
return (int)$code;
} | [
"public",
"static",
"function",
"getCodeByMessage",
"(",
"string",
"$",
"errorMessage",
")",
":",
"int",
"{",
"$",
"code",
"=",
"array_search",
"(",
"$",
"errorMessage",
",",
"self",
"::",
"MESSAGES",
")",
";",
"if",
"(",
"$",
"code",
"===",
"false",
")"... | Returns error code from given error message.
@param string $errorMessage error message
@return int error code | [
"Returns",
"error",
"code",
"from",
"given",
"error",
"message",
"."
] | b9a897219dfa60a316a29191dbeb836c5e1aa760 | https://github.com/adshares/ads-php-client/blob/b9a897219dfa60a316a29191dbeb836c5e1aa760/src/Driver/CommandError.php#L204-L211 |
222,278 | adshares/ads-php-client | src/Util/AdsValidator.php | AdsValidator.isAccountAddressValid | public static function isAccountAddressValid(string $address): bool
{
// validate format
if (1 === preg_match('/^[0-9a-fA-F]{4}-[0-9a-fA-F]{8}-([0-9a-fA-F]{4}|XXXX)$/', $address)) {
// validate checksum
$checksum = strtoupper(substr($address, -4));
if ('XXXX' === ... | php | public static function isAccountAddressValid(string $address): bool
{
// validate format
if (1 === preg_match('/^[0-9a-fA-F]{4}-[0-9a-fA-F]{8}-([0-9a-fA-F]{4}|XXXX)$/', $address)) {
// validate checksum
$checksum = strtoupper(substr($address, -4));
if ('XXXX' === ... | [
"public",
"static",
"function",
"isAccountAddressValid",
"(",
"string",
"$",
"address",
")",
":",
"bool",
"{",
"// validate format",
"if",
"(",
"1",
"===",
"preg_match",
"(",
"'/^[0-9a-fA-F]{4}-[0-9a-fA-F]{8}-([0-9a-fA-F]{4}|XXXX)$/'",
",",
"$",
"address",
")",
")",
... | Checks, if account address is in proper format.
@param string $address account address
@return bool true if address is valid, false otherwise | [
"Checks",
"if",
"account",
"address",
"is",
"in",
"proper",
"format",
"."
] | b9a897219dfa60a316a29191dbeb836c5e1aa760 | https://github.com/adshares/ads-php-client/blob/b9a897219dfa60a316a29191dbeb836c5e1aa760/src/Util/AdsValidator.php#L36-L52 |
222,279 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.setConfigDropAllDebugLog | public static function setConfigDropAllDebugLog()
{
self::setConfig('log', 'loadFile', false);
self::setConfig('log', 'loadRef', false);
self::setConfig('log', 'replaceRef', false);
self::setConfig('log', 'registerRef', false);
self::setConfig('log', 'dropRef', false);
... | php | public static function setConfigDropAllDebugLog()
{
self::setConfig('log', 'loadFile', false);
self::setConfig('log', 'loadRef', false);
self::setConfig('log', 'replaceRef', false);
self::setConfig('log', 'registerRef', false);
self::setConfig('log', 'dropRef', false);
... | [
"public",
"static",
"function",
"setConfigDropAllDebugLog",
"(",
")",
"{",
"self",
"::",
"setConfig",
"(",
"'log'",
",",
"'loadFile'",
",",
"false",
")",
";",
"self",
"::",
"setConfig",
"(",
"'log'",
",",
"'loadRef'",
",",
"false",
")",
";",
"self",
"::",
... | Method to disable all debug log | [
"Method",
"to",
"disable",
"all",
"debug",
"log"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L143-L157 |
222,280 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.getConfig | public static function getConfig($optionGroup, $optionName)
{
if (!array_key_exists($optionGroup, self::$config) || !is_array(self::$config[$optionGroup])) {
return;
}
if (!array_key_exists($optionName, self::$config[$optionGroup])) {
return;
}
retur... | php | public static function getConfig($optionGroup, $optionName)
{
if (!array_key_exists($optionGroup, self::$config) || !is_array(self::$config[$optionGroup])) {
return;
}
if (!array_key_exists($optionName, self::$config[$optionGroup])) {
return;
}
retur... | [
"public",
"static",
"function",
"getConfig",
"(",
"$",
"optionGroup",
",",
"$",
"optionName",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"optionGroup",
",",
"self",
"::",
"$",
"config",
")",
"||",
"!",
"is_array",
"(",
"self",
"::",
"$",
"... | Retrieve a config value
@param string $optionGroup
@param string $optionName
@return mixed | [
"Retrieve",
"a",
"config",
"value"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L165-L176 |
222,281 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.checkDataIsEmpty | public function checkDataIsEmpty()
{
if ($this->isDataExists() === false) {
$this->contextDataEmpty = true;
}
elseif (is_object($this->getDataValue())) {
$this->contextDataEmpty = false;
}
elseif (is_array($this->getDataValue())) {
$this->c... | php | public function checkDataIsEmpty()
{
if ($this->isDataExists() === false) {
$this->contextDataEmpty = true;
}
elseif (is_object($this->getDataValue())) {
$this->contextDataEmpty = false;
}
elseif (is_array($this->getDataValue())) {
$this->c... | [
"public",
"function",
"checkDataIsEmpty",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDataExists",
"(",
")",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"contextDataEmpty",
"=",
"true",
";",
"}",
"elseif",
"(",
"is_object",
"(",
"$",
"this",
"->",... | Check if the loaded data are empty or not | [
"Check",
"if",
"the",
"loaded",
"data",
"are",
"empty",
"or",
"not"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L195-L215 |
222,282 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.dataLoad | public function dataLoad()
{
$paramName = $this->__get('DataPath');
$paramName = array_pop($paramName);
$this->contextDataExists = false;
$this->contextDataValue = null;
if ($paramName === \SwaggerValidator\Common\FactorySwagger::LOCATION_BODY && $this->getType() === self:... | php | public function dataLoad()
{
$paramName = $this->__get('DataPath');
$paramName = array_pop($paramName);
$this->contextDataExists = false;
$this->contextDataValue = null;
if ($paramName === \SwaggerValidator\Common\FactorySwagger::LOCATION_BODY && $this->getType() === self:... | [
"public",
"function",
"dataLoad",
"(",
")",
"{",
"$",
"paramName",
"=",
"$",
"this",
"->",
"__get",
"(",
"'DataPath'",
")",
";",
"$",
"paramName",
"=",
"array_pop",
"(",
"$",
"paramName",
")",
";",
"$",
"this",
"->",
"contextDataExists",
"=",
"false",
... | Load data and check it based on local context definition
@return void | [
"Load",
"data",
"and",
"check",
"it",
"based",
"on",
"local",
"context",
"definition"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L238-L280 |
222,283 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadRequestFormData | public function loadRequestFormData($paramName)
{
if (array_key_exists($paramName, $_POST)) {
$this->contextDataExists = true;
$this->contextDataValue = $_POST[$paramName];
}
elseif (array_key_exists($paramName, $_FILES)) {
$this->contextDataExists = true... | php | public function loadRequestFormData($paramName)
{
if (array_key_exists($paramName, $_POST)) {
$this->contextDataExists = true;
$this->contextDataValue = $_POST[$paramName];
}
elseif (array_key_exists($paramName, $_FILES)) {
$this->contextDataExists = true... | [
"public",
"function",
"loadRequestFormData",
"(",
"$",
"paramName",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"paramName",
",",
"$",
"_POST",
")",
")",
"{",
"$",
"this",
"->",
"contextDataExists",
"=",
"true",
";",
"$",
"this",
"->",
"contextDataV... | Filtering the request form data and files,
load the data and check it
@param string $paramName
@return void | [
"Filtering",
"the",
"request",
"form",
"data",
"and",
"files",
"load",
"the",
"data",
"and",
"check",
"it"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L308-L320 |
222,284 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadRequestPath | public function loadRequestPath($paramName)
{
// parse from the end to the top
$path = array_reverse(explode('/', $this->contextRequestPath));
/**
* -1 => current params
* -2 => method
* -3 => route
*/
$datapath = $this->__get('DataPath');
... | php | public function loadRequestPath($paramName)
{
// parse from the end to the top
$path = array_reverse(explode('/', $this->contextRequestPath));
/**
* -1 => current params
* -2 => method
* -3 => route
*/
$datapath = $this->__get('DataPath');
... | [
"public",
"function",
"loadRequestPath",
"(",
"$",
"paramName",
")",
"{",
"// parse from the end to the top",
"$",
"path",
"=",
"array_reverse",
"(",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"contextRequestPath",
")",
")",
";",
"/**\n * -1 => current p... | Filtering the request path to identify the path parameters,
load the data and check it
@param string $paramName
@return void | [
"Filtering",
"the",
"request",
"path",
"to",
"identify",
"the",
"path",
"parameters",
"load",
"the",
"data",
"and",
"check",
"it"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L328-L374 |
222,285 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.getRequestQueryKey | public function getRequestQueryKey()
{
$uri = explode('?', $this->getEnv('REQUEST_URI'));
array_shift($uri);
parse_str(implode('?', $uri), $qrs);
return array_keys($qrs);
} | php | public function getRequestQueryKey()
{
$uri = explode('?', $this->getEnv('REQUEST_URI'));
array_shift($uri);
parse_str(implode('?', $uri), $qrs);
return array_keys($qrs);
} | [
"public",
"function",
"getRequestQueryKey",
"(",
")",
"{",
"$",
"uri",
"=",
"explode",
"(",
"'?'",
",",
"$",
"this",
"->",
"getEnv",
"(",
"'REQUEST_URI'",
")",
")",
";",
"array_shift",
"(",
"$",
"uri",
")",
";",
"parse_str",
"(",
"implode",
"(",
"'?'",... | return the complete list of all params send in query string
@return array | [
"return",
"the",
"complete",
"list",
"of",
"all",
"params",
"send",
"in",
"query",
"string"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L380-L388 |
222,286 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadRequestQuery | public function loadRequestQuery($paramName)
{
$uri = explode('?', $this->getEnv('REQUEST_URI'));
array_shift($uri);
$uri = implode('?', $uri);
/**
* Override this method to use parsing query string PHP method
* and not new standard of queryString
*/
... | php | public function loadRequestQuery($paramName)
{
$uri = explode('?', $this->getEnv('REQUEST_URI'));
array_shift($uri);
$uri = implode('?', $uri);
/**
* Override this method to use parsing query string PHP method
* and not new standard of queryString
*/
... | [
"public",
"function",
"loadRequestQuery",
"(",
"$",
"paramName",
")",
"{",
"$",
"uri",
"=",
"explode",
"(",
"'?'",
",",
"$",
"this",
"->",
"getEnv",
"(",
"'REQUEST_URI'",
")",
")",
";",
"array_shift",
"(",
"$",
"uri",
")",
";",
"$",
"uri",
"=",
"impl... | Filtering the request querystring, load the data and check it
@param string $paramName
@return void | [
"Filtering",
"the",
"request",
"querystring",
"load",
"the",
"data",
"and",
"check",
"it"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L395-L413 |
222,287 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadRequestHeader | public function loadRequestHeader($paramName)
{
$headers = $this->getRequestHeader();
if (array_key_exists($paramName, $headers)) {
$this->contextDataExists = true;
$this->contextDataValue = $headers[$paramName];
}
return $this->checkDataIsEmpty();
} | php | public function loadRequestHeader($paramName)
{
$headers = $this->getRequestHeader();
if (array_key_exists($paramName, $headers)) {
$this->contextDataExists = true;
$this->contextDataValue = $headers[$paramName];
}
return $this->checkDataIsEmpty();
} | [
"public",
"function",
"loadRequestHeader",
"(",
"$",
"paramName",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"getRequestHeader",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"paramName",
",",
"$",
"headers",
")",
")",
"{",
"$",
"this",
... | Filtering the request header, load the data and check it
@param string $paramName
@return void | [
"Filtering",
"the",
"request",
"header",
"load",
"the",
"data",
"and",
"check",
"it"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L458-L468 |
222,288 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadResponseHeader | public function loadResponseHeader($paramName)
{
$headers = $this->getResponseHeader();
if (array_key_exists($paramName, $headers)) {
$this->contextDataExists = true;
$this->contextDataValue = $headers[$paramName];
}
return $this->checkDataIsEmpty();
} | php | public function loadResponseHeader($paramName)
{
$headers = $this->getResponseHeader();
if (array_key_exists($paramName, $headers)) {
$this->contextDataExists = true;
$this->contextDataValue = $headers[$paramName];
}
return $this->checkDataIsEmpty();
} | [
"public",
"function",
"loadResponseHeader",
"(",
"$",
"paramName",
")",
"{",
"$",
"headers",
"=",
"$",
"this",
"->",
"getResponseHeader",
"(",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"paramName",
",",
"$",
"headers",
")",
")",
"{",
"$",
"this"... | Filtering the response header, load the data and check it
@param string $paramName
@return void | [
"Filtering",
"the",
"response",
"header",
"load",
"the",
"data",
"and",
"check",
"it"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L475-L485 |
222,289 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadRequestBody | public function loadRequestBody()
{
if (array_key_exists('php://input', $this->mockedData)) {
$this->loadBodyByContent($this->getRequestHeader(), $this->mockedData['php://input']);
}
else {
$this->loadBodyByContent($this->getRequestHeader(), file_get_contents("php://i... | php | public function loadRequestBody()
{
if (array_key_exists('php://input', $this->mockedData)) {
$this->loadBodyByContent($this->getRequestHeader(), $this->mockedData['php://input']);
}
else {
$this->loadBodyByContent($this->getRequestHeader(), file_get_contents("php://i... | [
"public",
"function",
"loadRequestBody",
"(",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'php://input'",
",",
"$",
"this",
"->",
"mockedData",
")",
")",
"{",
"$",
"this",
"->",
"loadBodyByContent",
"(",
"$",
"this",
"->",
"getRequestHeader",
"(",
")",
... | Method to load Request body identify by his content type header
And only if a content length is defined and > 0
@return void | [
"Method",
"to",
"load",
"Request",
"body",
"identify",
"by",
"his",
"content",
"type",
"header",
"And",
"only",
"if",
"a",
"content",
"length",
"is",
"defined",
"and",
">",
"0"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L492-L500 |
222,290 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.loadResponseBody | public function loadResponseBody()
{
if (array_key_exists('php://output', $this->mockedData)) {
$this->loadBodyByContent($this->getResponseHeader(), $this->mockedData['php://output']);
}
else {
$this->loadBodyByContent($this->getResponseHeader(), file_get_contents("ph... | php | public function loadResponseBody()
{
if (array_key_exists('php://output', $this->mockedData)) {
$this->loadBodyByContent($this->getResponseHeader(), $this->mockedData['php://output']);
}
else {
$this->loadBodyByContent($this->getResponseHeader(), file_get_contents("ph... | [
"public",
"function",
"loadResponseBody",
"(",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'php://output'",
",",
"$",
"this",
"->",
"mockedData",
")",
")",
"{",
"$",
"this",
"->",
"loadBodyByContent",
"(",
"$",
"this",
"->",
"getResponseHeader",
"(",
")",... | Method to load Response body identify by his content type header
And only if a content length is defined and > 0 | [
"Method",
"to",
"load",
"Response",
"body",
"identify",
"by",
"his",
"content",
"type",
"header",
"And",
"only",
"if",
"a",
"content",
"length",
"is",
"defined",
"and",
">",
"0"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L506-L514 |
222,291 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.buildBodyJson | public function buildBodyJson($contents)
{
$this->contextDataType = self::CONTENT_TYPE_JSON;
$this->contextDataExists = (bool) (strlen($contents) > 0);
$this->contextDataValue = json_decode($contents, false);
if (json_last_error() !== JSON_ERROR_NONE) {
$this->context... | php | public function buildBodyJson($contents)
{
$this->contextDataType = self::CONTENT_TYPE_JSON;
$this->contextDataExists = (bool) (strlen($contents) > 0);
$this->contextDataValue = json_decode($contents, false);
if (json_last_error() !== JSON_ERROR_NONE) {
$this->context... | [
"public",
"function",
"buildBodyJson",
"(",
"$",
"contents",
")",
"{",
"$",
"this",
"->",
"contextDataType",
"=",
"self",
"::",
"CONTENT_TYPE_JSON",
";",
"$",
"this",
"->",
"contextDataExists",
"=",
"(",
"bool",
")",
"(",
"strlen",
"(",
"$",
"contents",
")... | Method to build the body mixed data from a JSON Raw Body
@param string $contents | [
"Method",
"to",
"build",
"the",
"body",
"mixed",
"data",
"from",
"a",
"JSON",
"Raw",
"Body"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L559-L578 |
222,292 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.buildBodyXml | public function buildBodyXml($contents)
{
$this->contextDataType = self::CONTENT_TYPE_XML;
$this->contextDataExists = (bool) (strlen($contents) > 0);
$this->contextDataValue = simplexml_load_string($contents);
if ($this->contextDataValue === false) {
$this->contextDat... | php | public function buildBodyXml($contents)
{
$this->contextDataType = self::CONTENT_TYPE_XML;
$this->contextDataExists = (bool) (strlen($contents) > 0);
$this->contextDataValue = simplexml_load_string($contents);
if ($this->contextDataValue === false) {
$this->contextDat... | [
"public",
"function",
"buildBodyXml",
"(",
"$",
"contents",
")",
"{",
"$",
"this",
"->",
"contextDataType",
"=",
"self",
"::",
"CONTENT_TYPE_XML",
";",
"$",
"this",
"->",
"contextDataExists",
"=",
"(",
"bool",
")",
"(",
"strlen",
"(",
"$",
"contents",
")",... | Method to build the body mixed data from a XML Raw Body
@param string $contents | [
"Method",
"to",
"build",
"the",
"body",
"mixed",
"data",
"from",
"a",
"XML",
"Raw",
"Body"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L584-L630 |
222,293 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.setSandBox | public function setSandBox()
{
if ($this->getType() !== self::TYPE_REQUEST) {
return $this;
}
$last = $this->getLastDataPath();
$last = array_pop($last);
switch ($this->getLocation()) {
case \SwaggerValidator\Common\FactorySwagger::LOCATION_BODY:
... | php | public function setSandBox()
{
if ($this->getType() !== self::TYPE_REQUEST) {
return $this;
}
$last = $this->getLastDataPath();
$last = array_pop($last);
switch ($this->getLocation()) {
case \SwaggerValidator\Common\FactorySwagger::LOCATION_BODY:
... | [
"public",
"function",
"setSandBox",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
"!==",
"self",
"::",
"TYPE_REQUEST",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"last",
"=",
"$",
"this",
"->",
"getLastDataPath",
"(",
")",
... | Adding validated params to check
This method improve the TOOMANY errors at the end
of the validation process
@return \SwaggerValidator\Common\Context | [
"Adding",
"validated",
"params",
"to",
"check",
"This",
"method",
"improve",
"the",
"TOOMANY",
"errors",
"at",
"the",
"end",
"of",
"the",
"validation",
"process"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L656-L688 |
222,294 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.getRequestDataKeys | public function getRequestDataKeys()
{
if ($this->getType() !== self::TYPE_REQUEST) {
return array();
}
if (array_key_exists('php://input', $this->mockedData)) {
$data = $this->mockedData['php://input'];
}
else {
$data = file_get_contents(... | php | public function getRequestDataKeys()
{
if ($this->getType() !== self::TYPE_REQUEST) {
return array();
}
if (array_key_exists('php://input', $this->mockedData)) {
$data = $this->mockedData['php://input'];
}
else {
$data = file_get_contents(... | [
"public",
"function",
"getRequestDataKeys",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
"!==",
"self",
"::",
"TYPE_REQUEST",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"'php://input'",
",",
... | Method to list all received params name by location
@return array | [
"Method",
"to",
"list",
"all",
"received",
"params",
"name",
"by",
"location"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L694-L712 |
222,295 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.getEnv | public function getEnv($name)
{
if (array_key_exists($name, $this->mockedData)) {
return $this->mockedData[$name];
}
return getenv($name);
} | php | public function getEnv($name)
{
if (array_key_exists($name, $this->mockedData)) {
return $this->mockedData[$name];
}
return getenv($name);
} | [
"public",
"function",
"getEnv",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"mockedData",
")",
")",
"{",
"return",
"$",
"this",
"->",
"mockedData",
"[",
"$",
"name",
"]",
";",
"}",
"return",
... | Method to add capability of override the getenv function of PHP
for example to get env data in a sandbox
@param string $name
@return mixed | [
"Method",
"to",
"add",
"capability",
"of",
"override",
"the",
"getenv",
"function",
"of",
"PHP",
"for",
"example",
"to",
"get",
"env",
"data",
"in",
"a",
"sandbox"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L730-L737 |
222,296 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.mock | public function mock($options = array())
{
$this->mockedData = $options;
if (empty($this->mockedData) || !is_array($this->mockedData)) {
$this->mockedData = array();
}
} | php | public function mock($options = array())
{
$this->mockedData = $options;
if (empty($this->mockedData) || !is_array($this->mockedData)) {
$this->mockedData = array();
}
} | [
"public",
"function",
"mock",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"this",
"->",
"mockedData",
"=",
"$",
"options",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"mockedData",
")",
"||",
"!",
"is_array",
"(",
"$",
"this",
... | Method to define a batch of data to be used to
simulate the playback of external data
@param array $options | [
"Method",
"to",
"define",
"a",
"batch",
"of",
"data",
"to",
"be",
"used",
"to",
"simulate",
"the",
"playback",
"of",
"external",
"data"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L772-L779 |
222,297 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.cleanParams | public function cleanParams()
{
$_GET = array();
$_POST = array();
$_FILES = array();
$_COOKIE = array();
foreach ($this->getRequestHeader() as $key) {
if (array_key_exists($key, $_SERVER)) {
unset($_SERVER[$key]);
}
}
... | php | public function cleanParams()
{
$_GET = array();
$_POST = array();
$_FILES = array();
$_COOKIE = array();
foreach ($this->getRequestHeader() as $key) {
if (array_key_exists($key, $_SERVER)) {
unset($_SERVER[$key]);
}
}
... | [
"public",
"function",
"cleanParams",
"(",
")",
"{",
"$",
"_GET",
"=",
"array",
"(",
")",
";",
"$",
"_POST",
"=",
"array",
"(",
")",
";",
"$",
"_FILES",
"=",
"array",
"(",
")",
";",
"$",
"_COOKIE",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$... | Used to clean params if validation error occured for mode PASS | [
"Used",
"to",
"clean",
"params",
"if",
"validation",
"error",
"occured",
"for",
"mode",
"PASS"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L784-L796 |
222,298 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.logLoadFile | public function logLoadFile($file, $method = null, $line = null)
{
if (self::getConfig('log', 'loadFile')) {
$this->logMessage('LOAD FILE', 'Loading File : "' . $file . '"', $method, $line);
}
} | php | public function logLoadFile($file, $method = null, $line = null)
{
if (self::getConfig('log', 'loadFile')) {
$this->logMessage('LOAD FILE', 'Loading File : "' . $file . '"', $method, $line);
}
} | [
"public",
"function",
"logLoadFile",
"(",
"$",
"file",
",",
"$",
"method",
"=",
"null",
",",
"$",
"line",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"getConfig",
"(",
"'log'",
",",
"'loadFile'",
")",
")",
"{",
"$",
"this",
"->",
"logMessage",
... | Log loading file
@param string $file
@param string $method
@param int $line | [
"Log",
"loading",
"file"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L804-L809 |
222,299 | nabbar/SwaggerValidator-PHP | src/Common/Context.php | Context.logDecode | public function logDecode($className, $method = null, $line = null)
{
if (self::getConfig('log', 'decode')) {
$this->logMessage('DECODE', 'Decoding Path "' . $this->getDataPath() . '" As "' . $className . '"', $method, $line);
}
} | php | public function logDecode($className, $method = null, $line = null)
{
if (self::getConfig('log', 'decode')) {
$this->logMessage('DECODE', 'Decoding Path "' . $this->getDataPath() . '" As "' . $className . '"', $method, $line);
}
} | [
"public",
"function",
"logDecode",
"(",
"$",
"className",
",",
"$",
"method",
"=",
"null",
",",
"$",
"line",
"=",
"null",
")",
"{",
"if",
"(",
"self",
"::",
"getConfig",
"(",
"'log'",
",",
"'decode'",
")",
")",
"{",
"$",
"this",
"->",
"logMessage",
... | Log a decoding json mixed data as SwaggerValidator PHP object
@param string $decodePath
@param string $decodeType
@param string $method
@param int $line | [
"Log",
"a",
"decoding",
"json",
"mixed",
"data",
"as",
"SwaggerValidator",
"PHP",
"object"
] | c3518c53beed71b653a98ea7d56bd12a580d5aa8 | https://github.com/nabbar/SwaggerValidator-PHP/blob/c3518c53beed71b653a98ea7d56bd12a580d5aa8/src/Common/Context.php#L818-L823 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.