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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
17,500 | aryelgois/yasql-php | src/Controller.php | Controller.generate | public static function generate(
string $yasql,
string $name = null,
int $indent = null
) {
$model = new Parser($yasql, $name);
$view = new Generator($model, $indent);
return $view->output();
} | php | public static function generate(
string $yasql,
string $name = null,
int $indent = null
) {
$model = new Parser($yasql, $name);
$view = new Generator($model, $indent);
return $view->output();
} | [
"public",
"static",
"function",
"generate",
"(",
"string",
"$",
"yasql",
",",
"string",
"$",
"name",
"=",
"null",
",",
"int",
"$",
"indent",
"=",
"null",
")",
"{",
"$",
"model",
"=",
"new",
"Parser",
"(",
"$",
"yasql",
",",
"$",
"name",
")",
";",
... | Generates the SQL from a YASQL
@param string $yasql A string following YAML Ain't SQL specifications
@param string $name Overwrite database's name
@param int $indent How many spaces per indentation level
@return string | [
"Generates",
"the",
"SQL",
"from",
"a",
"YASQL"
] | f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7 | https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Controller.php#L55-L63 |
17,501 | aryelgois/yasql-php | src/Controller.php | Controller.parse | public static function parse(string $yasql, string $name = null)
{
$parser = new Parser($yasql, $name);
return $parser->getData();
} | php | public static function parse(string $yasql, string $name = null)
{
$parser = new Parser($yasql, $name);
return $parser->getData();
} | [
"public",
"static",
"function",
"parse",
"(",
"string",
"$",
"yasql",
",",
"string",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"parser",
"=",
"new",
"Parser",
"(",
"$",
"yasql",
",",
"$",
"name",
")",
";",
"return",
"$",
"parser",
"->",
"getData",
"... | Parses a YASQL and returns the parsed data
@param string $yasql A string following YAML Ain't SQL specifications
@param string $name Overwrite database's name
@return array | [
"Parses",
"a",
"YASQL",
"and",
"returns",
"the",
"parsed",
"data"
] | f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7 | https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Controller.php#L73-L77 |
17,502 | aedart/laravel-helpers | src/Traits/Cache/CacheFactoryTrait.php | CacheFactoryTrait.getCacheFactory | public function getCacheFactory(): ?Factory
{
if (!$this->hasCacheFactory()) {
$this->setCacheFactory($this->getDefaultCacheFactory());
}
return $this->cacheFactory;
} | php | public function getCacheFactory(): ?Factory
{
if (!$this->hasCacheFactory()) {
$this->setCacheFactory($this->getDefaultCacheFactory());
}
return $this->cacheFactory;
} | [
"public",
"function",
"getCacheFactory",
"(",
")",
":",
"?",
"Factory",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasCacheFactory",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setCacheFactory",
"(",
"$",
"this",
"->",
"getDefaultCacheFactory",
"(",
")",
")",
... | Get cache factory
If no cache factory has been set, this method will
set and return a default cache factory, if any such
value is available
@see getDefaultCacheFactory()
@return Factory|null cache factory or null if none cache factory has been set | [
"Get",
"cache",
"factory"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Cache/CacheFactoryTrait.php#L53-L59 |
17,503 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Atom.php | Zend_Feed_Atom.saveXml | public function saveXml()
{
// Return a complete document including XML prologue.
$doc = new DOMDocument($this->_element->ownerDocument->version,
$this->_element->ownerDocument->actualEncoding);
$doc->appendChild($doc->importNode($this->_element, true));
... | php | public function saveXml()
{
// Return a complete document including XML prologue.
$doc = new DOMDocument($this->_element->ownerDocument->version,
$this->_element->ownerDocument->actualEncoding);
$doc->appendChild($doc->importNode($this->_element, true));
... | [
"public",
"function",
"saveXml",
"(",
")",
"{",
"// Return a complete document including XML prologue.",
"$",
"doc",
"=",
"new",
"DOMDocument",
"(",
"$",
"this",
"->",
"_element",
"->",
"ownerDocument",
"->",
"version",
",",
"$",
"this",
"->",
"_element",
"->",
... | Override Zend_Feed_Element to allow formated feeds
@return string | [
"Override",
"Zend_Feed_Element",
"to",
"allow",
"formated",
"feeds"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Atom.php#L359-L368 |
17,504 | nyeholt/silverstripe-external-content | thirdparty/Zend/Feed/Atom.php | Zend_Feed_Atom.send | public function send()
{
if (headers_sent()) {
/**
* @see Zend_Feed_Exception
*/
require_once 'Zend/Feed/Exception.php';
throw new Zend_Feed_Exception('Cannot send ATOM because headers have already been sent.');
}
header('Conten... | php | public function send()
{
if (headers_sent()) {
/**
* @see Zend_Feed_Exception
*/
require_once 'Zend/Feed/Exception.php';
throw new Zend_Feed_Exception('Cannot send ATOM because headers have already been sent.');
}
header('Conten... | [
"public",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"headers_sent",
"(",
")",
")",
"{",
"/** \n * @see Zend_Feed_Exception\n */",
"require_once",
"'Zend/Feed/Exception.php'",
";",
"throw",
"new",
"Zend_Feed_Exception",
"(",
"'Cannot send ATOM bec... | Send feed to a http client with the correct header
@return void
@throws Zend_Feed_Exception if headers have already been sent | [
"Send",
"feed",
"to",
"a",
"http",
"client",
"with",
"the",
"correct",
"header"
] | 1c6da8c56ef717225ff904e1522aff94ed051601 | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Feed/Atom.php#L376-L389 |
17,505 | aedart/laravel-helpers | src/Traits/Redis/RedisFactoryTrait.php | RedisFactoryTrait.getRedisFactory | public function getRedisFactory(): ?Factory
{
if (!$this->hasRedisFactory()) {
$this->setRedisFactory($this->getDefaultRedisFactory());
}
return $this->redisFactory;
} | php | public function getRedisFactory(): ?Factory
{
if (!$this->hasRedisFactory()) {
$this->setRedisFactory($this->getDefaultRedisFactory());
}
return $this->redisFactory;
} | [
"public",
"function",
"getRedisFactory",
"(",
")",
":",
"?",
"Factory",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasRedisFactory",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setRedisFactory",
"(",
"$",
"this",
"->",
"getDefaultRedisFactory",
"(",
")",
")",
... | Get redis factory
If no redis factory has been set, this method will
set and return a default redis factory, if any such
value is available
@see getDefaultRedisFactory()
@return Factory|null redis factory or null if none redis factory has been set | [
"Get",
"redis",
"factory"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Redis/RedisFactoryTrait.php#L53-L59 |
17,506 | djgadd/themosis-illuminate | src/Validation/ValidationServiceProvider.php | ValidationServiceProvider.boot | public function boot ()
{
ValidatorFacade::extend('valid_nonce', function ($attaribute, $value, $params, $validator) {
$action = $params[0];
return (bool) wp_verify_nonce($value, $action);
});
} | php | public function boot ()
{
ValidatorFacade::extend('valid_nonce', function ($attaribute, $value, $params, $validator) {
$action = $params[0];
return (bool) wp_verify_nonce($value, $action);
});
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"ValidatorFacade",
"::",
"extend",
"(",
"'valid_nonce'",
",",
"function",
"(",
"$",
"attaribute",
",",
"$",
"value",
",",
"$",
"params",
",",
"$",
"validator",
")",
"{",
"$",
"action",
"=",
"$",
"params",
"[... | Add valid_nonce validation rule
@return void | [
"Add",
"valid_nonce",
"validation",
"rule"
] | 13ee4c3413cddd85a2f262ac361f35c81da0c53c | https://github.com/djgadd/themosis-illuminate/blob/13ee4c3413cddd85a2f262ac361f35c81da0c53c/src/Validation/ValidationServiceProvider.php#L23-L29 |
17,507 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.getEntity | public function getEntity($id, $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
return $this->getQueryBuilder(['id' => $id])
->getQuery()
->setMaxResults(1)
->getOneOrNullResult($hydrationMode);
} | php | public function getEntity($id, $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
return $this->getQueryBuilder(['id' => $id])
->getQuery()
->setMaxResults(1)
->getOneOrNullResult($hydrationMode);
} | [
"public",
"function",
"getEntity",
"(",
"$",
"id",
",",
"$",
"hydrationMode",
"=",
"AbstractQuery",
"::",
"HYDRATE_OBJECT",
")",
"{",
"return",
"$",
"this",
"->",
"getQueryBuilder",
"(",
"[",
"'id'",
"=>",
"$",
"id",
"]",
")",
"->",
"getQuery",
"(",
")",... | Returns an entity by its ID.
@param mixed $id
@param integer $hydrationMode
@return mixed
@deprecated Deprecated since 2.0.4; to be removed in 3.0.0. Use the basic `find()` method instead | [
"Returns",
"an",
"entity",
"by",
"its",
"ID",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L37-L43 |
17,508 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.getEntitiesById | public function getEntitiesById(array $ids, $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
return $this->getQueryBuilder(['id' => $ids])
->getQuery()
->execute(null, $hydrationMode);
} | php | public function getEntitiesById(array $ids, $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
return $this->getQueryBuilder(['id' => $ids])
->getQuery()
->execute(null, $hydrationMode);
} | [
"public",
"function",
"getEntitiesById",
"(",
"array",
"$",
"ids",
",",
"$",
"hydrationMode",
"=",
"AbstractQuery",
"::",
"HYDRATE_OBJECT",
")",
"{",
"return",
"$",
"this",
"->",
"getQueryBuilder",
"(",
"[",
"'id'",
"=>",
"$",
"ids",
"]",
")",
"->",
"getQu... | Returns a list of entities extracted by their IDs.
@param array $ids
@param integer $hydrationMode
@return array | [
"Returns",
"a",
"list",
"of",
"entities",
"extracted",
"by",
"their",
"IDs",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L65-L70 |
17,509 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.getEntities | public function getEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
$options = EntityRepositoryOptionsResolver::createAndResolve($options);
return $this->getQueryBuilder($options['filters'], $options['sorting'])
->getQuery()
->execute(null, $hyd... | php | public function getEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
$options = EntityRepositoryOptionsResolver::createAndResolve($options);
return $this->getQueryBuilder($options['filters'], $options['sorting'])
->getQuery()
->execute(null, $hyd... | [
"public",
"function",
"getEntities",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"hydrationMode",
"=",
"AbstractQuery",
"::",
"HYDRATE_OBJECT",
")",
"{",
"$",
"options",
"=",
"EntityRepositoryOptionsResolver",
"::",
"createAndResolve",
"(",
"$",
"opti... | Returns a list of all the entities.
@param array $options
@param integer $hydrationMode
@return array | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"entities",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L79-L85 |
17,510 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.getPaginatedEntities | public function getPaginatedEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
$options = PaginatedEntityRepositoryOptionsResolver::createAndResolve($options);
$queryBuilder = $this->addPagination(
$this->getQueryBuilder($options['filters'], $options['sorting... | php | public function getPaginatedEntities(array $options = [], $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
{
$options = PaginatedEntityRepositoryOptionsResolver::createAndResolve($options);
$queryBuilder = $this->addPagination(
$this->getQueryBuilder($options['filters'], $options['sorting... | [
"public",
"function",
"getPaginatedEntities",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"hydrationMode",
"=",
"AbstractQuery",
"::",
"HYDRATE_OBJECT",
")",
"{",
"$",
"options",
"=",
"PaginatedEntityRepositoryOptionsResolver",
"::",
"createAndResolve",
"... | Returns a paginated list of entities.
@param array $options
@param integer $hydrationMode
@return \Doctrine\ORM\Tools\Pagination\Paginator | [
"Returns",
"a",
"paginated",
"list",
"of",
"entities",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L94-L104 |
17,511 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.getQueryBuilder | protected function getQueryBuilder(array $filters = [], array $sorting = [])
{
$queryBuilder = $this->getBaseQueryBuilder();
if (!empty($filters)) {
$this->addFilters($queryBuilder, $filters);
}
if (empty($sorting)) {
$this->addSorting($queryBuilder, $this->g... | php | protected function getQueryBuilder(array $filters = [], array $sorting = [])
{
$queryBuilder = $this->getBaseQueryBuilder();
if (!empty($filters)) {
$this->addFilters($queryBuilder, $filters);
}
if (empty($sorting)) {
$this->addSorting($queryBuilder, $this->g... | [
"protected",
"function",
"getQueryBuilder",
"(",
"array",
"$",
"filters",
"=",
"[",
"]",
",",
"array",
"$",
"sorting",
"=",
"[",
"]",
")",
"{",
"$",
"queryBuilder",
"=",
"$",
"this",
"->",
"getBaseQueryBuilder",
"(",
")",
";",
"if",
"(",
"!",
"empty",
... | Returns a complete QueryBuilder instance for the current entity.
@param array $filters
@param array $sorting
@return \Doctrine\ORM\QueryBuilder | [
"Returns",
"a",
"complete",
"QueryBuilder",
"instance",
"for",
"the",
"current",
"entity",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L113-L127 |
17,512 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.addFilters | protected function addFilters(QueryBuilder $queryBuilder, $filters = array())
{
foreach ($filters as $field => $value) {
$methodName = sprintf('add%sFilter', ucfirst($field));
if (method_exists($this, $methodName)) {
// This field has a custom filtering method
... | php | protected function addFilters(QueryBuilder $queryBuilder, $filters = array())
{
foreach ($filters as $field => $value) {
$methodName = sprintf('add%sFilter', ucfirst($field));
if (method_exists($this, $methodName)) {
// This field has a custom filtering method
... | [
"protected",
"function",
"addFilters",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"$",
"filters",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"filters",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"methodName",
"=",
"sprintf",
... | Adds filters to the QueryBuilder instance.
@param \Doctrine\ORM\QueryBuilder $queryBuilder
@param array $filters
@return \Doctrine\ORM\QueryBuilder | [
"Adds",
"filters",
"to",
"the",
"QueryBuilder",
"instance",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L136-L160 |
17,513 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.addSorting | protected function addSorting(QueryBuilder $queryBuilder, array $sorting = [])
{
foreach ($sorting as $field => $sortOrder) {
if (!$this->isFieldSortable($field)) {
// Skip: invalid field
continue;
}
if (!$this->isSortOrderValid($sortOrder)... | php | protected function addSorting(QueryBuilder $queryBuilder, array $sorting = [])
{
foreach ($sorting as $field => $sortOrder) {
if (!$this->isFieldSortable($field)) {
// Skip: invalid field
continue;
}
if (!$this->isSortOrderValid($sortOrder)... | [
"protected",
"function",
"addSorting",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"array",
"$",
"sorting",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"sorting",
"as",
"$",
"field",
"=>",
"$",
"sortOrder",
")",
"{",
"if",
"(",
"!",
"$",
"this",
... | Adds sorting to the specified query builder.
@param \Doctrine\ORM\QueryBuilder $queryBuilder
@param array $sorting
@return \Doctrine\ORM\QueryBuilder | [
"Adds",
"sorting",
"to",
"the",
"specified",
"query",
"builder",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L169-L191 |
17,514 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.addPagination | protected function addPagination(QueryBuilder $queryBuilder, $elementsPerPage, $page = 1)
{
$elementsPerPage = (int)$elementsPerPage;
$page = (int)$page;
return $queryBuilder
->setMaxResults($elementsPerPage)
->setFirstResult($elementsPerPage * ($page - 1));
} | php | protected function addPagination(QueryBuilder $queryBuilder, $elementsPerPage, $page = 1)
{
$elementsPerPage = (int)$elementsPerPage;
$page = (int)$page;
return $queryBuilder
->setMaxResults($elementsPerPage)
->setFirstResult($elementsPerPage * ($page - 1));
} | [
"protected",
"function",
"addPagination",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"$",
"elementsPerPage",
",",
"$",
"page",
"=",
"1",
")",
"{",
"$",
"elementsPerPage",
"=",
"(",
"int",
")",
"$",
"elementsPerPage",
";",
"$",
"page",
"=",
"(",
"int",
... | Adds pagination to the specified query builder.
@param \Doctrine\ORM\QueryBuilder $queryBuilder
@param integer $elementsPerPage
@param integer $page
@return \Doctrine\ORM\QueryBuilder | [
"Adds",
"pagination",
"to",
"the",
"specified",
"query",
"builder",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L201-L209 |
17,515 | gibilogic/crud-bundle | Entity/EntityRepository.php | EntityRepository.hasJoin | protected function hasJoin(QueryBuilder $queryBuilder, $joinString)
{
/* @var \Doctrine\ORM\Query\Expr\Join $joinExpression */
foreach ($queryBuilder->getDQLPart('join') as $joinsList) {
foreach ($joinsList as $joinExpression) {
if ($joinExpression->getJoin() == $joinStri... | php | protected function hasJoin(QueryBuilder $queryBuilder, $joinString)
{
/* @var \Doctrine\ORM\Query\Expr\Join $joinExpression */
foreach ($queryBuilder->getDQLPart('join') as $joinsList) {
foreach ($joinsList as $joinExpression) {
if ($joinExpression->getJoin() == $joinStri... | [
"protected",
"function",
"hasJoin",
"(",
"QueryBuilder",
"$",
"queryBuilder",
",",
"$",
"joinString",
")",
"{",
"/* @var \\Doctrine\\ORM\\Query\\Expr\\Join $joinExpression */",
"foreach",
"(",
"$",
"queryBuilder",
"->",
"getDQLPart",
"(",
"'join'",
")",
"as",
"$",
"jo... | Returns TRUE if the join string is already present inside the query builder, FALSE otherwise.
@param \Doctrine\ORM\QueryBuilder $queryBuilder
@param string $joinString
@return boolean | [
"Returns",
"TRUE",
"if",
"the",
"join",
"string",
"is",
"already",
"present",
"inside",
"the",
"query",
"builder",
"FALSE",
"otherwise",
"."
] | 847e7c7bee4016026411eb230154f24986335633 | https://github.com/gibilogic/crud-bundle/blob/847e7c7bee4016026411eb230154f24986335633/Entity/EntityRepository.php#L218-L230 |
17,516 | 2amigos/yiifoundation | widgets/JoyRide.php | JoyRide.renderStop | public function renderStop($stop)
{
$options = array();
$options['data-id'] = ArrayHelper::getValue($stop, 'id');
$options['data-text'] = ArrayHelper::getValue($stop, 'text');
$options['data-button'] = ArrayHelper::getValue($stop, 'button');
$options[... | php | public function renderStop($stop)
{
$options = array();
$options['data-id'] = ArrayHelper::getValue($stop, 'id');
$options['data-text'] = ArrayHelper::getValue($stop, 'text');
$options['data-button'] = ArrayHelper::getValue($stop, 'button');
$options[... | [
"public",
"function",
"renderStop",
"(",
"$",
"stop",
")",
"{",
"$",
"options",
"=",
"array",
"(",
")",
";",
"$",
"options",
"[",
"'data-id'",
"]",
"=",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"stop",
",",
"'id'",
")",
";",
"$",
"options",
"[",
... | Renders a single stop
@param array $stop the stop configuration
@return string the resulting li tag | [
"Renders",
"a",
"single",
"stop"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/widgets/JoyRide.php#L124-L146 |
17,517 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Section/Table/Cell.php | PHPWord_Section_Table_Cell.addText | public function addText($text, $styleFont = null, $styleParagraph = null) {
$text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph);
$this->_elementCollection[] = $text;
return $text;
} | php | public function addText($text, $styleFont = null, $styleParagraph = null) {
$text = new PHPWord_Section_Text($text, $styleFont, $styleParagraph);
$this->_elementCollection[] = $text;
return $text;
} | [
"public",
"function",
"addText",
"(",
"$",
"text",
",",
"$",
"styleFont",
"=",
"null",
",",
"$",
"styleParagraph",
"=",
"null",
")",
"{",
"$",
"text",
"=",
"new",
"PHPWord_Section_Text",
"(",
"$",
"text",
",",
"$",
"styleFont",
",",
"$",
"styleParagraph"... | Add a Text Element
@param string $text
@param mixed $style
@return PHPWord_Section_Text | [
"Add",
"a",
"Text",
"Element"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L110-L114 |
17,518 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Section/Table/Cell.php | PHPWord_Section_Table_Cell.addObject | public function addObject($src, $style = null) {
$object = new PHPWord_Section_Object($src, $style);
if(!is_null($object->getSource())) {
$inf = pathinfo($src);
$ext = $inf['extension'];
if(strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') {
$ext = substr($ext, 0, -1);
}
... | php | public function addObject($src, $style = null) {
$object = new PHPWord_Section_Object($src, $style);
if(!is_null($object->getSource())) {
$inf = pathinfo($src);
$ext = $inf['extension'];
if(strlen($ext) == 4 && strtolower(substr($ext, -1)) == 'x') {
$ext = substr($ext, 0, -1);
}
... | [
"public",
"function",
"addObject",
"(",
"$",
"src",
",",
"$",
"style",
"=",
"null",
")",
"{",
"$",
"object",
"=",
"new",
"PHPWord_Section_Object",
"(",
"$",
"src",
",",
"$",
"style",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"object",
"->",
"g... | Add a OLE-Object Element
@param string $src
@param mixed $style
@return PHPWord_Section_Object | [
"Add",
"a",
"OLE",
"-",
"Object",
"Element"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L223-L254 |
17,519 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Section/Table/Cell.php | PHPWord_Section_Table_Cell.addPreserveText | public function addPreserveText($text, $styleFont = null, $styleParagraph = null) {
if($this->_insideOf == 'footer' || $this->_insideOf == 'header') {
$ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph);
$this->_elementCollection[] = $ptext;
return $ptext;
} else {
... | php | public function addPreserveText($text, $styleFont = null, $styleParagraph = null) {
if($this->_insideOf == 'footer' || $this->_insideOf == 'header') {
$ptext = new PHPWord_Section_Footer_PreserveText($text, $styleFont, $styleParagraph);
$this->_elementCollection[] = $ptext;
return $ptext;
} else {
... | [
"public",
"function",
"addPreserveText",
"(",
"$",
"text",
",",
"$",
"styleFont",
"=",
"null",
",",
"$",
"styleParagraph",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_insideOf",
"==",
"'footer'",
"||",
"$",
"this",
"->",
"_insideOf",
"==",
"... | Add a PreserveText Element
@param string $text
@param mixed $styleFont
@param mixed $styleParagraph
@return PHPWord_Section_Footer_PreserveText | [
"Add",
"a",
"PreserveText",
"Element"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L264-L272 |
17,520 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/Section/Table/Cell.php | PHPWord_Section_Table_Cell.createTextRun | public function createTextRun($styleParagraph = null) {
$textRun = new PHPWord_Section_TextRun($styleParagraph);
$this->_elementCollection[] = $textRun;
return $textRun;
} | php | public function createTextRun($styleParagraph = null) {
$textRun = new PHPWord_Section_TextRun($styleParagraph);
$this->_elementCollection[] = $textRun;
return $textRun;
} | [
"public",
"function",
"createTextRun",
"(",
"$",
"styleParagraph",
"=",
"null",
")",
"{",
"$",
"textRun",
"=",
"new",
"PHPWord_Section_TextRun",
"(",
"$",
"styleParagraph",
")",
";",
"$",
"this",
"->",
"_elementCollection",
"[",
"]",
"=",
"$",
"textRun",
";"... | Create a new TextRun
@return PHPWord_Section_TextRun | [
"Create",
"a",
"new",
"TextRun"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Section/Table/Cell.php#L279-L283 |
17,521 | webforge-labs/psc-cms | lib/PHPWord/PHPWord/TOC.php | PHPWord_TOC.addTitle | public static function addTitle($text, $depth = 0) {
$anchor = '_Toc'.++self::$_anchor;
$bookmarkId = self::$_bookmarkId++;
$title = array();
$title['text'] = $text;
$title['depth'] = $depth;
$title['anchor'] = $anchor;
$title['bookmarkId'] = $bookmarkId;
self::$_titles[] = $title;
... | php | public static function addTitle($text, $depth = 0) {
$anchor = '_Toc'.++self::$_anchor;
$bookmarkId = self::$_bookmarkId++;
$title = array();
$title['text'] = $text;
$title['depth'] = $depth;
$title['anchor'] = $anchor;
$title['bookmarkId'] = $bookmarkId;
self::$_titles[] = $title;
... | [
"public",
"static",
"function",
"addTitle",
"(",
"$",
"text",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"$",
"anchor",
"=",
"'_Toc'",
".",
"++",
"self",
"::",
"$",
"_anchor",
";",
"$",
"bookmarkId",
"=",
"self",
"::",
"$",
"_bookmarkId",
"++",
";",
"$... | Add a Title
@return array | [
"Add",
"a",
"Title"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/TOC.php#L113-L126 |
17,522 | webforge-labs/psc-cms | lib/Psc/Doctrine/Helper.php | Helper.reindex | public static function reindex($collection, $getIndex = 'getIdentifier') {
if (!Code::isTraversable($collection)) {
throw new \InvalidArgumentException('$collection muss Traversable sein. '.Code::varInfo($collection));
}
$getIndex = Code::castGetter($getIndex);
$ret = array();
foreach ($c... | php | public static function reindex($collection, $getIndex = 'getIdentifier') {
if (!Code::isTraversable($collection)) {
throw new \InvalidArgumentException('$collection muss Traversable sein. '.Code::varInfo($collection));
}
$getIndex = Code::castGetter($getIndex);
$ret = array();
foreach ($c... | [
"public",
"static",
"function",
"reindex",
"(",
"$",
"collection",
",",
"$",
"getIndex",
"=",
"'getIdentifier'",
")",
"{",
"if",
"(",
"!",
"Code",
"::",
"isTraversable",
"(",
"$",
"collection",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",... | Organisiert die Collection mit einem neuen Index
macht eine Kopie der $collection, deshalb erstmal nur array erlaubt, bis ich weiß, was da die arraycollection macht
@param string|Closure $getIndex wenn ein Closure wird als erster Parameter das Objekt der Collection übergeben. wenn ein string ist dies der Name des Gett... | [
"Organisiert",
"die",
"Collection",
"mit",
"einem",
"neuen",
"Index"
] | 467bfa2547e6b4fa487d2d7f35fa6cc618dbc763 | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/Helper.php#L48-L60 |
17,523 | CakeCMS/Core | src/Utility/Toolbar.php | Toolbar.getInstance | public static function getInstance($name = self::DEFAULT_NAME)
{
if (empty(self::$_instances[$name])) {
self::$_instances[$name] = new Toolbar($name);
}
return self::$_instances[$name];
} | php | public static function getInstance($name = self::DEFAULT_NAME)
{
if (empty(self::$_instances[$name])) {
self::$_instances[$name] = new Toolbar($name);
}
return self::$_instances[$name];
} | [
"public",
"static",
"function",
"getInstance",
"(",
"$",
"name",
"=",
"self",
"::",
"DEFAULT_NAME",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"_instances",
"[",
"$",
"name",
"]",
")",
")",
"{",
"self",
"::",
"$",
"_instances",
"[",
"$",
... | Get toolbar instance.
@param string $name
@return array|Toolbar | [
"Get",
"toolbar",
"instance",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L92-L99 |
17,524 | CakeCMS/Core | src/Utility/Toolbar.php | Toolbar.loadItemType | public function loadItemType($type)
{
$signature = md5($type);
if (isset($this->_buttons[$signature])) {
return $this->_buttons[$signature];
}
list($plugin, $name) = pluginSplit($type);
$alias = Slug::filter($name, '_');
$aliasClass = Inflector::classify(... | php | public function loadItemType($type)
{
$signature = md5($type);
if (isset($this->_buttons[$signature])) {
return $this->_buttons[$signature];
}
list($plugin, $name) = pluginSplit($type);
$alias = Slug::filter($name, '_');
$aliasClass = Inflector::classify(... | [
"public",
"function",
"loadItemType",
"(",
"$",
"type",
")",
"{",
"$",
"signature",
"=",
"md5",
"(",
"$",
"type",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_buttons",
"[",
"$",
"signature",
"]",
")",
")",
"{",
"return",
"$",
"this",
... | Load object of item type.
@param $type
@return ToolbarItem|bool | [
"Load",
"object",
"of",
"item",
"type",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L127-L146 |
17,525 | CakeCMS/Core | src/Utility/Toolbar.php | Toolbar.render | public function render()
{
$i = 0;
$output = [];
$count = count($this->_items);
foreach ($this->_items as $item) {
$i++;
$item['class'] = 'item-wrapper tb-item-' . $i;
if ($i == 1) {
$item['class'] .= ' first';
}
... | php | public function render()
{
$i = 0;
$output = [];
$count = count($this->_items);
foreach ($this->_items as $item) {
$i++;
$item['class'] = 'item-wrapper tb-item-' . $i;
if ($i == 1) {
$item['class'] .= ' first';
}
... | [
"public",
"function",
"render",
"(",
")",
"{",
"$",
"i",
"=",
"0",
";",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"count",
"=",
"count",
"(",
"$",
"this",
"->",
"_items",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_items",
"as",
"$",
"item",
... | Render toolbar items.
@return string
@SuppressWarnings(PHPMD.ShortVariable) | [
"Render",
"toolbar",
"items",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L167-L188 |
17,526 | CakeCMS/Core | src/Utility/Toolbar.php | Toolbar.renderItem | public function renderItem(&$node)
{
$type = $node[0];
$item = $this->loadItemType($type);
if ($item === false) {
return null;
}
return $item->render($node);
} | php | public function renderItem(&$node)
{
$type = $node[0];
$item = $this->loadItemType($type);
if ($item === false) {
return null;
}
return $item->render($node);
} | [
"public",
"function",
"renderItem",
"(",
"&",
"$",
"node",
")",
"{",
"$",
"type",
"=",
"$",
"node",
"[",
"0",
"]",
";",
"$",
"item",
"=",
"$",
"this",
"->",
"loadItemType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"item",
"===",
"false",
")"... | Render toolbar item html.
@param $node
@return null|string | [
"Render",
"toolbar",
"item",
"html",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L196-L206 |
17,527 | CakeCMS/Core | src/Utility/Toolbar.php | Toolbar._getItemClassName | protected function _getItemClassName($plugin, $aliasClass)
{
if ($plugin === null) {
$plugin = 'Core';
}
$buttonClass = $plugin . '.' . self::CLASS_NAME_PREFIX . $aliasClass;
$className = App::className($buttonClass, self::CLASS_TYPE);
if ($className === false... | php | protected function _getItemClassName($plugin, $aliasClass)
{
if ($plugin === null) {
$plugin = 'Core';
}
$buttonClass = $plugin . '.' . self::CLASS_NAME_PREFIX . $aliasClass;
$className = App::className($buttonClass, self::CLASS_TYPE);
if ($className === false... | [
"protected",
"function",
"_getItemClassName",
"(",
"$",
"plugin",
",",
"$",
"aliasClass",
")",
"{",
"if",
"(",
"$",
"plugin",
"===",
"null",
")",
"{",
"$",
"plugin",
"=",
"'Core'",
";",
"}",
"$",
"buttonClass",
"=",
"$",
"plugin",
".",
"'.'",
".",
"s... | Get full class name.
@param string $plugin
@param string $aliasClass
@return bool|string | [
"Get",
"full",
"class",
"name",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Utility/Toolbar.php#L215-L230 |
17,528 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._createIcon | protected function _createIcon(HtmlHelper $html, $title, array $options = [])
{
list($options, $iconOptions) = $this->_createIconAttr($options);
if (Arr::key('createIcon', $iconOptions)) {
unset($iconOptions['createIcon']);
$title = $html->icon($options['icon'], $iconOptions... | php | protected function _createIcon(HtmlHelper $html, $title, array $options = [])
{
list($options, $iconOptions) = $this->_createIconAttr($options);
if (Arr::key('createIcon', $iconOptions)) {
unset($iconOptions['createIcon']);
$title = $html->icon($options['icon'], $iconOptions... | [
"protected",
"function",
"_createIcon",
"(",
"HtmlHelper",
"$",
"html",
",",
"$",
"title",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"list",
"(",
"$",
"options",
",",
"$",
"iconOptions",
")",
"=",
"$",
"this",
"->",
"_createIconAttr",
"(",... | Create current icon.
@param HtmlHelper $html
@param string|int $title
@param array $options
@return array | [
"Create",
"current",
"icon",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L69-L84 |
17,529 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._createIconAttr | protected function _createIconAttr(array $options = [])
{
$iconOptions = ['class' => ''];
if (Arr::key('icon', $options)) {
if (Arr::key('iconClass', $options)) {
$iconOptions = $this->_addClass($iconOptions, $options['iconClass']);
unset($options['iconCl... | php | protected function _createIconAttr(array $options = [])
{
$iconOptions = ['class' => ''];
if (Arr::key('icon', $options)) {
if (Arr::key('iconClass', $options)) {
$iconOptions = $this->_addClass($iconOptions, $options['iconClass']);
unset($options['iconCl... | [
"protected",
"function",
"_createIconAttr",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"iconOptions",
"=",
"[",
"'class'",
"=>",
"''",
"]",
";",
"if",
"(",
"Arr",
"::",
"key",
"(",
"'icon'",
",",
"$",
"options",
")",
")",
"{",
"if"... | Create icon attributes.
@param array $options
@return array | [
"Create",
"icon",
"attributes",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L92-L106 |
17,530 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._getBtnClass | protected function _getBtnClass(array $options = [])
{
if (Arr::key('button', $options)) {
$button = $options['button'];
unset($options['button']);
if (is_callable($this->getConfig('prepareBtnClass'))) {
return (array) call_user_func($this->getConfig('pre... | php | protected function _getBtnClass(array $options = [])
{
if (Arr::key('button', $options)) {
$button = $options['button'];
unset($options['button']);
if (is_callable($this->getConfig('prepareBtnClass'))) {
return (array) call_user_func($this->getConfig('pre... | [
"protected",
"function",
"_getBtnClass",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"'button'",
",",
"$",
"options",
")",
")",
"{",
"$",
"button",
"=",
"$",
"options",
"[",
"'button'",
"]",
";",
"unse... | Create and get button classes.
@param array $options
@return array | [
"Create",
"and",
"get",
"button",
"classes",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L114-L128 |
17,531 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._getToolTipAttr | protected function _getToolTipAttr(array $options = [], $toggle = 'tooltip')
{
if (Arr::key('tooltip', $options)) {
$tooltip = $options['tooltip'];
unset($options['tooltip']);
if (is_callable($this->getConfig('prepareTooltip'))) {
return (array) call_user... | php | protected function _getToolTipAttr(array $options = [], $toggle = 'tooltip')
{
if (Arr::key('tooltip', $options)) {
$tooltip = $options['tooltip'];
unset($options['tooltip']);
if (is_callable($this->getConfig('prepareTooltip'))) {
return (array) call_user... | [
"protected",
"function",
"_getToolTipAttr",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"toggle",
"=",
"'tooltip'",
")",
"{",
"if",
"(",
"Arr",
"::",
"key",
"(",
"'tooltip'",
",",
"$",
"options",
")",
")",
"{",
"$",
"tooltip",
"=",
"$",
... | Create and get tooltip attributes.
@param array $options
@param string $toggle
@return array | [
"Create",
"and",
"get",
"tooltip",
"attributes",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L137-L163 |
17,532 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._prepareBeforeAfterContainer | protected function _prepareBeforeAfterContainer($type, $value)
{
$output = null;
$iconClass = ($type === 'before') ? 'prefix' : 'postfix';
if ($value !== null) {
$output = $value;
if (is_string($output)) {
$hasIcon = preg_match('/icon:[a-zA-Z]/', $... | php | protected function _prepareBeforeAfterContainer($type, $value)
{
$output = null;
$iconClass = ($type === 'before') ? 'prefix' : 'postfix';
if ($value !== null) {
$output = $value;
if (is_string($output)) {
$hasIcon = preg_match('/icon:[a-zA-Z]/', $... | [
"protected",
"function",
"_prepareBeforeAfterContainer",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"$",
"output",
"=",
"null",
";",
"$",
"iconClass",
"=",
"(",
"$",
"type",
"===",
"'before'",
")",
"?",
"'prefix'",
":",
"'postfix'",
";",
"if",
"(",
... | Prepare before after content for input container.
@param string|int $type Set before or after flag.
@param string|int $value
@return null|string | [
"Prepare",
"before",
"after",
"content",
"for",
"input",
"container",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L172-L190 |
17,533 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._setBtnClass | protected function _setBtnClass($button, array $options = [])
{
if ($button !== true) {
$classes = [$this->_configRead('btnPref')];
foreach ((array) $button as $button) {
$classes[] = $this->_configRead('btnPref') . '-' . $button;
}
$options = ... | php | protected function _setBtnClass($button, array $options = [])
{
if ($button !== true) {
$classes = [$this->_configRead('btnPref')];
foreach ((array) $button as $button) {
$classes[] = $this->_configRead('btnPref') . '-' . $button;
}
$options = ... | [
"protected",
"function",
"_setBtnClass",
"(",
"$",
"button",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"button",
"!==",
"true",
")",
"{",
"$",
"classes",
"=",
"[",
"$",
"this",
"->",
"_configRead",
"(",
"'btnPref'",
")",
... | Setup button classes by options.
@param string $button
@param array $options
@return array | [
"Setup",
"button",
"classes",
"by",
"options",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L199-L210 |
17,534 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._setIconOptions | protected function _setIconOptions(array $options = [], array $iconOptions = [])
{
$icon = $options['icon'];
if (Arr::key('iconInline', $options)) {
$iconPrefix = $this->_configRead('iconPref');
$options = $this->_addClass($options, implode(' ', [
$this->_clas... | php | protected function _setIconOptions(array $options = [], array $iconOptions = [])
{
$icon = $options['icon'];
if (Arr::key('iconInline', $options)) {
$iconPrefix = $this->_configRead('iconPref');
$options = $this->_addClass($options, implode(' ', [
$this->_clas... | [
"protected",
"function",
"_setIconOptions",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"array",
"$",
"iconOptions",
"=",
"[",
"]",
")",
"{",
"$",
"icon",
"=",
"$",
"options",
"[",
"'icon'",
"]",
";",
"if",
"(",
"Arr",
"::",
"key",
"(",
"'ico... | Setup icon options.
@param array $options
@param array $iconOptions
@return array | [
"Setup",
"icon",
"options",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L219-L237 |
17,535 | CakeCMS/Core | src/View/Helper/Traits/HelperTrait.php | HelperTrait._setTooltipTitle | protected function _setTooltipTitle($tooltip, array $options = [])
{
if ($tooltip === true && !Arr::key('title', $options)) {
$options['title'] = strip_tags($options['label']);
}
if (is_string($tooltip)) {
$options['title'] = $tooltip;
}
return $opti... | php | protected function _setTooltipTitle($tooltip, array $options = [])
{
if ($tooltip === true && !Arr::key('title', $options)) {
$options['title'] = strip_tags($options['label']);
}
if (is_string($tooltip)) {
$options['title'] = $tooltip;
}
return $opti... | [
"protected",
"function",
"_setTooltipTitle",
"(",
"$",
"tooltip",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"tooltip",
"===",
"true",
"&&",
"!",
"Arr",
"::",
"key",
"(",
"'title'",
",",
"$",
"options",
")",
")",
"{",
"$... | Setup tooltip title by options.
@param string $tooltip
@param array $options
@return array | [
"Setup",
"tooltip",
"title",
"by",
"options",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/Traits/HelperTrait.php#L246-L257 |
17,536 | aryelgois/yasql-php | src/Utils.php | Utils.arrayAppendLast | public static function arrayAppendLast(
array $array,
string $last,
string $others = null
) {
$count = count($array);
foreach ($array as $key => $value) {
$array[$key] = $value . (--$count > 0 ? $others : $last);
}
return $array;
} | php | public static function arrayAppendLast(
array $array,
string $last,
string $others = null
) {
$count = count($array);
foreach ($array as $key => $value) {
$array[$key] = $value . (--$count > 0 ? $others : $last);
}
return $array;
} | [
"public",
"static",
"function",
"arrayAppendLast",
"(",
"array",
"$",
"array",
",",
"string",
"$",
"last",
",",
"string",
"$",
"others",
"=",
"null",
")",
"{",
"$",
"count",
"=",
"count",
"(",
"$",
"array",
")",
";",
"foreach",
"(",
"$",
"array",
"as... | Appends a string to the last item in an array
Optionally, appends a string to the other items
@param string[] $array Array to receive data
@param string $last Appended to the last item
@param string $others Appended to the other items | [
"Appends",
"a",
"string",
"to",
"the",
"last",
"item",
"in",
"an",
"array"
] | f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7 | https://github.com/aryelgois/yasql-php/blob/f428b180d35bfc1ddf1f9b3323f9b085fbc09ac7/src/Utils.php#L28-L38 |
17,537 | barebone-php/barebone-core | lib/Request.php | Request.getContentType | public function getContentType()
{
$contentType = null;
$_contentType = $this->getHeader('Content-Type');
if (!empty($_contentType)) {
$_contentType = explode(';', $_contentType[0]);
$contentType = $_contentType[0];
}
return $contentType;
} | php | public function getContentType()
{
$contentType = null;
$_contentType = $this->getHeader('Content-Type');
if (!empty($_contentType)) {
$_contentType = explode(';', $_contentType[0]);
$contentType = $_contentType[0];
}
return $contentType;
} | [
"public",
"function",
"getContentType",
"(",
")",
"{",
"$",
"contentType",
"=",
"null",
";",
"$",
"_contentType",
"=",
"$",
"this",
"->",
"getHeader",
"(",
"'Content-Type'",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"_contentType",
")",
")",
"{",
"$... | Get primary content-type header without encoding info
@return string|null | [
"Get",
"primary",
"content",
"-",
"type",
"header",
"without",
"encoding",
"info"
] | 7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc | https://github.com/barebone-php/barebone-core/blob/7fda3a62d5fa103cdc4d2d34e1adf8f3ccbfe2bc/lib/Request.php#L132-L142 |
17,538 | flextype-components/http | Http.php | Http.setResponseStatus | public static function setResponseStatus(int $status) : void
{
if (array_key_exists($status, Http::$http_status_messages)) {
header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]);
}
} | php | public static function setResponseStatus(int $status) : void
{
if (array_key_exists($status, Http::$http_status_messages)) {
header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]);
}
} | [
"public",
"static",
"function",
"setResponseStatus",
"(",
"int",
"$",
"status",
")",
":",
"void",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"status",
",",
"Http",
"::",
"$",
"http_status_messages",
")",
")",
"{",
"header",
"(",
"'HTTP/1.1 '",
".",
"$",... | Set response header status
Http::setResponseStatus(404);
@param integer $status Status code
@return void | [
"Set",
"response",
"header",
"status"
] | 97c352f79b216355ba655a1cefcdbe69c134dee5 | https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L95-L100 |
17,539 | flextype-components/http | Http.php | Http.getBaseUrl | public static function getBaseUrl() : string
{
$https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';
return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/');
} | php | public static function getBaseUrl() : string
{
$https = (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://';
return $https . rtrim(rtrim($_SERVER['HTTP_HOST'], '\\/') . dirname($_SERVER['PHP_SELF']), '\\/');
} | [
"public",
"static",
"function",
"getBaseUrl",
"(",
")",
":",
"string",
"{",
"$",
"https",
"=",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTPS'",
"]",
")",
"&&",
"strtolower",
"(",
"$",
"_SERVER",
"[",
"'HTTPS'",
"]",
")",
"==",
"'on'",
")",
"?",
"... | Gets the base URL
echo Http::getBaseUrl();
@return string | [
"Gets",
"the",
"base",
"URL"
] | 97c352f79b216355ba655a1cefcdbe69c134dee5 | https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L189-L194 |
17,540 | flextype-components/http | Http.php | Http.getUriString | public static function getUriString() : string
{
// Get request url and script url
$url = '';
$request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';
$script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';
// Get our url path and tri... | php | public static function getUriString() : string
{
// Get request url and script url
$url = '';
$request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : '';
$script_url = (isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : '';
// Get our url path and tri... | [
"public",
"static",
"function",
"getUriString",
"(",
")",
":",
"string",
"{",
"// Get request url and script url",
"$",
"url",
"=",
"''",
";",
"$",
"request_url",
"=",
"(",
"isset",
"(",
"$",
"_SERVER",
"[",
"'REQUEST_URI'",
"]",
")",
")",
"?",
"$",
"_SERV... | Get Uri String
$uri_string = Http::getUriString();
@access public
@return string | [
"Get",
"Uri",
"String"
] | 97c352f79b216355ba655a1cefcdbe69c134dee5 | https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L216-L231 |
17,541 | flextype-components/http | Http.php | Http.getUriSegment | public static function getUriSegment(int $segment)
{
$segments = self::getUriSegments();
return isset($segments[$segment]) ? $segments[$segment] : null;
} | php | public static function getUriSegment(int $segment)
{
$segments = self::getUriSegments();
return isset($segments[$segment]) ? $segments[$segment] : null;
} | [
"public",
"static",
"function",
"getUriSegment",
"(",
"int",
"$",
"segment",
")",
"{",
"$",
"segments",
"=",
"self",
"::",
"getUriSegments",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"segments",
"[",
"$",
"segment",
"]",
")",
"?",
"$",
"segments",
"[... | Get Uri Segment
$uri_segment = Http::getUriSegment(1);
@access public
@param int $segment segment
@return string | [
"Get",
"Uri",
"Segment"
] | 97c352f79b216355ba655a1cefcdbe69c134dee5 | https://github.com/flextype-components/http/blob/97c352f79b216355ba655a1cefcdbe69c134dee5/Http.php#L255-L259 |
17,542 | npbtrac/yii2-enpii-cms | libs/override/web/NpUrlManager.php | NpUrlManager.matchCode | protected function matchCode($code)
{
$language = $code;
$country = null;
$parts = explode('-', $code);
if (count($parts)===2) {
$language = $parts[0];
$country = strtoupper($parts[1]);
}
if (in_array($code, $this->languages)) {
return [$language, $country];
} elseif (
$country && in_array("$... | php | protected function matchCode($code)
{
$language = $code;
$country = null;
$parts = explode('-', $code);
if (count($parts)===2) {
$language = $parts[0];
$country = strtoupper($parts[1]);
}
if (in_array($code, $this->languages)) {
return [$language, $country];
} elseif (
$country && in_array("$... | [
"protected",
"function",
"matchCode",
"(",
"$",
"code",
")",
"{",
"$",
"language",
"=",
"$",
"code",
";",
"$",
"country",
"=",
"null",
";",
"$",
"parts",
"=",
"explode",
"(",
"'-'",
",",
"$",
"code",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parts... | Tests whether the given code matches any of the configured languages.
If the code is a single language code, and matches either
- an exact language as configured (ll)
- a language with a country wildcard (ll-*)
this language code is returned.
If the code also contains a country code, and matches either
- an exact ... | [
"Tests",
"whether",
"the",
"given",
"code",
"matches",
"any",
"of",
"the",
"configured",
"languages",
"."
] | 3495e697509a57a573983f552629ff9f707a63b9 | https://github.com/npbtrac/yii2-enpii-cms/blob/3495e697509a57a573983f552629ff9f707a63b9/libs/override/web/NpUrlManager.php#L363-L384 |
17,543 | slashworks/control-bundle | src/Slashworks/AppBundle/Controller/AboutController.php | AboutController.aboutAction | public function aboutAction()
{
$oLicense = LicenseQuery::create()->findOne();
// include symfony requirements class
require_once dirname(__FILE__) . '/../../../../app/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
//... | php | public function aboutAction()
{
$oLicense = LicenseQuery::create()->findOne();
// include symfony requirements class
require_once dirname(__FILE__) . '/../../../../app/SymfonyRequirements.php';
$symfonyRequirements = new \SymfonyRequirements();
//... | [
"public",
"function",
"aboutAction",
"(",
")",
"{",
"$",
"oLicense",
"=",
"LicenseQuery",
"::",
"create",
"(",
")",
"->",
"findOne",
"(",
")",
";",
"// include symfony requirements class",
"require_once",
"dirname",
"(",
"__FILE__",
")",
".",
"'/../../../../app/Sy... | Display form for license activation
@return \Symfony\Component\HttpFoundation\Response | [
"Display",
"form",
"for",
"license",
"activation"
] | 2ba86d96f1f41f9424e2229c4e2b13017e973f89 | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Controller/AboutController.php#L44-L72 |
17,544 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.initialize | public function initialize(array $config)
{
$isMaterializeCss = $this->getConfig('materializeCss', false);
if ($isMaterializeCss === true) {
$this->_configWrite('prepareBtnClass', function (Helper $form, $options, $button) {
return $this->_prepareBtn($form, $options, $bu... | php | public function initialize(array $config)
{
$isMaterializeCss = $this->getConfig('materializeCss', false);
if ($isMaterializeCss === true) {
$this->_configWrite('prepareBtnClass', function (Helper $form, $options, $button) {
return $this->_prepareBtn($form, $options, $bu... | [
"public",
"function",
"initialize",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"isMaterializeCss",
"=",
"$",
"this",
"->",
"getConfig",
"(",
"'materializeCss'",
",",
"false",
")",
";",
"if",
"(",
"$",
"isMaterializeCss",
"===",
"true",
")",
"{",
"$",
"t... | Constructor hook method. Implement this method to avoid having to overwrite the constructor and call parent.
@param array $config The configuration settings provided to this helper.
@return void | [
"Constructor",
"hook",
"method",
".",
"Implement",
"this",
"method",
"to",
"avoid",
"having",
"to",
"overwrite",
"the",
"constructor",
"and",
"call",
"parent",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L90-L105 |
17,545 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.getAssets | public function getAssets($key)
{
$value = Hash::get($this->_assets, $key);
if (is_string($value)) {
return $value;
}
return Hash::sort((array) $value, '{n}.weight', 'asc');
} | php | public function getAssets($key)
{
$value = Hash::get($this->_assets, $key);
if (is_string($value)) {
return $value;
}
return Hash::sort((array) $value, '{n}.weight', 'asc');
} | [
"public",
"function",
"getAssets",
"(",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"Hash",
"::",
"get",
"(",
"$",
"this",
"->",
"_assets",
",",
"$",
"key",
")",
";",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
... | Get sort assets included list.
@param string $key
@return array|null|string | [
"Get",
"sort",
"assets",
"included",
"list",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L126-L134 |
17,546 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.icon | public function icon($icon = 'home', array $options = [])
{
$iconPref = $this->_configRead('iconPref');
$_classes = [
$this->_class(__FUNCTION__),
$iconPref,
$iconPref . '-' . $icon,
];
$options = $this->_addClass($options, implode(' ', $_classes)... | php | public function icon($icon = 'home', array $options = [])
{
$iconPref = $this->_configRead('iconPref');
$_classes = [
$this->_class(__FUNCTION__),
$iconPref,
$iconPref . '-' . $icon,
];
$options = $this->_addClass($options, implode(' ', $_classes)... | [
"public",
"function",
"icon",
"(",
"$",
"icon",
"=",
"'home'",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"iconPref",
"=",
"$",
"this",
"->",
"_configRead",
"(",
"'iconPref'",
")",
";",
"$",
"_classes",
"=",
"[",
"$",
"this",
"->",... | Create icon element.
@param string $icon
@param array $options
@return null|string | [
"Create",
"icon",
"element",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L143-L161 |
17,547 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.less | public function less($path, array $options = [])
{
$cssPath = [];
if (!Arr::key('force', $options)) {
$options['force'] = false;
}
if (is_array($path)) {
foreach ($path as $i) {
if ($result = $this->Less->process($i, $options['force'])) {
... | php | public function less($path, array $options = [])
{
$cssPath = [];
if (!Arr::key('force', $options)) {
$options['force'] = false;
}
if (is_array($path)) {
foreach ($path as $i) {
if ($result = $this->Less->process($i, $options['force'])) {
... | [
"public",
"function",
"less",
"(",
"$",
"path",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"cssPath",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"Arr",
"::",
"key",
"(",
"'force'",
",",
"$",
"options",
")",
")",
"{",
"$",
"options",
... | Creates a CSS stylesheets from less.
@param string|array $path
@param array $options
@return null|string
@throws \JBZoo\Less\Exception | [
"Creates",
"a",
"CSS",
"stylesheets",
"from",
"less",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L172-L193 |
17,548 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.link | public function link($title, $url = null, array $options = [])
{
$options = $this->addClass($options, $this->_class(__FUNCTION__));
$options = Hash::merge([
'escapeTitle' => false,
'clear' => false,
'label' => $title,
], $options);
$is... | php | public function link($title, $url = null, array $options = [])
{
$options = $this->addClass($options, $this->_class(__FUNCTION__));
$options = Hash::merge([
'escapeTitle' => false,
'clear' => false,
'label' => $title,
], $options);
$is... | [
"public",
"function",
"link",
"(",
"$",
"title",
",",
"$",
"url",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"options",
"=",
"$",
"this",
"->",
"addClass",
"(",
"$",
"options",
",",
"$",
"this",
"->",
"_class",
"(",
... | Create an html link.
@param string $title
@param null|string|array $url
@param array $options
@return string | [
"Create",
"an",
"html",
"link",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L203-L229 |
17,549 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.status | public function status($status = 0, array $url = [], $icon = 'circle')
{
$class = (int) $status === 1 ? 'ck-green' : 'ck-red';
if (count($url) === 0) {
return $this->icon($icon, ['class' => $class]);
}
return $this->link(null, 'javascript:void(0);', [
'icon' ... | php | public function status($status = 0, array $url = [], $icon = 'circle')
{
$class = (int) $status === 1 ? 'ck-green' : 'ck-red';
if (count($url) === 0) {
return $this->icon($icon, ['class' => $class]);
}
return $this->link(null, 'javascript:void(0);', [
'icon' ... | [
"public",
"function",
"status",
"(",
"$",
"status",
"=",
"0",
",",
"array",
"$",
"url",
"=",
"[",
"]",
",",
"$",
"icon",
"=",
"'circle'",
")",
"{",
"$",
"class",
"=",
"(",
"int",
")",
"$",
"status",
"===",
"1",
"?",
"'ck-green'",
":",
"'ck-red'",... | Create status icon or link.
@param int $status
@param array $url
@param string $icon
@return null|string | [
"Create",
"status",
"icon",
"or",
"link",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L251-L263 |
17,550 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper.toggle | public function toggle(Entity $entity, array $url = [], array $data = [])
{
if (count($url) === 0) {
$url = [
'action' => 'toggle',
'prefix' => $this->request->getParam('prefix'),
'plugin' => $this->request->getParam('plugin'),
... | php | public function toggle(Entity $entity, array $url = [], array $data = [])
{
if (count($url) === 0) {
$url = [
'action' => 'toggle',
'prefix' => $this->request->getParam('prefix'),
'plugin' => $this->request->getParam('plugin'),
... | [
"public",
"function",
"toggle",
"(",
"Entity",
"$",
"entity",
",",
"array",
"$",
"url",
"=",
"[",
"]",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"url",
")",
"===",
"0",
")",
"{",
"$",
"url",
"=",
"[",
... | Create and render ajax toggle element.
@param Entity $entity
@param array $url
@param array $data
@return string | [
"Create",
"and",
"render",
"ajax",
"toggle",
"element",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L273-L292 |
17,551 | CakeCMS/Core | src/View/Helper/HtmlHelper.php | HtmlHelper._setTitleAttr | protected function _setTitleAttr($title, array $options = [])
{
if (!Arr::key('title', $options)) {
$options['title'] = strip_tags($title);
}
return $options;
} | php | protected function _setTitleAttr($title, array $options = [])
{
if (!Arr::key('title', $options)) {
$options['title'] = strip_tags($title);
}
return $options;
} | [
"protected",
"function",
"_setTitleAttr",
"(",
"$",
"title",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"!",
"Arr",
"::",
"key",
"(",
"'title'",
",",
"$",
"options",
")",
")",
"{",
"$",
"options",
"[",
"'title'",
"]",
"=",
... | Setup default title attr.
@param string $title
@param array $options
@return array | [
"Setup",
"default",
"title",
"attr",
"."
] | f9cba7aa0043a10e5c35bd45fbad158688a09a96 | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/View/Helper/HtmlHelper.php#L314-L321 |
17,552 | joomlatools/joomlatools-platform-legacy | code/utilities/xmlelement.php | JXMLElement.asFormattedXml | public function asFormattedXml($compressed = false, $indent = "\t", $level = 0)
{
JLog::add('JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.', JLog::WARNING, 'deprecated');
$out = '';
// Start a new line, indent by the number indicated in $level
$out .= ($compressed) ? '' :... | php | public function asFormattedXml($compressed = false, $indent = "\t", $level = 0)
{
JLog::add('JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.', JLog::WARNING, 'deprecated');
$out = '';
// Start a new line, indent by the number indicated in $level
$out .= ($compressed) ? '' :... | [
"public",
"function",
"asFormattedXml",
"(",
"$",
"compressed",
"=",
"false",
",",
"$",
"indent",
"=",
"\"\\t\"",
",",
"$",
"level",
"=",
"0",
")",
"{",
"JLog",
"::",
"add",
"(",
"'JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.'",
... | Return a well-formed XML string based on SimpleXML element
@param boolean $compressed Should we use indentation and newlines ?
@param string $indent Indention character.
@param integer $level The level within the document which informs the indentation.
@return string
@since 11.1
@deprecated ... | [
"Return",
"a",
"well",
"-",
"formed",
"XML",
"string",
"based",
"on",
"SimpleXML",
"element"
] | 3a76944e2f2c415faa6504754c75321a3b478c06 | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/utilities/xmlelement.php#L49-L103 |
17,553 | steeffeen/FancyManiaLinks | FML/Script/Features/ValuePickerFeature.php | ValuePickerFeature.setLabel | public function setLabel(Label $label)
{
$label->checkId();
$label->setScriptEvents(true);
$this->label = $label;
return $this;
} | php | public function setLabel(Label $label)
{
$label->checkId();
$label->setScriptEvents(true);
$this->label = $label;
return $this;
} | [
"public",
"function",
"setLabel",
"(",
"Label",
"$",
"label",
")",
"{",
"$",
"label",
"->",
"checkId",
"(",
")",
";",
"$",
"label",
"->",
"setScriptEvents",
"(",
"true",
")",
";",
"$",
"this",
"->",
"label",
"=",
"$",
"label",
";",
"return",
"$",
"... | Set the Label
@api
@param Label $label Label
@return static | [
"Set",
"the",
"Label"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L93-L99 |
17,554 | steeffeen/FancyManiaLinks | FML/Script/Features/ValuePickerFeature.php | ValuePickerFeature.setValues | public function setValues(array $values)
{
$this->values = array();
foreach ($values as $value) {
$this->addValue($value);
}
return $this;
} | php | public function setValues(array $values)
{
$this->values = array();
foreach ($values as $value) {
$this->addValue($value);
}
return $this;
} | [
"public",
"function",
"setValues",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"this",
"->",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addValue",
"(",
"$",
"value",
")",
... | Set the possible values
@api
@param string[] $values Possible values
@return static | [
"Set",
"the",
"possible",
"values"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L157-L164 |
17,555 | steeffeen/FancyManiaLinks | FML/Script/Features/ValuePickerFeature.php | ValuePickerFeature.getDefault | public function getDefault()
{
if ($this->default) {
return $this->default;
}
if (!empty($this->values)) {
return reset($this->values);
}
return null;
} | php | public function getDefault()
{
if ($this->default) {
return $this->default;
}
if (!empty($this->values)) {
return reset($this->values);
}
return null;
} | [
"public",
"function",
"getDefault",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"default",
")",
"{",
"return",
"$",
"this",
"->",
"default",
";",
"}",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"values",
")",
")",
"{",
"return",
"reset",
"... | Get the default value
@api
@return string | [
"Get",
"the",
"default",
"value"
] | 227b0759306f0a3c75873ba50276e4163a93bfa6 | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ValuePickerFeature.php#L172-L181 |
17,556 | alphayax/phpdoc_md | src/models/NamespaceMd.php | NamespaceMd.generateTree | public function generateTree( $pad = '', $relativePath = '') {
$generatedMd = '';
/// SubPages
if( ! empty( $this->subPages)){
foreach( $this->subPages as $subPageName => $subPage){
$subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage-... | php | public function generateTree( $pad = '', $relativePath = '') {
$generatedMd = '';
/// SubPages
if( ! empty( $this->subPages)){
foreach( $this->subPages as $subPageName => $subPage){
$subPageFile = './' . $relativePath . $subPageName . DIRECTORY_SEPARATOR . $subPage-... | [
"public",
"function",
"generateTree",
"(",
"$",
"pad",
"=",
"''",
",",
"$",
"relativePath",
"=",
"''",
")",
"{",
"$",
"generatedMd",
"=",
"''",
";",
"/// SubPages",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"subPages",
")",
")",
"{",
"foreach"... | Generate overview markdown tree
@param string $pad
@param string $relativePath
@return string | [
"Generate",
"overview",
"markdown",
"tree"
] | 326da10b837161591a32ab4f36f9b2f4feabbe65 | https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/NamespaceMd.php#L73-L96 |
17,557 | alphayax/phpdoc_md | src/models/NamespaceMd.php | NamespaceMd.write | public function write(){
$m = new \Mustache_Engine([
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views')
]);
$template = $m->loadTemplate('Page');
$generatedMd = $template->render( $this);
$this->writeSubPages();
/// Write page
... | php | public function write(){
$m = new \Mustache_Engine([
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__.'/../views')
]);
$template = $m->loadTemplate('Page');
$generatedMd = $template->render( $this);
$this->writeSubPages();
/// Write page
... | [
"public",
"function",
"write",
"(",
")",
"{",
"$",
"m",
"=",
"new",
"\\",
"Mustache_Engine",
"(",
"[",
"'loader'",
"=>",
"new",
"\\",
"Mustache_Loader_FilesystemLoader",
"(",
"__DIR__",
".",
"'/../views'",
")",
"]",
")",
";",
"$",
"template",
"=",
"$",
"... | Write markdown file | [
"Write",
"markdown",
"file"
] | 326da10b837161591a32ab4f36f9b2f4feabbe65 | https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/NamespaceMd.php#L101-L115 |
17,558 | alphayax/phpdoc_md | src/models/NamespaceMd.php | NamespaceMd.writeSubPages | public function writeSubPages() {
foreach( $this->subPages as $subPageName => $subPage) {
$subPageDirectory = $this->page_rd . DIRECTORY_SEPARATOR . $subPageName;
$subPage->setDirectory( $subPageDirectory);
$subPage->write();
}
} | php | public function writeSubPages() {
foreach( $this->subPages as $subPageName => $subPage) {
$subPageDirectory = $this->page_rd . DIRECTORY_SEPARATOR . $subPageName;
$subPage->setDirectory( $subPageDirectory);
$subPage->write();
}
} | [
"public",
"function",
"writeSubPages",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"subPages",
"as",
"$",
"subPageName",
"=>",
"$",
"subPage",
")",
"{",
"$",
"subPageDirectory",
"=",
"$",
"this",
"->",
"page_rd",
".",
"DIRECTORY_SEPARATOR",
".",
"$",... | Write sub pages of this page | [
"Write",
"sub",
"pages",
"of",
"this",
"page"
] | 326da10b837161591a32ab4f36f9b2f4feabbe65 | https://github.com/alphayax/phpdoc_md/blob/326da10b837161591a32ab4f36f9b2f4feabbe65/src/models/NamespaceMd.php#L120-L126 |
17,559 | userfriendly/SocialUserBundle | Model/UserIdentity.php | UserIdentity.getReadableType | static public function getReadableType( $type )
{
switch ( $type )
{
case self::TYPE_GOOGLE: return 'google';
case self::TYPE_FACEBOOK: return 'facebook';
case self::TYPE_YAHOO: return 'yahoo';
case self::TYPE_TWITTER: return 'twitter';
... | php | static public function getReadableType( $type )
{
switch ( $type )
{
case self::TYPE_GOOGLE: return 'google';
case self::TYPE_FACEBOOK: return 'facebook';
case self::TYPE_YAHOO: return 'yahoo';
case self::TYPE_TWITTER: return 'twitter';
... | [
"static",
"public",
"function",
"getReadableType",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"self",
"::",
"TYPE_GOOGLE",
":",
"return",
"'google'",
";",
"case",
"self",
"::",
"TYPE_FACEBOOK",
":",
"return",
"'facebook'",
";... | Convert type to human-readable form
@param integer $type
@return string | [
"Convert",
"type",
"to",
"human",
"-",
"readable",
"form"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Model/UserIdentity.php#L112-L121 |
17,560 | userfriendly/SocialUserBundle | Model/UserIdentity.php | UserIdentity.getStorableType | static public function getStorableType( $type )
{
switch ( $type )
{
case 'google': return self::TYPE_GOOGLE;
case 'facebook': return self::TYPE_FACEBOOK;
case 'yahoo': return self::TYPE_YAHOO;
case 'twitter': return self::TYPE_TWITTE... | php | static public function getStorableType( $type )
{
switch ( $type )
{
case 'google': return self::TYPE_GOOGLE;
case 'facebook': return self::TYPE_FACEBOOK;
case 'yahoo': return self::TYPE_YAHOO;
case 'twitter': return self::TYPE_TWITTE... | [
"static",
"public",
"function",
"getStorableType",
"(",
"$",
"type",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'google'",
":",
"return",
"self",
"::",
"TYPE_GOOGLE",
";",
"case",
"'facebook'",
":",
"return",
"self",
"::",
"TYPE_FACEBOOK",
";... | Convert human-readable type to integer
@param string $type
@return integer | [
"Convert",
"human",
"-",
"readable",
"type",
"to",
"integer"
] | 1dfcf76af2bc639901c471e6f28b04d73fb65452 | https://github.com/userfriendly/SocialUserBundle/blob/1dfcf76af2bc639901c471e6f28b04d73fb65452/Model/UserIdentity.php#L129-L138 |
17,561 | aedart/laravel-helpers | src/Traits/Logging/PsrLogTrait.php | PsrLogTrait.getPsrLog | public function getPsrLog(): ?LoggerInterface
{
if (!$this->hasPsrLog()) {
$this->setPsrLog($this->getDefaultPsrLog());
}
return $this->psrLog;
} | php | public function getPsrLog(): ?LoggerInterface
{
if (!$this->hasPsrLog()) {
$this->setPsrLog($this->getDefaultPsrLog());
}
return $this->psrLog;
} | [
"public",
"function",
"getPsrLog",
"(",
")",
":",
"?",
"LoggerInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPsrLog",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setPsrLog",
"(",
"$",
"this",
"->",
"getDefaultPsrLog",
"(",
")",
")",
";",
"}",
... | Get psr log
If no psr log has been set, this method will
set and return a default psr log, if any such
value is available
@see getDefaultPsrLog()
@return LoggerInterface|null psr log or null if none psr log has been set | [
"Get",
"psr",
"log"
] | 8b81a2d6658f3f8cb62b6be2c34773aaa2df219a | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Logging/PsrLogTrait.php#L53-L59 |
17,562 | benmanu/silverstripe-knowledgebase | code/forms/KnowledgeBaseSearchForm.php | KnowledgeBaseSearchForm.doSearchKnowledgeBase | public function doSearchKnowledgeBase($data, $form)
{
if (!$this->kbPageId) {
return $this->controller->redirectBack();
}
$page = KnowledgebasePage::get()->byID($this->kbPageId);
// just in case the page doesn't actually exist anymore
if (!$page) {
r... | php | public function doSearchKnowledgeBase($data, $form)
{
if (!$this->kbPageId) {
return $this->controller->redirectBack();
}
$page = KnowledgebasePage::get()->byID($this->kbPageId);
// just in case the page doesn't actually exist anymore
if (!$page) {
r... | [
"public",
"function",
"doSearchKnowledgeBase",
"(",
"$",
"data",
",",
"$",
"form",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"kbPageId",
")",
"{",
"return",
"$",
"this",
"->",
"controller",
"->",
"redirectBack",
"(",
")",
";",
"}",
"$",
"page",
"=... | Handler for the form submission.
@param array $data
@param Form $form
@return SS_HTTPResponse | [
"Handler",
"for",
"the",
"form",
"submission",
"."
] | db19bfd4836f43da17ab52e8b53e72a11be64210 | https://github.com/benmanu/silverstripe-knowledgebase/blob/db19bfd4836f43da17ab52e8b53e72a11be64210/code/forms/KnowledgeBaseSearchForm.php#L62-L83 |
17,563 | 2amigos/yiifoundation | helpers/Button.php | Button.group | public static function group($buttons, $htmlOptions = array())
{
ArrayHelper::addValue('class', 'button-group', $htmlOptions);
ob_start();
echo \CHtml::openTag('ul', $htmlOptions);
foreach ($buttons as $button) {
echo $button;
}
echo \CHtml::closeTag('ul'... | php | public static function group($buttons, $htmlOptions = array())
{
ArrayHelper::addValue('class', 'button-group', $htmlOptions);
ob_start();
echo \CHtml::openTag('ul', $htmlOptions);
foreach ($buttons as $button) {
echo $button;
}
echo \CHtml::closeTag('ul'... | [
"public",
"static",
"function",
"group",
"(",
"$",
"buttons",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"'button-group'",
",",
"$",
"htmlOptions",
")",
";",
"ob_start",
"(",
")",
";",... | Generates a group of link buttons
@param array $buttons the link buttons to render in a group
@param array $htmlOptions
@return string
@see http://foundation.zurb.com/docs/components/button-groups.html | [
"Generates",
"a",
"group",
"of",
"link",
"buttons"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L54-L66 |
17,564 | 2amigos/yiifoundation | helpers/Button.php | Button.bar | public static function bar($groups, $htmlOptions = array())
{
ArrayHelper::addValue('class', 'button-bar', $htmlOptions);
ob_start();
echo \CHtml::openTag('div', $htmlOptions);
foreach ($groups as $group) {
echo $group;
}
echo \CHtml::closeTag('div');
... | php | public static function bar($groups, $htmlOptions = array())
{
ArrayHelper::addValue('class', 'button-bar', $htmlOptions);
ob_start();
echo \CHtml::openTag('div', $htmlOptions);
foreach ($groups as $group) {
echo $group;
}
echo \CHtml::closeTag('div');
... | [
"public",
"static",
"function",
"bar",
"(",
"$",
"groups",
",",
"$",
"htmlOptions",
"=",
"array",
"(",
")",
")",
"{",
"ArrayHelper",
"::",
"addValue",
"(",
"'class'",
",",
"'button-bar'",
",",
"$",
"htmlOptions",
")",
";",
"ob_start",
"(",
")",
";",
"e... | Generates a button bar by wrapping multiple button groups into a button-bar
@param array $groups the button group to wrap
@param array $htmlOptions
@return string | [
"Generates",
"a",
"button",
"bar",
"by",
"wrapping",
"multiple",
"button",
"groups",
"into",
"a",
"button",
"-",
"bar"
] | 49bed0d3ca1a9bac9299000e48a2661bdc8f9a29 | https://github.com/2amigos/yiifoundation/blob/49bed0d3ca1a9bac9299000e48a2661bdc8f9a29/helpers/Button.php#L74-L86 |
17,565 | alanpich/slender | src/App.php | App.loadConfigDefaults | protected function loadConfigDefaults($userSettings)
{
$parser = $this['config-parser'];
$defaults = $parser->parseFile(__DIR__ . '/slender.yml');
$userSettings = array_merge_recursive($defaults, $userSettings);
$this['settings']->setArray($userSettings);
} | php | protected function loadConfigDefaults($userSettings)
{
$parser = $this['config-parser'];
$defaults = $parser->parseFile(__DIR__ . '/slender.yml');
$userSettings = array_merge_recursive($defaults, $userSettings);
$this['settings']->setArray($userSettings);
} | [
"protected",
"function",
"loadConfigDefaults",
"(",
"$",
"userSettings",
")",
"{",
"$",
"parser",
"=",
"$",
"this",
"[",
"'config-parser'",
"]",
";",
"$",
"defaults",
"=",
"$",
"parser",
"->",
"parseFile",
"(",
"__DIR__",
".",
"'/slender.yml'",
")",
";",
"... | Load up config defaults
This is a hardcoded config file within Slender core that sets
up sane default values for config
@var ConfigFileParserInterface $parser | [
"Load",
"up",
"config",
"defaults"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L91-L97 |
17,566 | alanpich/slender | src/App.php | App.loadApplicationConfigFiles | protected function loadApplicationConfigFiles($userSettings)
{
$parser = $this['config-parser'];
$loader = $this['config-finder'];
$userSettings = array();
foreach ($loader->findFiles() as $path) {
if (is_readable($path)) {
$parsedFile = $parser->parseFile... | php | protected function loadApplicationConfigFiles($userSettings)
{
$parser = $this['config-parser'];
$loader = $this['config-finder'];
$userSettings = array();
foreach ($loader->findFiles() as $path) {
if (is_readable($path)) {
$parsedFile = $parser->parseFile... | [
"protected",
"function",
"loadApplicationConfigFiles",
"(",
"$",
"userSettings",
")",
"{",
"$",
"parser",
"=",
"$",
"this",
"[",
"'config-parser'",
"]",
";",
"$",
"loader",
"=",
"$",
"this",
"[",
"'config-finder'",
"]",
";",
"$",
"userSettings",
"=",
"array"... | Load any application config files
@var ConfigFileFinderInterface $loader | [
"Load",
"any",
"application",
"config",
"files"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L104-L119 |
17,567 | alanpich/slender | src/App.php | App.registerService | public function registerService($service, $class)
{
$this[$service] = function ($app) use ($class) {
$inst = new $class;
if ($inst instanceof FactoryInterface) {
return $inst->create($app);
} else {
return $inst;
... | php | public function registerService($service, $class)
{
$this[$service] = function ($app) use ($class) {
$inst = new $class;
if ($inst instanceof FactoryInterface) {
return $inst->create($app);
} else {
return $inst;
... | [
"public",
"function",
"registerService",
"(",
"$",
"service",
",",
"$",
"class",
")",
"{",
"$",
"this",
"[",
"$",
"service",
"]",
"=",
"function",
"(",
"$",
"app",
")",
"use",
"(",
"$",
"class",
")",
"{",
"$",
"inst",
"=",
"new",
"$",
"class",
";... | Register a Service to the DI container.
Services are singletons, and the same instance
is returned every time the identifier is requested
@param string $service identifier
@param string $class Class to create | [
"Register",
"a",
"Service",
"to",
"the",
"DI",
"container",
".",
"Services",
"are",
"singletons",
"and",
"the",
"same",
"instance",
"is",
"returned",
"every",
"time",
"the",
"identifier",
"is",
"requested"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L129-L139 |
17,568 | alanpich/slender | src/App.php | App.registerFactory | public function registerFactory($factory, $class)
{
$this[$factory] = $this->factory(function ($app) use ($class) {
$obj = new $class;
if ($obj instanceof FactoryInterface) {
return $obj->create($app);
} else {
return $obj;
}
... | php | public function registerFactory($factory, $class)
{
$this[$factory] = $this->factory(function ($app) use ($class) {
$obj = new $class;
if ($obj instanceof FactoryInterface) {
return $obj->create($app);
} else {
return $obj;
}
... | [
"public",
"function",
"registerFactory",
"(",
"$",
"factory",
",",
"$",
"class",
")",
"{",
"$",
"this",
"[",
"$",
"factory",
"]",
"=",
"$",
"this",
"->",
"factory",
"(",
"function",
"(",
"$",
"app",
")",
"use",
"(",
"$",
"class",
")",
"{",
"$",
"... | Register a Factory to the DI container.
Factories return a new instance of a class each
time they are called
@param string $factory identifier
@param string $class Class to create | [
"Register",
"a",
"Factory",
"to",
"the",
"DI",
"container",
".",
"Factories",
"return",
"a",
"new",
"instance",
"of",
"a",
"class",
"each",
"time",
"they",
"are",
"called"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L149-L159 |
17,569 | alanpich/slender | src/App.php | App.registerCoreServices | protected function registerCoreServices()
{
$this['util'] = function ($app) {
return new \Slender\Core\Util\Util();
};
$this->registerService('dependency-injector','Slender\Core\DependencyInjector\Factory');
$this->registerService('autoloader', 'Slender\Core\Autoloader\A... | php | protected function registerCoreServices()
{
$this['util'] = function ($app) {
return new \Slender\Core\Util\Util();
};
$this->registerService('dependency-injector','Slender\Core\DependencyInjector\Factory');
$this->registerService('autoloader', 'Slender\Core\Autoloader\A... | [
"protected",
"function",
"registerCoreServices",
"(",
")",
"{",
"$",
"this",
"[",
"'util'",
"]",
"=",
"function",
"(",
"$",
"app",
")",
"{",
"return",
"new",
"\\",
"Slender",
"\\",
"Core",
"\\",
"Util",
"\\",
"Util",
"(",
")",
";",
"}",
";",
"$",
"... | Registers core services to the IoC Container | [
"Registers",
"core",
"services",
"to",
"the",
"IoC",
"Container"
] | 247f5c08af20cda95b116eb5d9f6f623d61e8a8a | https://github.com/alanpich/slender/blob/247f5c08af20cda95b116eb5d9f6f623d61e8a8a/src/App.php#L236-L311 |
17,570 | gries/rcon | src/Connection.php | Connection.sendMessage | public function sendMessage(Message $message)
{
$this->currentId++;
$messageData = $message->convertToRconData($this->currentId);
$this->client->write($messageData);
return $this->getResponseMessage();
} | php | public function sendMessage(Message $message)
{
$this->currentId++;
$messageData = $message->convertToRconData($this->currentId);
$this->client->write($messageData);
return $this->getResponseMessage();
} | [
"public",
"function",
"sendMessage",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"currentId",
"++",
";",
"$",
"messageData",
"=",
"$",
"message",
"->",
"convertToRconData",
"(",
"$",
"this",
"->",
"currentId",
")",
";",
"$",
"this",
"->"... | Send a RCON message.
@param Message $message
@return Message | [
"Send",
"a",
"RCON",
"message",
"."
] | 7fada05b329d89542692af00ab80db02ad59d45d | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L55-L62 |
17,571 | gries/rcon | src/Connection.php | Connection.getResponseMessage | protected function getResponseMessage()
{
// read the first 4 bytes which include the length of the response
$lengthEncoded = $this->client->read(4);
if (strlen($lengthEncoded) < 4) {
return new Message('', Message::TYPE_RESPONSE_VALUE);
}
$lengthInBytes = unpa... | php | protected function getResponseMessage()
{
// read the first 4 bytes which include the length of the response
$lengthEncoded = $this->client->read(4);
if (strlen($lengthEncoded) < 4) {
return new Message('', Message::TYPE_RESPONSE_VALUE);
}
$lengthInBytes = unpa... | [
"protected",
"function",
"getResponseMessage",
"(",
")",
"{",
"// read the first 4 bytes which include the length of the response",
"$",
"lengthEncoded",
"=",
"$",
"this",
"->",
"client",
"->",
"read",
"(",
"4",
")",
";",
"if",
"(",
"strlen",
"(",
"$",
"lengthEncode... | Get the response value of the server.
@return string | [
"Get",
"the",
"response",
"value",
"of",
"the",
"server",
"."
] | 7fada05b329d89542692af00ab80db02ad59d45d | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L69-L100 |
17,572 | gries/rcon | src/Connection.php | Connection.authenticate | protected function authenticate($password)
{
$message = new Message($password, Message::TYPE_AUTH);
$response = $this->sendMessage($message);
if ($response->getType() === Message::TYPE_AUTH_FAILURE) {
throw new AuthenticationFailedException('Could not authenticate to the server.... | php | protected function authenticate($password)
{
$message = new Message($password, Message::TYPE_AUTH);
$response = $this->sendMessage($message);
if ($response->getType() === Message::TYPE_AUTH_FAILURE) {
throw new AuthenticationFailedException('Could not authenticate to the server.... | [
"protected",
"function",
"authenticate",
"(",
"$",
"password",
")",
"{",
"$",
"message",
"=",
"new",
"Message",
"(",
"$",
"password",
",",
"Message",
"::",
"TYPE_AUTH",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"sendMessage",
"(",
"$",
"message"... | Authenticate with the server.
@param $password
@throws Exception\AuthenticationFailedException | [
"Authenticate",
"with",
"the",
"server",
"."
] | 7fada05b329d89542692af00ab80db02ad59d45d | https://github.com/gries/rcon/blob/7fada05b329d89542692af00ab80db02ad59d45d/src/Connection.php#L109-L117 |
17,573 | vufind-org/vufinddate | src/Converter.php | Converter.getDateExceptionMessage | protected function getDateExceptionMessage($details)
{
$errors = "Date/time problem: Details: ";
if (is_array($details['errors']) && $details['error_count'] > 0) {
foreach ($details['errors'] as $error) {
$errors .= $error . " ";
}
} elseif (is_array($... | php | protected function getDateExceptionMessage($details)
{
$errors = "Date/time problem: Details: ";
if (is_array($details['errors']) && $details['error_count'] > 0) {
foreach ($details['errors'] as $error) {
$errors .= $error . " ";
}
} elseif (is_array($... | [
"protected",
"function",
"getDateExceptionMessage",
"(",
"$",
"details",
")",
"{",
"$",
"errors",
"=",
"\"Date/time problem: Details: \"",
";",
"if",
"(",
"is_array",
"(",
"$",
"details",
"[",
"'errors'",
"]",
")",
"&&",
"$",
"details",
"[",
"'error_count'",
"... | Build an exception message from a detailed error array.
@param array $details Error details
@return string | [
"Build",
"an",
"exception",
"message",
"from",
"a",
"detailed",
"error",
"array",
"."
] | 1bec5458b48d96fa8ff87123584042780f4c3c24 | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L147-L160 |
17,574 | vufind-org/vufinddate | src/Converter.php | Converter.convertToDisplayDateAndTime | public function convertToDisplayDateAndTime($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayDate($createFormat, $timeString)
. $separator . $this->convertToDisplayTime($createFormat, $timeString);
} | php | public function convertToDisplayDateAndTime($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayDate($createFormat, $timeString)
. $separator . $this->convertToDisplayTime($createFormat, $timeString);
} | [
"public",
"function",
"convertToDisplayDateAndTime",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
",",
"$",
"separator",
"=",
"' '",
")",
"{",
"return",
"$",
"this",
"->",
"convertToDisplayDate",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
")",
".",... | Public method for getting a date prepended to a time.
@param string $createFormat The format of the time string to be changed
@param string $timeString The time string
@param string $separator String between time/date
@throws DateException
@return string A re-formatted time string | [
"Public",
"method",
"for",
"getting",
"a",
"date",
"prepended",
"to",
"a",
"time",
"."
] | 1bec5458b48d96fa8ff87123584042780f4c3c24 | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L218-L223 |
17,575 | vufind-org/vufinddate | src/Converter.php | Converter.convertToDisplayTimeAndDate | public function convertToDisplayTimeAndDate($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayTime($createFormat, $timeString)
. $separator . $this->convertToDisplayDate($createFormat, $timeString);
} | php | public function convertToDisplayTimeAndDate($createFormat, $timeString,
$separator = ' '
) {
return $this->convertToDisplayTime($createFormat, $timeString)
. $separator . $this->convertToDisplayDate($createFormat, $timeString);
} | [
"public",
"function",
"convertToDisplayTimeAndDate",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
",",
"$",
"separator",
"=",
"' '",
")",
"{",
"return",
"$",
"this",
"->",
"convertToDisplayTime",
"(",
"$",
"createFormat",
",",
"$",
"timeString",
")",
".",... | Public method for getting a time prepended to a date.
@param string $createFormat The format of the time string to be changed
@param string $timeString The time string
@param string $separator String between time/date
@throws DateException
@return string A re-formatted time string | [
"Public",
"method",
"for",
"getting",
"a",
"time",
"prepended",
"to",
"a",
"date",
"."
] | 1bec5458b48d96fa8ff87123584042780f4c3c24 | https://github.com/vufind-org/vufinddate/blob/1bec5458b48d96fa8ff87123584042780f4c3c24/src/Converter.php#L235-L240 |
17,576 | flextype-components/form | Form.php | Form.open | public static function open($action = '', array $attributes = null) : string
{
// Add the form action to the attributes
$attributes['action'] = $action;
if ( ! isset($attributes['method'])) {
// Use POST method
$attributes['method'] = 'post';
}
retu... | php | public static function open($action = '', array $attributes = null) : string
{
// Add the form action to the attributes
$attributes['action'] = $action;
if ( ! isset($attributes['method'])) {
// Use POST method
$attributes['method'] = 'post';
}
retu... | [
"public",
"static",
"function",
"open",
"(",
"$",
"action",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Add the form action to the attributes",
"$",
"attributes",
"[",
"'action'",
"]",
"=",
"$",
"action",
";",
"if",
... | Create an opening HTML form tag.
// Form will submit back to the current page using POST
echo Form::open();
// Form will submit to 'search' using GET
echo Form::open('search', array('method' => 'get'));
// When "file" inputs are present, you must include the "enctype"
echo Form::open(null, array('enctype' => 'multip... | [
"Create",
"an",
"opening",
"HTML",
"form",
"tag",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L72-L84 |
17,577 | flextype-components/form | Form.php | Form.input | public static function input(string $name, string $value = '', array $attributes = null) : string
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;
// Set the input value
... | php | public static function input(string $name, string $value = '', array $attributes = null) : string
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;
// Set the input value
... | [
"public",
"static",
"function",
"input",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"]",
"=",
"$",
... | Create a form input.
Text is default input type.
echo Form::input('username', $username);
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@return string | [
"Create",
"a",
"form",
"input",
".",
"Text",
"is",
"default",
"input",
"type",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L97-L115 |
17,578 | flextype-components/form | Form.php | Form.hidden | public static function hidden(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'hidden';
return Form::input($name, $value, $attributes);
} | php | public static function hidden(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'hidden';
return Form::input($name, $value, $attributes);
} | [
"public",
"static",
"function",
"hidden",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'hi... | Create a hidden form input.
echo Form::hidden('user_id', $user_id);
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@return string | [
"Create",
"a",
"hidden",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L127-L133 |
17,579 | flextype-components/form | Form.php | Form.password | public static function password(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'password';
return Form::input($name, $value, $attributes);
} | php | public static function password(string $name, string $value = '', array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'password';
return Form::input($name, $value, $attributes);
} | [
"public",
"static",
"function",
"password",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"value",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'... | Creates a password form input.
echo Form::password('password');
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@return string | [
"Creates",
"a",
"password",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L145-L151 |
17,580 | flextype-components/form | Form.php | Form.file | public static function file(string $name, array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'file';
return Form::input($name, '', $attributes);
} | php | public static function file(string $name, array $attributes = null) : string
{
// Set the input type
$attributes['type'] = 'file';
return Form::input($name, '', $attributes);
} | [
"public",
"static",
"function",
"file",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
":",
"string",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'file'",
";",
"return",
"Form",
"::",
"input",
... | Creates a file upload form input.
echo Form::file('image');
@param string $name Input name
@param array $attributes HTML attributes
@return string | [
"Creates",
"a",
"file",
"upload",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L162-L168 |
17,581 | flextype-components/form | Form.php | Form.checkbox | public static function checkbox($name, $value = '', $checked = false, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'checkbox';
if ($checked === true) {
// Make the checkbox active
$attributes['checked'] = 'checked';
}
retur... | php | public static function checkbox($name, $value = '', $checked = false, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'checkbox';
if ($checked === true) {
// Make the checkbox active
$attributes['checked'] = 'checked';
}
retur... | [
"public",
"static",
"function",
"checkbox",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
",",
"$",
"checked",
"=",
"false",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
... | Creates a checkbox form input.
echo Form::checkbox('i_am_not_a_robot');
@param string $name Input name
@param string $input Input value
@param boolean $checked Checked status
@param array $attributes HTML attributes
@uses Form::input
@return string | [
"Creates",
"a",
"checkbox",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L182-L193 |
17,582 | flextype-components/form | Form.php | Form.radio | public static function radio($name, $value = '', $checked = null, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'radio';
if ($checked === true) {
// Make the radio active
$attributes['checked'] = 'checked';
}
return Form::in... | php | public static function radio($name, $value = '', $checked = null, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'radio';
if ($checked === true) {
// Make the radio active
$attributes['checked'] = 'checked';
}
return Form::in... | [
"public",
"static",
"function",
"radio",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"''",
",",
"$",
"checked",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'ra... | Creates a radio form input.
echo Form::radio('i_am_not_a_robot');
@param string $name Input name
@param string $value Input value
@param boolean $checked Checked status
@param array $attributes HTML attributes
@uses Form::input
@return string | [
"Creates",
"a",
"radio",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L207-L218 |
17,583 | flextype-components/form | Form.php | Form.textarea | public static function textarea($name, $body = '', array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
return '<textarea'.Html::attributes($attributes).'>'... | php | public static function textarea($name, $body = '', array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
return '<textarea'.Html::attributes($attributes).'>'... | [
"public",
"static",
"function",
"textarea",
"(",
"$",
"name",
",",
"$",
"body",
"=",
"''",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"// Set the input id",... | Creates a textarea form input.
echo Form::textarea('text', $text);
@param string $name Name
@param string $body Body
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"textarea",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L231-L240 |
17,584 | flextype-components/form | Form.php | Form.select | public static function select($name, array $options = null, $selected = null, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
$options_output = '';
... | php | public static function select($name, array $options = null, $selected = null, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
$options_output = '';
... | [
"public",
"static",
"function",
"select",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"null",
",",
"$",
"selected",
"=",
"null",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"... | Creates a select form input.
<code>
echo Form::select('themes', array('default', 'classic', 'modern'));
</code>
@param string $name Name
@param array $options Options array
@param string $selected Selected option
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"select",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L256-L272 |
17,585 | flextype-components/form | Form.php | Form.submit | public static function submit($name, $value, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'submit';
return Form::input($name, $value, $attributes);
} | php | public static function submit($name, $value, array $attributes = null)
{
// Set the input type
$attributes['type'] = 'submit';
return Form::input($name, $value, $attributes);
} | [
"public",
"static",
"function",
"submit",
"(",
"$",
"name",
",",
"$",
"value",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input type",
"$",
"attributes",
"[",
"'type'",
"]",
"=",
"'submit'",
";",
"return",
"Form",
"::",
"input",
... | Creates a submit form input.
<code>
echo Form::submit('save', 'Save');
</code>
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@uses Form::input
@return string | [
"Creates",
"a",
"submit",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L287-L293 |
17,586 | flextype-components/form | Form.php | Form.button | public static function button($name, $body, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
return '<button'.Html::attributes($attributes).'>'.$body.'</button>';
} | php | public static function button($name, $body, array $attributes = null)
{
// Set the input name
$attributes['name'] = $name;
return '<button'.Html::attributes($attributes).'>'.$body.'</button>';
} | [
"public",
"static",
"function",
"button",
"(",
"$",
"name",
",",
"$",
"body",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the input name",
"$",
"attributes",
"[",
"'name'",
"]",
"=",
"$",
"name",
";",
"return",
"'<button'",
".",
"Html... | Creates a button form input.
echo Form::button('save', 'Save Profile', array('type' => 'submit'));
@param string $name Input name
@param string $value Input value
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"button",
"form",
"input",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L306-L312 |
17,587 | flextype-components/form | Form.php | Form.label | public static function label($input, $text, array $attributes = null)
{
// Set the label target
$attributes['for'] = $input;
return '<label'.Html::attributes($attributes).'>'.$text.'</label>';
} | php | public static function label($input, $text, array $attributes = null)
{
// Set the label target
$attributes['for'] = $input;
return '<label'.Html::attributes($attributes).'>'.$text.'</label>';
} | [
"public",
"static",
"function",
"label",
"(",
"$",
"input",
",",
"$",
"text",
",",
"array",
"$",
"attributes",
"=",
"null",
")",
"{",
"// Set the label target",
"$",
"attributes",
"[",
"'for'",
"]",
"=",
"$",
"input",
";",
"return",
"'<label'",
".",
"Htm... | Creates a form label.
echo Form::label('username', 'Username');
@param string $input Target input
@param string $text Label text
@param array $attributes HTML attributes
@uses Html::attributes
@return string | [
"Creates",
"a",
"form",
"label",
"."
] | b3fea245c996dc19d7a0081db6e48dac39fac5e5 | https://github.com/flextype-components/form/blob/b3fea245c996dc19d7a0081db6e48dac39fac5e5/Form.php#L325-L331 |
17,588 | 4devs/ElfinderPhpConnector | Connector.php | Connector.run | public function run($cmd, array $args)
{
if (!isset($this->commands[$cmd])) {
$this->error(sprintf('command %s not exists', $cmd));
}
$response = new Response();
$driverId = isset($args['target']) ? $this->getDriverId($args['target']) : '';
$driverId = !$driverId ... | php | public function run($cmd, array $args)
{
if (!isset($this->commands[$cmd])) {
$this->error(sprintf('command %s not exists', $cmd));
}
$response = new Response();
$driverId = isset($args['target']) ? $this->getDriverId($args['target']) : '';
$driverId = !$driverId ... | [
"public",
"function",
"run",
"(",
"$",
"cmd",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"commands",
"[",
"$",
"cmd",
"]",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(",
"sprintf",
"(",
"'command %s not... | run command.
@param string $cmd
@param array $args
@return Response|HttpResponse | [
"run",
"command",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L105-L140 |
17,589 | 4devs/ElfinderPhpConnector | Connector.php | Connector.addDriver | public function addDriver(DriverInterface $driver)
{
$driver->setConnector($this);
$this->driverList[$driver->getDriverId()] = $driver;
return $this;
} | php | public function addDriver(DriverInterface $driver)
{
$driver->setConnector($this);
$this->driverList[$driver->getDriverId()] = $driver;
return $this;
} | [
"public",
"function",
"addDriver",
"(",
"DriverInterface",
"$",
"driver",
")",
"{",
"$",
"driver",
"->",
"setConnector",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"driverList",
"[",
"$",
"driver",
"->",
"getDriverId",
"(",
")",
"]",
"=",
"$",
"dri... | add Driver.
@param DriverInterface $driver
@return $this | [
"add",
"Driver",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L176-L182 |
17,590 | 4devs/ElfinderPhpConnector | Connector.php | Connector.setDrivers | public function setDrivers(array $drivers)
{
$this->driverList = array();
foreach ($drivers as $driver) {
$this->addDriver($driver);
}
return $this;
} | php | public function setDrivers(array $drivers)
{
$this->driverList = array();
foreach ($drivers as $driver) {
$this->addDriver($driver);
}
return $this;
} | [
"public",
"function",
"setDrivers",
"(",
"array",
"$",
"drivers",
")",
"{",
"$",
"this",
"->",
"driverList",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"drivers",
"as",
"$",
"driver",
")",
"{",
"$",
"this",
"->",
"addDriver",
"(",
"$",
"driver... | set All Drivers.
@param array $drivers
@return $this | [
"set",
"All",
"Drivers",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L191-L199 |
17,591 | 4devs/ElfinderPhpConnector | Connector.php | Connector.error | public function error($message)
{
if ($this->logger) {
$this->logger->error($message);
}
if (!$this->debug) {
throw new \RuntimeException($message);
}
} | php | public function error($message)
{
if ($this->logger) {
$this->logger->error($message);
}
if (!$this->debug) {
throw new \RuntimeException($message);
}
} | [
"public",
"function",
"error",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"logger",
")",
"{",
"$",
"this",
"->",
"logger",
"->",
"error",
"(",
"$",
"message",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"debug",
")",
"{"... | error Handling.
@param string $message
@throws \RuntimeException | [
"error",
"Handling",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L208-L216 |
17,592 | 4devs/ElfinderPhpConnector | Connector.php | Connector.getDriverId | public function getDriverId($targetHash)
{
if (is_array($targetHash)) {
$targetHash = current($targetHash);
}
return substr($targetHash, 0, strpos($targetHash, '_'));
} | php | public function getDriverId($targetHash)
{
if (is_array($targetHash)) {
$targetHash = current($targetHash);
}
return substr($targetHash, 0, strpos($targetHash, '_'));
} | [
"public",
"function",
"getDriverId",
"(",
"$",
"targetHash",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"targetHash",
")",
")",
"{",
"$",
"targetHash",
"=",
"current",
"(",
"$",
"targetHash",
")",
";",
"}",
"return",
"substr",
"(",
"$",
"targetHash",
"... | get Driver Id from hash target.
@param string $targetHash
@return string | [
"get",
"Driver",
"Id",
"from",
"hash",
"target",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L239-L246 |
17,593 | 4devs/ElfinderPhpConnector | Connector.php | Connector.runCmd | private function runCmd(DriverInterface $driver, $cmd, array $args, Response $response)
{
$data = null;
try {
if ($driver->isAllowedCommand($cmd)) {
$data = call_user_func_array(
array($driver, $cmd),
$this->getArgs($args, $cmd, $re... | php | private function runCmd(DriverInterface $driver, $cmd, array $args, Response $response)
{
$data = null;
try {
if ($driver->isAllowedCommand($cmd)) {
$data = call_user_func_array(
array($driver, $cmd),
$this->getArgs($args, $cmd, $re... | [
"private",
"function",
"runCmd",
"(",
"DriverInterface",
"$",
"driver",
",",
"$",
"cmd",
",",
"array",
"$",
"args",
",",
"Response",
"$",
"response",
")",
"{",
"$",
"data",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"$",
"driver",
"->",
"isAllowedCommand... | run cmd.
@param DriverInterface $driver
@param string $cmd
@param array $args
@param Response $response
@return Response | [
"run",
"cmd",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L258-L275 |
17,594 | 4devs/ElfinderPhpConnector | Connector.php | Connector.addDisabledCommand | private function addDisabledCommand(AbstractDriver $driver)
{
foreach ($this->commands as $name => $command) {
$interface = $this->getInterfaceByCmd($name);
if (!$driver instanceof $interface) {
$driver->addDisabledCmd($name);
}
}
return $... | php | private function addDisabledCommand(AbstractDriver $driver)
{
foreach ($this->commands as $name => $command) {
$interface = $this->getInterfaceByCmd($name);
if (!$driver instanceof $interface) {
$driver->addDisabledCmd($name);
}
}
return $... | [
"private",
"function",
"addDisabledCommand",
"(",
"AbstractDriver",
"$",
"driver",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"commands",
"as",
"$",
"name",
"=>",
"$",
"command",
")",
"{",
"$",
"interface",
"=",
"$",
"this",
"->",
"getInterfaceByCmd",
"(... | add Disabled Command.
@param AbstractDriver $driver
@return $this | [
"add",
"Disabled",
"Command",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L296-L306 |
17,595 | 4devs/ElfinderPhpConnector | Connector.php | Connector.getArgs | private function getArgs(array $args, $cmd, $response, $driverId)
{
$response = array($response);
$allowedArgs = $this->commands[$cmd];
unset($allowedArgs['interface']);
foreach ($allowedArgs as $key => $value) {
if (isset($args[$key])) {
$response[$key] =... | php | private function getArgs(array $args, $cmd, $response, $driverId)
{
$response = array($response);
$allowedArgs = $this->commands[$cmd];
unset($allowedArgs['interface']);
foreach ($allowedArgs as $key => $value) {
if (isset($args[$key])) {
$response[$key] =... | [
"private",
"function",
"getArgs",
"(",
"array",
"$",
"args",
",",
"$",
"cmd",
",",
"$",
"response",
",",
"$",
"driverId",
")",
"{",
"$",
"response",
"=",
"array",
"(",
"$",
"response",
")",
";",
"$",
"allowedArgs",
"=",
"$",
"this",
"->",
"commands",... | get Allowed Arguments.
@param array $args
@param string $cmd
@param Response $response
@param string $driverId
@return array | [
"get",
"Allowed",
"Arguments",
"."
] | 510e295dcafeaa0f796986ad87b3ed5f6b0d9338 | https://github.com/4devs/ElfinderPhpConnector/blob/510e295dcafeaa0f796986ad87b3ed5f6b0d9338/Connector.php#L318-L344 |
17,596 | jfusion/org.jfusion.framework | src/Plugin/Auth.php | Auth.checkPassword | function checkPassword(Userinfo $userinfo) {
return $this->comparePassword($userinfo->password, $this->generateEncryptedPassword($userinfo));
} | php | function checkPassword(Userinfo $userinfo) {
return $this->comparePassword($userinfo->password, $this->generateEncryptedPassword($userinfo));
} | [
"function",
"checkPassword",
"(",
"Userinfo",
"$",
"userinfo",
")",
"{",
"return",
"$",
"this",
"->",
"comparePassword",
"(",
"$",
"userinfo",
"->",
"password",
",",
"$",
"this",
"->",
"generateEncryptedPassword",
"(",
"$",
"userinfo",
")",
")",
";",
"}"
] | used by framework to ensure a password test
@param Userinfo $userinfo userdata object containing the userdata
@return boolean | [
"used",
"by",
"framework",
"to",
"ensure",
"a",
"password",
"test"
] | 65771963f23ccabcf1f867eb17c9452299cfe683 | https://github.com/jfusion/org.jfusion.framework/blob/65771963f23ccabcf1f867eb17c9452299cfe683/src/Plugin/Auth.php#L61-L63 |
17,597 | zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeOctet | public function writeOctet($n)
{
if ($n < 0 || $n > 255) {
throw new \InvalidArgumentException('Octet out of range 0..255');
}
$this->flushBits();
$this->out .= chr($n);
return $this;
} | php | public function writeOctet($n)
{
if ($n < 0 || $n > 255) {
throw new \InvalidArgumentException('Octet out of range 0..255');
}
$this->flushBits();
$this->out .= chr($n);
return $this;
} | [
"public",
"function",
"writeOctet",
"(",
"$",
"n",
")",
"{",
"if",
"(",
"$",
"n",
"<",
"0",
"||",
"$",
"n",
">",
"255",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Octet out of range 0..255'",
")",
";",
"}",
"$",
"this",
"->",
... | Write an integer as an unsigned 8-bit value.
@param $n
@return Writer
@throws \InvalidArgumentException | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"8",
"-",
"bit",
"value",
"."
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L138-L147 |
17,598 | zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeShort | public function writeShort($n)
{
if ($n < 0 || $n > 65535) {
throw new \InvalidArgumentException('Octet out of range 0..65535');
}
$this->flushBits();
$this->out .= pack('n', $n);
return $this;
} | php | public function writeShort($n)
{
if ($n < 0 || $n > 65535) {
throw new \InvalidArgumentException('Octet out of range 0..65535');
}
$this->flushBits();
$this->out .= pack('n', $n);
return $this;
} | [
"public",
"function",
"writeShort",
"(",
"$",
"n",
")",
"{",
"if",
"(",
"$",
"n",
"<",
"0",
"||",
"$",
"n",
">",
"65535",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Octet out of range 0..65535'",
")",
";",
"}",
"$",
"this",
"->"... | Write an integer as an unsigned 16-bit value.
@param $n
@return Writer
@throws \InvalidArgumentException | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"16",
"-",
"bit",
"value",
"."
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L157-L166 |
17,599 | zircote/AMQP | library/AMQP/Wire/Writer.php | Writer.writeLong | public function writeLong($n)
{
$this->flushBits();
$this->out .= implode('', Writer::chrByteSplit($n, 4));
return $this;
} | php | public function writeLong($n)
{
$this->flushBits();
$this->out .= implode('', Writer::chrByteSplit($n, 4));
return $this;
} | [
"public",
"function",
"writeLong",
"(",
"$",
"n",
")",
"{",
"$",
"this",
"->",
"flushBits",
"(",
")",
";",
"$",
"this",
"->",
"out",
".=",
"implode",
"(",
"''",
",",
"Writer",
"::",
"chrByteSplit",
"(",
"$",
"n",
",",
"4",
")",
")",
";",
"return"... | Write an integer as an unsigned 32-bit value.
@param $n
@return Writer | [
"Write",
"an",
"integer",
"as",
"an",
"unsigned",
"32",
"-",
"bit",
"value",
"."
] | b96777b372f556797db4fd0ba02edb18d4bf4a1e | https://github.com/zircote/AMQP/blob/b96777b372f556797db4fd0ba02edb18d4bf4a1e/library/AMQP/Wire/Writer.php#L175-L180 |
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.