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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
194,000 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/logging/AbstractLogger.php | AbstractLogger.getLogHistory | public function getLogHistory($klass = null)
{
if (empty($klass))
return $this->history;
if (!isset($this->history[$klass]))
return array();
return $this->history[$klass];
} | php | public function getLogHistory($klass = null)
{
if (empty($klass))
return $this->history;
if (!isset($this->history[$klass]))
return array();
return $this->history[$klass];
} | [
"public",
"function",
"getLogHistory",
"(",
"$",
"klass",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"klass",
")",
")",
"return",
"$",
"this",
"->",
"history",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"history",
"[",
"$",
"... | This function returns the current array of log message for a particular category.
@param string $klass The category of log messages. If this parameter is omitted, then all log history is returned.
@return array Array of strings containing sequential log messages for the given {@link $klass}. | [
"This",
"function",
"returns",
"the",
"current",
"array",
"of",
"log",
"message",
"for",
"a",
"particular",
"category",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/logging/AbstractLogger.php#L348-L357 |
194,001 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/logging/AbstractLogger.php | AbstractLogger.clearLogHistory | public function clearLogHistory($klass = null)
{
if (empty($klass))
$this->history = array();
if (!isset($this->history[$klass]))
return;
$this->history[$klass] = array();
} | php | public function clearLogHistory($klass = null)
{
if (empty($klass))
$this->history = array();
if (!isset($this->history[$klass]))
return;
$this->history[$klass] = array();
} | [
"public",
"function",
"clearLogHistory",
"(",
"$",
"klass",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"klass",
")",
")",
"$",
"this",
"->",
"history",
"=",
"array",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"histo... | This function clears the current array of log message for a particular category.
@param string $klass The category of log messages. If this parameter is ommitted, then all history is cleared.
@return void | [
"This",
"function",
"clears",
"the",
"current",
"array",
"of",
"log",
"message",
"for",
"a",
"particular",
"category",
"."
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/logging/AbstractLogger.php#L366-L375 |
194,002 | chalasr/RCHCapistranoBundle | Generator/GemfileGenerator.php | GemfileGenerator.write | public function write()
{
$gemfile = '';
foreach ($this->parameters as $gem) {
$line = str_replace('<gem>', $gem, self::$template);
$gemfile = sprintf('%s%s%s', $gemfile, PHP_EOL, $line);
}
$gemfile .= self::$sourceTemplate;
fwrite($this->file, $thi... | php | public function write()
{
$gemfile = '';
foreach ($this->parameters as $gem) {
$line = str_replace('<gem>', $gem, self::$template);
$gemfile = sprintf('%s%s%s', $gemfile, PHP_EOL, $line);
}
$gemfile .= self::$sourceTemplate;
fwrite($this->file, $thi... | [
"public",
"function",
"write",
"(",
")",
"{",
"$",
"gemfile",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"parameters",
"as",
"$",
"gem",
")",
"{",
"$",
"line",
"=",
"str_replace",
"(",
"'<gem>'",
",",
"$",
"gem",
",",
"self",
"::",
"$",
"... | Writes Gemfile. | [
"Writes",
"Gemfile",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Generator/GemfileGenerator.php#L46-L58 |
194,003 | OxfordInfoLabs/kinikit-core | src/Util/Caching/SessionCache.php | SessionCache.cacheObject | public function cacheObject($key, $object, $timeoutSeconds = -1) {
$cache = HttpSession::instance()->getValue("__SESSION_CACHED_ITEMS");
if (!is_array($cache)) {
$cache = array();
}
$cache[$key] = $object;
HttpSession::instance()->setValue("__SESSION_CACHED_ITEMS",... | php | public function cacheObject($key, $object, $timeoutSeconds = -1) {
$cache = HttpSession::instance()->getValue("__SESSION_CACHED_ITEMS");
if (!is_array($cache)) {
$cache = array();
}
$cache[$key] = $object;
HttpSession::instance()->setValue("__SESSION_CACHED_ITEMS",... | [
"public",
"function",
"cacheObject",
"(",
"$",
"key",
",",
"$",
"object",
",",
"$",
"timeoutSeconds",
"=",
"-",
"1",
")",
"{",
"$",
"cache",
"=",
"HttpSession",
"::",
"instance",
"(",
")",
"->",
"getValue",
"(",
"\"__SESSION_CACHED_ITEMS\"",
")",
";",
"i... | Cache an object with a key and an optional timeout in seconds.
@param $key
@param $object | [
"Cache",
"an",
"object",
"with",
"a",
"key",
"and",
"an",
"optional",
"timeout",
"in",
"seconds",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Caching/SessionCache.php#L33-L59 |
194,004 | OxfordInfoLabs/kinikit-core | src/Util/Caching/SessionCache.php | SessionCache.getCachedObject | public function getCachedObject($key) {
$cache = HttpSession::instance()->getValue("__SESSION_CACHED_ITEMS");
$timeouts = HttpSession::instance()->getValue("__SESSION_CACHE_TIMEOUTS");
if (is_array($timeouts) && isset($timeouts[$key])) {
$now = new \DateTime();
$expiry =... | php | public function getCachedObject($key) {
$cache = HttpSession::instance()->getValue("__SESSION_CACHED_ITEMS");
$timeouts = HttpSession::instance()->getValue("__SESSION_CACHE_TIMEOUTS");
if (is_array($timeouts) && isset($timeouts[$key])) {
$now = new \DateTime();
$expiry =... | [
"public",
"function",
"getCachedObject",
"(",
"$",
"key",
")",
"{",
"$",
"cache",
"=",
"HttpSession",
"::",
"instance",
"(",
")",
"->",
"getValue",
"(",
"\"__SESSION_CACHED_ITEMS\"",
")",
";",
"$",
"timeouts",
"=",
"HttpSession",
"::",
"instance",
"(",
")",
... | Get a cached object by key
@param $key | [
"Get",
"a",
"cached",
"object",
"by",
"key"
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Util/Caching/SessionCache.php#L67-L81 |
194,005 | prosoftSolutions/Pager | Twig/PagerfantaExtension.php | PagerfantaExtension.getPageUrl | public function getPageUrl(PagerfantaInterface $pagerfanta, $page, array $options = array())
{
if ($page < 0 || $page > $pagerfanta->count()) {
throw new \InvalidArgumentException("Page '{$page}' is out of bounds");
}
$routeGenerator = $this->createRouteGenerator($options);
... | php | public function getPageUrl(PagerfantaInterface $pagerfanta, $page, array $options = array())
{
if ($page < 0 || $page > $pagerfanta->count()) {
throw new \InvalidArgumentException("Page '{$page}' is out of bounds");
}
$routeGenerator = $this->createRouteGenerator($options);
... | [
"public",
"function",
"getPageUrl",
"(",
"PagerfantaInterface",
"$",
"pagerfanta",
",",
"$",
"page",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"page",
"<",
"0",
"||",
"$",
"page",
">",
"$",
"pagerfanta",
"->",
"c... | Generates the url for a given page in a pagerfanta instance.
@param \Pagerfanta\PagerfantaInterface $pagerfanta
@param $page
@param array $options
@return string The url of the given page
@throws \InvalidArgumentException | [
"Generates",
"the",
"url",
"for",
"a",
"given",
"page",
"in",
"a",
"pagerfanta",
"instance",
"."
] | 96446ee22caedc0b9bb486d9ffe7a50b6c13177f | https://github.com/prosoftSolutions/Pager/blob/96446ee22caedc0b9bb486d9ffe7a50b6c13177f/Twig/PagerfantaExtension.php#L80-L89 |
194,006 | prosoftSolutions/Pager | Twig/PagerfantaExtension.php | PagerfantaExtension.createRouteGenerator | private function createRouteGenerator($options = array())
{
$options = array_replace(array(
'routeName' => null,
'routeParams' => array(),
'pageParameter' => '[page]',
), $options);
$router = $this->container->get('router');
... | php | private function createRouteGenerator($options = array())
{
$options = array_replace(array(
'routeName' => null,
'routeParams' => array(),
'pageParameter' => '[page]',
), $options);
$router = $this->container->get('router');
... | [
"private",
"function",
"createRouteGenerator",
"(",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"options",
"=",
"array_replace",
"(",
"array",
"(",
"'routeName'",
"=>",
"null",
",",
"'routeParams'",
"=>",
"array",
"(",
")",
",",
"'pageParameter'",... | Creates an anonymous function which returns the URL for a given page.
@param array $options
@return callable
@throws \Exception | [
"Creates",
"an",
"anonymous",
"function",
"which",
"returns",
"the",
"URL",
"for",
"a",
"given",
"page",
"."
] | 96446ee22caedc0b9bb486d9ffe7a50b6c13177f | https://github.com/prosoftSolutions/Pager/blob/96446ee22caedc0b9bb486d9ffe7a50b6c13177f/Twig/PagerfantaExtension.php#L100-L138 |
194,007 | brain-diminished/schema-version-control | src/Utils/SchemaBuilder.php | SchemaBuilder.build | public function build(array $schemaDesc): Schema
{
$this->schemaDesc = $schemaDesc;
$schema = new Schema();
foreach ($schemaDesc['tables'] as $name => $tableDesc) {
$table = $schema->createTable($name);
$this->buildTable($tableDesc, $table);
}
return $... | php | public function build(array $schemaDesc): Schema
{
$this->schemaDesc = $schemaDesc;
$schema = new Schema();
foreach ($schemaDesc['tables'] as $name => $tableDesc) {
$table = $schema->createTable($name);
$this->buildTable($tableDesc, $table);
}
return $... | [
"public",
"function",
"build",
"(",
"array",
"$",
"schemaDesc",
")",
":",
"Schema",
"{",
"$",
"this",
"->",
"schemaDesc",
"=",
"$",
"schemaDesc",
";",
"$",
"schema",
"=",
"new",
"Schema",
"(",
")",
";",
"foreach",
"(",
"$",
"schemaDesc",
"[",
"'tables'... | Build an array descriptor into a Schema object
@param array $schemaDesc
@return Schema | [
"Build",
"an",
"array",
"descriptor",
"into",
"a",
"Schema",
"object"
] | 215dd96394072720b61a682e10a55a6520470c46 | https://github.com/brain-diminished/schema-version-control/blob/215dd96394072720b61a682e10a55a6520470c46/src/Utils/SchemaBuilder.php#L24-L33 |
194,008 | brightnucleus/values | src/Exception/FailedToValidate.php | FailedToValidate.fromValueForClass | public static function fromValueForClass($value, string $class)
{
$message = sprintf(
'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)',
is_object($value) ? get_class($value) : gettype($value),
$class,
json_encode($value)
... | php | public static function fromValueForClass($value, string $class)
{
$message = sprintf(
'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)',
is_object($value) ? get_class($value) : gettype($value),
$class,
json_encode($value)
... | [
"public",
"static",
"function",
"fromValueForClass",
"(",
"$",
"value",
",",
"string",
"$",
"class",
")",
"{",
"$",
"message",
"=",
"sprintf",
"(",
"'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)'",
",",
"is_object",
"(",
"$",
"valu... | Create a new exception instance from a failing value.
@since 0.1.1
@param mixed $value Value that failed validation.
@param string $class FQCN of the class that the value was validated against.
@return static | [
"Create",
"a",
"new",
"exception",
"instance",
"from",
"a",
"failing",
"value",
"."
] | e9bdfbec949f6f964631aacaccaa98a0f13d916f | https://github.com/brightnucleus/values/blob/e9bdfbec949f6f964631aacaccaa98a0f13d916f/src/Exception/FailedToValidate.php#L40-L50 |
194,009 | dmj/PicaRecord | src/HAB/Pica/Record/LocalRecord.php | LocalRecord.addCopyRecord | public function addCopyRecord (CopyRecord $record)
{
if ($this->getCopyRecordByItemNumber($record->getItemNumber())) {
throw new InvalidArgumentException("Cannot add copy record: Copy record with item number {$record->getItemNumber()} already present");
}
$this->addRecord($record... | php | public function addCopyRecord (CopyRecord $record)
{
if ($this->getCopyRecordByItemNumber($record->getItemNumber())) {
throw new InvalidArgumentException("Cannot add copy record: Copy record with item number {$record->getItemNumber()} already present");
}
$this->addRecord($record... | [
"public",
"function",
"addCopyRecord",
"(",
"CopyRecord",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getCopyRecordByItemNumber",
"(",
"$",
"record",
"->",
"getItemNumber",
"(",
")",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
... | Add a copy record.
@throws InvalidArgumentException Record already contains the copy record
@throws InvalidArgumentException Record already contains a copy record with the same item number
@param CopyRecord $record Copy record to add
@return void | [
"Add",
"a",
"copy",
"record",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/LocalRecord.php#L64-L71 |
194,010 | dmj/PicaRecord | src/HAB/Pica/Record/LocalRecord.php | LocalRecord.getCopyRecordByItemNumber | public function getCopyRecordByItemNumber ($itemNumber)
{
foreach ($this->_records as $record) {
if ($record->getItemNumber() === $itemNumber) {
return $record;
}
}
return null;
} | php | public function getCopyRecordByItemNumber ($itemNumber)
{
foreach ($this->_records as $record) {
if ($record->getItemNumber() === $itemNumber) {
return $record;
}
}
return null;
} | [
"public",
"function",
"getCopyRecordByItemNumber",
"(",
"$",
"itemNumber",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_records",
"as",
"$",
"record",
")",
"{",
"if",
"(",
"$",
"record",
"->",
"getItemNumber",
"(",
")",
"===",
"$",
"itemNumber",
")",
"... | Return copy record by item number.
@param integer $itemNumber Item number
@return CopyRecord|null The copy record or null if none exists | [
"Return",
"copy",
"record",
"by",
"item",
"number",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/LocalRecord.php#L91-L99 |
194,011 | dmj/PicaRecord | src/HAB/Pica/Record/LocalRecord.php | LocalRecord.setTitleRecord | public function setTitleRecord (TitleRecord $record)
{
$this->unsetTitleRecord();
if (!$record->containsLocalRecord($this)) {
$record->addLocalRecord($this);
}
$this->_parent = $record;
} | php | public function setTitleRecord (TitleRecord $record)
{
$this->unsetTitleRecord();
if (!$record->containsLocalRecord($this)) {
$record->addLocalRecord($this);
}
$this->_parent = $record;
} | [
"public",
"function",
"setTitleRecord",
"(",
"TitleRecord",
"$",
"record",
")",
"{",
"$",
"this",
"->",
"unsetTitleRecord",
"(",
")",
";",
"if",
"(",
"!",
"$",
"record",
"->",
"containsLocalRecord",
"(",
"$",
"this",
")",
")",
"{",
"$",
"record",
"->",
... | Set the containing title record.
@param TitleRecord $record Title record
@return void | [
"Set",
"the",
"containing",
"title",
"record",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/LocalRecord.php#L145-L152 |
194,012 | dmj/PicaRecord | src/HAB/Pica/Record/LocalRecord.php | LocalRecord.unsetTitleRecord | public function unsetTitleRecord ()
{
if ($this->_parent) {
if ($this->_parent->containsLocalRecord($this)) {
$this->_parent->removeLocalRecord($this);
}
$this->_parent = null;
}
} | php | public function unsetTitleRecord ()
{
if ($this->_parent) {
if ($this->_parent->containsLocalRecord($this)) {
$this->_parent->removeLocalRecord($this);
}
$this->_parent = null;
}
} | [
"public",
"function",
"unsetTitleRecord",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_parent",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_parent",
"->",
"containsLocalRecord",
"(",
"$",
"this",
")",
")",
"{",
"$",
"this",
"->",
"_parent",
"->",
"re... | Unset the containing title record.
@return void | [
"Unset",
"the",
"containing",
"title",
"record",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/LocalRecord.php#L159-L167 |
194,013 | bseddon/XPath20 | XPath2Expression.php | XPath2Expression.getParameterQNames | public function getParameterQNames()
{
$result = array();
$forQNames = array(); // Need to ignore variables that are defined for the 'for' clause
$this->traverseNodes( $this->exprTree, function( $node ) use( &$result, &$forQNames )
{
if ( $node instanceof ForNode )
{
$forQNames[] = $node->g... | php | public function getParameterQNames()
{
$result = array();
$forQNames = array(); // Need to ignore variables that are defined for the 'for' clause
$this->traverseNodes( $this->exprTree, function( $node ) use( &$result, &$forQNames )
{
if ( $node instanceof ForNode )
{
$forQNames[] = $node->g... | [
"public",
"function",
"getParameterQNames",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"$",
"forQNames",
"=",
"array",
"(",
")",
";",
"// Need to ignore variables that are defined for the 'for' clause\r",
"$",
"this",
"->",
"traverseNodes",
"(",
"$... | Return an array of parameter names
@return QName[] | [
"Return",
"an",
"array",
"of",
"parameter",
"names"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/XPath2Expression.php#L306-L330 |
194,014 | bseddon/XPath20 | XPath2Expression.php | XPath2Expression.isFunctionUsed | public function isFunctionUsed( $functions )
{
if ( is_string( $functions ) )
{
$functions = array( $functions );
}
$result = $this->traverseNodes( $this->exprTree, function( $node ) use( &$result, $functions )
{
// TODO Test the functions in this node and return false if any are found
re... | php | public function isFunctionUsed( $functions )
{
if ( is_string( $functions ) )
{
$functions = array( $functions );
}
$result = $this->traverseNodes( $this->exprTree, function( $node ) use( &$result, $functions )
{
// TODO Test the functions in this node and return false if any are found
re... | [
"public",
"function",
"isFunctionUsed",
"(",
"$",
"functions",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"functions",
")",
")",
"{",
"$",
"functions",
"=",
"array",
"(",
"$",
"functions",
")",
";",
"}",
"$",
"result",
"=",
"$",
"this",
"->",
"trave... | Checks to see is one or any of a collection of functions are used in an expression
@param array $functions | [
"Checks",
"to",
"see",
"is",
"one",
"or",
"any",
"of",
"a",
"collection",
"of",
"functions",
"are",
"used",
"in",
"an",
"expression"
] | 69882b6efffaa5470a819d5fdd2f6473ddeb046d | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/XPath2Expression.php#L356-L370 |
194,015 | WellCommerce/ShippingBundle | Visitor/ShippingMethodOrderVisitor.php | ShippingMethodOrderVisitor.getCostCollection | private function getCostCollection(OrderInterface $order) : Collection
{
if ($order->hasShippingMethod()) {
$costs = $this->getCurrentShippingMethodCostsCollection($order);
if ($costs->count() > 0) {
return $costs;
}
}
return $this... | php | private function getCostCollection(OrderInterface $order) : Collection
{
if ($order->hasShippingMethod()) {
$costs = $this->getCurrentShippingMethodCostsCollection($order);
if ($costs->count() > 0) {
return $costs;
}
}
return $this... | [
"private",
"function",
"getCostCollection",
"(",
"OrderInterface",
"$",
"order",
")",
":",
"Collection",
"{",
"if",
"(",
"$",
"order",
"->",
"hasShippingMethod",
"(",
")",
")",
"{",
"$",
"costs",
"=",
"$",
"this",
"->",
"getCurrentShippingMethodCostsCollection",... | Returns the costs collection for existing shipping method or all shipping methods if current method is not longer available
@param OrderInterface $order
@return Collection | [
"Returns",
"the",
"costs",
"collection",
"for",
"existing",
"shipping",
"method",
"or",
"all",
"shipping",
"methods",
"if",
"current",
"method",
"is",
"not",
"longer",
"available"
] | c298c571440f3058b0efd64744df194b461198f3 | https://github.com/WellCommerce/ShippingBundle/blob/c298c571440f3058b0efd64744df194b461198f3/Visitor/ShippingMethodOrderVisitor.php#L113-L123 |
194,016 | WellCommerce/ShippingBundle | Visitor/ShippingMethodOrderVisitor.php | ShippingMethodOrderVisitor.getCurrentShippingMethodCostsCollection | private function getCurrentShippingMethodCostsCollection(OrderInterface $order) : Collection
{
return $this->methodProvider->getShippingMethodCosts($order->getShippingMethod(), new OrderContext($order));
} | php | private function getCurrentShippingMethodCostsCollection(OrderInterface $order) : Collection
{
return $this->methodProvider->getShippingMethodCosts($order->getShippingMethod(), new OrderContext($order));
} | [
"private",
"function",
"getCurrentShippingMethodCostsCollection",
"(",
"OrderInterface",
"$",
"order",
")",
":",
"Collection",
"{",
"return",
"$",
"this",
"->",
"methodProvider",
"->",
"getShippingMethodCosts",
"(",
"$",
"order",
"->",
"getShippingMethod",
"(",
")",
... | Returns the collection of costs for current shipping method
@param OrderInterface $order
@return Collection | [
"Returns",
"the",
"collection",
"of",
"costs",
"for",
"current",
"shipping",
"method"
] | c298c571440f3058b0efd64744df194b461198f3 | https://github.com/WellCommerce/ShippingBundle/blob/c298c571440f3058b0efd64744df194b461198f3/Visitor/ShippingMethodOrderVisitor.php#L144-L147 |
194,017 | t-kanstantsin/fileupload | src/model/Type.php | Type.getByMimeType | public static function getByMimeType(?string $mimeType): int
{
switch (explode('/', (string) $mimeType)[0] ?? null) {
case 'image':
return static::IMAGE;
case 'audio':
return static::AUDIO;
case 'video':
return static::VIDEO... | php | public static function getByMimeType(?string $mimeType): int
{
switch (explode('/', (string) $mimeType)[0] ?? null) {
case 'image':
return static::IMAGE;
case 'audio':
return static::AUDIO;
case 'video':
return static::VIDEO... | [
"public",
"static",
"function",
"getByMimeType",
"(",
"?",
"string",
"$",
"mimeType",
")",
":",
"int",
"{",
"switch",
"(",
"explode",
"(",
"'/'",
",",
"(",
"string",
")",
"$",
"mimeType",
")",
"[",
"0",
"]",
"??",
"null",
")",
"{",
"case",
"'image'",... | Returns file type by its mime type.
@param string|null $mimeType
@return int | [
"Returns",
"file",
"type",
"by",
"its",
"mime",
"type",
"."
] | d6317a9b9b36d992f09affe3900ef7d7ddfd855f | https://github.com/t-kanstantsin/fileupload/blob/d6317a9b9b36d992f09affe3900ef7d7ddfd855f/src/model/Type.php#L56-L68 |
194,018 | MindyPHP/QueryBuilder | ExpressionBuilder.php | ExpressionBuilder.literal | public function literal($input, $type = null)
{
// TODO remove
if (!is_string($input)) {
return $input;
}
// TODO remove
return $this->connection->quote($input, $type);
} | php | public function literal($input, $type = null)
{
// TODO remove
if (!is_string($input)) {
return $input;
}
// TODO remove
return $this->connection->quote($input, $type);
} | [
"public",
"function",
"literal",
"(",
"$",
"input",
",",
"$",
"type",
"=",
"null",
")",
"{",
"// TODO remove",
"if",
"(",
"!",
"is_string",
"(",
"$",
"input",
")",
")",
"{",
"return",
"$",
"input",
";",
"}",
"// TODO remove",
"return",
"$",
"this",
"... | Quotes a given input parameter.
@param mixed $input the parameter to be quoted
@param string|null $type the type of the parameter
@return string | [
"Quotes",
"a",
"given",
"input",
"parameter",
"."
] | fc486454786f3d38887dd7246802ea11e2954e54 | https://github.com/MindyPHP/QueryBuilder/blob/fc486454786f3d38887dd7246802ea11e2954e54/ExpressionBuilder.php#L358-L367 |
194,019 | CatLabInteractive/Accounts | src/CatLab/Accounts/Authenticators/Password.php | Password.processChangePassword | private function processChangePassword(User $user, $password, $confirmPassword)
{
if (empty($password)) {
return Errors::PASSWORD_INVALID;
}
if ($password !== $confirmPassword) {
return Errors::CONFIRM_PASSWORD_INVALID;
}
/** @var UserMapper $mapper ... | php | private function processChangePassword(User $user, $password, $confirmPassword)
{
if (empty($password)) {
return Errors::PASSWORD_INVALID;
}
if ($password !== $confirmPassword) {
return Errors::CONFIRM_PASSWORD_INVALID;
}
/** @var UserMapper $mapper ... | [
"private",
"function",
"processChangePassword",
"(",
"User",
"$",
"user",
",",
"$",
"password",
",",
"$",
"confirmPassword",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"password",
")",
")",
"{",
"return",
"Errors",
"::",
"PASSWORD_INVALID",
";",
"}",
"if",
... | Change the password of a user and sent them on their way.
@param User $user
@param $password
@param $confirmPassword
@return string
@throws \Neuron\Exceptions\DataNotSet | [
"Change",
"the",
"password",
"of",
"a",
"user",
"and",
"sent",
"them",
"on",
"their",
"way",
"."
] | e5465ad815c3caba5b7c1fde7b465a5fa05f3298 | https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Authenticators/Password.php#L377-L395 |
194,020 | CatLabInteractive/Accounts | src/CatLab/Accounts/Authenticators/Password.php | Password.verifyRecaptcha | private function verifyRecaptcha()
{
if (!isset($this->recaptchaClientKey)) {
return true;
}
$recaptcha = $this->request->input('g-recaptcha-response');
if (!$recaptcha) {
return false;
}
$request = new Request();
$request->setUrl('ht... | php | private function verifyRecaptcha()
{
if (!isset($this->recaptchaClientKey)) {
return true;
}
$recaptcha = $this->request->input('g-recaptcha-response');
if (!$recaptcha) {
return false;
}
$request = new Request();
$request->setUrl('ht... | [
"private",
"function",
"verifyRecaptcha",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"recaptchaClientKey",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",
"recaptcha",
"=",
"$",
"this",
"->",
"request",
"->",
"input",
"(",
"'g-reca... | Verify recaptcha code | [
"Verify",
"recaptcha",
"code"
] | e5465ad815c3caba5b7c1fde7b465a5fa05f3298 | https://github.com/CatLabInteractive/Accounts/blob/e5465ad815c3caba5b7c1fde7b465a5fa05f3298/src/CatLab/Accounts/Authenticators/Password.php#L459-L487 |
194,021 | CommonApi/Cache | CacheTrait.php | CacheTrait.setCache | public function setCache($key, $value, $ttl = 0)
{
$cache_function = $this->set_cache_callback;
return $cache_function($this->cache_type, array('key' => $key, 'value' => $value, 'ttl' => $ttl));
} | php | public function setCache($key, $value, $ttl = 0)
{
$cache_function = $this->set_cache_callback;
return $cache_function($this->cache_type, array('key' => $key, 'value' => $value, 'ttl' => $ttl));
} | [
"public",
"function",
"setCache",
"(",
"$",
"key",
",",
"$",
"value",
",",
"$",
"ttl",
"=",
"0",
")",
"{",
"$",
"cache_function",
"=",
"$",
"this",
"->",
"set_cache_callback",
";",
"return",
"$",
"cache_function",
"(",
"$",
"this",
"->",
"cache_type",
... | Persist data in cache
@param string $key
@param mixed $value
@param integer $ttl (number of seconds)
@return bool
@since 1.0.0 | [
"Persist",
"data",
"in",
"cache"
] | 6ff22d7d5f75f0e7b857bdec518f56d5c4682850 | https://github.com/CommonApi/Cache/blob/6ff22d7d5f75f0e7b857bdec518f56d5c4682850/CacheTrait.php#L78-L83 |
194,022 | CommonApi/Cache | CacheTrait.php | CacheTrait.useCache | public function useCache()
{
if (is_callable($this->get_cache_callback)
&& is_callable($this->set_cache_callback)
&& is_callable($this->delete_cache_callback)) {
return true;
}
return false;
} | php | public function useCache()
{
if (is_callable($this->get_cache_callback)
&& is_callable($this->set_cache_callback)
&& is_callable($this->delete_cache_callback)) {
return true;
}
return false;
} | [
"public",
"function",
"useCache",
"(",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"this",
"->",
"get_cache_callback",
")",
"&&",
"is_callable",
"(",
"$",
"this",
"->",
"set_cache_callback",
")",
"&&",
"is_callable",
"(",
"$",
"this",
"->",
"delete_cache_c... | Determine if Cache is activated for this type
@return boolean
@since 1.0 | [
"Determine",
"if",
"Cache",
"is",
"activated",
"for",
"this",
"type"
] | 6ff22d7d5f75f0e7b857bdec518f56d5c4682850 | https://github.com/CommonApi/Cache/blob/6ff22d7d5f75f0e7b857bdec518f56d5c4682850/CacheTrait.php#L119-L128 |
194,023 | pixelpolishers/makedocs | src/MakeDocs/Builder/AbstractBuilder.php | AbstractBuilder.setConfig | public function setConfig(array $config)
{
foreach ($config as $name => $value) {
$setter = 'set' . ucfirst($name);
call_user_func_array(array($this, $setter), array($value));
}
} | php | public function setConfig(array $config)
{
foreach ($config as $name => $value) {
$setter = 'set' . ucfirst($name);
call_user_func_array(array($this, $setter), array($value));
}
} | [
"public",
"function",
"setConfig",
"(",
"array",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"setter",
"=",
"'set'",
".",
"ucfirst",
"(",
"$",
"name",
")",
";",
"call_user_func_array",
... | Sets the configuration of the builder.
@param array $config The configuration to set. | [
"Sets",
"the",
"configuration",
"of",
"the",
"builder",
"."
] | 1fa243b52565b5de417ef2dbdfbcae9896b6b483 | https://github.com/pixelpolishers/makedocs/blob/1fa243b52565b5de417ef2dbdfbcae9896b6b483/src/MakeDocs/Builder/AbstractBuilder.php#L18-L25 |
194,024 | kaiohken1982/Neobazaar | src/Neobazaar/Service/MainModuleService.php | MainModuleService.getDocumentEntityRepository | public function getDocumentEntityRepository()
{
if(isset($this->er['Document'])) {
return $this->er['Document'];
}
$sphinxClient = $this->getServiceManager()->get('sphinxsearch.client.default');
$entityRepository = $this->getEntityManager()->getRepository('Neobazaar\Entity\Document');
... | php | public function getDocumentEntityRepository()
{
if(isset($this->er['Document'])) {
return $this->er['Document'];
}
$sphinxClient = $this->getServiceManager()->get('sphinxsearch.client.default');
$entityRepository = $this->getEntityManager()->getRepository('Neobazaar\Entity\Document');
... | [
"public",
"function",
"getDocumentEntityRepository",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"er",
"[",
"'Document'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"er",
"[",
"'Document'",
"]",
";",
"}",
"$",
"sphinxClient",
"=",
... | Get Neobazaar\Entity\Document entity repository | [
"Get",
"Neobazaar",
"\\",
"Entity",
"\\",
"Document",
"entity",
"repository"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Service/MainModuleService.php#L96-L109 |
194,025 | kaiohken1982/Neobazaar | src/Neobazaar/Service/MainModuleService.php | MainModuleService.getTermTaxonomyEntityRepository | public function getTermTaxonomyEntityRepository()
{
if(isset($this->er['TermTaxonomy'])) {
return $this->er['TermTaxonomy'];
}
$this->er['TermTaxonomy'] = $this->getEntityManager()->getRepository('Neobazaar\Entity\TermTaxonomy');
return $this->er['TermTaxonomy'];
} | php | public function getTermTaxonomyEntityRepository()
{
if(isset($this->er['TermTaxonomy'])) {
return $this->er['TermTaxonomy'];
}
$this->er['TermTaxonomy'] = $this->getEntityManager()->getRepository('Neobazaar\Entity\TermTaxonomy');
return $this->er['TermTaxonomy'];
} | [
"public",
"function",
"getTermTaxonomyEntityRepository",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"er",
"[",
"'TermTaxonomy'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"er",
"[",
"'TermTaxonomy'",
"]",
";",
"}",
"$",
"this",
"... | Get Neobazaar\Entity\TermTaxonomy entity repository | [
"Get",
"Neobazaar",
"\\",
"Entity",
"\\",
"TermTaxonomy",
"entity",
"repository"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Service/MainModuleService.php#L114-L122 |
194,026 | kaiohken1982/Neobazaar | src/Neobazaar/Service/MainModuleService.php | MainModuleService.getGeonamesEntityRepository | public function getGeonamesEntityRepository()
{
if(isset($this->er['Geonames'])) {
return $this->er['Geonames'];
}
$this->er['Geonames'] = $this->getEntityManager()->getRepository('Neobazaar\Entity\Geonames');
return $this->er['Geonames'];
} | php | public function getGeonamesEntityRepository()
{
if(isset($this->er['Geonames'])) {
return $this->er['Geonames'];
}
$this->er['Geonames'] = $this->getEntityManager()->getRepository('Neobazaar\Entity\Geonames');
return $this->er['Geonames'];
} | [
"public",
"function",
"getGeonamesEntityRepository",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"er",
"[",
"'Geonames'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"er",
"[",
"'Geonames'",
"]",
";",
"}",
"$",
"this",
"->",
"er",... | Get Neobazaar\Entity\Geonames entity repository | [
"Get",
"Neobazaar",
"\\",
"Entity",
"\\",
"Geonames",
"entity",
"repository"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Service/MainModuleService.php#L127-L135 |
194,027 | kaiohken1982/Neobazaar | src/Neobazaar/Service/MainModuleService.php | MainModuleService.getUserEntityRepository | public function getUserEntityRepository()
{
if(isset($this->er['User'])) {
return $this->er['User'];
}
$entityRepository = $this->getEntityManager()->getRepository('Neobazaar\Entity\User');
$entityRepository->setServiceLocator($this->getServiceManager());
$this->er['User'] = $entityR... | php | public function getUserEntityRepository()
{
if(isset($this->er['User'])) {
return $this->er['User'];
}
$entityRepository = $this->getEntityManager()->getRepository('Neobazaar\Entity\User');
$entityRepository->setServiceLocator($this->getServiceManager());
$this->er['User'] = $entityR... | [
"public",
"function",
"getUserEntityRepository",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"er",
"[",
"'User'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"er",
"[",
"'User'",
"]",
";",
"}",
"$",
"entityRepository",
"=",
"$",
... | Get Neobazaar\Entity\USer entity repository | [
"Get",
"Neobazaar",
"\\",
"Entity",
"\\",
"USer",
"entity",
"repository"
] | 288c972dea981d715c4e136edb5dba0318c9e6cb | https://github.com/kaiohken1982/Neobazaar/blob/288c972dea981d715c4e136edb5dba0318c9e6cb/src/Neobazaar/Service/MainModuleService.php#L140-L150 |
194,028 | rollerworks/search-core | Loader/InputProcessorLoader.php | InputProcessorLoader.create | public static function create(Validator $validator = null): self
{
return new self(
new ClosureContainer(
[
'rollerworks_search.input.json' => function () use ($validator) {
return new Input\JsonInput($validator);
},... | php | public static function create(Validator $validator = null): self
{
return new self(
new ClosureContainer(
[
'rollerworks_search.input.json' => function () use ($validator) {
return new Input\JsonInput($validator);
},... | [
"public",
"static",
"function",
"create",
"(",
"Validator",
"$",
"validator",
"=",
"null",
")",
":",
"self",
"{",
"return",
"new",
"self",
"(",
"new",
"ClosureContainer",
"(",
"[",
"'rollerworks_search.input.json'",
"=>",
"function",
"(",
")",
"use",
"(",
"$... | Create a new InputProcessorLoader with the build-in InputProcessors loadable. | [
"Create",
"a",
"new",
"InputProcessorLoader",
"with",
"the",
"build",
"-",
"in",
"InputProcessors",
"loadable",
"."
] | 6b5671b8c4d6298906ded768261b0a59845140fb | https://github.com/rollerworks/search-core/blob/6b5671b8c4d6298906ded768261b0a59845140fb/Loader/InputProcessorLoader.php#L46-L68 |
194,029 | alphalemon/BootstrapBundle | Core/Json/JsonAutoloaderCollection.php | JsonAutoloaderCollection.load | protected function load()
{
$path = $this->vendorDir . '/composer';
if (!is_dir($path)) throw new InvalidProjectException('"composer" folder has not been found. Be sure to use this bundle on a project managed by Composer');
$map = require $path . '/autoload_namespaces.php';
foreach ... | php | protected function load()
{
$path = $this->vendorDir . '/composer';
if (!is_dir($path)) throw new InvalidProjectException('"composer" folder has not been found. Be sure to use this bundle on a project managed by Composer');
$map = require $path . '/autoload_namespaces.php';
foreach ... | [
"protected",
"function",
"load",
"(",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"vendorDir",
".",
"'/composer'",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"path",
")",
")",
"throw",
"new",
"InvalidProjectException",
"(",
"'\"composer\" folder has not bee... | Loads the bundles when the autoload.json file exists, parsing the autoload_namespaces.php file generated
by composer
@throws InvalidProjectException | [
"Loads",
"the",
"bundles",
"when",
"the",
"autoload",
".",
"json",
"file",
"exists",
"parsing",
"the",
"autoload_namespaces",
".",
"php",
"file",
"generated",
"by",
"composer"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Json/JsonAutoloaderCollection.php#L101-L125 |
194,030 | alphalemon/BootstrapBundle | Core/Json/JsonAutoloaderCollection.php | JsonAutoloaderCollection.parseExtraFolders | protected function parseExtraFolders()
{
foreach ($this->extraFolders as $folder) {
$finder = new Finder();
if (is_dir($folder)) {
$bundleFolders = $finder->directories()->depth(0)->in($folder);
foreach ($bundleFolders as $bundleFolder) {
... | php | protected function parseExtraFolders()
{
foreach ($this->extraFolders as $folder) {
$finder = new Finder();
if (is_dir($folder)) {
$bundleFolders = $finder->directories()->depth(0)->in($folder);
foreach ($bundleFolders as $bundleFolder) {
... | [
"protected",
"function",
"parseExtraFolders",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"extraFolders",
"as",
"$",
"folder",
")",
"{",
"$",
"finder",
"=",
"new",
"Finder",
"(",
")",
";",
"if",
"(",
"is_dir",
"(",
"$",
"folder",
")",
")",
"{",... | parses extra folders to look for autoloaders in different path than the ones
saved into the composer file | [
"parses",
"extra",
"folders",
"to",
"look",
"for",
"autoloaders",
"in",
"different",
"path",
"than",
"the",
"ones",
"saved",
"into",
"the",
"composer",
"file"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Json/JsonAutoloaderCollection.php#L131-L143 |
194,031 | alphalemon/BootstrapBundle | Core/Json/JsonAutoloaderCollection.php | JsonAutoloaderCollection.hasAutoloader | protected function hasAutoloader($path)
{
if (is_dir($path)) {
$finder = new \Symfony\Component\Finder\Finder();
$bundles = $finder->files()->depth(0)->name('autoload.json')->in($path);
if (count($bundles) == 1) {
return true;
}
}
... | php | protected function hasAutoloader($path)
{
if (is_dir($path)) {
$finder = new \Symfony\Component\Finder\Finder();
$bundles = $finder->files()->depth(0)->name('autoload.json')->in($path);
if (count($bundles) == 1) {
return true;
}
}
... | [
"protected",
"function",
"hasAutoloader",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"$",
"finder",
"=",
"new",
"\\",
"Symfony",
"\\",
"Component",
"\\",
"Finder",
"\\",
"Finder",
"(",
")",
";",
"$",
"bundles",
... | Checks if the bundle has an autoloader.json file
@param string $path The bundle's path
@return boolean | [
"Checks",
"if",
"the",
"bundle",
"has",
"an",
"autoloader",
".",
"json",
"file"
] | 27ff5cbc58d58149ec72a974f2a9d765a6fd37a6 | https://github.com/alphalemon/BootstrapBundle/blob/27ff5cbc58d58149ec72a974f2a9d765a6fd37a6/Core/Json/JsonAutoloaderCollection.php#L170-L181 |
194,032 | blainesch/prettyArray | src/prettyArray/PrettyArray.php | PrettyArray.getRange_ | public function getRange_($start, $end) {
$ret = new PrettyArray();
$collecting = false;
$start = (string)$start;
$end = (string)$end;
foreach($this->data as $key => &$value) {
$key = (string)$key;
if($start == $key || $collecting) {
$collecting = true;
$ret->setByReference($key, $value);
if... | php | public function getRange_($start, $end) {
$ret = new PrettyArray();
$collecting = false;
$start = (string)$start;
$end = (string)$end;
foreach($this->data as $key => &$value) {
$key = (string)$key;
if($start == $key || $collecting) {
$collecting = true;
$ret->setByReference($key, $value);
if... | [
"public",
"function",
"getRange_",
"(",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"ret",
"=",
"new",
"PrettyArray",
"(",
")",
";",
"$",
"collecting",
"=",
"false",
";",
"$",
"start",
"=",
"(",
"string",
")",
"$",
"start",
";",
"$",
"end",
"="... | Will get a 'range' from PrettyArray. Calling it destructively will force the return value to be references to the current PrettyArray.
<code>
$arr = new PrettyArray(['swamp', 'desert', 'snow', 'rain', 'fog']);
$arr->getSet(1,3); // [ 1 => desert, 2 => snow, 3 => rain]
</code>
<code>
$arr = new PrettyArray();
$arr['na... | [
"Will",
"get",
"a",
"range",
"from",
"PrettyArray",
".",
"Calling",
"it",
"destructively",
"will",
"force",
"the",
"return",
"value",
"to",
"be",
"references",
"to",
"the",
"current",
"PrettyArray",
"."
] | 2c18672e45a0ed9b67a0e321213c4055d224a334 | https://github.com/blainesch/prettyArray/blob/2c18672e45a0ed9b67a0e321213c4055d224a334/src/prettyArray/PrettyArray.php#L386-L402 |
194,033 | blainesch/prettyArray | src/prettyArray/PrettyArray.php | PrettyArray.key | public function key() {
$keys = array_keys($this->data);
return isset($keys[$this->position]) ? $keys[$this->position] : null;
} | php | public function key() {
$keys = array_keys($this->data);
return isset($keys[$this->position]) ? $keys[$this->position] : null;
} | [
"public",
"function",
"key",
"(",
")",
"{",
"$",
"keys",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"data",
")",
";",
"return",
"isset",
"(",
"$",
"keys",
"[",
"$",
"this",
"->",
"position",
"]",
")",
"?",
"$",
"keys",
"[",
"$",
"this",
"->",
"... | Retrieve the current key. Part of the Iterator interface.
@return null | [
"Retrieve",
"the",
"current",
"key",
".",
"Part",
"of",
"the",
"Iterator",
"interface",
"."
] | 2c18672e45a0ed9b67a0e321213c4055d224a334 | https://github.com/blainesch/prettyArray/blob/2c18672e45a0ed9b67a0e321213c4055d224a334/src/prettyArray/PrettyArray.php#L543-L546 |
194,034 | romm/configuration_object | Classes/Validation/Validator/FileExistsValidator.php | FileExistsValidator.isValid | public function isValid($value)
{
$filePath = GeneralUtility::getFileAbsFileName($value);
if (false === GeneralUtility::getUrl($filePath)) {
$errorMessage = $this->translateErrorMessage('validator.file_exists.not_valid', 'configuration_object', [$value]);
$this->addError($er... | php | public function isValid($value)
{
$filePath = GeneralUtility::getFileAbsFileName($value);
if (false === GeneralUtility::getUrl($filePath)) {
$errorMessage = $this->translateErrorMessage('validator.file_exists.not_valid', 'configuration_object', [$value]);
$this->addError($er... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
")",
"{",
"$",
"filePath",
"=",
"GeneralUtility",
"::",
"getFileAbsFileName",
"(",
"$",
"value",
")",
";",
"if",
"(",
"false",
"===",
"GeneralUtility",
"::",
"getUrl",
"(",
"$",
"filePath",
")",
")",
"{... | Checks if the value is a path to an existing file.
The following syntax is supported: `EXT:my_extension/Path/To/My/File.txt`
@param mixed $value | [
"Checks",
"if",
"the",
"value",
"is",
"a",
"path",
"to",
"an",
"existing",
"file",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Validation/Validator/FileExistsValidator.php#L28-L36 |
194,035 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGP.php | DomCssAndJavascriptByDanielGP.setCssContent | protected function setCssContent($cssContent, $optionalFlags = null)
{
$attr = [];
if (is_null($optionalFlags)) {
$attr['media'] = 'all';
} else {
$knownAttributes = ['media'];
foreach ($knownAttributes as $value) {
if (array_key_exists($va... | php | protected function setCssContent($cssContent, $optionalFlags = null)
{
$attr = [];
if (is_null($optionalFlags)) {
$attr['media'] = 'all';
} else {
$knownAttributes = ['media'];
foreach ($knownAttributes as $value) {
if (array_key_exists($va... | [
"protected",
"function",
"setCssContent",
"(",
"$",
"cssContent",
",",
"$",
"optionalFlags",
"=",
"null",
")",
"{",
"$",
"attr",
"=",
"[",
"]",
";",
"if",
"(",
"is_null",
"(",
"$",
"optionalFlags",
")",
")",
"{",
"$",
"attr",
"[",
"'media'",
"]",
"="... | Returns css codes
@param string $cssContent
@param array $optionalFlags
@return string | [
"Returns",
"css",
"codes"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGP.php#L65-L80 |
194,036 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGP.php | DomCssAndJavascriptByDanielGP.setCssFile | protected function setCssFile($cssFileName, $hostsWithoutCDNrq = null)
{
if (is_null($hostsWithoutCDNrq)) {
$hostsWithoutCDNrq = [];
}
if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) {
return '<link rel="stylesheet" type="text/css" href="'
... | php | protected function setCssFile($cssFileName, $hostsWithoutCDNrq = null)
{
if (is_null($hostsWithoutCDNrq)) {
$hostsWithoutCDNrq = [];
}
if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) {
return '<link rel="stylesheet" type="text/css" href="'
... | [
"protected",
"function",
"setCssFile",
"(",
"$",
"cssFileName",
",",
"$",
"hostsWithoutCDNrq",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"hostsWithoutCDNrq",
")",
")",
"{",
"$",
"hostsWithoutCDNrq",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"in_ar... | Returns css link to a given file
@param string $cssFileName
@return string | [
"Returns",
"css",
"link",
"to",
"a",
"given",
"file"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGP.php#L88-L100 |
194,037 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGP.php | DomCssAndJavascriptByDanielGP.setFormJavascriptFinal | protected function setFormJavascriptFinal($frmId)
{
$cnt = implode(PHP_EOL, [
'$(document).ready(function(){',
'$("form#' . $frmId . '").submit(function(){',
'$("form#' . $frmId . ' input[type=checkbox]").attr("readonly", true);',
'$("form#' . $frmId . ' input... | php | protected function setFormJavascriptFinal($frmId)
{
$cnt = implode(PHP_EOL, [
'$(document).ready(function(){',
'$("form#' . $frmId . '").submit(function(){',
'$("form#' . $frmId . ' input[type=checkbox]").attr("readonly", true);',
'$("form#' . $frmId . ' input... | [
"protected",
"function",
"setFormJavascriptFinal",
"(",
"$",
"frmId",
")",
"{",
"$",
"cnt",
"=",
"implode",
"(",
"PHP_EOL",
",",
"[",
"'$(document).ready(function(){'",
",",
"'$(\"form#'",
".",
"$",
"frmId",
".",
"'\").submit(function(){'",
",",
"'$(\"form#'",
"."... | Builds javascript to avoid multiple form submission
@param string $frmId
@return string | [
"Builds",
"javascript",
"to",
"avoid",
"multiple",
"form",
"submission"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGP.php#L108-L125 |
194,038 | danielgp/common-lib | source/DomCssAndJavascriptByDanielGP.php | DomCssAndJavascriptByDanielGP.setJavascriptFile | protected function setJavascriptFile($jsFileName, $hostsWithoutCDNrq = null)
{
if (is_null($hostsWithoutCDNrq)) {
$hostsWithoutCDNrq = [];
}
if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) {
return '<script type="text/javascript" src="' . filter_var... | php | protected function setJavascriptFile($jsFileName, $hostsWithoutCDNrq = null)
{
if (is_null($hostsWithoutCDNrq)) {
$hostsWithoutCDNrq = [];
}
if (in_array($this->getClientRealIpAddress(), $hostsWithoutCDNrq)) {
return '<script type="text/javascript" src="' . filter_var... | [
"protected",
"function",
"setJavascriptFile",
"(",
"$",
"jsFileName",
",",
"$",
"hostsWithoutCDNrq",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"hostsWithoutCDNrq",
")",
")",
"{",
"$",
"hostsWithoutCDNrq",
"=",
"[",
"]",
";",
"}",
"if",
"(",
... | Returns javascript link to a given file
@param string $jsFileName
@return string | [
"Returns",
"javascript",
"link",
"to",
"a",
"given",
"file"
] | 627b99b4408414c7cd21a6c8016f6468dc9216b2 | https://github.com/danielgp/common-lib/blob/627b99b4408414c7cd21a6c8016f6468dc9216b2/source/DomCssAndJavascriptByDanielGP.php#L180-L191 |
194,039 | AeonDigital/PHP-Collection | src/TypeList.php | TypeList.getStructureType | protected function getStructureType(string $structure, int $lvl) : array
{
$structureType = "";
$dataType = "";
if ($structure === "mixed" || $structure === "?mixed") {
$structureType .= "nullable-";
$structure = "mixed";
} elseif (strpos($structure, "?") ==... | php | protected function getStructureType(string $structure, int $lvl) : array
{
$structureType = "";
$dataType = "";
if ($structure === "mixed" || $structure === "?mixed") {
$structureType .= "nullable-";
$structure = "mixed";
} elseif (strpos($structure, "?") ==... | [
"protected",
"function",
"getStructureType",
"(",
"string",
"$",
"structure",
",",
"int",
"$",
"lvl",
")",
":",
"array",
"{",
"$",
"structureType",
"=",
"\"\"",
";",
"$",
"dataType",
"=",
"\"\"",
";",
"if",
"(",
"$",
"structure",
"===",
"\"mixed\"",
"||"... | Retorna o tipo de estrutura de dados que a string passada representa.
O retorno será um array associativo contendo:
<pre>
"structureType" => [nullable-] type | array
"dataType => type | array-of-types | array-assoc
"internalStructure => Estrutura interna, removendo marcações mais
externas como ?[ ... ... | [
"Retorna",
"o",
"tipo",
"de",
"estrutura",
"de",
"dados",
"que",
"a",
"string",
"passada",
"representa",
"."
] | 8b010e1fada781e7ca86e9f406c18ad7adc6499d | https://github.com/AeonDigital/PHP-Collection/blob/8b010e1fada781e7ca86e9f406c18ad7adc6499d/src/TypeList.php#L413-L457 |
194,040 | SahilDude89ss/PyntaxFramework | src/Pyntax/DAO/Adapter/MySqlAdapter.php | MySqlAdapter.exec | public function exec($sql = "", $bindingValues = array(), $insert = true)
{
//Check if the query is a SELECT|INSERT|UPDATE and :variation is available
if (preg_match("/.*(SELECT|INSERT|UPDATE|SHOW|DELETE).*/", $sql)) {
$this->sql = $sql;
//Always prepare the SQL... | php | public function exec($sql = "", $bindingValues = array(), $insert = true)
{
//Check if the query is a SELECT|INSERT|UPDATE and :variation is available
if (preg_match("/.*(SELECT|INSERT|UPDATE|SHOW|DELETE).*/", $sql)) {
$this->sql = $sql;
//Always prepare the SQL... | [
"public",
"function",
"exec",
"(",
"$",
"sql",
"=",
"\"\"",
",",
"$",
"bindingValues",
"=",
"array",
"(",
")",
",",
"$",
"insert",
"=",
"true",
")",
"{",
"//Check if the query is a SELECT|INSERT|UPDATE and :variation is available",
"if",
"(",
"preg_match",
"(",
... | Executes the current SQL query.
Returns a ASSOC result set.
@param string $sql
@param array $bindingValues
@param bool $insert
@return mixed | [
"Executes",
"the",
"current",
"SQL",
"query",
".",
"Returns",
"a",
"ASSOC",
"result",
"set",
"."
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/DAO/Adapter/MySqlAdapter.php#L96-L140 |
194,041 | SahilDude89ss/PyntaxFramework | src/Pyntax/DAO/Adapter/MySqlAdapter.php | MySqlAdapter.convertWhereToString | protected function convertWhereToString(array $whereArray = array(), $concatenationOperator = " AND ", $assignmentOperator = "=")
{
if (empty($whereArray)) {
return false;
}
$returnWhereStringToken = array();
//Check if the the keys is AND or OR, if yes then use that as... | php | protected function convertWhereToString(array $whereArray = array(), $concatenationOperator = " AND ", $assignmentOperator = "=")
{
if (empty($whereArray)) {
return false;
}
$returnWhereStringToken = array();
//Check if the the keys is AND or OR, if yes then use that as... | [
"protected",
"function",
"convertWhereToString",
"(",
"array",
"$",
"whereArray",
"=",
"array",
"(",
")",
",",
"$",
"concatenationOperator",
"=",
"\" AND \"",
",",
"$",
"assignmentOperator",
"=",
"\"=\"",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"whereArray",
... | This function converts an array into a Where String.
@param array $whereArray
@param string $concatenationOperator
@return bool|string | [
"This",
"function",
"converts",
"an",
"array",
"into",
"a",
"Where",
"String",
"."
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/DAO/Adapter/MySqlAdapter.php#L232-L253 |
194,042 | SahilDude89ss/PyntaxFramework | src/Pyntax/DAO/Adapter/MySqlAdapter.php | MySqlAdapter.getOneResult | public function getOneResult($table, $where = null, $groupBy = null, $orderBy = null)
{
return $this->Select($table, $where, $groupBy, $orderBy, 1);
} | php | public function getOneResult($table, $where = null, $groupBy = null, $orderBy = null)
{
return $this->Select($table, $where, $groupBy, $orderBy, 1);
} | [
"public",
"function",
"getOneResult",
"(",
"$",
"table",
",",
"$",
"where",
"=",
"null",
",",
"$",
"groupBy",
"=",
"null",
",",
"$",
"orderBy",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"Select",
"(",
"$",
"table",
",",
"$",
"where",
",",... | Executes the current SQL query and returns the first result as ASSOC result set
@param $table
@param null $where
@param null $groupBy
@param null $orderBy
@return mixed | [
"Executes",
"the",
"current",
"SQL",
"query",
"and",
"returns",
"the",
"first",
"result",
"as",
"ASSOC",
"result",
"set"
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/DAO/Adapter/MySqlAdapter.php#L265-L268 |
194,043 | SahilDude89ss/PyntaxFramework | src/Pyntax/DAO/Adapter/MySqlAdapter.php | MySqlAdapter.Insert | public function Insert($table, $data = array())
{
if (empty($table) || empty($data)) {
return false;
}
//Before we set the columns, make sure we only use the column that re meant to be filled.
foreach ($data as $key => $val) {
if (empty($val)) {
... | php | public function Insert($table, $data = array())
{
if (empty($table) || empty($data)) {
return false;
}
//Before we set the columns, make sure we only use the column that re meant to be filled.
foreach ($data as $key => $val) {
if (empty($val)) {
... | [
"public",
"function",
"Insert",
"(",
"$",
"table",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"table",
")",
"||",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"return",
"false",
";",
"}",
"//Before we set the col... | Saves the data in the table with a new id;
INSERT INTO tbl_temp2 (fld_id)
SELECT tbl_temp1.fld_order_id
FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100;
@param $table
@param array $data
@return mixed | [
"Saves",
"the",
"data",
"in",
"the",
"table",
"with",
"a",
"new",
"id",
";"
] | 045cca87d24eb2b6405734966c64344e00224c7b | https://github.com/SahilDude89ss/PyntaxFramework/blob/045cca87d24eb2b6405734966c64344e00224c7b/src/Pyntax/DAO/Adapter/MySqlAdapter.php#L364-L400 |
194,044 | squareproton/Bond | src/Bond/Normality/Builder/Repository.php | Repository.getClassExtends | private function getClassExtends()
{
if( $this->isMultiton() ) {
$this->class->addUses('\Bond\Repository\Multiton as RM');
$this->class->addExtends('RM');
} else {
$this->class->addUses('\Bond\Repository as R');
$this->class->addExtends('R');
}... | php | private function getClassExtends()
{
if( $this->isMultiton() ) {
$this->class->addUses('\Bond\Repository\Multiton as RM');
$this->class->addExtends('RM');
} else {
$this->class->addUses('\Bond\Repository as R');
$this->class->addExtends('R');
}... | [
"private",
"function",
"getClassExtends",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isMultiton",
"(",
")",
")",
"{",
"$",
"this",
"->",
"class",
"->",
"addUses",
"(",
"'\\Bond\\Repository\\Multiton as RM'",
")",
";",
"$",
"this",
"->",
"class",
"->",
... | Class to extend
@return string | [
"Class",
"to",
"extend"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Repository.php#L96-L106 |
194,045 | squareproton/Bond | src/Bond/Normality/Builder/Repository.php | Repository.getClassConstants | private function getClassConstants()
{
$pgClass = $this->entity->pgClass;
$this->class->classComponents[] = new ClassConstant(
'TABLE',
new Sformatf( "const TABLE = '%s';", $pgClass->getFullyQualifiedName() )
);
$this->class->classComponents[] = new ClassCons... | php | private function getClassConstants()
{
$pgClass = $this->entity->pgClass;
$this->class->classComponents[] = new ClassConstant(
'TABLE',
new Sformatf( "const TABLE = '%s';", $pgClass->getFullyQualifiedName() )
);
$this->class->classComponents[] = new ClassCons... | [
"private",
"function",
"getClassConstants",
"(",
")",
"{",
"$",
"pgClass",
"=",
"$",
"this",
"->",
"entity",
"->",
"pgClass",
";",
"$",
"this",
"->",
"class",
"->",
"classComponents",
"[",
"]",
"=",
"new",
"ClassConstant",
"(",
"'TABLE'",
",",
"new",
"Sf... | Get class constants | [
"Get",
"class",
"constants"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Repository.php#L111-L126 |
194,046 | squareproton/Bond | src/Bond/Normality/Builder/Repository.php | Repository.setClassComment | private function setClassComment()
{
$connectionSettings = $this->entity->pgClass->getCatalog()->db->resource->connectionSettings;
$header = new Sformatf( <<<TEXT
ConnectionInfo %s@%s:%s,
Relation %s
TEXT
, $connectionSettings->dbname,
$connectionSet... | php | private function setClassComment()
{
$connectionSettings = $this->entity->pgClass->getCatalog()->db->resource->connectionSettings;
$header = new Sformatf( <<<TEXT
ConnectionInfo %s@%s:%s,
Relation %s
TEXT
, $connectionSettings->dbname,
$connectionSet... | [
"private",
"function",
"setClassComment",
"(",
")",
"{",
"$",
"connectionSettings",
"=",
"$",
"this",
"->",
"entity",
"->",
"pgClass",
"->",
"getCatalog",
"(",
")",
"->",
"db",
"->",
"resource",
"->",
"connectionSettings",
";",
"$",
"header",
"=",
"new",
"... | Entity generated Headers
@return array Headers | [
"Entity",
"generated",
"Headers"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Repository.php#L132-L149 |
194,047 | squareproton/Bond | src/Bond/Normality/Builder/Repository.php | Repository.getOptionsResolverFunctionDeclaration | private function getOptionsResolverFunctionDeclaration()
{
// get required properties
$required = [];
$optional = [];
$allowedValues = [];
// optional
foreach( $this->entity->dataTypes as $name => $dataType ) {
// is required
if( !$dataType-... | php | private function getOptionsResolverFunctionDeclaration()
{
// get required properties
$required = [];
$optional = [];
$allowedValues = [];
// optional
foreach( $this->entity->dataTypes as $name => $dataType ) {
// is required
if( !$dataType-... | [
"private",
"function",
"getOptionsResolverFunctionDeclaration",
"(",
")",
"{",
"// get required properties",
"$",
"required",
"=",
"[",
"]",
";",
"$",
"optional",
"=",
"[",
"]",
";",
"$",
"allowedValues",
"=",
"[",
"]",
";",
"// optional",
"foreach",
"(",
"$",... | Generate a get Options Resolver component for the enity | [
"Generate",
"a",
"get",
"Options",
"Resolver",
"component",
"for",
"the",
"enity"
] | a04ad9dd1a35adeaec98237716c2a41ce02b4f1a | https://github.com/squareproton/Bond/blob/a04ad9dd1a35adeaec98237716c2a41ce02b4f1a/src/Bond/Normality/Builder/Repository.php#L504-L601 |
194,048 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssParser.getAndClearBuffer | public function getAndClearBuffer($trim = "", $tolower = false)
{
$r = $this->getBuffer($trim, $tolower);
$this->buffer = "";
return $r;
} | php | public function getAndClearBuffer($trim = "", $tolower = false)
{
$r = $this->getBuffer($trim, $tolower);
$this->buffer = "";
return $r;
} | [
"public",
"function",
"getAndClearBuffer",
"(",
"$",
"trim",
"=",
"\"\"",
",",
"$",
"tolower",
"=",
"false",
")",
"{",
"$",
"r",
"=",
"$",
"this",
"->",
"getBuffer",
"(",
"$",
"trim",
",",
"$",
"tolower",
")",
";",
"$",
"this",
"->",
"buffer",
"=",... | Returns and clear the current buffer.
@param string $trim Chars to use to trim the returned buffer
@param boolean $tolower if TRUE the returned buffer will get converted to lower case
@return string | [
"Returns",
"and",
"clear",
"the",
"current",
"buffer",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L1502-L1507 |
194,049 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssParser.getPlugin | public function getPlugin($class)
{
static $index = null;
if (is_null($index))
{
$index = array();
for ($i = 0, $l = count($this->plugins); $i < $l; $i++)
{
$index[get_class($this->plugins[$i])] = $i;
}
}
return isset($index[$class]) ? $this->plugins[$index[$class]] : false;
... | php | public function getPlugin($class)
{
static $index = null;
if (is_null($index))
{
$index = array();
for ($i = 0, $l = count($this->plugins); $i < $l; $i++)
{
$index[get_class($this->plugins[$i])] = $i;
}
}
return isset($index[$class]) ? $this->plugins[$index[$class]] : false;
... | [
"public",
"function",
"getPlugin",
"(",
"$",
"class",
")",
"{",
"static",
"$",
"index",
"=",
"null",
";",
"if",
"(",
"is_null",
"(",
"$",
"index",
")",
")",
"{",
"$",
"index",
"=",
"array",
"(",
")",
";",
"for",
"(",
"$",
"i",
"=",
"0",
",",
... | Returns a plugin by class name.
@param string $name Class name of the plugin
@return aCssParserPlugin | [
"Returns",
"a",
"plugin",
"by",
"class",
"name",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L1561-L1573 |
194,050 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssParser.popState | public function popState()
{
$r = array_pop($this->states);
$this->state = $this->states[count($this->states) - 1];
return $r;
} | php | public function popState()
{
$r = array_pop($this->states);
$this->state = $this->states[count($this->states) - 1];
return $r;
} | [
"public",
"function",
"popState",
"(",
")",
"{",
"$",
"r",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"states",
")",
";",
"$",
"this",
"->",
"state",
"=",
"$",
"this",
"->",
"states",
"[",
"count",
"(",
"$",
"this",
"->",
"states",
")",
"-",
"1",
... | Remove the last state of the state stack and return the removed stack value.
@return integer Removed state value | [
"Remove",
"the",
"last",
"state",
"of",
"the",
"state",
"stack",
"and",
"return",
"the",
"removed",
"stack",
"value",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L1713-L1718 |
194,051 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssParser.pushState | public function pushState($state)
{
$r = array_push($this->states, $state);
$this->state = $this->states[count($this->states) - 1];
return $r;
} | php | public function pushState($state)
{
$r = array_push($this->states, $state);
$this->state = $this->states[count($this->states) - 1];
return $r;
} | [
"public",
"function",
"pushState",
"(",
"$",
"state",
")",
"{",
"$",
"r",
"=",
"array_push",
"(",
"$",
"this",
"->",
"states",
",",
"$",
"state",
")",
";",
"$",
"this",
"->",
"state",
"=",
"$",
"this",
"->",
"states",
"[",
"count",
"(",
"$",
"thi... | Adds a new state onto the state stack.
@param integer $state State to add onto the state stack.
@return integer The index of the added state in the state stacks | [
"Adds",
"a",
"new",
"state",
"onto",
"the",
"state",
"stack",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L1725-L1730 |
194,052 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssMinifier.minify | public function minify($source)
{
// Variables
$r = "";
$parser = new CssParser($source);
$tokens = $parser->getTokens();
$filters = $this->filters;
$filterCount = count($this->filters);
$plugins = $this->plugins;
$pluginCount = count($plugins);
$pluginIndex = arr... | php | public function minify($source)
{
// Variables
$r = "";
$parser = new CssParser($source);
$tokens = $parser->getTokens();
$filters = $this->filters;
$filterCount = count($this->filters);
$plugins = $this->plugins;
$pluginCount = count($plugins);
$pluginIndex = arr... | [
"public",
"function",
"minify",
"(",
"$",
"source",
")",
"{",
"// Variables\r",
"$",
"r",
"=",
"\"\"",
";",
"$",
"parser",
"=",
"new",
"CssParser",
"(",
"$",
"source",
")",
";",
"$",
"tokens",
"=",
"$",
"parser",
"->",
"getTokens",
"(",
")",
";",
"... | Minifies the CSS source.
@param string $source CSS source
@return string | [
"Minifies",
"the",
"CSS",
"source",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L2058-L2127 |
194,053 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssMin.initialise | public static function initialise()
{
// Create the class index for autoloading or including
$paths = array(dirname(__FILE__));
while (list($i, $path) = each($paths))
{
$subDirectorys = glob($path . "*", GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
if (is_array($subDirectorys))
{
foreach (... | php | public static function initialise()
{
// Create the class index for autoloading or including
$paths = array(dirname(__FILE__));
while (list($i, $path) = each($paths))
{
$subDirectorys = glob($path . "*", GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
if (is_array($subDirectorys))
{
foreach (... | [
"public",
"static",
"function",
"initialise",
"(",
")",
"{",
"// Create the class index for autoloading or including\r",
"$",
"paths",
"=",
"array",
"(",
"dirname",
"(",
"__FILE__",
")",
")",
";",
"while",
"(",
"list",
"(",
"$",
"i",
",",
"$",
"path",
")",
"... | Initialises CssMin.
@return void | [
"Initialises",
"CssMin",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L2218-L2260 |
194,054 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssMin.minify | public static function minify($source, array $filters = null, array $plugins = null)
{
self::$errors = array();
$minifier = new CssMinifier($source, $filters, $plugins);
return $minifier->getMinified();
} | php | public static function minify($source, array $filters = null, array $plugins = null)
{
self::$errors = array();
$minifier = new CssMinifier($source, $filters, $plugins);
return $minifier->getMinified();
} | [
"public",
"static",
"function",
"minify",
"(",
"$",
"source",
",",
"array",
"$",
"filters",
"=",
"null",
",",
"array",
"$",
"plugins",
"=",
"null",
")",
"{",
"self",
"::",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"minifier",
"=",
"new",
"Cs... | Minifies CSS source.
@param string $source CSS source
@param array $filters Filter configuration [optional]
@param array $plugins Plugin configuration [optional]
@return string Minified CSS | [
"Minifies",
"CSS",
"source",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L2269-L2274 |
194,055 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssMin.parse | public static function parse($source, array $plugins = null)
{
self::$errors = array();
$parser = new CssParser($source, $plugins);
return $parser->getTokens();
} | php | public static function parse($source, array $plugins = null)
{
self::$errors = array();
$parser = new CssParser($source, $plugins);
return $parser->getTokens();
} | [
"public",
"static",
"function",
"parse",
"(",
"$",
"source",
",",
"array",
"$",
"plugins",
"=",
"null",
")",
"{",
"self",
"::",
"$",
"errors",
"=",
"array",
"(",
")",
";",
"$",
"parser",
"=",
"new",
"CssParser",
"(",
"$",
"source",
",",
"$",
"plugi... | Parse the CSS source.
@param string $source CSS source
@param array $plugins Plugin configuration [optional]
@return array Array of aCssToken | [
"Parse",
"the",
"CSS",
"source",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L2282-L2287 |
194,056 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssConvertHslColorsMinifierPlugin.hsl2hex | private function hsl2hex($hue, $saturation, $lightness)
{
$hue = $hue / 360;
$saturation = $saturation / 100;
$lightness = $lightness / 100;
if ($saturation == 0)
{
$red = $lightness * 255;
$green = $lightness * 255;
$blue = $lightness * 255;
}
else
{
if ($lightness < 0.5 ... | php | private function hsl2hex($hue, $saturation, $lightness)
{
$hue = $hue / 360;
$saturation = $saturation / 100;
$lightness = $lightness / 100;
if ($saturation == 0)
{
$red = $lightness * 255;
$green = $lightness * 255;
$blue = $lightness * 255;
}
else
{
if ($lightness < 0.5 ... | [
"private",
"function",
"hsl2hex",
"(",
"$",
"hue",
",",
"$",
"saturation",
",",
"$",
"lightness",
")",
"{",
"$",
"hue",
"=",
"$",
"hue",
"/",
"360",
";",
"$",
"saturation",
"=",
"$",
"saturation",
"/",
"100",
";",
"$",
"lightness",
"=",
"$",
"light... | Convert a HSL value to hexadecimal notation.
Based on: {@link http://www.easyrgb.com/index.php?X=MATH&H=19#text19}.
@param integer $hue Hue
@param integer $saturation Saturation
@param integer $lightness Lightnesss
@return string | [
"Convert",
"a",
"HSL",
"value",
"to",
"hexadecimal",
"notation",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L3442-L3469 |
194,057 | crodas/SimpleAssetManager | lib/crodas/Contrib/cssmin-v3.0.1.php | CssConvertHslColorsMinifierPlugin.hue2rgb | private function hue2rgb($v1, $v2, $hue)
{
if ($hue < 0)
{
$hue += 1;
}
if ($hue > 1)
{
$hue -= 1;
}
if ((6 * $hue) < 1)
{
return ($v1 + ($v2 - $v1) * 6 * $hue);
}
if ((2 * $hue) < 1)
{
return ($v2);
}
if ((3 * $hue) < 2)
{
return ($v1 + ($v2 - $... | php | private function hue2rgb($v1, $v2, $hue)
{
if ($hue < 0)
{
$hue += 1;
}
if ($hue > 1)
{
$hue -= 1;
}
if ((6 * $hue) < 1)
{
return ($v1 + ($v2 - $v1) * 6 * $hue);
}
if ((2 * $hue) < 1)
{
return ($v2);
}
if ((3 * $hue) < 2)
{
return ($v1 + ($v2 - $... | [
"private",
"function",
"hue2rgb",
"(",
"$",
"v1",
",",
"$",
"v2",
",",
"$",
"hue",
")",
"{",
"if",
"(",
"$",
"hue",
"<",
"0",
")",
"{",
"$",
"hue",
"+=",
"1",
";",
"}",
"if",
"(",
"$",
"hue",
">",
"1",
")",
"{",
"$",
"hue",
"-=",
"1",
"... | Apply hue to a rgb color value.
@param integer $v1 Value 1
@param integer $v2 Value 2
@param integer $hue Hue
@return integer | [
"Apply",
"hue",
"to",
"a",
"rgb",
"color",
"value",
"."
] | a81661cc5739fa15c0ed7b6809b392b955c26401 | https://github.com/crodas/SimpleAssetManager/blob/a81661cc5739fa15c0ed7b6809b392b955c26401/lib/crodas/Contrib/cssmin-v3.0.1.php#L3478-L3501 |
194,058 | praxigento/mobi_mod_downline | Repo/Dao/Change.php | Change.getChangelogMinDate | public function getChangelogMinDate()
{
$result = null;
$asChange = 'c';
$tblChange = $this->resource->getTableName(EChange::ENTITY_NAME);
/* select from account */
$query = $this->conn->select();
$query->from([$asChange => $tblChange], [EChange::A_DATE_CHANGED]);
... | php | public function getChangelogMinDate()
{
$result = null;
$asChange = 'c';
$tblChange = $this->resource->getTableName(EChange::ENTITY_NAME);
/* select from account */
$query = $this->conn->select();
$query->from([$asChange => $tblChange], [EChange::A_DATE_CHANGED]);
... | [
"public",
"function",
"getChangelogMinDate",
"(",
")",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"asChange",
"=",
"'c'",
";",
"$",
"tblChange",
"=",
"$",
"this",
"->",
"resource",
"->",
"getTableName",
"(",
"EChange",
"::",
"ENTITY_NAME",
")",
";",
"/* ... | Select MIN date for the existing change log.
SELECT
`c`.`date_changed`
FROM `prxgt_dwnl_change` AS `c`
ORDER BY `c`.`date_changed` ASC
@return string|null | [
"Select",
"MIN",
"date",
"for",
"the",
"existing",
"change",
"log",
"."
] | 0f3c276dfff1aa029f9fd205ccfc56f207a2e75b | https://github.com/praxigento/mobi_mod_downline/blob/0f3c276dfff1aa029f9fd205ccfc56f207a2e75b/Repo/Dao/Change.php#L54-L70 |
194,059 | modulusphp/utility | Accessor.php | Accessor.requireView | public static function requireView() : void
{
$medusa = new Medusa(self::$viewsEngine);
$medusa->setCacheDirectory(self::$viewsCache);
$medusa->setViewsDirectory(self::$viewsDirectory);
$medusa->setViewsExtension(self::$viewsExtension);
$medusa->register(Partial::class);
$medusa->register(Us... | php | public static function requireView() : void
{
$medusa = new Medusa(self::$viewsEngine);
$medusa->setCacheDirectory(self::$viewsCache);
$medusa->setViewsDirectory(self::$viewsDirectory);
$medusa->setViewsExtension(self::$viewsExtension);
$medusa->register(Partial::class);
$medusa->register(Us... | [
"public",
"static",
"function",
"requireView",
"(",
")",
":",
"void",
"{",
"$",
"medusa",
"=",
"new",
"Medusa",
"(",
"self",
"::",
"$",
"viewsEngine",
")",
";",
"$",
"medusa",
"->",
"setCacheDirectory",
"(",
"self",
"::",
"$",
"viewsCache",
")",
";",
"... | Create a new Medusa Object
@return void | [
"Create",
"a",
"new",
"Medusa",
"Object"
] | c1e127539b13d3ec8381e41c64b881e0701807f5 | https://github.com/modulusphp/utility/blob/c1e127539b13d3ec8381e41c64b881e0701807f5/Accessor.php#L62-L82 |
194,060 | erenmustafaozdal/laravel-modules-base | src/Exceptions/Handler.php | Handler.getEmailDatas | private function getEmailDatas($request, $e)
{
$session = $request->session()->all();
return [
'date' => Carbon::now()->format('d.m.Y H:i:s'),
'rUser' => $request->user(),
'rSessionOld' => isset($session['flash']) ? $session['flash']['old'] : []... | php | private function getEmailDatas($request, $e)
{
$session = $request->session()->all();
return [
'date' => Carbon::now()->format('d.m.Y H:i:s'),
'rUser' => $request->user(),
'rSessionOld' => isset($session['flash']) ? $session['flash']['old'] : []... | [
"private",
"function",
"getEmailDatas",
"(",
"$",
"request",
",",
"$",
"e",
")",
"{",
"$",
"session",
"=",
"$",
"request",
"->",
"session",
"(",
")",
"->",
"all",
"(",
")",
";",
"return",
"[",
"'date'",
"=>",
"Carbon",
"::",
"now",
"(",
")",
"->",
... | get error email datas
@param \Illuminate\Http\Request $request
@param Exception $e
@return array | [
"get",
"error",
"email",
"datas"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Exceptions/Handler.php#L89-L112 |
194,061 | horntell/php-sdk | src/Horntell/Campaign.php | Campaign.toProfiles | public function toProfiles($profiles, $campaignId, $meta = [])
{
$data = ['profile_uids' => $profiles, 'meta' => $meta];
return $this->request->send('POST', "profiles/campaigns/$campaignId", $data);
} | php | public function toProfiles($profiles, $campaignId, $meta = [])
{
$data = ['profile_uids' => $profiles, 'meta' => $meta];
return $this->request->send('POST', "profiles/campaigns/$campaignId", $data);
} | [
"public",
"function",
"toProfiles",
"(",
"$",
"profiles",
",",
"$",
"campaignId",
",",
"$",
"meta",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"[",
"'profile_uids'",
"=>",
"$",
"profiles",
",",
"'meta'",
"=>",
"$",
"meta",
"]",
";",
"return",
"$",
... | Triggers campaign for multiple profiles
@param array $profiles
@param string $campaignId
@param array $meta
@return Horntell\Http\Response | [
"Triggers",
"campaign",
"for",
"multiple",
"profiles"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Campaign.php#L41-L46 |
194,062 | horntell/php-sdk | src/Horntell/Campaign.php | Campaign.toChannels | public function toChannels($channels, $campaignId, $meta = [])
{
$data = ['channel_uids' => $channels, 'meta' => $meta];
return $this->request->send('POST', "channels/campaigns/$campaignId", $data);
} | php | public function toChannels($channels, $campaignId, $meta = [])
{
$data = ['channel_uids' => $channels, 'meta' => $meta];
return $this->request->send('POST', "channels/campaigns/$campaignId", $data);
} | [
"public",
"function",
"toChannels",
"(",
"$",
"channels",
",",
"$",
"campaignId",
",",
"$",
"meta",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"[",
"'channel_uids'",
"=>",
"$",
"channels",
",",
"'meta'",
"=>",
"$",
"meta",
"]",
";",
"return",
"$",
... | Triggers campaign for multiple channels
@param array $channels
@param string $campaignId
@param array $meta
@return Horntell\Http\Response | [
"Triggers",
"campaign",
"for",
"multiple",
"channels"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/src/Horntell/Campaign.php#L69-L74 |
194,063 | PenoaksDev/Milky-Framework | src/Milky/Pagination/LengthAwarePaginator.php | LengthAwarePaginator.nextPageUrl | public function nextPageUrl()
{
if ( $this->lastPage() > $this->currentPage() )
return $this->url( $this->currentPage() + 1 );
return null;
} | php | public function nextPageUrl()
{
if ( $this->lastPage() > $this->currentPage() )
return $this->url( $this->currentPage() + 1 );
return null;
} | [
"public",
"function",
"nextPageUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lastPage",
"(",
")",
">",
"$",
"this",
"->",
"currentPage",
"(",
")",
")",
"return",
"$",
"this",
"->",
"url",
"(",
"$",
"this",
"->",
"currentPage",
"(",
")",
"+",
... | Get the URL for the next page.
@return string|null | [
"Get",
"the",
"URL",
"for",
"the",
"next",
"page",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Pagination/LengthAwarePaginator.php#L69-L75 |
194,064 | PenoaksDev/Milky-Framework | src/Milky/Pagination/LengthAwarePaginator.php | LengthAwarePaginator.render | public function render( Presenter $presenter = null )
{
if ( is_null( $presenter ) && static::$presenterResolver )
$presenter = call_user_func( static::$presenterResolver, $this );
$presenter = $presenter ?: new BootstrapThreePresenter( $this );
return $presenter->render();
} | php | public function render( Presenter $presenter = null )
{
if ( is_null( $presenter ) && static::$presenterResolver )
$presenter = call_user_func( static::$presenterResolver, $this );
$presenter = $presenter ?: new BootstrapThreePresenter( $this );
return $presenter->render();
} | [
"public",
"function",
"render",
"(",
"Presenter",
"$",
"presenter",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"presenter",
")",
"&&",
"static",
"::",
"$",
"presenterResolver",
")",
"$",
"presenter",
"=",
"call_user_func",
"(",
"static",
"::",
... | Render the paginator using the given presenter.
@param Presenter|null $presenter
@return string | [
"Render",
"the",
"paginator",
"using",
"the",
"given",
"presenter",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Pagination/LengthAwarePaginator.php#L124-L132 |
194,065 | mullanaphy/variable | src/PHY/Variable/Str.php | Str.pad | public function pad($pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
{
$string = $this->get();
$value = str_pad($string, $pad_length, $pad_string, $pad_type);
$this->update($value);
return $this;
} | php | public function pad($pad_length, $pad_string = ' ', $pad_type = STR_PAD_RIGHT)
{
$string = $this->get();
$value = str_pad($string, $pad_length, $pad_string, $pad_type);
$this->update($value);
return $this;
} | [
"public",
"function",
"pad",
"(",
"$",
"pad_length",
",",
"$",
"pad_string",
"=",
"' '",
",",
"$",
"pad_type",
"=",
"STR_PAD_RIGHT",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"$",
"value",
"=",
"str_pad",
"(",
"$",
"str... | Pad a string.
@param int $pad_length
@param string $pad_string
@param int $pad_type
@return \PHY\Variable\Str | [
"Pad",
"a",
"string",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/Str.php#L83-L89 |
194,066 | mullanaphy/variable | src/PHY/Variable/Str.php | Str.rot13 | public function rot13()
{
$string = $this->get();
$value = str_rot13($string);
$this->update($value);
return $this;
} | php | public function rot13()
{
$string = $this->get();
$value = str_rot13($string);
$this->update($value);
return $this;
} | [
"public",
"function",
"rot13",
"(",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"$",
"value",
"=",
"str_rot13",
"(",
"$",
"string",
")",
";",
"$",
"this",
"->",
"update",
"(",
"$",
"value",
")",
";",
"return",
"$",
"t... | Performs the ROT13 encoding on the str argument and returns the
resulting string.
The ROT13 encoding simply shifts every letter by 13 places in the
alphabet while leaving non-alpha characters untouched. Encoding and
decoding are done by the same function, passing an encoded string as
argument will return the original ... | [
"Performs",
"the",
"ROT13",
"encoding",
"on",
"the",
"str",
"argument",
"and",
"returns",
"the",
"resulting",
"string",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/Str.php#L104-L110 |
194,067 | mullanaphy/variable | src/PHY/Variable/Str.php | Str.shuffle | public function shuffle()
{
$string = $this->get();
$value = str_shuffle($string);
$this->update($value);
return $this;
} | php | public function shuffle()
{
$string = $this->get();
$value = str_shuffle($string);
$this->update($value);
return $this;
} | [
"public",
"function",
"shuffle",
"(",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"$",
"value",
"=",
"str_shuffle",
"(",
"$",
"string",
")",
";",
"$",
"this",
"->",
"update",
"(",
"$",
"value",
")",
";",
"return",
"$",
... | Randomly shuffles the string.
@return \PHY\Variable\Str | [
"Randomly",
"shuffles",
"the",
"string",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/Str.php#L117-L123 |
194,068 | mullanaphy/variable | src/PHY/Variable/Str.php | Str.possessive | public function possessive()
{
$string = $this->get();
$value = $string."'".(
's' !== substr($string, -1)
? 's'
: null
);
$this->update($value);
return $this;
} | php | public function possessive()
{
$string = $this->get();
$value = $string."'".(
's' !== substr($string, -1)
? 's'
: null
);
$this->update($value);
return $this;
} | [
"public",
"function",
"possessive",
"(",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"$",
"value",
"=",
"$",
"string",
".",
"\"'\"",
".",
"(",
"'s'",
"!==",
"substr",
"(",
"$",
"string",
",",
"-",
"1",
")",
"?",
"'s'"... | Get the possessive version of a string.
@return \PHY\Variable\Str | [
"Get",
"the",
"possessive",
"version",
"of",
"a",
"string",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/Str.php#L163-L173 |
194,069 | mullanaphy/variable | src/PHY/Variable/Str.php | Str.toShorten | public function toShorten($length = 32, $truncate = false)
{
$string = $this->get();
if (is_bool($length)) {
$truncate = $length;
$length = 32;
} else {
$length = (int)$length;
}
if (strlen($... | php | public function toShorten($length = 32, $truncate = false)
{
$string = $this->get();
if (is_bool($length)) {
$truncate = $length;
$length = 32;
} else {
$length = (int)$length;
}
if (strlen($... | [
"public",
"function",
"toShorten",
"(",
"$",
"length",
"=",
"32",
",",
"$",
"truncate",
"=",
"false",
")",
"{",
"$",
"string",
"=",
"$",
"this",
"->",
"get",
"(",
")",
";",
"if",
"(",
"is_bool",
"(",
"$",
"length",
")",
")",
"{",
"$",
"truncate",... | Shorten a string.
@param int $length
@param bool $truncate
@return string | [
"Shorten",
"a",
"string",
"."
] | e4eb274a1799a25e33e5e21cd260603c74628031 | https://github.com/mullanaphy/variable/blob/e4eb274a1799a25e33e5e21cd260603c74628031/src/PHY/Variable/Str.php#L200-L229 |
194,070 | Vectrex/vxPHP | src/Database/AbstractPdoAdapter.php | AbstractPdoAdapter.primeQuery | protected function primeQuery($statementString, array $parameters) {
$statement = $this->connection->prepare($statementString);
foreach($parameters as $name => $value) {
// question mark placeholders start with 1
if(is_int($name)) {
++$name;
}
// otherwise ensure colons
else {
$na... | php | protected function primeQuery($statementString, array $parameters) {
$statement = $this->connection->prepare($statementString);
foreach($parameters as $name => $value) {
// question mark placeholders start with 1
if(is_int($name)) {
++$name;
}
// otherwise ensure colons
else {
$na... | [
"protected",
"function",
"primeQuery",
"(",
"$",
"statementString",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"connection",
"->",
"prepare",
"(",
"$",
"statementString",
")",
";",
"foreach",
"(",
"$",
"parameters",
... | prepare a statement and bind parameters
@param string $statementString
@param array $parameters
@return \PDOStatement | [
"prepare",
"a",
"statement",
"and",
"bind",
"parameters"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Database/AbstractPdoAdapter.php#L830-L884 |
194,071 | theomessin/ts-framework | src/Node/Channelgroup.php | Channelgroup.message | public function message($msg)
{
foreach ($this as $client) {
try {
$this->execute(
"sendtextmessage",
array("msg" => $msg, "target" => $client, "targetmode" => Teamspeak::TEXTMSG_CLIENT)
);
} catch (TeamSpeak3_Ad... | php | public function message($msg)
{
foreach ($this as $client) {
try {
$this->execute(
"sendtextmessage",
array("msg" => $msg, "target" => $client, "targetmode" => Teamspeak::TEXTMSG_CLIENT)
);
} catch (TeamSpeak3_Ad... | [
"public",
"function",
"message",
"(",
"$",
"msg",
")",
"{",
"foreach",
"(",
"$",
"this",
"as",
"$",
"client",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"execute",
"(",
"\"sendtextmessage\"",
",",
"array",
"(",
"\"msg\"",
"=>",
"$",
"msg",
",",
"\"targ... | Sends a text message to all clients residing in the channel group on the virtual server.
@param string $msg
@return void | [
"Sends",
"a",
"text",
"message",
"to",
"all",
"clients",
"residing",
"in",
"the",
"channel",
"group",
"on",
"the",
"virtual",
"server",
"."
] | d60e36553241db05cb05ef19e749866cc977437c | https://github.com/theomessin/ts-framework/blob/d60e36553241db05cb05ef19e749866cc977437c/src/Node/Channelgroup.php#L198-L213 |
194,072 | gingerwfms/ginger-core | src/GingerCore/Repository/Adapter/ZendDbCrudRepositoryAdapter.php | ZendDbCrudRepositoryAdapter.getTablegateway | protected function getTablegateway(Resource\ResourceType $resourceType)
{
$type = $resourceType->getValue();
if (!isset($this->tableGateways[$type])) {
$this->tableGateways[$type] = new TableGateway($type, $this->zendDbAdapter);
}
return $this->tableGate... | php | protected function getTablegateway(Resource\ResourceType $resourceType)
{
$type = $resourceType->getValue();
if (!isset($this->tableGateways[$type])) {
$this->tableGateways[$type] = new TableGateway($type, $this->zendDbAdapter);
}
return $this->tableGate... | [
"protected",
"function",
"getTablegateway",
"(",
"Resource",
"\\",
"ResourceType",
"$",
"resourceType",
")",
"{",
"$",
"type",
"=",
"$",
"resourceType",
"->",
"getValue",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"tableGateways",
"[",... | Get the corresponding Tablegateway of the given ResourceType
@param Resource\ResourceType $resourceType
@return TableGateway | [
"Get",
"the",
"corresponding",
"Tablegateway",
"of",
"the",
"given",
"ResourceType"
] | 178e699dd1a912ec7b8b4e21f7de51edd2a1c1e8 | https://github.com/gingerwfms/ginger-core/blob/178e699dd1a912ec7b8b4e21f7de51edd2a1c1e8/src/GingerCore/Repository/Adapter/ZendDbCrudRepositoryAdapter.php#L195-L204 |
194,073 | RocketPropelledTortoise/Core | src/Utilities/ParentChildTree.php | ParentChildTree.buildTree | protected function buildTree($tree_data)
{
$parent_key = $this->config['parent'];
$default_root_id = $this->config['default_root_id'];
while (count($tree_data)) {
$beginning_with = count($tree_data);
foreach ($tree_data as $node_id => $node) {
$node[... | php | protected function buildTree($tree_data)
{
$parent_key = $this->config['parent'];
$default_root_id = $this->config['default_root_id'];
while (count($tree_data)) {
$beginning_with = count($tree_data);
foreach ($tree_data as $node_id => $node) {
$node[... | [
"protected",
"function",
"buildTree",
"(",
"$",
"tree_data",
")",
"{",
"$",
"parent_key",
"=",
"$",
"this",
"->",
"config",
"[",
"'parent'",
"]",
";",
"$",
"default_root_id",
"=",
"$",
"this",
"->",
"config",
"[",
"'default_root_id'",
"]",
";",
"while",
... | Build the tree from the received data
@param array $tree_data The raw data to create a tree from
@throws \Exception | [
"Build",
"the",
"tree",
"from",
"the",
"received",
"data"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Utilities/ParentChildTree.php#L66-L84 |
194,074 | RocketPropelledTortoise/Core | src/Utilities/ParentChildTree.php | ParentChildTree.ungracefulExit | protected function ungracefulExit($beginning_with, $tree_data)
{
if ($beginning_with == count($tree_data)) {
throw new \Exception('This tree has some missing parent items: ' . print_r($tree_data, true));
}
} | php | protected function ungracefulExit($beginning_with, $tree_data)
{
if ($beginning_with == count($tree_data)) {
throw new \Exception('This tree has some missing parent items: ' . print_r($tree_data, true));
}
} | [
"protected",
"function",
"ungracefulExit",
"(",
"$",
"beginning_with",
",",
"$",
"tree_data",
")",
"{",
"if",
"(",
"$",
"beginning_with",
"==",
"count",
"(",
"$",
"tree_data",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'This tree has some missing ... | Exit the tree creation if the tree can't be built completely
@param int $beginning_with The number of nodes left to place on the tree
@param array $tree_data The rest of the tree data to place
@throws \Exception | [
"Exit",
"the",
"tree",
"creation",
"if",
"the",
"tree",
"can",
"t",
"be",
"built",
"completely"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Utilities/ParentChildTree.php#L93-L98 |
194,075 | RocketPropelledTortoise/Core | src/Utilities/ParentChildTree.php | ParentChildTree.add | public function add($parent_id, $node_id, $node)
{
//is it a root ?
if (in_array($parent_id, $this->config['default_parent'])) {
if (!$this->config['create_root']) {
$this->tree[$node_id] = $node;
$this->finder[$node_id] = &$this->tree[$node_id];
... | php | public function add($parent_id, $node_id, $node)
{
//is it a root ?
if (in_array($parent_id, $this->config['default_parent'])) {
if (!$this->config['create_root']) {
$this->tree[$node_id] = $node;
$this->finder[$node_id] = &$this->tree[$node_id];
... | [
"public",
"function",
"add",
"(",
"$",
"parent_id",
",",
"$",
"node_id",
",",
"$",
"node",
")",
"{",
"//is it a root ?",
"if",
"(",
"in_array",
"(",
"$",
"parent_id",
",",
"$",
"this",
"->",
"config",
"[",
"'default_parent'",
"]",
")",
")",
"{",
"if",
... | Add a leaf on the tree.
@param string $parent_id
@param string $node_id
@param array $node
@return bool | [
"Add",
"a",
"leaf",
"on",
"the",
"tree",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Utilities/ParentChildTree.php#L108-L133 |
194,076 | RocketPropelledTortoise/Core | src/Utilities/ParentChildTree.php | ParentChildTree.getChilds | public function getChilds($id)
{
$result = [];
if (array_key_exists($id, $this->finder)) {
return $this->recursiveGetChilds($this->finder[$id][$this->config['childs']], $result);
} else {
return $result;
}
} | php | public function getChilds($id)
{
$result = [];
if (array_key_exists($id, $this->finder)) {
return $this->recursiveGetChilds($this->finder[$id][$this->config['childs']], $result);
} else {
return $result;
}
} | [
"public",
"function",
"getChilds",
"(",
"$",
"id",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"finder",
")",
")",
"{",
"return",
"$",
"this",
"->",
"recursiveGetChilds",
"(",
... | Get all node's children.
@param string $id The entry's ID
@return array | [
"Get",
"all",
"node",
"s",
"children",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Utilities/ParentChildTree.php#L151-L159 |
194,077 | RocketPropelledTortoise/Core | src/Utilities/ParentChildTree.php | ParentChildTree.recursiveGetChilds | private function recursiveGetChilds($childs, $result)
{
foreach ($childs as $node) {
$result[] = $node[$this->config['id']];
$result = $this->recursiveGetChilds($node[$this->config['childs']], $result);
}
return $result;
} | php | private function recursiveGetChilds($childs, $result)
{
foreach ($childs as $node) {
$result[] = $node[$this->config['id']];
$result = $this->recursiveGetChilds($node[$this->config['childs']], $result);
}
return $result;
} | [
"private",
"function",
"recursiveGetChilds",
"(",
"$",
"childs",
",",
"$",
"result",
")",
"{",
"foreach",
"(",
"$",
"childs",
"as",
"$",
"node",
")",
"{",
"$",
"result",
"[",
"]",
"=",
"$",
"node",
"[",
"$",
"this",
"->",
"config",
"[",
"'id'",
"]"... | Internal recursive function to get children.
@param array $childs
@param array $result
@return array | [
"Internal",
"recursive",
"function",
"to",
"get",
"children",
"."
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Utilities/ParentChildTree.php#L168-L176 |
194,078 | RocketPropelledTortoise/Core | src/Utilities/ParentChildTree.php | ParentChildTree.recursiveSort | private function recursiveSort(&$tree)
{
//execute sort
usort(
$tree,
function ($a, $b) {
if ($a[$this->config['sort_key']] == $b[$this->config['sort_key']]) {
return 0;
}
return ($a[$this->config['sort_key'... | php | private function recursiveSort(&$tree)
{
//execute sort
usort(
$tree,
function ($a, $b) {
if ($a[$this->config['sort_key']] == $b[$this->config['sort_key']]) {
return 0;
}
return ($a[$this->config['sort_key'... | [
"private",
"function",
"recursiveSort",
"(",
"&",
"$",
"tree",
")",
"{",
"//execute sort",
"usort",
"(",
"$",
"tree",
",",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"if",
"(",
"$",
"a",
"[",
"$",
"this",
"->",
"config",
"[",
"'sort_key'",... | Internal recursive function
@param array $tree
@return bool | [
"Internal",
"recursive",
"function"
] | 78b65663fc463e21e494257140ddbed0a9ccb3c3 | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Utilities/ParentChildTree.php#L193-L214 |
194,079 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Client/Pool/Pool.php | Pool.execute | public function execute($hydrationMode = self::RESULT_TYPE_HYDRATED)
{
if ($hydrationMode !== self::RESULT_TYPE_NONE) {
$items = $this->getResultIterator();
}
// Send requests until the queue is empty
while (!empty($this->queue)) {
$pool = new \Aws\CommandPoo... | php | public function execute($hydrationMode = self::RESULT_TYPE_HYDRATED)
{
if ($hydrationMode !== self::RESULT_TYPE_NONE) {
$items = $this->getResultIterator();
}
// Send requests until the queue is empty
while (!empty($this->queue)) {
$pool = new \Aws\CommandPoo... | [
"public",
"function",
"execute",
"(",
"$",
"hydrationMode",
"=",
"self",
"::",
"RESULT_TYPE_HYDRATED",
")",
"{",
"if",
"(",
"$",
"hydrationMode",
"!==",
"self",
"::",
"RESULT_TYPE_NONE",
")",
"{",
"$",
"items",
"=",
"$",
"this",
"->",
"getResultIterator",
"(... | Execute queued requests. Unprocessed items are automatically retried.
@param int $hydrationMode
@return IteratorIterator|bool | [
"Execute",
"queued",
"requests",
".",
"Unprocessed",
"items",
"are",
"automatically",
"retried",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Client/Pool/Pool.php#L58-L87 |
194,080 | agentmedia/phine-builtin | src/BuiltIn/Modules/Frontend/Logout.php | Logout.RedirectUrl | private function RedirectUrl()
{
if ($this->logout->GetNextUrl())
{
return FrontendRouter::Url($this->logout->GetNextUrl());
}
return CurrentUrl();
} | php | private function RedirectUrl()
{
if ($this->logout->GetNextUrl())
{
return FrontendRouter::Url($this->logout->GetNextUrl());
}
return CurrentUrl();
} | [
"private",
"function",
"RedirectUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logout",
"->",
"GetNextUrl",
"(",
")",
")",
"{",
"return",
"FrontendRouter",
"::",
"Url",
"(",
"$",
"this",
"->",
"logout",
"->",
"GetNextUrl",
"(",
")",
")",
";",
"}... | Gets the actual redirect url
@return string Gets the url after post | [
"Gets",
"the",
"actual",
"redirect",
"url"
] | 4dd05bc406a71e997bd4eaa16b12e23dbe62a456 | https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Modules/Frontend/Logout.php#L46-L53 |
194,081 | crazy-cats/framework | src/Utility/File.php | File.getCsv | static public function getCsv( $handle, $length = null, $delimiter = ',', $enclosure = '"' )
{
$separator = preg_quote( $delimiter );
$quoteSymbol = preg_quote( $enclosure );
$line = '';
$eof = false;
do {
$line .= ( $length === null ? fgets( $handle ) : fgets( $... | php | static public function getCsv( $handle, $length = null, $delimiter = ',', $enclosure = '"' )
{
$separator = preg_quote( $delimiter );
$quoteSymbol = preg_quote( $enclosure );
$line = '';
$eof = false;
do {
$line .= ( $length === null ? fgets( $handle ) : fgets( $... | [
"static",
"public",
"function",
"getCsv",
"(",
"$",
"handle",
",",
"$",
"length",
"=",
"null",
",",
"$",
"delimiter",
"=",
"','",
",",
"$",
"enclosure",
"=",
"'\"'",
")",
"{",
"$",
"separator",
"=",
"preg_quote",
"(",
"$",
"delimiter",
")",
";",
"$",... | Customized a method to read CSV file with Chinese content,
instead of using PHP fgetcsv function.
@param resource $handle
@param int $length
@param string $delimiter
@param string $enclosure
@return string[] | [
"Customized",
"a",
"method",
"to",
"read",
"CSV",
"file",
"with",
"Chinese",
"content",
"instead",
"of",
"using",
"PHP",
"fgetcsv",
"function",
"."
] | 5ea53d3f97689a301782c0d3d7b924d763420c66 | https://github.com/crazy-cats/framework/blob/5ea53d3f97689a301782c0d3d7b924d763420c66/src/Utility/File.php#L76-L102 |
194,082 | Mandarin-Medien/MMCmfRoutingBundle | Entity/NodeRouteManager.php | NodeRouteManager.generateAutoNodeRoute | public function generateAutoNodeRoute(RoutableNodeInterface $node)
{
$repository = $this->manager->getRepository(AutoNodeRoute::class);
$route = (new AutoNodeRoute())
->setRoute('/' . $this->slugify($node));
//$node->addRoute($route);
/**
* @var Node $parent... | php | public function generateAutoNodeRoute(RoutableNodeInterface $node)
{
$repository = $this->manager->getRepository(AutoNodeRoute::class);
$route = (new AutoNodeRoute())
->setRoute('/' . $this->slugify($node));
//$node->addRoute($route);
/**
* @var Node $parent... | [
"public",
"function",
"generateAutoNodeRoute",
"(",
"RoutableNodeInterface",
"$",
"node",
")",
"{",
"$",
"repository",
"=",
"$",
"this",
"->",
"manager",
"->",
"getRepository",
"(",
"AutoNodeRoute",
"::",
"class",
")",
";",
"$",
"route",
"=",
"(",
"new",
"Au... | generates a AutoNodeRoute for a given Node
@param RoutableNodeInterface $node
@return AutoNodeRoute | [
"generates",
"a",
"AutoNodeRoute",
"for",
"a",
"given",
"Node"
] | 7db1b03f5e120bd473486c0be6ab76c6146cd2d0 | https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Entity/NodeRouteManager.php#L43-L71 |
194,083 | Mandarin-Medien/MMCmfRoutingBundle | Entity/NodeRouteManager.php | NodeRouteManager.getAutoNodeRoutesRecursive | public function getAutoNodeRoutesRecursive(NodeInterface &$node, $base = null, &$routeObjects = array())
{
$route = $this->getAutoNodeRoute($node);
if($route) {
$route->setRoute(
$base ? $base . '/' . util::slugify($node->getName())
: $this->genera... | php | public function getAutoNodeRoutesRecursive(NodeInterface &$node, $base = null, &$routeObjects = array())
{
$route = $this->getAutoNodeRoute($node);
if($route) {
$route->setRoute(
$base ? $base . '/' . util::slugify($node->getName())
: $this->genera... | [
"public",
"function",
"getAutoNodeRoutesRecursive",
"(",
"NodeInterface",
"&",
"$",
"node",
",",
"$",
"base",
"=",
"null",
",",
"&",
"$",
"routeObjects",
"=",
"array",
"(",
")",
")",
"{",
"$",
"route",
"=",
"$",
"this",
"->",
"getAutoNodeRoute",
"(",
"$"... | get updated AutoNodeRoutes recursive
@param NodeInterface $node
@param null|string $base
@return NodeRoute[] | [
"get",
"updated",
"AutoNodeRoutes",
"recursive"
] | 7db1b03f5e120bd473486c0be6ab76c6146cd2d0 | https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Entity/NodeRouteManager.php#L81-L110 |
194,084 | Mandarin-Medien/MMCmfRoutingBundle | Entity/NodeRouteManager.php | NodeRouteManager.getIncrement | protected function getIncrement($route)
{
// var_dump($route);
$mapper = new ResultSetMapping();
$mapper->addScalarResult('route', 'route');
$builder = $this->manager->createNativeQuery(
'SELECT route FROM node_route WHERE route REGEXP ?',
$mapper
)... | php | protected function getIncrement($route)
{
// var_dump($route);
$mapper = new ResultSetMapping();
$mapper->addScalarResult('route', 'route');
$builder = $this->manager->createNativeQuery(
'SELECT route FROM node_route WHERE route REGEXP ?',
$mapper
)... | [
"protected",
"function",
"getIncrement",
"(",
"$",
"route",
")",
"{",
"// var_dump($route);",
"$",
"mapper",
"=",
"new",
"ResultSetMapping",
"(",
")",
";",
"$",
"mapper",
"->",
"addScalarResult",
"(",
"'route'",
",",
"'route'",
")",
";",
"$",
"builder",
"=",... | check if the generated route already exists and return the count
@param string $route route string to check
@return string increment value in parenthesis | [
"check",
"if",
"the",
"generated",
"route",
"already",
"exists",
"and",
"return",
"the",
"count"
] | 7db1b03f5e120bd473486c0be6ab76c6146cd2d0 | https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Entity/NodeRouteManager.php#L144-L174 |
194,085 | Mandarin-Medien/MMCmfRoutingBundle | Entity/NodeRouteManager.php | NodeRouteManager.prepareMysqlRegexp | protected function prepareMysqlRegexp($string)
{
$regexp = $string;
// first remove trailing increment
$regexp = preg_replace('/\([0-9]\)$/', "", $regexp);
// escape existing parenthesis
$regexp = preg_replace('(\(|\))', '\\\\${0}', $regexp);
// append matching mys... | php | protected function prepareMysqlRegexp($string)
{
$regexp = $string;
// first remove trailing increment
$regexp = preg_replace('/\([0-9]\)$/', "", $regexp);
// escape existing parenthesis
$regexp = preg_replace('(\(|\))', '\\\\${0}', $regexp);
// append matching mys... | [
"protected",
"function",
"prepareMysqlRegexp",
"(",
"$",
"string",
")",
"{",
"$",
"regexp",
"=",
"$",
"string",
";",
"// first remove trailing increment",
"$",
"regexp",
"=",
"preg_replace",
"(",
"'/\\([0-9]\\)$/'",
",",
"\"\"",
",",
"$",
"regexp",
")",
";",
"... | create regexp for mysql query
@param $string NodeRoute::route
@return string | [
"create",
"regexp",
"for",
"mysql",
"query"
] | 7db1b03f5e120bd473486c0be6ab76c6146cd2d0 | https://github.com/Mandarin-Medien/MMCmfRoutingBundle/blob/7db1b03f5e120bd473486c0be6ab76c6146cd2d0/Entity/NodeRouteManager.php#L215-L230 |
194,086 | CalderaWP/caldera-interop | src/Traits/Rest/ProvidesRoute.php | ProvidesRoute.addEndpoint | public function addEndpoint(Endpoint $endpoint): Route
{
$this->endpoints[get_class($endpoint)] = $endpoint;
return $this;
} | php | public function addEndpoint(Endpoint $endpoint): Route
{
$this->endpoints[get_class($endpoint)] = $endpoint;
return $this;
} | [
"public",
"function",
"addEndpoint",
"(",
"Endpoint",
"$",
"endpoint",
")",
":",
"Route",
"{",
"$",
"this",
"->",
"endpoints",
"[",
"get_class",
"(",
"$",
"endpoint",
")",
"]",
"=",
"$",
"endpoint",
";",
"return",
"$",
"this",
";",
"}"
] | Add an endpoint to route
@param Endpoint $endpoint
@return Route | [
"Add",
"an",
"endpoint",
"to",
"route"
] | d25c4bc930200b314fbd42d084080b5d85261c94 | https://github.com/CalderaWP/caldera-interop/blob/d25c4bc930200b314fbd42d084080b5d85261c94/src/Traits/Rest/ProvidesRoute.php#L20-L24 |
194,087 | joegreen88/zf1-component-validate | src/Zend/Validate/Barcode/AdapterAbstract.php | Zend_Validate_Barcode_AdapterAbstract.checkLength | public function checkLength($value)
{
if (!is_string($value)) {
return false;
}
$fixum = strlen($value);
$found = false;
$length = $this->getLength();
if (is_array($length)) {
foreach ($length as $value) {
if ($fixum == $valu... | php | public function checkLength($value)
{
if (!is_string($value)) {
return false;
}
$fixum = strlen($value);
$found = false;
$length = $this->getLength();
if (is_array($length)) {
foreach ($length as $value) {
if ($fixum == $valu... | [
"public",
"function",
"checkLength",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"fixum",
"=",
"strlen",
"(",
"$",
"value",
")",
";",
"$",
"found",
"=",
"false",
";... | Checks the length of a barcode
@param string $value The barcode to check for proper length
@return boolean | [
"Checks",
"the",
"length",
"of",
"a",
"barcode"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Barcode/AdapterAbstract.php#L66-L98 |
194,088 | joegreen88/zf1-component-validate | src/Zend/Validate/Barcode/AdapterAbstract.php | Zend_Validate_Barcode_AdapterAbstract.checkChars | public function checkChars($value)
{
if (!is_string($value)) {
return false;
}
$characters = $this->getCharacters();
if ($characters == 128) {
for ($x = 0; $x < 128; ++$x) {
$value = str_replace(chr($x), '', $value);
}
} el... | php | public function checkChars($value)
{
if (!is_string($value)) {
return false;
}
$characters = $this->getCharacters();
if ($characters == 128) {
for ($x = 0; $x < 128; ++$x) {
$value = str_replace(chr($x), '', $value);
}
} el... | [
"public",
"function",
"checkChars",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"characters",
"=",
"$",
"this",
"->",
"getCharacters",
"(",
")",
";",
"if",
"(",
"$",
... | Checks for allowed characters within the barcode
@param string $value The barcode to check for allowed characters
@return boolean | [
"Checks",
"for",
"allowed",
"characters",
"within",
"the",
"barcode"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/Barcode/AdapterAbstract.php#L106-L129 |
194,089 | devlabmtl/haven-core | Controller/CategoryController.php | CategoryController.listAction | public function listAction() {
$entities = $this->container->get("haven_core.category.read_handler")->getAll();
foreach ($entities as $entity) {
$delete_forms[$entity->getId()] = $this->container->get("haven_core.category.form_handler")->createDeleteForm($entity->getId())->createView();
... | php | public function listAction() {
$entities = $this->container->get("haven_core.category.read_handler")->getAll();
foreach ($entities as $entity) {
$delete_forms[$entity->getId()] = $this->container->get("haven_core.category.form_handler")->createDeleteForm($entity->getId())->createView();
... | [
"public",
"function",
"listAction",
"(",
")",
"{",
"$",
"entities",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"\"haven_core.category.read_handler\"",
")",
"->",
"getAll",
"(",
")",
";",
"foreach",
"(",
"$",
"entities",
"as",
"$",
"entity",
")"... | Finds and all persona for admin.
@Route("admin/list/category")
@Method("GET")
@Template() | [
"Finds",
"and",
"all",
"persona",
"for",
"admin",
"."
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Controller/CategoryController.php#L48-L58 |
194,090 | devlabmtl/haven-core | Controller/CategoryController.php | CategoryController.addAction | public function addAction() {
$edit_form = $this->container->get("haven_core.category.form_handler")->createNewForm();
$request = $this->container->get('request_modifier')->setRequest($this->container->get("request"))
->slug(array("name"))
->getRequest();
$edit... | php | public function addAction() {
$edit_form = $this->container->get("haven_core.category.form_handler")->createNewForm();
$request = $this->container->get('request_modifier')->setRequest($this->container->get("request"))
->slug(array("name"))
->getRequest();
$edit... | [
"public",
"function",
"addAction",
"(",
")",
"{",
"$",
"edit_form",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"\"haven_core.category.form_handler\"",
")",
"->",
"createNewForm",
"(",
")",
";",
"$",
"request",
"=",
"$",
"this",
"->",
"container",... | Creates a new persona entity.
@Route("/admin/create/category")
@Method("POST")
@Template | [
"Creates",
"a",
"new",
"persona",
"entity",
"."
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Controller/CategoryController.php#L98-L123 |
194,091 | Nekland/BaseApi | lib/Nekland/BaseApi/ApiFactory.php | ApiFactory.useAuthentication | public function useAuthentication($auth, array $options = [])
{
if (!($auth instanceof AuthStrategyInterface)) {
$auth = $this->getAuthFactory()->get($auth);
$auth->setOptions($options);
}
$this->dispatcher->addListener(Events::ON_REQUEST_EVENT, [
$auth,
... | php | public function useAuthentication($auth, array $options = [])
{
if (!($auth instanceof AuthStrategyInterface)) {
$auth = $this->getAuthFactory()->get($auth);
$auth->setOptions($options);
}
$this->dispatcher->addListener(Events::ON_REQUEST_EVENT, [
$auth,
... | [
"public",
"function",
"useAuthentication",
"(",
"$",
"auth",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"auth",
"instanceof",
"AuthStrategyInterface",
")",
")",
"{",
"$",
"auth",
"=",
"$",
"this",
"->",
"getAuthFac... | Allow the user to add an authentication to the request
@param string|AuthStrategyInterface $auth
@param array $options | [
"Allow",
"the",
"user",
"to",
"add",
"an",
"authentication",
"to",
"the",
"request"
] | c96051b36d6982abf2a8b1f1ec16351bcae2455e | https://github.com/Nekland/BaseApi/blob/c96051b36d6982abf2a8b1f1ec16351bcae2455e/lib/Nekland/BaseApi/ApiFactory.php#L80-L91 |
194,092 | irfantoor/console | src/Console.php | Console.applyStyle | function applyStyle($text, $styles = [])
{
if (!self::$supported)
return $text;
if (is_string($styles))
{
$styles = [$styles];
}
$output = $text;
foreach ($styles as $style) {
if (isset(self::$theme[$style])) {
$ou... | php | function applyStyle($text, $styles = [])
{
if (!self::$supported)
return $text;
if (is_string($styles))
{
$styles = [$styles];
}
$output = $text;
foreach ($styles as $style) {
if (isset(self::$theme[$style])) {
$ou... | [
"function",
"applyStyle",
"(",
"$",
"text",
",",
"$",
"styles",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"supported",
")",
"return",
"$",
"text",
";",
"if",
"(",
"is_string",
"(",
"$",
"styles",
")",
")",
"{",
"$",
"styles",
... | Returns the text with the styles applied to it
@param string
@param string|array
@return string | [
"Returns",
"the",
"text",
"with",
"the",
"styles",
"applied",
"to",
"it"
] | 683927e2205a4d54061add377cb2b33adc1d83dc | https://github.com/irfantoor/console/blob/683927e2205a4d54061add377cb2b33adc1d83dc/src/Console.php#L102-L129 |
194,093 | irfantoor/console | src/Console.php | Console.read | public function read($prompt, $style = '') {
$this->write($prompt . ' ', $style);
$stdin = fopen('php://stdin', 'r');
$str = fgets($stdin, 4096);
fclose($stdin);
return preg_replace('{\r?\n$}D', '', $str);
} | php | public function read($prompt, $style = '') {
$this->write($prompt . ' ', $style);
$stdin = fopen('php://stdin', 'r');
$str = fgets($stdin, 4096);
fclose($stdin);
return preg_replace('{\r?\n$}D', '', $str);
} | [
"public",
"function",
"read",
"(",
"$",
"prompt",
",",
"$",
"style",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"$",
"prompt",
".",
"' '",
",",
"$",
"style",
")",
";",
"$",
"stdin",
"=",
"fopen",
"(",
"'php://stdin'",
",",
"'r'",
")",
... | Read a line from input with an optional prompt and optional style
@param string $prompt can be string to be prompted before reading from console
@param mixed $style can be null, a style code as string or an array of strings.
@return the line read from console | [
"Read",
"a",
"line",
"from",
"input",
"with",
"an",
"optional",
"prompt",
"and",
"optional",
"style"
] | 683927e2205a4d54061add377cb2b33adc1d83dc | https://github.com/irfantoor/console/blob/683927e2205a4d54061add377cb2b33adc1d83dc/src/Console.php#L150-L156 |
194,094 | irfantoor/console | src/Console.php | Console.write | public function write($text = '', $style = 'none') {
if (is_array($text)) {
$max = 0;
foreach($text as $txt) {
$max = max($max, strlen($txt));
}
$outline = str_repeat(' ', $max + 4);
$this->writeln($outline, $style);
fore... | php | public function write($text = '', $style = 'none') {
if (is_array($text)) {
$max = 0;
foreach($text as $txt) {
$max = max($max, strlen($txt));
}
$outline = str_repeat(' ', $max + 4);
$this->writeln($outline, $style);
fore... | [
"public",
"function",
"write",
"(",
"$",
"text",
"=",
"''",
",",
"$",
"style",
"=",
"'none'",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"text",
")",
")",
"{",
"$",
"max",
"=",
"0",
";",
"foreach",
"(",
"$",
"text",
"as",
"$",
"txt",
")",
"{"... | Write a line or a group of lines to output
@param mixed $text can be string or an array of strings
@param mixed $style can be null, a style code as string or an array of strings. | [
"Write",
"a",
"line",
"or",
"a",
"group",
"of",
"lines",
"to",
"output"
] | 683927e2205a4d54061add377cb2b33adc1d83dc | https://github.com/irfantoor/console/blob/683927e2205a4d54061add377cb2b33adc1d83dc/src/Console.php#L164-L187 |
194,095 | stevenliebregt/crispysystem | src/Helpers/Config.php | Config.init | public static function init()
{
$file = ROOT . 'storage/crispysystem.config.php';
if (!is_readable($file)) {
showPlainError('The file `crispysystem.config.php` in the `storage` directory is not readable');
}
$config = unserialize(file_get_contents($file));
stati... | php | public static function init()
{
$file = ROOT . 'storage/crispysystem.config.php';
if (!is_readable($file)) {
showPlainError('The file `crispysystem.config.php` in the `storage` directory is not readable');
}
$config = unserialize(file_get_contents($file));
stati... | [
"public",
"static",
"function",
"init",
"(",
")",
"{",
"$",
"file",
"=",
"ROOT",
".",
"'storage/crispysystem.config.php'",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"file",
")",
")",
"{",
"showPlainError",
"(",
"'The file `crispysystem.config.php` in the `stor... | Read the config from the cached file
@since 1.0.0 | [
"Read",
"the",
"config",
"from",
"the",
"cached",
"file"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Helpers/Config.php#L25-L35 |
194,096 | stevenliebregt/crispysystem | src/Helpers/Config.php | Config.cache | public static function cache()
{
$cache = [];
$finder = (new Finder())
->files()
->name('/.+\.php/')
->in(ROOT . 'config');
/** @var SplFileInfo $file */
foreach ($finder as $file) {
$category = str_ireplace('.php', '', $file->getFile... | php | public static function cache()
{
$cache = [];
$finder = (new Finder())
->files()
->name('/.+\.php/')
->in(ROOT . 'config');
/** @var SplFileInfo $file */
foreach ($finder as $file) {
$category = str_ireplace('.php', '', $file->getFile... | [
"public",
"static",
"function",
"cache",
"(",
")",
"{",
"$",
"cache",
"=",
"[",
"]",
";",
"$",
"finder",
"=",
"(",
"new",
"Finder",
"(",
")",
")",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"'/.+\\.php/'",
")",
"->",
"in",
"(",
"ROOT",
".",
"'... | Cache the configuration files into one file
@since 1.0.0 | [
"Cache",
"the",
"configuration",
"files",
"into",
"one",
"file"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Helpers/Config.php#L41-L59 |
194,097 | stevenliebregt/crispysystem | src/Helpers/Config.php | Config.get | public static function get(string $key = null)
{
if (is_null($key)) {
return static::$config;
}
// Key is formatted like database.default.driver
$config = static::$config;
$key = explode('.', $key);
foreach ($key as $k) {
if (!isset($config[$k]... | php | public static function get(string $key = null)
{
if (is_null($key)) {
return static::$config;
}
// Key is formatted like database.default.driver
$config = static::$config;
$key = explode('.', $key);
foreach ($key as $k) {
if (!isset($config[$k]... | [
"public",
"static",
"function",
"get",
"(",
"string",
"$",
"key",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"static",
"::",
"$",
"config",
";",
"}",
"// Key is formatted like database.default.driver",
"$",
"conf... | Get the value of a configuration key
@param string|null $key Name of the key you want value of, leave empty to retrieve all,
multidimensional keys are formatted like: key.subkey.subsubkey.something
@return array|mixed|null Retrieve values or null if key doesn't exist
@since 1.0.0 | [
"Get",
"the",
"value",
"of",
"a",
"configuration",
"key"
] | 06547dae100dae1023a93ec903f2d2abacce9aec | https://github.com/stevenliebregt/crispysystem/blob/06547dae100dae1023a93ec903f2d2abacce9aec/src/Helpers/Config.php#L68-L83 |
194,098 | lightwerk/SurfCaptain | Classes/Lightwerk/SurfCaptain/Domain/Repository/Preset/GitRepository.php | GitRepository.savePresets | protected function savePresets(array $presets, $logMessage)
{
$this->driverComposite->setFileContent(
$this->settings['repositoryUrl'],
$this->settings['filePath'],
json_encode($presets, JSON_PRETTY_PRINT),
'[SURFCAPTAIN] ' . $logMessage
);
$th... | php | protected function savePresets(array $presets, $logMessage)
{
$this->driverComposite->setFileContent(
$this->settings['repositoryUrl'],
$this->settings['filePath'],
json_encode($presets, JSON_PRETTY_PRINT),
'[SURFCAPTAIN] ' . $logMessage
);
$th... | [
"protected",
"function",
"savePresets",
"(",
"array",
"$",
"presets",
",",
"$",
"logMessage",
")",
"{",
"$",
"this",
"->",
"driverComposite",
"->",
"setFileContent",
"(",
"$",
"this",
"->",
"settings",
"[",
"'repositoryUrl'",
"]",
",",
"$",
"this",
"->",
"... | Saves the presets.
@param array $presets
@param string $logMessage
@return void | [
"Saves",
"the",
"presets",
"."
] | 2865e963fd634504d8923902cf422873749a0940 | https://github.com/lightwerk/SurfCaptain/blob/2865e963fd634504d8923902cf422873749a0940/Classes/Lightwerk/SurfCaptain/Domain/Repository/Preset/GitRepository.php#L50-L59 |
194,099 | lightwerk/SurfCaptain | Classes/Lightwerk/SurfCaptain/Domain/Repository/Preset/GitRepository.php | GitRepository.loadPresets | protected function loadPresets()
{
if (!isset($this->presets)) {
$this->presets = json_decode(
$this->driverComposite->getFileContent($this->settings['repositoryUrl'], $this->settings['filePath']),
true
);
if (empty($this->presets)) {
... | php | protected function loadPresets()
{
if (!isset($this->presets)) {
$this->presets = json_decode(
$this->driverComposite->getFileContent($this->settings['repositoryUrl'], $this->settings['filePath']),
true
);
if (empty($this->presets)) {
... | [
"protected",
"function",
"loadPresets",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"presets",
")",
")",
"{",
"$",
"this",
"->",
"presets",
"=",
"json_decode",
"(",
"$",
"this",
"->",
"driverComposite",
"->",
"getFileContent",
"(",
... | Load the presets.
@return array $presets
@throws Exception | [
"Load",
"the",
"presets",
"."
] | 2865e963fd634504d8923902cf422873749a0940 | https://github.com/lightwerk/SurfCaptain/blob/2865e963fd634504d8923902cf422873749a0940/Classes/Lightwerk/SurfCaptain/Domain/Repository/Preset/GitRepository.php#L67-L79 |
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.