id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
198,500 | squareproton/Bond | lib/underscore.php | __.keys | public function keys($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
if(!is_object($collection) && !is_array($collection)) throw new Exception('Invalid object');
return self::_wrap(array_keys((array) $collection));
} | php | public function keys($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
if(!is_object($collection) && !is_array($collection)) throw new Exception('Invalid object');
return self::_wrap(array_keys((array) $collection));
} | [
"public",
"function",
"keys",
"(",
"$",
"collection",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"if",
"(",
"!",
"is_object",
"(",
"$",
"collection",... | Get the collection's keys | [
"Get",
"the",
"collection",
"s",
"keys"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L597-L603 |
198,501 | squareproton/Bond | lib/underscore.php | __.values | public function values($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(array_values((array) $collection));
} | php | public function values($collection=null) {
list($collection) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(array_values((array) $collection));
} | [
"public",
"function",
"values",
"(",
"$",
"collection",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"array_values"... | Get the collection's values | [
"Get",
"the",
"collection",
"s",
"values"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L607-L611 |
198,502 | squareproton/Bond | lib/underscore.php | __.extend | public function extend($object=null) {
$args = self::_wrapArgs(func_get_args(), 1);
$num_args = func_num_args();
if($num_args === 1) return $object;
$is_object = is_object($object);
$array = (array) $object;
$__ = new self;
$extensions = $__->rest(func_get_args());
foreach($ext... | php | public function extend($object=null) {
$args = self::_wrapArgs(func_get_args(), 1);
$num_args = func_num_args();
if($num_args === 1) return $object;
$is_object = is_object($object);
$array = (array) $object;
$__ = new self;
$extensions = $__->rest(func_get_args());
foreach($ext... | [
"public",
"function",
"extend",
"(",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"num_args",
"=",
"func_num_args",
"(",
")",
";",
"if",
"(",
"$",
"num_a... | Copy all properties from the source objects into the destination object | [
"Copy",
"all",
"properties",
"from",
"the",
"source",
"objects",
"into",
"the",
"destination",
"object"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L615-L630 |
198,503 | squareproton/Bond | lib/underscore.php | __.defaults | public function defaults($object=null) {
$args = self::_wrapArgs(func_get_args(), 1);
list($object) = $args;
$num_args = count($args);
if($num_args === 1) return $object;
$is_object = is_object($object);
$array = (array) $object;
$__ = new self;
$extensions = $__->rest($args);
... | php | public function defaults($object=null) {
$args = self::_wrapArgs(func_get_args(), 1);
list($object) = $args;
$num_args = count($args);
if($num_args === 1) return $object;
$is_object = is_object($object);
$array = (array) $object;
$__ = new self;
$extensions = $__->rest($args);
... | [
"public",
"function",
"defaults",
"(",
"$",
"object",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"list",
"(",
"$",
"object",
")",
"=",
"$",
"args",
";",
"$",
"num_args",
... | Returns the object with any missing values filled in using the defaults. | [
"Returns",
"the",
"object",
"with",
"any",
"missing",
"values",
"filled",
"in",
"using",
"the",
"defaults",
"."
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L634-L650 |
198,504 | squareproton/Bond | lib/underscore.php | __.clon | public function clon(&$object=null) {
list($object) = self::_wrapArgs(func_get_args(), 1);
$clone = null;
if(is_array($object)) $clone = (array) clone (object) $object;
elseif(!is_object($object)) $clone = $object;
elseif(!$clone) $clone = clone $object;
// shallow copy object
if(i... | php | public function clon(&$object=null) {
list($object) = self::_wrapArgs(func_get_args(), 1);
$clone = null;
if(is_array($object)) $clone = (array) clone (object) $object;
elseif(!is_object($object)) $clone = $object;
elseif(!$clone) $clone = clone $object;
// shallow copy object
if(i... | [
"public",
"function",
"clon",
"(",
"&",
"$",
"object",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"object",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"$",
"clone",
"=",
"null",
";",
"if",
"(",
"is_arra... | Returns a shallow copy of the object | [
"Returns",
"a",
"shallow",
"copy",
"of",
"the",
"object"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L664-L686 |
198,505 | squareproton/Bond | lib/underscore.php | __.tap | public function tap($object=null, $interceptor=null) {
list($object, $interceptor) = self::_wrapArgs(func_get_args(), 2);
$interceptor($object);
return self::_wrap($object);
} | php | public function tap($object=null, $interceptor=null) {
list($object, $interceptor) = self::_wrapArgs(func_get_args(), 2);
$interceptor($object);
return self::_wrap($object);
} | [
"public",
"function",
"tap",
"(",
"$",
"object",
"=",
"null",
",",
"$",
"interceptor",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"object",
",",
"$",
"interceptor",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
"... | Invokes the interceptor on the object, then returns the object | [
"Invokes",
"the",
"interceptor",
"on",
"the",
"object",
"then",
"returns",
"the",
"object"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L690-L695 |
198,506 | squareproton/Bond | lib/underscore.php | __.has | public function has($collection=null, $key=null) {
list($collection, $key) = self::_wrapArgs(func_get_args(), 2);
$collection = (array) self::_collection($collection);
return self::_wrap(array_key_exists($key, $collection));
} | php | public function has($collection=null, $key=null) {
list($collection, $key) = self::_wrapArgs(func_get_args(), 2);
$collection = (array) self::_collection($collection);
return self::_wrap(array_key_exists($key, $collection));
} | [
"public",
"function",
"has",
"(",
"$",
"collection",
"=",
"null",
",",
"$",
"key",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"collection",
",",
"$",
"key",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";",
"$... | Does the given key exist? | [
"Does",
"the",
"given",
"key",
"exist?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L699-L705 |
198,507 | squareproton/Bond | lib/underscore.php | __.isEqual | public function isEqual($a=null, $b=null) {
list($a, $b) = self::_wrapArgs(func_get_args(), 2);
if(isset($this) && isset($this->_chained) && $this->_chained) $a =& $this;
if($a === $b) return self::_wrap(true);
if(gettype($a) !== gettype($b)) return self::_wrap(false);
if(is_callable($a) !... | php | public function isEqual($a=null, $b=null) {
list($a, $b) = self::_wrapArgs(func_get_args(), 2);
if(isset($this) && isset($this->_chained) && $this->_chained) $a =& $this;
if($a === $b) return self::_wrap(true);
if(gettype($a) !== gettype($b)) return self::_wrap(false);
if(is_callable($a) !... | [
"public",
"function",
"isEqual",
"(",
"$",
"a",
"=",
"null",
",",
"$",
"b",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"a",
",",
"$",
"b",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";",
"if",
"(",
"isse... | Are these items equal? | [
"Are",
"these",
"items",
"equal?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L709-L738 |
198,508 | squareproton/Bond | lib/underscore.php | __.isEmpty | public function isEmpty($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_array($item) || is_object($item)) ? !((bool) count((array) $item)) : (!(bool) $item);
} | php | public function isEmpty($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_array($item) || is_object($item)) ? !((bool) count((array) $item)) : (!(bool) $item);
} | [
"public",
"function",
"isEmpty",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_array",
"(",
"$",... | Is this item empty? | [
"Is",
"this",
"item",
"empty?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L742-L746 |
198,509 | squareproton/Bond | lib/underscore.php | __.isObject | public function isObject($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_object($item));
} | php | public function isObject($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_object($item));
} | [
"public",
"function",
"isObject",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_object",
"(",
"$... | Is this item an object? | [
"Is",
"this",
"item",
"an",
"object?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L750-L753 |
198,510 | squareproton/Bond | lib/underscore.php | __.isArray | public function isArray($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_array($item));
} | php | public function isArray($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_array($item));
} | [
"public",
"function",
"isArray",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_array",
"(",
"$",... | Is this item an array? | [
"Is",
"this",
"item",
"an",
"array?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L757-L760 |
198,511 | squareproton/Bond | lib/underscore.php | __.isString | public function isString($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_string($item));
} | php | public function isString($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_string($item));
} | [
"public",
"function",
"isString",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_string",
"(",
"$... | Is this item a string? | [
"Is",
"this",
"item",
"a",
"string?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L764-L767 |
198,512 | squareproton/Bond | lib/underscore.php | __.isNumber | public function isNumber($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap((is_int($item) || is_float($item)) && !is_nan($item) && !is_infinite($item));
} | php | public function isNumber($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap((is_int($item) || is_float($item)) && !is_nan($item) && !is_infinite($item));
} | [
"public",
"function",
"isNumber",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"(",
"is_int",
"(",
... | Is this item a number? | [
"Is",
"this",
"item",
"a",
"number?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L771-L774 |
198,513 | squareproton/Bond | lib/underscore.php | __.isBoolean | public function isBoolean($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_bool($item));
} | php | public function isBoolean($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_bool($item));
} | [
"public",
"function",
"isBoolean",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_bool",
"(",
"$"... | Is this item a bool? | [
"Is",
"this",
"item",
"a",
"bool?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L778-L781 |
198,514 | squareproton/Bond | lib/underscore.php | __.isDate | public function isDate($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_object($item) && get_class($item) === 'DateTime');
} | php | public function isDate($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_object($item) && get_class($item) === 'DateTime');
} | [
"public",
"function",
"isDate",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_object",
"(",
"$",... | Is this item an instance of DateTime? | [
"Is",
"this",
"item",
"an",
"instance",
"of",
"DateTime?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L792-L795 |
198,515 | squareproton/Bond | lib/underscore.php | __.isNaN | public function isNaN($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_nan($item));
} | php | public function isNaN($item=null) {
list($item) = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(is_nan($item));
} | [
"public",
"function",
"isNaN",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"item",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"is_nan",
"(",
"$",
"... | Is this item a NaN value? | [
"Is",
"this",
"item",
"a",
"NaN",
"value?"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L799-L802 |
198,516 | squareproton/Bond | lib/underscore.php | __.identity | public function identity() {
$args = self::_wrapArgs(func_get_args(), 1);
if(is_array($args)) return self::_wrap($args[0]);
return self::_wrap(function($x) {
return $x;
});
} | php | public function identity() {
$args = self::_wrapArgs(func_get_args(), 1);
if(is_array($args)) return self::_wrap($args[0]);
return self::_wrap(function($x) {
return $x;
});
} | [
"public",
"function",
"identity",
"(",
")",
"{",
"$",
"args",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"args",
")",
")",
"return",
"self",
"::",
"_wrap",
"(",
"$",
"args",
... | Returns the same value passed as the argument | [
"Returns",
"the",
"same",
"value",
"passed",
"as",
"the",
"argument"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L806-L814 |
198,517 | squareproton/Bond | lib/underscore.php | __.times | public function times($n=null, $iterator=null) {
list($n, $iterator) = self::_wrapArgs(func_get_args(), 2);
if(is_null($n)) $n = 0;
for($i=0; $i<$n; $i++) $iterator($i);
return self::_wrap(null);
} | php | public function times($n=null, $iterator=null) {
list($n, $iterator) = self::_wrapArgs(func_get_args(), 2);
if(is_null($n)) $n = 0;
for($i=0; $i<$n; $i++) $iterator($i);
return self::_wrap(null);
} | [
"public",
"function",
"times",
"(",
"$",
"n",
"=",
"null",
",",
"$",
"iterator",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"n",
",",
"$",
"iterator",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";",
"if",
... | Invokes the iterator n times | [
"Invokes",
"the",
"iterator",
"n",
"times"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L830-L836 |
198,518 | squareproton/Bond | lib/underscore.php | __.templateSettings | public function templateSettings($settings=null) {
$_template_settings =& self::getInstance()->_template_settings;
if(is_null($settings)) {
$_template_settings = array(
'evaluate' => self::TEMPLATE_DEFAULT_EVALUATE,
'interpolate' => self::TEMPLATE_DEFAULT_INTERPOLATE,
'esca... | php | public function templateSettings($settings=null) {
$_template_settings =& self::getInstance()->_template_settings;
if(is_null($settings)) {
$_template_settings = array(
'evaluate' => self::TEMPLATE_DEFAULT_EVALUATE,
'interpolate' => self::TEMPLATE_DEFAULT_INTERPOLATE,
'esca... | [
"public",
"function",
"templateSettings",
"(",
"$",
"settings",
"=",
"null",
")",
"{",
"$",
"_template_settings",
"=",
"&",
"self",
"::",
"getInstance",
"(",
")",
"->",
"_template_settings",
";",
"if",
"(",
"is_null",
"(",
"$",
"settings",
")",
")",
"{",
... | Set template settings | [
"Set",
"template",
"settings"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L882-L900 |
198,519 | squareproton/Bond | lib/underscore.php | __.template | public function template($code=null, $context=null) {
list($code, $context) = self::_wrapArgs(func_get_args(), 2);
$class_name = __CLASS__;
$return = self::_wrap(function($context=null) use ($code, $class_name) {
$ts = $class_name::getInstance()->_template_settings;
// Wrap escaped,... | php | public function template($code=null, $context=null) {
list($code, $context) = self::_wrapArgs(func_get_args(), 2);
$class_name = __CLASS__;
$return = self::_wrap(function($context=null) use ($code, $class_name) {
$ts = $class_name::getInstance()->_template_settings;
// Wrap escaped,... | [
"public",
"function",
"template",
"(",
"$",
"code",
"=",
"null",
",",
"$",
"context",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"code",
",",
"$",
"context",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";",
"... | Compile templates into functions that can be evaluated for rendering | [
"Compile",
"templates",
"into",
"functions",
"that",
"can",
"be",
"evaluated",
"for",
"rendering"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L904-L947 |
198,520 | squareproton/Bond | lib/underscore.php | __.wrap | public function wrap($function=null, $wrapper=null) {
list($function, $wrapper) = self::_wrapArgs(func_get_args(), 2);
return self::_wrap(function() use ($wrapper, $function) {
$args = array_merge(array($function), func_get_args());
return call_user_func_array($wrapper, $args);
});
} | php | public function wrap($function=null, $wrapper=null) {
list($function, $wrapper) = self::_wrapArgs(func_get_args(), 2);
return self::_wrap(function() use ($wrapper, $function) {
$args = array_merge(array($function), func_get_args());
return call_user_func_array($wrapper, $args);
});
} | [
"public",
"function",
"wrap",
"(",
"$",
"function",
"=",
"null",
",",
"$",
"wrapper",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"function",
",",
"$",
"wrapper",
")",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"2",
")",
";",... | Wraps the function inside the wrapper function, passing it as the first argument | [
"Wraps",
"the",
"function",
"inside",
"the",
"wrapper",
"function",
"passing",
"it",
"as",
"the",
"first",
"argument"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L1033-L1040 |
198,521 | squareproton/Bond | lib/underscore.php | __.compose | public function compose() {
$functions = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(function() use ($functions) {
$args = func_get_args();
foreach($functions as $function) {
$args[0] = call_user_func_array($function, $args);
}
return $args[0];
});
} | php | public function compose() {
$functions = self::_wrapArgs(func_get_args(), 1);
return self::_wrap(function() use ($functions) {
$args = func_get_args();
foreach($functions as $function) {
$args[0] = call_user_func_array($function, $args);
}
return $args[0];
});
} | [
"public",
"function",
"compose",
"(",
")",
"{",
"$",
"functions",
"=",
"self",
"::",
"_wrapArgs",
"(",
"func_get_args",
"(",
")",
",",
"1",
")",
";",
"return",
"self",
"::",
"_wrap",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"functions",
")",
"{",
... | Returns the composition of the functions | [
"Returns",
"the",
"composition",
"of",
"the",
"functions"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L1044-L1054 |
198,522 | squareproton/Bond | lib/underscore.php | __._wrap | private function _wrap($val) {
if(isset($this) && isset($this->_chained) && $this->_chained) {
$this->_wrapped = $val;
return $this;
}
return $val;
} | php | private function _wrap($val) {
if(isset($this) && isset($this->_chained) && $this->_chained) {
$this->_wrapped = $val;
return $this;
}
return $val;
} | [
"private",
"function",
"_wrap",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"_chained",
")",
"&&",
"$",
"this",
"->",
"_chained",
")",
"{",
"$",
"this",
"->",
"_wrapped",
"=",
"$",
... | Value passed from one chained method to the next | [
"Value",
"passed",
"from",
"one",
"chained",
"method",
"to",
"the",
"next"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L1089-L1095 |
198,523 | squareproton/Bond | lib/underscore.php | __._wrapArgs | private function _wrapArgs($caller_args, $num_args=null) {
$num_args = (is_null($num_args)) ? count($caller_args) - 1 : $num_args;
$filled_args = array();
if(isset($this) && isset($this->_wrapped)) {
$filled_args[] =& $this->_wrapped;
}
if(count($caller_args) > 0) {
foreach($caller_... | php | private function _wrapArgs($caller_args, $num_args=null) {
$num_args = (is_null($num_args)) ? count($caller_args) - 1 : $num_args;
$filled_args = array();
if(isset($this) && isset($this->_wrapped)) {
$filled_args[] =& $this->_wrapped;
}
if(count($caller_args) > 0) {
foreach($caller_... | [
"private",
"function",
"_wrapArgs",
"(",
"$",
"caller_args",
",",
"$",
"num_args",
"=",
"null",
")",
"{",
"$",
"num_args",
"=",
"(",
"is_null",
"(",
"$",
"num_args",
")",
")",
"?",
"count",
"(",
"$",
"caller_args",
")",
"-",
"1",
":",
"$",
"num_args"... | because this function understands both OO-style and functional calls | [
"because",
"this",
"function",
"understands",
"both",
"OO",
"-",
"style",
"and",
"functional",
"calls"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L1100-L1114 |
198,524 | squareproton/Bond | lib/underscore.php | __._collection | private function _collection($collection) {
return (!is_array($collection) && !is_object($collection)) ? str_split((string) $collection) : $collection;
} | php | private function _collection($collection) {
return (!is_array($collection) && !is_object($collection)) ? str_split((string) $collection) : $collection;
} | [
"private",
"function",
"_collection",
"(",
"$",
"collection",
")",
"{",
"return",
"(",
"!",
"is_array",
"(",
"$",
"collection",
")",
"&&",
"!",
"is_object",
"(",
"$",
"collection",
")",
")",
"?",
"str_split",
"(",
"(",
"string",
")",
"$",
"collection",
... | Get a collection in a way that supports strings | [
"Get",
"a",
"collection",
"in",
"a",
"way",
"that",
"supports",
"strings"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/lib/underscore.php#L1118-L1120 |
198,525 | jabernardo/console.php | src/Console/Input.php | Input.hasFlag | public function hasFlag($flag) {
if (!is_string($flag)) {
throw new \Console\Exception\InvalidArgument('Parameter must be string.');
}
return in_array($flag, $this->_flags);
} | php | public function hasFlag($flag) {
if (!is_string($flag)) {
throw new \Console\Exception\InvalidArgument('Parameter must be string.');
}
return in_array($flag, $this->_flags);
} | [
"public",
"function",
"hasFlag",
"(",
"$",
"flag",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"flag",
")",
")",
"{",
"throw",
"new",
"\\",
"Console",
"\\",
"Exception",
"\\",
"InvalidArgument",
"(",
"'Parameter must be string.'",
")",
";",
"}",
"re... | Check if flag exists
@access public
@param string $flag Flag to be checked
@return boolean True / False
@throws \Console\Exception\InvalidArgument Parameter must be string | [
"Check",
"if",
"flag",
"exists"
] | a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c | https://github.com/jabernardo/console.php/blob/a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c/src/Console/Input.php#L110-L116 |
198,526 | jabernardo/console.php | src/Console/Input.php | Input.hasOption | public function hasOption($option) {
if (!is_string($option)) {
throw new \Console\Exception\InvalidArgument('Parameter must be string.');
}
return isset($this->_options[$option]);
} | php | public function hasOption($option) {
if (!is_string($option)) {
throw new \Console\Exception\InvalidArgument('Parameter must be string.');
}
return isset($this->_options[$option]);
} | [
"public",
"function",
"hasOption",
"(",
"$",
"option",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"option",
")",
")",
"{",
"throw",
"new",
"\\",
"Console",
"\\",
"Exception",
"\\",
"InvalidArgument",
"(",
"'Parameter must be string.'",
")",
";",
"}",... | Check if option exists
@access public
@param string $option Option name
@return boolean True / False
@throws \Console\Exception\InvalidArgument Parameter must be string | [
"Check",
"if",
"option",
"exists"
] | a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c | https://github.com/jabernardo/console.php/blob/a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c/src/Console/Input.php#L126-L132 |
198,527 | jabernardo/console.php | src/Console/Input.php | Input.hasOptions | public function hasOptions(array $options) {
$all = true;
foreach ($options as $option) {
if (!isset($this->_options[$option])) {
$all = false;
}
}
return $all;
} | php | public function hasOptions(array $options) {
$all = true;
foreach ($options as $option) {
if (!isset($this->_options[$option])) {
$all = false;
}
}
return $all;
} | [
"public",
"function",
"hasOptions",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"all",
"=",
"true",
";",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_options",
"[",
"$",
"option"... | Check if multiple options are given in the command-line arguments
@access public
@param array $options Options to be check
@return boolean True / False | [
"Check",
"if",
"multiple",
"options",
"are",
"given",
"in",
"the",
"command",
"-",
"line",
"arguments"
] | a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c | https://github.com/jabernardo/console.php/blob/a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c/src/Console/Input.php#L141-L151 |
198,528 | jabernardo/console.php | src/Console/Input.php | Input.getOption | public function getOption($option) {
return isset($this->_options[$option]) ?
$this->_options[$option] :
null;
} | php | public function getOption($option) {
return isset($this->_options[$option]) ?
$this->_options[$option] :
null;
} | [
"public",
"function",
"getOption",
"(",
"$",
"option",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_options",
"[",
"$",
"option",
"]",
")",
"?",
"$",
"this",
"->",
"_options",
"[",
"$",
"option",
"]",
":",
"null",
";",
"}"
] | Get option value
@access public
@param string $option Option name
@return mixed | [
"Get",
"option",
"value"
] | a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c | https://github.com/jabernardo/console.php/blob/a526458f4d1a525d0ccff62cd9cfcfbc5526bc9c/src/Console/Input.php#L160-L164 |
198,529 | makinacorpus/drupal-apubsub | src/Notification/AbstractNotificationFormatter.php | AbstractNotificationFormatter.getUserAccountName | protected function getUserAccountName(NotificationInterface $notification, $keyInData = 'uid')
{
$names = [];
$count = 0;
if (isset($notification[$keyInData])) {
$uidList = $notification[$keyInData];
$count = count($uidList);
if (!is_array($uidList)... | php | protected function getUserAccountName(NotificationInterface $notification, $keyInData = 'uid')
{
$names = [];
$count = 0;
if (isset($notification[$keyInData])) {
$uidList = $notification[$keyInData];
$count = count($uidList);
if (!is_array($uidList)... | [
"protected",
"function",
"getUserAccountName",
"(",
"NotificationInterface",
"$",
"notification",
",",
"$",
"keyInData",
"=",
"'uid'",
")",
"{",
"$",
"names",
"=",
"[",
"]",
";",
"$",
"count",
"=",
"0",
";",
"if",
"(",
"isset",
"(",
"$",
"notification",
... | Return user account name for given uid
@param NotificationInterface $notification
@param string $keyInData
Key in notification data in which to search for user names
@return string | [
"Return",
"user",
"account",
"name",
"for",
"given",
"uid"
] | 534fbecf67c880996ae02210c0bfdb3e0d3699b6 | https://github.com/makinacorpus/drupal-apubsub/blob/534fbecf67c880996ae02210c0bfdb3e0d3699b6/src/Notification/AbstractNotificationFormatter.php#L90-L114 |
198,530 | makinacorpus/drupal-apubsub | src/Notification/AbstractNotificationFormatter.php | AbstractNotificationFormatter.getTitleString | protected function getTitleString($titles, $count)
{
$limit = $this->getLimit();
$okCount = count($titles);
$missing = $count - $okCount;
$andCount = max([0, $okCount - $limit]) + $missing;
if (!$okCount) {
list($singular, $plural) = $this->getTypeLa... | php | protected function getTitleString($titles, $count)
{
$limit = $this->getLimit();
$okCount = count($titles);
$missing = $count - $okCount;
$andCount = max([0, $okCount - $limit]) + $missing;
if (!$okCount) {
list($singular, $plural) = $this->getTypeLa... | [
"protected",
"function",
"getTitleString",
"(",
"$",
"titles",
",",
"$",
"count",
")",
"{",
"$",
"limit",
"=",
"$",
"this",
"->",
"getLimit",
"(",
")",
";",
"$",
"okCount",
"=",
"count",
"(",
"$",
"titles",
")",
";",
"$",
"missing",
"=",
"$",
"coun... | Get title string
@param string $titles
@param int $count
@return string | [
"Get",
"title",
"string"
] | 534fbecf67c880996ae02210c0bfdb3e0d3699b6 | https://github.com/makinacorpus/drupal-apubsub/blob/534fbecf67c880996ae02210c0bfdb3e0d3699b6/src/Notification/AbstractNotificationFormatter.php#L135-L164 |
198,531 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.addFieldError | public function addFieldError($failureCode, $fieldResolved, $fieldType, $fieldTitle, $value, $defaultErrorMessage)
{
$this->errors[] = new FieldValidationError($failureCode, $fieldResolved, $fieldType, $fieldTitle, $value, $defaultErrorMessage);
return $this;
} | php | public function addFieldError($failureCode, $fieldResolved, $fieldType, $fieldTitle, $value, $defaultErrorMessage)
{
$this->errors[] = new FieldValidationError($failureCode, $fieldResolved, $fieldType, $fieldTitle, $value, $defaultErrorMessage);
return $this;
} | [
"public",
"function",
"addFieldError",
"(",
"$",
"failureCode",
",",
"$",
"fieldResolved",
",",
"$",
"fieldType",
",",
"$",
"fieldTitle",
",",
"$",
"value",
",",
"$",
"defaultErrorMessage",
")",
"{",
"$",
"this",
"->",
"errors",
"[",
"]",
"=",
"new",
"Fi... | Adds an error that is associated with a form field.
@param string $failureCode The code or slug that identifies this error's failure cause
@param string $fieldResolved The machine-readable error code that uniquely identifies the error
@param string $fieldType Can be 'field', 'meta', or 'tag' to... | [
"Adds",
"an",
"error",
"that",
"is",
"associated",
"with",
"a",
"form",
"field",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L93-L97 |
198,532 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.addErrors | public function addErrors(array $errors)
{
foreach ($errors as $error) {
if (!$error instanceof ValidationError)
throw new Exception('Error was not instance of ValidationError: '.$error);
if (!in_array($error, $this->errors))
$this->errors[] = $error;
... | php | public function addErrors(array $errors)
{
foreach ($errors as $error) {
if (!$error instanceof ValidationError)
throw new Exception('Error was not instance of ValidationError: '.$error);
if (!in_array($error, $this->errors))
$this->errors[] = $error;
... | [
"public",
"function",
"addErrors",
"(",
"array",
"$",
"errors",
")",
"{",
"foreach",
"(",
"$",
"errors",
"as",
"$",
"error",
")",
"{",
"if",
"(",
"!",
"$",
"error",
"instanceof",
"ValidationError",
")",
"throw",
"new",
"Exception",
"(",
"'Error was not ins... | Adds more than one error to the collection of errors
@param array $errors Each object in the array must be of type ValidationError
@return this | [
"Adds",
"more",
"than",
"one",
"error",
"to",
"the",
"collection",
"of",
"errors"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L119-L129 |
198,533 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.hasFieldError | public function hasFieldError($field)
{
foreach ((array)$this->errors as $err) {
if ($err instanceof FieldValidationError) {
$tfield = $err->getFieldResolved();
if($tfield == $field)
return true;
}
}
return false;
... | php | public function hasFieldError($field)
{
foreach ((array)$this->errors as $err) {
if ($err instanceof FieldValidationError) {
$tfield = $err->getFieldResolved();
if($tfield == $field)
return true;
}
}
return false;
... | [
"public",
"function",
"hasFieldError",
"(",
"$",
"field",
")",
"{",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"errors",
"as",
"$",
"err",
")",
"{",
"if",
"(",
"$",
"err",
"instanceof",
"FieldValidationError",
")",
"{",
"$",
"tfield",
"=",
... | Determines if an error has occurred for the supplied field already
@param $field Field name
@return boolean | [
"Determines",
"if",
"an",
"error",
"has",
"occurred",
"for",
"the",
"supplied",
"field",
"already"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L147-L159 |
198,534 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.getErrorsAsArray | public function getErrorsAsArray()
{
$errors = array();
$errors['HasErrors'] = $this->hasErrors();
$errors['ErrorCount'] = $this->getErrorCount();
$errors['Errors'] = (array)$this->errors;
/*
$errors['ErrorString'] = '';
$errors['FieldErrorString'] = '';
... | php | public function getErrorsAsArray()
{
$errors = array();
$errors['HasErrors'] = $this->hasErrors();
$errors['ErrorCount'] = $this->getErrorCount();
$errors['Errors'] = (array)$this->errors;
/*
$errors['ErrorString'] = '';
$errors['FieldErrorString'] = '';
... | [
"public",
"function",
"getErrorsAsArray",
"(",
")",
"{",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"errors",
"[",
"'HasErrors'",
"]",
"=",
"$",
"this",
"->",
"hasErrors",
"(",
")",
";",
"$",
"errors",
"[",
"'ErrorCount'",
"]",
"=",
"$",
"this"... | Extracts the errors from the collection as ValidationErrors into simple arrays
@return array | [
"Extracts",
"the",
"errors",
"from",
"the",
"collection",
"as",
"ValidationErrors",
"into",
"simple",
"arrays"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L178-L220 |
198,535 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.toString | public function toString()
{
$errorString = '';
foreach ((array)$this->errors as $err) {
$errorString .= $err->getDefaultErrorMessage().", ";
}
return substr($errorString, 0, -2);
} | php | public function toString()
{
$errorString = '';
foreach ((array)$this->errors as $err) {
$errorString .= $err->getDefaultErrorMessage().", ";
}
return substr($errorString, 0, -2);
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"errorString",
"=",
"''",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"this",
"->",
"errors",
"as",
"$",
"err",
")",
"{",
"$",
"errorString",
".=",
"$",
"err",
"->",
"getDefaultErrorMessage",
"(",
... | Returns a string that's a combination of all errors
@return string | [
"Returns",
"a",
"string",
"that",
"s",
"a",
"combination",
"of",
"all",
"errors"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L227-L234 |
198,536 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.rejectField | public function rejectField($errorCode, $fieldResolved, $fieldTitle, $value, $message = '')
{
$this->addFieldError($errorCode, $fieldResolved, 'field', $fieldTitle, $value, $message==''?"$fieldTitle is required.":$message);
return $this;
} | php | public function rejectField($errorCode, $fieldResolved, $fieldTitle, $value, $message = '')
{
$this->addFieldError($errorCode, $fieldResolved, 'field', $fieldTitle, $value, $message==''?"$fieldTitle is required.":$message);
return $this;
} | [
"public",
"function",
"rejectField",
"(",
"$",
"errorCode",
",",
"$",
"fieldResolved",
",",
"$",
"fieldTitle",
",",
"$",
"value",
",",
"$",
"message",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"addFieldError",
"(",
"$",
"errorCode",
",",
"$",
"fieldResolve... | Adds a field error to the specified field
@param string $errorCode The error code to use
@param string $fieldResolved The machine readable field identifier
@param string $fieldTitle The human readable field name
@param string $value The value to check
@param string $message (optional) A default er... | [
"Adds",
"a",
"field",
"error",
"to",
"the",
"specified",
"field"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L315-L319 |
198,537 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/validation/Errors.php | Errors.validateModelObject | public function validateModelObject(ModelObject $model)
{
$fields = $model->getPersistentFields();
foreach ( $fields as $fieldName ) {
$value = $model->$fieldName;
$fieldResolved = get_class($model).'.'.$fieldName;
$this->rejectIfInvalid($fieldResolved,... | php | public function validateModelObject(ModelObject $model)
{
$fields = $model->getPersistentFields();
foreach ( $fields as $fieldName ) {
$value = $model->$fieldName;
$fieldResolved = get_class($model).'.'.$fieldName;
$this->rejectIfInvalid($fieldResolved,... | [
"public",
"function",
"validateModelObject",
"(",
"ModelObject",
"$",
"model",
")",
"{",
"$",
"fields",
"=",
"$",
"model",
"->",
"getPersistentFields",
"(",
")",
";",
"foreach",
"(",
"$",
"fields",
"as",
"$",
"fieldName",
")",
"{",
"$",
"value",
"=",
"$"... | Validates the model object, rejecting the fields that fail validation
@param ModelObject $model The object to validate
@return void | [
"Validates",
"the",
"model",
"object",
"rejecting",
"the",
"fields",
"that",
"fail",
"validation"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/validation/Errors.php#L366-L381 |
198,538 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.wordsTokenized | public static function wordsTokenized($string)
{
for ($tokens = array(), $nextToken = strtok($string, ' '); $nextToken !== false; $nextToken = strtok(' ')) {
if ($nextToken{0} == '"')
$nextToken = $nextToken{strlen($nextToken)-1} == '"' ?
'"' . sub... | php | public static function wordsTokenized($string)
{
for ($tokens = array(), $nextToken = strtok($string, ' '); $nextToken !== false; $nextToken = strtok(' ')) {
if ($nextToken{0} == '"')
$nextToken = $nextToken{strlen($nextToken)-1} == '"' ?
'"' . sub... | [
"public",
"static",
"function",
"wordsTokenized",
"(",
"$",
"string",
")",
"{",
"for",
"(",
"$",
"tokens",
"=",
"array",
"(",
")",
",",
"$",
"nextToken",
"=",
"strtok",
"(",
"$",
"string",
",",
"' '",
")",
";",
"$",
"nextToken",
"!==",
"false",
";",
... | Splits a string into an array, exploded by spaces.
However, it takes "quoted strings" into account,
will count them as a single item.
@param string $string String to split
@see http://us2.php.net/manual/en/function.strtok.php#53244
@author brian dot cairns dot remove dot this at commerx dot com
@return array An a... | [
"Splits",
"a",
"string",
"into",
"an",
"array",
"exploded",
"by",
"spaces",
".",
"However",
"it",
"takes",
"quoted",
"strings",
"into",
"account",
"will",
"count",
"them",
"as",
"a",
"single",
"item",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L106-L117 |
198,539 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.smartSplit | public static function smartSplit($data, $delimiter = ';', $quote = "'", $escape = "\\'", $limit = null)
{
$results = array ();
// Split like normal to start.
$lines = explode($delimiter, $data);
if (empty ($lines))
return array ();
$broke = false;
for ... | php | public static function smartSplit($data, $delimiter = ';', $quote = "'", $escape = "\\'", $limit = null)
{
$results = array ();
// Split like normal to start.
$lines = explode($delimiter, $data);
if (empty ($lines))
return array ();
$broke = false;
for ... | [
"public",
"static",
"function",
"smartSplit",
"(",
"$",
"data",
",",
"$",
"delimiter",
"=",
"';'",
",",
"$",
"quote",
"=",
"\"'\"",
",",
"$",
"escape",
"=",
"\"\\\\'\"",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"results",
"=",
"array",
"(",
"... | Split a string around a delimiter, taking into account quoted substrings
@param string $data big string with data
@param string $delimiter Field delimiter
@param string $quote quote field character
@param string $escape escaped quote character
@param int $limit Return at most this many parts
@retur... | [
"Split",
"a",
"string",
"around",
"a",
"delimiter",
"taking",
"into",
"account",
"quoted",
"substrings"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L131-L169 |
198,540 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.lineIsOpenQuoted | public static function lineIsOpenQuoted($line, $quote, $escape)
{
// Returns TRUE if line is valid
$pos = 0;
$quote_open = false;
$esc_len = strlen($escape);
for (; $pos < strlen($line); ++ $pos) {
$char = $line[$pos];
// If the character i... | php | public static function lineIsOpenQuoted($line, $quote, $escape)
{
// Returns TRUE if line is valid
$pos = 0;
$quote_open = false;
$esc_len = strlen($escape);
for (; $pos < strlen($line); ++ $pos) {
$char = $line[$pos];
// If the character i... | [
"public",
"static",
"function",
"lineIsOpenQuoted",
"(",
"$",
"line",
",",
"$",
"quote",
",",
"$",
"escape",
")",
"{",
"// Returns TRUE if line is valid",
"$",
"pos",
"=",
"0",
";",
"$",
"quote_open",
"=",
"false",
";",
"$",
"esc_len",
"=",
"strlen",
"(",
... | Determines if a line is "open-quoted" and continues to the next line.
Most useful for parsing CSV files.
@param string $line The line to examine
@param string $quote The quote character (must be one character)
@param string $escape The escape character or character set
@return void | [
"Determines",
"if",
"a",
"line",
"is",
"open",
"-",
"quoted",
"and",
"continues",
"to",
"the",
"next",
"line",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L182-L209 |
198,541 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.smartExplode | public static function smartExplode($string)
{
if (empty($string))
return array();
if (is_array($string))
return $string;
if (!is_array($string)) {
if (strpos($string, ';') !== false)
return explode(';', trim($string, ';'));
... | php | public static function smartExplode($string)
{
if (empty($string))
return array();
if (is_array($string))
return $string;
if (!is_array($string)) {
if (strpos($string, ';') !== false)
return explode(';', trim($string, ';'));
... | [
"public",
"static",
"function",
"smartExplode",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"string",
")",
")",
"return",
"array",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"string",
")",
")",
"return",
"$",
"string",
";",
"if... | Explodes a string into an array split upon ';' or ',' characters
@param string $string The string to *EXPLODE*
@return array | [
"Explodes",
"a",
"string",
"into",
"an",
"array",
"split",
"upon",
";",
"or",
"characters"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L366-L383 |
198,542 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.pluralize | public static function pluralize($word)
{
$plural = array(
'/(quiz)$/i' => '\1zes',
'/^(ox)$/i' => '\1en',
'/([m|l])ouse$/i' => '\1ice',
'/(matr|vert|ind)ix|ex$/i' => '\1ices',
'/(x|ch|ss|sh)$/i' => '\1es',
'/([^aeiouy]|qu)ies$/i' => '\1y',
'/([^aeiouy... | php | public static function pluralize($word)
{
$plural = array(
'/(quiz)$/i' => '\1zes',
'/^(ox)$/i' => '\1en',
'/([m|l])ouse$/i' => '\1ice',
'/(matr|vert|ind)ix|ex$/i' => '\1ices',
'/(x|ch|ss|sh)$/i' => '\1es',
'/([^aeiouy]|qu)ies$/i' => '\1y',
'/([^aeiouy... | [
"public",
"static",
"function",
"pluralize",
"(",
"$",
"word",
")",
"{",
"$",
"plural",
"=",
"array",
"(",
"'/(quiz)$/i'",
"=>",
"'\\1zes'",
",",
"'/^(ox)$/i'",
"=>",
"'\\1en'",
",",
"'/([m|l])ouse$/i'",
"=>",
"'\\1ice'",
",",
"'/(matr|vert|ind)ix|ex$/i'",
"=>",... | Takes a word, and makes it plural.
@param string $word The word to pluralize
@return string | [
"Takes",
"a",
"word",
"and",
"makes",
"it",
"plural",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L533-L584 |
198,543 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.strToBool | public static function strToBool($string)
{
if(is_bool($string))
return $string;
if (in_array(strtolower((string)$string), array('1', 'true', 'on', '+', 'yes', 'y')))
return true;
elseif (in_array(strtolower((string)$string), array('', '0','false', 'off', '-', 'no', ... | php | public static function strToBool($string)
{
if(is_bool($string))
return $string;
if (in_array(strtolower((string)$string), array('1', 'true', 'on', '+', 'yes', 'y')))
return true;
elseif (in_array(strtolower((string)$string), array('', '0','false', 'off', '-', 'no', ... | [
"public",
"static",
"function",
"strToBool",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"is_bool",
"(",
"$",
"string",
")",
")",
"return",
"$",
"string",
";",
"if",
"(",
"in_array",
"(",
"strtolower",
"(",
"(",
"string",
")",
"$",
"string",
")",
",",
... | Translates the given string into a boolean value if it's in the proper format
@param string $string The string to convert
@return boolean true or false, translated
@throws Exception if string cannot be converted | [
"Translates",
"the",
"given",
"string",
"into",
"a",
"boolean",
"value",
"if",
"it",
"s",
"in",
"the",
"proper",
"format"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L594-L605 |
198,544 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.stripslashesDeep | public static function stripslashesDeep($value)
{
$value = is_array($value) ?
array_map(array('StringUtils', 'stripslashesDeep'), $value) :
stripslashes($value);
return $value;
} | php | public static function stripslashesDeep($value)
{
$value = is_array($value) ?
array_map(array('StringUtils', 'stripslashesDeep'), $value) :
stripslashes($value);
return $value;
} | [
"public",
"static",
"function",
"stripslashesDeep",
"(",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"is_array",
"(",
"$",
"value",
")",
"?",
"array_map",
"(",
"array",
"(",
"'StringUtils'",
",",
"'stripslashesDeep'",
")",
",",
"$",
"value",
")",
":",
"st... | Recursively strips slashes from all values in the array
@param mixed $value If an array, all values will be stripslashed()
If a string, then it will be stripslashed()
@return array The stripped array | [
"Recursively",
"strips",
"slashes",
"from",
"all",
"values",
"in",
"the",
"array"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L615-L622 |
198,545 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/utils/StringUtils.php | StringUtils.stripHtml | public static function stripHtml($value, $tags = null, $keepContent = false)
{
$content = '';
if(!is_array($tags)) {
$tags = (strpos($value, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
if(end($tags) == '') array_pop($tags);
}
fo... | php | public static function stripHtml($value, $tags = null, $keepContent = false)
{
$content = '';
if(!is_array($tags)) {
$tags = (strpos($value, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
if(end($tags) == '') array_pop($tags);
}
fo... | [
"public",
"static",
"function",
"stripHtml",
"(",
"$",
"value",
",",
"$",
"tags",
"=",
"null",
",",
"$",
"keepContent",
"=",
"false",
")",
"{",
"$",
"content",
"=",
"''",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"tags",
")",
")",
"{",
"$",
"tag... | Strips a string of HTML tags specified, can strip content or just remove tags
@param string $value Html/text to strip html from
@param string $tags Comma separated list of tags to strip (ie "<object>,<script>")
@param bool $keepContent Keep content within html tags (defaults to false)
@return string
@s... | [
"Strips",
"a",
"string",
"of",
"HTML",
"tags",
"specified",
"can",
"strip",
"content",
"or",
"just",
"remove",
"tags"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/utils/StringUtils.php#L737-L750 |
198,546 | netbull/CoreBundle | Utils/PDFUtils.php | PDFUtils.convertMetric | public static function convertMetric( $value, $from, $to, $precision = null ) {
switch ($from . $to) {
case 'incm':
$value *= 2.54;
break;
case 'inmm':
$value *= 25.4;
break;
case 'inpt':
$value *... | php | public static function convertMetric( $value, $from, $to, $precision = null ) {
switch ($from . $to) {
case 'incm':
$value *= 2.54;
break;
case 'inmm':
$value *= 25.4;
break;
case 'inpt':
$value *... | [
"public",
"static",
"function",
"convertMetric",
"(",
"$",
"value",
",",
"$",
"from",
",",
"$",
"to",
",",
"$",
"precision",
"=",
"null",
")",
"{",
"switch",
"(",
"$",
"from",
".",
"$",
"to",
")",
"{",
"case",
"'incm'",
":",
"$",
"value",
"*=",
"... | convert value from one metric to another.
@param $value
@param $from
@param $to
@param null $precision
@return float|int | [
"convert",
"value",
"from",
"one",
"metric",
"to",
"another",
"."
] | 0bacc1d9e4733b6da613027400c48421e5a14645 | https://github.com/netbull/CoreBundle/blob/0bacc1d9e4733b6da613027400c48421e5a14645/Utils/PDFUtils.php#L21-L66 |
198,547 | Kris-Kuiper/sFire-Framework | src/Validator/Form/Combine.php | Combine.setValues | public function setValues($values) {
if(false === is_array($values)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($values)), E_USER_ERROR);
}
$this -> values = $values;
return $this;
} | php | public function setValues($values) {
if(false === is_array($values)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($values)), E_USER_ERROR);
}
$this -> values = $values;
return $this;
} | [
"public",
"function",
"setValues",
"(",
"$",
"values",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"%s\" given'",
",",
"... | Add one or multiple fields to combine them as one
@param string|array $fieldnames
@return sFire\Validator\Combine | [
"Add",
"one",
"or",
"multiple",
"fields",
"to",
"combine",
"them",
"as",
"one"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Form/Combine.php#L51-L60 |
198,548 | Kris-Kuiper/sFire-Framework | src/Validator/Form/Combine.php | Combine.setFieldnames | public function setFieldnames($fieldnames) {
if(false === is_array($fieldnames)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($fieldnames)), E_USER_ERROR);
}
$this -> fieldnames = $fieldnames;
} | php | public function setFieldnames($fieldnames) {
if(false === is_array($fieldnames)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type array, "%s" given', __METHOD__, gettype($fieldnames)), E_USER_ERROR);
}
$this -> fieldnames = $fieldnames;
} | [
"public",
"function",
"setFieldnames",
"(",
"$",
"fieldnames",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"fieldnames",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type array, \"%s\" given'"... | Sets the fieldnames
@param array $fieldnames
@return sFire\Validator\Combine | [
"Sets",
"the",
"fieldnames"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Form/Combine.php#L67-L74 |
198,549 | Kris-Kuiper/sFire-Framework | src/Validator/Form/Combine.php | Combine.glue | public function glue($glue) {
if(false === is_string($glue)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($glue)), E_USER_ERROR);
}
$this -> glue = $glue;
return $this;
} | php | public function glue($glue) {
if(false === is_string($glue)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($glue)), E_USER_ERROR);
}
$this -> glue = $glue;
return $this;
} | [
"public",
"function",
"glue",
"(",
"$",
"glue",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"glue",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__METHO... | Joins the fieldnames with the glue string between each fieldname
@param string $glue
@return sFire\Validator\Combine | [
"Joins",
"the",
"fieldnames",
"with",
"the",
"glue",
"string",
"between",
"each",
"fieldname"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Form/Combine.php#L82-L91 |
198,550 | Kris-Kuiper/sFire-Framework | src/Validator/Form/Combine.php | Combine.format | public function format($format) {
if(false === is_string($format)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($format)), E_USER_ERROR);
}
$this -> format = $format;
return $this;
} | php | public function format($format) {
if(false === is_string($format)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($format)), E_USER_ERROR);
}
$this -> format = $format;
return $this;
} | [
"public",
"function",
"format",
"(",
"$",
"format",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"format",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"_... | Converts the fieldname values to the specific given format
@param string $format
@return sFire\Validator\Combine | [
"Converts",
"the",
"fieldname",
"values",
"to",
"the",
"specific",
"given",
"format"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Form/Combine.php#L99-L108 |
198,551 | Kris-Kuiper/sFire-Framework | src/Validator/Form/Combine.php | Combine.name | public function name($name) {
if(false === is_string($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
$this -> name = $name;
return $this;
} | php | public function name($name) {
if(false === is_string($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
$this -> name = $name;
return $this;
} | [
"public",
"function",
"name",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__METHO... | Gives the combined fieldnames a new single name
@param string $name
@return sFire\Validator\Combine | [
"Gives",
"the",
"combined",
"fieldnames",
"a",
"new",
"single",
"name"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Form/Combine.php#L116-L125 |
198,552 | Kris-Kuiper/sFire-Framework | src/Validator/Form/Combine.php | Combine.combine | public function combine() {
if(count($this -> values) > 0) {
if(null !== $this -> glue) {
return implode($this -> glue, $this -> values);
}
return vsprintf($this -> format, $this -> values);
}
} | php | public function combine() {
if(count($this -> values) > 0) {
if(null !== $this -> glue) {
return implode($this -> glue, $this -> values);
}
return vsprintf($this -> format, $this -> values);
}
} | [
"public",
"function",
"combine",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"values",
")",
">",
"0",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"glue",
")",
"{",
"return",
"implode",
"(",
"$",
"this",
"->",
"glue",
"... | Combine the values with the glue or format
@return string | [
"Combine",
"the",
"values",
"with",
"the",
"glue",
"or",
"format"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Validator/Form/Combine.php#L168-L178 |
198,553 | RocketPropelledTortoise/Core | src/Taxonomy/Utils/RecursiveQuery.php | RecursiveQuery.getRecursiveAncestry | protected function getRecursiveAncestry(Collection $all_results, $ids)
{
$all_results->merge($results = DB::table($this->hierarchyTable)->whereIn('term_id', $ids)->get());
if (count($results)) {
$this->getRecursiveAncestry($all_results, Arr::pluck($results, 'parent_id'));
}
... | php | protected function getRecursiveAncestry(Collection $all_results, $ids)
{
$all_results->merge($results = DB::table($this->hierarchyTable)->whereIn('term_id', $ids)->get());
if (count($results)) {
$this->getRecursiveAncestry($all_results, Arr::pluck($results, 'parent_id'));
}
... | [
"protected",
"function",
"getRecursiveAncestry",
"(",
"Collection",
"$",
"all_results",
",",
"$",
"ids",
")",
"{",
"$",
"all_results",
"->",
"merge",
"(",
"$",
"results",
"=",
"DB",
"::",
"table",
"(",
"$",
"this",
"->",
"hierarchyTable",
")",
"->",
"where... | Get the ancestry recursively
@param Collection $all_results
@param int[] $ids | [
"Get",
"the",
"ancestry",
"recursively"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Utils/RecursiveQuery.php#L66-L73 |
198,554 | pluf/tenant | src/Tenant/Views/Ticket.php | Tenant_Views_Ticket.createManyToOne | public function createManyToOne($request, $match)
{
$parent = Pluf_Shortcuts_GetObjectOr404('Tenant_Ticket', $match['parentId']);
$object = new Tenant_Comment();
$form = Pluf_Shortcuts_GetFormForModel($object, $request->REQUEST);
$object = $form->save(false);
$object->ticket_... | php | public function createManyToOne($request, $match)
{
$parent = Pluf_Shortcuts_GetObjectOr404('Tenant_Ticket', $match['parentId']);
$object = new Tenant_Comment();
$form = Pluf_Shortcuts_GetFormForModel($object, $request->REQUEST);
$object = $form->save(false);
$object->ticket_... | [
"public",
"function",
"createManyToOne",
"(",
"$",
"request",
",",
"$",
"match",
")",
"{",
"$",
"parent",
"=",
"Pluf_Shortcuts_GetObjectOr404",
"(",
"'Tenant_Ticket'",
",",
"$",
"match",
"[",
"'parentId'",
"]",
")",
";",
"$",
"object",
"=",
"new",
"Tenant_Co... | Create new comment
@param Pluf_HTTP_Request $request
@param array $match
@param array $p | [
"Create",
"new",
"comment"
] | a06359c52b9a257b5a0a186264e8770acfc54b73 | https://github.com/pluf/tenant/blob/a06359c52b9a257b5a0a186264e8770acfc54b73/src/Tenant/Views/Ticket.php#L37-L47 |
198,555 | mwyatt/core | src/Url.php | Url.generateVersioned | public function generateVersioned($pathBase, $pathAppend)
{
$pathAbsolute = $pathBase . $pathAppend;
if (!file_exists($pathAbsolute)) {
throw new \Exception("cannot get cache busting path for file '$pathAbsolute'");
}
// get mod time
$timeModified = filemtime($pa... | php | public function generateVersioned($pathBase, $pathAppend)
{
$pathAbsolute = $pathBase . $pathAppend;
if (!file_exists($pathAbsolute)) {
throw new \Exception("cannot get cache busting path for file '$pathAbsolute'");
}
// get mod time
$timeModified = filemtime($pa... | [
"public",
"function",
"generateVersioned",
"(",
"$",
"pathBase",
",",
"$",
"pathAppend",
")",
"{",
"$",
"pathAbsolute",
"=",
"$",
"pathBase",
".",
"$",
"pathAppend",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"pathAbsolute",
")",
")",
"{",
"throw",
"n... | gets absolute path of a single file with cache busting powers!
@param string $path
@return string | [
"gets",
"absolute",
"path",
"of",
"a",
"single",
"file",
"with",
"cache",
"busting",
"powers!"
] | 8ea9d67cc84fe6aff17a469c703d5492dbcd93ed | https://github.com/mwyatt/core/blob/8ea9d67cc84fe6aff17a469c703d5492dbcd93ed/src/Url.php#L101-L113 |
198,556 | ciims/ciims-modules-install | controllers/DefaultController.php | DefaultController.actionError | public function actionError()
{
$error = array();
if (!empty(Yii::app()->errorHandler->error))
$error=Yii::app()->errorHandler->error;
$this->render('error', array('error' => $error));
} | php | public function actionError()
{
$error = array();
if (!empty(Yii::app()->errorHandler->error))
$error=Yii::app()->errorHandler->error;
$this->render('error', array('error' => $error));
} | [
"public",
"function",
"actionError",
"(",
")",
"{",
"$",
"error",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"Yii",
"::",
"app",
"(",
")",
"->",
"errorHandler",
"->",
"error",
")",
")",
"$",
"error",
"=",
"Yii",
"::",
"app",
"(",
... | Error Action
The installer shouldn't error, if this happens, flat out die and blame the developer | [
"Error",
"Action",
"The",
"installer",
"shouldn",
"t",
"error",
"if",
"this",
"happens",
"flat",
"out",
"die",
"and",
"blame",
"the",
"developer"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/controllers/DefaultController.php#L23-L30 |
198,557 | ciims/ciims-modules-install | controllers/DefaultController.php | DefaultController.actionIndex | public function actionIndex()
{
$model = new DatabaseForm;
// Assign previously set credentials
if (Cii::get(Yii::app()->session['dsn']) != "")
$model->attributes = Yii::app()->session['dsn'];
// If a post request was sent
if (Cii::get($_POST, 'D... | php | public function actionIndex()
{
$model = new DatabaseForm;
// Assign previously set credentials
if (Cii::get(Yii::app()->session['dsn']) != "")
$model->attributes = Yii::app()->session['dsn'];
// If a post request was sent
if (Cii::get($_POST, 'D... | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"DatabaseForm",
";",
"// Assign previously set credentials",
"if",
"(",
"Cii",
"::",
"get",
"(",
"Yii",
"::",
"app",
"(",
")",
"->",
"session",
"[",
"'dsn'",
"]",
")",
"!=",
"\... | Initial action the user arrives to.
Handles setting up the database connection | [
"Initial",
"action",
"the",
"user",
"arrives",
"to",
".",
"Handles",
"setting",
"up",
"the",
"database",
"connection"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/controllers/DefaultController.php#L36-L64 |
198,558 | ciims/ciims-modules-install | controllers/DefaultController.php | DefaultController.actionCreateAdmin | public function actionCreateAdmin()
{
$model = new UserForm;
if (Cii::get($_POST, 'UserForm') != NULL)
{
$model->attributes = Cii::get($_POST, 'UserForm', array());
if ($model->validate())
{
$response = $this->runInstaller(... | php | public function actionCreateAdmin()
{
$model = new UserForm;
if (Cii::get($_POST, 'UserForm') != NULL)
{
$model->attributes = Cii::get($_POST, 'UserForm', array());
if ($model->validate())
{
$response = $this->runInstaller(... | [
"public",
"function",
"actionCreateAdmin",
"(",
")",
"{",
"$",
"model",
"=",
"new",
"UserForm",
";",
"if",
"(",
"Cii",
"::",
"get",
"(",
"$",
"_POST",
",",
"'UserForm'",
")",
"!=",
"NULL",
")",
"{",
"$",
"model",
"->",
"attributes",
"=",
"Cii",
"::",... | This action enables us to create an admin user for CiiMS | [
"This",
"action",
"enables",
"us",
"to",
"create",
"an",
"admin",
"user",
"for",
"CiiMS"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/controllers/DefaultController.php#L86-L114 |
198,559 | ciims/ciims-modules-install | controllers/DefaultController.php | DefaultController.actionRunMigrations | public function actionRunMigrations()
{
header('Content-Type: application/json');
$response = $this->runMigrationTool();
$data = array('migrated' => false, 'details' => $response);
if (strpos($response, 'Migrated up successfully.') || strpos($response, 'Your system... | php | public function actionRunMigrations()
{
header('Content-Type: application/json');
$response = $this->runMigrationTool();
$data = array('migrated' => false, 'details' => $response);
if (strpos($response, 'Migrated up successfully.') || strpos($response, 'Your system... | [
"public",
"function",
"actionRunMigrations",
"(",
")",
"{",
"header",
"(",
"'Content-Type: application/json'",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"runMigrationTool",
"(",
")",
";",
"$",
"data",
"=",
"array",
"(",
"'migrated'",
"=>",
"false",
... | Ajax comment to run CDbMigrations | [
"Ajax",
"comment",
"to",
"run",
"CDbMigrations"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/controllers/DefaultController.php#L119-L132 |
198,560 | ciims/ciims-modules-install | controllers/DefaultController.php | DefaultController.runInstaller | private function runInstaller($userModel)
{
return $this->runCommand(Yii::app()->session['dsn'], 'application.modules.install.InstallerCommand', array(
'yiic',
'installer',
'index',
'--dbHost='.Yii::app()->session['dsn']['host'],
'--dbName='.Yii::a... | php | private function runInstaller($userModel)
{
return $this->runCommand(Yii::app()->session['dsn'], 'application.modules.install.InstallerCommand', array(
'yiic',
'installer',
'index',
'--dbHost='.Yii::app()->session['dsn']['host'],
'--dbName='.Yii::a... | [
"private",
"function",
"runInstaller",
"(",
"$",
"userModel",
")",
"{",
"return",
"$",
"this",
"->",
"runCommand",
"(",
"Yii",
"::",
"app",
"(",
")",
"->",
"session",
"[",
"'dsn'",
"]",
",",
"'application.modules.install.InstallerCommand'",
",",
"array",
"(",
... | Runs the CLI installer which writes the config files and create the initial admin user
@param $userModel UserForm
@return string | [
"Runs",
"the",
"CLI",
"installer",
"which",
"writes",
"the",
"config",
"files",
"and",
"create",
"the",
"initial",
"admin",
"user"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/controllers/DefaultController.php#L153-L169 |
198,561 | ciims/ciims-modules-install | controllers/DefaultController.php | DefaultController.runCommand | private function runCommand($dsn, $command, $data)
{
$runner=new CConsoleCommandRunner();
$runner->commands=array(
'migrate' => array(
'class' => $command,
'dsn' => $dsn,
'interactive' => 0,
),
'db'=>array(
... | php | private function runCommand($dsn, $command, $data)
{
$runner=new CConsoleCommandRunner();
$runner->commands=array(
'migrate' => array(
'class' => $command,
'dsn' => $dsn,
'interactive' => 0,
),
'db'=>array(
... | [
"private",
"function",
"runCommand",
"(",
"$",
"dsn",
",",
"$",
"command",
",",
"$",
"data",
")",
"{",
"$",
"runner",
"=",
"new",
"CConsoleCommandRunner",
"(",
")",
";",
"$",
"runner",
"->",
"commands",
"=",
"array",
"(",
"'migrate'",
"=>",
"array",
"(... | Runs a given command
@param array $dsn The DSN
@param string $command The CLI command to run
@param array $data The runner data to use
@return string | [
"Runs",
"a",
"given",
"command"
] | 54d6a93e5c42c2d98e19de38a90e27f77358e88b | https://github.com/ciims/ciims-modules-install/blob/54d6a93e5c42c2d98e19de38a90e27f77358e88b/controllers/DefaultController.php#L178-L209 |
198,562 | linpax/microphp-framework | src/db/drivers/Connection.php | Connection.setDriver | public function setDriver($dsn, array $config = [], array $options = [])
{
$class = '\Micro\Db\Drivers\\'.ucfirst(substr($dsn, 0, strpos($dsn, ':'))).'Driver';
if (!class_exists($class)) {
throw new Exception('DB driver `'.$class.'` not supported');
}
unset($this->drive... | php | public function setDriver($dsn, array $config = [], array $options = [])
{
$class = '\Micro\Db\Drivers\\'.ucfirst(substr($dsn, 0, strpos($dsn, ':'))).'Driver';
if (!class_exists($class)) {
throw new Exception('DB driver `'.$class.'` not supported');
}
unset($this->drive... | [
"public",
"function",
"setDriver",
"(",
"$",
"dsn",
",",
"array",
"$",
"config",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"class",
"=",
"'\\Micro\\Db\\Drivers\\\\'",
".",
"ucfirst",
"(",
"substr",
"(",
"$",
"dsn",
",... | Set active connection driver
@access public
@param string $dsn DSN connection string
@param array $config Configuration of connection
@param array $options Other options
@return void
@throws Exception | [
"Set",
"active",
"connection",
"driver"
] | 11f3370f3f64c516cce9b84ecd8276c6e9ae8df9 | https://github.com/linpax/microphp-framework/blob/11f3370f3f64c516cce9b84ecd8276c6e9ae8df9/src/db/drivers/Connection.php#L66-L77 |
198,563 | siriusSupreme/sirius-redis | src/Connections/PhpRedisConnection.php | PhpRedisConnection.hmget | public function hmget($key, ...$dictionary)
{
if (count($dictionary) == 1) {
$dictionary = $dictionary[0];
}
return array_values($this->command('hmget', [$key, $dictionary]));
} | php | public function hmget($key, ...$dictionary)
{
if (count($dictionary) == 1) {
$dictionary = $dictionary[0];
}
return array_values($this->command('hmget', [$key, $dictionary]));
} | [
"public",
"function",
"hmget",
"(",
"$",
"key",
",",
"...",
"$",
"dictionary",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"dictionary",
")",
"==",
"1",
")",
"{",
"$",
"dictionary",
"=",
"$",
"dictionary",
"[",
"0",
"]",
";",
"}",
"return",
"array_valu... | Get the value of the given hash fields.
@param string $key
@param dynamic $dictionary
@return int | [
"Get",
"the",
"value",
"of",
"the",
"given",
"hash",
"fields",
"."
] | 30abe086fdc44ba424d1554e16db586fa95b27a1 | https://github.com/siriusSupreme/sirius-redis/blob/30abe086fdc44ba424d1554e16db586fa95b27a1/src/Connections/PhpRedisConnection.php#L104-L111 |
198,564 | siriusSupreme/sirius-redis | src/Connections/PhpRedisConnection.php | PhpRedisConnection.eval | public function eval($script, $numberOfKeys, ...$arguments)
{
return $this->client->eval($script, $arguments, $numberOfKeys);
} | php | public function eval($script, $numberOfKeys, ...$arguments)
{
return $this->client->eval($script, $arguments, $numberOfKeys);
} | [
"public",
"function",
"eval",
"(",
"$",
"script",
",",
"$",
"numberOfKeys",
",",
"...",
"$",
"arguments",
")",
"{",
"return",
"$",
"this",
"->",
"client",
"->",
"eval",
"(",
"$",
"script",
",",
"$",
"arguments",
",",
"$",
"numberOfKeys",
")",
";",
"}... | Evaluate a script and retunr its result.
@param string $script
@param int $numberOfKeys
@param dynamic $arguments
@return mixed | [
"Evaluate",
"a",
"script",
"and",
"retunr",
"its",
"result",
"."
] | 30abe086fdc44ba424d1554e16db586fa95b27a1 | https://github.com/siriusSupreme/sirius-redis/blob/30abe086fdc44ba424d1554e16db586fa95b27a1/src/Connections/PhpRedisConnection.php#L319-L322 |
198,565 | mossphp/moss-storage | Moss/Storage/Query/Storage.php | Storage.read | public function read($entityName)
{
return new ReadQuery(
$this->connection,
$this->models->get($entityName),
$this->factory,
$this->accessor,
$this->dispatcher
);
} | php | public function read($entityName)
{
return new ReadQuery(
$this->connection,
$this->models->get($entityName),
$this->factory,
$this->accessor,
$this->dispatcher
);
} | [
"public",
"function",
"read",
"(",
"$",
"entityName",
")",
"{",
"return",
"new",
"ReadQuery",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"models",
"->",
"get",
"(",
"$",
"entityName",
")",
",",
"$",
"this",
"->",
"factory",
",",
"$... | Sets read operation
@param string $entityName
@return ReadQueryInterface | [
"Sets",
"read",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Storage.php#L107-L116 |
198,566 | mossphp/moss-storage | Moss/Storage/Query/Storage.php | Storage.readOne | public function readOne($entityName)
{
return new ReadOneQuery(
$this->connection,
$this->models->get($entityName),
$this->factory,
$this->accessor,
$this->dispatcher
);
} | php | public function readOne($entityName)
{
return new ReadOneQuery(
$this->connection,
$this->models->get($entityName),
$this->factory,
$this->accessor,
$this->dispatcher
);
} | [
"public",
"function",
"readOne",
"(",
"$",
"entityName",
")",
"{",
"return",
"new",
"ReadOneQuery",
"(",
"$",
"this",
"->",
"connection",
",",
"$",
"this",
"->",
"models",
"->",
"get",
"(",
"$",
"entityName",
")",
",",
"$",
"this",
"->",
"factory",
","... | Sets read one operation
@param string $entityName
@return ReadQueryInterface | [
"Sets",
"read",
"one",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Storage.php#L125-L134 |
198,567 | mossphp/moss-storage | Moss/Storage/Query/Storage.php | Storage.write | public function write($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new WriteQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | php | public function write($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new WriteQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | [
"public",
"function",
"write",
"(",
"$",
"instance",
",",
"$",
"entity",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
"=",
"$",
"this",
"->",
"reassignEntity",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
";",
"re... | Sets write operation
@param array|object $instance
@param null|string|object $entity
@return WriteQueryInterface | [
"Sets",
"write",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Storage.php#L144-L156 |
198,568 | mossphp/moss-storage | Moss/Storage/Query/Storage.php | Storage.update | public function update($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new UpdateQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | php | public function update($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new UpdateQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | [
"public",
"function",
"update",
"(",
"$",
"instance",
",",
"$",
"entity",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
"=",
"$",
"this",
"->",
"reassignEntity",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
";",
"r... | Sets update operation
@param array|object $instance
@param null|string|object $entity
@return UpdateQueryInterface | [
"Sets",
"update",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Storage.php#L166-L178 |
198,569 | mossphp/moss-storage | Moss/Storage/Query/Storage.php | Storage.insert | public function insert($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new InsertQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | php | public function insert($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new InsertQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | [
"public",
"function",
"insert",
"(",
"$",
"instance",
",",
"$",
"entity",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
"=",
"$",
"this",
"->",
"reassignEntity",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
";",
"r... | Sets insert operation
@param array|object $instance
@param null|string|object $entity
@return InsertQueryInterface | [
"Sets",
"insert",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Storage.php#L188-L200 |
198,570 | mossphp/moss-storage | Moss/Storage/Query/Storage.php | Storage.delete | public function delete($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new DeleteQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | php | public function delete($instance, $entity = null)
{
list($instance, $entity) = $this->reassignEntity($instance, $entity);
return new DeleteQuery(
$this->connection,
$instance,
$this->models->get($entity),
$this->factory,
$this->accessor,
... | [
"public",
"function",
"delete",
"(",
"$",
"instance",
",",
"$",
"entity",
"=",
"null",
")",
"{",
"list",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
"=",
"$",
"this",
"->",
"reassignEntity",
"(",
"$",
"instance",
",",
"$",
"entity",
")",
";",
"r... | Sets delete operation
@param array|object $instance
@param null|string|object $entity
@return DeleteQueryInterface | [
"Sets",
"delete",
"operation"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Query/Storage.php#L210-L222 |
198,571 | Dhii/exception | src/InitBaseExceptionCapableTrait.php | InitBaseExceptionCapableTrait._initBaseException | public function _initBaseException($message = null, $code = null, RootException $previous = null)
{
$message = is_null($message)
? ''
: $this->_normalizeString($message);
$code = is_null($code)
? 0
: $this->_normalizeInt($code);
$this->_initPa... | php | public function _initBaseException($message = null, $code = null, RootException $previous = null)
{
$message = is_null($message)
? ''
: $this->_normalizeString($message);
$code = is_null($code)
? 0
: $this->_normalizeInt($code);
$this->_initPa... | [
"public",
"function",
"_initBaseException",
"(",
"$",
"message",
"=",
"null",
",",
"$",
"code",
"=",
"null",
",",
"RootException",
"$",
"previous",
"=",
"null",
")",
"{",
"$",
"message",
"=",
"is_null",
"(",
"$",
"message",
")",
"?",
"''",
":",
"$",
... | Initializes the base exception.
@since [*next-version*]
@param string|Stringable|int|float|bool|null $message The message, if any.
@param int|float|string|Stringable|null $code The numeric error code, if any.
@param RootException|null $previous The inner exception, if any.
@throws BaseIn... | [
"Initializes",
"the",
"base",
"exception",
"."
] | d42828984c85a509af3f7fde709561a1e520b9e4 | https://github.com/Dhii/exception/blob/d42828984c85a509af3f7fde709561a1e520b9e4/src/InitBaseExceptionCapableTrait.php#L27-L37 |
198,572 | ricardopedias/old-extended | src/Accessor.php | Accessor.dateTransform | public function dateTransform($date_value, $format_origin = 'd/m/Y H:i:s', $format_destiny = 'Y-m-d H:i:s')
{
$date = \DateTime::createFromFormat($format_origin, $date_value);
return $date !== false ? $date->format($format_destiny) : '';
} | php | public function dateTransform($date_value, $format_origin = 'd/m/Y H:i:s', $format_destiny = 'Y-m-d H:i:s')
{
$date = \DateTime::createFromFormat($format_origin, $date_value);
return $date !== false ? $date->format($format_destiny) : '';
} | [
"public",
"function",
"dateTransform",
"(",
"$",
"date_value",
",",
"$",
"format_origin",
"=",
"'d/m/Y H:i:s'",
",",
"$",
"format_destiny",
"=",
"'Y-m-d H:i:s'",
")",
"{",
"$",
"date",
"=",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"$",
"format_origin",
... | Transforma uma data de um formato para outro
@param string $date_value O valor da data
@param string $format_origin O formato original do valor Ex: d/m/Y
@param string $format_destiny O formato transformado Ex: Y-m-d | [
"Transforma",
"uma",
"data",
"de",
"um",
"formato",
"para",
"outro"
] | 381a1cfc6aa4915e701ad252a7c78733e8484f26 | https://github.com/ricardopedias/old-extended/blob/381a1cfc6aa4915e701ad252a7c78733e8484f26/src/Accessor.php#L165-L169 |
198,573 | blueblazeassociates/geocode-postalcodes | src/php/Utils.php | Utils.validate_distance | public static function validate_distance( $distance ) {
$valid = filter_var( $distance, FILTER_VALIDATE_INT,
array( 'options' => array(
'min_range' => 1,
'max_range' => PHP_INT_MAX
))
);
return false !== $valid ? true : false;
} | php | public static function validate_distance( $distance ) {
$valid = filter_var( $distance, FILTER_VALIDATE_INT,
array( 'options' => array(
'min_range' => 1,
'max_range' => PHP_INT_MAX
))
);
return false !== $valid ? true : false;
} | [
"public",
"static",
"function",
"validate_distance",
"(",
"$",
"distance",
")",
"{",
"$",
"valid",
"=",
"filter_var",
"(",
"$",
"distance",
",",
"FILTER_VALIDATE_INT",
",",
"array",
"(",
"'options'",
"=>",
"array",
"(",
"'min_range'",
"=>",
"1",
",",
"'max_r... | Validate distance.
Distance must be a positive integer.
@param string|integer $distance
@return boolean | [
"Validate",
"distance",
"."
] | 3a9b6c68327b13f5dc15015e78223dd215e8d4ea | https://github.com/blueblazeassociates/geocode-postalcodes/blob/3a9b6c68327b13f5dc15015e78223dd215e8d4ea/src/php/Utils.php#L18-L27 |
198,574 | dms-org/common.structure | src/DateTime/DateTimeBase.php | DateTimeBase.diff | public function diff(DateTimeBase $other, bool $absolute = false)
{
return $this->dateTime->diff($other->dateTime, $absolute);
} | php | public function diff(DateTimeBase $other, bool $absolute = false)
{
return $this->dateTime->diff($other->dateTime, $absolute);
} | [
"public",
"function",
"diff",
"(",
"DateTimeBase",
"$",
"other",
",",
"bool",
"$",
"absolute",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"dateTime",
"->",
"diff",
"(",
"$",
"other",
"->",
"dateTime",
",",
"$",
"absolute",
")",
";",
"}"
] | Returns a diff of the supplied date time.
@param DateTimeBase $other
@param bool $absolute
@return \DateInterval | [
"Returns",
"a",
"diff",
"of",
"the",
"supplied",
"date",
"time",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/DateTimeBase.php#L31-L34 |
198,575 | dms-org/common.structure | src/DateTime/DateTimeBase.php | DateTimeBase.equals | public function equals(DateTimeBase $other) : bool
{
$dateTime = $this->dateTime;
$otherDateTime = $other->dateTime;
return $dateTime == $otherDateTime
&& $dateTime->getTimezone()->getName() === $otherDateTime->getTimezone()->getName();
} | php | public function equals(DateTimeBase $other) : bool
{
$dateTime = $this->dateTime;
$otherDateTime = $other->dateTime;
return $dateTime == $otherDateTime
&& $dateTime->getTimezone()->getName() === $otherDateTime->getTimezone()->getName();
} | [
"public",
"function",
"equals",
"(",
"DateTimeBase",
"$",
"other",
")",
":",
"bool",
"{",
"$",
"dateTime",
"=",
"$",
"this",
"->",
"dateTime",
";",
"$",
"otherDateTime",
"=",
"$",
"other",
"->",
"dateTime",
";",
"return",
"$",
"dateTime",
"==",
"$",
"o... | Returns whether the DateTimeBase is equal to the supplied date.
@param DateTimeBase $other
@return bool | [
"Returns",
"whether",
"the",
"DateTimeBase",
"is",
"equal",
"to",
"the",
"supplied",
"date",
"."
] | 23f122182f60df5ec847047a81a39c8aab019ff1 | https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/DateTime/DateTimeBase.php#L43-L50 |
198,576 | johnkrovitch/SamBundle | src/Command/AbstractCommand.php | AbstractCommand.buildTasks | protected function buildTasks(array $configuration)
{
$this->io->text('- Building tasks...');
$builder = new TaskBuilder($this->debug);
$tasks = $builder->build($configuration);
$this->io->text('- Tasks build !');
$this->io->newLine();
return $tasks;
} | php | protected function buildTasks(array $configuration)
{
$this->io->text('- Building tasks...');
$builder = new TaskBuilder($this->debug);
$tasks = $builder->build($configuration);
$this->io->text('- Tasks build !');
$this->io->newLine();
return $tasks;
} | [
"protected",
"function",
"buildTasks",
"(",
"array",
"$",
"configuration",
")",
"{",
"$",
"this",
"->",
"io",
"->",
"text",
"(",
"'- Building tasks...'",
")",
";",
"$",
"builder",
"=",
"new",
"TaskBuilder",
"(",
"$",
"this",
"->",
"debug",
")",
";",
"$",... | Build tasks from the configuration array.
@param array $configuration
@return Task[] | [
"Build",
"tasks",
"from",
"the",
"configuration",
"array",
"."
] | 6cc08ef2dd8f7cd5c33ee27818edd4697afa435e | https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Command/AbstractCommand.php#L48-L59 |
198,577 | johnkrovitch/SamBundle | src/Command/AbstractCommand.php | AbstractCommand.buildFilters | protected function buildFilters(array $configuration)
{
$this->io->text('- Building filters...');
$builder = new FilterBuilder($this->eventDispatcher);
$filters = $builder->build($configuration);
$this->io->text('- Filters build !');
$this->io->newLine();
return $f... | php | protected function buildFilters(array $configuration)
{
$this->io->text('- Building filters...');
$builder = new FilterBuilder($this->eventDispatcher);
$filters = $builder->build($configuration);
$this->io->text('- Filters build !');
$this->io->newLine();
return $f... | [
"protected",
"function",
"buildFilters",
"(",
"array",
"$",
"configuration",
")",
"{",
"$",
"this",
"->",
"io",
"->",
"text",
"(",
"'- Building filters...'",
")",
";",
"$",
"builder",
"=",
"new",
"FilterBuilder",
"(",
"$",
"this",
"->",
"eventDispatcher",
")... | Build the filter according to the configuration array.
@param array $configuration
@return FilterInterface[] | [
"Build",
"the",
"filter",
"according",
"to",
"the",
"configuration",
"array",
"."
] | 6cc08ef2dd8f7cd5c33ee27818edd4697afa435e | https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Command/AbstractCommand.php#L68-L79 |
198,578 | johnkrovitch/SamBundle | src/Command/AbstractCommand.php | AbstractCommand.loadConfigurationFile | protected function loadConfigurationFile($configurationFile)
{
if (!file_exists($configurationFile)) {
throw new Exception('The configuration yml file '.$configurationFile.' was not found');
}
$configuration = Yaml::parse(file_get_contents($configurationFile));
if (empty... | php | protected function loadConfigurationFile($configurationFile)
{
if (!file_exists($configurationFile)) {
throw new Exception('The configuration yml file '.$configurationFile.' was not found');
}
$configuration = Yaml::parse(file_get_contents($configurationFile));
if (empty... | [
"protected",
"function",
"loadConfigurationFile",
"(",
"$",
"configurationFile",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"configurationFile",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'The configuration yml file '",
".",
"$",
"configurationFile",
... | Load the configuration from a yml file.
@param $configurationFile
@return string[]
@throws Exception | [
"Load",
"the",
"configuration",
"from",
"a",
"yml",
"file",
"."
] | 6cc08ef2dd8f7cd5c33ee27818edd4697afa435e | https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Command/AbstractCommand.php#L90-L102 |
198,579 | johnkrovitch/SamBundle | src/Command/AbstractCommand.php | AbstractCommand.loadConfiguration | protected function loadConfiguration(InputInterface $input)
{
$loader = new ConfigurationLoader();
if ($input->hasOption('config') && $file = $input->getOption('config')) {
$configuration = $loader->loadFromFile($file);
} else {
if (null === $this->conta... | php | protected function loadConfiguration(InputInterface $input)
{
$loader = new ConfigurationLoader();
if ($input->hasOption('config') && $file = $input->getOption('config')) {
$configuration = $loader->loadFromFile($file);
} else {
if (null === $this->conta... | [
"protected",
"function",
"loadConfiguration",
"(",
"InputInterface",
"$",
"input",
")",
"{",
"$",
"loader",
"=",
"new",
"ConfigurationLoader",
"(",
")",
";",
"if",
"(",
"$",
"input",
"->",
"hasOption",
"(",
"'config'",
")",
"&&",
"$",
"file",
"=",
"$",
"... | Load the configuration from a yml file or the container, according to the given option.
@param InputInterface $input
@return array
@throws Exception | [
"Load",
"the",
"configuration",
"from",
"a",
"yml",
"file",
"or",
"the",
"container",
"according",
"to",
"the",
"given",
"option",
"."
] | 6cc08ef2dd8f7cd5c33ee27818edd4697afa435e | https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Command/AbstractCommand.php#L113-L128 |
198,580 | johnkrovitch/SamBundle | src/Command/AbstractCommand.php | AbstractCommand.setContainer | public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
$this->eventDispatcher = $this->container->get('event_dispatcher');
} | php | public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
$this->eventDispatcher = $this->container->get('event_dispatcher');
} | [
"public",
"function",
"setContainer",
"(",
"ContainerInterface",
"$",
"container",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"$",
"container",
";",
"$",
"this",
"->",
"eventDispatcher",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(... | Sets the container.
@param ContainerInterface|null $container A ContainerInterface instance or null | [
"Sets",
"the",
"container",
"."
] | 6cc08ef2dd8f7cd5c33ee27818edd4697afa435e | https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Command/AbstractCommand.php#L135-L139 |
198,581 | spoom-php/core | src/extension/Event/Emitter.php | Emitter.sort | protected function sort() {
if( !empty( $this->_callback_list ) ) {
// sort by the priorities, but keep the original indexes (we need it for the repopulation)
$priority_list = $this->_priority_list;
asort( $priority_list );
// repopulate the callbacks based on the new priority "map"
... | php | protected function sort() {
if( !empty( $this->_callback_list ) ) {
// sort by the priorities, but keep the original indexes (we need it for the repopulation)
$priority_list = $this->_priority_list;
asort( $priority_list );
// repopulate the callbacks based on the new priority "map"
... | [
"protected",
"function",
"sort",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_callback_list",
")",
")",
"{",
"// sort by the priorities, but keep the original indexes (we need it for the repopulation)",
"$",
"priority_list",
"=",
"$",
"this",
"->"... | Sort callbacks based on their priority | [
"Sort",
"callbacks",
"based",
"on",
"their",
"priority"
] | ea7184213352fa2fad7636927a019e5798734e04 | https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Event/Emitter.php#L149-L166 |
198,582 | lasallecms/lasallecms-l5-tokenbasedlogin-pkg | src/Repositories/UserTokenbasedloginRepository.php | UserTokenbasedloginRepository.createLoginToken | public function createLoginToken($userID) {
$user = $this->getFind($userID);
$user->login_token = hash_hmac('sha256', Str::random(40), 'secret');
$user->login_token_created_at = Carbon::now();
return $user->save();
} | php | public function createLoginToken($userID) {
$user = $this->getFind($userID);
$user->login_token = hash_hmac('sha256', Str::random(40), 'secret');
$user->login_token_created_at = Carbon::now();
return $user->save();
} | [
"public",
"function",
"createLoginToken",
"(",
"$",
"userID",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getFind",
"(",
"$",
"userID",
")",
";",
"$",
"user",
"->",
"login_token",
"=",
"hash_hmac",
"(",
"'sha256'",
",",
"Str",
"::",
"random",
"(",
... | UPDATE the "users" table with a login token
@param int $userID User's ID | [
"UPDATE",
"the",
"users",
"table",
"with",
"a",
"login",
"token"
] | 8b7bc14b959626c3b02111415dd5f0a9b96b11ac | https://github.com/lasallecms/lasallecms-l5-tokenbasedlogin-pkg/blob/8b7bc14b959626c3b02111415dd5f0a9b96b11ac/src/Repositories/UserTokenbasedloginRepository.php#L84-L91 |
198,583 | lasallecms/lasallecms-l5-tokenbasedlogin-pkg | src/Repositories/UserTokenbasedloginRepository.php | UserTokenbasedloginRepository.isLoginTokenExpired | public function isLoginTokenExpired($user) {
$startTime = strtotime($user->login_token_created_at);
$now = strtotime(Carbon::now());
// The time difference is in seconds, we want in minutes
$timeDiff = ($now - $startTime)/60;
$minutes2faFormIsLive = config('lasallecmstokenbasedlo... | php | public function isLoginTokenExpired($user) {
$startTime = strtotime($user->login_token_created_at);
$now = strtotime(Carbon::now());
// The time difference is in seconds, we want in minutes
$timeDiff = ($now - $startTime)/60;
$minutes2faFormIsLive = config('lasallecmstokenbasedlo... | [
"public",
"function",
"isLoginTokenExpired",
"(",
"$",
"user",
")",
"{",
"$",
"startTime",
"=",
"strtotime",
"(",
"$",
"user",
"->",
"login_token_created_at",
")",
";",
"$",
"now",
"=",
"strtotime",
"(",
"Carbon",
"::",
"now",
"(",
")",
")",
";",
"// The... | Has a login token expired?
@param object $user User object
@return bool | [
"Has",
"a",
"login",
"token",
"expired?"
] | 8b7bc14b959626c3b02111415dd5f0a9b96b11ac | https://github.com/lasallecms/lasallecms-l5-tokenbasedlogin-pkg/blob/8b7bc14b959626c3b02111415dd5f0a9b96b11ac/src/Repositories/UserTokenbasedloginRepository.php#L109-L120 |
198,584 | lasallecms/lasallecms-l5-tokenbasedlogin-pkg | src/Repositories/UserTokenbasedloginRepository.php | UserTokenbasedloginRepository.deleteUserLoginTokenFields | public function deleteUserLoginTokenFields($userID) {
$user = $this->getFind($userID);
$user->login_token = '';
$user->login_token_created_at = '';
return $user->save();
} | php | public function deleteUserLoginTokenFields($userID) {
$user = $this->getFind($userID);
$user->login_token = '';
$user->login_token_created_at = '';
return $user->save();
} | [
"public",
"function",
"deleteUserLoginTokenFields",
"(",
"$",
"userID",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getFind",
"(",
"$",
"userID",
")",
";",
"$",
"user",
"->",
"login_token",
"=",
"''",
";",
"$",
"user",
"->",
"login_token_created_at",
... | Remove the 'login_token' and 'login_token_created_at' fields.
@param int $userID The user's ID
@return mixed | [
"Remove",
"the",
"login_token",
"and",
"login_token_created_at",
"fields",
"."
] | 8b7bc14b959626c3b02111415dd5f0a9b96b11ac | https://github.com/lasallecms/lasallecms-l5-tokenbasedlogin-pkg/blob/8b7bc14b959626c3b02111415dd5f0a9b96b11ac/src/Repositories/UserTokenbasedloginRepository.php#L128-L135 |
198,585 | nails/module-blog | blog/controllers/Blog.php | NAILS_Blog.index | public function index()
{
// Meta & Breadcrumbs
$this->data['page']->title = APP_NAME . ' Blog';
$this->data['page']->seo->description = '';
$this->data['page']->seo->keywords = '';
// --------------------------------------------------------------------------
... | php | public function index()
{
// Meta & Breadcrumbs
$this->data['page']->title = APP_NAME . ' Blog';
$this->data['page']->seo->description = '';
$this->data['page']->seo->keywords = '';
// --------------------------------------------------------------------------
... | [
"public",
"function",
"index",
"(",
")",
"{",
"// Meta & Breadcrumbs",
"$",
"this",
"->",
"data",
"[",
"'page'",
"]",
"->",
"title",
"=",
"APP_NAME",
".",
"' Blog'",
";",
"$",
"this",
"->",
"data",
"[",
"'page'",
"]",
"->",
"seo",
"->",
"description",
... | Browse all posts
@return void | [
"Browse",
"all",
"posts"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/Blog.php#L45-L99 |
198,586 | nails/module-blog | blog/controllers/Blog.php | NAILS_Blog.rss | public function rss()
{
if (!appSetting('rss_enabled', 'blog-' . $this->oBlog->id)) {
show404();
}
// --------------------------------------------------------------------------
// Get posts
$data = array();
$data['include_body'] =... | php | public function rss()
{
if (!appSetting('rss_enabled', 'blog-' . $this->oBlog->id)) {
show404();
}
// --------------------------------------------------------------------------
// Get posts
$data = array();
$data['include_body'] =... | [
"public",
"function",
"rss",
"(",
")",
"{",
"if",
"(",
"!",
"appSetting",
"(",
"'rss_enabled'",
",",
"'blog-'",
".",
"$",
"this",
"->",
"oBlog",
"->",
"id",
")",
")",
"{",
"show404",
"(",
")",
";",
"}",
"// ---------------------------------------------------... | RSS Feed for the blog
@return void | [
"RSS",
"Feed",
"for",
"the",
"blog"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/Blog.php#L438-L467 |
198,587 | nails/module-blog | blog/controllers/Blog.php | NAILS_Blog.fetchSidebarWidgets | protected function fetchSidebarWidgets()
{
$this->data['widget'] = new stdClass();
if (appSetting('sidebar_latest_posts', 'blog-' . $this->oBlog->id)) {
$this->data['widget']->latest_posts = $this->blog_widget_model->latestPosts($this->oBlog->id);
}
if (appSetting('sid... | php | protected function fetchSidebarWidgets()
{
$this->data['widget'] = new stdClass();
if (appSetting('sidebar_latest_posts', 'blog-' . $this->oBlog->id)) {
$this->data['widget']->latest_posts = $this->blog_widget_model->latestPosts($this->oBlog->id);
}
if (appSetting('sid... | [
"protected",
"function",
"fetchSidebarWidgets",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'widget'",
"]",
"=",
"new",
"stdClass",
"(",
")",
";",
"if",
"(",
"appSetting",
"(",
"'sidebar_latest_posts'",
",",
"'blog-'",
".",
"$",
"this",
"->",
"oBlog",
... | Loads all the enabled sidebar widgets
@return void | [
"Loads",
"all",
"the",
"enabled",
"sidebar",
"widgets"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/Blog.php#L498-L521 |
198,588 | nails/module-blog | blog/controllers/Blog.php | NAILS_Blog.loadView | private function loadView($sView, $aData = array())
{
$oView = Factory::service('View');
$sFile = $this->oSkin->path . 'views/' . $sView;
if (is_file($sFile . '.php')) {
$oView->load($sFile, $aData);
} elseif (!empty($this->oSkinParent)) {
$sFile = $this->... | php | private function loadView($sView, $aData = array())
{
$oView = Factory::service('View');
$sFile = $this->oSkin->path . 'views/' . $sView;
if (is_file($sFile . '.php')) {
$oView->load($sFile, $aData);
} elseif (!empty($this->oSkinParent)) {
$sFile = $this->... | [
"private",
"function",
"loadView",
"(",
"$",
"sView",
",",
"$",
"aData",
"=",
"array",
"(",
")",
")",
"{",
"$",
"oView",
"=",
"Factory",
"::",
"service",
"(",
"'View'",
")",
";",
"$",
"sFile",
"=",
"$",
"this",
"->",
"oSkin",
"->",
"path",
".",
"... | Loads a view from the skin, falls back tot he parent view if there is one.
@param string $sView The view to load
@return void | [
"Loads",
"a",
"view",
"from",
"the",
"skin",
"falls",
"back",
"tot",
"he",
"parent",
"view",
"if",
"there",
"is",
"one",
"."
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/Blog.php#L530-L552 |
198,589 | nails/module-blog | blog/controllers/Blog.php | NAILS_Blog._remap | public function _remap()
{
$method = $this->uri->rsegment(3) ? $this->uri->rsegment(3) : 'index';
if (method_exists($this, $method) && substr($method, 0, 1) != '_' && $this->input->get('id')) {
// Permalink
$this->single($this->input->get('id'));
} elseif (method_... | php | public function _remap()
{
$method = $this->uri->rsegment(3) ? $this->uri->rsegment(3) : 'index';
if (method_exists($this, $method) && substr($method, 0, 1) != '_' && $this->input->get('id')) {
// Permalink
$this->single($this->input->get('id'));
} elseif (method_... | [
"public",
"function",
"_remap",
"(",
")",
"{",
"$",
"method",
"=",
"$",
"this",
"->",
"uri",
"->",
"rsegment",
"(",
"3",
")",
"?",
"$",
"this",
"->",
"uri",
"->",
"rsegment",
"(",
"3",
")",
":",
"'index'",
";",
"if",
"(",
"method_exists",
"(",
"$... | Routes the URL
@return void | [
"Routes",
"the",
"URL"
] | 7b369c5209f4343fff7c7e2a22c237d5a95c8c24 | https://github.com/nails/module-blog/blob/7b369c5209f4343fff7c7e2a22c237d5a95c8c24/blog/controllers/Blog.php#L560-L584 |
198,590 | gplcart/cli | controllers/commands/Review.php | Review.cmdGetReview | public function cmdGetReview()
{
$result = $this->getListReview();
$this->outputFormat($result);
$this->outputFormatTableReview($result);
$this->output();
} | php | public function cmdGetReview()
{
$result = $this->getListReview();
$this->outputFormat($result);
$this->outputFormatTableReview($result);
$this->output();
} | [
"public",
"function",
"cmdGetReview",
"(",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getListReview",
"(",
")",
";",
"$",
"this",
"->",
"outputFormat",
"(",
"$",
"result",
")",
";",
"$",
"this",
"->",
"outputFormatTableReview",
"(",
"$",
"result",... | Callback for "review-get" command | [
"Callback",
"for",
"review",
"-",
"get",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Review.php#L40-L46 |
198,591 | gplcart/cli | controllers/commands/Review.php | Review.setStatusReview | protected function setStatusReview($status)
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (!isset($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
if (isset($id) && (empty($id) || !is_numeric($id))) {
$thi... | php | protected function setStatusReview($status)
{
$id = $this->getParam(0);
$all = $this->getParam('all');
if (!isset($id) && empty($all)) {
$this->errorAndExit($this->text('Invalid command'));
}
if (isset($id) && (empty($id) || !is_numeric($id))) {
$thi... | [
"protected",
"function",
"setStatusReview",
"(",
"$",
"status",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"getParam",
"(",
"0",
")",
";",
"$",
"all",
"=",
"$",
"this",
"->",
"getParam",
"(",
"'all'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$"... | Sets status for one or several reviews
@param bool $status | [
"Sets",
"status",
"for",
"one",
"or",
"several",
"reviews"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Review.php#L121-L165 |
198,592 | gplcart/cli | controllers/commands/Review.php | Review.cmdUpdateReview | public function cmdUpdateReview()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | php | public function cmdUpdateReview()
{
$params = $this->getParam();
if (empty($params[0]) || count($params) < 2) {
$this->errorAndExit($this->text('Invalid command'));
}
if (!is_numeric($params[0])) {
$this->errorAndExit($this->text('Invalid argument'));
... | [
"public",
"function",
"cmdUpdateReview",
"(",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParam",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"params",
"[",
"0",
"]",
")",
"||",
"count",
"(",
"$",
"params",
")",
"<",
"2",
")",
"{",
"$... | Callback for "review-update" command | [
"Callback",
"for",
"review",
"-",
"update",
"command"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Review.php#L184-L202 |
198,593 | gplcart/cli | controllers/commands/Review.php | Review.addReview | protected function addReview()
{
if (!$this->isError()) {
$id = $this->review->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | php | protected function addReview()
{
if (!$this->isError()) {
$id = $this->review->add($this->getSubmitted());
if (empty($id)) {
$this->errorAndExit($this->text('Unexpected result'));
}
$this->line($id);
}
} | [
"protected",
"function",
"addReview",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isError",
"(",
")",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"review",
"->",
"add",
"(",
"$",
"this",
"->",
"getSubmitted",
"(",
")",
")",
";",
"if",
"... | Add a new review | [
"Add",
"a",
"new",
"review"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Review.php#L271-L280 |
198,594 | gplcart/cli | controllers/commands/Review.php | Review.submitAddReview | protected function submitAddReview()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('review');
$this->addReview();
} | php | protected function submitAddReview()
{
$this->setSubmitted(null, $this->getParam());
$this->validateComponent('review');
$this->addReview();
} | [
"protected",
"function",
"submitAddReview",
"(",
")",
"{",
"$",
"this",
"->",
"setSubmitted",
"(",
"null",
",",
"$",
"this",
"->",
"getParam",
"(",
")",
")",
";",
"$",
"this",
"->",
"validateComponent",
"(",
"'review'",
")",
";",
"$",
"this",
"->",
"ad... | Add a new review at once | [
"Add",
"a",
"new",
"review",
"at",
"once"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Review.php#L296-L301 |
198,595 | gplcart/cli | controllers/commands/Review.php | Review.wizardAddReview | protected function wizardAddReview()
{
$this->validatePrompt('user_id', $this->text('User'), 'review');
$this->validatePrompt('product_id', $this->text('Product'), 'review');
$this->validatePrompt('text', $this->text('Text'), 'review');
$this->validatePrompt('status', $this->text('St... | php | protected function wizardAddReview()
{
$this->validatePrompt('user_id', $this->text('User'), 'review');
$this->validatePrompt('product_id', $this->text('Product'), 'review');
$this->validatePrompt('text', $this->text('Text'), 'review');
$this->validatePrompt('status', $this->text('St... | [
"protected",
"function",
"wizardAddReview",
"(",
")",
"{",
"$",
"this",
"->",
"validatePrompt",
"(",
"'user_id'",
",",
"$",
"this",
"->",
"text",
"(",
"'User'",
")",
",",
"'review'",
")",
";",
"$",
"this",
"->",
"validatePrompt",
"(",
"'product_id'",
",",
... | Add a new review step by step | [
"Add",
"a",
"new",
"review",
"step",
"by",
"step"
] | e57dba53e291a225b4bff0c0d9b23d685dd1c125 | https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Review.php#L306-L315 |
198,596 | Vectrex/vxPHP | src/File/MimeTypeGetter.php | MimeTypeGetter.getTypeFinfoExt | protected static function getTypeFinfoExt($file) {
$type = (new \finfo(FILEINFO_MIME_TYPE))->file($file);
if($type) {
return $type;
}
else {
return self::getTypeFileExtList($file);
}
} | php | protected static function getTypeFinfoExt($file) {
$type = (new \finfo(FILEINFO_MIME_TYPE))->file($file);
if($type) {
return $type;
}
else {
return self::getTypeFileExtList($file);
}
} | [
"protected",
"static",
"function",
"getTypeFinfoExt",
"(",
"$",
"file",
")",
"{",
"$",
"type",
"=",
"(",
"new",
"\\",
"finfo",
"(",
"FILEINFO_MIME_TYPE",
")",
")",
"->",
"file",
"(",
"$",
"file",
")",
";",
"if",
"(",
"$",
"type",
")",
"{",
"return",
... | Gets the Mime Type using the Fileinfo Extension.
If the Extension returns nothing the extension list
is used.
@param string $file the path to the File
@return string the Mime Type | [
"Gets",
"the",
"Mime",
"Type",
"using",
"the",
"Fileinfo",
"Extension",
".",
"If",
"the",
"Extension",
"returns",
"nothing",
"the",
"extension",
"list",
"is",
"used",
"."
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/MimeTypeGetter.php#L1042-L1054 |
198,597 | Vectrex/vxPHP | src/File/MimeTypeGetter.php | MimeTypeGetter.getTypeFileExtList | protected static function getTypeFileExtList($file) {
$info = pathinfo(strtolower($file));
if(isset(self::$extensionToMime[$info['extension']])) {
return self::$extensionToMime[$info['extension']];
}
else {
return self::DEFAULT_MIME_TYPE;
}
} | php | protected static function getTypeFileExtList($file) {
$info = pathinfo(strtolower($file));
if(isset(self::$extensionToMime[$info['extension']])) {
return self::$extensionToMime[$info['extension']];
}
else {
return self::DEFAULT_MIME_TYPE;
}
} | [
"protected",
"static",
"function",
"getTypeFileExtList",
"(",
"$",
"file",
")",
"{",
"$",
"info",
"=",
"pathinfo",
"(",
"strtolower",
"(",
"$",
"file",
")",
")",
";",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"extensionToMime",
"[",
"$",
"info",
"[",... | extracts the file extension and checks the extension array
for the extension. If it is found it returns the MIME type.
If not it returns the the default MIME type.
@param string $file the path to the file
@return string | [
"extracts",
"the",
"file",
"extension",
"and",
"checks",
"the",
"extension",
"array",
"for",
"the",
"extension",
".",
"If",
"it",
"is",
"found",
"it",
"returns",
"the",
"MIME",
"type",
".",
"If",
"not",
"it",
"returns",
"the",
"the",
"default",
"MIME",
"... | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/MimeTypeGetter.php#L1064-L1075 |
198,598 | Vectrex/vxPHP | src/File/MimeTypeGetter.php | MimeTypeGetter.getDefaultFileExtension | public static function getDefaultFileExtension($mime) {
if(empty(self::$mimeToExtension)) {
self::$mimeToExtension = array_flip(self::$extensionToMime);
}
return isset(self::$mimeToExtension[$mime]) ? self::$mimeToExtension[$mime] : '';
} | php | public static function getDefaultFileExtension($mime) {
if(empty(self::$mimeToExtension)) {
self::$mimeToExtension = array_flip(self::$extensionToMime);
}
return isset(self::$mimeToExtension[$mime]) ? self::$mimeToExtension[$mime] : '';
} | [
"public",
"static",
"function",
"getDefaultFileExtension",
"(",
"$",
"mime",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"mimeToExtension",
")",
")",
"{",
"self",
"::",
"$",
"mimeToExtension",
"=",
"array_flip",
"(",
"self",
"::",
"$",
"extension... | returns a default extension by a given MIME type
since a single MIME type can be assigned to more than one
extension the one determined by the array structure is returned
returns an empty string if no match for the MIME type was found
@param string
@return string | [
"returns",
"a",
"default",
"extension",
"by",
"a",
"given",
"MIME",
"type"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/File/MimeTypeGetter.php#L1131-L1139 |
198,599 | vaccuum/container | source/Traits/TContainerConfiguration.php | TContainerConfiguration.configure | protected function configure(IConfig $config)
{
$configuration = $config->get('container');
foreach ($configuration as $name => $group)
{
switch ($name)
{
case 'parameters':
$this->configureParameters($group);
b... | php | protected function configure(IConfig $config)
{
$configuration = $config->get('container');
foreach ($configuration as $name => $group)
{
switch ($name)
{
case 'parameters':
$this->configureParameters($group);
b... | [
"protected",
"function",
"configure",
"(",
"IConfig",
"$",
"config",
")",
"{",
"$",
"configuration",
"=",
"$",
"config",
"->",
"get",
"(",
"'container'",
")",
";",
"foreach",
"(",
"$",
"configuration",
"as",
"$",
"name",
"=>",
"$",
"group",
")",
"{",
"... | Configure container.
@param IConfig $config
@return void | [
"Configure",
"container",
"."
] | 7d474cf42656585a0f66b4cc6f697f1c3185c980 | https://github.com/vaccuum/container/blob/7d474cf42656585a0f66b4cc6f697f1c3185c980/source/Traits/TContainerConfiguration.php#L14-L43 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.