repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
lode/fem | src/routing.php | routing.find_custom_handler | private function find_custom_handler() {
// get user defined routes
$routes = $this->get_custom_routes();
if (empty($routes) || empty($routes[$this->method])) {
return false;
}
// catch the non-regex routes first
if (isset($routes[$this->method][$this->url])) {
return $routes[$this->method][$this->url];
}
... | php | private function find_custom_handler() {
// get user defined routes
$routes = $this->get_custom_routes();
if (empty($routes) || empty($routes[$this->method])) {
return false;
}
// catch the non-regex routes first
if (isset($routes[$this->method][$this->url])) {
return $routes[$this->method][$this->url];
}
... | [
"private",
"function",
"find_custom_handler",
"(",
")",
"{",
"// get user defined routes",
"$",
"routes",
"=",
"$",
"this",
"->",
"get_custom_routes",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"routes",
")",
"||",
"empty",
"(",
"$",
"routes",
"[",
"$",
... | matches the user defined routes
@return mixed $handler see get_handler_type() | [
"matches",
"the",
"user",
"defined",
"routes"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/routing.php#L207-L234 |
lode/fem | src/routing.php | routing.get_handler_type | private function get_handler_type($handler) {
if ($handler instanceof \Closure) {
return 'function';
}
if (is_string($handler) == false) {
return false;
}
if (strpos($handler, '->')) {
return 'method';
}
if (strpos($handler, '::')) {
return 'static';
}
if ($handler && $this->find_handler_path($handle... | php | private function get_handler_type($handler) {
if ($handler instanceof \Closure) {
return 'function';
}
if (is_string($handler) == false) {
return false;
}
if (strpos($handler, '->')) {
return 'method';
}
if (strpos($handler, '::')) {
return 'static';
}
if ($handler && $this->find_handler_path($handle... | [
"private",
"function",
"get_handler_type",
"(",
"$",
"handler",
")",
"{",
"if",
"(",
"$",
"handler",
"instanceof",
"\\",
"Closure",
")",
"{",
"return",
"'function'",
";",
"}",
"if",
"(",
"is_string",
"(",
"$",
"handler",
")",
"==",
"false",
")",
"{",
"... | figure out how to run the given handler
there are a few different handlers formats:
- function: an inline function directly handling the request
@note it can call handle() with a new handler of another type ..
.. this might be useful for database lookups
- method: a method in the format of 'class->method'
the clas... | [
"figure",
"out",
"how",
"to",
"run",
"the",
"given",
"handler"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/routing.php#L258-L277 |
lode/fem | src/routing.php | routing.load_handler_as_method | private function load_handler_as_method($handler) {
list($class, $method) = explode('->', $handler);
$object = new $class;
$object->$method($this->url, $this->method, $this->arguments);
} | php | private function load_handler_as_method($handler) {
list($class, $method) = explode('->', $handler);
$object = new $class;
$object->$method($this->url, $this->method, $this->arguments);
} | [
"private",
"function",
"load_handler_as_method",
"(",
"$",
"handler",
")",
"{",
"list",
"(",
"$",
"class",
",",
"$",
"method",
")",
"=",
"explode",
"(",
"'->'",
",",
"$",
"handler",
")",
";",
"$",
"object",
"=",
"new",
"$",
"class",
";",
"$",
"object... | instantiated method handler
@param string $handler
@return void, the method is called on the object | [
"instantiated",
"method",
"handler"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/routing.php#L295-L300 |
lode/fem | src/routing.php | routing.load_handler_as_static | private function load_handler_as_static($handler) {
list($class, $method) = explode('::', $handler);
$class::$method($this->url, $this->method, $this->arguments);
} | php | private function load_handler_as_static($handler) {
list($class, $method) = explode('::', $handler);
$class::$method($this->url, $this->method, $this->arguments);
} | [
"private",
"function",
"load_handler_as_static",
"(",
"$",
"handler",
")",
"{",
"list",
"(",
"$",
"class",
",",
"$",
"method",
")",
"=",
"explode",
"(",
"'::'",
",",
"$",
"handler",
")",
";",
"$",
"class",
"::",
"$",
"method",
"(",
"$",
"this",
"->",... | static method handler
@param string $handler
@return void, the method is called on the class | [
"static",
"method",
"handler"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/routing.php#L308-L312 |
lode/fem | src/routing.php | routing.load_handler_as_file | private function load_handler_as_file($handler) {
$path = $this->find_handler_path($handler);
require_once $path;
$class_name = str_replace('/', '\\', $handler);
if ($this->auto_instantiation && is_callable($class_name)) {
new $class_name($this->url, $this->method, $this->arguments);
}
} | php | private function load_handler_as_file($handler) {
$path = $this->find_handler_path($handler);
require_once $path;
$class_name = str_replace('/', '\\', $handler);
if ($this->auto_instantiation && is_callable($class_name)) {
new $class_name($this->url, $this->method, $this->arguments);
}
} | [
"private",
"function",
"load_handler_as_file",
"(",
"$",
"handler",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"find_handler_path",
"(",
"$",
"handler",
")",
";",
"require_once",
"$",
"path",
";",
"$",
"class_name",
"=",
"str_replace",
"(",
"'/'",
",",... | file reference handler
@param string $handler
@return void, the file is included
a inner class is instantiated if $this->auto_instantiation is true | [
"file",
"reference",
"handler"
] | train | https://github.com/lode/fem/blob/c1c466c1a904d99452b341c5ae7cbc3e22b106e1/src/routing.php#L321-L329 |
yuncms/framework | src/admin/migrations/m180324_103503_create_admin_menu_table.php | m180324_103503_create_admin_menu_table.safeUp | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | php | public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE=Inn... | [
"public",
"function",
"safeUp",
"(",
")",
"{",
"$",
"tableOptions",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"db",
"->",
"driverName",
"===",
"'mysql'",
")",
"{",
"// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-... | {@inheritdoc} | [
"{"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/migrations/m180324_103503_create_admin_menu_table.php#L19-L113 |
PeekAndPoke/psi | src/Operation/Intermediate/EmptyIntermediateOp.php | EmptyIntermediateOp.apply | public function apply($input, $index, IntermediateContext $context)
{
$context->outUseItem = true;
$context->outCanContinue = true;
// return the input unmodified
return $input;
} | php | public function apply($input, $index, IntermediateContext $context)
{
$context->outUseItem = true;
$context->outCanContinue = true;
// return the input unmodified
return $input;
} | [
"public",
"function",
"apply",
"(",
"$",
"input",
",",
"$",
"index",
",",
"IntermediateContext",
"$",
"context",
")",
"{",
"$",
"context",
"->",
"outUseItem",
"=",
"true",
";",
"$",
"context",
"->",
"outCanContinue",
"=",
"true",
";",
"// return the input un... | {@inheritdoc} | [
"{"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Operation/Intermediate/EmptyIntermediateOp.php#L23-L30 |
devemio/php-readable-timer | src/Timer.php | Timer.stop | public function stop()
{
$time = microtime(true);
$this->time += $time - $this->start;
$this->start = $time;
return $this;
} | php | public function stop()
{
$time = microtime(true);
$this->time += $time - $this->start;
$this->start = $time;
return $this;
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"$",
"time",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"this",
"->",
"time",
"+=",
"$",
"time",
"-",
"$",
"this",
"->",
"start",
";",
"$",
"this",
"->",
"start",
"=",
"$",
"time",
";",
"return",
... | Stop the timer.
@return $this | [
"Stop",
"the",
"timer",
"."
] | train | https://github.com/devemio/php-readable-timer/blob/50916b630eda07999dc6676528afe59fb2105615/src/Timer.php#L60-L66 |
devemio/php-readable-timer | src/Timer.php | Timer.time | public function time()
{
$format = $this->format;
$format = $this->replace('u', 6, $format);
$format = $this->replace('ms', 3, $format);
return gmdate($format, $this->time);
} | php | public function time()
{
$format = $this->format;
$format = $this->replace('u', 6, $format);
$format = $this->replace('ms', 3, $format);
return gmdate($format, $this->time);
} | [
"public",
"function",
"time",
"(",
")",
"{",
"$",
"format",
"=",
"$",
"this",
"->",
"format",
";",
"$",
"format",
"=",
"$",
"this",
"->",
"replace",
"(",
"'u'",
",",
"6",
",",
"$",
"format",
")",
";",
"$",
"format",
"=",
"$",
"this",
"->",
"rep... | Return measured time.
@return string | [
"Return",
"measured",
"time",
"."
] | train | https://github.com/devemio/php-readable-timer/blob/50916b630eda07999dc6676528afe59fb2105615/src/Timer.php#L85-L94 |
devemio/php-readable-timer | src/Timer.php | Timer.replace | private function replace($pattern, $precision, $format)
{
$time = round($this->time, $precision);
$value = substr(number_format($time - floor($time), $precision), 2);
return str_replace($pattern, $value, $format);
} | php | private function replace($pattern, $precision, $format)
{
$time = round($this->time, $precision);
$value = substr(number_format($time - floor($time), $precision), 2);
return str_replace($pattern, $value, $format);
} | [
"private",
"function",
"replace",
"(",
"$",
"pattern",
",",
"$",
"precision",
",",
"$",
"format",
")",
"{",
"$",
"time",
"=",
"round",
"(",
"$",
"this",
"->",
"time",
",",
"$",
"precision",
")",
";",
"$",
"value",
"=",
"substr",
"(",
"number_format",... | Replace the date format with calculated values.
@param string $pattern
@param int $precision
@param string $format
@return string | [
"Replace",
"the",
"date",
"format",
"with",
"calculated",
"values",
"."
] | train | https://github.com/devemio/php-readable-timer/blob/50916b630eda07999dc6676528afe59fb2105615/src/Timer.php#L104-L109 |
anime-db/app-bundle | src/Event/Listener/Request.php | Request.getLocale | public function getLocale(HttpRequest $request)
{
if ($this->locale) {
return $this->locale;
}
// get locale from language list
$constraint = new Locale();
foreach ($request->getLanguages() as $language) {
if (!$this->validator->validate($language, $c... | php | public function getLocale(HttpRequest $request)
{
if ($this->locale) {
return $this->locale;
}
// get locale from language list
$constraint = new Locale();
foreach ($request->getLanguages() as $language) {
if (!$this->validator->validate($language, $c... | [
"public",
"function",
"getLocale",
"(",
"HttpRequest",
"$",
"request",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"locale",
")",
"{",
"return",
"$",
"this",
"->",
"locale",
";",
"}",
"// get locale from language list",
"$",
"constraint",
"=",
"new",
"Locale",
... | @param HttpRequest $request
@return string | [
"@param",
"HttpRequest",
"$request"
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Event/Listener/Request.php#L99-L115 |
lmammino/e-foundation | src/Attribute/Model/AttributeSubjectTrait.php | AttributeSubjectTrait.setAttributesValues | public function setAttributesValues(Collection $attributesValues)
{
foreach ($attributesValues as $attributeValue) {
$this->addAttributeValue($attributeValue);
}
return $this;
} | php | public function setAttributesValues(Collection $attributesValues)
{
foreach ($attributesValues as $attributeValue) {
$this->addAttributeValue($attributeValue);
}
return $this;
} | [
"public",
"function",
"setAttributesValues",
"(",
"Collection",
"$",
"attributesValues",
")",
"{",
"foreach",
"(",
"$",
"attributesValues",
"as",
"$",
"attributeValue",
")",
"{",
"$",
"this",
"->",
"addAttributeValue",
"(",
"$",
"attributeValue",
")",
";",
"}",
... | Set the attribute values
@param Collection $attributesValues
@return $this | [
"Set",
"the",
"attribute",
"values"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Attribute/Model/AttributeSubjectTrait.php#L45-L52 |
lmammino/e-foundation | src/Attribute/Model/AttributeSubjectTrait.php | AttributeSubjectTrait.addAttributeValue | public function addAttributeValue(AttributeValueInterface $attributeValue)
{
if (!$this->attributeValues->contains($attributeValue)) {
$attributeValue->setSubject($this);
$this->attributeValues->add($attributeValue);
}
return $this;
} | php | public function addAttributeValue(AttributeValueInterface $attributeValue)
{
if (!$this->attributeValues->contains($attributeValue)) {
$attributeValue->setSubject($this);
$this->attributeValues->add($attributeValue);
}
return $this;
} | [
"public",
"function",
"addAttributeValue",
"(",
"AttributeValueInterface",
"$",
"attributeValue",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"attributeValues",
"->",
"contains",
"(",
"$",
"attributeValue",
")",
")",
"{",
"$",
"attributeValue",
"->",
"setSubjec... | Add an attribute value
@param AttributeValueInterface $attributeValue
@return $this | [
"Add",
"an",
"attribute",
"value"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Attribute/Model/AttributeSubjectTrait.php#L61-L69 |
lmammino/e-foundation | src/Attribute/Model/AttributeSubjectTrait.php | AttributeSubjectTrait.removeAttributeValue | public function removeAttributeValue(AttributeValueInterface $attributeValue)
{
if ($this->attributeValues->contains($attributeValue)) {
$attributeValue->setSubject(null);
$this->attributeValues->removeElement($attributeValue);
}
return $this;
} | php | public function removeAttributeValue(AttributeValueInterface $attributeValue)
{
if ($this->attributeValues->contains($attributeValue)) {
$attributeValue->setSubject(null);
$this->attributeValues->removeElement($attributeValue);
}
return $this;
} | [
"public",
"function",
"removeAttributeValue",
"(",
"AttributeValueInterface",
"$",
"attributeValue",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"attributeValues",
"->",
"contains",
"(",
"$",
"attributeValue",
")",
")",
"{",
"$",
"attributeValue",
"->",
"setSubject",
... | Remove an attribute value
@param AttributeValueInterface $attributeValue
@return $this | [
"Remove",
"an",
"attribute",
"value"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Attribute/Model/AttributeSubjectTrait.php#L78-L86 |
lmammino/e-foundation | src/Attribute/Model/AttributeSubjectTrait.php | AttributeSubjectTrait.hasAttributeValueByName | public function hasAttributeValueByName($attributeValueName)
{
/** @var AttributeValueInterface $attributeValue */
foreach ($this->attributeValues as $attributeValue) {
if ($attributeValue->getAttributeName() == $attributeValueName) {
return true;
}
}
... | php | public function hasAttributeValueByName($attributeValueName)
{
/** @var AttributeValueInterface $attributeValue */
foreach ($this->attributeValues as $attributeValue) {
if ($attributeValue->getAttributeName() == $attributeValueName) {
return true;
}
}
... | [
"public",
"function",
"hasAttributeValueByName",
"(",
"$",
"attributeValueName",
")",
"{",
"/** @var AttributeValueInterface $attributeValue */",
"foreach",
"(",
"$",
"this",
"->",
"attributeValues",
"as",
"$",
"attributeValue",
")",
"{",
"if",
"(",
"$",
"attributeValue... | Check if has an attribute value that matches a given name
@param string $attributeValueName
@return boolean | [
"Check",
"if",
"has",
"an",
"attribute",
"value",
"that",
"matches",
"a",
"given",
"name"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Attribute/Model/AttributeSubjectTrait.php#L107-L117 |
lmammino/e-foundation | src/Attribute/Model/AttributeSubjectTrait.php | AttributeSubjectTrait.getAttributeValueByName | public function getAttributeValueByName($attributeValueName)
{
/** @var AttributeValueInterface $attributeValue */
foreach ($this->attributeValues as $attributeValue) {
if ($attributeValue->getAttributeName() == $attributeValueName) {
return $attributeValue;
}... | php | public function getAttributeValueByName($attributeValueName)
{
/** @var AttributeValueInterface $attributeValue */
foreach ($this->attributeValues as $attributeValue) {
if ($attributeValue->getAttributeName() == $attributeValueName) {
return $attributeValue;
}... | [
"public",
"function",
"getAttributeValueByName",
"(",
"$",
"attributeValueName",
")",
"{",
"/** @var AttributeValueInterface $attributeValue */",
"foreach",
"(",
"$",
"this",
"->",
"attributeValues",
"as",
"$",
"attributeValue",
")",
"{",
"if",
"(",
"$",
"attributeValue... | Gets an attribute value if matches a given name or null instead
@param string $attributeValueName
@return AttributeValueInterface|null | [
"Gets",
"an",
"attribute",
"value",
"if",
"matches",
"a",
"given",
"name",
"or",
"null",
"instead"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Attribute/Model/AttributeSubjectTrait.php#L126-L136 |
ClanCats/Core | src/classes/CCView.php | CCView.cache_path | public static function cache_path( $view )
{
if ( strpos( $view, '::' ) !== false )
{
list( $package, $view ) = explode( '::', $view );
}
else
{
$package = 'app';
}
return \CCStorage::path( 'views/'.$package.'/'.$view.EXT );
} | php | public static function cache_path( $view )
{
if ( strpos( $view, '::' ) !== false )
{
list( $package, $view ) = explode( '::', $view );
}
else
{
$package = 'app';
}
return \CCStorage::path( 'views/'.$package.'/'.$view.EXT );
} | [
"public",
"static",
"function",
"cache_path",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"view",
",",
"'::'",
")",
"!==",
"false",
")",
"{",
"list",
"(",
"$",
"package",
",",
"$",
"view",
")",
"=",
"explode",
"(",
"'::'",
",",
"$"... | Get the cache path of a view
@param string $view
@return string | [
"Get",
"the",
"cache",
"path",
"of",
"a",
"view"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L72-L84 |
ClanCats/Core | src/classes/CCView.php | CCView.file | public function file( $file = null )
{
if ( !is_null( $file ) )
{
return $this->_file = $file;
}
return $this->_file;
} | php | public function file( $file = null )
{
if ( !is_null( $file ) )
{
return $this->_file = $file;
}
return $this->_file;
} | [
"public",
"function",
"file",
"(",
"$",
"file",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"file",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_file",
"=",
"$",
"file",
";",
"}",
"return",
"$",
"this",
"->",
"_file",
";",
"}"
... | set or get the current file
@param string $file
@return string | [
"set",
"or",
"get",
"the",
"current",
"file"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L126-L134 |
ClanCats/Core | src/classes/CCView.php | CCView.set | public function set( $key, $value, $param = null )
{
if ( $param === true )
{
$value = CCStr::htmlentities( $value );
}
return CCArr::set( $key, $value, $this->_data );
} | php | public function set( $key, $value, $param = null )
{
if ( $param === true )
{
$value = CCStr::htmlentities( $value );
}
return CCArr::set( $key, $value, $this->_data );
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"param",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"param",
"===",
"true",
")",
"{",
"$",
"value",
"=",
"CCStr",
"::",
"htmlentities",
"(",
"$",
"value",
")",
";",
"}",
"re... | custom setter with encode ability
@param string $key
@param mixed $value
@param mixed $param
@return void | [
"custom",
"setter",
"with",
"encode",
"ability"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L144-L152 |
ClanCats/Core | src/classes/CCView.php | CCView.capture | public function capture( $key, $callback )
{
return $this->set( $key, CCStr::capture( $callback, $this ) );
} | php | public function capture( $key, $callback )
{
return $this->set( $key, CCStr::capture( $callback, $this ) );
} | [
"public",
"function",
"capture",
"(",
"$",
"key",
",",
"$",
"callback",
")",
"{",
"return",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"CCStr",
"::",
"capture",
"(",
"$",
"callback",
",",
"$",
"this",
")",
")",
";",
"}"
] | just like set but it can
captures all output in a closure and set that.
@param string $key
@param callback $callback
@return void | [
"just",
"like",
"set",
"but",
"it",
"can",
"captures",
"all",
"output",
"in",
"a",
"closure",
"and",
"set",
"that",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L162-L165 |
ClanCats/Core | src/classes/CCView.php | CCView.capture_append | public function capture_append( $key, $callback )
{
return $this->set( $key, $this->get( $key, '' ).CCStr::capture( $callback, $this ) );
} | php | public function capture_append( $key, $callback )
{
return $this->set( $key, $this->get( $key, '' ).CCStr::capture( $callback, $this ) );
} | [
"public",
"function",
"capture_append",
"(",
"$",
"key",
",",
"$",
"callback",
")",
"{",
"return",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
",",
"''",
")",
".",
"CCStr",
"::",
"capture",
"(",
"$",... | just like capture but it appends
@param string $key
@param callback $callback
@return void | [
"just",
"like",
"capture",
"but",
"it",
"appends"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L174-L177 |
ClanCats/Core | src/classes/CCView.php | CCView.view_path | protected function view_path( $view )
{
if ( isset( static::$_view_paths[$view] ) )
{
return static::$_view_paths[$view];
}
// view is empty?
if ( is_null( $view ) )
{
throw new CCException( "CCView - cannot render view without a view file." );
}
// generate the views path
$path = CCPath:... | php | protected function view_path( $view )
{
if ( isset( static::$_view_paths[$view] ) )
{
return static::$_view_paths[$view];
}
// view is empty?
if ( is_null( $view ) )
{
throw new CCException( "CCView - cannot render view without a view file." );
}
// generate the views path
$path = CCPath:... | [
"protected",
"function",
"view_path",
"(",
"$",
"view",
")",
"{",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"_view_paths",
"[",
"$",
"view",
"]",
")",
")",
"{",
"return",
"static",
"::",
"$",
"_view_paths",
"[",
"$",
"view",
"]",
";",
"}",
"// ... | Get the path to real view file
This function will also build the cache view file if needed.
@param string $path
@return string | [
"Get",
"the",
"path",
"to",
"real",
"view",
"file"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L198-L235 |
ClanCats/Core | src/classes/CCView.php | CCView.build_cache | protected function build_cache( $path, $builder, $view_path )
{
CCFile::write( $path, CCView_Builder::compile( $builder, $view_path ) );
} | php | protected function build_cache( $path, $builder, $view_path )
{
CCFile::write( $path, CCView_Builder::compile( $builder, $view_path ) );
} | [
"protected",
"function",
"build_cache",
"(",
"$",
"path",
",",
"$",
"builder",
",",
"$",
"view_path",
")",
"{",
"CCFile",
"::",
"write",
"(",
"$",
"path",
",",
"CCView_Builder",
"::",
"compile",
"(",
"$",
"builder",
",",
"$",
"view_path",
")",
")",
";"... | Build a view cache file
@param string $path
@param string $builder
@param string
@return void | [
"Build",
"a",
"view",
"cache",
"file"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L246-L249 |
ClanCats/Core | src/classes/CCView.php | CCView.render | public function render( $file = null )
{
if ( !is_null( $file ) )
{
$this->file( $file );
}
$path = $this->view_path( $this->file() );
// extract the view data
extract( $this->_data );
// extract globals if they exists
if ( !empty( static::$_globals ) )
{
extract( static::$_globals,... | php | public function render( $file = null )
{
if ( !is_null( $file ) )
{
$this->file( $file );
}
$path = $this->view_path( $this->file() );
// extract the view data
extract( $this->_data );
// extract globals if they exists
if ( !empty( static::$_globals ) )
{
extract( static::$_globals,... | [
"public",
"function",
"render",
"(",
"$",
"file",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"file",
"(",
"$",
"file",
")",
";",
"}",
"$",
"path",
"=",
"$",
"this",
"->",
"view_path",
... | Render the view and return the output.
@param string $file
@return string | [
"Render",
"the",
"view",
"and",
"return",
"the",
"output",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCView.php#L257-L280 |
boekkooi/tactician-amqp | src/ExchangeLocator/InMemoryLocator.php | InMemoryLocator.addExchanges | protected function addExchanges(array $commandClassToHandlerMap)
{
foreach ($commandClassToHandlerMap as $messageClass => $handler) {
$this->addExchange($handler, $messageClass);
}
} | php | protected function addExchanges(array $commandClassToHandlerMap)
{
foreach ($commandClassToHandlerMap as $messageClass => $handler) {
$this->addExchange($handler, $messageClass);
}
} | [
"protected",
"function",
"addExchanges",
"(",
"array",
"$",
"commandClassToHandlerMap",
")",
"{",
"foreach",
"(",
"$",
"commandClassToHandlerMap",
"as",
"$",
"messageClass",
"=>",
"$",
"handler",
")",
"{",
"$",
"this",
"->",
"addExchange",
"(",
"$",
"handler",
... | Allows you to add multiple exchanges at once.
The map should be an array in the format of:
[
AddTaskCommand::class => $someAMQPExchangeInstance,
CompleteTaskCommand::class => $someAMQPExchangeInstance,
]
@param array $commandClassToHandlerMap | [
"Allows",
"you",
"to",
"add",
"multiple",
"exchanges",
"at",
"once",
"."
] | train | https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/ExchangeLocator/InMemoryLocator.php#L44-L49 |
boekkooi/tactician-amqp | src/ExchangeLocator/InMemoryLocator.php | InMemoryLocator.getExchangeForMessage | public function getExchangeForMessage(Message $message)
{
$class = get_class($message);
if (!isset($this->exchanges[$class])) {
throw MissingExchangeException::forMessage($message);
}
return $this->exchanges[$class];
} | php | public function getExchangeForMessage(Message $message)
{
$class = get_class($message);
if (!isset($this->exchanges[$class])) {
throw MissingExchangeException::forMessage($message);
}
return $this->exchanges[$class];
} | [
"public",
"function",
"getExchangeForMessage",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"message",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"exchanges",
"[",
"$",
"class",
"]",
")",
")",
"{... | {@inheritdoc} | [
"{"
] | train | https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/ExchangeLocator/InMemoryLocator.php#L54-L63 |
lmammino/e-foundation | src/Price/Model/AdjustableTrait.php | AdjustableTrait.setAdjustments | public function setAdjustments(Collection $adjustments)
{
$this->adjustmentsTotal = null;
$this->onAdjustmentsChange();
foreach ($adjustments as $adjustment) {
$this->addAdjustment($adjustment);
}
return $this;
} | php | public function setAdjustments(Collection $adjustments)
{
$this->adjustmentsTotal = null;
$this->onAdjustmentsChange();
foreach ($adjustments as $adjustment) {
$this->addAdjustment($adjustment);
}
return $this;
} | [
"public",
"function",
"setAdjustments",
"(",
"Collection",
"$",
"adjustments",
")",
"{",
"$",
"this",
"->",
"adjustmentsTotal",
"=",
"null",
";",
"$",
"this",
"->",
"onAdjustmentsChange",
"(",
")",
";",
"foreach",
"(",
"$",
"adjustments",
"as",
"$",
"adjustm... | Set adjustments
@param Collection $adjustments
@return $this | [
"Set",
"adjustments"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/AdjustableTrait.php#L50-L59 |
lmammino/e-foundation | src/Price/Model/AdjustableTrait.php | AdjustableTrait.addAdjustment | public function addAdjustment(AdjustmentInterface $adjustment)
{
if (!$this->hasAdjustment($adjustment)) {
$this->adjustmentsTotal = null;
$this->onAdjustmentsChange();
$adjustment->setAdjustable($this);
$this->adjustments->add($adjustment);
}
... | php | public function addAdjustment(AdjustmentInterface $adjustment)
{
if (!$this->hasAdjustment($adjustment)) {
$this->adjustmentsTotal = null;
$this->onAdjustmentsChange();
$adjustment->setAdjustable($this);
$this->adjustments->add($adjustment);
}
... | [
"public",
"function",
"addAdjustment",
"(",
"AdjustmentInterface",
"$",
"adjustment",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasAdjustment",
"(",
"$",
"adjustment",
")",
")",
"{",
"$",
"this",
"->",
"adjustmentsTotal",
"=",
"null",
";",
"$",
"this",... | Add adjustment
@param AdjustmentInterface $adjustment
@return $this | [
"Add",
"adjustment"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/AdjustableTrait.php#L68-L78 |
lmammino/e-foundation | src/Price/Model/AdjustableTrait.php | AdjustableTrait.removeAdjustment | public function removeAdjustment(AdjustmentInterface $adjustment)
{
if ($this->hasAdjustment($adjustment)) {
$this->adjustmentsTotal = null;
$adjustment->setAdjustable(null);
$this->adjustments->removeElement($adjustment);
}
return $this;
} | php | public function removeAdjustment(AdjustmentInterface $adjustment)
{
if ($this->hasAdjustment($adjustment)) {
$this->adjustmentsTotal = null;
$adjustment->setAdjustable(null);
$this->adjustments->removeElement($adjustment);
}
return $this;
} | [
"public",
"function",
"removeAdjustment",
"(",
"AdjustmentInterface",
"$",
"adjustment",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasAdjustment",
"(",
"$",
"adjustment",
")",
")",
"{",
"$",
"this",
"->",
"adjustmentsTotal",
"=",
"null",
";",
"$",
"adjustment... | Removes a given adjustment
@param AdjustmentInterface $adjustment
@return $this | [
"Removes",
"a",
"given",
"adjustment"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/AdjustableTrait.php#L99-L108 |
lmammino/e-foundation | src/Price/Model/AdjustableTrait.php | AdjustableTrait.removeAdjustmentByLabel | public function removeAdjustmentByLabel($adjustmentLabel)
{
/** @var AdjustmentInterface $adjustment */
foreach ($this->adjustments as $adjustment) {
if ($adjustmentLabel == $adjustment->getLabel()) {
$this->removeAdjustment($adjustment);
return $this;
... | php | public function removeAdjustmentByLabel($adjustmentLabel)
{
/** @var AdjustmentInterface $adjustment */
foreach ($this->adjustments as $adjustment) {
if ($adjustmentLabel == $adjustment->getLabel()) {
$this->removeAdjustment($adjustment);
return $this;
... | [
"public",
"function",
"removeAdjustmentByLabel",
"(",
"$",
"adjustmentLabel",
")",
"{",
"/** @var AdjustmentInterface $adjustment */",
"foreach",
"(",
"$",
"this",
"->",
"adjustments",
"as",
"$",
"adjustment",
")",
"{",
"if",
"(",
"$",
"adjustmentLabel",
"==",
"$",
... | Removes an adjustment by label
@param string $adjustmentLabel
@return $this | [
"Removes",
"an",
"adjustment",
"by",
"label"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/AdjustableTrait.php#L116-L127 |
lmammino/e-foundation | src/Price/Model/AdjustableTrait.php | AdjustableTrait.calculateAdjustmentsTotal | public function calculateAdjustmentsTotal()
{
$this->adjustmentsTotal = 0;
foreach ($this->adjustments as $adjustment) {
if (!$adjustment->isNeutral()) {
$this->adjustmentsTotal += $adjustment->getAmount();
}
}
return $this;
} | php | public function calculateAdjustmentsTotal()
{
$this->adjustmentsTotal = 0;
foreach ($this->adjustments as $adjustment) {
if (!$adjustment->isNeutral()) {
$this->adjustmentsTotal += $adjustment->getAmount();
}
}
return $this;
} | [
"public",
"function",
"calculateAdjustmentsTotal",
"(",
")",
"{",
"$",
"this",
"->",
"adjustmentsTotal",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"adjustments",
"as",
"$",
"adjustment",
")",
"{",
"if",
"(",
"!",
"$",
"adjustment",
"->",
"isNeutral... | Recalculates the adjustment amount
@return $this | [
"Recalculates",
"the",
"adjustment",
"amount"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Price/Model/AdjustableTrait.php#L158-L169 |
askupasoftware/amarkal | Assets/Stylesheet.php | Stylesheet.register | public function register()
{
wp_register_style(
$this->handle,
$this->url,
$this->dependencies,
$this->version,
$this->media
);
$this->is_registered = true;
} | php | public function register()
{
wp_register_style(
$this->handle,
$this->url,
$this->dependencies,
$this->version,
$this->media
);
$this->is_registered = true;
} | [
"public",
"function",
"register",
"(",
")",
"{",
"wp_register_style",
"(",
"$",
"this",
"->",
"handle",
",",
"$",
"this",
"->",
"url",
",",
"$",
"this",
"->",
"dependencies",
",",
"$",
"this",
"->",
"version",
",",
"$",
"this",
"->",
"media",
")",
";... | Register the stylesheet. | [
"Register",
"the",
"stylesheet",
"."
] | train | https://github.com/askupasoftware/amarkal/blob/fe8283e2d6847ef697abec832da7ee741a85058c/Assets/Stylesheet.php#L31-L41 |
PeekAndPoke/psi | src/Operation/Terminal/GetFirstOperation.php | GetFirstOperation.apply | public function apply(\Iterator $set)
{
$set->rewind();
return $set->valid() ? $set->current() : $this->default;
} | php | public function apply(\Iterator $set)
{
$set->rewind();
return $set->valid() ? $set->current() : $this->default;
} | [
"public",
"function",
"apply",
"(",
"\\",
"Iterator",
"$",
"set",
")",
"{",
"$",
"set",
"->",
"rewind",
"(",
")",
";",
"return",
"$",
"set",
"->",
"valid",
"(",
")",
"?",
"$",
"set",
"->",
"current",
"(",
")",
":",
"$",
"this",
"->",
"default",
... | @param \Iterator $set
@return mixed | [
"@param",
"\\",
"Iterator",
"$set"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Operation/Terminal/GetFirstOperation.php#L35-L40 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.set_addons | protected function set_addons()
{
if ( $this->config->get( 'addons' ) ) {
foreach ( $this->config->get( 'addons' ) as $addon ) {
$this->addons[] = new $addon( $this );
}
}
} | php | protected function set_addons()
{
if ( $this->config->get( 'addons' ) ) {
foreach ( $this->config->get( 'addons' ) as $addon ) {
$this->addons[] = new $addon( $this );
}
}
} | [
"protected",
"function",
"set_addons",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'addons'",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"config",
"->",
"get",
"(",
"'addons'",
")",
"as",
"$",
"addon",
")",
"{",... | Sets plugin addons.
@since 1.2
@return void | [
"Sets",
"plugin",
"addons",
".",
"@since",
"1",
".",
"2"
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L181-L188 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.autoload_init | public function autoload_init()
{
$this->init();
// Addons
for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
$this->addons[$i]->init();
}
} | php | public function autoload_init()
{
$this->init();
// Addons
for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
$this->addons[$i]->init();
}
} | [
"public",
"function",
"autoload_init",
"(",
")",
"{",
"$",
"this",
"->",
"init",
"(",
")",
";",
"// Addons",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"this",
"->",
"addons",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"--",
"$",
"i",
"... | Called by autoload to init class.
@since 1.2
@return void | [
"Called",
"by",
"autoload",
"to",
"init",
"class",
"."
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L209-L216 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.autoload_on_admin | public function autoload_on_admin()
{
$this->on_admin();
// Addons
for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
$this->addons[$i]->on_admin();
}
} | php | public function autoload_on_admin()
{
$this->on_admin();
// Addons
for ( $i = count( $this->addons ) - 1; $i >= 0; --$i ) {
$this->addons[$i]->on_admin();
}
} | [
"public",
"function",
"autoload_on_admin",
"(",
")",
"{",
"$",
"this",
"->",
"on_admin",
"(",
")",
";",
"// Addons",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"this",
"->",
"addons",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"--",
"$",
... | Called by autoload to init on admin.
@since 1.2
@return void | [
"Called",
"by",
"autoload",
"to",
"init",
"on",
"admin",
"."
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L223-L230 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.add_action | public function add_action( $hook, $mvc_call, $priority = 10, $accepted_args = 1, $args = 1 )
{
$this->actions[] = $this->get_hook(
$hook,
$mvc_call,
$priority,
$accepted_args,
$args
);
} | php | public function add_action( $hook, $mvc_call, $priority = 10, $accepted_args = 1, $args = 1 )
{
$this->actions[] = $this->get_hook(
$hook,
$mvc_call,
$priority,
$accepted_args,
$args
);
} | [
"public",
"function",
"add_action",
"(",
"$",
"hook",
",",
"$",
"mvc_call",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"accepted_args",
"=",
"1",
",",
"$",
"args",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"$",
"this",
"->"... | Adds a Wordpress action hook.
@since 1.3
@param string $hook Wordpress hook name.
@param string $mvc_call Lightweight MVC call. (i.e. 'Controller@method')
@param mixed $priority Execution priority or MVC params.
@param mixed $accepted_args Accepted args or priority.
@param int $args Accep... | [
"Adds",
"a",
"Wordpress",
"action",
"hook",
".",
"@since",
"1",
".",
"3"
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L262-L271 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.add_filter | public function add_filter( $hook, $mvc_call, $priority = 10, $accepted_args = 1, $args = 1 )
{
$this->filters[] = $this->get_hook(
$hook,
$mvc_call,
$priority,
$accepted_args,
$args
);
} | php | public function add_filter( $hook, $mvc_call, $priority = 10, $accepted_args = 1, $args = 1 )
{
$this->filters[] = $this->get_hook(
$hook,
$mvc_call,
$priority,
$accepted_args,
$args
);
} | [
"public",
"function",
"add_filter",
"(",
"$",
"hook",
",",
"$",
"mvc_call",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"accepted_args",
"=",
"1",
",",
"$",
"args",
"=",
"1",
")",
"{",
"$",
"this",
"->",
"filters",
"[",
"]",
"=",
"$",
"this",
"->"... | Adds a Wordpress filter hook.
@since 1.3
@param string $hook Wordpress hook name.
@param string $mvc_call Lightweight MVC call. (i.e. 'Controller@method')
@param mixed $priority Execution priority or MVC params.
@param mixed $accepted_args Accepted args or priority.
@param int $args Accep... | [
"Adds",
"a",
"Wordpress",
"filter",
"hook",
".",
"@since",
"1",
".",
"3"
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L283-L292 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.add_shortcode | public function add_shortcode( $tag, $mvc_call, $mvc_args = null )
{
$this->shortcodes[] = [
'tag' => $tag,
'mvc' => $mvc_call,
'mvc_args' => $mvc_args,
];
} | php | public function add_shortcode( $tag, $mvc_call, $mvc_args = null )
{
$this->shortcodes[] = [
'tag' => $tag,
'mvc' => $mvc_call,
'mvc_args' => $mvc_args,
];
} | [
"public",
"function",
"add_shortcode",
"(",
"$",
"tag",
",",
"$",
"mvc_call",
",",
"$",
"mvc_args",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"shortcodes",
"[",
"]",
"=",
"[",
"'tag'",
"=>",
"$",
"tag",
",",
"'mvc'",
"=>",
"$",
"mvc_call",
",",
"'m... | Adds a Wordpress shortcode.
@since 1.3
@param string $tag Wordpress tag name.
@param string $mvc_call Lightweight MVC call. (i.e. 'Controller@method') | [
"Adds",
"a",
"Wordpress",
"shortcode",
".",
"@since",
"1",
".",
"3"
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L301-L308 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.add_hooks | public function add_hooks()
{
if ( function_exists( 'add_action' )
&& function_exists( 'add_filter' )
&& function_exists( 'add_shortcode' )
) {
// Actions
foreach ( $this->actions as $action ) {
add_action(
$action['hook'],
[ &$this, $this->get_mapped_mvc_call( $action['mvc'] ) ],
$a... | php | public function add_hooks()
{
if ( function_exists( 'add_action' )
&& function_exists( 'add_filter' )
&& function_exists( 'add_shortcode' )
) {
// Actions
foreach ( $this->actions as $action ) {
add_action(
$action['hook'],
[ &$this, $this->get_mapped_mvc_call( $action['mvc'] ) ],
$a... | [
"public",
"function",
"add_hooks",
"(",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'add_action'",
")",
"&&",
"function_exists",
"(",
"'add_filter'",
")",
"&&",
"function_exists",
"(",
"'add_shortcode'",
")",
")",
"{",
"// Actions",
"foreach",
"(",
"$",
"thi... | Adds hooks and filters into Wordpress core.
@since 1.3 | [
"Adds",
"hooks",
"and",
"filters",
"into",
"Wordpress",
"core",
"."
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L325-L361 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.get_hook | private function get_hook( $hook, $mvc_call, $priority = 10, $accepted_args = 1, $args = 1 )
{
return [
'hook' => $hook,
'mvc' => $mvc_call,
'priority' => is_array( $priority ) ? $accepted_args : $priority,
'args' => is_array( $priority ) ? $args : $accepted_args,
'mvc_args' => is_array( $priority ... | php | private function get_hook( $hook, $mvc_call, $priority = 10, $accepted_args = 1, $args = 1 )
{
return [
'hook' => $hook,
'mvc' => $mvc_call,
'priority' => is_array( $priority ) ? $accepted_args : $priority,
'args' => is_array( $priority ) ? $args : $accepted_args,
'mvc_args' => is_array( $priority ... | [
"private",
"function",
"get_hook",
"(",
"$",
"hook",
",",
"$",
"mvc_call",
",",
"$",
"priority",
"=",
"10",
",",
"$",
"accepted_args",
"=",
"1",
",",
"$",
"args",
"=",
"1",
")",
"{",
"return",
"[",
"'hook'",
"=>",
"$",
"hook",
",",
"'mvc'",
"=>",
... | Returns valid action filter item.
@since 1.3
@param string $hook Wordpress hook name.
@param string $mvc_call Lightweight MVC call. (i.e. 'Controller@method')
@param mixed $priority Execution priority or MVC params.
@param mixed $accepted_args Accepted args or priority.
@param int $args A... | [
"Returns",
"valid",
"action",
"filter",
"item",
".",
"@since",
"1",
".",
"3"
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L399-L408 |
amostajo/wordpress-plugin-core | src/psr4/Plugin.php | Plugin.override_args | private function override_args( $mvc_call, $args )
{
// Check on actions
for ( $i = count( $this->actions ) - 1; $i >= 0; --$i ) {
if ( ! empty( $this->actions[$i]['mvc_args'] )
&& $this->actions[$i]['mvc'] === $mvc_call
) {
return $this->actions[$i]['mvc_args'];
}
}
// Check on filters
for ... | php | private function override_args( $mvc_call, $args )
{
// Check on actions
for ( $i = count( $this->actions ) - 1; $i >= 0; --$i ) {
if ( ! empty( $this->actions[$i]['mvc_args'] )
&& $this->actions[$i]['mvc'] === $mvc_call
) {
return $this->actions[$i]['mvc_args'];
}
}
// Check on filters
for ... | [
"private",
"function",
"override_args",
"(",
"$",
"mvc_call",
",",
"$",
"args",
")",
"{",
"// Check on actions",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"this",
"->",
"actions",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"--",
"$",
"i",
... | Override mvc arguments with those defined when adding an action or filter.
@since 1.3
@param string $mvc_call Lightweight MVC call. (i.e. 'Controller@method')
@param array $args Current args for call.
@return array | [
"Override",
"mvc",
"arguments",
"with",
"those",
"defined",
"when",
"adding",
"an",
"action",
"or",
"filter",
".",
"@since",
"1",
".",
"3"
] | train | https://github.com/amostajo/wordpress-plugin-core/blob/63aba30b07057df540c3af4dc50b92bd5501d6fd/src/psr4/Plugin.php#L419-L446 |
liugene/framework | src/Model.php | Model.buildQuery | protected function buildQuery()
{
// 合并数据库配置
if (!empty($this->connection)) {
if (is_array($this->connection)) {
$connection = array_merge(Config::get('database'), $this->connection);
} else {
$connection = $this->connection;
}
... | php | protected function buildQuery()
{
// 合并数据库配置
if (!empty($this->connection)) {
if (is_array($this->connection)) {
$connection = array_merge(Config::get('database'), $this->connection);
} else {
$connection = $this->connection;
}
... | [
"protected",
"function",
"buildQuery",
"(",
")",
"{",
"// 合并数据库配置",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"connection",
")",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"connection",
")",
")",
"{",
"$",
"connection",
"=",
"arr... | 创建模型的查询对象
@access protected
@return Query | [
"创建模型的查询对象"
] | train | https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Model.php#L73-L109 |
liugene/framework | src/Model.php | Model.getQuery | public function getQuery($buildNewQuery = false)
{
if ($buildNewQuery) {
return $this->buildQuery();
} elseif (!isset(self::$links[$this->class])) {
// 创建模型查询对象
self::$links[$this->class] = $this->buildQuery();
}
return self::$links[$this->class];... | php | public function getQuery($buildNewQuery = false)
{
if ($buildNewQuery) {
return $this->buildQuery();
} elseif (!isset(self::$links[$this->class])) {
// 创建模型查询对象
self::$links[$this->class] = $this->buildQuery();
}
return self::$links[$this->class];... | [
"public",
"function",
"getQuery",
"(",
"$",
"buildNewQuery",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"buildNewQuery",
")",
"{",
"return",
"$",
"this",
"->",
"buildQuery",
"(",
")",
";",
"}",
"elseif",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"links... | 获取当前模型的查询对象
@access public
@param bool $buildNewQuery 创建新的查询对象
@return Query | [
"获取当前模型的查询对象"
] | train | https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Model.php#L117-L127 |
liugene/framework | src/Model.php | Model.insert | public function insert(array $data)
{
if (false === $this->trigger('before_insert', $this)) {
return false;
}
if($this->dateFormat && $this->updateTime && $this->createTime){
$time = date('Y-m-d H:i:s', time());
$data[$this->updateTime] = $time;
... | php | public function insert(array $data)
{
if (false === $this->trigger('before_insert', $this)) {
return false;
}
if($this->dateFormat && $this->updateTime && $this->createTime){
$time = date('Y-m-d H:i:s', time());
$data[$this->updateTime] = $time;
... | [
"public",
"function",
"insert",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"trigger",
"(",
"'before_insert'",
",",
"$",
"this",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"dateF... | save 数据库添加操作方法 返回保存记录的ID | [
"save",
"数据库添加操作方法",
"返回保存记录的ID"
] | train | https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Model.php#L182-L204 |
liugene/framework | src/Model.php | Model.delete | public function delete($data=null)
{
if (false === $this->trigger('before_delete', $this)) {
return false;
}
$response = $this->getQuery()->delete($data);
if (false === $this->trigger('after_insert', $this)) {
return false;
}
return $respons... | php | public function delete($data=null)
{
if (false === $this->trigger('before_delete', $this)) {
return false;
}
$response = $this->getQuery()->delete($data);
if (false === $this->trigger('after_insert', $this)) {
return false;
}
return $respons... | [
"public",
"function",
"delete",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"trigger",
"(",
"'before_delete'",
",",
"$",
"this",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"response",
"=",
"$",
"this... | delete | [
"delete"
] | train | https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Model.php#L226-L239 |
liugene/framework | src/Model.php | Model.event | public static function event($event, $callback, $override = false)
{
$class = get_called_class();
if ($override) {
self::$event[$class][$event] = [];
}
self::$event[$class][$event][] = $callback;
} | php | public static function event($event, $callback, $override = false)
{
$class = get_called_class();
if ($override) {
self::$event[$class][$event] = [];
}
self::$event[$class][$event][] = $callback;
} | [
"public",
"static",
"function",
"event",
"(",
"$",
"event",
",",
"$",
"callback",
",",
"$",
"override",
"=",
"false",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"$",
"override",
")",
"{",
"self",
"::",
"$",
"event",
... | 注册回调方法
@access public
@param string $event 事件名
@param callable $callback 回调方法
@param bool $override 是否覆盖
@return void | [
"注册回调方法"
] | train | https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Model.php#L427-L434 |
liugene/framework | src/Model.php | Model.trigger | protected function trigger($event, &$params)
{
if (isset(self::$event[$this->class][$event])) {
foreach (self::$event[$this->class][$event] as $callback) {
if (is_callable($callback)) {
$result = call_user_func_array($callback, [ & $params]);
... | php | protected function trigger($event, &$params)
{
if (isset(self::$event[$this->class][$event])) {
foreach (self::$event[$this->class][$event] as $callback) {
if (is_callable($callback)) {
$result = call_user_func_array($callback, [ & $params]);
... | [
"protected",
"function",
"trigger",
"(",
"$",
"event",
",",
"&",
"$",
"params",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"event",
"[",
"$",
"this",
"->",
"class",
"]",
"[",
"$",
"event",
"]",
")",
")",
"{",
"foreach",
"(",
"self",
... | 触发事件
@access protected
@param string $event 事件名
@param mixed $params 传入参数(引用)
@return bool | [
"触发事件"
] | train | https://github.com/liugene/framework/blob/450642242442c5884d47552a588a2639923e7289/src/Model.php#L443-L456 |
GrafiteInc/Mission-Control-Package | src/TrafficService.php | TrafficService.sendTraffic | public function sendTraffic($log, $format)
{
$headers = [
'token' => $this->token,
];
if (is_null($this->token)) {
throw new Exception("Missing token", 1);
}
$query = $this->getTraffic($log, $format);
$response = $this->curl::post($this->mis... | php | public function sendTraffic($log, $format)
{
$headers = [
'token' => $this->token,
];
if (is_null($this->token)) {
throw new Exception("Missing token", 1);
}
$query = $this->getTraffic($log, $format);
$response = $this->curl::post($this->mis... | [
"public",
"function",
"sendTraffic",
"(",
"$",
"log",
",",
"$",
"format",
")",
"{",
"$",
"headers",
"=",
"[",
"'token'",
"=>",
"$",
"this",
"->",
"token",
",",
"]",
";",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"token",
")",
")",
"{",
"throw... | Send the exception to Mission control.
@param Exeption $exception
@return bool | [
"Send",
"the",
"exception",
"to",
"Mission",
"control",
"."
] | train | https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/TrafficService.php#L35-L54 |
GrafiteInc/Mission-Control-Package | src/TrafficService.php | TrafficService.getTraffic | public function getTraffic($log, $format)
{
try {
return $this->service->analyze($log, $format);
} catch (Exception $e) {
$this->issueService->exception($e);
}
} | php | public function getTraffic($log, $format)
{
try {
return $this->service->analyze($log, $format);
} catch (Exception $e) {
$this->issueService->exception($e);
}
} | [
"public",
"function",
"getTraffic",
"(",
"$",
"log",
",",
"$",
"format",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"service",
"->",
"analyze",
"(",
"$",
"log",
",",
"$",
"format",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
... | Collect data and set report details.
@return array | [
"Collect",
"data",
"and",
"set",
"report",
"details",
"."
] | train | https://github.com/GrafiteInc/Mission-Control-Package/blob/4e85f0b729329783b34e35d90abba2807899ff58/src/TrafficService.php#L61-L68 |
steeffeen/FancyManiaLinks | FML/Controls/Label.php | Label.addClockFeature | public function addClockFeature($showSeconds = true, $showFullDate = false)
{
$clock = new Clock($this, $showSeconds, $showFullDate);
$this->addScriptFeature($clock);
return $this;
} | php | public function addClockFeature($showSeconds = true, $showFullDate = false)
{
$clock = new Clock($this, $showSeconds, $showFullDate);
$this->addScriptFeature($clock);
return $this;
} | [
"public",
"function",
"addClockFeature",
"(",
"$",
"showSeconds",
"=",
"true",
",",
"$",
"showFullDate",
"=",
"false",
")",
"{",
"$",
"clock",
"=",
"new",
"Clock",
"(",
"$",
"this",
",",
"$",
"showSeconds",
",",
"$",
"showFullDate",
")",
";",
"$",
"thi... | Add a dynamic Feature showing the current time
@api
@param bool $showSeconds (optional) If the seconds should be shown
@param bool $showFullDate (optional) If the date should be shown
@return static | [
"Add",
"a",
"dynamic",
"Feature",
"showing",
"the",
"current",
"time"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Controls/Label.php#L604-L609 |
paliari/oauth2-server-facade | src/Paliari/Oauth2ServerFacade/Oauth2Facade.php | Oauth2Facade.authorized | protected function authorized($client_id, $user_id)
{
if ($this->storage->getClientUser($client_id, $user_id)) {
return true;
}
if ($_POST && 'yes' === @$_POST['authorized']) {
$this->storage->setClientUser($client_id, $user_id);
return true;
}
... | php | protected function authorized($client_id, $user_id)
{
if ($this->storage->getClientUser($client_id, $user_id)) {
return true;
}
if ($_POST && 'yes' === @$_POST['authorized']) {
$this->storage->setClientUser($client_id, $user_id);
return true;
}
... | [
"protected",
"function",
"authorized",
"(",
"$",
"client_id",
",",
"$",
"user_id",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"storage",
"->",
"getClientUser",
"(",
"$",
"client_id",
",",
"$",
"user_id",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
... | @param string $client_id
@param string $user_id
@return bool | [
"@param",
"string",
"$client_id",
"@param",
"string",
"$user_id"
] | train | https://github.com/paliari/oauth2-server-facade/blob/72785397ff5b2d4c9e8cf487b4215b3808bbcfdf/src/Paliari/Oauth2ServerFacade/Oauth2Facade.php#L168-L180 |
phpmob/changmin | src/PhpMob/CoreBundle/Form/Type/WebUserRegistrationType.php | WebUserRegistrationType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options): void
{
parent::buildForm($builder, $options);
$builder->remove('enabled');
$builder->add('plainPassword', RepeatedType::class, [
'type' => PasswordType::class,
'first_options' => ['label' => '... | php | public function buildForm(FormBuilderInterface $builder, array $options): void
{
parent::buildForm($builder, $options);
$builder->remove('enabled');
$builder->add('plainPassword', RepeatedType::class, [
'type' => PasswordType::class,
'first_options' => ['label' => '... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
":",
"void",
"{",
"parent",
"::",
"buildForm",
"(",
"$",
"builder",
",",
"$",
"options",
")",
";",
"$",
"builder",
"->",
"remove",
"(",
"'e... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CoreBundle/Form/Type/WebUserRegistrationType.php#L27-L39 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.setResourceMembers | protected function setResourceMembers($resourcePath = null)
{
// File services need the trailing slash '/' for designating folders vs files
// It is removed by the parent method
$isFolder = (empty($resourcePath) ? false : ('/' === substr($resourcePath, -1)));
parent::setResourceMembe... | php | protected function setResourceMembers($resourcePath = null)
{
// File services need the trailing slash '/' for designating folders vs files
// It is removed by the parent method
$isFolder = (empty($resourcePath) ? false : ('/' === substr($resourcePath, -1)));
parent::setResourceMembe... | [
"protected",
"function",
"setResourceMembers",
"(",
"$",
"resourcePath",
"=",
"null",
")",
"{",
"// File services need the trailing slash '/' for designating folders vs files",
"// It is removed by the parent method",
"$",
"isFolder",
"=",
"(",
"empty",
"(",
"$",
"resourcePath"... | Apply the commonly used REST path members to the class.
@param string $resourcePath
@return $this | [
"Apply",
"the",
"commonly",
"used",
"REST",
"path",
"members",
"to",
"the",
"class",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L253-L270 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleResource | protected function handleResource(array $resources)
{
// Fall through is to process just like a no-resource request
$resources = $this->getResourceHandlers();
if ((false !== $resources) && !empty($this->resource)) {
if (in_array($this->resource, $resources)) {
re... | php | protected function handleResource(array $resources)
{
// Fall through is to process just like a no-resource request
$resources = $this->getResourceHandlers();
if ((false !== $resources) && !empty($this->resource)) {
if (in_array($this->resource, $resources)) {
re... | [
"protected",
"function",
"handleResource",
"(",
"array",
"$",
"resources",
")",
"{",
"// Fall through is to process just like a no-resource request",
"$",
"resources",
"=",
"$",
"this",
"->",
"getResourceHandlers",
"(",
")",
";",
"if",
"(",
"(",
"false",
"!==",
"$"... | @param array $resources
@return bool|mixed
@throws BadRequestException
@throws NotFoundException | [
"@param",
"array",
"$resources"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L284-L295 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.doSearch | protected function doSearch($search)
{
$found = [];
$result = $this->driver->getFolder(
$this->container,
$this->folderPath,
$this->request->getParameterAsBool('include_files', true),
$this->request->getParameterAsBool('include_folders', true),
... | php | protected function doSearch($search)
{
$found = [];
$result = $this->driver->getFolder(
$this->container,
$this->folderPath,
$this->request->getParameterAsBool('include_files', true),
$this->request->getParameterAsBool('include_folders', true),
... | [
"protected",
"function",
"doSearch",
"(",
"$",
"search",
")",
"{",
"$",
"found",
"=",
"[",
"]",
";",
"$",
"result",
"=",
"$",
"this",
"->",
"driver",
"->",
"getFolder",
"(",
"$",
"this",
"->",
"container",
",",
"$",
"this",
"->",
"folderPath",
",",
... | Searches for files/folders.
@param string $search
@return array | [
"Searches",
"for",
"files",
"/",
"folders",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L340-L358 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleGET | protected function handleGET()
{
if (empty($this->folderPath) && empty($this->filePath) &&
$this->request->getParameterAsBool(ApiOptions::AS_ACCESS_LIST)
) {
return ResourcesWrapper::wrapResources($this->getAccessList());
}
if (empty($this->filePath)) {
... | php | protected function handleGET()
{
if (empty($this->folderPath) && empty($this->filePath) &&
$this->request->getParameterAsBool(ApiOptions::AS_ACCESS_LIST)
) {
return ResourcesWrapper::wrapResources($this->getAccessList());
}
if (empty($this->filePath)) {
... | [
"protected",
"function",
"handleGET",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"folderPath",
")",
"&&",
"empty",
"(",
"$",
"this",
"->",
"filePath",
")",
"&&",
"$",
"this",
"->",
"request",
"->",
"getParameterAsBool",
"(",
"ApiOptions",... | Handles GET actions.
@throws \Exception
@return \DreamFactory\Core\Utility\ServiceResponse|StreamedResponse|array | [
"Handles",
"GET",
"actions",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L366-L437 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handlePOST | protected function handlePOST()
{
$extract = $this->request->getParameterAsBool('extract', false);
$clean = $this->request->getParameterAsBool('clean', false);
$checkExist = $this->request->getParameterAsBool('check_exist', false);
if (empty($this->filePath)) {
$fileName... | php | protected function handlePOST()
{
$extract = $this->request->getParameterAsBool('extract', false);
$clean = $this->request->getParameterAsBool('clean', false);
$checkExist = $this->request->getParameterAsBool('check_exist', false);
if (empty($this->filePath)) {
$fileName... | [
"protected",
"function",
"handlePOST",
"(",
")",
"{",
"$",
"extract",
"=",
"$",
"this",
"->",
"request",
"->",
"getParameterAsBool",
"(",
"'extract'",
",",
"false",
")",
";",
"$",
"clean",
"=",
"$",
"this",
"->",
"request",
"->",
"getParameterAsBool",
"(",... | Handles POST actions.
@return \DreamFactory\Core\Utility\ServiceResponse
@throws BadRequestException
@throws InternalServerErrorException
@throws \Exception | [
"Handles",
"POST",
"actions",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L447-L562 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handlePATCH | protected function handlePATCH()
{
$content = $this->getPayloadData();
if (empty($this->folderPath)) {
// update container properties
$this->driver->updateContainerProperties($this->container, $content);
} else {
if (empty($this->filePath)) {
... | php | protected function handlePATCH()
{
$content = $this->getPayloadData();
if (empty($this->folderPath)) {
// update container properties
$this->driver->updateContainerProperties($this->container, $content);
} else {
if (empty($this->filePath)) {
... | [
"protected",
"function",
"handlePATCH",
"(",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getPayloadData",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"folderPath",
")",
")",
"{",
"// update container properties",
"$",
"this",
"->",
... | Handles PATCH actions.
@return \DreamFactory\Core\Utility\ServiceResponse | [
"Handles",
"PATCH",
"actions",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L569-L586 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleDELETE | protected function handleDELETE()
{
$force = $this->request->getParameterAsBool('force', false);
$noCheck = $this->request->getParameterAsBool('no_check', false);
$contentOnly = $this->request->getParameterAsBool('content_only', false);
if (empty($this->folderPath)) {
//... | php | protected function handleDELETE()
{
$force = $this->request->getParameterAsBool('force', false);
$noCheck = $this->request->getParameterAsBool('no_check', false);
$contentOnly = $this->request->getParameterAsBool('content_only', false);
if (empty($this->folderPath)) {
//... | [
"protected",
"function",
"handleDELETE",
"(",
")",
"{",
"$",
"force",
"=",
"$",
"this",
"->",
"request",
"->",
"getParameterAsBool",
"(",
"'force'",
",",
"false",
")",
";",
"$",
"noCheck",
"=",
"$",
"this",
"->",
"request",
"->",
"getParameterAsBool",
"(",... | Handles DELETE actions.
@return \DreamFactory\Core\Utility\ServiceResponse
@throws BadRequestException | [
"Handles",
"DELETE",
"actions",
"."
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L594-L625 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleFileContent | protected function handleFileContent(
$dest_path,
$dest_name,
$content,
$contentType = '',
$extract = false,
$clean = false,
$check_exist = false
){
$ext = FileUtilities::getFileExtension($dest_name);
if (empty($contentType)) {
$con... | php | protected function handleFileContent(
$dest_path,
$dest_name,
$content,
$contentType = '',
$extract = false,
$clean = false,
$check_exist = false
){
$ext = FileUtilities::getFileExtension($dest_name);
if (empty($contentType)) {
$con... | [
"protected",
"function",
"handleFileContent",
"(",
"$",
"dest_path",
",",
"$",
"dest_name",
",",
"$",
"content",
",",
"$",
"contentType",
"=",
"''",
",",
"$",
"extract",
"=",
"false",
",",
"$",
"clean",
"=",
"false",
",",
"$",
"check_exist",
"=",
"false"... | @param $dest_path
@param $dest_name
@param $content
@param string $contentType
@param bool $extract
@param bool $clean
@param bool $check_exist
@throws \Exception
@return array | [
"@param",
"$dest_path",
"@param",
"$dest_name",
"@param",
"$content",
"@param",
"string",
"$contentType",
"@param",
"bool",
"$extract",
"@param",
"bool",
"$clean",
"@param",
"bool",
"$check_exist"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L652-L688 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleFile | protected function handleFile(
$dest_path,
$dest_name,
$source_file,
$contentType = '',
$extract = false,
$clean = false,
$check_exist = false
){
$ext = FileUtilities::getFileExtension($source_file);
if (empty($contentType)) {
$cont... | php | protected function handleFile(
$dest_path,
$dest_name,
$source_file,
$contentType = '',
$extract = false,
$clean = false,
$check_exist = false
){
$ext = FileUtilities::getFileExtension($source_file);
if (empty($contentType)) {
$cont... | [
"protected",
"function",
"handleFile",
"(",
"$",
"dest_path",
",",
"$",
"dest_name",
",",
"$",
"source_file",
",",
"$",
"contentType",
"=",
"''",
",",
"$",
"extract",
"=",
"false",
",",
"$",
"clean",
"=",
"false",
",",
"$",
"check_exist",
"=",
"false",
... | @param $dest_path
@param $dest_name
@param $source_file
@param string $contentType
@param bool $extract
@param bool $clean
@param bool $check_exist
@throws \Exception
@return array | [
"@param",
"$dest_path",
"@param",
"$dest_name",
"@param",
"$source_file",
"@param",
"string",
"$contentType",
"@param",
"bool",
"$extract",
"@param",
"bool",
"$clean",
"@param",
"bool",
"$check_exist"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L702-L730 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleFolderContentFromFiles | protected function handleFolderContentFromFiles($files, $extract = false, $clean = false, $checkExist = false)
{
$out = [];
$err = [];
foreach ($files as $key => $file) {
$name = $file['name'];
$error = $file['error'];
if ($error == UPLOAD_ERR_OK) {
... | php | protected function handleFolderContentFromFiles($files, $extract = false, $clean = false, $checkExist = false)
{
$out = [];
$err = [];
foreach ($files as $key => $file) {
$name = $file['name'];
$error = $file['error'];
if ($error == UPLOAD_ERR_OK) {
... | [
"protected",
"function",
"handleFolderContentFromFiles",
"(",
"$",
"files",
",",
"$",
"extract",
"=",
"false",
",",
"$",
"clean",
"=",
"false",
",",
"$",
"checkExist",
"=",
"false",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"$",
"err",
"=",
"[",
"]",... | @param array $files
@param bool $extract
@param bool $clean
@param bool $checkExist
@return array
@throws \Exception | [
"@param",
"array",
"$files",
"@param",
"bool",
"$extract",
"@param",
"bool",
"$clean",
"@param",
"bool",
"$checkExist"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L741-L779 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.handleFolderContentFromData | protected function handleFolderContentFromData(
$data,
/** @noinspection PhpUnusedParameterInspection */
$extract = false,
/** @noinspection PhpUnusedParameterInspection */
$clean = false,
/** @noinspection PhpUnusedParameterInspection */
$checkExist = false
)... | php | protected function handleFolderContentFromData(
$data,
/** @noinspection PhpUnusedParameterInspection */
$extract = false,
/** @noinspection PhpUnusedParameterInspection */
$clean = false,
/** @noinspection PhpUnusedParameterInspection */
$checkExist = false
)... | [
"protected",
"function",
"handleFolderContentFromData",
"(",
"$",
"data",
",",
"/** @noinspection PhpUnusedParameterInspection */",
"$",
"extract",
"=",
"false",
",",
"/** @noinspection PhpUnusedParameterInspection */",
"$",
"clean",
"=",
"false",
",",
"/** @noinspection PhpUnu... | @param array $data
@param bool $extract
@param bool $clean
@param bool $checkExist
@return array | [
"@param",
"array",
"$data",
"@param",
"bool",
"$extract",
"@param",
"bool",
"$clean",
"@param",
"bool",
"$checkExist"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L789-L878 |
dreamfactorysoftware/df-file | src/Services/BaseFileService.php | BaseFileService.deleteFolderContent | protected function deleteFolderContent($data, $root = '', $force = false)
{
$root = FileUtilities::fixFolderPath($root);
$out = [];
if (!empty($data)) {
foreach ($data as $key => $resource) {
$path = array_get($resource, 'path');
$name = array_get(... | php | protected function deleteFolderContent($data, $root = '', $force = false)
{
$root = FileUtilities::fixFolderPath($root);
$out = [];
if (!empty($data)) {
foreach ($data as $key => $resource) {
$path = array_get($resource, 'path');
$name = array_get(... | [
"protected",
"function",
"deleteFolderContent",
"(",
"$",
"data",
",",
"$",
"root",
"=",
"''",
",",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"root",
"=",
"FileUtilities",
"::",
"fixFolderPath",
"(",
"$",
"root",
")",
";",
"$",
"out",
"=",
"[",
"]",... | @param array $data Array of sub-folder and file paths that are relative to the root folder
@param string $root root folder from which to delete
@param bool $force
@return array
@throws \DreamFactory\Core\Exceptions\BadRequestException | [
"@param",
"array",
"$data",
"Array",
"of",
"sub",
"-",
"folder",
"and",
"file",
"paths",
"that",
"are",
"relative",
"to",
"the",
"root",
"folder",
"@param",
"string",
"$root",
"root",
"folder",
"from",
"which",
"to",
"delete",
"@param",
"bool",
"$force"
] | train | https://github.com/dreamfactorysoftware/df-file/blob/e78aaec3e1d6585b5e7fe9b7646af4b1180ecd66/src/Services/BaseFileService.php#L888-L929 |
yuncms/framework | src/rest/models/UserSettingsForm.php | UserSettingsForm.validatePassword | public function validatePassword($attribute)
{
if (!$this->hasErrors()) {
if ($this->user === null || !PasswordHelper::validate($this->password, $this->user->password_hash)) {
$this->addError($attribute, Yii::t('yuncms', 'Invalid login or password'));
}
}
... | php | public function validatePassword($attribute)
{
if (!$this->hasErrors()) {
if ($this->user === null || !PasswordHelper::validate($this->password, $this->user->password_hash)) {
$this->addError($attribute, Yii::t('yuncms', 'Invalid login or password'));
}
}
... | [
"public",
"function",
"validatePassword",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasErrors",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"user",
"===",
"null",
"||",
"!",
"PasswordHelper",
"::",
"validate",
"(",
"$... | Validates the password.
This method serves as the inline validation for password.
@param string $attribute the attribute currently being validated | [
"Validates",
"the",
"password",
".",
"This",
"method",
"serves",
"as",
"the",
"inline",
"validation",
"for",
"password",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/models/UserSettingsForm.php#L63-L70 |
yuncms/framework | src/rest/models/UserSettingsForm.php | UserSettingsForm.save | public function save()
{
if ($this->validate()) {
$this->user->scenario = User::SCENARIO_PASSWORD;
$this->user->password = $this->new_password;
return $this->user->save();
}
return false;
} | php | public function save()
{
if ($this->validate()) {
$this->user->scenario = User::SCENARIO_PASSWORD;
$this->user->password = $this->new_password;
return $this->user->save();
}
return false;
} | [
"public",
"function",
"save",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"$",
"this",
"->",
"user",
"->",
"scenario",
"=",
"User",
"::",
"SCENARIO_PASSWORD",
";",
"$",
"this",
"->",
"user",
"->",
"password",
"=",
"... | Saves new account settings.
@return boolean | [
"Saves",
"new",
"account",
"settings",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/models/UserSettingsForm.php#L88-L96 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Helper/InstallHelper.php | InstallHelper.doInstall | public static function doInstall(&$oContainer, &$aData)
{
// init class vars
self::_init($oContainer, $aData);
// check provided database credentials
if (self::_checkDatabaseCredentials()) {
// write symfony's parameters.yml
sel... | php | public static function doInstall(&$oContainer, &$aData)
{
// init class vars
self::_init($oContainer, $aData);
// check provided database credentials
if (self::_checkDatabaseCredentials()) {
// write symfony's parameters.yml
sel... | [
"public",
"static",
"function",
"doInstall",
"(",
"&",
"$",
"oContainer",
",",
"&",
"$",
"aData",
")",
"{",
"// init class vars",
"self",
"::",
"_init",
"(",
"$",
"oContainer",
",",
"$",
"aData",
")",
";",
"// check provided database credentials",
"if",
"(",
... | @param $oContainer
@param $aData
@throws \Exception | [
"@param",
"$oContainer",
"@param",
"$aData"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Helper/InstallHelper.php#L45-L78 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Helper/InstallHelper.php | InstallHelper.resetAsseticConfig | private static function resetAsseticConfig()
{
return;
/**
* dev
*/
$aYaml = Yaml::parse(file_get_contents(self::$_container->get('kernel')->getRootDir() . '/config/config_dev.yml'));
$aYaml['assetic']['use_... | php | private static function resetAsseticConfig()
{
return;
/**
* dev
*/
$aYaml = Yaml::parse(file_get_contents(self::$_container->get('kernel')->getRootDir() . '/config/config_dev.yml'));
$aYaml['assetic']['use_... | [
"private",
"static",
"function",
"resetAsseticConfig",
"(",
")",
"{",
"return",
";",
"/**\n * dev\n */",
"$",
"aYaml",
"=",
"Yaml",
"::",
"parse",
"(",
"file_get_contents",
"(",
"self",
"::",
"$",
"_container",
"->",
"get",
"(",
"'kernel'",... | reset assitx-config not to use controller | [
"reset",
"assitx",
"-",
"config",
"not",
"to",
"use",
"controller"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Helper/InstallHelper.php#L99-L120 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Helper/InstallHelper.php | InstallHelper._saveControlUrl | private static function _saveControlUrl()
{
$oStatement = self::$_connection->prepare('INSERT INTO `system_settings` (`key` ,`value`)VALUES (:key, :value);');
$oResult = $oStatement->execute(array(
":key" => "control_url",
... | php | private static function _saveControlUrl()
{
$oStatement = self::$_connection->prepare('INSERT INTO `system_settings` (`key` ,`value`)VALUES (:key, :value);');
$oResult = $oStatement->execute(array(
":key" => "control_url",
... | [
"private",
"static",
"function",
"_saveControlUrl",
"(",
")",
"{",
"$",
"oStatement",
"=",
"self",
"::",
"$",
"_connection",
"->",
"prepare",
"(",
"'INSERT INTO `system_settings` (`key` ,`value`)VALUES (:key, :value);'",
")",
";",
"$",
"oResult",
"=",
"$",
"oStateme... | save control-url to database | [
"save",
"control",
"-",
"url",
"to",
"database"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Helper/InstallHelper.php#L184-L204 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Helper/InstallHelper.php | InstallHelper._saveSystemConfig | private static function _saveSystemConfig()
{
$sYmlDump = array(
'parameters' => array(
'database_driver' => self::checkEmpty(self::$_data['dbDriver']),
'database_host' => self::checkEmpty(self::$_data['dbHost']),
'da... | php | private static function _saveSystemConfig()
{
$sYmlDump = array(
'parameters' => array(
'database_driver' => self::checkEmpty(self::$_data['dbDriver']),
'database_host' => self::checkEmpty(self::$_data['dbHost']),
'da... | [
"private",
"static",
"function",
"_saveSystemConfig",
"(",
")",
"{",
"$",
"sYmlDump",
"=",
"array",
"(",
"'parameters'",
"=>",
"array",
"(",
"'database_driver'",
"=>",
"self",
"::",
"checkEmpty",
"(",
"self",
"::",
"$",
"_data",
"[",
"'dbDriver'",
"]",
")",
... | save systemconfig to parameters.yml | [
"save",
"systemconfig",
"to",
"parameters",
".",
"yml"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Helper/InstallHelper.php#L210-L237 |
slashworks/control-bundle | src/Slashworks/BackendBundle/Helper/InstallHelper.php | InstallHelper._createAdminUser | private static function _createAdminUser()
{
$oUser = new User();
$factory = self::$_container->get('security.encoder_factory');
$encoder = $factory->getEncoder($oUser);
$sSalt = $oUser->getSalt();
$sPassword = $encoder->encodePassword(sel... | php | private static function _createAdminUser()
{
$oUser = new User();
$factory = self::$_container->get('security.encoder_factory');
$encoder = $factory->getEncoder($oUser);
$sSalt = $oUser->getSalt();
$sPassword = $encoder->encodePassword(sel... | [
"private",
"static",
"function",
"_createAdminUser",
"(",
")",
"{",
"$",
"oUser",
"=",
"new",
"User",
"(",
")",
";",
"$",
"factory",
"=",
"self",
"::",
"$",
"_container",
"->",
"get",
"(",
"'security.encoder_factory'",
")",
";",
"$",
"encoder",
"=",
"$",... | create the admin user | [
"create",
"the",
"admin",
"user"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Helper/InstallHelper.php#L309-L343 |
uthando-cms/uthando-dompdf | src/UthandoDomPdf/Mvc/Service/ViewPdfRendererFactory.php | ViewPdfRendererFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
$resolver = $serviceLocator->get('ViewResolver');
$renderer = $serviceLocator->get('ViewRenderer');
$pdfRenderer = new PdfRenderer();
$pdfRenderer->setResolver($resolver);
$pdfRenderer->setHtmlR... | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
$resolver = $serviceLocator->get('ViewResolver');
$renderer = $serviceLocator->get('ViewRenderer');
$pdfRenderer = new PdfRenderer();
$pdfRenderer->setResolver($resolver);
$pdfRenderer->setHtmlR... | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"$",
"resolver",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'ViewResolver'",
")",
";",
"$",
"renderer",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"'... | Create and return the PDF view renderer
@param ServiceLocatorInterface $serviceLocator
@return PdfRenderer | [
"Create",
"and",
"return",
"the",
"PDF",
"view",
"renderer"
] | train | https://github.com/uthando-cms/uthando-dompdf/blob/60a750058c2db9ed167476192b20c7f544c32007/src/UthandoDomPdf/Mvc/Service/ViewPdfRendererFactory.php#L31-L42 |
windwork/wf-mailer | lib/adapter/Mail.php | Mail.send | public function send($to, $subject, $message, $from = '', $cc = '', $bcc = '')
{
$to = \wf\mailer\Helper::emailEncode($to);
$from = \wf\mailer\Helper::emailEncode($from);
$subject = \wf\mailer\Helper::encode($subject);
$headers = "From: {$from}\r\n";
$headers = "To: {$t... | php | public function send($to, $subject, $message, $from = '', $cc = '', $bcc = '')
{
$to = \wf\mailer\Helper::emailEncode($to);
$from = \wf\mailer\Helper::emailEncode($from);
$subject = \wf\mailer\Helper::encode($subject);
$headers = "From: {$from}\r\n";
$headers = "To: {$t... | [
"public",
"function",
"send",
"(",
"$",
"to",
",",
"$",
"subject",
",",
"$",
"message",
",",
"$",
"from",
"=",
"''",
",",
"$",
"cc",
"=",
"''",
",",
"$",
"bcc",
"=",
"''",
")",
"{",
"$",
"to",
"=",
"\\",
"wf",
"\\",
"mailer",
"\\",
"Helper",
... | {@inheritDoc}
@see \wf\mailer\MailerInterface::send() | [
"{"
] | train | https://github.com/windwork/wf-mailer/blob/71fbdb3bcb5bdc0a53fa8b4433c446828e205d22/lib/adapter/Mail.php#L35-L73 |
joseph-walker/vector | src/Control/Pattern.php | Pattern.__getType | protected static function __getType($param)
{
$type = is_object($param)
? get_class($param)
: gettype($param);
return $type === 'integer' ? 'int' : $type;
} | php | protected static function __getType($param)
{
$type = is_object($param)
? get_class($param)
: gettype($param);
return $type === 'integer' ? 'int' : $type;
} | [
"protected",
"static",
"function",
"__getType",
"(",
"$",
"param",
")",
"{",
"$",
"type",
"=",
"is_object",
"(",
"$",
"param",
")",
"?",
"get_class",
"(",
"$",
"param",
")",
":",
"gettype",
"(",
"$",
"param",
")",
";",
"return",
"$",
"type",
"===",
... | Get type OR class for params, as well as re-mapping inconsistencies
@param $param
@return string | [
"Get",
"type",
"OR",
"class",
"for",
"params",
"as",
"well",
"as",
"re",
"-",
"mapping",
"inconsistencies"
] | train | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Control/Pattern.php#L27-L34 |
joseph-walker/vector | src/Control/Pattern.php | Pattern.__match | protected static function __match(array $patterns)
{
return function (...$args) use ($patterns) {
$parameterTypes = array_map(self::getType(), $args);
try {
$keysToValues = Arrays::zip(array_keys($patterns), array_values($patterns));
list($key, $matc... | php | protected static function __match(array $patterns)
{
return function (...$args) use ($patterns) {
$parameterTypes = array_map(self::getType(), $args);
try {
$keysToValues = Arrays::zip(array_keys($patterns), array_values($patterns));
list($key, $matc... | [
"protected",
"static",
"function",
"__match",
"(",
"array",
"$",
"patterns",
")",
"{",
"return",
"function",
"(",
"...",
"$",
"args",
")",
"use",
"(",
"$",
"patterns",
")",
"{",
"$",
"parameterTypes",
"=",
"array_map",
"(",
"self",
"::",
"getType",
"(",
... | Pattern Matching. Use switch-case for explicit values, this for everything else.
@param array $patterns
@return mixed | [
"Pattern",
"Matching",
".",
"Use",
"switch",
"-",
"case",
"for",
"explicit",
"values",
"this",
"for",
"everything",
"else",
"."
] | train | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Control/Pattern.php#L41-L93 |
joseph-walker/vector | src/Control/Pattern.php | Pattern.unwrapArgs | private static function unwrapArgs(array $args) : array
{
$hasExtractable = false;
$unwrappedArgs = self::flatten(array_map(function ($arg) use (&$hasExtractable) {
if (method_exists($arg, 'extract')) {
$hasExtractable = true;
return $arg->extract();
... | php | private static function unwrapArgs(array $args) : array
{
$hasExtractable = false;
$unwrappedArgs = self::flatten(array_map(function ($arg) use (&$hasExtractable) {
if (method_exists($arg, 'extract')) {
$hasExtractable = true;
return $arg->extract();
... | [
"private",
"static",
"function",
"unwrapArgs",
"(",
"array",
"$",
"args",
")",
":",
"array",
"{",
"$",
"hasExtractable",
"=",
"false",
";",
"$",
"unwrappedArgs",
"=",
"self",
"::",
"flatten",
"(",
"array_map",
"(",
"function",
"(",
"$",
"arg",
")",
"use"... | Extracts args from Extractable values
@param array $args
@return array | [
"Extracts",
"args",
"from",
"Extractable",
"values"
] | train | https://github.com/joseph-walker/vector/blob/e349aa2e9e0535b1993f9fffc0476e7fd8e113fc/src/Control/Pattern.php#L100-L114 |
maniaplanet/maniaplanet-ws-sdk | libraries/Maniaplanet/WebServices/Rankings.php | Rankings.getMultiplayerPlayer | function getMultiplayerPlayer($titleId, $login)
{
if(!$login)
{
throw new Exception('Invalid login');
}
return $this->execute('GET', $this->getPrefixEndpoint($titleId).'/rankings/multiplayer/player/%s/?title=%s', array($login, $titleId));
} | php | function getMultiplayerPlayer($titleId, $login)
{
if(!$login)
{
throw new Exception('Invalid login');
}
return $this->execute('GET', $this->getPrefixEndpoint($titleId).'/rankings/multiplayer/player/%s/?title=%s', array($login, $titleId));
} | [
"function",
"getMultiplayerPlayer",
"(",
"$",
"titleId",
",",
"$",
"login",
")",
"{",
"if",
"(",
"!",
"$",
"login",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Invalid login'",
")",
";",
"}",
"return",
"$",
"this",
"->",
"execute",
"(",
"'GET'",
",",... | Get player ranking for the give title
@param string $titleId
@param string $login
@return Object
@throws Exception | [
"Get",
"player",
"ranking",
"for",
"the",
"give",
"title"
] | train | https://github.com/maniaplanet/maniaplanet-ws-sdk/blob/027a458388035fe66f2f56ff3ea1f85eff2a5a4e/libraries/Maniaplanet/WebServices/Rankings.php#L18-L25 |
webforge-labs/psc-cms | lib/Psc/Graph/EdgesList.php | EdgesList.remove | public function remove(Vertice $u, Vertice $v = NULL) {
if ($v == NULL) return $this->erase($u);
return $this;
} | php | public function remove(Vertice $u, Vertice $v = NULL) {
if ($v == NULL) return $this->erase($u);
return $this;
} | [
"public",
"function",
"remove",
"(",
"Vertice",
"$",
"u",
",",
"Vertice",
"$",
"v",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"v",
"==",
"NULL",
")",
"return",
"$",
"this",
"->",
"erase",
"(",
"$",
"u",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Entfernt die Kante von $u und $v
Ist $v nicht angegeben werden alle Kanten von $u entfernt | [
"Entfernt",
"die",
"Kante",
"von",
"$u",
"und",
"$v"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/EdgesList.php#L30-L33 |
webforge-labs/psc-cms | lib/Psc/Graph/EdgesList.php | EdgesList.erase | public function erase(Vertice $u) {
if (isset($this->lists[$u->label]))
unset($this->lists[$u->label]);
return $this;
} | php | public function erase(Vertice $u) {
if (isset($this->lists[$u->label]))
unset($this->lists[$u->label]);
return $this;
} | [
"public",
"function",
"erase",
"(",
"Vertice",
"$",
"u",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"lists",
"[",
"$",
"u",
"->",
"label",
"]",
")",
")",
"unset",
"(",
"$",
"this",
"->",
"lists",
"[",
"$",
"u",
"->",
"label",
"]",
... | Löscht alle Kanten von $u | [
"Löscht",
"alle",
"Kanten",
"von",
"$u"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Graph/EdgesList.php#L38-L43 |
yuncms/framework | src/admin/widgets/ActiveField.php | ActiveField.fileInput | public function fileInput($options = [])
{
$options = array_merge([
'class' => 'filestyle',
'data' => [
'buttonText' => Yii::t('app', 'Choose file'),
//'size' => 'lg'
]
], $options);
BootstrapFileStyleAsset::register($this->... | php | public function fileInput($options = [])
{
$options = array_merge([
'class' => 'filestyle',
'data' => [
'buttonText' => Yii::t('app', 'Choose file'),
//'size' => 'lg'
]
], $options);
BootstrapFileStyleAsset::register($this->... | [
"public",
"function",
"fileInput",
"(",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"[",
"'class'",
"=>",
"'filestyle'",
",",
"'data'",
"=>",
"[",
"'buttonText'",
"=>",
"Yii",
"::",
"t",
"(",
"'app'",
",",
"'Choose... | 显示文件上传窗口
@param array $options
@return \yii\bootstrap\ActiveField|ActiveField | [
"显示文件上传窗口"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/ActiveField.php#L29-L40 |
yuncms/framework | src/admin/widgets/ActiveField.php | ActiveField.dropDownList | public function dropDownList($items, $options = [], $generateDefault = true)
{
if ($generateDefault === true && !isset($options['prompt'])) {
$options['prompt'] = Yii::t('yuncms', 'Please select');
}
return parent::dropDownList($items, $options);
} | php | public function dropDownList($items, $options = [], $generateDefault = true)
{
if ($generateDefault === true && !isset($options['prompt'])) {
$options['prompt'] = Yii::t('yuncms', 'Please select');
}
return parent::dropDownList($items, $options);
} | [
"public",
"function",
"dropDownList",
"(",
"$",
"items",
",",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"generateDefault",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"generateDefault",
"===",
"true",
"&&",
"!",
"isset",
"(",
"$",
"options",
"[",
"'prompt'",... | 显示下拉
@param array $items
@param array $options
@param bool $generateDefault
@return \yii\bootstrap\ActiveField|ActiveField | [
"显示下拉"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/widgets/ActiveField.php#L91-L97 |
afrittella/back-project | src/app/Http/Middleware/Role.php | Role.handle | public function handle($request, Closure $next, $role, $permission = "")
{
if (Auth::guest()) {
return redirect()->guest('login');
}
if (!$request->user()->hasRole($role)) {
abort(403);
}
if (!empty($permission) and !$request->user()->can($permission... | php | public function handle($request, Closure $next, $role, $permission = "")
{
if (Auth::guest()) {
return redirect()->guest('login');
}
if (!$request->user()->hasRole($role)) {
abort(403);
}
if (!empty($permission) and !$request->user()->can($permission... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
",",
"$",
"role",
",",
"$",
"permission",
"=",
"\"\"",
")",
"{",
"if",
"(",
"Auth",
"::",
"guest",
"(",
")",
")",
"{",
"return",
"redirect",
"(",
")",
"->",
"guest",
... | Handle an incoming request.
@param \Illuminate\Http\Request $request
@param \Closure $next
@param $role
@param $permission
@return mixed | [
"Handle",
"an",
"incoming",
"request",
"."
] | train | https://github.com/afrittella/back-project/blob/e1aa2e3ee03d453033f75a4b16f073c60b5f32d1/src/app/Http/Middleware/Role.php#L19-L34 |
PortaText/php-sdk | src/PortaText/Command/Api/ContactLists.php | ContactLists.withNumber | public function withNumber($number, $variables = null)
{
if (!is_null($variables)) {
$vars = array();
foreach ($variables as $k => $v) {
$vars[] = array('key' => $k, 'value' => $v);
}
$this->setArgument("variables", $vars);
}
re... | php | public function withNumber($number, $variables = null)
{
if (!is_null($variables)) {
$vars = array();
foreach ($variables as $k => $v) {
$vars[] = array('key' => $k, 'value' => $v);
}
$this->setArgument("variables", $vars);
}
re... | [
"public",
"function",
"withNumber",
"(",
"$",
"number",
",",
"$",
"variables",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"variables",
")",
")",
"{",
"$",
"vars",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"variables",
"as",... | Add or remove this number to the contact list.
@param string $number Number.
@param array $variables variables.
@return PortaText\Command\ICommand | [
"Add",
"or",
"remove",
"this",
"number",
"to",
"the",
"contact",
"list",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/ContactLists.php#L52-L62 |
PortaText/php-sdk | src/PortaText/Command/Api/ContactLists.php | ContactLists.getEndpoint | protected function getEndpoint($method)
{
$endpoint = "contact_lists";
$contactListId = $this->getArgument("id");
if (!is_null($contactListId)) {
$endpoint = "contact_lists/$contactListId";
$this->delArgument("id");
}
$number = $this->getArgument("numb... | php | protected function getEndpoint($method)
{
$endpoint = "contact_lists";
$contactListId = $this->getArgument("id");
if (!is_null($contactListId)) {
$endpoint = "contact_lists/$contactListId";
$this->delArgument("id");
}
$number = $this->getArgument("numb... | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"\"contact_lists\"",
";",
"$",
"contactListId",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"id\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"contactListId"... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/ContactLists.php#L119-L143 |
dandisy/laravel-generator | src/Utils/TableFieldsGenerator.php | TableFieldsGenerator.detectManyToOne | private function detectManyToOne($tables, $modelTable)
{
$manyToOneRelations = [];
$foreignKeys = $modelTable->foreignKeys;
foreach ($foreignKeys as $foreignKey) {
$foreignTable = $foreignKey->foreignTable;
$foreignField = $foreignKey->foreignField;
if ... | php | private function detectManyToOne($tables, $modelTable)
{
$manyToOneRelations = [];
$foreignKeys = $modelTable->foreignKeys;
foreach ($foreignKeys as $foreignKey) {
$foreignTable = $foreignKey->foreignTable;
$foreignField = $foreignKey->foreignField;
if ... | [
"private",
"function",
"detectManyToOne",
"(",
"$",
"tables",
",",
"$",
"modelTable",
")",
"{",
"$",
"manyToOneRelations",
"=",
"[",
"]",
";",
"$",
"foreignKeys",
"=",
"$",
"modelTable",
"->",
"foreignKeys",
";",
"foreach",
"(",
"$",
"foreignKeys",
"as",
"... | Detect many to one relationship on model table
If foreign key of model table is primary key of foreign table.
@param GeneratorTable[] $tables
@param GeneratorTable $modelTable
@return array | [
"Detect",
"many",
"to",
"one",
"relationship",
"on",
"model",
"table",
"If",
"foreign",
"key",
"of",
"model",
"table",
"is",
"primary",
"key",
"of",
"foreign",
"table",
"."
] | train | https://github.com/dandisy/laravel-generator/blob/742797c8483bc88b54b6302a516a9a85eeb8579b/src/Utils/TableFieldsGenerator.php#L483-L504 |
ClanCats/Core | src/classes/CCModel.php | CCModel._prepare | protected static function _prepare( $setting, $class )
{
$settings['defaults'] = array();
$settings['types'] = array();
// get the default's, fix them and clean them.
if ( property_exists( $class, '_defaults') )
{
foreach( static::$_defaults as $key => $value )
{
if ( is_numeric( $key ) )
{
... | php | protected static function _prepare( $setting, $class )
{
$settings['defaults'] = array();
$settings['types'] = array();
// get the default's, fix them and clean them.
if ( property_exists( $class, '_defaults') )
{
foreach( static::$_defaults as $key => $value )
{
if ( is_numeric( $key ) )
{
... | [
"protected",
"static",
"function",
"_prepare",
"(",
"$",
"setting",
",",
"$",
"class",
")",
"{",
"$",
"settings",
"[",
"'defaults'",
"]",
"=",
"array",
"(",
")",
";",
"$",
"settings",
"[",
"'types'",
"]",
"=",
"array",
"(",
")",
";",
"// get the defaul... | Prepare the model
@param string $settings The model properties
@param string $class The class name.
@return array | [
"Prepare",
"the",
"model"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L66-L135 |
ClanCats/Core | src/classes/CCModel.php | CCModel.assign | public static function assign( $data )
{
// return null if we have no data
if ( $data === null || empty( $data ) )
{
return null;
}
// do we have a collection or a single result?
if ( CCArr::is_collection( $data ) )
{
$return = array();
foreach( $data as $key => $item )
{
$return[$k... | php | public static function assign( $data )
{
// return null if we have no data
if ( $data === null || empty( $data ) )
{
return null;
}
// do we have a collection or a single result?
if ( CCArr::is_collection( $data ) )
{
$return = array();
foreach( $data as $key => $item )
{
$return[$k... | [
"public",
"static",
"function",
"assign",
"(",
"$",
"data",
")",
"{",
"// return null if we have no data",
"if",
"(",
"$",
"data",
"===",
"null",
"||",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"return",
"null",
";",
"}",
"// do we have a collection or a singl... | Assign an model with some data
@param array $data
@return CCModel | [
"Assign",
"an",
"model",
"with",
"some",
"data"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L169-L190 |
ClanCats/Core | src/classes/CCModel.php | CCModel.__ | public function __( $key, $params = array() )
{
$namespace = explode( "\\", get_called_class() );
$class = strtolower( 'model/'.str_replace( '_', '/', array_pop( $namespace ) ) );
$namespace = implode( "\\", $namespace );
if ( $namespace )
{
$class = $namespace.'::'.$class;
}
return __( $class.'.... | php | public function __( $key, $params = array() )
{
$namespace = explode( "\\", get_called_class() );
$class = strtolower( 'model/'.str_replace( '_', '/', array_pop( $namespace ) ) );
$namespace = implode( "\\", $namespace );
if ( $namespace )
{
$class = $namespace.'::'.$class;
}
return __( $class.'.... | [
"public",
"function",
"__",
"(",
"$",
"key",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"namespace",
"=",
"explode",
"(",
"\"\\\\\"",
",",
"get_called_class",
"(",
")",
")",
";",
"$",
"class",
"=",
"strtolower",
"(",
"'model/'",
".",
... | Label translation helper
@param string $key
@param array $params
@return string | [
"Label",
"translation",
"helper"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L234-L248 |
ClanCats/Core | src/classes/CCModel.php | CCModel._assign | public function _assign( $data )
{
$data = $this->_before_assign( $data );
$types = static::_model( 'types' );
foreach( $data as $key => $value )
{
if ( array_key_exists( $key, $this->_data_store ) )
{
// do we have to to something with the data type?
if ( array_key_exists( $key, $types ) )... | php | public function _assign( $data )
{
$data = $this->_before_assign( $data );
$types = static::_model( 'types' );
foreach( $data as $key => $value )
{
if ( array_key_exists( $key, $this->_data_store ) )
{
// do we have to to something with the data type?
if ( array_key_exists( $key, $types ) )... | [
"public",
"function",
"_assign",
"(",
"$",
"data",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"_before_assign",
"(",
"$",
"data",
")",
";",
"$",
"types",
"=",
"static",
"::",
"_model",
"(",
"'types'",
")",
";",
"foreach",
"(",
"$",
"data",
"as"... | Assign an model with some data
@param array $data
@return self | [
"Assign",
"an",
"model",
"with",
"some",
"data"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L256-L277 |
ClanCats/Core | src/classes/CCModel.php | CCModel.strict_assign | public function strict_assign( array $fields, array $data )
{
foreach( $fields as $field )
{
if ( isset( $data[$field] ) )
{
$this->__set( $field, $data[$field] );
}
}
} | php | public function strict_assign( array $fields, array $data )
{
foreach( $fields as $field )
{
if ( isset( $data[$field] ) )
{
$this->__set( $field, $data[$field] );
}
}
} | [
"public",
"function",
"strict_assign",
"(",
"array",
"$",
"fields",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"field",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"field",
"]",
")",
")",
"{",
"$"... | Strict assign only sets some values out of an array.
This can be useful to easly set some values from post.
example:
$model->srtict_assign( array( 'name', 'description' ), CCIn::all( 'post' ) )
@param array $fields
@param array $data
@return void | [
"Strict",
"assign",
"only",
"sets",
"some",
"values",
"out",
"of",
"an",
"array",
".",
"This",
"can",
"be",
"useful",
"to",
"easly",
"set",
"some",
"values",
"from",
"post",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L290-L299 |
ClanCats/Core | src/classes/CCModel.php | CCModel._type_assignment_set | protected function _type_assignment_set( $type, $value )
{
switch ( $type )
{
case 'int':
case 'timestamp':
return (int) $value;
break;
case 'string':
return (string) $value;
break;
case 'bool':
return (bool) $value;
break;
// json datatype simply encode
case 'json':
... | php | protected function _type_assignment_set( $type, $value )
{
switch ( $type )
{
case 'int':
case 'timestamp':
return (int) $value;
break;
case 'string':
return (string) $value;
break;
case 'bool':
return (bool) $value;
break;
// json datatype simply encode
case 'json':
... | [
"protected",
"function",
"_type_assignment_set",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'int'",
":",
"case",
"'timestamp'",
":",
"return",
"(",
"int",
")",
"$",
"value",
";",
"break",
";",
"case",
... | Assign the data type in a set operation
@param string $type
@param mixed $value
@return mixed | [
"Assign",
"the",
"data",
"type",
"in",
"a",
"set",
"operation"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L308-L332 |
ClanCats/Core | src/classes/CCModel.php | CCModel._type_assignment_get | protected function _type_assignment_get( $type, $value )
{
switch ( $type )
{
case 'int':
case 'timestamp':
return (int) $value;
break;
case 'string':
return (string) $value;
break;
case 'bool':
return (bool) $value;
break;
// json datatype try to decode return array on fail... | php | protected function _type_assignment_get( $type, $value )
{
switch ( $type )
{
case 'int':
case 'timestamp':
return (int) $value;
break;
case 'string':
return (string) $value;
break;
case 'bool':
return (bool) $value;
break;
// json datatype try to decode return array on fail... | [
"protected",
"function",
"_type_assignment_get",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'int'",
":",
"case",
"'timestamp'",
":",
"return",
"(",
"int",
")",
"$",
"value",
";",
"break",
";",
"case",
... | Assign the data type in a get operation
@param string $type
@param mixed $value
@return mixed | [
"Assign",
"the",
"data",
"type",
"in",
"a",
"get",
"operation"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L341-L373 |
ClanCats/Core | src/classes/CCModel.php | CCModel.& | public function &__get( $key )
{
$value = null;
// check if the modifier exists
$has_modifier = method_exists( $this, '_get_modifier_'.$key );
// try getting the item
if ( array_key_exists( $key, $this->_data_store ) )
{
$value =& $this->_data_store[$key];
if ( $has_modifier )
{
$tmpvalue... | php | public function &__get( $key )
{
$value = null;
// check if the modifier exists
$has_modifier = method_exists( $this, '_get_modifier_'.$key );
// try getting the item
if ( array_key_exists( $key, $this->_data_store ) )
{
$value =& $this->_data_store[$key];
if ( $has_modifier )
{
$tmpvalue... | [
"public",
"function",
"&",
"__get",
"(",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"null",
";",
"// check if the modifier exists",
"$",
"has_modifier",
"=",
"method_exists",
"(",
"$",
"this",
",",
"'_get_modifier_'",
".",
"$",
"key",
")",
";",
"// try getting... | Get a value by key from the model data
@param string $key
@return mixed | [
"Get",
"a",
"value",
"by",
"key",
"from",
"the",
"model",
"data"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L390-L422 |
ClanCats/Core | src/classes/CCModel.php | CCModel.__isset | public function __isset( $key )
{
return ( array_key_exists( $key, $this->_data_store ) || method_exists( $this, '_get_modifier_'.$key ) ) ? true : false;
} | php | public function __isset( $key )
{
return ( array_key_exists( $key, $this->_data_store ) || method_exists( $this, '_get_modifier_'.$key ) ) ? true : false;
} | [
"public",
"function",
"__isset",
"(",
"$",
"key",
")",
"{",
"return",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_data_store",
")",
"||",
"method_exists",
"(",
"$",
"this",
",",
"'_get_modifier_'",
".",
"$",
"key",
")",
")",
"?"... | Check if model data isset
This also checks if a get modifier function exists which will also count as ture.
@param $key
@return bool | [
"Check",
"if",
"model",
"data",
"isset",
"This",
"also",
"checks",
"if",
"a",
"get",
"modifier",
"function",
"exists",
"which",
"will",
"also",
"count",
"as",
"ture",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L456-L459 |
ClanCats/Core | src/classes/CCModel.php | CCModel.raw | public function raw( $key = null )
{
if ( !is_null( $key ) )
{
if ( isset( $this->_data_store[$key] ) )
{
return $this->_data_store[$key];
}
throw new \InvalidArgumentException( "CCModel - Invalid or undefined model property '".$key."'." );
}
return $this->_data_store;
} | php | public function raw( $key = null )
{
if ( !is_null( $key ) )
{
if ( isset( $this->_data_store[$key] ) )
{
return $this->_data_store[$key];
}
throw new \InvalidArgumentException( "CCModel - Invalid or undefined model property '".$key."'." );
}
return $this->_data_store;
} | [
"public",
"function",
"raw",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_data_store",
"[",
"$",
"key",
"]",
")",
")",
"{",
"return",
"$",
"th... | Returns all raw data of the object or a single property
$model->raw();
$model->raw( 'key' );
@param string $key
@return array | [
"Returns",
"all",
"raw",
"data",
"of",
"the",
"object",
"or",
"a",
"single",
"property"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L470-L483 |
ClanCats/Core | src/classes/CCModel.php | CCModel.as_array | public function as_array( $modifiers = true )
{
$settings = static::_model();
// get the available keys
$keys = ( $this->_data_store );
// remove the hidden ones
$keys = array_diff_key( $keys, $settings['hidden'] );
// add this moment we can simply return when
// we dont wish to execute the modifiers... | php | public function as_array( $modifiers = true )
{
$settings = static::_model();
// get the available keys
$keys = ( $this->_data_store );
// remove the hidden ones
$keys = array_diff_key( $keys, $settings['hidden'] );
// add this moment we can simply return when
// we dont wish to execute the modifiers... | [
"public",
"function",
"as_array",
"(",
"$",
"modifiers",
"=",
"true",
")",
"{",
"$",
"settings",
"=",
"static",
"::",
"_model",
"(",
")",
";",
"// get the available keys",
"$",
"keys",
"=",
"(",
"$",
"this",
"->",
"_data_store",
")",
";",
"// remove the hi... | Get the object as array
When $modifiers is true, then the data will be passed trough the modifiers
@param bool $modifiers
@return array | [
"Get",
"the",
"object",
"as",
"array",
"When",
"$modifiers",
"is",
"true",
"then",
"the",
"data",
"will",
"be",
"passed",
"trough",
"the",
"modifiers"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L506-L536 |
ClanCats/Core | src/classes/CCModel.php | CCModel.as_json | public function as_json( $modifiers = true, $beautify = true )
{
return CCJson::encode( $this->as_array( $modifiers ), $beautify );
} | php | public function as_json( $modifiers = true, $beautify = true )
{
return CCJson::encode( $this->as_array( $modifiers ), $beautify );
} | [
"public",
"function",
"as_json",
"(",
"$",
"modifiers",
"=",
"true",
",",
"$",
"beautify",
"=",
"true",
")",
"{",
"return",
"CCJson",
"::",
"encode",
"(",
"$",
"this",
"->",
"as_array",
"(",
"$",
"modifiers",
")",
",",
"$",
"beautify",
")",
";",
"}"
... | Get the object as json
When $modifiers is true, then the data will be passed trough the modifiers
@param bool $modifiers
@param bool $beautify
@return string | [
"Get",
"the",
"object",
"as",
"json",
"When",
"$modifiers",
"is",
"true",
"then",
"the",
"data",
"will",
"be",
"passed",
"trough",
"the",
"modifiers"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCModel.php#L546-L549 |
spiral-modules/scaffolder | source/Scaffolder/Commands/RequestCommand.php | RequestCommand.parseField | private function parseField(string $field): array
{
$source = static::DEFAULT_SOURCE;
$type = static::DEFAULT_TYPE;
$origin = null;
if (strpos($field, '(') !== false) {
$source = substr($field, strpos($field, '(') + 1, -1);
$field = substr($field, 0, strpos($... | php | private function parseField(string $field): array
{
$source = static::DEFAULT_SOURCE;
$type = static::DEFAULT_TYPE;
$origin = null;
if (strpos($field, '(') !== false) {
$source = substr($field, strpos($field, '(') + 1, -1);
$field = substr($field, 0, strpos($... | [
"private",
"function",
"parseField",
"(",
"string",
"$",
"field",
")",
":",
"array",
"{",
"$",
"source",
"=",
"static",
"::",
"DEFAULT_SOURCE",
";",
"$",
"type",
"=",
"static",
"::",
"DEFAULT_TYPE",
";",
"$",
"origin",
"=",
"null",
";",
"if",
"(",
"str... | Parse field to fetch source, origin and type.
@param string $field
@return array | [
"Parse",
"field",
"to",
"fetch",
"source",
"origin",
"and",
"type",
"."
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Commands/RequestCommand.php#L69-L89 |
ufocoder/yii2-SyncSocial | src/actions/ActionSynchronize.php | ActionSynchronize.initialRedirectUrl | protected function initialRedirectUrl() {
$defaultUrl = '/'. $this->controller->id . '/' . $this->controller->defaultAction;
if (isset($this->controller->module->id) && !$this->controller->module instanceof Application) {
$defaultUrl = '/' . $this->controller->module->id . $defaultUrl;
... | php | protected function initialRedirectUrl() {
$defaultUrl = '/'. $this->controller->id . '/' . $this->controller->defaultAction;
if (isset($this->controller->module->id) && !$this->controller->module instanceof Application) {
$defaultUrl = '/' . $this->controller->module->id . $defaultUrl;
... | [
"protected",
"function",
"initialRedirectUrl",
"(",
")",
"{",
"$",
"defaultUrl",
"=",
"'/'",
".",
"$",
"this",
"->",
"controller",
"->",
"id",
".",
"'/'",
".",
"$",
"this",
"->",
"controller",
"->",
"defaultAction",
";",
"if",
"(",
"isset",
"(",
"$",
"... | Set default redirect url | [
"Set",
"default",
"redirect",
"url"
] | train | https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/actions/ActionSynchronize.php#L37-L53 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.