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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,700 | peterkahl/Chinese-Master | src/ChineseMaster.php | ChineseMaster.simp2trad | public static function simp2trad($str) {
if (empty($str)) {
throw new Exception('Argument str cannot be empty');
}
$charArray = array_flip(self::$trad2simple);
$ords = self::utf8ToUnicode($str);
foreach ($ords as $k => $val) {
if (array_key_exists($val, $charArray)) {
$ords[$k] =... | php | public static function simp2trad($str) {
if (empty($str)) {
throw new Exception('Argument str cannot be empty');
}
$charArray = array_flip(self::$trad2simple);
$ords = self::utf8ToUnicode($str);
foreach ($ords as $k => $val) {
if (array_key_exists($val, $charArray)) {
$ords[$k] =... | [
"public",
"static",
"function",
"simp2trad",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"str",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Argument str cannot be empty'",
")",
";",
"}",
"$",
"charArray",
"=",
"array_flip",
"(",
"self... | Converts simplified to traditional.
@param string | [
"Converts",
"simplified",
"to",
"traditional",
"."
] | 31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c | https://github.com/peterkahl/Chinese-Master/blob/31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c/src/ChineseMaster.php#L78-L93 |
225,701 | peterkahl/Chinese-Master | src/ChineseMaster.php | ChineseMaster.unicodeToUtf8 | private static function unicodeToUtf8($arr) {
$dest = '';
foreach ($arr as $src) {
$dest .= self::utf8($src);
}
return $dest;
} | php | private static function unicodeToUtf8($arr) {
$dest = '';
foreach ($arr as $src) {
$dest .= self::utf8($src);
}
return $dest;
} | [
"private",
"static",
"function",
"unicodeToUtf8",
"(",
"$",
"arr",
")",
"{",
"$",
"dest",
"=",
"''",
";",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"src",
")",
"{",
"$",
"dest",
".=",
"self",
"::",
"utf8",
"(",
"$",
"src",
")",
";",
"}",
"return",
... | Takes an array of integers representing the Unicode characters
and returns a UTF-8 string. | [
"Takes",
"an",
"array",
"of",
"integers",
"representing",
"the",
"Unicode",
"characters",
"and",
"returns",
"a",
"UTF",
"-",
"8",
"string",
"."
] | 31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c | https://github.com/peterkahl/Chinese-Master/blob/31e82bbcddcd9e2e5fa12db8d2e1026a1a0dbe9c/src/ChineseMaster.php#L117-L123 |
225,702 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Common/EncodingRequest.php | EncodingRequest.setDomQuery | public function setDomQuery($userid, $userkey, $action)
{
$request = $this->appendChild($this->createElement('query'));
// add action, userid and userkey params
$userid = $this->createElement('userid', $userid);
$userkey = $this->createElement('userkey', $userkey);
$action =... | php | public function setDomQuery($userid, $userkey, $action)
{
$request = $this->appendChild($this->createElement('query'));
// add action, userid and userkey params
$userid = $this->createElement('userid', $userid);
$userkey = $this->createElement('userkey', $userkey);
$action =... | [
"public",
"function",
"setDomQuery",
"(",
"$",
"userid",
",",
"$",
"userkey",
",",
"$",
"action",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"appendChild",
"(",
"$",
"this",
"->",
"createElement",
"(",
"'query'",
")",
")",
";",
"// add action, use... | Set Query & Auth Params
@param string $userid
User Id
@param string $userkey
User Key
@param string $action
Action Name
@return DOMNode | [
"Set",
"Query",
"&",
"Auth",
"Params"
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Common/EncodingRequest.php#L32-L46 |
225,703 | cmsgears/module-cart | common/services/resources/OrderItemService.php | OrderItemService.createFromCartItem | public function createFromCartItem( $order, $cartItem, $config = [] ) {
$model = $this->getModelObject();
// Set Attributes
$model->orderId = $order->id;
$model->createdBy = $order->creator->id;
// Copy from Cart Item
$model->copyForUpdateFrom( $cartItem, [ 'primaryUnitId', 'purchasingUnitId', 'quantity... | php | public function createFromCartItem( $order, $cartItem, $config = [] ) {
$model = $this->getModelObject();
// Set Attributes
$model->orderId = $order->id;
$model->createdBy = $order->creator->id;
// Copy from Cart Item
$model->copyForUpdateFrom( $cartItem, [ 'primaryUnitId', 'purchasingUnitId', 'quantity... | [
"public",
"function",
"createFromCartItem",
"(",
"$",
"order",
",",
"$",
"cartItem",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModelObject",
"(",
")",
";",
"// Set Attributes",
"$",
"model",
"->",
"orderId",
... | Create Order Item from cart item | [
"Create",
"Order",
"Item",
"from",
"cart",
"item"
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/services/resources/OrderItemService.php#L82-L97 |
225,704 | nails/module-barcode | barcode/controllers/Barcode.php | Barcode.serveFromCache | protected function serveFromCache($cacheFile, $hit = true)
{
/**
* Cache object exists, set the appropriate headers and return the
* contents of the file.
**/
$_stats = stat($this->cacheDir . $cacheFile);
// Set cache headers
$this->setCacheHeaders($_sta... | php | protected function serveFromCache($cacheFile, $hit = true)
{
/**
* Cache object exists, set the appropriate headers and return the
* contents of the file.
**/
$_stats = stat($this->cacheDir . $cacheFile);
// Set cache headers
$this->setCacheHeaders($_sta... | [
"protected",
"function",
"serveFromCache",
"(",
"$",
"cacheFile",
",",
"$",
"hit",
"=",
"true",
")",
"{",
"/**\n * Cache object exists, set the appropriate headers and return the\n * contents of the file.\n **/",
"$",
"_stats",
"=",
"stat",
"(",
"$",
"... | Serve a file from the cache, setting headers as we go then halt execution
@param string $cacheFile The cache file's filename
@param boolean $hit Whether this was a cache hit or not
@return void | [
"Serve",
"a",
"file",
"from",
"the",
"cache",
"setting",
"headers",
"as",
"we",
"go",
"then",
"halt",
"execution"
] | c8c9dbb5b458edc5d58d80c1350819a66036cfdb | https://github.com/nails/module-barcode/blob/c8c9dbb5b458edc5d58d80c1350819a66036cfdb/barcode/controllers/Barcode.php#L48-L74 |
225,705 | nails/module-barcode | barcode/controllers/Barcode.php | Barcode.setCacheHeaders | protected function setCacheHeaders($lastModified, $file, $hit)
{
// Set some flags
$this->cacheHeadersSet = true;
$this->cacheHeadersMaxAge = 31536000; // 1 year
$this->cacheHeadersLastModified = $lastModified;
$this->cacheHeadersExpires = time() + $this-... | php | protected function setCacheHeaders($lastModified, $file, $hit)
{
// Set some flags
$this->cacheHeadersSet = true;
$this->cacheHeadersMaxAge = 31536000; // 1 year
$this->cacheHeadersLastModified = $lastModified;
$this->cacheHeadersExpires = time() + $this-... | [
"protected",
"function",
"setCacheHeaders",
"(",
"$",
"lastModified",
",",
"$",
"file",
",",
"$",
"hit",
")",
"{",
"// Set some flags",
"$",
"this",
"->",
"cacheHeadersSet",
"=",
"true",
";",
"$",
"this",
"->",
"cacheHeadersMaxAge",
"=",
"31536000",
";",
"/... | Set the correct cache headers
@param string $lastModified The time the source file was last modified
@param string $file The filename
@param boolean $hit Whether this was a cache hit or not | [
"Set",
"the",
"correct",
"cache",
"headers"
] | c8c9dbb5b458edc5d58d80c1350819a66036cfdb | https://github.com/nails/module-barcode/blob/c8c9dbb5b458edc5d58d80c1350819a66036cfdb/barcode/controllers/Barcode.php#L84-L101 |
225,706 | nails/module-barcode | barcode/controllers/Barcode.php | Barcode.serveNotModified | protected function serveNotModified($file)
{
if (function_exists('apache_request_headers')) {
$headers = apache_request_headers();
} elseif ($this->input->server('HTTP_IF_NONE_MATCH')) {
$headers = array();
$headers['If-None-Match'] = $this->in... | php | protected function serveNotModified($file)
{
if (function_exists('apache_request_headers')) {
$headers = apache_request_headers();
} elseif ($this->input->server('HTTP_IF_NONE_MATCH')) {
$headers = array();
$headers['If-None-Match'] = $this->in... | [
"protected",
"function",
"serveNotModified",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"function_exists",
"(",
"'apache_request_headers'",
")",
")",
"{",
"$",
"headers",
"=",
"apache_request_headers",
"(",
")",
";",
"}",
"elseif",
"(",
"$",
"this",
"->",
"input... | Serve the "not modified" headers, if appropriate
@param string $file The file to server headers for
@return boolean | [
"Serve",
"the",
"not",
"modified",
"headers",
"if",
"appropriate"
] | c8c9dbb5b458edc5d58d80c1350819a66036cfdb | https://github.com/nails/module-barcode/blob/c8c9dbb5b458edc5d58d80c1350819a66036cfdb/barcode/controllers/Barcode.php#L143-L206 |
225,707 | cmsgears/module-notify | common/services/resources/AnnouncementService.php | AnnouncementService.getRecentByAdmin | public function getRecentByAdmin( $limit = 5, $config = [] ) {
$modelClass = static::$modelClass;
$modelTable = $this->getModelTable();
$siteId = Yii::$app->core->siteId;
$config[ 'conditions' ][] = "$modelTable.access >=" . Announcement::ACCESS_APP_ADMIN;
return $modelClass::find()
->where( $config[ '... | php | public function getRecentByAdmin( $limit = 5, $config = [] ) {
$modelClass = static::$modelClass;
$modelTable = $this->getModelTable();
$siteId = Yii::$app->core->siteId;
$config[ 'conditions' ][] = "$modelTable.access >=" . Announcement::ACCESS_APP_ADMIN;
return $modelClass::find()
->where( $config[ '... | [
"public",
"function",
"getRecentByAdmin",
"(",
"$",
"limit",
"=",
"5",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"modelClass",
"=",
"static",
"::",
"$",
"modelClass",
";",
"$",
"modelTable",
"=",
"$",
"this",
"->",
"getModelTable",
"(",
")",
... | It returns the most recent announcements that can be displayed on Admin.
@param integer $limit
@param array $config
@return \cmsgears\notify\common\models\resources\Announcement | [
"It",
"returns",
"the",
"most",
"recent",
"announcements",
"that",
"can",
"be",
"displayed",
"on",
"Admin",
"."
] | 2cca001d47dc4615c49cc704f0a3f8b0baf03cf6 | https://github.com/cmsgears/module-notify/blob/2cca001d47dc4615c49cc704f0a3f8b0baf03cf6/common/services/resources/AnnouncementService.php#L245-L260 |
225,708 | railken/amethyst-price-rule | src/PriceRules/ExpressionPriceRule.php | ExpressionPriceRule.calculate | public function calculate(PriceRule $priceRule, float $price, array $options = [])
{
$payload = $priceRule->payload;
$options = (object) $options;
$parser = new StdMathParser();
if (!isset($payload->expression)) {
throw new Exceptions\PriceRuleWrongPayloadException('Mi... | php | public function calculate(PriceRule $priceRule, float $price, array $options = [])
{
$payload = $priceRule->payload;
$options = (object) $options;
$parser = new StdMathParser();
if (!isset($payload->expression)) {
throw new Exceptions\PriceRuleWrongPayloadException('Mi... | [
"public",
"function",
"calculate",
"(",
"PriceRule",
"$",
"priceRule",
",",
"float",
"$",
"price",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"payload",
"=",
"$",
"priceRule",
"->",
"payload",
";",
"$",
"options",
"=",
"(",
"object",
... | Given the base priceRule calculate the final price.
@param PriceRule $priceRule
@param float $price
@param array $options
@return float | [
"Given",
"the",
"base",
"priceRule",
"calculate",
"the",
"final",
"price",
"."
] | cdcdab58f61d85faa99525d7087ce1abd1a8388a | https://github.com/railken/amethyst-price-rule/blob/cdcdab58f61d85faa99525d7087ce1abd1a8388a/src/PriceRules/ExpressionPriceRule.php#L22-L43 |
225,709 | 975L/PaymentBundle | Twig/PaymentButton.php | PaymentButton.paymentButton | public function paymentButton(Environment $environment, $text = null, $amount = null, $currency = null, $style = 'btn btn-lg btn-primary')
{
return $environment->render('@c975LPayment/fragments/paymentButton.html.twig', array(
'text' => $text,
'amount' => $amount,
... | php | public function paymentButton(Environment $environment, $text = null, $amount = null, $currency = null, $style = 'btn btn-lg btn-primary')
{
return $environment->render('@c975LPayment/fragments/paymentButton.html.twig', array(
'text' => $text,
'amount' => $amount,
... | [
"public",
"function",
"paymentButton",
"(",
"Environment",
"$",
"environment",
",",
"$",
"text",
"=",
"null",
",",
"$",
"amount",
"=",
"null",
",",
"$",
"currency",
"=",
"null",
",",
"$",
"style",
"=",
"'btn btn-lg btn-primary'",
")",
"{",
"return",
"$",
... | Returns xhtml code for Payment button
@return string | [
"Returns",
"xhtml",
"code",
"for",
"Payment",
"button"
] | da3beb13842aea6a3dc278eeb565f519040995b7 | https://github.com/975L/PaymentBundle/blob/da3beb13842aea6a3dc278eeb565f519040995b7/Twig/PaymentButton.php#L41-L49 |
225,710 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php | StoreHelper.createClass | public static function createClass(
$class,
$data
)
{
if (!class_exists($class)) {
return null;
}
$ref = new \ReflectionClass($class);
if ($ref->isAbstract()) {
return null;
}
$store = new $class($data);
... | php | public static function createClass(
$class,
$data
)
{
if (!class_exists($class)) {
return null;
}
$ref = new \ReflectionClass($class);
if ($ref->isAbstract()) {
return null;
}
$store = new $class($data);
... | [
"public",
"static",
"function",
"createClass",
"(",
"$",
"class",
",",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"class",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"ref",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"... | Create a class if exists and not abstract | [
"Create",
"a",
"class",
"if",
"exists",
"and",
"not",
"abstract"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php#L92-L107 |
225,711 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php | StoreHelper.getStoreClass | public static function getStoreClass($inValue, array $defaultClassName)
{
//Get the class inside the values
if ($inValue && isset($inValue->_className) && class_exists($inValue->_className)) {
return $inValue->_className;
}
//We take it from the array if there is only on... | php | public static function getStoreClass($inValue, array $defaultClassName)
{
//Get the class inside the values
if ($inValue && isset($inValue->_className) && class_exists($inValue->_className)) {
return $inValue->_className;
}
//We take it from the array if there is only on... | [
"public",
"static",
"function",
"getStoreClass",
"(",
"$",
"inValue",
",",
"array",
"$",
"defaultClassName",
")",
"{",
"//Get the class inside the values",
"if",
"(",
"$",
"inValue",
"&&",
"isset",
"(",
"$",
"inValue",
"->",
"_className",
")",
"&&",
"class_exist... | return a string that represent a store.
Look first inside the $inValue.
If mot, take if from the definition
and check if class exists
in definition
@param array $definition | [
"return",
"a",
"string",
"that",
"represent",
"a",
"store",
"."
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php#L119-L146 |
225,712 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php | StoreHelper.matchType | public static function matchType($inValue, $className) {
if ($inValue instanceof \stdClass) {
$inValueKeys = array_keys(get_object_vars($inValue));
if (in_array('_type', $inValueKeys)) {
$tempStore = new $className();
$tempStoreType = $tempStore->get_type(... | php | public static function matchType($inValue, $className) {
if ($inValue instanceof \stdClass) {
$inValueKeys = array_keys(get_object_vars($inValue));
if (in_array('_type', $inValueKeys)) {
$tempStore = new $className();
$tempStoreType = $tempStore->get_type(... | [
"public",
"static",
"function",
"matchType",
"(",
"$",
"inValue",
",",
"$",
"className",
")",
"{",
"if",
"(",
"$",
"inValue",
"instanceof",
"\\",
"stdClass",
")",
"{",
"$",
"inValueKeys",
"=",
"array_keys",
"(",
"get_object_vars",
"(",
"$",
"inValue",
")",... | Use the _type in value to detect if matches with an array of
classes given
@param $inValue
@param $className
@return mixed | [
"Use",
"the",
"_type",
"in",
"value",
"to",
"detect",
"if",
"matches",
"with",
"an",
"array",
"of",
"classes",
"given"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php#L156-L167 |
225,713 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php | StoreHelper.checkStoreClass | public static function checkStoreClass($store, array $storeClasses, array $allowedId)
{
if (is_string($store) && strstr($store, '_')) {
list($prefix, $id) = explode('_', $store);
if (in_array($prefix, $allowedId)) {
return true;
}
return fals... | php | public static function checkStoreClass($store, array $storeClasses, array $allowedId)
{
if (is_string($store) && strstr($store, '_')) {
list($prefix, $id) = explode('_', $store);
if (in_array($prefix, $allowedId)) {
return true;
}
return fals... | [
"public",
"static",
"function",
"checkStoreClass",
"(",
"$",
"store",
",",
"array",
"$",
"storeClasses",
",",
"array",
"$",
"allowedId",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"store",
")",
"&&",
"strstr",
"(",
"$",
"store",
",",
"'_'",
")",
")",
... | Check if the store class type is part of declared classes in
storeClasses. | [
"Check",
"if",
"the",
"store",
"class",
"type",
"is",
"part",
"of",
"declared",
"classes",
"in",
"storeClasses",
"."
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Store/Base/StoreHelper.php#L173-L187 |
225,714 | Eve-PHP/Framework | src/Cli/Generate.php | Generate.copy | public function copy($source, $destination)
{
$contents = $this('file', $source)->getContent();
$template = $this->engine->compile($contents);
$code = $template($this->schema);
$code = str_replace('\\\\', '\\', $code);
$code = str_replace('\}', '}', $code);
$code = s... | php | public function copy($source, $destination)
{
$contents = $this('file', $source)->getContent();
$template = $this->engine->compile($contents);
$code = $template($this->schema);
$code = str_replace('\\\\', '\\', $code);
$code = str_replace('\}', '}', $code);
$code = s... | [
"public",
"function",
"copy",
"(",
"$",
"source",
",",
"$",
"destination",
")",
"{",
"$",
"contents",
"=",
"$",
"this",
"(",
"'file'",
",",
"$",
"source",
")",
"->",
"getContent",
"(",
")",
";",
"$",
"template",
"=",
"$",
"this",
"->",
"engine",
"-... | Copy the contents from to
@return Eve\Framework\Cli\Generate | [
"Copy",
"the",
"contents",
"from",
"to"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Cli/Generate.php#L515-L532 |
225,715 | Erebot/API | src/Event/Match/CollectionAbstract.php | CollectionAbstract.& | public function & add($filter)
{
$filters = func_get_args();
foreach ($filters as $filter) {
if (!($filter instanceof \Erebot\Interfaces\Event\Match)) {
throw new \Erebot\InvalidValueException('Not a valid matcher');
}
if (!in_array($filter, $this-... | php | public function & add($filter)
{
$filters = func_get_args();
foreach ($filters as $filter) {
if (!($filter instanceof \Erebot\Interfaces\Event\Match)) {
throw new \Erebot\InvalidValueException('Not a valid matcher');
}
if (!in_array($filter, $this-... | [
"public",
"function",
"&",
"add",
"(",
"$",
"filter",
")",
"{",
"$",
"filters",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"filter",
"instanceof",
"\\",
"Erebot",
"\... | Adds one or more subfilters to this filter.
\retval Erebot::Event::Match::CollectionAbstract
Returns this instance, so that multiple calls
to Erebot::Event::Match::CollectionAbstract::add()
can be chained up together.
\param $filter,... One or more filters to add as subfilters
of this filter. Duplicates are silentl... | [
"Adds",
"one",
"or",
"more",
"subfilters",
"to",
"this",
"filter",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Event/Match/CollectionAbstract.php#L105-L117 |
225,716 | Erebot/API | src/Event/Match/CollectionAbstract.php | CollectionAbstract.& | public function & remove($filter)
{
$filters = func_get_args();
foreach ($filters as $filter) {
if (!($filter instanceof \Erebot\Interfaces\Event\Match)) {
throw new \Erebot\InvalidValueException('Not a valid matcher');
}
$key = array_search($filte... | php | public function & remove($filter)
{
$filters = func_get_args();
foreach ($filters as $filter) {
if (!($filter instanceof \Erebot\Interfaces\Event\Match)) {
throw new \Erebot\InvalidValueException('Not a valid matcher');
}
$key = array_search($filte... | [
"public",
"function",
"&",
"remove",
"(",
"$",
"filter",
")",
"{",
"$",
"filters",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"filter",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"filter",
"instanceof",
"\\",
"Erebot",
... | Removes one or more subfilters from this filter.
\retval Erebot::Event::Match::CollectionAbstract
Returns this instance, so that multiple calls
to Erebot::Event::Match::CollectionAbstract::remove()
can be chained up together.
\param $filter,... One or more filters to remove from this
filter's subfilters. Filters wh... | [
"Removes",
"one",
"or",
"more",
"subfilters",
"from",
"this",
"filter",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Event/Match/CollectionAbstract.php#L132-L145 |
225,717 | SetBased/php-abc-form-louver | src/Control/SlatControlFactory.php | SlatControlFactory.createFormControl | public function createFormControl(ComplexControl $parentControl,
string $slatJointName,
?string $controlName = null): Control
{
$control = $this->slatJoints[$slatJointName]->createControl($controlName ?? $slatJointName);
$parentControl->a... | php | public function createFormControl(ComplexControl $parentControl,
string $slatJointName,
?string $controlName = null): Control
{
$control = $this->slatJoints[$slatJointName]->createControl($controlName ?? $slatJointName);
$parentControl->a... | [
"public",
"function",
"createFormControl",
"(",
"ComplexControl",
"$",
"parentControl",
",",
"string",
"$",
"slatJointName",
",",
"?",
"string",
"$",
"controlName",
"=",
"null",
")",
":",
"Control",
"{",
"$",
"control",
"=",
"$",
"this",
"->",
"slatJoints",
... | Creates a form control using a slat joint and returns the created form control.
@param ComplexControl $parentControl The parent form control for the created form control.
@param string $slatJointName The name of the slat joint.
@param string|null $controlName The name of the created form control. If null ... | [
"Creates",
"a",
"form",
"control",
"using",
"a",
"slat",
"joint",
"and",
"returns",
"the",
"created",
"form",
"control",
"."
] | 59ff07a59da4ba90ef9665a8893559cd66d37233 | https://github.com/SetBased/php-abc-form-louver/blob/59ff07a59da4ba90ef9665a8893559cd66d37233/src/Control/SlatControlFactory.php#L70-L78 |
225,718 | SetBased/php-abc-form-louver | src/Control/SlatControlFactory.php | SlatControlFactory.getHtmlColumnGroup | public function getHtmlColumnGroup(): string
{
$ret = '';
foreach ($this->slatJoints as $factory)
{
$ret .= $factory->getHtmlCol();
}
$ret .= '<col/>';
return $ret;
} | php | public function getHtmlColumnGroup(): string
{
$ret = '';
foreach ($this->slatJoints as $factory)
{
$ret .= $factory->getHtmlCol();
}
$ret .= '<col/>';
return $ret;
} | [
"public",
"function",
"getHtmlColumnGroup",
"(",
")",
":",
"string",
"{",
"$",
"ret",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"slatJoints",
"as",
"$",
"factory",
")",
"{",
"$",
"ret",
".=",
"$",
"factory",
"->",
"getHtmlCol",
"(",
")",
";"... | Returns the inner HTML code of the colgroup element of the table form control.
@return string | [
"Returns",
"the",
"inner",
"HTML",
"code",
"of",
"the",
"colgroup",
"element",
"of",
"the",
"table",
"form",
"control",
"."
] | 59ff07a59da4ba90ef9665a8893559cd66d37233 | https://github.com/SetBased/php-abc-form-louver/blob/59ff07a59da4ba90ef9665a8893559cd66d37233/src/Control/SlatControlFactory.php#L144-L155 |
225,719 | SetBased/php-abc-form-louver | src/Control/SlatControlFactory.php | SlatControlFactory.getHtmlHeader | public function getHtmlHeader(): string
{
$ret = Html::generateTag('tr', ['class' => [OverviewTable::$class, 'header']]);
foreach ($this->slatJoints as $factory)
{
$ret .= $factory->getHtmlColumnHeader();
}
$ret .= '<th class="error"></th>';
$ret .= '</tr>';
if ($this->filter)
{... | php | public function getHtmlHeader(): string
{
$ret = Html::generateTag('tr', ['class' => [OverviewTable::$class, 'header']]);
foreach ($this->slatJoints as $factory)
{
$ret .= $factory->getHtmlColumnHeader();
}
$ret .= '<th class="error"></th>';
$ret .= '</tr>';
if ($this->filter)
{... | [
"public",
"function",
"getHtmlHeader",
"(",
")",
":",
"string",
"{",
"$",
"ret",
"=",
"Html",
"::",
"generateTag",
"(",
"'tr'",
",",
"[",
"'class'",
"=>",
"[",
"OverviewTable",
"::",
"$",
"class",
",",
"'header'",
"]",
"]",
")",
";",
"foreach",
"(",
... | Returns the inner HTML code of the thead element of the table form control.
@return string | [
"Returns",
"the",
"inner",
"HTML",
"code",
"of",
"the",
"thead",
"element",
"of",
"the",
"table",
"form",
"control",
"."
] | 59ff07a59da4ba90ef9665a8893559cd66d37233 | https://github.com/SetBased/php-abc-form-louver/blob/59ff07a59da4ba90ef9665a8893559cd66d37233/src/Control/SlatControlFactory.php#L163-L185 |
225,720 | SetBased/php-abc-form-louver | src/Control/SlatControlFactory.php | SlatControlFactory.getOrdinal | public function getOrdinal(string $slatJointName): int
{
$ordinal = 0;
$key = null;
foreach ($this->slatJoints as $key => $slat_joint)
{
if ($key==$slatJointName) break;
$ordinal += $slat_joint->getColSpan();
}
if ($key!=$slatJointName)
{
throw new LogicException("S... | php | public function getOrdinal(string $slatJointName): int
{
$ordinal = 0;
$key = null;
foreach ($this->slatJoints as $key => $slat_joint)
{
if ($key==$slatJointName) break;
$ordinal += $slat_joint->getColSpan();
}
if ($key!=$slatJointName)
{
throw new LogicException("S... | [
"public",
"function",
"getOrdinal",
"(",
"string",
"$",
"slatJointName",
")",
":",
"int",
"{",
"$",
"ordinal",
"=",
"0",
";",
"$",
"key",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"slatJoints",
"as",
"$",
"key",
"=>",
"$",
"slat_joint",
")... | Returns the 0-indexed ordinal of a slat joint in the underlying table of the louver form control.
@param string $slatJointName The name of the slat joint.
@return int
@throws LogicException | [
"Returns",
"the",
"0",
"-",
"indexed",
"ordinal",
"of",
"a",
"slat",
"joint",
"in",
"the",
"underlying",
"table",
"of",
"the",
"louver",
"form",
"control",
"."
] | 59ff07a59da4ba90ef9665a8893559cd66d37233 | https://github.com/SetBased/php-abc-form-louver/blob/59ff07a59da4ba90ef9665a8893559cd66d37233/src/Control/SlatControlFactory.php#L208-L225 |
225,721 | MASNathan/Object | src/SuperObject.php | SuperObject.set | public function set($key, $value)
{
// If a child is an associative array or an stdClass we convert it as well
if ((is_array($value) && (bool) count(array_filter(array_keys($value), 'is_string'))) || (is_object($value) && get_class($value) == 'stdClass')) {
$value = new self($value);
... | php | public function set($key, $value)
{
// If a child is an associative array or an stdClass we convert it as well
if ((is_array($value) && (bool) count(array_filter(array_keys($value), 'is_string'))) || (is_object($value) && get_class($value) == 'stdClass')) {
$value = new self($value);
... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"// If a child is an associative array or an stdClass we convert it as well",
"if",
"(",
"(",
"is_array",
"(",
"$",
"value",
")",
"&&",
"(",
"bool",
")",
"count",
"(",
"array_filter",
"("... | Sets a value to the requested key
@param string $key Key
@param mixed $value Value | [
"Sets",
"a",
"value",
"to",
"the",
"requested",
"key"
] | 19154ddce8ef371bf97901fe17a3a09cfb54aff1 | https://github.com/MASNathan/Object/blob/19154ddce8ef371bf97901fe17a3a09cfb54aff1/src/SuperObject.php#L70-L81 |
225,722 | MASNathan/Object | src/SuperObject.php | SuperObject.toArray | public function toArray($convertRecursively = true)
{
if ($convertRecursively) {
// We use the json serializer as help to recursively convert the Object instances
return json_decode(json_encode($this), true);
} else {
return (array) $this->data;
}
} | php | public function toArray($convertRecursively = true)
{
if ($convertRecursively) {
// We use the json serializer as help to recursively convert the Object instances
return json_decode(json_encode($this), true);
} else {
return (array) $this->data;
}
} | [
"public",
"function",
"toArray",
"(",
"$",
"convertRecursively",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"convertRecursively",
")",
"{",
"// We use the json serializer as help to recursively convert the Object instances",
"return",
"json_decode",
"(",
"json_encode",
"(",
"... | Recursively converts all the Object instances to array
@return array | [
"Recursively",
"converts",
"all",
"the",
"Object",
"instances",
"to",
"array"
] | 19154ddce8ef371bf97901fe17a3a09cfb54aff1 | https://github.com/MASNathan/Object/blob/19154ddce8ef371bf97901fe17a3a09cfb54aff1/src/SuperObject.php#L229-L237 |
225,723 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Compiler/CoreInitializationPass.php | CoreInitializationPass.process | public function process(ContainerBuilder $container)
{
// Connect to database and build manifest
$frameworkPath = $container->getParameter('behat.silverstripe_extension.framework_path');
$_GET['flush'] = 1;
require_once $frameworkPath . '/core/Core.php';
if(class_exi... | php | public function process(ContainerBuilder $container)
{
// Connect to database and build manifest
$frameworkPath = $container->getParameter('behat.silverstripe_extension.framework_path');
$_GET['flush'] = 1;
require_once $frameworkPath . '/core/Core.php';
if(class_exi... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"// Connect to database and build manifest",
"$",
"frameworkPath",
"=",
"$",
"container",
"->",
"getParameter",
"(",
"'behat.silverstripe_extension.framework_path'",
")",
";",
"$",
"_GET... | Loads kernel file.
@param ContainerBuilder $container | [
"Loads",
"kernel",
"file",
"."
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Compiler/CoreInitializationPass.php#L18-L36 |
225,724 | stubbles/stubbles-input | src/main/php/filter/RangeFilter.php | RangeFilter.wrap | public static function wrap(Filter $filter, Range $range = null)
{
if (null === $range) {
return $filter;
}
return new self($filter, $range);
} | php | public static function wrap(Filter $filter, Range $range = null)
{
if (null === $range) {
return $filter;
}
return new self($filter, $range);
} | [
"public",
"static",
"function",
"wrap",
"(",
"Filter",
"$",
"filter",
",",
"Range",
"$",
"range",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"range",
")",
"{",
"return",
"$",
"filter",
";",
"}",
"return",
"new",
"self",
"(",
"$",
"filter... | utility method that wraps given filter with given range
@param \stubbles\input\Filter $filter decorated filter
@param \stubbles\input\filter\range\Range $range range definition
@return \stubbles\input\Filter | [
"utility",
"method",
"that",
"wraps",
"given",
"filter",
"with",
"given",
"range"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/RangeFilter.php#L52-L59 |
225,725 | DrNixx/yii2-onix | src/system/DateIntervalHelper.php | DateIntervalHelper.totalDays | public static function totalDays($interval)
{
if ($interval->days !== false) {
return $interval->days;
} else {
return $interval->d + self::totalMonths($interval) * 30;
}
} | php | public static function totalDays($interval)
{
if ($interval->days !== false) {
return $interval->days;
} else {
return $interval->d + self::totalMonths($interval) * 30;
}
} | [
"public",
"static",
"function",
"totalDays",
"(",
"$",
"interval",
")",
"{",
"if",
"(",
"$",
"interval",
"->",
"days",
"!==",
"false",
")",
"{",
"return",
"$",
"interval",
"->",
"days",
";",
"}",
"else",
"{",
"return",
"$",
"interval",
"->",
"d",
"+"... | Total days in interval
@param \DateInterval $interval
@return int | [
"Total",
"days",
"in",
"interval"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/system/DateIntervalHelper.php#L52-L59 |
225,726 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/SilverStripeContext.php | SilverStripeContext.getRegionObj | public function getRegionObj($region) {
// Try to find regions directly by CSS selector.
try {
$regionObj = $this->getSession()->getPage()->find(
'css',
// Escape CSS selector
(false !== strpos($region, "'")) ? str_replace("'", "\'", $region) : $region
);
if($regionObj) {
return $regionObj;... | php | public function getRegionObj($region) {
// Try to find regions directly by CSS selector.
try {
$regionObj = $this->getSession()->getPage()->find(
'css',
// Escape CSS selector
(false !== strpos($region, "'")) ? str_replace("'", "\'", $region) : $region
);
if($regionObj) {
return $regionObj;... | [
"public",
"function",
"getRegionObj",
"(",
"$",
"region",
")",
"{",
"// Try to find regions directly by CSS selector.",
"try",
"{",
"$",
"regionObj",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"find",
"(",
"'css'",
",",
... | Returns MinkElement based off region defined in .yml file.
Also supports direct CSS selectors and regions identified by a "data-title" attribute.
When using the "data-title" attribute, ensure not to include double quotes.
@param String $region Region name or CSS selector
@return MinkElement|null | [
"Returns",
"MinkElement",
"based",
"off",
"region",
"defined",
"in",
".",
"yml",
"file",
".",
"Also",
"supports",
"direct",
"CSS",
"selectors",
"and",
"regions",
"identified",
"by",
"a",
"data",
"-",
"title",
"attribute",
".",
"When",
"using",
"the",
"data",... | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/SilverStripeContext.php#L139-L180 |
225,727 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/SilverStripeContext.php | SilverStripeContext.parseUrl | public function parseUrl($url) {
$url = parse_url($url);
$url['vars'] = array();
if (!isset($url['fragment'])) {
$url['fragment'] = null;
}
if (isset($url['query'])) {
parse_str($url['query'], $url['vars']);
}
return $url;
} | php | public function parseUrl($url) {
$url = parse_url($url);
$url['vars'] = array();
if (!isset($url['fragment'])) {
$url['fragment'] = null;
}
if (isset($url['query'])) {
parse_str($url['query'], $url['vars']);
}
return $url;
} | [
"public",
"function",
"parseUrl",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"parse_url",
"(",
"$",
"url",
")",
";",
"$",
"url",
"[",
"'vars'",
"]",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"url",
"[",
"'fragment'",
"]",... | Parses given URL and returns its components
@param $url
@return array|mixed Parsed URL | [
"Parses",
"given",
"URL",
"and",
"returns",
"its",
"components"
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/SilverStripeContext.php#L243-L254 |
225,728 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/SilverStripeContext.php | SilverStripeContext.joinUrlParts | public function joinUrlParts() {
if (0 === func_num_args()) {
throw new \InvalidArgumentException('Need at least one argument');
}
$parts = func_get_args();
$trimSlashes = function(&$part) {
$part = trim($part, '/');
};
array_walk($parts, $trimSlashes);
return implode('/', $parts);
} | php | public function joinUrlParts() {
if (0 === func_num_args()) {
throw new \InvalidArgumentException('Need at least one argument');
}
$parts = func_get_args();
$trimSlashes = function(&$part) {
$part = trim($part, '/');
};
array_walk($parts, $trimSlashes);
return implode('/', $parts);
} | [
"public",
"function",
"joinUrlParts",
"(",
")",
"{",
"if",
"(",
"0",
"===",
"func_num_args",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Need at least one argument'",
")",
";",
"}",
"$",
"parts",
"=",
"func_get_args",
"(",
")... | Joins URL parts into an URL using forward slash.
Forward slash usages are normalised to one between parts.
This method takes variable number of parameters.
@param $...
@return string
@throws \InvalidArgumentException | [
"Joins",
"URL",
"parts",
"into",
"an",
"URL",
"using",
"forward",
"slash",
".",
"Forward",
"slash",
"usages",
"are",
"normalised",
"to",
"one",
"between",
"parts",
".",
"This",
"method",
"takes",
"variable",
"number",
"of",
"parameters",
"."
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/SilverStripeContext.php#L305-L317 |
225,729 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/SilverStripeContext.php | SilverStripeContext.selectOption | public function selectOption($select, $option) {
// Find field
$field = $this
->getSession()
->getPage()
->findField($this->fixStepArgument($select));
// If field is visible then select it as per normal
if($field && $field->isVisible()) {
parent::selectOption($select, $option);
} else {
$this-... | php | public function selectOption($select, $option) {
// Find field
$field = $this
->getSession()
->getPage()
->findField($this->fixStepArgument($select));
// If field is visible then select it as per normal
if($field && $field->isVisible()) {
parent::selectOption($select, $option);
} else {
$this-... | [
"public",
"function",
"selectOption",
"(",
"$",
"select",
",",
"$",
"option",
")",
"{",
"// Find field",
"$",
"field",
"=",
"$",
"this",
"->",
"getSession",
"(",
")",
"->",
"getPage",
"(",
")",
"->",
"findField",
"(",
"$",
"this",
"->",
"fixStepArgument"... | Selects option in select field with specified id|name|label|value.
@override /^(?:|I )select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/ | [
"Selects",
"option",
"in",
"select",
"field",
"with",
"specified",
"id|name|label|value",
"."
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/SilverStripeContext.php#L436-L449 |
225,730 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/SilverStripeContext.php | SilverStripeContext.selectOptionWithJavascript | public function selectOptionWithJavascript($select, $option) {
$select = $this->fixStepArgument($select);
$option = $this->fixStepArgument($option);
$page = $this->getSession()->getPage();
// Find field
$field = $page->findField($select);
if (null === $field) {
throw new ElementNotFoundException($this->... | php | public function selectOptionWithJavascript($select, $option) {
$select = $this->fixStepArgument($select);
$option = $this->fixStepArgument($option);
$page = $this->getSession()->getPage();
// Find field
$field = $page->findField($select);
if (null === $field) {
throw new ElementNotFoundException($this->... | [
"public",
"function",
"selectOptionWithJavascript",
"(",
"$",
"select",
",",
"$",
"option",
")",
"{",
"$",
"select",
"=",
"$",
"this",
"->",
"fixStepArgument",
"(",
"$",
"select",
")",
";",
"$",
"option",
"=",
"$",
"this",
"->",
"fixStepArgument",
"(",
"... | Selects option in select field with specified id|name|label|value using javascript
This method uses javascript to allow selection of options that may be
overridden by javascript libraries, and thus hide the element.
@When /^(?:|I )select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)" with javascript$/ | [
"Selects",
"option",
"in",
"select",
"field",
"with",
"specified",
"id|name|label|value",
"using",
"javascript",
"This",
"method",
"uses",
"javascript",
"to",
"allow",
"selection",
"of",
"options",
"that",
"may",
"be",
"overridden",
"by",
"javascript",
"libraries",
... | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/SilverStripeContext.php#L458-L499 |
225,731 | edineibauer/helpers | public/src/Helpers/Helper.php | Helper.corAuxiliar | public static function corAuxiliar($name)
{
$style = str_replace("#", "", $name);
$style = strlen($style) === 3 ? $style[0] . $style[0] . $style[1] . $style[1] . $style[2] . $style[2] : $style;
$todo = hexdec($style[0] . $style[1]) + hexdec($style[2] . $style[3]) + hexdec($style[4] . $style... | php | public static function corAuxiliar($name)
{
$style = str_replace("#", "", $name);
$style = strlen($style) === 3 ? $style[0] . $style[0] . $style[1] . $style[1] . $style[2] . $style[2] : $style;
$todo = hexdec($style[0] . $style[1]) + hexdec($style[2] . $style[3]) + hexdec($style[4] . $style... | [
"public",
"static",
"function",
"corAuxiliar",
"(",
"$",
"name",
")",
"{",
"$",
"style",
"=",
"str_replace",
"(",
"\"#\"",
",",
"\"\"",
",",
"$",
"name",
")",
";",
"$",
"style",
"=",
"strlen",
"(",
"$",
"style",
")",
"===",
"3",
"?",
"$",
"style",
... | retorna cor auxiliar inversa em hexadecimal
@param STRING $name = hexadecimal color
@return STRING = cor de resalte à $name | [
"retorna",
"cor",
"auxiliar",
"inversa",
"em",
"hexadecimal"
] | 3ed14fec3a8f2f282107f79f6bd1ca11e6882300 | https://github.com/edineibauer/helpers/blob/3ed14fec3a8f2f282107f79f6bd1ca11e6882300/public/src/Helpers/Helper.php#L20-L33 |
225,732 | cmsgears/module-cms | frontend/controllers/post/DefaultController.php | DefaultController.updateStatus | protected function updateStatus( $post, $status ) {
// Update Post Status
$this->modelService->updateStatus( $post, $status );
return $this->checkStatus( $post );
} | php | protected function updateStatus( $post, $status ) {
// Update Post Status
$this->modelService->updateStatus( $post, $status );
return $this->checkStatus( $post );
} | [
"protected",
"function",
"updateStatus",
"(",
"$",
"post",
",",
"$",
"status",
")",
"{",
"// Update Post Status",
"$",
"this",
"->",
"modelService",
"->",
"updateStatus",
"(",
"$",
"post",
",",
"$",
"status",
")",
";",
"return",
"$",
"this",
"->",
"checkSt... | Update post status and redirect to the last step filled by user. | [
"Update",
"post",
"status",
"and",
"redirect",
"to",
"the",
"last",
"step",
"filled",
"by",
"user",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/frontend/controllers/post/DefaultController.php#L432-L438 |
225,733 | railken/amethyst-work | src/Workers/FileWorker.php | FileWorker.execute | public function execute(Work $work, stdClass $payload, array $data = [])
{
$generator = $this->manager->getRepository()->findOneById($payload->data->id);
$result = $this->manager->generate($generator, $data);
} | php | public function execute(Work $work, stdClass $payload, array $data = [])
{
$generator = $this->manager->getRepository()->findOneById($payload->data->id);
$result = $this->manager->generate($generator, $data);
} | [
"public",
"function",
"execute",
"(",
"Work",
"$",
"work",
",",
"stdClass",
"$",
"payload",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"generator",
"=",
"$",
"this",
"->",
"manager",
"->",
"getRepository",
"(",
")",
"->",
"findOneById",
... | Dispatch a work.
@param Work $work
@param array $data | [
"Dispatch",
"a",
"work",
"."
] | ea1d4316a86395da5796b3aee291f8ebe4882aeb | https://github.com/railken/amethyst-work/blob/ea1d4316a86395da5796b3aee291f8ebe4882aeb/src/Workers/FileWorker.php#L30-L35 |
225,734 | bytic/form | src/Renderer/AbstractRenderer.php | AbstractRenderer.renderMessages | public function renderMessages()
{
$return = '';
$messages = $this->getForm()->getMessages();
foreach ($messages as $type => $lines) {
if ($type == "error") {
$return .= ErrorsHelper::render($lines);
} else {
$return .= MessagesHelper::... | php | public function renderMessages()
{
$return = '';
$messages = $this->getForm()->getMessages();
foreach ($messages as $type => $lines) {
if ($type == "error") {
$return .= ErrorsHelper::render($lines);
} else {
$return .= MessagesHelper::... | [
"public",
"function",
"renderMessages",
"(",
")",
"{",
"$",
"return",
"=",
"''",
";",
"$",
"messages",
"=",
"$",
"this",
"->",
"getForm",
"(",
")",
"->",
"getMessages",
"(",
")",
";",
"foreach",
"(",
"$",
"messages",
"as",
"$",
"type",
"=>",
"$",
"... | The errors are rendered using the Errors View Helper
@return string | [
"The",
"errors",
"are",
"rendered",
"using",
"the",
"Errors",
"View",
"Helper"
] | eb0fcb950b912c15f6fde6974e75d61eaaa06248 | https://github.com/bytic/form/blob/eb0fcb950b912c15f6fde6974e75d61eaaa06248/src/Renderer/AbstractRenderer.php#L137-L150 |
225,735 | SetBased/php-abc-form-louver | src/Control/SlatControl.php | SlatControl.getHtmlErrorCell | protected function getHtmlErrorCell(): string
{
$ret = '';
if (!$this->isValid())
{
$error_messages = $this->getErrorMessages(true);
$ret .= '<td class="error">';
if (!empty($error_messages))
{
foreach ($error_messages as $message)
{
$ret .= Html::txt2Ht... | php | protected function getHtmlErrorCell(): string
{
$ret = '';
if (!$this->isValid())
{
$error_messages = $this->getErrorMessages(true);
$ret .= '<td class="error">';
if (!empty($error_messages))
{
foreach ($error_messages as $message)
{
$ret .= Html::txt2Ht... | [
"protected",
"function",
"getHtmlErrorCell",
"(",
")",
":",
"string",
"{",
"$",
"ret",
"=",
"''",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"$",
"error_messages",
"=",
"$",
"this",
"->",
"getErrorMessages",
"(",
"true",
"... | Returns a table cell with the errors messages of all form controls at this row.
@return string | [
"Returns",
"a",
"table",
"cell",
"with",
"the",
"errors",
"messages",
"of",
"all",
"form",
"controls",
"at",
"this",
"row",
"."
] | 59ff07a59da4ba90ef9665a8893559cd66d37233 | https://github.com/SetBased/php-abc-form-louver/blob/59ff07a59da4ba90ef9665a8893559cd66d37233/src/Control/SlatControl.php#L108-L133 |
225,736 | bytic/Common | src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php | UsersControllerTrait.afterLoginRedirect | public function afterLoginRedirect()
{
$redirect = $this->getRequest()->query->get(
'redirect',
$this->Url()->default()
);
$this->flashRedirect(
$this->getModelManager()->getMessage('login-success'),
$redirect,
'success',
... | php | public function afterLoginRedirect()
{
$redirect = $this->getRequest()->query->get(
'redirect',
$this->Url()->default()
);
$this->flashRedirect(
$this->getModelManager()->getMessage('login-success'),
$redirect,
'success',
... | [
"public",
"function",
"afterLoginRedirect",
"(",
")",
"{",
"$",
"redirect",
"=",
"$",
"this",
"->",
"getRequest",
"(",
")",
"->",
"query",
"->",
"get",
"(",
"'redirect'",
",",
"$",
"this",
"->",
"Url",
"(",
")",
"->",
"default",
"(",
")",
")",
";",
... | Redirect after login | [
"Redirect",
"after",
"login"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php#L58-L71 |
225,737 | bytic/Common | src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php | UsersControllerTrait.setLoginMeta | protected function setLoginMeta($action)
{
$label = $this->getModelManager()->getLabel($action . '-title');
$urlMethod = 'get' . ucfirst($action) . 'URL';
$this->getView()->Breadcrumbs()
->addItem($label, $this->_getUser()->getManager()->$urlMethod());
$this->getView()->... | php | protected function setLoginMeta($action)
{
$label = $this->getModelManager()->getLabel($action . '-title');
$urlMethod = 'get' . ucfirst($action) . 'URL';
$this->getView()->Breadcrumbs()
->addItem($label, $this->_getUser()->getManager()->$urlMethod());
$this->getView()->... | [
"protected",
"function",
"setLoginMeta",
"(",
"$",
"action",
")",
"{",
"$",
"label",
"=",
"$",
"this",
"->",
"getModelManager",
"(",
")",
"->",
"getLabel",
"(",
"$",
"action",
".",
"'-title'",
")",
";",
"$",
"urlMethod",
"=",
"'get'",
".",
"ucfirst",
"... | Set Login Meta
@param string $action Action name
@return void | [
"Set",
"Login",
"Meta"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php#L80-L88 |
225,738 | bytic/Common | src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php | UsersControllerTrait.loginWith | public function loginWith()
{
$providerName = $_REQUEST["provider"];
$redirect = $_GET['redirect'];
$userProfile = $this->getAuthProvider()->authenticate($providerName);
if ($userProfile instanceof Exception) {
$this->getView()->set('exception', $userProfile);
}... | php | public function loginWith()
{
$providerName = $_REQUEST["provider"];
$redirect = $_GET['redirect'];
$userProfile = $this->getAuthProvider()->authenticate($providerName);
if ($userProfile instanceof Exception) {
$this->getView()->set('exception', $userProfile);
}... | [
"public",
"function",
"loginWith",
"(",
")",
"{",
"$",
"providerName",
"=",
"$",
"_REQUEST",
"[",
"\"provider\"",
"]",
";",
"$",
"redirect",
"=",
"$",
"_GET",
"[",
"'redirect'",
"]",
";",
"$",
"userProfile",
"=",
"$",
"this",
"->",
"getAuthProvider",
"("... | Login with Auth Provider | [
"Login",
"with",
"Auth",
"Provider"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php#L93-L117 |
225,739 | bytic/Common | src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php | UsersControllerTrait.oAuthLink | public function oAuthLink()
{
$providerName = $_REQUEST["provider"];
$userProfile = $this->getAuthProvider()->authenticate($providerName);
$this->_getUser()->first_name = $userProfile->firstName;
$this->_getUser()->last_name = $userProfile->lastName;
$this->_getUser()->email... | php | public function oAuthLink()
{
$providerName = $_REQUEST["provider"];
$userProfile = $this->getAuthProvider()->authenticate($providerName);
$this->_getUser()->first_name = $userProfile->firstName;
$this->_getUser()->last_name = $userProfile->lastName;
$this->_getUser()->email... | [
"public",
"function",
"oAuthLink",
"(",
")",
"{",
"$",
"providerName",
"=",
"$",
"_REQUEST",
"[",
"\"provider\"",
"]",
";",
"$",
"userProfile",
"=",
"$",
"this",
"->",
"getAuthProvider",
"(",
")",
"->",
"authenticate",
"(",
"$",
"providerName",
")",
";",
... | Link an OAuth to existing user | [
"Link",
"an",
"OAuth",
"to",
"existing",
"user"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php#L139-L165 |
225,740 | bytic/Common | src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php | UsersControllerTrait.profile | public function profile()
{
$formsProfile = $this->_getUser()->getForm('profile');
if ($formsProfile->execute()) {
$redirect = $this->getRequest()->query->get(
'redirect',
$this->getModelManager()->getProfileURL()
);
$this->flashRe... | php | public function profile()
{
$formsProfile = $this->_getUser()->getForm('profile');
if ($formsProfile->execute()) {
$redirect = $this->getRequest()->query->get(
'redirect',
$this->getModelManager()->getProfileURL()
);
$this->flashRe... | [
"public",
"function",
"profile",
"(",
")",
"{",
"$",
"formsProfile",
"=",
"$",
"this",
"->",
"_getUser",
"(",
")",
"->",
"getForm",
"(",
"'profile'",
")",
";",
"if",
"(",
"$",
"formsProfile",
"->",
"execute",
"(",
")",
")",
"{",
"$",
"redirect",
"=",... | User Profile Page | [
"User",
"Profile",
"Page"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Application/Modules/Frontend/Controllers/Traits/UsersControllerTrait.php#L212-L228 |
225,741 | charlesportwoodii/rpq-client | src/Job.php | Job.cancel | public function cancel()
{
if ($this->id === null) {
return false;
}
$key = $this->queue->generateListKey();
$id = "$key:" . $this->id;
// Delete the job from the current and scheduled queue, then remove the job details from Redis
$result = $this->queue-... | php | public function cancel()
{
if ($this->id === null) {
return false;
}
$key = $this->queue->generateListKey();
$id = "$key:" . $this->id;
// Delete the job from the current and scheduled queue, then remove the job details from Redis
$result = $this->queue-... | [
"public",
"function",
"cancel",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"id",
"===",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"key",
"=",
"$",
"this",
"->",
"queue",
"->",
"generateListKey",
"(",
")",
";",
"$",
"id",
"=",
"\"$key:... | Cancels a job from executing
@return boolean | [
"Cancels",
"a",
"job",
"from",
"executing"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Job.php#L145-L173 |
225,742 | charlesportwoodii/rpq-client | src/Job.php | Job.retry | public function retry($backOffTime = null)
{
$retry = $this->getRetry();
// Log the retry
$this->queue->getClient()->getRedis()->hset(\date('Y-m-d') . '_retry', (string)\time(), \json_encode([
'class' => $this->getWorkerClass(),
'args' => $this->getArgs(),
... | php | public function retry($backOffTime = null)
{
$retry = $this->getRetry();
// Log the retry
$this->queue->getClient()->getRedis()->hset(\date('Y-m-d') . '_retry', (string)\time(), \json_encode([
'class' => $this->getWorkerClass(),
'args' => $this->getArgs(),
... | [
"public",
"function",
"retry",
"(",
"$",
"backOffTime",
"=",
"null",
")",
"{",
"$",
"retry",
"=",
"$",
"this",
"->",
"getRetry",
"(",
")",
";",
"// Log the retry",
"$",
"this",
"->",
"queue",
"->",
"getClient",
"(",
")",
"->",
"getRedis",
"(",
")",
"... | Retries a job
@param int $backOffTime
@return boolean | [
"Retries",
"a",
"job"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Job.php#L181-L202 |
225,743 | charlesportwoodii/rpq-client | src/Job.php | Job.end | public function end()
{
$key = $this->queue->generateListKey();
$key = "$key:" . $this->id;
$retry = $this->getRetry();
$result = $this->queue->getClient()->getRedis()->multi()
->del($key)
->hset(\date('Y-m-d') . '_pass', (string)\time(), \json_encode([
... | php | public function end()
{
$key = $this->queue->generateListKey();
$key = "$key:" . $this->id;
$retry = $this->getRetry();
$result = $this->queue->getClient()->getRedis()->multi()
->del($key)
->hset(\date('Y-m-d') . '_pass', (string)\time(), \json_encode([
... | [
"public",
"function",
"end",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"queue",
"->",
"generateListKey",
"(",
")",
";",
"$",
"key",
"=",
"\"$key:\"",
".",
"$",
"this",
"->",
"id",
";",
"$",
"retry",
"=",
"$",
"this",
"->",
"getRetry",
"(... | Ends a job and marks it as completed
@return boolean | [
"Ends",
"a",
"job",
"and",
"marks",
"it",
"as",
"completed"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Job.php#L209-L227 |
225,744 | charlesportwoodii/rpq-client | src/Job.php | Job.hydrate | private function hydrate()
{
$key = $this->queue->generateListKey();
$job = $this->queue->getClient()->getRedis()->hGetAll("$key:" . $this->id);
if (empty($job)) {
throw new JobNotFoundException('Unable to fetch job details from Redis.');
}
$this->workerClass = ... | php | private function hydrate()
{
$key = $this->queue->generateListKey();
$job = $this->queue->getClient()->getRedis()->hGetAll("$key:" . $this->id);
if (empty($job)) {
throw new JobNotFoundException('Unable to fetch job details from Redis.');
}
$this->workerClass = ... | [
"private",
"function",
"hydrate",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"queue",
"->",
"generateListKey",
"(",
")",
";",
"$",
"job",
"=",
"$",
"this",
"->",
"queue",
"->",
"getClient",
"(",
")",
"->",
"getRedis",
"(",
")",
"->",
"hGetA... | Hydrates the model by pulling data from Redis | [
"Hydrates",
"the",
"model",
"by",
"pulling",
"data",
"from",
"Redis"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Job.php#L257-L276 |
225,745 | ricardopedias/report-collection | src/Libs/Reader.php | Reader.createFromArray | public static function createFromArray(array $array) : Reader
{
$classname = \get_called_class(); // para permitir abstração
$instance = new $classname;
$instance->type = 'array';
$instance->buffer = $array;
return $instance;
} | php | public static function createFromArray(array $array) : Reader
{
$classname = \get_called_class(); // para permitir abstração
$instance = new $classname;
$instance->type = 'array';
$instance->buffer = $array;
return $instance;
} | [
"public",
"static",
"function",
"createFromArray",
"(",
"array",
"$",
"array",
")",
":",
"Reader",
"{",
"$",
"classname",
"=",
"\\",
"get_called_class",
"(",
")",
";",
"// para permitir abstração",
"$",
"instance",
"=",
"new",
"$",
"classname",
";",
"$",
"in... | Importa os dados a partir de um array
@param array $array
@return ReportCollection\Libs\Reader | [
"Importa",
"os",
"dados",
"a",
"partir",
"de",
"um",
"array"
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/Reader.php#L45-L53 |
225,746 | ricardopedias/report-collection | src/Libs/Reader.php | Reader.toArray | public function toArray() : array
{
if($this->data !== null) {
return $this->data;
}
if ($this->type == 'spreadsheet') {
$this->data = $this->parseDataFromSpreadsheet($this->buffer, $this->extension);
} else {
$this->data = $this->parseDataFromAr... | php | public function toArray() : array
{
if($this->data !== null) {
return $this->data;
}
if ($this->type == 'spreadsheet') {
$this->data = $this->parseDataFromSpreadsheet($this->buffer, $this->extension);
} else {
$this->data = $this->parseDataFromAr... | [
"public",
"function",
"toArray",
"(",
")",
":",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"data",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"data",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"type",
"==",
"'spreadsheet'",
")",
"{",
"$"... | Devolve os dados em forma de array.
@return array | [
"Devolve",
"os",
"dados",
"em",
"forma",
"de",
"array",
"."
] | 8536e2c48f83fa12b5cea20737d50da20945b71d | https://github.com/ricardopedias/report-collection/blob/8536e2c48f83fa12b5cea20737d50da20945b71d/src/Libs/Reader.php#L285-L299 |
225,747 | cmsgears/module-cart | common/models/resources/Cart.php | Cart.getCartTotal | public function getCartTotal( $precision = 2 ) {
$items = $this->activeItems;
$total = 0;
foreach( $items as $item ) {
if( $item->keep ) {
$total += $item->getTotalPrice();
}
}
return round( $total, $precision );
} | php | public function getCartTotal( $precision = 2 ) {
$items = $this->activeItems;
$total = 0;
foreach( $items as $item ) {
if( $item->keep ) {
$total += $item->getTotalPrice();
}
}
return round( $total, $precision );
} | [
"public",
"function",
"getCartTotal",
"(",
"$",
"precision",
"=",
"2",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"activeItems",
";",
"$",
"total",
"=",
"0",
";",
"foreach",
"(",
"$",
"items",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"it... | Returns the total value of cart.
@param integer $precision
@return float | [
"Returns",
"the",
"total",
"value",
"of",
"cart",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Cart.php#L238-L253 |
225,748 | cmsgears/module-cart | common/models/resources/Cart.php | Cart.getActiveCount | public function getActiveCount( $type = 'purchase' ) {
if( !in_array( $type, [ 'primary', 'purchase', 'quantity', 'weight', 'volume' ] ) ) {
return 0;
}
$cartItems = $this->activeItems;
$count = 0;
foreach ( $cartItems as $cartItem ) {
if( $cartItem->keep ) {
$count += $cartItem->$type;
}
... | php | public function getActiveCount( $type = 'purchase' ) {
if( !in_array( $type, [ 'primary', 'purchase', 'quantity', 'weight', 'volume' ] ) ) {
return 0;
}
$cartItems = $this->activeItems;
$count = 0;
foreach ( $cartItems as $cartItem ) {
if( $cartItem->keep ) {
$count += $cartItem->$type;
}
... | [
"public",
"function",
"getActiveCount",
"(",
"$",
"type",
"=",
"'purchase'",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"type",
",",
"[",
"'primary'",
",",
"'purchase'",
",",
"'quantity'",
",",
"'weight'",
",",
"'volume'",
"]",
")",
")",
"{",
"ret... | Returns the total items in cart.
It accepts $type having column name among primary, purchase, quantity, weight and volume.
@param string $type
@return float | [
"Returns",
"the",
"total",
"items",
"in",
"cart",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/Cart.php#L263-L282 |
225,749 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderContainer | public function renderContainer( $config = [] ) {
$containerView = CodeGenUtil::isAbsolutePath( $this->containerView, true ) ? $this->containerView : "$this->template/$this->containerView";
return $this->render( $containerView, [ 'widget' => $this ] );
} | php | public function renderContainer( $config = [] ) {
$containerView = CodeGenUtil::isAbsolutePath( $this->containerView, true ) ? $this->containerView : "$this->template/$this->containerView";
return $this->render( $containerView, [ 'widget' => $this ] );
} | [
"public",
"function",
"renderContainer",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"containerView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"containerView",
",",
"true",
")",
"?",
"$",
"this",
"->",
"containerView",
":",... | Generate and return the HTML of container.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"container",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L196-L201 |
225,750 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderDragger | public function renderDragger( $config = [] ) {
$draggerView = CodeGenUtil::isAbsolutePath( $this->draggerView, true ) ? $this->draggerView : "$this->template/$this->draggerView";
return $this->render( $draggerView, [ 'widget' => $this ] );
} | php | public function renderDragger( $config = [] ) {
$draggerView = CodeGenUtil::isAbsolutePath( $this->draggerView, true ) ? $this->draggerView : "$this->template/$this->draggerView";
return $this->render( $draggerView, [ 'widget' => $this ] );
} | [
"public",
"function",
"renderDragger",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"draggerView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"draggerView",
",",
"true",
")",
"?",
"$",
"this",
"->",
"draggerView",
":",
"\"$t... | Generate and return the HTML of file dragger having drag area.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"file",
"dragger",
"having",
"drag",
"area",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L209-L214 |
225,751 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderChooser | public function renderChooser( $config = [] ) {
$chooserView = CodeGenUtil::isAbsolutePath( $this->chooserView, true ) ? $this->chooserView : "$this->template/$this->chooserView";
return $this->render( $chooserView, [ 'widget' => $this ] );
} | php | public function renderChooser( $config = [] ) {
$chooserView = CodeGenUtil::isAbsolutePath( $this->chooserView, true ) ? $this->chooserView : "$this->template/$this->chooserView";
return $this->render( $chooserView, [ 'widget' => $this ] );
} | [
"public",
"function",
"renderChooser",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"chooserView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"chooserView",
",",
"true",
")",
"?",
"$",
"this",
"->",
"chooserView",
":",
"\"$t... | Generate and return the HTML of file chooser element.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"file",
"chooser",
"element",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L222-L227 |
225,752 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderPreloader | public function renderPreloader( $config = [] ) {
$preloaderView = CodeGenUtil::isAbsolutePath( $this->preloaderView, true ) ? $this->preloaderView : "$this->template/$this->preloaderView";
return $this->render( $preloaderView, [ 'widget' => $this ] );
} | php | public function renderPreloader( $config = [] ) {
$preloaderView = CodeGenUtil::isAbsolutePath( $this->preloaderView, true ) ? $this->preloaderView : "$this->template/$this->preloaderView";
return $this->render( $preloaderView, [ 'widget' => $this ] );
} | [
"public",
"function",
"renderPreloader",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"preloaderView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"preloaderView",
",",
"true",
")",
"?",
"$",
"this",
"->",
"preloaderView",
":",... | Generate and return the HTML of pre-loader used to show upload progress.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"pre",
"-",
"loader",
"used",
"to",
"show",
"upload",
"progress",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L235-L240 |
225,753 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderInfo | public function renderInfo( $config = [] ) {
$infoView = CodeGenUtil::isAbsolutePath( $this->infoView, true ) ? $this->infoView : "$this->template/$this->infoView";
return $this->render( $infoView, [ 'widget' => $this ] );
} | php | public function renderInfo( $config = [] ) {
$infoView = CodeGenUtil::isAbsolutePath( $this->infoView, true ) ? $this->infoView : "$this->template/$this->infoView";
return $this->render( $infoView, [ 'widget' => $this ] );
} | [
"public",
"function",
"renderInfo",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"infoView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"infoView",
",",
"true",
")",
"?",
"$",
"this",
"->",
"infoView",
":",
"\"$this->templat... | Generate and return the HTML of info having fields required to store file.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"info",
"having",
"fields",
"required",
"to",
"store",
"file",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L248-L253 |
225,754 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderFields | public function renderFields( $config = [] ) {
$fieldsView = CodeGenUtil::isAbsolutePath( $this->fieldsView, true ) ? $this->fieldsView : "$this->template/$this->fieldsView";
return $this->render( $fieldsView, [ 'widget' => $this ] );
} | php | public function renderFields( $config = [] ) {
$fieldsView = CodeGenUtil::isAbsolutePath( $this->fieldsView, true ) ? $this->fieldsView : "$this->template/$this->fieldsView";
return $this->render( $fieldsView, [ 'widget' => $this ] );
} | [
"public",
"function",
"renderFields",
"(",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"fieldsView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"fieldsView",
",",
"true",
")",
"?",
"$",
"this",
"->",
"fieldsView",
":",
"\"$this-... | Generate and return the HTML of fields. These fields will submit additional data required for file.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"fields",
".",
"These",
"fields",
"will",
"submit",
"additional",
"data",
"required",
"for",
"file",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L261-L266 |
225,755 | cmsgears/plugin-file-manager | widgets/FileUploader.php | FileUploader.renderForm | public function renderForm( $config = [], $html = [] ) {
$formView = CodeGenUtil::isAbsolutePath( $this->formView, true ) ? $this->formView : "$this->template/$this->formView";
return $this->render( $formView, [
'widget' => $this,
'infoHtml' => $html[ 'infoHtml' ],
'fieldsHtml' => $html[ 'fieldsHtml' ]
... | php | public function renderForm( $config = [], $html = [] ) {
$formView = CodeGenUtil::isAbsolutePath( $this->formView, true ) ? $this->formView : "$this->template/$this->formView";
return $this->render( $formView, [
'widget' => $this,
'infoHtml' => $html[ 'infoHtml' ],
'fieldsHtml' => $html[ 'fieldsHtml' ]
... | [
"public",
"function",
"renderForm",
"(",
"$",
"config",
"=",
"[",
"]",
",",
"$",
"html",
"=",
"[",
"]",
")",
"{",
"$",
"formView",
"=",
"CodeGenUtil",
"::",
"isAbsolutePath",
"(",
"$",
"this",
"->",
"formView",
",",
"true",
")",
"?",
"$",
"this",
"... | Generate and return the HTML of form to submit the uploaded file.
@param array $config
@return string | [
"Generate",
"and",
"return",
"the",
"HTML",
"of",
"form",
"to",
"submit",
"the",
"uploaded",
"file",
"."
] | aad2a109b4c6126efabcadfb38762cd240a60bc5 | https://github.com/cmsgears/plugin-file-manager/blob/aad2a109b4c6126efabcadfb38762cd240a60bc5/widgets/FileUploader.php#L274-L283 |
225,756 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/FixtureContext.php | FixtureContext.stepThereAreTheFollowingRecords | public function stepThereAreTheFollowingRecords($dataObject, PyStringNode $string) {
$yaml = array_merge(array($dataObject . ':'), $string->getLines());
$yaml = implode("\n ", $yaml);
// Save fixtures into database
// TODO Run prepareAsset() for each File and Folder record
$yamlFixture = new \YamlFixture($y... | php | public function stepThereAreTheFollowingRecords($dataObject, PyStringNode $string) {
$yaml = array_merge(array($dataObject . ':'), $string->getLines());
$yaml = implode("\n ", $yaml);
// Save fixtures into database
// TODO Run prepareAsset() for each File and Folder record
$yamlFixture = new \YamlFixture($y... | [
"public",
"function",
"stepThereAreTheFollowingRecords",
"(",
"$",
"dataObject",
",",
"PyStringNode",
"$",
"string",
")",
"{",
"$",
"yaml",
"=",
"array_merge",
"(",
"array",
"(",
"$",
"dataObject",
".",
"':'",
")",
",",
"$",
"string",
"->",
"getLines",
"(",
... | Accepts YAML fixture definitions similar to the ones used in SilverStripe unit testing.
Example: Given there are the following member records:
member1:
Email: member1@test.com
member2:
Email: member2@test.com
@Given /^there are the following ([^\s]*) records$/ | [
"Accepts",
"YAML",
"fixture",
"definitions",
"similar",
"to",
"the",
"ones",
"used",
"in",
"SilverStripe",
"unit",
"testing",
"."
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/FixtureContext.php#L368-L376 |
225,757 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/FixtureContext.php | FixtureContext.prepareFixture | protected function prepareFixture($class, $identifier, $data = array()) {
if($class == 'File' || is_subclass_of($class, 'File')) {
$data = $this->prepareAsset($class, $identifier, $data);
}
return $data;
} | php | protected function prepareFixture($class, $identifier, $data = array()) {
if($class == 'File' || is_subclass_of($class, 'File')) {
$data = $this->prepareAsset($class, $identifier, $data);
}
return $data;
} | [
"protected",
"function",
"prepareFixture",
"(",
"$",
"class",
",",
"$",
"identifier",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"class",
"==",
"'File'",
"||",
"is_subclass_of",
"(",
"$",
"class",
",",
"'File'",
")",
")",
"{"... | Prepares a fixture for use
@param string $class
@param string $identifier
@param array $data
@return array Prepared $data with additional injected fields | [
"Prepares",
"a",
"fixture",
"for",
"use"
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/FixtureContext.php#L541-L546 |
225,758 | edineibauer/helpers | public/src/Helpers/Date.php | Date.checkWhichPart | private function checkWhichPart(int $dado, int $position)
{
if ($dado > 12) {
$current = $this->setDateInfo('dia', 'ano');
if ($current) {
$this->data[$current] = $dado;
$this->position[$current] = $position;
}
} else {
... | php | private function checkWhichPart(int $dado, int $position)
{
if ($dado > 12) {
$current = $this->setDateInfo('dia', 'ano');
if ($current) {
$this->data[$current] = $dado;
$this->position[$current] = $position;
}
} else {
... | [
"private",
"function",
"checkWhichPart",
"(",
"int",
"$",
"dado",
",",
"int",
"$",
"position",
")",
"{",
"if",
"(",
"$",
"dado",
">",
"12",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"setDateInfo",
"(",
"'dia'",
",",
"'ano'",
")",
";",
"if",... | filtra para determinar onde aplicar este valor inteiro.
@param int $position
@param int $dado | [
"filtra",
"para",
"determinar",
"onde",
"aplicar",
"este",
"valor",
"inteiro",
"."
] | 3ed14fec3a8f2f282107f79f6bd1ca11e6882300 | https://github.com/edineibauer/helpers/blob/3ed14fec3a8f2f282107f79f6bd1ca11e6882300/public/src/Helpers/Date.php#L115-L130 |
225,759 | nails/module-event | src/Service/Event.php | Event.addType | public function addType($mSlug, $sLabel = '', $sDescription = '', $aHooks = [])
{
if (empty($mSlug)) {
return false;
}
if (is_string($mSlug)) {
$this->aEventTypes[$mSlug] = new \stdClass();
$this->aEventTypes[$mSlug]->slug = $mSlug;
... | php | public function addType($mSlug, $sLabel = '', $sDescription = '', $aHooks = [])
{
if (empty($mSlug)) {
return false;
}
if (is_string($mSlug)) {
$this->aEventTypes[$mSlug] = new \stdClass();
$this->aEventTypes[$mSlug]->slug = $mSlug;
... | [
"public",
"function",
"addType",
"(",
"$",
"mSlug",
",",
"$",
"sLabel",
"=",
"''",
",",
"$",
"sDescription",
"=",
"''",
",",
"$",
"aHooks",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"mSlug",
")",
")",
"{",
"return",
"false",
";",
"... | Adds a new event type to the stack
@param mixed $mSlug The event's slug; calling code refers to events
by this value. Alternatively pass a stdClass to set all values.
@param string $sLabel The human friendly name to give the event
@param string $sDescription The human friendly description of the event... | [
"Adds",
"a",
"new",
"event",
"type",
"to",
"the",
"stack"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L94-L122 |
225,760 | nails/module-event | src/Service/Event.php | Event.destroy | public function destroy($iId)
{
if (empty($iId)) {
$this->setError('Event ID not defined.');
return false;
}
// -------------------------------------------------------------------------
// Perform delete
$oDb = Factory::service('Database');
... | php | public function destroy($iId)
{
if (empty($iId)) {
$this->setError('Event ID not defined.');
return false;
}
// -------------------------------------------------------------------------
// Perform delete
$oDb = Factory::service('Database');
... | [
"public",
"function",
"destroy",
"(",
"$",
"iId",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"iId",
")",
")",
"{",
"$",
"this",
"->",
"setError",
"(",
"'Event ID not defined.'",
")",
";",
"return",
"false",
";",
"}",
"// ----------------------------------------... | Destroys an event object
@param integer $iId The event ID
@return boolean | [
"Destroys",
"an",
"event",
"object"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L264-L284 |
225,761 | nails/module-event | src/Service/Event.php | Event.getAllRawQuery | public function getAllRawQuery($iPage = null, $iPerPage = null, $aData = [])
{
// Fetch all objects from the table
$oDb = Factory::service('Database');
$oDb->select($this->sTableAlias . '.*');
$oDb->select('ue.email,u.first_name,u.last_name,u.profile_img,u.gender');
// App... | php | public function getAllRawQuery($iPage = null, $iPerPage = null, $aData = [])
{
// Fetch all objects from the table
$oDb = Factory::service('Database');
$oDb->select($this->sTableAlias . '.*');
$oDb->select('ue.email,u.first_name,u.last_name,u.profile_img,u.gender');
// App... | [
"public",
"function",
"getAllRawQuery",
"(",
"$",
"iPage",
"=",
"null",
",",
"$",
"iPerPage",
"=",
"null",
",",
"$",
"aData",
"=",
"[",
"]",
")",
"{",
"// Fetch all objects from the table",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
"... | Returns all event objects.
@param integer $iPage The page of objects to return
@param integer $iPerPage The number of objects per page
@param array $aData Any data to pass to getCountCommon
@return object | [
"Returns",
"all",
"event",
"objects",
"."
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L297-L328 |
225,762 | nails/module-event | src/Service/Event.php | Event.countAll | public function countAll($aData)
{
$this->getCountCommonEvent($aData);
$oDb = Factory::service('Database');
return $oDb->count_all_results($this->sTable . ' ' . $this->sTableAlias);
} | php | public function countAll($aData)
{
$this->getCountCommonEvent($aData);
$oDb = Factory::service('Database');
return $oDb->count_all_results($this->sTable . ' ' . $this->sTableAlias);
} | [
"public",
"function",
"countAll",
"(",
"$",
"aData",
")",
"{",
"$",
"this",
"->",
"getCountCommonEvent",
"(",
"$",
"aData",
")",
";",
"$",
"oDb",
"=",
"Factory",
"::",
"service",
"(",
"'Database'",
")",
";",
"return",
"$",
"oDb",
"->",
"count_all_results... | Count the total number of events for a certain query
@param $aData
@return int | [
"Count",
"the",
"total",
"number",
"of",
"events",
"for",
"a",
"certain",
"query"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L400-L405 |
225,763 | nails/module-event | src/Service/Event.php | Event.getById | public function getById($iId)
{
$aEvents = $this->getAll([
'where' => [
[$this->sTableAlias . '.id', $iId],
],
]);
if (!$aEvents) {
return false;
}
return $aEvents[0];
} | php | public function getById($iId)
{
$aEvents = $this->getAll([
'where' => [
[$this->sTableAlias . '.id', $iId],
],
]);
if (!$aEvents) {
return false;
}
return $aEvents[0];
} | [
"public",
"function",
"getById",
"(",
"$",
"iId",
")",
"{",
"$",
"aEvents",
"=",
"$",
"this",
"->",
"getAll",
"(",
"[",
"'where'",
"=>",
"[",
"[",
"$",
"this",
"->",
"sTableAlias",
".",
"'.id'",
",",
"$",
"iId",
"]",
",",
"]",
",",
"]",
")",
";... | Return an individual event
@param integer $iId The event's ID
@return mixed stdClass on success, false on failure | [
"Return",
"an",
"individual",
"event"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L416-L429 |
225,764 | nails/module-event | src/Service/Event.php | Event.getByType | public function getByType($sType)
{
$aEvents = $this->getAll([
'where' => [
[$this->sTableAlias . '.type', $sType],
],
]);
if (!$aEvents) {
return false;
}
return $aEvents[0];
} | php | public function getByType($sType)
{
$aEvents = $this->getAll([
'where' => [
[$this->sTableAlias . '.type', $sType],
],
]);
if (!$aEvents) {
return false;
}
return $aEvents[0];
} | [
"public",
"function",
"getByType",
"(",
"$",
"sType",
")",
"{",
"$",
"aEvents",
"=",
"$",
"this",
"->",
"getAll",
"(",
"[",
"'where'",
"=>",
"[",
"[",
"$",
"this",
"->",
"sTableAlias",
".",
"'.type'",
",",
"$",
"sType",
"]",
",",
"]",
",",
"]",
"... | Returns events of a particular type
@param string $sType The type of event to return
@return boolean|array | [
"Returns",
"events",
"of",
"a",
"particular",
"type"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L440-L453 |
225,765 | nails/module-event | src/Service/Event.php | Event.getByUser | public function getByUser($iUserId)
{
$aEvents = $this->getAll([
'where' => [
[$this->sTableAlias . '.created_by', $iUserId],
],
]);
if (!$aEvents) {
return false;
}
return $aEvents[0];
} | php | public function getByUser($iUserId)
{
$aEvents = $this->getAll([
'where' => [
[$this->sTableAlias . '.created_by', $iUserId],
],
]);
if (!$aEvents) {
return false;
}
return $aEvents[0];
} | [
"public",
"function",
"getByUser",
"(",
"$",
"iUserId",
")",
"{",
"$",
"aEvents",
"=",
"$",
"this",
"->",
"getAll",
"(",
"[",
"'where'",
"=>",
"[",
"[",
"$",
"this",
"->",
"sTableAlias",
".",
"'.created_by'",
",",
"$",
"iUserId",
"]",
",",
"]",
",",
... | Returns events created by a user
@param integer $iUserId The ID of the user
@return boolean|array | [
"Returns",
"events",
"created",
"by",
"a",
"user"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L464-L477 |
225,766 | nails/module-event | src/Service/Event.php | Event.getTypeBySlug | public function getTypeBySlug($sSlug)
{
return isset($this->aEventTypes[$sSlug]) ? $this->aEventTypes[$sSlug] : false;
} | php | public function getTypeBySlug($sSlug)
{
return isset($this->aEventTypes[$sSlug]) ? $this->aEventTypes[$sSlug] : false;
} | [
"public",
"function",
"getTypeBySlug",
"(",
"$",
"sSlug",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"aEventTypes",
"[",
"$",
"sSlug",
"]",
")",
"?",
"$",
"this",
"->",
"aEventTypes",
"[",
"$",
"sSlug",
"]",
":",
"false",
";",
"}"
] | Get an individual type of event
@param string $sSlug The event's slug
@return mixed stdClass on success, false on failure | [
"Get",
"an",
"individual",
"type",
"of",
"event"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L499-L502 |
225,767 | nails/module-event | src/Service/Event.php | Event.getAllTypesFlat | public function getAllTypesFlat()
{
$aTypes = $this->getAllTypes();
$aOut = [];
foreach ($aTypes as $oType) {
$aOut[$oType->slug] = $oType->label ? $oType->label : title_case(str_replace('_', ' ', $oType->slug));
}
return $aOut;
} | php | public function getAllTypesFlat()
{
$aTypes = $this->getAllTypes();
$aOut = [];
foreach ($aTypes as $oType) {
$aOut[$oType->slug] = $oType->label ? $oType->label : title_case(str_replace('_', ' ', $oType->slug));
}
return $aOut;
} | [
"public",
"function",
"getAllTypesFlat",
"(",
")",
"{",
"$",
"aTypes",
"=",
"$",
"this",
"->",
"getAllTypes",
"(",
")",
";",
"$",
"aOut",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"aTypes",
"as",
"$",
"oType",
")",
"{",
"$",
"aOut",
"[",
"$",
"oTy... | Get the differing types of event as a flat array
@return array | [
"Get",
"the",
"differing",
"types",
"of",
"event",
"as",
"a",
"flat",
"array"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L510-L520 |
225,768 | nails/module-event | src/Service/Event.php | Event.formatObject | protected function formatObject(&$oObj)
{
// Ints
$oObj->ref = $oObj->ref ? (int) $oObj->ref : null;
// Type
$temp = $this->getTypeBySlug($oObj->type);
if (empty($temp)) {
$temp = new \stdClass();
$temp->slug = $oObj->type;
... | php | protected function formatObject(&$oObj)
{
// Ints
$oObj->ref = $oObj->ref ? (int) $oObj->ref : null;
// Type
$temp = $this->getTypeBySlug($oObj->type);
if (empty($temp)) {
$temp = new \stdClass();
$temp->slug = $oObj->type;
... | [
"protected",
"function",
"formatObject",
"(",
"&",
"$",
"oObj",
")",
"{",
"// Ints",
"$",
"oObj",
"->",
"ref",
"=",
"$",
"oObj",
"->",
"ref",
"?",
"(",
"int",
")",
"$",
"oObj",
"->",
"ref",
":",
"null",
";",
"// Type",
"$",
"temp",
"=",
"$",
"t... | Formats an event object
@param \stdClass $oObj The event object to format
@return void | [
"Formats",
"an",
"event",
"object"
] | 6e5f7ff3decb722a0b182bf72b1db462a5030285 | https://github.com/nails/module-event/blob/6e5f7ff3decb722a0b182bf72b1db462a5030285/src/Service/Event.php#L531-L568 |
225,769 | Innmind/Filesystem | src/MediaType/MediaType.php | MediaType.topLevels | public static function topLevels(): SetInterface
{
if (self::$topLevels === null) {
self::$topLevels = (new Set('string'))
->add('application')
->add('audio')
->add('font')
->add('example')
->add('image')
... | php | public static function topLevels(): SetInterface
{
if (self::$topLevels === null) {
self::$topLevels = (new Set('string'))
->add('application')
->add('audio')
->add('font')
->add('example')
->add('image')
... | [
"public",
"static",
"function",
"topLevels",
"(",
")",
":",
"SetInterface",
"{",
"if",
"(",
"self",
"::",
"$",
"topLevels",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"topLevels",
"=",
"(",
"new",
"Set",
"(",
"'string'",
")",
")",
"->",
"add",
"(",
... | List of allowed top levels
@return SetInterface<string> | [
"List",
"of",
"allowed",
"top",
"levels"
] | 21700d8424bc88e99fd5c612c5316613e4c45a3b | https://github.com/Innmind/Filesystem/blob/21700d8424bc88e99fd5c612c5316613e4c45a3b/src/MediaType/MediaType.php#L96-L113 |
225,770 | Innmind/Filesystem | src/MediaType/MediaType.php | MediaType.fromString | public static function fromString(string $string): self
{
$string = new Str($string);
$pattern = sprintf(
'~%s/[\w\-.]+(\+\w+)?([;,] [\w\-.]+=[\w\-.]+)?~',
self::topLevels()->join('|')
);
if (!$string->matches($pattern)) {
throw new InvalidMediaTy... | php | public static function fromString(string $string): self
{
$string = new Str($string);
$pattern = sprintf(
'~%s/[\w\-.]+(\+\w+)?([;,] [\w\-.]+=[\w\-.]+)?~',
self::topLevels()->join('|')
);
if (!$string->matches($pattern)) {
throw new InvalidMediaTy... | [
"public",
"static",
"function",
"fromString",
"(",
"string",
"$",
"string",
")",
":",
"self",
"{",
"$",
"string",
"=",
"new",
"Str",
"(",
"$",
"string",
")",
";",
"$",
"pattern",
"=",
"sprintf",
"(",
"'~%s/[\\w\\-.]+(\\+\\w+)?([;,] [\\w\\-.]+=[\\w\\-.]+)?~'",
... | Build an object out of a string
@param string $string
@return self | [
"Build",
"an",
"object",
"out",
"of",
"a",
"string"
] | 21700d8424bc88e99fd5c612c5316613e4c45a3b | https://github.com/Innmind/Filesystem/blob/21700d8424bc88e99fd5c612c5316613e4c45a3b/src/MediaType/MediaType.php#L122-L169 |
225,771 | svilborg/guzzle-encoding-com | src/Gencoding/Guzzle/Encoding/Notifications.php | Notifications.parse | public function parse()
{
$notification = (isset($_POST) && isset($_POST["xml"])) ? $_POST["xml"] : null;
if (! $notification) {
throw new \Exception('Notification error', 5000);
}
return new \SimpleXMLElement($notification);
} | php | public function parse()
{
$notification = (isset($_POST) && isset($_POST["xml"])) ? $_POST["xml"] : null;
if (! $notification) {
throw new \Exception('Notification error', 5000);
}
return new \SimpleXMLElement($notification);
} | [
"public",
"function",
"parse",
"(",
")",
"{",
"$",
"notification",
"=",
"(",
"isset",
"(",
"$",
"_POST",
")",
"&&",
"isset",
"(",
"$",
"_POST",
"[",
"\"xml\"",
"]",
")",
")",
"?",
"$",
"_POST",
"[",
"\"xml\"",
"]",
":",
"null",
";",
"if",
"(",
... | Parse the notifications
@throws \Exception
@return SimpleXMLElement | [
"Parse",
"the",
"notifications"
] | 0f42505e85013d1753502c0f3d0aa8955fb24cce | https://github.com/svilborg/guzzle-encoding-com/blob/0f42505e85013d1753502c0f3d0aa8955fb24cce/src/Gencoding/Guzzle/Encoding/Notifications.php#L16-L24 |
225,772 | Eve-PHP/Framework | src/Cli/Index.php | Index.input | public static function input($question, $default = null)
{
echo $question.': ';
$handle = fopen ('php://stdin', 'r');
$answer = fgets($handle);
fclose($handle);
$answer = trim($answer);
if(!$answer) {
$answer = $default;
}
return $answe... | php | public static function input($question, $default = null)
{
echo $question.': ';
$handle = fopen ('php://stdin', 'r');
$answer = fgets($handle);
fclose($handle);
$answer = trim($answer);
if(!$answer) {
$answer = $default;
}
return $answe... | [
"public",
"static",
"function",
"input",
"(",
"$",
"question",
",",
"$",
"default",
"=",
"null",
")",
"{",
"echo",
"$",
"question",
".",
"': '",
";",
"$",
"handle",
"=",
"fopen",
"(",
"'php://stdin'",
",",
"'r'",
")",
";",
"$",
"answer",
"=",
"fgets"... | Queries the user for an
input and returns the results
@param string $question The text question
@param string|null $default The default answer
@return string | [
"Queries",
"the",
"user",
"for",
"an",
"input",
"and",
"returns",
"the",
"results"
] | cd4ca9472c6c46034bde402bf20bf2f86657c608 | https://github.com/Eve-PHP/Framework/blob/cd4ca9472c6c46034bde402bf20bf2f86657c608/src/Cli/Index.php#L147-L162 |
225,773 | DrNixx/yii2-onix | src/assets/BaseAssetBundle.php | BaseAssetBundle.addLanguage | public function addLanguage($lang = '', $prefix = '', $dir = null, $min = false)
{
if (empty($lang) || substr($lang, 0, 2) == 'en') {
return $this;
}
$ext = $min ? (YII_DEBUG ? ".min.js" : ".js") : ".js";
$file = "{$prefix}{$lang}{$ext}";
if ($dir === null) {
... | php | public function addLanguage($lang = '', $prefix = '', $dir = null, $min = false)
{
if (empty($lang) || substr($lang, 0, 2) == 'en') {
return $this;
}
$ext = $min ? (YII_DEBUG ? ".min.js" : ".js") : ".js";
$file = "{$prefix}{$lang}{$ext}";
if ($dir === null) {
... | [
"public",
"function",
"addLanguage",
"(",
"$",
"lang",
"=",
"''",
",",
"$",
"prefix",
"=",
"''",
",",
"$",
"dir",
"=",
"null",
",",
"$",
"min",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"lang",
")",
"||",
"substr",
"(",
"$",
"lang",... | Adds a language JS locale file
@param string $lang the ISO language code
@param string $prefix the language locale file name prefix
@param string $dir the language file directory relative to source path
@param bool $min whether to auto use minified version
@return AssetBundle instance | [
"Adds",
"a",
"language",
"JS",
"locale",
"file"
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/assets/BaseAssetBundle.php#L75-L100 |
225,774 | nails/module-barcode | src/Service/Generator.php | Generator.save | public function save($sString, $sPath, $iWidth = null, $iHeight = null)
{
$rImg = $this->generateBarcode($sString, $iWidth, $iHeight);
if ($rImg) {
imagepng($rImg, $sPath);
imagedestroy($rImg);
return true;
} else {
return false;
}... | php | public function save($sString, $sPath, $iWidth = null, $iHeight = null)
{
$rImg = $this->generateBarcode($sString, $iWidth, $iHeight);
if ($rImg) {
imagepng($rImg, $sPath);
imagedestroy($rImg);
return true;
} else {
return false;
}... | [
"public",
"function",
"save",
"(",
"$",
"sString",
",",
"$",
"sPath",
",",
"$",
"iWidth",
"=",
"null",
",",
"$",
"iHeight",
"=",
"null",
")",
"{",
"$",
"rImg",
"=",
"$",
"this",
"->",
"generateBarcode",
"(",
"$",
"sString",
",",
"$",
"iWidth",
",",... | Saves a barcode to disk
@param string $sString The string to encode
@param string $sPath Where to save the image
@param integer $iWidth The width of the image
@param integer $iHeight The height of the image
@return boolean | [
"Saves",
"a",
"barcode",
"to",
"disk"
] | c8c9dbb5b458edc5d58d80c1350819a66036cfdb | https://github.com/nails/module-barcode/blob/c8c9dbb5b458edc5d58d80c1350819a66036cfdb/src/Service/Generator.php#L179-L194 |
225,775 | nails/module-barcode | src/Service/Generator.php | Generator.show | public function show($sString, $iWidth = null, $iHeight = null)
{
$rImg = $this->generateBarcode($sString, $iWidth, $iHeight);
if ($rImg) {
header('Content-Type: image/png');
imagepng($rImg);
imagedestroy($rImg);
exit(0);
} else {
... | php | public function show($sString, $iWidth = null, $iHeight = null)
{
$rImg = $this->generateBarcode($sString, $iWidth, $iHeight);
if ($rImg) {
header('Content-Type: image/png');
imagepng($rImg);
imagedestroy($rImg);
exit(0);
} else {
... | [
"public",
"function",
"show",
"(",
"$",
"sString",
",",
"$",
"iWidth",
"=",
"null",
",",
"$",
"iHeight",
"=",
"null",
")",
"{",
"$",
"rImg",
"=",
"$",
"this",
"->",
"generateBarcode",
"(",
"$",
"sString",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
")... | Sends a barcode to the browser as an image
@param string $sString The string to encode
@param integer $iWidth The width of the image
@param integer $iHeight The height of the image
@return void | [
"Sends",
"a",
"barcode",
"to",
"the",
"browser",
"as",
"an",
"image"
] | c8c9dbb5b458edc5d58d80c1350819a66036cfdb | https://github.com/nails/module-barcode/blob/c8c9dbb5b458edc5d58d80c1350819a66036cfdb/src/Service/Generator.php#L205-L220 |
225,776 | nails/module-barcode | src/Service/Generator.php | Generator.base64 | public function base64($sString, $iWidth = null, $iHeight = null)
{
$rImg = $this->generateBarcode($sString, $iWidth, $iHeight);
if ($rImg) {
ob_start();
imagepng($rImg);
$sContents = ob_get_contents();
ob_end_clean();
return base64_enco... | php | public function base64($sString, $iWidth = null, $iHeight = null)
{
$rImg = $this->generateBarcode($sString, $iWidth, $iHeight);
if ($rImg) {
ob_start();
imagepng($rImg);
$sContents = ob_get_contents();
ob_end_clean();
return base64_enco... | [
"public",
"function",
"base64",
"(",
"$",
"sString",
",",
"$",
"iWidth",
"=",
"null",
",",
"$",
"iHeight",
"=",
"null",
")",
"{",
"$",
"rImg",
"=",
"$",
"this",
"->",
"generateBarcode",
"(",
"$",
"sString",
",",
"$",
"iWidth",
",",
"$",
"iHeight",
... | Returns the encoded image as a base64 string
@param string $sString The string to encode
@param integer $iWidth The width of the image
@param integer $iHeight The height of the image
@return string | [
"Returns",
"the",
"encoded",
"image",
"as",
"a",
"base64",
"string"
] | c8c9dbb5b458edc5d58d80c1350819a66036cfdb | https://github.com/nails/module-barcode/blob/c8c9dbb5b458edc5d58d80c1350819a66036cfdb/src/Service/Generator.php#L231-L248 |
225,777 | cmsgears/module-cart | common/services/resources/CartService.php | CartService.getByUserId | public function getByUserId( $userId ) {
$modelClass = self::$modelClass;
$cart = $modelClass::findByParentIdParentType( $userId, CoreGlobal::TYPE_USER );
if( !isset( $cart ) ) {
$cart = $this->createByUserId( $userId );
}
return $cart;
} | php | public function getByUserId( $userId ) {
$modelClass = self::$modelClass;
$cart = $modelClass::findByParentIdParentType( $userId, CoreGlobal::TYPE_USER );
if( !isset( $cart ) ) {
$cart = $this->createByUserId( $userId );
}
return $cart;
} | [
"public",
"function",
"getByUserId",
"(",
"$",
"userId",
")",
"{",
"$",
"modelClass",
"=",
"self",
"::",
"$",
"modelClass",
";",
"$",
"cart",
"=",
"$",
"modelClass",
"::",
"findByParentIdParentType",
"(",
"$",
"userId",
",",
"CoreGlobal",
"::",
"TYPE_USER",
... | Find cart if exist for the given user. If does not exist create, it. | [
"Find",
"cart",
"if",
"exist",
"for",
"the",
"given",
"user",
".",
"If",
"does",
"not",
"exist",
"create",
"it",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/services/resources/CartService.php#L119-L131 |
225,778 | php-toolkit/sys-utils | src/ProcessUtil.php | ProcessUtil.getPidByFile | public static function getPidByFile(string $file, bool $checkLive = false): int
{
if ($file && \file_exists($file)) {
$pid = (int)\file_get_contents($file);
// check live
if ($checkLive && self::isRunning($pid)) {
return $pid;
}
\... | php | public static function getPidByFile(string $file, bool $checkLive = false): int
{
if ($file && \file_exists($file)) {
$pid = (int)\file_get_contents($file);
// check live
if ($checkLive && self::isRunning($pid)) {
return $pid;
}
\... | [
"public",
"static",
"function",
"getPidByFile",
"(",
"string",
"$",
"file",
",",
"bool",
"$",
"checkLive",
"=",
"false",
")",
":",
"int",
"{",
"if",
"(",
"$",
"file",
"&&",
"\\",
"file_exists",
"(",
"$",
"file",
")",
")",
"{",
"$",
"pid",
"=",
"(",... | get PID by pid File
@param string $file
@param bool $checkLive
@return int | [
"get",
"PID",
"by",
"pid",
"File"
] | cf6ca81efed472ca4457e6f4325fe00398d2d0ca | https://github.com/php-toolkit/sys-utils/blob/cf6ca81efed472ca4457e6f4325fe00398d2d0ca/src/ProcessUtil.php#L473-L487 |
225,779 | php-toolkit/sys-utils | src/ProcessUtil.php | ProcessUtil.run | public static function run(string $command, string $cwd = null): array
{
return Sys::run($command, $cwd);
} | php | public static function run(string $command, string $cwd = null): array
{
return Sys::run($command, $cwd);
} | [
"public",
"static",
"function",
"run",
"(",
"string",
"$",
"command",
",",
"string",
"$",
"cwd",
"=",
"null",
")",
":",
"array",
"{",
"return",
"Sys",
"::",
"run",
"(",
"$",
"command",
",",
"$",
"cwd",
")",
";",
"}"
] | run a command. it is support windows
@param string $command
@param string|null $cwd
@return array
@throws \RuntimeException
@deprecated Please use Sys::run() | [
"run",
"a",
"command",
".",
"it",
"is",
"support",
"windows"
] | cf6ca81efed472ca4457e6f4325fe00398d2d0ca | https://github.com/php-toolkit/sys-utils/blob/cf6ca81efed472ca4457e6f4325fe00398d2d0ca/src/ProcessUtil.php#L539-L542 |
225,780 | php-toolkit/sys-utils | src/ProcessUtil.php | ProcessUtil.setTitle | public static function setTitle(string $title): bool
{
if (!$title || 'Darwin' === \PHP_OS) {
return false;
}
if (\function_exists('cli_set_process_title')) {
\cli_set_process_title($title);
} elseif (\function_exists('setproctitle')) {
\setprocti... | php | public static function setTitle(string $title): bool
{
if (!$title || 'Darwin' === \PHP_OS) {
return false;
}
if (\function_exists('cli_set_process_title')) {
\cli_set_process_title($title);
} elseif (\function_exists('setproctitle')) {
\setprocti... | [
"public",
"static",
"function",
"setTitle",
"(",
"string",
"$",
"title",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"$",
"title",
"||",
"'Darwin'",
"===",
"\\",
"PHP_OS",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"\\",
"function_exists",
"(",
"'c... | Set process title.
@param string $title
@return bool | [
"Set",
"process",
"title",
"."
] | cf6ca81efed472ca4457e6f4325fe00398d2d0ca | https://github.com/php-toolkit/sys-utils/blob/cf6ca81efed472ca4457e6f4325fe00398d2d0ca/src/ProcessUtil.php#L559-L576 |
225,781 | SetBased/php-abc-form | src/Control/CheckboxesControl.php | CheckboxesControl.getSetValuesBase | public function getSetValuesBase(array &$values): void
{
if ($this->name==='')
{
$tmp = &$values;
}
else
{
$values[$this->name] = [];
$tmp = &$values[$this->name];
}
foreach ($this->options as $i => $option)
{
// Get the (database) ID of the opt... | php | public function getSetValuesBase(array &$values): void
{
if ($this->name==='')
{
$tmp = &$values;
}
else
{
$values[$this->name] = [];
$tmp = &$values[$this->name];
}
foreach ($this->options as $i => $option)
{
// Get the (database) ID of the opt... | [
"public",
"function",
"getSetValuesBase",
"(",
"array",
"&",
"$",
"values",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"name",
"===",
"''",
")",
"{",
"$",
"tmp",
"=",
"&",
"$",
"values",
";",
"}",
"else",
"{",
"$",
"values",
"[",
"$",
... | Adds the value of checked checkboxes the values with the name of this form control as key.
@param array $values The values. | [
"Adds",
"the",
"value",
"of",
"checked",
"checkboxes",
"the",
"values",
"with",
"the",
"name",
"of",
"this",
"form",
"control",
"as",
"key",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/CheckboxesControl.php#L158-L178 |
225,782 | SetBased/php-abc-form | src/Control/CheckboxesControl.php | CheckboxesControl.inputAttributes | private function inputAttributes(array $option): array
{
$attributes = [];
if (is_array($this->inputAttributesMap))
{
foreach ($this->inputAttributesMap as $key => $name)
{
if (isset($option[$key])) $attributes[$name] = $option[$key];
}
}
$attributes['type'] = 'checkbox... | php | private function inputAttributes(array $option): array
{
$attributes = [];
if (is_array($this->inputAttributesMap))
{
foreach ($this->inputAttributesMap as $key => $name)
{
if (isset($option[$key])) $attributes[$name] = $option[$key];
}
}
$attributes['type'] = 'checkbox... | [
"private",
"function",
"inputAttributes",
"(",
"array",
"$",
"option",
")",
":",
"array",
"{",
"$",
"attributes",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"inputAttributesMap",
")",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",... | Returns the attributes for the input element.
@param array $option The option.
@return array | [
"Returns",
"the",
"attributes",
"for",
"the",
"input",
"element",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/CheckboxesControl.php#L464-L481 |
225,783 | kaystrobach/FLOW.Custom | Classes/Aspects/AroundControllerAspect.php | AroundControllerAspect.output | public function output(\Neos\Flow\Aop\JoinPointInterface $joinPoint) {
/** @var ActionController $controller */
$controller = $joinPoint->getProxy();
$view = ObjectAccess::getProperty($controller, 'view', true);
/** @var \Neos\Flow\Http\Response $response */
$response = $contro... | php | public function output(\Neos\Flow\Aop\JoinPointInterface $joinPoint) {
/** @var ActionController $controller */
$controller = $joinPoint->getProxy();
$view = ObjectAccess::getProperty($controller, 'view', true);
/** @var \Neos\Flow\Http\Response $response */
$response = $contro... | [
"public",
"function",
"output",
"(",
"\\",
"Neos",
"\\",
"Flow",
"\\",
"Aop",
"\\",
"JoinPointInterface",
"$",
"joinPoint",
")",
"{",
"/** @var ActionController $controller */",
"$",
"controller",
"=",
"$",
"joinPoint",
"->",
"getProxy",
"(",
")",
";",
"$",
"v... | Directly outputs all the data instead of storing it in the buffer
@Flow\Around("method(Neos\Flow\Mvc\Controller\AbstractController->redirectToUri())")
@throws \Neos\Flow\Mvc\Exception\StopActionException
@throws \Neos\Utility\Exception\PropertyNotAccessibleException
@param \Neos\Flow\Aop\JoinPointInterface $joinPoi... | [
"Directly",
"outputs",
"all",
"the",
"data",
"instead",
"of",
"storing",
"it",
"in",
"the",
"buffer"
] | 873001a46fa0dfbc426edd74af1841cfa7bcf1b9 | https://github.com/kaystrobach/FLOW.Custom/blob/873001a46fa0dfbc426edd74af1841cfa7bcf1b9/Classes/Aspects/AroundControllerAspect.php#L29-L45 |
225,784 | DaveRandom/Enum | src/Enum.php | Enum.getClassConstants | private static function getClassConstants(string $className): array
{
return self::$constantCache[$className]
?? self::$constantCache[$className] = (new \ReflectionClass($className))->getConstants();
} | php | private static function getClassConstants(string $className): array
{
return self::$constantCache[$className]
?? self::$constantCache[$className] = (new \ReflectionClass($className))->getConstants();
} | [
"private",
"static",
"function",
"getClassConstants",
"(",
"string",
"$",
"className",
")",
":",
"array",
"{",
"return",
"self",
"::",
"$",
"constantCache",
"[",
"$",
"className",
"]",
"??",
"self",
"::",
"$",
"constantCache",
"[",
"$",
"className",
"]",
"... | Get a map of member names to values for the specified class name
@param string $className
@return array | [
"Get",
"a",
"map",
"of",
"member",
"names",
"to",
"values",
"for",
"the",
"specified",
"class",
"name"
] | 52c0388a234eb679f4c9be374ea76bd41763b114 | https://github.com/DaveRandom/Enum/blob/52c0388a234eb679f4c9be374ea76bd41763b114/src/Enum.php#L15-L19 |
225,785 | DaveRandom/Enum | src/Enum.php | Enum.parseValue | final public static function parseValue($searchValue, bool $looseComparison = false): string
{
if (false !== $name = \array_search($searchValue, self::getClassConstants(static::class), !$looseComparison)) {
return $name;
}
throw new \InvalidArgumentException('Unknown enumeration... | php | final public static function parseValue($searchValue, bool $looseComparison = false): string
{
if (false !== $name = \array_search($searchValue, self::getClassConstants(static::class), !$looseComparison)) {
return $name;
}
throw new \InvalidArgumentException('Unknown enumeration... | [
"final",
"public",
"static",
"function",
"parseValue",
"(",
"$",
"searchValue",
",",
"bool",
"$",
"looseComparison",
"=",
"false",
")",
":",
"string",
"{",
"if",
"(",
"false",
"!==",
"$",
"name",
"=",
"\\",
"array_search",
"(",
"$",
"searchValue",
",",
"... | Get the name of the first member with the specified value
@param mixed $searchValue
@param bool $looseComparison
@return string | [
"Get",
"the",
"name",
"of",
"the",
"first",
"member",
"with",
"the",
"specified",
"value"
] | 52c0388a234eb679f4c9be374ea76bd41763b114 | https://github.com/DaveRandom/Enum/blob/52c0388a234eb679f4c9be374ea76bd41763b114/src/Enum.php#L49-L56 |
225,786 | DaveRandom/Enum | src/Enum.php | Enum.parseName | final public static function parseName(string $searchName, bool $caseInsensitive = false)
{
$constants = self::getClassConstants(static::class);
if (isset($constants[$searchName])) {
return $constants[$searchName];
}
if ($caseInsensitive && null !== $key = self::searchA... | php | final public static function parseName(string $searchName, bool $caseInsensitive = false)
{
$constants = self::getClassConstants(static::class);
if (isset($constants[$searchName])) {
return $constants[$searchName];
}
if ($caseInsensitive && null !== $key = self::searchA... | [
"final",
"public",
"static",
"function",
"parseName",
"(",
"string",
"$",
"searchName",
",",
"bool",
"$",
"caseInsensitive",
"=",
"false",
")",
"{",
"$",
"constants",
"=",
"self",
"::",
"getClassConstants",
"(",
"static",
"::",
"class",
")",
";",
"if",
"("... | Get the value of the member with the specified name
@param string $searchName
@param bool $caseInsensitive
@return mixed | [
"Get",
"the",
"value",
"of",
"the",
"member",
"with",
"the",
"specified",
"name"
] | 52c0388a234eb679f4c9be374ea76bd41763b114 | https://github.com/DaveRandom/Enum/blob/52c0388a234eb679f4c9be374ea76bd41763b114/src/Enum.php#L73-L86 |
225,787 | bytic/Common | src/Records/Traits/HasForms/RecordsTrait.php | RecordsTrait.getFormClassName | public function getFormClassName($type = null)
{
if (!$type) {
$type = $this->getFormTypeDefault();
}
$module = $this->getRequest()->getModuleName();
if (strpos($type, 'admin-') !== false) {
$module = 'admin';
$type = str_replace('admin-', '', $ty... | php | public function getFormClassName($type = null)
{
if (!$type) {
$type = $this->getFormTypeDefault();
}
$module = $this->getRequest()->getModuleName();
if (strpos($type, 'admin-') !== false) {
$module = 'admin';
$type = str_replace('admin-', '', $ty... | [
"public",
"function",
"getFormClassName",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"type",
")",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"getFormTypeDefault",
"(",
")",
";",
"}",
"$",
"module",
"=",
"$",
"this",
"->",
"getRequ... | Get Form Class name by type
@param string $type Type name
@return string | [
"Get",
"Form",
"Class",
"name",
"by",
"type"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/HasForms/RecordsTrait.php#L39-L58 |
225,788 | bytic/Common | src/Records/Traits/HasForms/RecordsTrait.php | RecordsTrait.initFormClassNameSlug | protected function initFormClassNameSlug()
{
$slug = \inflector()->singularize(
\inflector()->classify($this->getFormClassNameBase())
);
$this->setFormClassNameSlug($slug);
} | php | protected function initFormClassNameSlug()
{
$slug = \inflector()->singularize(
\inflector()->classify($this->getFormClassNameBase())
);
$this->setFormClassNameSlug($slug);
} | [
"protected",
"function",
"initFormClassNameSlug",
"(",
")",
"{",
"$",
"slug",
"=",
"\\",
"inflector",
"(",
")",
"->",
"singularize",
"(",
"\\",
"inflector",
"(",
")",
"->",
"classify",
"(",
"$",
"this",
"->",
"getFormClassNameBase",
"(",
")",
")",
")",
"... | Init form class name slug
@return void | [
"Init",
"form",
"class",
"name",
"slug"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Traits/HasForms/RecordsTrait.php#L101-L107 |
225,789 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Exception/Exception.php | Exception.searchForFileAndLineCalledFromStack | protected static function searchForFileAndLineCalledFromStack(array $stack)
{
for ($i=0;$i<count($stack);$i++) {
if(array_key_exists("file", $stack[$i]) && array_key_exists("line", $stack[$i])) return $stack[$i];
}
return null;
} | php | protected static function searchForFileAndLineCalledFromStack(array $stack)
{
for ($i=0;$i<count($stack);$i++) {
if(array_key_exists("file", $stack[$i]) && array_key_exists("line", $stack[$i])) return $stack[$i];
}
return null;
} | [
"protected",
"static",
"function",
"searchForFileAndLineCalledFromStack",
"(",
"array",
"$",
"stack",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"count",
"(",
"$",
"stack",
")",
";",
"$",
"i",
"++",
")",
"{",
"if",
"(",
"array_key_... | Search for a valid stack item with file and line not a raw class
call. Return the stack item with this data or null in case not stack item
found
@param array $stack
@return array|null | [
"Search",
"for",
"a",
"valid",
"stack",
"item",
"with",
"file",
"and",
"line",
"not",
"a",
"raw",
"class",
"call",
".",
"Return",
"the",
"stack",
"item",
"with",
"this",
"data",
"or",
"null",
"in",
"case",
"not",
"stack",
"item",
"found"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Exception/Exception.php#L71-L78 |
225,790 | PureBilling/PureMachineSDK | src/PureMachine/Bundle/SDKBundle/Exception/Exception.php | Exception.buildExceptionStore | public static function buildExceptionStore(\Exception $e)
{
$exceptionStore = new ExceptionStore();
$exceptionStore->setMessage($e->getMessage());
$exceptionStore->setCode($e->getCode());
$exceptionStore->setExceptionClass(get_class($e));
$t = explode('\n', $e->getTraceAsStri... | php | public static function buildExceptionStore(\Exception $e)
{
$exceptionStore = new ExceptionStore();
$exceptionStore->setMessage($e->getMessage());
$exceptionStore->setCode($e->getCode());
$exceptionStore->setExceptionClass(get_class($e));
$t = explode('\n', $e->getTraceAsStri... | [
"public",
"static",
"function",
"buildExceptionStore",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"$",
"exceptionStore",
"=",
"new",
"ExceptionStore",
"(",
")",
";",
"$",
"exceptionStore",
"->",
"setMessage",
"(",
"$",
"e",
"->",
"getMessage",
"(",
")",
"... | Build a exceptionStore from a PHP Exception
@param \Exception $e | [
"Build",
"a",
"exceptionStore",
"from",
"a",
"PHP",
"Exception"
] | 1cd3b6a629cbc913513a5d043e6423d1836d5177 | https://github.com/PureBilling/PureMachineSDK/blob/1cd3b6a629cbc913513a5d043e6423d1836d5177/src/PureMachine/Bundle/SDKBundle/Exception/Exception.php#L135-L158 |
225,791 | SetBased/php-abc-form-louver | src/SlatJoint/TableColumnSlatJoint.php | TableColumnSlatJoint.createControl | public function createControl(string $name): Control
{
$control = new TableColumnControl($name);
$control->setTableColumn($this->tableColumn);
return $control;
} | php | public function createControl(string $name): Control
{
$control = new TableColumnControl($name);
$control->setTableColumn($this->tableColumn);
return $control;
} | [
"public",
"function",
"createControl",
"(",
"string",
"$",
"name",
")",
":",
"Control",
"{",
"$",
"control",
"=",
"new",
"TableColumnControl",
"(",
"$",
"name",
")",
";",
"$",
"control",
"->",
"setTableColumn",
"(",
"$",
"this",
"->",
"tableColumn",
")",
... | Creates and returns a button form control.
@param string $name The local name of the button form control.
@return Control | [
"Creates",
"and",
"returns",
"a",
"button",
"form",
"control",
"."
] | 59ff07a59da4ba90ef9665a8893559cd66d37233 | https://github.com/SetBased/php-abc-form-louver/blob/59ff07a59da4ba90ef9665a8893559cd66d37233/src/SlatJoint/TableColumnSlatJoint.php#L40-L46 |
225,792 | phpactor/worse-reference-finder | lib/WorsePlainTextClassDefinitionLocator.php | WorsePlainTextClassDefinitionLocator.resolveImportTable | private function resolveImportTable(Node $node): array
{
try {
return $node->getImportTablesForCurrentScope();
} catch (Exception $e) {
}
foreach ($node->getDescendantNodes() as $node) {
try {
$imports = $node->getImportTablesForCurrentScope()... | php | private function resolveImportTable(Node $node): array
{
try {
return $node->getImportTablesForCurrentScope();
} catch (Exception $e) {
}
foreach ($node->getDescendantNodes() as $node) {
try {
$imports = $node->getImportTablesForCurrentScope()... | [
"private",
"function",
"resolveImportTable",
"(",
"Node",
"$",
"node",
")",
":",
"array",
"{",
"try",
"{",
"return",
"$",
"node",
"->",
"getImportTablesForCurrentScope",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
"{",
"}",
"foreach",
"... | Tolerant parser will resolve a docblock comment as the root node, not
the node to which the comment belongs. Here we attempt to get the import
table from the current node, if that fails then we just do whatever we
can to get an import table. | [
"Tolerant",
"parser",
"will",
"resolve",
"a",
"docblock",
"comment",
"as",
"the",
"root",
"node",
"not",
"the",
"node",
"to",
"which",
"the",
"comment",
"belongs",
".",
"Here",
"we",
"attempt",
"to",
"get",
"the",
"import",
"table",
"from",
"the",
"current... | 78bd0209b34dccbe84ce1e238390cf0f5b86da15 | https://github.com/phpactor/worse-reference-finder/blob/78bd0209b34dccbe84ce1e238390cf0f5b86da15/lib/WorsePlainTextClassDefinitionLocator.php#L141-L160 |
225,793 | phpactor/worse-reference-finder | lib/WorsePlainTextClassDefinitionLocator.php | WorsePlainTextClassDefinitionLocator.resolveNamespace | private function resolveNamespace(Node $node)
{
try {
return $this->namespaceFromNode($node);
} catch (Exception $e) {
}
foreach ($node->getDescendantNodes() as $node) {
try {
return $this->namespaceFromNode($node);
} catch (Except... | php | private function resolveNamespace(Node $node)
{
try {
return $this->namespaceFromNode($node);
} catch (Exception $e) {
}
foreach ($node->getDescendantNodes() as $node) {
try {
return $this->namespaceFromNode($node);
} catch (Except... | [
"private",
"function",
"resolveNamespace",
"(",
"Node",
"$",
"node",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"namespaceFromNode",
"(",
"$",
"node",
")",
";",
"}",
"catch",
"(",
"Exception",
"$",
"e",
")",
"{",
"}",
"foreach",
"(",
"$",
"no... | As with resolve import table, we try our best. | [
"As",
"with",
"resolve",
"import",
"table",
"we",
"try",
"our",
"best",
"."
] | 78bd0209b34dccbe84ce1e238390cf0f5b86da15 | https://github.com/phpactor/worse-reference-finder/blob/78bd0209b34dccbe84ce1e238390cf0f5b86da15/lib/WorsePlainTextClassDefinitionLocator.php#L165-L180 |
225,794 | cmsgears/module-cms | common/utilities/ContentUtil.php | ContentUtil.initPage | public static function initPage( $view, $config = [] ) {
$model = isset( $view->params[ 'model' ] ) ? $view->params[ 'model' ] : self::findPage( $view, $config );
if( isset( $model ) ) {
$coreProperties = CoreProperties::getInstance();
$cmsProperties = CmsProperties::getInstance();
$content = $model->m... | php | public static function initPage( $view, $config = [] ) {
$model = isset( $view->params[ 'model' ] ) ? $view->params[ 'model' ] : self::findPage( $view, $config );
if( isset( $model ) ) {
$coreProperties = CoreProperties::getInstance();
$cmsProperties = CmsProperties::getInstance();
$content = $model->m... | [
"public",
"static",
"function",
"initPage",
"(",
"$",
"view",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"model",
"=",
"isset",
"(",
"$",
"view",
"->",
"params",
"[",
"'model'",
"]",
")",
"?",
"$",
"view",
"->",
"params",
"[",
"'model'",
"... | Generates the meta data of Page or Post.
@param \yii\web\View $view The current view being rendered by controller.
@param array $config - It can pass service, typed and type to detect the model. It can also pass basePath to form ogurl.
@return array having page meta data. | [
"Generates",
"the",
"meta",
"data",
"of",
"Page",
"or",
"Post",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/utilities/ContentUtil.php#L38-L82 |
225,795 | cmsgears/module-cms | common/utilities/ContentUtil.php | ContentUtil.initModelPage | public static function initModelPage( $view, $config = [] ) {
$model = isset( $view->params[ 'model' ] ) ? $view->params[ 'model' ] : self::findModel( $config );
if( isset( $model ) ) {
$coreProperties = CoreProperties::getInstance();
$cmsProperties = CmsProperties::getInstance();
$seoData = $model->ge... | php | public static function initModelPage( $view, $config = [] ) {
$model = isset( $view->params[ 'model' ] ) ? $view->params[ 'model' ] : self::findModel( $config );
if( isset( $model ) ) {
$coreProperties = CoreProperties::getInstance();
$cmsProperties = CmsProperties::getInstance();
$seoData = $model->ge... | [
"public",
"static",
"function",
"initModelPage",
"(",
"$",
"view",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"model",
"=",
"isset",
"(",
"$",
"view",
"->",
"params",
"[",
"'model'",
"]",
")",
"?",
"$",
"view",
"->",
"params",
"[",
"'model'"... | Generates the meta data of Model using model content.
@param \yii\web\View $view The current view being rendered by controller.
@param array $config
@return array having model meta data. | [
"Generates",
"the",
"meta",
"data",
"of",
"Model",
"using",
"model",
"content",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/utilities/ContentUtil.php#L143-L188 |
225,796 | cmsgears/module-cms | common/utilities/ContentUtil.php | ContentUtil.findPage | public static function findPage( $view, $config = [] ) {
$moduleName = $view->context->module->id;
$controllerName = Yii::$app->controller->id;
$actionName = Yii::$app->controller->action->id;
$page = null;
// System/Public Pages - Landing, Login, Register, Confirm Account, Activate Account, Forgot Passw... | php | public static function findPage( $view, $config = [] ) {
$moduleName = $view->context->module->id;
$controllerName = Yii::$app->controller->id;
$actionName = Yii::$app->controller->action->id;
$page = null;
// System/Public Pages - Landing, Login, Register, Confirm Account, Activate Account, Forgot Passw... | [
"public",
"static",
"function",
"findPage",
"(",
"$",
"view",
",",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"$",
"moduleName",
"=",
"$",
"view",
"->",
"context",
"->",
"module",
"->",
"id",
";",
"$",
"controllerName",
"=",
"Yii",
"::",
"$",
"app",
"... | Find and return the view according to the configuration passed to it.
@param \yii\web\View $view
@param array $config
@return \cmsgears\cms\common\models\entities\Content | [
"Find",
"and",
"return",
"the",
"view",
"according",
"to",
"the",
"configuration",
"passed",
"to",
"it",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/utilities/ContentUtil.php#L197-L228 |
225,797 | OAuth2-Framework/bearer-token-type | BearerToken.php | BearerToken.getTokenFromAuthorizationHeaders | private function getTokenFromAuthorizationHeaders(ServerRequestInterface $request): ?string
{
$authorization_headers = $request->getHeader('AUTHORIZATION');
foreach ($authorization_headers as $authorization_header) {
if (1 === \Safe\preg_match('/'.\preg_quote('Bearer', '/').'\s([a-zA-Z0... | php | private function getTokenFromAuthorizationHeaders(ServerRequestInterface $request): ?string
{
$authorization_headers = $request->getHeader('AUTHORIZATION');
foreach ($authorization_headers as $authorization_header) {
if (1 === \Safe\preg_match('/'.\preg_quote('Bearer', '/').'\s([a-zA-Z0... | [
"private",
"function",
"getTokenFromAuthorizationHeaders",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"?",
"string",
"{",
"$",
"authorization_headers",
"=",
"$",
"request",
"->",
"getHeader",
"(",
"'AUTHORIZATION'",
")",
";",
"foreach",
"(",
"$",
"au... | Get the token from the authorization header. | [
"Get",
"the",
"token",
"from",
"the",
"authorization",
"header",
"."
] | faa34838a313fdbd96d0e61bddfc93c441ca2bd3 | https://github.com/OAuth2-Framework/bearer-token-type/blob/faa34838a313fdbd96d0e61bddfc93c441ca2bd3/BearerToken.php#L110-L121 |
225,798 | OAuth2-Framework/bearer-token-type | BearerToken.php | BearerToken.getTokenFromRequestBody | private function getTokenFromRequestBody(ServerRequestInterface $request): ?string
{
try {
$parameters = RequestBodyParser::parseFormUrlEncoded($request);
return $this->getAccessTokenFromParameters($parameters);
} catch (\Exception $e) {
return null;
}
... | php | private function getTokenFromRequestBody(ServerRequestInterface $request): ?string
{
try {
$parameters = RequestBodyParser::parseFormUrlEncoded($request);
return $this->getAccessTokenFromParameters($parameters);
} catch (\Exception $e) {
return null;
}
... | [
"private",
"function",
"getTokenFromRequestBody",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"?",
"string",
"{",
"try",
"{",
"$",
"parameters",
"=",
"RequestBodyParser",
"::",
"parseFormUrlEncoded",
"(",
"$",
"request",
")",
";",
"return",
"$",
"th... | Get the token from the request body. | [
"Get",
"the",
"token",
"from",
"the",
"request",
"body",
"."
] | faa34838a313fdbd96d0e61bddfc93c441ca2bd3 | https://github.com/OAuth2-Framework/bearer-token-type/blob/faa34838a313fdbd96d0e61bddfc93c441ca2bd3/BearerToken.php#L126-L135 |
225,799 | OAuth2-Framework/bearer-token-type | BearerToken.php | BearerToken.getTokenFromQuery | private function getTokenFromQuery(ServerRequestInterface $request): ?string
{
$query_params = $request->getQueryParams();
return $this->getAccessTokenFromParameters($query_params);
} | php | private function getTokenFromQuery(ServerRequestInterface $request): ?string
{
$query_params = $request->getQueryParams();
return $this->getAccessTokenFromParameters($query_params);
} | [
"private",
"function",
"getTokenFromQuery",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"?",
"string",
"{",
"$",
"query_params",
"=",
"$",
"request",
"->",
"getQueryParams",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getAccessTokenFromParameters",
... | Get the token from the query string. | [
"Get",
"the",
"token",
"from",
"the",
"query",
"string",
"."
] | faa34838a313fdbd96d0e61bddfc93c441ca2bd3 | https://github.com/OAuth2-Framework/bearer-token-type/blob/faa34838a313fdbd96d0e61bddfc93c441ca2bd3/BearerToken.php#L140-L145 |
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.