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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
3,500 | phlexible/phlexible | src/Phlexible/Bundle/DashboardBundle/Portlet/Portlet.php | Portlet.toArray | public function toArray()
{
return array(
'id' => $this->getId(),
'title' => $this->getTitle(),
'class' => $this->getClass(),
'iconCls' => $this->getIconClass(),
'data' => $this->getData(),
'settings' => $this->getSettings(),
);... | php | public function toArray()
{
return array(
'id' => $this->getId(),
'title' => $this->getTitle(),
'class' => $this->getClass(),
'iconCls' => $this->getIconClass(),
'data' => $this->getData(),
'settings' => $this->getSettings(),
);... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"array",
"(",
"'id'",
"=>",
"$",
"this",
"->",
"getId",
"(",
")",
",",
"'title'",
"=>",
"$",
"this",
"->",
"getTitle",
"(",
")",
",",
"'class'",
"=>",
"$",
"this",
"->",
"getClass",
"(",
")"... | Return array representation of this portlet.
@return array | [
"Return",
"array",
"representation",
"of",
"this",
"portlet",
"."
] | 132f24924c9bb0dbb6c1ea84db0a463f97fa3893 | https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Bundle/DashboardBundle/Portlet/Portlet.php#L180-L190 |
3,501 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.get | public function get(
$uri,
array $parameters = [],
array $headers = [],
string $protocol = '1.1'
): ResponseInterface {
$promise = $this->getAsync($uri, $parameters, $headers, $protocol);
$promise->wait();
if ($promise->getState() === Promise::REJECTED) {
... | php | public function get(
$uri,
array $parameters = [],
array $headers = [],
string $protocol = '1.1'
): ResponseInterface {
$promise = $this->getAsync($uri, $parameters, $headers, $protocol);
$promise->wait();
if ($promise->getState() === Promise::REJECTED) {
... | [
"public",
"function",
"get",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
")",
":",
"ResponseInterface",
"{",
"$",
"promise",
"=",
"$",
"... | Sends a GET request
@param string|UriInterface $uri Request URI
@param array $parameters Query parameters
@param array $headers Request headers
@param string $protocol Protocol version
@return ResponseInterface
@throws Throwable When an error occurs | [
"Sends",
"a",
"GET",
"request"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L96-L110 |
3,502 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.getAsync | public function getAsync(
$uri,
array $parameters = [],
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createQueryRequest(
static::METHOD_GET,
$uri,
$parameters,
$headers,
$protocol
... | php | public function getAsync(
$uri,
array $parameters = [],
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createQueryRequest(
static::METHOD_GET,
$uri,
$parameters,
$headers,
$protocol
... | [
"public",
"function",
"getAsync",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
")",
":",
"Promise",
"{",
"$",
"request",
"=",
"$",
"this"... | Sends a GET request asynchronously
@param string|UriInterface $uri Request URI
@param array $parameters Query parameters
@param array $headers Request headers
@param string $protocol Protocol version
@return Promise | [
"Sends",
"a",
"GET",
"request",
"asynchronously"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L242-L257 |
3,503 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.postAsync | public function postAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_POST,
$uri,
$parameters,
... | php | public function postAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_POST,
$uri,
$parameters,
... | [
"public",
"function",
"postAsync",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"?",
"ContentType",
"$",
"contentType",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
"... | Sends a POST request asynchronously
@param string|UriInterface $uri Request URI
@param array $parameters Body parameters
@param ContentType|null $contentType The content type
@param array $headers Request headers
@param string $protocol Protocol version
@ret... | [
"Sends",
"a",
"POST",
"request",
"asynchronously"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L270-L287 |
3,504 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.putAsync | public function putAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_PUT,
$uri,
$parameters,
... | php | public function putAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_PUT,
$uri,
$parameters,
... | [
"public",
"function",
"putAsync",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"?",
"ContentType",
"$",
"contentType",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
")... | Sends a PUT request asynchronously
@param string|UriInterface $uri Request URI
@param array $parameters Query parameters
@param ContentType|null $contentType The content type
@param array $headers Request headers
@param string $protocol Protocol version
@ret... | [
"Sends",
"a",
"PUT",
"request",
"asynchronously"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L300-L317 |
3,505 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.patchAsync | public function patchAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_PATCH,
$uri,
$parameters,
... | php | public function patchAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_PATCH,
$uri,
$parameters,
... | [
"public",
"function",
"patchAsync",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"?",
"ContentType",
"$",
"contentType",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
... | Sends a PATCH request asynchronously
@param string|UriInterface $uri Request URI
@param array $parameters Query parameters
@param ContentType|null $contentType The content type
@param array $headers Request headers
@param string $protocol Protocol version
@r... | [
"Sends",
"a",
"PATCH",
"request",
"asynchronously"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L330-L347 |
3,506 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.deleteAsync | public function deleteAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_DELETE,
$uri,
$parameters,
... | php | public function deleteAsync(
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): Promise {
$request = $this->createBodyRequest(
static::METHOD_DELETE,
$uri,
$parameters,
... | [
"public",
"function",
"deleteAsync",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"?",
"ContentType",
"$",
"contentType",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
... | Sends a DELETE request asynchronously
@param string|UriInterface $uri Request URI
@param array $parameters Query parameters
@param ContentType|null $contentType The content type
@param array $headers Request headers
@param string $protocol Protocol version
@... | [
"Sends",
"a",
"DELETE",
"request",
"asynchronously"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L360-L377 |
3,507 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.createQueryRequest | protected function createQueryRequest(
string $method,
$uri,
array $parameters = [],
array $headers = [],
string $protocol = '1.1'
): RequestInterface {
$uri = $this->createUri($uri);
if (!empty($parameters)) {
$queryString = http_build_query($par... | php | protected function createQueryRequest(
string $method,
$uri,
array $parameters = [],
array $headers = [],
string $protocol = '1.1'
): RequestInterface {
$uri = $this->createUri($uri);
if (!empty($parameters)) {
$queryString = http_build_query($par... | [
"protected",
"function",
"createQueryRequest",
"(",
"string",
"$",
"method",
",",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"string",
"$",
"protocol",
"=",
"'1.1'",
")",
":",
"RequestI... | Creates a query request
@param string $method Request method
@param string|UriInterface $uri Request URI
@param array $parameters Query parameters
@param array $headers Request headers
@param string $protocol Protocol version
@return RequestInterfa... | [
"Creates",
"a",
"query",
"request"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L448-L467 |
3,508 | novuso/common | src/Application/HttpClient/HttpService.php | HttpService.createBodyRequest | protected function createBodyRequest(
string $method,
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): RequestInterface {
if ($contentType === null) {
$contentType = ContentType::fromV... | php | protected function createBodyRequest(
string $method,
$uri,
array $parameters = [],
?ContentType $contentType = null,
array $headers = [],
string $protocol = '1.1'
): RequestInterface {
if ($contentType === null) {
$contentType = ContentType::fromV... | [
"protected",
"function",
"createBodyRequest",
"(",
"string",
"$",
"method",
",",
"$",
"uri",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"?",
"ContentType",
"$",
"contentType",
"=",
"null",
",",
"array",
"$",
"headers",
"=",
"[",
"]",
",",
"st... | Creates a body request
@param string $method Request method
@param string|UriInterface $uri Request URI
@param array $parameters Body parameters
@param ContentType|null $contentType The content type
@param array $headers Request headers
@param string ... | [
"Creates",
"a",
"body",
"request"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Application/HttpClient/HttpService.php#L481-L515 |
3,509 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.initFromItemClass | public static function initFromItemClass($itemClass)
{
$itemMetaData = new ItemMetaData();
$itemMetaData->setItemClass($itemClass);
$contruct = new ReflectionMethod($itemClass, '__construct');
/* @var $param \ReflectionParameter */
foreach($contruct->getParameters() as $key => $param)
{
$itemMetaData->s... | php | public static function initFromItemClass($itemClass)
{
$itemMetaData = new ItemMetaData();
$itemMetaData->setItemClass($itemClass);
$contruct = new ReflectionMethod($itemClass, '__construct');
/* @var $param \ReflectionParameter */
foreach($contruct->getParameters() as $key => $param)
{
$itemMetaData->s... | [
"public",
"static",
"function",
"initFromItemClass",
"(",
"$",
"itemClass",
")",
"{",
"$",
"itemMetaData",
"=",
"new",
"ItemMetaData",
"(",
")",
";",
"$",
"itemMetaData",
"->",
"setItemClass",
"(",
"$",
"itemClass",
")",
";",
"$",
"contruct",
"=",
"new",
"... | Initializes a new View instance that will hold the object-relational
mapping of the class with the given name.
@param string $itemClass The name of the item class the new instance is used for.
return ItemMetaData | [
"Initializes",
"a",
"new",
"View",
"instance",
"that",
"will",
"hold",
"the",
"object",
"-",
"relational",
"mapping",
"of",
"the",
"class",
"with",
"the",
"given",
"name",
"."
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L104-L119 |
3,510 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.validateAndCompleteEntity | protected function validateAndCompleteEntity($entityIdentifier, $entityDefinition)
{
if(!isset($entityDefinition['label']))
{
throw MappingException::requiredMapping($this->itemClass, 'label', $entityIdentifier);
}
elseif(!settype($entityDefinition['label'], 'string'))
{
throw MappingException::invalid... | php | protected function validateAndCompleteEntity($entityIdentifier, $entityDefinition)
{
if(!isset($entityDefinition['label']))
{
throw MappingException::requiredMapping($this->itemClass, 'label', $entityIdentifier);
}
elseif(!settype($entityDefinition['label'], 'string'))
{
throw MappingException::invalid... | [
"protected",
"function",
"validateAndCompleteEntity",
"(",
"$",
"entityIdentifier",
",",
"$",
"entityDefinition",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"entityDefinition",
"[",
"'label'",
"]",
")",
")",
"{",
"throw",
"MappingException",
"::",
"requiredMap... | Validates & completes the given entity definition.
@param string $entityIdentifier
@param array $entityDefinition
@throws MappingException | [
"Validates",
"&",
"completes",
"the",
"given",
"entity",
"definition",
"."
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L189-L216 |
3,511 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.validateAndCompleteHit | protected function validateAndCompleteHit($hitIdentifier, array &$hitDefinition)
{
$this->addRequiredHit($hitIdentifier);
if(!isset($hitDefinition['scoreFactor']))
{
$this->setHitScoreFactor($hitIdentifier, 1);
}
elseif(!settype($hitDefinition['scoreFactor'], 'integer'))
{
throw MappingException::in... | php | protected function validateAndCompleteHit($hitIdentifier, array &$hitDefinition)
{
$this->addRequiredHit($hitIdentifier);
if(!isset($hitDefinition['scoreFactor']))
{
$this->setHitScoreFactor($hitIdentifier, 1);
}
elseif(!settype($hitDefinition['scoreFactor'], 'integer'))
{
throw MappingException::in... | [
"protected",
"function",
"validateAndCompleteHit",
"(",
"$",
"hitIdentifier",
",",
"array",
"&",
"$",
"hitDefinition",
")",
"{",
"$",
"this",
"->",
"addRequiredHit",
"(",
"$",
"hitIdentifier",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"hitDefinition",
"["... | Validates & completes the given hit definition.
@param string $hitIdentifier the hit identifier
@param array $hitDefinition The attribute mapping to validated & complete.
@throws MappingException | [
"Validates",
"&",
"completes",
"the",
"given",
"hit",
"definition",
"."
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L258-L302 |
3,512 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.getOrderedRequiredHits | public function getOrderedRequiredHits()
{
$hitIdentifiers = array();
foreach($this->requiredHits as $hitIdentifier)
{
$hitIdentifiers[$this->hitPositions[$hitIdentifier]] = $hitIdentifier;
}
krsort($hitIdentifiers);
return $hitIdentifiers;
} | php | public function getOrderedRequiredHits()
{
$hitIdentifiers = array();
foreach($this->requiredHits as $hitIdentifier)
{
$hitIdentifiers[$this->hitPositions[$hitIdentifier]] = $hitIdentifier;
}
krsort($hitIdentifiers);
return $hitIdentifiers;
} | [
"public",
"function",
"getOrderedRequiredHits",
"(",
")",
"{",
"$",
"hitIdentifiers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"requiredHits",
"as",
"$",
"hitIdentifier",
")",
"{",
"$",
"hitIdentifiers",
"[",
"$",
"this",
"->",
"hitP... | Get required hits names,
ordered by item constructor positions
@return string[] | [
"Get",
"required",
"hits",
"names",
"ordered",
"by",
"item",
"constructor",
"positions"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L386-L395 |
3,513 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.addRequiredHit | public function addRequiredHit($hitIdentifier)
{
if(!in_array($hitIdentifier, $this->requiredHits))
{
$this->requiredHits[] = $hitIdentifier;
}
return $this;
} | php | public function addRequiredHit($hitIdentifier)
{
if(!in_array($hitIdentifier, $this->requiredHits))
{
$this->requiredHits[] = $hitIdentifier;
}
return $this;
} | [
"public",
"function",
"addRequiredHit",
"(",
"$",
"hitIdentifier",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"hitIdentifier",
",",
"$",
"this",
"->",
"requiredHits",
")",
")",
"{",
"$",
"this",
"->",
"requiredHits",
"[",
"]",
"=",
"$",
"hitIdentifi... | Add Required Hit
@param type $hitIdentifier
@return \Emhar\SearchDoctrineBundle\Mapping\ItemMetaData | [
"Add",
"Required",
"Hit"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L403-L410 |
3,514 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.addSortableHit | public function addSortableHit($hitIdentifier)
{
if(!in_array($hitIdentifier, $this->sortableHits))
{
$this->sortableHits[] = $hitIdentifier;
}
return $this;
} | php | public function addSortableHit($hitIdentifier)
{
if(!in_array($hitIdentifier, $this->sortableHits))
{
$this->sortableHits[] = $hitIdentifier;
}
return $this;
} | [
"public",
"function",
"addSortableHit",
"(",
"$",
"hitIdentifier",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"hitIdentifier",
",",
"$",
"this",
"->",
"sortableHits",
")",
")",
"{",
"$",
"this",
"->",
"sortableHits",
"[",
"]",
"=",
"$",
"hitIdentifi... | Add sortable hit.
@param string $hitIdentifier
@return ItemMetaData | [
"Add",
"sortable",
"hit",
"."
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L451-L458 |
3,515 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.getHitEntityAttribute | public function getHitEntityAttribute($hitIdentifier, $entityIdentifier)
{
return isset($this->entityHitMapping[$entityIdentifier][$hitIdentifier]) ?
$this->entityHitMapping[$entityIdentifier][$hitIdentifier] : null;
} | php | public function getHitEntityAttribute($hitIdentifier, $entityIdentifier)
{
return isset($this->entityHitMapping[$entityIdentifier][$hitIdentifier]) ?
$this->entityHitMapping[$entityIdentifier][$hitIdentifier] : null;
} | [
"public",
"function",
"getHitEntityAttribute",
"(",
"$",
"hitIdentifier",
",",
"$",
"entityIdentifier",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"entityHitMapping",
"[",
"$",
"entityIdentifier",
"]",
"[",
"$",
"hitIdentifier",
"]",
")",
"?",
"$",
... | Get hit entity attribute
return null if there is no mapping for this hit
@param string $hitIdentifier
@param string $entityIdentifier
@return string|null | [
"Get",
"hit",
"entity",
"attribute",
"return",
"null",
"if",
"there",
"is",
"no",
"mapping",
"for",
"this",
"hit"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L468-L472 |
3,516 | emhar/SearchDoctrineBundle | Mapping/ItemMetaData.php | ItemMetaData.setHitEntityAttribute | public function setHitEntityAttribute($hitIdentifier, $entityIdentifier, $attribute)
{
if(!array_key_exists($entityIdentifier, $this->entityClasses))
{
throw MappingException::invalidEntity($this->itemClass, $entityIdentifier);
}
$this->entityHitMapping[$entityIdentifier][$hitIdentifier] = $attribute;
ret... | php | public function setHitEntityAttribute($hitIdentifier, $entityIdentifier, $attribute)
{
if(!array_key_exists($entityIdentifier, $this->entityClasses))
{
throw MappingException::invalidEntity($this->itemClass, $entityIdentifier);
}
$this->entityHitMapping[$entityIdentifier][$hitIdentifier] = $attribute;
ret... | [
"public",
"function",
"setHitEntityAttribute",
"(",
"$",
"hitIdentifier",
",",
"$",
"entityIdentifier",
",",
"$",
"attribute",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"entityIdentifier",
",",
"$",
"this",
"->",
"entityClasses",
")",
")",
"{",
... | Set hit entity attribute
@param string $hitIdentifier
@param string $entityIdentifier
@param string $attribute
@return ItemMetaData | [
"Set",
"hit",
"entity",
"attribute"
] | 0844cda4a6972dd71c04c0b38dba1ebf9b15c238 | https://github.com/emhar/SearchDoctrineBundle/blob/0844cda4a6972dd71c04c0b38dba1ebf9b15c238/Mapping/ItemMetaData.php#L482-L490 |
3,517 | MESD/JasperReportViewerBundle | Twig/Extension/ReportViewerExtension.php | ReportViewerExtension.getFunctions | public function getFunctions()
{
//Function definition
return array(
'mesd_jasper_reportviewer_stored_report_link' => new \Twig_Function_Method($this, 'renderStoredReportLink', array('is_safe' => array('html'))),
'mesd_jasper_reportviewer_report_link' => new \Twig_Function_M... | php | public function getFunctions()
{
//Function definition
return array(
'mesd_jasper_reportviewer_stored_report_link' => new \Twig_Function_Method($this, 'renderStoredReportLink', array('is_safe' => array('html'))),
'mesd_jasper_reportviewer_report_link' => new \Twig_Function_M... | [
"public",
"function",
"getFunctions",
"(",
")",
"{",
"//Function definition",
"return",
"array",
"(",
"'mesd_jasper_reportviewer_stored_report_link'",
"=>",
"new",
"\\",
"Twig_Function_Method",
"(",
"$",
"this",
",",
"'renderStoredReportLink'",
",",
"array",
"(",
"'is_s... | Get functions lists the functions in this class | [
"Get",
"functions",
"lists",
"the",
"functions",
"in",
"this",
"class"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Twig/Extension/ReportViewerExtension.php#L21-L31 |
3,518 | MESD/JasperReportViewerBundle | Twig/Extension/ReportViewerExtension.php | ReportViewerExtension.renderReportHome | public function renderReportHome($linkText, $classes = ' ', $openInNewTab = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:reportHome.html.twig',
array(
'linkText' => $linkText,
'classes' => $classes,
... | php | public function renderReportHome($linkText, $classes = ' ', $openInNewTab = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:reportHome.html.twig',
array(
'linkText' => $linkText,
'classes' => $classes,
... | [
"public",
"function",
"renderReportHome",
"(",
"$",
"linkText",
",",
"$",
"classes",
"=",
"' '",
",",
"$",
"openInNewTab",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"environment",
"->",
"render",
"(",
"'MesdJasperReportViewerBundle:Partials:reportHome.ht... | Render a link to the report viewer home
@param [type] $linkText [description]
@param string $class [description]
@param boolean $optionInNewTab [description]
@return [type] [description] | [
"Render",
"a",
"link",
"to",
"the",
"report",
"viewer",
"home"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Twig/Extension/ReportViewerExtension.php#L72-L80 |
3,519 | MESD/JasperReportViewerBundle | Twig/Extension/ReportViewerExtension.php | ReportViewerExtension.renderReportLink | public function renderReportLink($reportUri, $linkText, $classes = ' ', $openInNewTab = true, $hideHome = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:reportLink.html.twig',
array(
'reportUri' => $reportUri,
'linkTe... | php | public function renderReportLink($reportUri, $linkText, $classes = ' ', $openInNewTab = true, $hideHome = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:reportLink.html.twig',
array(
'reportUri' => $reportUri,
'linkTe... | [
"public",
"function",
"renderReportLink",
"(",
"$",
"reportUri",
",",
"$",
"linkText",
",",
"$",
"classes",
"=",
"' '",
",",
"$",
"openInNewTab",
"=",
"true",
",",
"$",
"hideHome",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"environment",
"->",
... | Renders a link to a report
@param string $reportUri The uri of the report
@param string $linkText The text to display for the link
@param string $classes The classes to have for the anchor tag
@param boolean $openInNewTab Whether to open in a new tab or not
@param boolean $hideHome Whether to hide t... | [
"Renders",
"a",
"link",
"to",
"a",
"report"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Twig/Extension/ReportViewerExtension.php#L93-L103 |
3,520 | MESD/JasperReportViewerBundle | Twig/Extension/ReportViewerExtension.php | ReportViewerExtension.renderStoredReportLink | public function renderStoredReportLink($reportUri, $requestId, $linkText, $classes = ' ', $openInNewTab = true, $hideHome = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:storedReportLink.html.twig',
array(
'reportUri' => $reportUri,... | php | public function renderStoredReportLink($reportUri, $requestId, $linkText, $classes = ' ', $openInNewTab = true, $hideHome = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:storedReportLink.html.twig',
array(
'reportUri' => $reportUri,... | [
"public",
"function",
"renderStoredReportLink",
"(",
"$",
"reportUri",
",",
"$",
"requestId",
",",
"$",
"linkText",
",",
"$",
"classes",
"=",
"' '",
",",
"$",
"openInNewTab",
"=",
"true",
",",
"$",
"hideHome",
"=",
"true",
")",
"{",
"return",
"$",
"this"... | Renders a link to a stored report
@param string $reportUri The uri of the report the request id is for
@param string $requestId The request id of the stored report
@param string $linkText The text to display for the link
@param string $classes The classes to have for the anchor tag
@param boolean $o... | [
"Renders",
"a",
"link",
"to",
"a",
"stored",
"report"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Twig/Extension/ReportViewerExtension.php#L118-L129 |
3,521 | MESD/JasperReportViewerBundle | Twig/Extension/ReportViewerExtension.php | ReportViewerExtension.renderDirectReportLink | public function renderDirectReportLink(ReportInstance $reportInstance, $linkText, $classes = ' ', $openInNewTab = true, $hideHome = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:directReportLink.html.twig',
array(
'reportUri' => $re... | php | public function renderDirectReportLink(ReportInstance $reportInstance, $linkText, $classes = ' ', $openInNewTab = true, $hideHome = true)
{
return $this->environment->render(
'MesdJasperReportViewerBundle:Partials:directReportLink.html.twig',
array(
'reportUri' => $re... | [
"public",
"function",
"renderDirectReportLink",
"(",
"ReportInstance",
"$",
"reportInstance",
",",
"$",
"linkText",
",",
"$",
"classes",
"=",
"' '",
",",
"$",
"openInNewTab",
"=",
"true",
",",
"$",
"hideHome",
"=",
"true",
")",
"{",
"return",
"$",
"this",
... | Renders a report immediately in the viewer with the parameters from the report instance object
@param ReportInstance $reportInstance The instance of a report to run
@param string $linkText THe text to place in the link
@param string $classes The classes to add to the link
@param boolea... | [
"Renders",
"a",
"report",
"immediately",
"in",
"the",
"viewer",
"with",
"the",
"parameters",
"from",
"the",
"report",
"instance",
"object"
] | d51ff079ba79b35c549a7ac472a305d416060d86 | https://github.com/MESD/JasperReportViewerBundle/blob/d51ff079ba79b35c549a7ac472a305d416060d86/Twig/Extension/ReportViewerExtension.php#L143-L154 |
3,522 | narrowspark/automatic-common | Package.php | Package.createFromLock | public static function createFromLock(string $name, array $packageData): PackageContract
{
$keyToFunctionMappers = [
'parent' => 'setParentName',
'is-dev' => 'setIsDev',
'url' => 'setUrl',
'operation' => 'setOperation',
... | php | public static function createFromLock(string $name, array $packageData): PackageContract
{
$keyToFunctionMappers = [
'parent' => 'setParentName',
'is-dev' => 'setIsDev',
'url' => 'setUrl',
'operation' => 'setOperation',
... | [
"public",
"static",
"function",
"createFromLock",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"packageData",
")",
":",
"PackageContract",
"{",
"$",
"keyToFunctionMappers",
"=",
"[",
"'parent'",
"=>",
"'setParentName'",
",",
"'is-dev'",
"=>",
"'setIsDev'",
","... | Create a automatic package from the lock data.
@param string $name
@param array $packageData
@return \Narrowspark\Automatic\Common\Contract\Package | [
"Create",
"a",
"automatic",
"package",
"from",
"the",
"lock",
"data",
"."
] | 415f0d566932847c3ca799e06f27e588bd244881 | https://github.com/narrowspark/automatic-common/blob/415f0d566932847c3ca799e06f27e588bd244881/Package.php#L285-L308 |
3,523 | samurai-fw/samurai | src/Samurai/Component/Spec/Helper.php | Helper.getRunner | public function getRunner()
{
if ($this->runner)
return $this->runner;
$runner = new Runner\PHPSpecRunner();
$this->application->getContainer()->injectDependency($runner);
$runner->initialize();
return $this->runner = $runner;
} | php | public function getRunner()
{
if ($this->runner)
return $this->runner;
$runner = new Runner\PHPSpecRunner();
$this->application->getContainer()->injectDependency($runner);
$runner->initialize();
return $this->runner = $runner;
} | [
"public",
"function",
"getRunner",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"runner",
")",
"return",
"$",
"this",
"->",
"runner",
";",
"$",
"runner",
"=",
"new",
"Runner",
"\\",
"PHPSpecRunner",
"(",
")",
";",
"$",
"this",
"->",
"application",
"-... | get runner.
@access public
@return Samurai\Samurai\Component\Spec\Runner
@todo support other runner (ex: phpUnit, behat, etc...) | [
"get",
"runner",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Spec/Helper.php#L66-L77 |
3,524 | HeroicTeam/m | Html/Element.php | Element.renderAttributes | protected function renderAttributes()
{
$output = '';
foreach($this->_attr as $key => $value) {
$output .= $key.' = "'.$value.'" ';
}
return $output;
} | php | protected function renderAttributes()
{
$output = '';
foreach($this->_attr as $key => $value) {
$output .= $key.' = "'.$value.'" ';
}
return $output;
} | [
"protected",
"function",
"renderAttributes",
"(",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"_attr",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"output",
".=",
"$",
"key",
".",
"' = \"'",
".",
"$",
"value... | Renders the attribute string for the element.
@return string | [
"Renders",
"the",
"attribute",
"string",
"for",
"the",
"element",
"."
] | daa6d5956ee6c989379fe5fae39feccc59cf4add | https://github.com/HeroicTeam/m/blob/daa6d5956ee6c989379fe5fae39feccc59cf4add/Html/Element.php#L24-L33 |
3,525 | HeroicTeam/m | Html/Element.php | Element.getAttribute | public function getAttribute($key)
{
return isset($this->_attr[$key]) ? $this->_attr[$key] : null;
} | php | public function getAttribute($key)
{
return isset($this->_attr[$key]) ? $this->_attr[$key] : null;
} | [
"public",
"function",
"getAttribute",
"(",
"$",
"key",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_attr",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"_attr",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Returns the requested attribute if it exists.
@param string $key
@return mixed|null | [
"Returns",
"the",
"requested",
"attribute",
"if",
"it",
"exists",
"."
] | daa6d5956ee6c989379fe5fae39feccc59cf4add | https://github.com/HeroicTeam/m/blob/daa6d5956ee6c989379fe5fae39feccc59cf4add/Html/Element.php#L68-L71 |
3,526 | Jinxes/layton | Layton/Library/Http/Stream.php | Stream.isPipe | public function isPipe()
{
if (\is_null($this->isPipe)) {
$this->isPipe = false;
if ($this->isAttached()) {
$mode = fstat($this->stream)['mode'];
$this->isPipe = ($mode & 0010000) !== 0;
}
}
return $this->isPipe;
} | php | public function isPipe()
{
if (\is_null($this->isPipe)) {
$this->isPipe = false;
if ($this->isAttached()) {
$mode = fstat($this->stream)['mode'];
$this->isPipe = ($mode & 0010000) !== 0;
}
}
return $this->isPipe;
} | [
"public",
"function",
"isPipe",
"(",
")",
"{",
"if",
"(",
"\\",
"is_null",
"(",
"$",
"this",
"->",
"isPipe",
")",
")",
"{",
"$",
"this",
"->",
"isPipe",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"isAttached",
"(",
")",
")",
"{",
"$",
"mo... | Is the stream is a pipe?
@return bool | [
"Is",
"the",
"stream",
"is",
"a",
"pipe?"
] | 27b8eab2c59b9887eb93e40a533eb77cc5690584 | https://github.com/Jinxes/layton/blob/27b8eab2c59b9887eb93e40a533eb77cc5690584/Layton/Library/Http/Stream.php#L176-L186 |
3,527 | osflab/view | Component/Jquery.php | Jquery.enableAutofocus | public function enableAutofocus()
{
static $enabled = false;
if (!$enabled) {
$script = "$(document).ready(function(){"
. "\$(this).find('[autofocus]:first').focus();"
. "});";
$this->registerScript($script);
$enabl... | php | public function enableAutofocus()
{
static $enabled = false;
if (!$enabled) {
$script = "$(document).ready(function(){"
. "\$(this).find('[autofocus]:first').focus();"
. "});";
$this->registerScript($script);
$enabl... | [
"public",
"function",
"enableAutofocus",
"(",
")",
"{",
"static",
"$",
"enabled",
"=",
"false",
";",
"if",
"(",
"!",
"$",
"enabled",
")",
"{",
"$",
"script",
"=",
"\"$(document).ready(function(){\"",
".",
"\"\\$(this).find('[autofocus]:first').focus();\"",
".",
"\... | Activate focus on elements with the attribute "autofocus"
@staticvar boolean $activated
@return $this | [
"Activate",
"focus",
"on",
"elements",
"with",
"the",
"attribute",
"autofocus"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Component/Jquery.php#L53-L66 |
3,528 | gliverphp/helpers | src/Redirect/Redirect.php | Redirect.to | public static function to($path, array $data = null )
{
//compose query string if data was set
($data !== null) ? self::with($data) : '';
//compose full url
$path = (self::$query_string === null) ? Url::link($path) : Url::link($path) . '?' . self::$query_string;
//redirect to path
header('Location: ' . ... | php | public static function to($path, array $data = null )
{
//compose query string if data was set
($data !== null) ? self::with($data) : '';
//compose full url
$path = (self::$query_string === null) ? Url::link($path) : Url::link($path) . '?' . self::$query_string;
//redirect to path
header('Location: ' . ... | [
"public",
"static",
"function",
"to",
"(",
"$",
"path",
",",
"array",
"$",
"data",
"=",
"null",
")",
"{",
"//compose query string if data was set",
"(",
"$",
"data",
"!==",
"null",
")",
"?",
"self",
"::",
"with",
"(",
"$",
"data",
")",
":",
"''",
";",
... | This method redirect to the specified page
@param string $path The path to redirect to
@param mixed $data The data with which to do redirect | [
"This",
"method",
"redirect",
"to",
"the",
"specified",
"page"
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/Redirect/Redirect.php#L48-L62 |
3,529 | znframework/package-language | Update.php | Update.do | public function do(String $app = NULL, $key, String $data = NULL) : Bool
{
return (new Insert)->do($app, $key, $data);
} | php | public function do(String $app = NULL, $key, String $data = NULL) : Bool
{
return (new Insert)->do($app, $key, $data);
} | [
"public",
"function",
"do",
"(",
"String",
"$",
"app",
"=",
"NULL",
",",
"$",
"key",
",",
"String",
"$",
"data",
"=",
"NULL",
")",
":",
"Bool",
"{",
"return",
"(",
"new",
"Insert",
")",
"->",
"do",
"(",
"$",
"app",
",",
"$",
"key",
",",
"$",
... | Updates language key
@param string $app = NULL
@param mixed $key
@param string $data = NULL
@return bool | [
"Updates",
"language",
"key"
] | f0fe3b9ec2ba1a69838da9af58ced5398ea9fb09 | https://github.com/znframework/package-language/blob/f0fe3b9ec2ba1a69838da9af58ced5398ea9fb09/Update.php#L23-L26 |
3,530 | cityware/city-snmp | src/MIBS/Cisco/VlanMembership.php | VlanMembership.vlanTypes | public function vlanTypes($translate = false)
{
$states = $this->getSNMP()->walk1d(self::OID_VLAN_MEMBERSHIP_VLAN_TYPE);
if (!$translate) {
return $states;
}
return $this->getSNMP()->translate($states, self::$VLAN_MEMBERSHIP_VLAN_TYPES);
} | php | public function vlanTypes($translate = false)
{
$states = $this->getSNMP()->walk1d(self::OID_VLAN_MEMBERSHIP_VLAN_TYPE);
if (!$translate) {
return $states;
}
return $this->getSNMP()->translate($states, self::$VLAN_MEMBERSHIP_VLAN_TYPES);
} | [
"public",
"function",
"vlanTypes",
"(",
"$",
"translate",
"=",
"false",
")",
"{",
"$",
"states",
"=",
"$",
"this",
"->",
"getSNMP",
"(",
")",
"->",
"walk1d",
"(",
"self",
"::",
"OID_VLAN_MEMBERSHIP_VLAN_TYPE",
")",
";",
"if",
"(",
"!",
"$",
"translate",
... | Get an array of the type of VLAN membership of each device port.
E.g. the follow SNMP output yields the shown array:
.1.3.6.1.4.1.9.9.68.1.2.2.1.1.10128 = INTEGER: static(1)
.1.3.6.1.4.1.9.9.68.1.2.2.1.1.10129 = INTEGER: dynamic(2)
...
[10128] => 1
[10129] => 2
@return array | [
"Get",
"an",
"array",
"of",
"the",
"type",
"of",
"VLAN",
"membership",
"of",
"each",
"device",
"port",
"."
] | 831b7485b6c932a84f081d5ceeb9c5f4e7a8641d | https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Cisco/VlanMembership.php#L62-L71 |
3,531 | cityware/city-snmp | src/MIBS/Cisco/VlanMembership.php | VlanMembership.portStatus | public function portStatus($translate = false)
{
$states = $this->getSNMP()->walk1d(self::OID_VLAN_MEMBERSHIP_PORT_STATUS);
if (!$translate) {
return $states;
}
return $this->getSNMP()->translate($states, self::$VLAN_MEMBERSHIP_PORT_STATUS);
} | php | public function portStatus($translate = false)
{
$states = $this->getSNMP()->walk1d(self::OID_VLAN_MEMBERSHIP_PORT_STATUS);
if (!$translate) {
return $states;
}
return $this->getSNMP()->translate($states, self::$VLAN_MEMBERSHIP_PORT_STATUS);
} | [
"public",
"function",
"portStatus",
"(",
"$",
"translate",
"=",
"false",
")",
"{",
"$",
"states",
"=",
"$",
"this",
"->",
"getSNMP",
"(",
")",
"->",
"walk1d",
"(",
"self",
"::",
"OID_VLAN_MEMBERSHIP_PORT_STATUS",
")",
";",
"if",
"(",
"!",
"$",
"translate... | Get an array of the current status of VLAN in each device port.
.1.3.6.1.4.1.9.9.68.1.2.2.1.1.10128 = INTEGER: inactive(1)
.1.3.6.1.4.1.9.9.68.1.2.2.1.1.10129 = INTEGER: active(2)
...
[10128] => 1
[10129] => 2
@param bool $translate If true, return the string representation.
@return array An array with the current ... | [
"Get",
"an",
"array",
"of",
"the",
"current",
"status",
"of",
"VLAN",
"in",
"each",
"device",
"port",
"."
] | 831b7485b6c932a84f081d5ceeb9c5f4e7a8641d | https://github.com/cityware/city-snmp/blob/831b7485b6c932a84f081d5ceeb9c5f4e7a8641d/src/MIBS/Cisco/VlanMembership.php#L138-L147 |
3,532 | nicmart/DSQExpression | src/Builder/FilterProcess.php | FilterProcess.getSubtree | private function getSubtree(TreeExpression $expr)
{
foreach ($expr->getChildren() as $child) {
if ($child->getType() == $this->operator)
return $child;
}
$expr->addChild($subtree = new TreeExpression($this->operator));
return $subtree;
} | php | private function getSubtree(TreeExpression $expr)
{
foreach ($expr->getChildren() as $child) {
if ($child->getType() == $this->operator)
return $child;
}
$expr->addChild($subtree = new TreeExpression($this->operator));
return $subtree;
} | [
"private",
"function",
"getSubtree",
"(",
"TreeExpression",
"$",
"expr",
")",
"{",
"foreach",
"(",
"$",
"expr",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"getType",
"(",
")",
"==",
"$",
"this",
"->",
... | Retrieve or create the first subtree that matches with the operator
@param TreeExpression $expr
@return \DSQ\Expression\Expression|TreeExpression | [
"Retrieve",
"or",
"create",
"the",
"first",
"subtree",
"that",
"matches",
"with",
"the",
"operator"
] | f46f18cabdbc59347424b3b6669e380f24943be3 | https://github.com/nicmart/DSQExpression/blob/f46f18cabdbc59347424b3b6669e380f24943be3/src/Builder/FilterProcess.php#L61-L70 |
3,533 | yongtiger/yii2-theme | src/Bootstrap.php | Bootstrap.filterThemesBootstrap | public static function filterThemesBootstrap($themesRootPath = 'themes', $bootstrapPathFile = 'src\\Bootstrap', $bootstrapPathPattern = '{theme-path}\\{bootstrap-path-file}') {
if (static::$_themeBootstraps === null) {
static::$_themeBootstraps = static::findThemeBootstraps($themesRootPath, $bootstrapPathFi... | php | public static function filterThemesBootstrap($themesRootPath = 'themes', $bootstrapPathFile = 'src\\Bootstrap', $bootstrapPathPattern = '{theme-path}\\{bootstrap-path-file}') {
if (static::$_themeBootstraps === null) {
static::$_themeBootstraps = static::findThemeBootstraps($themesRootPath, $bootstrapPathFi... | [
"public",
"static",
"function",
"filterThemesBootstrap",
"(",
"$",
"themesRootPath",
"=",
"'themes'",
",",
"$",
"bootstrapPathFile",
"=",
"'src\\\\Bootstrap'",
",",
"$",
"bootstrapPathPattern",
"=",
"'{theme-path}\\\\{bootstrap-path-file}'",
")",
"{",
"if",
"(",
"static... | Filters bootstraps in `themes` folder.
If the current theme exist in `Yii::$app->extensions`, remove out.
In other words, if a theme has been registered in the themes table `theme/thems`, you do not need to perform bootstrap.
@param string $themesRootPath e.g. `themes`
@param string $bootstrapPathFile e.g. `src\Boots... | [
"Filters",
"bootstraps",
"in",
"themes",
"folder",
"."
] | b51fbf66fe51d16b3061b5ffc26f05eb64c3ea40 | https://github.com/yongtiger/yii2-theme/blob/b51fbf66fe51d16b3061b5ffc26f05eb64c3ea40/src/Bootstrap.php#L86-L107 |
3,534 | yongtiger/yii2-theme | src/Bootstrap.php | Bootstrap.findThemeBootstraps | public static function findThemeBootstraps($themesRootPath, $bootstrapPathFile, $bootstrapPathPattern) {
$dir = Yii::getAlias('@' . $themesRootPath);
if (!is_dir($dir)) {
throw new InvalidParamException("The dir argument must be a directory: $dir");
}
$dir = rtrim($dir, DIRECTO... | php | public static function findThemeBootstraps($themesRootPath, $bootstrapPathFile, $bootstrapPathPattern) {
$dir = Yii::getAlias('@' . $themesRootPath);
if (!is_dir($dir)) {
throw new InvalidParamException("The dir argument must be a directory: $dir");
}
$dir = rtrim($dir, DIRECTO... | [
"public",
"static",
"function",
"findThemeBootstraps",
"(",
"$",
"themesRootPath",
",",
"$",
"bootstrapPathFile",
",",
"$",
"bootstrapPathPattern",
")",
"{",
"$",
"dir",
"=",
"Yii",
"::",
"getAlias",
"(",
"'@'",
".",
"$",
"themesRootPath",
")",
";",
"if",
"(... | Finds all `Bootstrap` class files in the given themes root path.
@param string $themesRootPath e.g. `themes`
@param string $bootstrapPathFile e.g. `src\Bootstrap`
@param string $bootstrapPathPattern e.g. `{theme-path}\{bootstrap-path-file}`
@return array e.g. ['themes\yii2themeyii\src\Bootstrap'] | [
"Finds",
"all",
"Bootstrap",
"class",
"files",
"in",
"the",
"given",
"themes",
"root",
"path",
"."
] | b51fbf66fe51d16b3061b5ffc26f05eb64c3ea40 | https://github.com/yongtiger/yii2-theme/blob/b51fbf66fe51d16b3061b5ffc26f05eb64c3ea40/src/Bootstrap.php#L117-L144 |
3,535 | atelierspierrot/library | src/Library/HttpFundamental/Request.php | Request.guessFromCurrent | public function guessFromCurrent()
{
$this
->setUrl(UrlHelper::getRequestUrl())
->setProtocol(UrlHelper::getHttpProtocol())
->setMethod($_SERVER['REQUEST_METHOD'])
->setHeaders($this->getallheaders())
->setArguments(isset($_GET) ? $_GET : array())
... | php | public function guessFromCurrent()
{
$this
->setUrl(UrlHelper::getRequestUrl())
->setProtocol(UrlHelper::getHttpProtocol())
->setMethod($_SERVER['REQUEST_METHOD'])
->setHeaders($this->getallheaders())
->setArguments(isset($_GET) ? $_GET : array())
... | [
"public",
"function",
"guessFromCurrent",
"(",
")",
"{",
"$",
"this",
"->",
"setUrl",
"(",
"UrlHelper",
"::",
"getRequestUrl",
"(",
")",
")",
"->",
"setProtocol",
"(",
"UrlHelper",
"::",
"getHttpProtocol",
"(",
")",
")",
"->",
"setMethod",
"(",
"$",
"_SERV... | Populate the request object with current HTTP request values
@return $this
@see \Library\Helper\Url::getRequestUrl() | [
"Populate",
"the",
"request",
"object",
"with",
"current",
"HTTP",
"request",
"values"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/HttpFundamental/Request.php#L167-L184 |
3,536 | atelierspierrot/library | src/Library/HttpFundamental/Request.php | Request._extractSegments | protected function _extractSegments(&$arguments)
{
if (is_string($arguments)) $this->_extractArguments($arguments);
foreach ($arguments as $var=>$val) {
if (empty($val) && strpos($var, '/')!==false) {
$parts = explode('/', $var);
unset($arguments[$var]);
... | php | protected function _extractSegments(&$arguments)
{
if (is_string($arguments)) $this->_extractArguments($arguments);
foreach ($arguments as $var=>$val) {
if (empty($val) && strpos($var, '/')!==false) {
$parts = explode('/', $var);
unset($arguments[$var]);
... | [
"protected",
"function",
"_extractSegments",
"(",
"&",
"$",
"arguments",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"arguments",
")",
")",
"$",
"this",
"->",
"_extractArguments",
"(",
"$",
"arguments",
")",
";",
"foreach",
"(",
"$",
"arguments",
"as",
"... | Extract the table of "var=>val" arguments pairs from a slashed route
@param array|string $arguments (passed and transformed by reference) | [
"Extract",
"the",
"table",
"of",
"var",
"=",
">",
"val",
"arguments",
"pairs",
"from",
"a",
"slashed",
"route"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/HttpFundamental/Request.php#L661-L679 |
3,537 | atelierspierrot/library | src/Library/HttpFundamental/Request.php | Request.cleanArgument | public static function cleanArgument($arg_value, $flags = ENT_COMPAT, $encoding = 'UTF-8')
{
if (is_string($arg_value)) {
$result = stripslashes( htmlspecialchars($arg_value, ENT_COMPAT, $encoding) );
} elseif (is_array($arg_value)) {
$result = array();
foreach($... | php | public static function cleanArgument($arg_value, $flags = ENT_COMPAT, $encoding = 'UTF-8')
{
if (is_string($arg_value)) {
$result = stripslashes( htmlspecialchars($arg_value, ENT_COMPAT, $encoding) );
} elseif (is_array($arg_value)) {
$result = array();
foreach($... | [
"public",
"static",
"function",
"cleanArgument",
"(",
"$",
"arg_value",
",",
"$",
"flags",
"=",
"ENT_COMPAT",
",",
"$",
"encoding",
"=",
"'UTF-8'",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"arg_value",
")",
")",
"{",
"$",
"result",
"=",
"stripslashes"... | Clean the value taken from request arguments or data
@param string $arg_value The parameter name if so, or 'args' to get all parameters values
@param int $flags The PHP flags used with htmlspecialchars() (default is ENT_COMPAT)
@param string $encoding The encoding used with htmlspecialchars() (defa... | [
"Clean",
"the",
"value",
"taken",
"from",
"request",
"arguments",
"or",
"data"
] | a2988a11370d13c7e0dc47f9d2d81c664c30b8dd | https://github.com/atelierspierrot/library/blob/a2988a11370d13c7e0dc47f9d2d81c664c30b8dd/src/Library/HttpFundamental/Request.php#L693-L704 |
3,538 | glendmaatita/Tolkien | src/Tolkien/BuildPost.php | BuildPost.find_all_files | public function find_all_files($dir)
{
$root = array_reverse(scandir($dir));
if(count($root) == 0) return;
foreach($root as $value)
{
if($value === '.' || $value === '..')
{
continue;
}
if(is_file("$dir/$value"))
{
$result[] = "$dir/$value";
$this->posts[] = $this->read( "$dir/$v... | php | public function find_all_files($dir)
{
$root = array_reverse(scandir($dir));
if(count($root) == 0) return;
foreach($root as $value)
{
if($value === '.' || $value === '..')
{
continue;
}
if(is_file("$dir/$value"))
{
$result[] = "$dir/$value";
$this->posts[] = $this->read( "$dir/$v... | [
"public",
"function",
"find_all_files",
"(",
"$",
"dir",
")",
"{",
"$",
"root",
"=",
"array_reverse",
"(",
"scandir",
"(",
"$",
"dir",
")",
")",
";",
"if",
"(",
"count",
"(",
"$",
"root",
")",
"==",
"0",
")",
"return",
";",
"foreach",
"(",
"$",
"... | Find All file on asset dir and create array of Model\Post
@param string $dir
@return recursive | [
"Find",
"All",
"file",
"on",
"asset",
"dir",
"and",
"create",
"array",
"of",
"Model",
"\\",
"Post"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/BuildPost.php#L64-L87 |
3,539 | glendmaatita/Tolkien | src/Tolkien/BuildPost.php | BuildPost.defineAuthor | public function defineAuthor($header)
{
$author = $this->config['authors'][$header['author']];
return new Author($header['author'], $author['name'], $author['email'], $author['signature'], $author['facebook'], $author['twitter'], $author['github']);
} | php | public function defineAuthor($header)
{
$author = $this->config['authors'][$header['author']];
return new Author($header['author'], $author['name'], $author['email'], $author['signature'], $author['facebook'], $author['twitter'], $author['github']);
} | [
"public",
"function",
"defineAuthor",
"(",
"$",
"header",
")",
"{",
"$",
"author",
"=",
"$",
"this",
"->",
"config",
"[",
"'authors'",
"]",
"[",
"$",
"header",
"[",
"'author'",
"]",
"]",
";",
"return",
"new",
"Author",
"(",
"$",
"header",
"[",
"'auth... | Create new Author object instance for Post object
@param array $header Metadata
@return Model\Author | [
"Create",
"new",
"Author",
"object",
"instance",
"for",
"Post",
"object"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/BuildPost.php#L202-L206 |
3,540 | glendmaatita/Tolkien | src/Tolkien/BuildPost.php | BuildPost.defineCategories | public function defineCategories($header)
{
$categories = array();
$cats = explode(',', $header['categories']);
foreach ($cats as $category)
{
$categories[] = new Category(trim($category));
}
return $categories;
} | php | public function defineCategories($header)
{
$categories = array();
$cats = explode(',', $header['categories']);
foreach ($cats as $category)
{
$categories[] = new Category(trim($category));
}
return $categories;
} | [
"public",
"function",
"defineCategories",
"(",
"$",
"header",
")",
"{",
"$",
"categories",
"=",
"array",
"(",
")",
";",
"$",
"cats",
"=",
"explode",
"(",
"','",
",",
"$",
"header",
"[",
"'categories'",
"]",
")",
";",
"foreach",
"(",
"$",
"cats",
"as"... | Create a list of category from header metadata
@param array $header
@return array(Model\Category) | [
"Create",
"a",
"list",
"of",
"category",
"from",
"header",
"metadata"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/BuildPost.php#L214-L223 |
3,541 | loopsframework/base | src/Loops/Application/WebApplication.php | WebApplication.run | public function run() {
try {
$request = $this->getLoops()->getService("request");
$response = $this->getLoops()->getService("response");
$web_core = $this->getLoops()->getService("web_core");
//dispatch request
echo $web_core->dispatch($this->url, $... | php | public function run() {
try {
$request = $this->getLoops()->getService("request");
$response = $this->getLoops()->getService("response");
$web_core = $this->getLoops()->getService("web_core");
//dispatch request
echo $web_core->dispatch($this->url, $... | [
"public",
"function",
"run",
"(",
")",
"{",
"try",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"getLoops",
"(",
")",
"->",
"getService",
"(",
"\"request\"",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"getLoops",
"(",
")",
"->",
"getService",... | Runs the request by by dispaching the request via the web core service.
This method will print the resulting output and set http status codes accordingly.
Exceptions will be caught and rendered. | [
"Runs",
"the",
"request",
"by",
"by",
"dispaching",
"the",
"request",
"via",
"the",
"web",
"core",
"service",
".",
"This",
"method",
"will",
"print",
"the",
"resulting",
"output",
"and",
"set",
"http",
"status",
"codes",
"accordingly",
".",
"Exceptions",
"wi... | 5a15172ed4e543d7d5ecd8bd65e31f26bab3d192 | https://github.com/loopsframework/base/blob/5a15172ed4e543d7d5ecd8bd65e31f26bab3d192/src/Loops/Application/WebApplication.php#L87-L107 |
3,542 | noordawod/php-util | src/Base64.php | Base64.encode | public static function encode(
/*string*/ $string,
/*boolean*/ $oneLine = true
) {
if(!self::isEncoded($string)) {
$string = base64_encode($string);
}
if($string && $oneLine) {
$string = str_replace(["\r", "\n"], '', $string);
}
return $string;
} | php | public static function encode(
/*string*/ $string,
/*boolean*/ $oneLine = true
) {
if(!self::isEncoded($string)) {
$string = base64_encode($string);
}
if($string && $oneLine) {
$string = str_replace(["\r", "\n"], '', $string);
}
return $string;
} | [
"public",
"static",
"function",
"encode",
"(",
"/*string*/",
"$",
"string",
",",
"/*boolean*/",
"$",
"oneLine",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"isEncoded",
"(",
"$",
"string",
")",
")",
"{",
"$",
"string",
"=",
"base64_encode",
"(... | Encodes the specified string as Base64. Note that a previously-encoded
string will not be re-encoded.
@param string $string to encode
@param boolean $oneLine TRUE to return result as a single, long line
@return string Base64-encoded string | [
"Encodes",
"the",
"specified",
"string",
"as",
"Base64",
".",
"Note",
"that",
"a",
"previously",
"-",
"encoded",
"string",
"will",
"not",
"be",
"re",
"-",
"encoded",
"."
] | 6458690cc2c8457914a2aa74b131451d4a8e5797 | https://github.com/noordawod/php-util/blob/6458690cc2c8457914a2aa74b131451d4a8e5797/src/Base64.php#L58-L69 |
3,543 | mvccore/ext-form | src/MvcCore/Ext/Form.php | Form.throwNewInvalidArgumentException | protected function throwNewInvalidArgumentException ($errorMsg) {
$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
$str = '['.$selfClass.'] ' . $errorMsg . ' ('
. 'form id: `'.$this->id . '`, '
. 'form type: `'.get_class($this->form).'`'
.')';
throw new \InvalidArgumentExce... | php | protected function throwNewInvalidArgumentException ($errorMsg) {
$selfClass = version_compare(PHP_VERSION, '5.5', '>') ? self::class : __CLASS__;
$str = '['.$selfClass.'] ' . $errorMsg . ' ('
. 'form id: `'.$this->id . '`, '
. 'form type: `'.get_class($this->form).'`'
.')';
throw new \InvalidArgumentExce... | [
"protected",
"function",
"throwNewInvalidArgumentException",
"(",
"$",
"errorMsg",
")",
"{",
"$",
"selfClass",
"=",
"version_compare",
"(",
"PHP_VERSION",
",",
"'5.5'",
",",
"'>'",
")",
"?",
"self",
"::",
"class",
":",
"__CLASS__",
";",
"$",
"str",
"=",
"'['... | Throw new `\InvalidArgumentException` with given
error message and append automatically current class name,
current form id and form class type.
@param string $errorMsg
@throws \InvalidArgumentException | [
"Throw",
"new",
"\\",
"InvalidArgumentException",
"with",
"given",
"error",
"message",
"and",
"append",
"automatically",
"current",
"class",
"name",
"current",
"form",
"id",
"and",
"form",
"class",
"type",
"."
] | 8d81a3c7326236702f37dc4b9d968907b3230b9f | https://github.com/mvccore/ext-form/blob/8d81a3c7326236702f37dc4b9d968907b3230b9f/src/MvcCore/Ext/Form.php#L86-L93 |
3,544 | mvccore/ext-form | src/MvcCore/Ext/Form.php | Form.PreDispatch | public function PreDispatch () {
if ($this->dispatchState > 1) return $this;
parent::PreDispatch(); // code: `if ($this->dispatchState < 1) $this->Init();` is executed by parent
foreach ($this->fields as $field)
// translate fields if necessary and do any rendering preparation stuff
$field->PreDispatch();
... | php | public function PreDispatch () {
if ($this->dispatchState > 1) return $this;
parent::PreDispatch(); // code: `if ($this->dispatchState < 1) $this->Init();` is executed by parent
foreach ($this->fields as $field)
// translate fields if necessary and do any rendering preparation stuff
$field->PreDispatch();
... | [
"public",
"function",
"PreDispatch",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"dispatchState",
">",
"1",
")",
"return",
"$",
"this",
";",
"parent",
"::",
"PreDispatch",
"(",
")",
";",
"// code: `if ($this->dispatchState < 1) $this->Init();` is executed by parent... | Prepare form and it's fields for rendering.
This function is called automatically by rendering process if necessary.
But if you need to operate with fields in your controller before rendering
with real session values and initialized session errors, you can call this
method anytime to prepare form for rendering and ope... | [
"Prepare",
"form",
"and",
"it",
"s",
"fields",
"for",
"rendering",
"."
] | 8d81a3c7326236702f37dc4b9d968907b3230b9f | https://github.com/mvccore/ext-form/blob/8d81a3c7326236702f37dc4b9d968907b3230b9f/src/MvcCore/Ext/Form.php#L140-L168 |
3,545 | FiveLab/ResourceBundle | src/Resource/EventListener/SymfonyGrantedRelationListener.php | SymfonyGrantedRelationListener.onBeforeNormalization | public function onBeforeNormalization(BeforeNormalizationEvent $event): void
{
$resource = $event->getResource();
if (!$resource instanceof RelatedResourceInterface) {
return;
}
$relations = $resource->getRelations();
foreach ($relations as $relation) {
... | php | public function onBeforeNormalization(BeforeNormalizationEvent $event): void
{
$resource = $event->getResource();
if (!$resource instanceof RelatedResourceInterface) {
return;
}
$relations = $resource->getRelations();
foreach ($relations as $relation) {
... | [
"public",
"function",
"onBeforeNormalization",
"(",
"BeforeNormalizationEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"resource",
"=",
"$",
"event",
"->",
"getResource",
"(",
")",
";",
"if",
"(",
"!",
"$",
"resource",
"instanceof",
"RelatedResourceInterface"... | Check the grants to relations
@param BeforeNormalizationEvent $event | [
"Check",
"the",
"grants",
"to",
"relations"
] | 048fce7be5357dc23fef1402ef8ca213489e8154 | https://github.com/FiveLab/ResourceBundle/blob/048fce7be5357dc23fef1402ef8ca213489e8154/src/Resource/EventListener/SymfonyGrantedRelationListener.php#L48-L67 |
3,546 | ekyna/Characteristics | Schema/Schema.php | Schema.addGroup | public function addGroup(Group $group)
{
if ($this->hasGroup($group)) {
throw new \InvalidArgumentException(sprintf('Group "%s" is allready defined.', $group->getName()));
}
$this->groups[$group->getName()] = $group;
return $this;
} | php | public function addGroup(Group $group)
{
if ($this->hasGroup($group)) {
throw new \InvalidArgumentException(sprintf('Group "%s" is allready defined.', $group->getName()));
}
$this->groups[$group->getName()] = $group;
return $this;
} | [
"public",
"function",
"addGroup",
"(",
"Group",
"$",
"group",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasGroup",
"(",
"$",
"group",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Group \"%s\" is allready defined.'",
... | Adds the group.
@param Group $group
@throws \InvalidArgumentException
@return Schema | [
"Adds",
"the",
"group",
"."
] | 118a349fd98a7c28721d3cbaba67ce79d1cffada | https://github.com/ekyna/Characteristics/blob/118a349fd98a7c28721d3cbaba67ce79d1cffada/Schema/Schema.php#L111-L120 |
3,547 | ekyna/Characteristics | Schema/Schema.php | Schema.getGroupByName | public function getGroupByName($name)
{
if (!array_key_exists($name, $this->groups)) {
throw new \InvalidArgumentException(sprintf('Can\'t find "%s" group.', $name));
}
return $this->groups[$name];
} | php | public function getGroupByName($name)
{
if (!array_key_exists($name, $this->groups)) {
throw new \InvalidArgumentException(sprintf('Can\'t find "%s" group.', $name));
}
return $this->groups[$name];
} | [
"public",
"function",
"getGroupByName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"groups",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Can\\'t find... | Returns a group by his name.
@param string $name
@throws \InvalidArgumentException
@return Group | [
"Returns",
"a",
"group",
"by",
"his",
"name",
"."
] | 118a349fd98a7c28721d3cbaba67ce79d1cffada | https://github.com/ekyna/Characteristics/blob/118a349fd98a7c28721d3cbaba67ce79d1cffada/Schema/Schema.php#L131-L138 |
3,548 | ekyna/Characteristics | Schema/Schema.php | Schema.getDefinitionByIdentifier | public function getDefinitionByIdentifier($identifier)
{
foreach($this->groups as $group) {
foreach($group->getDefinitions() as $definition) {
if ($definition->getIdentifier() === $identifier) {
return $definition;
}
}
}
... | php | public function getDefinitionByIdentifier($identifier)
{
foreach($this->groups as $group) {
foreach($group->getDefinitions() as $definition) {
if ($definition->getIdentifier() === $identifier) {
return $definition;
}
}
}
... | [
"public",
"function",
"getDefinitionByIdentifier",
"(",
"$",
"identifier",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"groups",
"as",
"$",
"group",
")",
"{",
"foreach",
"(",
"$",
"group",
"->",
"getDefinitions",
"(",
")",
"as",
"$",
"definition",
")",
... | Returns a characteristic definition by his identifier.
@param $identifier
@return Definition|null | [
"Returns",
"a",
"characteristic",
"definition",
"by",
"his",
"identifier",
"."
] | 118a349fd98a7c28721d3cbaba67ce79d1cffada | https://github.com/ekyna/Characteristics/blob/118a349fd98a7c28721d3cbaba67ce79d1cffada/Schema/Schema.php#L155-L165 |
3,549 | lucidphp/xml | src/Normalizer/Normalizer.php | Normalizer.convertValue | protected function convertValue($data)
{
if ($this->isTraversable($data)) {
return $this->recursiveConvertArray($data);
}
if (is_object($data)) {
return $this->convertObject($data) ?: null;
}
return $data;
} | php | protected function convertValue($data)
{
if ($this->isTraversable($data)) {
return $this->recursiveConvertArray($data);
}
if (is_object($data)) {
return $this->convertObject($data) ?: null;
}
return $data;
} | [
"protected",
"function",
"convertValue",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isTraversable",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"this",
"->",
"recursiveConvertArray",
"(",
"$",
"data",
")",
";",
"}",
"if",
"(",
"is... | Conversts a given value into a traversable one.
@param mixed $data
@return mixed | [
"Conversts",
"a",
"given",
"value",
"into",
"a",
"traversable",
"one",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Normalizer/Normalizer.php#L157-L168 |
3,550 | lucidphp/xml | src/Normalizer/Normalizer.php | Normalizer.recursiveConvertArray | protected function recursiveConvertArray($data)
{
$out = [];
foreach ($data as $key => $value) {
$nkey = $this->normalize($key);
if (in_array($nkey, $this->ignoredAttributes)) {
continue;
}
$out[$nkey] = is_scalar($value) ? $value : ... | php | protected function recursiveConvertArray($data)
{
$out = [];
foreach ($data as $key => $value) {
$nkey = $this->normalize($key);
if (in_array($nkey, $this->ignoredAttributes)) {
continue;
}
$out[$nkey] = is_scalar($value) ? $value : ... | [
"protected",
"function",
"recursiveConvertArray",
"(",
"$",
"data",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"nkey",
"=",
"$",
"this",
"->",
"normalize",
"(",
"$",
... | Recursivly converts a given value to an array.
@param array $data
@return array | [
"Recursivly",
"converts",
"a",
"given",
"value",
"to",
"an",
"array",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Normalizer/Normalizer.php#L189-L204 |
3,551 | lucidphp/xml | src/Normalizer/Normalizer.php | Normalizer.setObjectProperties | protected function setObjectProperties(array $properties, $data, array &$out = [])
{
foreach ($properties as $property) {
$prop = $property->getName();
if (in_array($name = $this->normalize($prop), $this->ignoredAttributes)) {
continue;
}
$o... | php | protected function setObjectProperties(array $properties, $data, array &$out = [])
{
foreach ($properties as $property) {
$prop = $property->getName();
if (in_array($name = $this->normalize($prop), $this->ignoredAttributes)) {
continue;
}
$o... | [
"protected",
"function",
"setObjectProperties",
"(",
"array",
"$",
"properties",
",",
"$",
"data",
",",
"array",
"&",
"$",
"out",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"property",
")",
"{",
"$",
"prop",
"=",
"$",
"pro... | Set opbject properties to an output array.
@param array $properties
@param mixed $data
@param array $out
@return void | [
"Set",
"opbject",
"properties",
"to",
"an",
"output",
"array",
"."
] | 4ff1e92c4071887c2802eb7ee3f3c46632ad7db2 | https://github.com/lucidphp/xml/blob/4ff1e92c4071887c2802eb7ee3f3c46632ad7db2/src/Normalizer/Normalizer.php#L325-L336 |
3,552 | eghojansu/nutrition | src/Utils/CommonUtil.php | CommonUtil.dateSQL | public static function dateSQL($date, $format = 'd-m-Y')
{
if (empty($date)) {
return null;
}
$obj = DateTime::createFromFormat('Y-m-d H:i:s', $date);
if (empty($obj)) {
return null;
}
return $obj->format($format);
} | php | public static function dateSQL($date, $format = 'd-m-Y')
{
if (empty($date)) {
return null;
}
$obj = DateTime::createFromFormat('Y-m-d H:i:s', $date);
if (empty($obj)) {
return null;
}
return $obj->format($format);
} | [
"public",
"static",
"function",
"dateSQL",
"(",
"$",
"date",
",",
"$",
"format",
"=",
"'d-m-Y'",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"date",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"obj",
"=",
"DateTime",
"::",
"createFromFormat",
"(",
... | SQL timestamp to date format
@param string $date
@param string $format
@return string | [
"SQL",
"timestamp",
"to",
"date",
"format"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/CommonUtil.php#L27-L39 |
3,553 | eghojansu/nutrition | src/Utils/CommonUtil.php | CommonUtil.random | public static function random($len = 6)
{
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$random = '';
for ($p = 0; $p < $len; $p++) {
$random .= $chars[mt_rand(0, 61)];
}
return $random;
} | php | public static function random($len = 6)
{
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$random = '';
for ($p = 0; $p < $len; $p++) {
$random .= $chars[mt_rand(0, 61)];
}
return $random;
} | [
"public",
"static",
"function",
"random",
"(",
"$",
"len",
"=",
"6",
")",
"{",
"$",
"chars",
"=",
"'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'",
";",
"$",
"random",
"=",
"''",
";",
"for",
"(",
"$",
"p",
"=",
"0",
";",
"$",
"p",
"<",
... | Get random string
@param integer $len
@return string | [
"Get",
"random",
"string"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/CommonUtil.php#L85-L94 |
3,554 | eghojansu/nutrition | src/Utils/CommonUtil.php | CommonUtil.lowerLabel | public static function lowerLabel($value, array $labels)
{
ksort($labels);
foreach ($labels as $max => $label) {
if ($value <= $max) {
return $label;
}
}
return end($labels);
} | php | public static function lowerLabel($value, array $labels)
{
ksort($labels);
foreach ($labels as $max => $label) {
if ($value <= $max) {
return $label;
}
}
return end($labels);
} | [
"public",
"static",
"function",
"lowerLabel",
"(",
"$",
"value",
",",
"array",
"$",
"labels",
")",
"{",
"ksort",
"(",
"$",
"labels",
")",
";",
"foreach",
"(",
"$",
"labels",
"as",
"$",
"max",
"=>",
"$",
"label",
")",
"{",
"if",
"(",
"$",
"value",
... | Get label that key is lower than value
@param numeric $value
@param string[] $labels with numeric key
@return string | [
"Get",
"label",
"that",
"key",
"is",
"lower",
"than",
"value"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/CommonUtil.php#L152-L163 |
3,555 | eghojansu/nutrition | src/Utils/CommonUtil.php | CommonUtil.majorVersion | public static function majorVersion($version)
{
$components = explode('.', $version);
foreach ($components as $key => $value) {
if ($key > 0 && is_numeric($value)) {
$components[$key] = '0';
}
}
return implode('.', $components);
} | php | public static function majorVersion($version)
{
$components = explode('.', $version);
foreach ($components as $key => $value) {
if ($key > 0 && is_numeric($value)) {
$components[$key] = '0';
}
}
return implode('.', $components);
} | [
"public",
"static",
"function",
"majorVersion",
"(",
"$",
"version",
")",
"{",
"$",
"components",
"=",
"explode",
"(",
"'.'",
",",
"$",
"version",
")",
";",
"foreach",
"(",
"$",
"components",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",... | Get major version
@param string $version
@return string | [
"Get",
"major",
"version"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/CommonUtil.php#L239-L249 |
3,556 | encorephp/error | src/Handler.php | Handler.setDisplayer | public function setDisplayer(DisplayerInterface $displayer)
{
$this->displayer = $displayer;
if ( ! isset($this->exceptionHandler)) return;
$this->exceptionHandler->setDisplayer($displayer);
} | php | public function setDisplayer(DisplayerInterface $displayer)
{
$this->displayer = $displayer;
if ( ! isset($this->exceptionHandler)) return;
$this->exceptionHandler->setDisplayer($displayer);
} | [
"public",
"function",
"setDisplayer",
"(",
"DisplayerInterface",
"$",
"displayer",
")",
"{",
"$",
"this",
"->",
"displayer",
"=",
"$",
"displayer",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"exceptionHandler",
")",
")",
"return",
";",
"$",
"t... | Set the exception displayer
@param DisplayerInterface $displayer | [
"Set",
"the",
"exception",
"displayer"
] | 1e411efa4389412fa2727973a60841bdefb0102b | https://github.com/encorephp/error/blob/1e411efa4389412fa2727973a60841bdefb0102b/src/Handler.php#L29-L36 |
3,557 | encorephp/error | src/Handler.php | Handler.registerExceptionHandler | protected function registerExceptionHandler()
{
$this->exceptionHandler = ExceptionHandler::register(true);
$this->exceptionHandler->setDisplayer($this->displayer);
} | php | protected function registerExceptionHandler()
{
$this->exceptionHandler = ExceptionHandler::register(true);
$this->exceptionHandler->setDisplayer($this->displayer);
} | [
"protected",
"function",
"registerExceptionHandler",
"(",
")",
"{",
"$",
"this",
"->",
"exceptionHandler",
"=",
"ExceptionHandler",
"::",
"register",
"(",
"true",
")",
";",
"$",
"this",
"->",
"exceptionHandler",
"->",
"setDisplayer",
"(",
"$",
"this",
"->",
"d... | Register the Symfony exception handler
@return void | [
"Register",
"the",
"Symfony",
"exception",
"handler"
] | 1e411efa4389412fa2727973a60841bdefb0102b | https://github.com/encorephp/error/blob/1e411efa4389412fa2727973a60841bdefb0102b/src/Handler.php#L64-L68 |
3,558 | FiveLab/Resource | src/Assembler/Resolver/ResourceAssemblerResolver.php | ResourceAssemblerResolver.add | public function add(ResourceAssemblerSupportableInterface $supportable, ResourceAssemblerInterface $assembler): void
{
$this->map[] = [$supportable, $assembler];
} | php | public function add(ResourceAssemblerSupportableInterface $supportable, ResourceAssemblerInterface $assembler): void
{
$this->map[] = [$supportable, $assembler];
} | [
"public",
"function",
"add",
"(",
"ResourceAssemblerSupportableInterface",
"$",
"supportable",
",",
"ResourceAssemblerInterface",
"$",
"assembler",
")",
":",
"void",
"{",
"$",
"this",
"->",
"map",
"[",
"]",
"=",
"[",
"$",
"supportable",
",",
"$",
"assembler",
... | Add the resource assembler to registry
@param ResourceAssemblerSupportableInterface $supportable
@param ResourceAssemblerInterface $assembler | [
"Add",
"the",
"resource",
"assembler",
"to",
"registry"
] | f2864924212dd4e2d1a3e7a1ad8a863d9db26127 | https://github.com/FiveLab/Resource/blob/f2864924212dd4e2d1a3e7a1ad8a863d9db26127/src/Assembler/Resolver/ResourceAssemblerResolver.php#L36-L39 |
3,559 | 10usb/css-lib | src/PropertySet.php | PropertySet.setProperty | public function setProperty($key, $value = null){
if($key instanceof Property){
$value = $key;
$key = $key->getName();
}elseif(!$value instanceof Property){
$value = new Property($key, $value);
}
foreach($this->properties as $index=>$property){
if($property->getName() == $key){
unset($this->p... | php | public function setProperty($key, $value = null){
if($key instanceof Property){
$value = $key;
$key = $key->getName();
}elseif(!$value instanceof Property){
$value = new Property($key, $value);
}
foreach($this->properties as $index=>$property){
if($property->getName() == $key){
unset($this->p... | [
"public",
"function",
"setProperty",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"key",
"instanceof",
"Property",
")",
"{",
"$",
"value",
"=",
"$",
"key",
";",
"$",
"key",
"=",
"$",
"key",
"->",
"getName",
"(",
")",... | Appending a property at the end and cleaning up any property with the same name
@param string $key Name of the property
@param string $value String representation of the values | [
"Appending",
"a",
"property",
"at",
"the",
"end",
"and",
"cleaning",
"up",
"any",
"property",
"with",
"the",
"same",
"name"
] | 6370b1404bae3eecb44c214ed4eaaf33113858dd | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/PropertySet.php#L27-L43 |
3,560 | 10usb/css-lib | src/PropertySet.php | PropertySet.getProperty | public function getProperty($key, &$match = false){
if(is_array($key)){
foreach(array_reverse($this->properties) as $property){
if(in_array($property->getName(), $key)){
$match = $property->getName();
return $property;
}
}
}else{
foreach(array_reverse($this->properties) as $property){
... | php | public function getProperty($key, &$match = false){
if(is_array($key)){
foreach(array_reverse($this->properties) as $property){
if(in_array($property->getName(), $key)){
$match = $property->getName();
return $property;
}
}
}else{
foreach(array_reverse($this->properties) as $property){
... | [
"public",
"function",
"getProperty",
"(",
"$",
"key",
",",
"&",
"$",
"match",
"=",
"false",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"foreach",
"(",
"array_reverse",
"(",
"$",
"this",
"->",
"properties",
")",
"as",
"$",
"pro... | Return the property if it is within this set otherwise retuns false
@param string|string[] $key Name or array of names of the property to obtain
@param string|bool $match Name of the matched property
@return \csslib\Property|boolean | [
"Return",
"the",
"property",
"if",
"it",
"is",
"within",
"this",
"set",
"otherwise",
"retuns",
"false"
] | 6370b1404bae3eecb44c214ed4eaaf33113858dd | https://github.com/10usb/css-lib/blob/6370b1404bae3eecb44c214ed4eaaf33113858dd/src/PropertySet.php#L51-L68 |
3,561 | extendsframework/extends-application | src/Framework/ServiceLocator/Factory/ApplicationFactory.php | ApplicationFactory.getHttpApplication | protected function getHttpApplication(ServiceLocatorInterface $serviceLocator): HttpApplication
{
$chain = $serviceLocator->getService(MiddlewareChainInterface::class);
$request = $serviceLocator->getService(RequestInterface::class);
/**
* @var MiddlewareChainInterface $chain
... | php | protected function getHttpApplication(ServiceLocatorInterface $serviceLocator): HttpApplication
{
$chain = $serviceLocator->getService(MiddlewareChainInterface::class);
$request = $serviceLocator->getService(RequestInterface::class);
/**
* @var MiddlewareChainInterface $chain
... | [
"protected",
"function",
"getHttpApplication",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
":",
"HttpApplication",
"{",
"$",
"chain",
"=",
"$",
"serviceLocator",
"->",
"getService",
"(",
"MiddlewareChainInterface",
"::",
"class",
")",
";",
"$",
"requ... | Get HTTP application.
@param ServiceLocatorInterface $serviceLocator
@return HttpApplication
@throws ServiceLocatorException | [
"Get",
"HTTP",
"application",
"."
] | 89b74594310e60542d5714e2db33ae0feb0f9d34 | https://github.com/extendsframework/extends-application/blob/89b74594310e60542d5714e2db33ae0feb0f9d34/src/Framework/ServiceLocator/Factory/ApplicationFactory.php#L58-L73 |
3,562 | liuggio/RackspaceCloudFilesStreamWrapper | src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php | RackspaceCloudFilesStreamWrapper.unregisterStreamWrapperClass | public static function unregisterStreamWrapperClass()
{
$unregisterFunction = self::getStreamWrapperUnregisterFunction();
if (!isset(self::$protocolName)) {
throw new \RuntimeException(
sprintf('Scheme name not found for %s', __CLASS__));
}
@$unregis... | php | public static function unregisterStreamWrapperClass()
{
$unregisterFunction = self::getStreamWrapperUnregisterFunction();
if (!isset(self::$protocolName)) {
throw new \RuntimeException(
sprintf('Scheme name not found for %s', __CLASS__));
}
@$unregis... | [
"public",
"static",
"function",
"unregisterStreamWrapperClass",
"(",
")",
"{",
"$",
"unregisterFunction",
"=",
"self",
"::",
"getStreamWrapperUnregisterFunction",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"protocolName",
")",
")",
"{",
"t... | Registers the stream wrapper to handle the specified protocolName
@param string $schema Default is rscf | [
"Registers",
"the",
"stream",
"wrapper",
"to",
"handle",
"the",
"specified",
"protocolName"
] | 241fcf75062cd433eebacf9d3180ea74f5ff5f2b | https://github.com/liuggio/RackspaceCloudFilesStreamWrapper/blob/241fcf75062cd433eebacf9d3180ea74f5ff5f2b/src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php#L60-L69 |
3,563 | liuggio/RackspaceCloudFilesStreamWrapper | src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php | RackspaceCloudFilesStreamWrapper.stream_flush | public function stream_flush()
{
if (!$this->getResource()) {
return false;
}
$buffer = $this->getDataBuffer();
$bufferWritten = $buffer;
$retVal = true;
if (!empty($buffer)) {
$object = $this->getResource()->getObject();
$mimetyp... | php | public function stream_flush()
{
if (!$this->getResource()) {
return false;
}
$buffer = $this->getDataBuffer();
$bufferWritten = $buffer;
$retVal = true;
if (!empty($buffer)) {
$object = $this->getResource()->getObject();
$mimetyp... | [
"public",
"function",
"stream_flush",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getResource",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"buffer",
"=",
"$",
"this",
"->",
"getDataBuffer",
"(",
")",
";",
"$",
"bufferWritten",
"=",
... | Flush the data buffer to the CDN.
@return bool | [
"Flush",
"the",
"data",
"buffer",
"to",
"the",
"CDN",
"."
] | 241fcf75062cd433eebacf9d3180ea74f5ff5f2b | https://github.com/liuggio/RackspaceCloudFilesStreamWrapper/blob/241fcf75062cd433eebacf9d3180ea74f5ff5f2b/src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php#L201-L227 |
3,564 | liuggio/RackspaceCloudFilesStreamWrapper | src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php | RackspaceCloudFilesStreamWrapper.reset | public function reset()
{
$this->setPosition(0);
$this->setOnWriteDataMode(false);
$this->setDataBuffer(null);
$this->setResource(null);
} | php | public function reset()
{
$this->setPosition(0);
$this->setOnWriteDataMode(false);
$this->setDataBuffer(null);
$this->setResource(null);
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"setPosition",
"(",
"0",
")",
";",
"$",
"this",
"->",
"setOnWriteDataMode",
"(",
"false",
")",
";",
"$",
"this",
"->",
"setDataBuffer",
"(",
"null",
")",
";",
"$",
"this",
"->",
"setRes... | reset the variable | [
"reset",
"the",
"variable"
] | 241fcf75062cd433eebacf9d3180ea74f5ff5f2b | https://github.com/liuggio/RackspaceCloudFilesStreamWrapper/blob/241fcf75062cd433eebacf9d3180ea74f5ff5f2b/src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php#L432-L438 |
3,565 | liuggio/RackspaceCloudFilesStreamWrapper | src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php | RackspaceCloudFilesStreamWrapper.initFromPath | public function initFromPath($path)
{
$this->setPosition(0);
$this->setDataBuffer(null);
$resource = $this->getService()->createResourceFromPath($path);
if (!$resource) {
return false;
}
$this->setResource($resource);
return $this;
} | php | public function initFromPath($path)
{
$this->setPosition(0);
$this->setDataBuffer(null);
$resource = $this->getService()->createResourceFromPath($path);
if (!$resource) {
return false;
}
$this->setResource($resource);
return $this;
} | [
"public",
"function",
"initFromPath",
"(",
"$",
"path",
")",
"{",
"$",
"this",
"->",
"setPosition",
"(",
"0",
")",
";",
"$",
"this",
"->",
"setDataBuffer",
"(",
"null",
")",
";",
"$",
"resource",
"=",
"$",
"this",
"->",
"getService",
"(",
")",
"->",
... | creates the resource, the container and the object by the path given
@param string $path
@return bool|RackspaceCloudFilesStreamWrapper | [
"creates",
"the",
"resource",
"the",
"container",
"and",
"the",
"object",
"by",
"the",
"path",
"given"
] | 241fcf75062cd433eebacf9d3180ea74f5ff5f2b | https://github.com/liuggio/RackspaceCloudFilesStreamWrapper/blob/241fcf75062cd433eebacf9d3180ea74f5ff5f2b/src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php#L446-L458 |
3,566 | liuggio/RackspaceCloudFilesStreamWrapper | src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php | RackspaceCloudFilesStreamWrapper.appendDataBuffer | public function appendDataBuffer($data)
{
if (is_null($this->dataBuffer)) {
$this->dataBuffer = $data;
} else {
$this->dataBuffer .= $data;
}
return $this;
} | php | public function appendDataBuffer($data)
{
if (is_null($this->dataBuffer)) {
$this->dataBuffer = $data;
} else {
$this->dataBuffer .= $data;
}
return $this;
} | [
"public",
"function",
"appendDataBuffer",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dataBuffer",
")",
")",
"{",
"$",
"this",
"->",
"dataBuffer",
"=",
"$",
"data",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"dataBuffer"... | Append some data to the current property data
@param string $data
@return RackspaceCloudFilesStreamWrapper | [
"Append",
"some",
"data",
"to",
"the",
"current",
"property",
"data"
] | 241fcf75062cd433eebacf9d3180ea74f5ff5f2b | https://github.com/liuggio/RackspaceCloudFilesStreamWrapper/blob/241fcf75062cd433eebacf9d3180ea74f5ff5f2b/src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php#L575-L583 |
3,567 | liuggio/RackspaceCloudFilesStreamWrapper | src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php | RackspaceCloudFilesStreamWrapper.appendPosition | public function appendPosition($length)
{
$this->dataPosition = (int) $this->dataPosition;
$this->dataPosition += (int) $length;
return $this;
} | php | public function appendPosition($length)
{
$this->dataPosition = (int) $this->dataPosition;
$this->dataPosition += (int) $length;
return $this;
} | [
"public",
"function",
"appendPosition",
"(",
"$",
"length",
")",
"{",
"$",
"this",
"->",
"dataPosition",
"=",
"(",
"int",
")",
"$",
"this",
"->",
"dataPosition",
";",
"$",
"this",
"->",
"dataPosition",
"+=",
"(",
"int",
")",
"$",
"length",
";",
"return... | sum the int of the position to the var given
@param int $length
@return RackspaceCloudFilesStreamWrapper | [
"sum",
"the",
"int",
"of",
"the",
"position",
"to",
"the",
"var",
"given"
] | 241fcf75062cd433eebacf9d3180ea74f5ff5f2b | https://github.com/liuggio/RackspaceCloudFilesStreamWrapper/blob/241fcf75062cd433eebacf9d3180ea74f5ff5f2b/src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php#L591-L596 |
3,568 | konservs/brilliant.framework | libraries/MVC/BController.php | BController.field_get | public function field_get($type,$com=''){
if(empty($com)){
$fn=BLIBRARIESFRAMEWORKPATH.'mvc'.DIRECTORY_SEPARATOR.'field'.DIRECTORY_SEPARATOR.$type.'.php';
$class='BControllerField_'.$type;
} else {
$fn=BCOMPONENTSAPPLICATIONPATH.$com.DIRECTORY_SEPARATOR.'fields'.DIRECTORY_SEPARATOR.$type.'.php';
if(!fi... | php | public function field_get($type,$com=''){
if(empty($com)){
$fn=BLIBRARIESFRAMEWORKPATH.'mvc'.DIRECTORY_SEPARATOR.'field'.DIRECTORY_SEPARATOR.$type.'.php';
$class='BControllerField_'.$type;
} else {
$fn=BCOMPONENTSAPPLICATIONPATH.$com.DIRECTORY_SEPARATOR.'fields'.DIRECTORY_SEPARATOR.$type.'.php';
if(!fi... | [
"public",
"function",
"field_get",
"(",
"$",
"type",
",",
"$",
"com",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"com",
")",
")",
"{",
"$",
"fn",
"=",
"BLIBRARIESFRAMEWORKPATH",
".",
"'mvc'",
".",
"DIRECTORY_SEPARATOR",
".",
"'field'",
".",
"... | Load fields objects by component & field type
@return null|\BControllerField | [
"Load",
"fields",
"objects",
"by",
"component",
"&",
"field",
"type"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BController.php#L43-L65 |
3,569 | konservs/brilliant.framework | libraries/MVC/BController.php | BController.softmodule_fields_list | public function softmodule_fields_list($fview,$fcontroller=NULL){
$mylist=$this->softmodules_list();
$myitm=NULL;
//Search the necessary softmodule...
foreach($mylist as $itm){
if($itm->view==$fview){
$myitm=$itm;
}
}
if(empty($myitm)){
return false;
}
$params=array();
foreach($myitm->... | php | public function softmodule_fields_list($fview,$fcontroller=NULL){
$mylist=$this->softmodules_list();
$myitm=NULL;
//Search the necessary softmodule...
foreach($mylist as $itm){
if($itm->view==$fview){
$myitm=$itm;
}
}
if(empty($myitm)){
return false;
}
$params=array();
foreach($myitm->... | [
"public",
"function",
"softmodule_fields_list",
"(",
"$",
"fview",
",",
"$",
"fcontroller",
"=",
"NULL",
")",
"{",
"$",
"mylist",
"=",
"$",
"this",
"->",
"softmodules_list",
"(",
")",
";",
"$",
"myitm",
"=",
"NULL",
";",
"//Search the necessary softmodule...",... | Load fields objects list...
@return array soft modules list for current component | [
"Load",
"fields",
"objects",
"list",
"..."
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BController.php#L70-L97 |
3,570 | konservs/brilliant.framework | libraries/MVC/BController.php | BController.LoadModel | public function LoadModel($mdlname=''){
if(empty($mdlname)){
bimport('mvc.model');
return new BModel();
}
$fn=BCOMPONENTSAPPLICATIONPATH.$this->componentname.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$mdlname.'.php';
if(!file_exists($fn)){
$fn=BCOMPONENTSFRAMEWORKPATH.$this->componentname.DIREC... | php | public function LoadModel($mdlname=''){
if(empty($mdlname)){
bimport('mvc.model');
return new BModel();
}
$fn=BCOMPONENTSAPPLICATIONPATH.$this->componentname.DIRECTORY_SEPARATOR.'models'.DIRECTORY_SEPARATOR.$mdlname.'.php';
if(!file_exists($fn)){
$fn=BCOMPONENTSFRAMEWORKPATH.$this->componentname.DIREC... | [
"public",
"function",
"LoadModel",
"(",
"$",
"mdlname",
"=",
"''",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"mdlname",
")",
")",
"{",
"bimport",
"(",
"'mvc.model'",
")",
";",
"return",
"new",
"BModel",
"(",
")",
";",
"}",
"$",
"fn",
"=",
"BCOMPONENT... | Load the model of current component by alias
@param type $mdlname
@return null|\BModel | [
"Load",
"the",
"model",
"of",
"current",
"component",
"by",
"alias"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BController.php#L111-L129 |
3,571 | konservs/brilliant.framework | libraries/MVC/BController.php | BController.LoadView | public function LoadView($viewname){
$fn=BCOMPONENTSAPPLICATIONPATH.$this->componentname.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$viewname.'.php';
if(!file_exists($fn)){
$fn=BCOMPONENTSFRAMEWORKPATH.$this->componentname.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$viewname.'.php';
}
$class='View... | php | public function LoadView($viewname){
$fn=BCOMPONENTSAPPLICATIONPATH.$this->componentname.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$viewname.'.php';
if(!file_exists($fn)){
$fn=BCOMPONENTSFRAMEWORKPATH.$this->componentname.DIRECTORY_SEPARATOR.'views'.DIRECTORY_SEPARATOR.$viewname.'.php';
}
$class='View... | [
"public",
"function",
"LoadView",
"(",
"$",
"viewname",
")",
"{",
"$",
"fn",
"=",
"BCOMPONENTSAPPLICATIONPATH",
".",
"$",
"this",
"->",
"componentname",
".",
"DIRECTORY_SEPARATOR",
".",
"'views'",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"viewname",
".",
"'.php'",
... | Load the view of current component by alias
@param string $viewname
@return null|\BView | [
"Load",
"the",
"view",
"of",
"current",
"component",
"by",
"alias"
] | 95f03f1917f746fee98bea8a906ba0588c87762d | https://github.com/konservs/brilliant.framework/blob/95f03f1917f746fee98bea8a906ba0588c87762d/libraries/MVC/BController.php#L136-L153 |
3,572 | lower-speck/lower-speck-php | src/Specification.php | Specification.idIsDuplicate | public function idIsDuplicate(string $id) : bool
{
$id = strtolower($id);
return isset($this->byId[$id]) && count($this->byId[$id]) > 1;
} | php | public function idIsDuplicate(string $id) : bool
{
$id = strtolower($id);
return isset($this->byId[$id]) && count($this->byId[$id]) > 1;
} | [
"public",
"function",
"idIsDuplicate",
"(",
"string",
"$",
"id",
")",
":",
"bool",
"{",
"$",
"id",
"=",
"strtolower",
"(",
"$",
"id",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"byId",
"[",
"$",
"id",
"]",
")",
"&&",
"count",
"(",
"$",
... | Tells whether there is more than one requirement identified by the id.
If there are none, this returns false.
@param string $id
@return bool | [
"Tells",
"whether",
"there",
"is",
"more",
"than",
"one",
"requirement",
"identified",
"by",
"the",
"id",
".",
"If",
"there",
"are",
"none",
"this",
"returns",
"false",
"."
] | 21fcb38d9773b17fe293e86f8a5d2c59a0b0ae6c | https://github.com/lower-speck/lower-speck-php/blob/21fcb38d9773b17fe293e86f8a5d2c59a0b0ae6c/src/Specification.php#L61-L65 |
3,573 | thecodingmachine/html.utils.weblibrarymanager | src/InlineWebLibrary.php | InlineWebLibrary.setJSFromFile | public function setJSFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
{
$this->jsElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
} | php | public function setJSFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
{
$this->jsElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
} | [
"public",
"function",
"setJSFromFile",
"(",
"string",
"$",
"filename",
",",
"Scopable",
"$",
"scope",
"=",
"null",
",",
"bool",
"$",
"relativeToRootPath",
"=",
"true",
")",
":",
"void",
"{",
"$",
"this",
"->",
"jsElement",
"=",
"new",
"HtmlFromFile",
"(",
... | Sets the script outputed in the JS section
@param string $filename
@param Scopable $scope
@param bool $relativeToRootPath | [
"Sets",
"the",
"script",
"outputed",
"in",
"the",
"JS",
"section"
] | e1e5e06d7221a4e77196798ca8bdc3908025eb51 | https://github.com/thecodingmachine/html.utils.weblibrarymanager/blob/e1e5e06d7221a4e77196798ca8bdc3908025eb51/src/InlineWebLibrary.php#L138-L141 |
3,574 | thecodingmachine/html.utils.weblibrarymanager | src/InlineWebLibrary.php | InlineWebLibrary.setCSSFromFile | public function setCSSFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
{
$this->cssElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
} | php | public function setCSSFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
{
$this->cssElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
} | [
"public",
"function",
"setCSSFromFile",
"(",
"string",
"$",
"filename",
",",
"Scopable",
"$",
"scope",
"=",
"null",
",",
"bool",
"$",
"relativeToRootPath",
"=",
"true",
")",
":",
"void",
"{",
"$",
"this",
"->",
"cssElement",
"=",
"new",
"HtmlFromFile",
"("... | Sets the script outputed in the CSS section
@param string $filename
@param Scopable $scope
@param bool $relativeToRootPath | [
"Sets",
"the",
"script",
"outputed",
"in",
"the",
"CSS",
"section"
] | e1e5e06d7221a4e77196798ca8bdc3908025eb51 | https://github.com/thecodingmachine/html.utils.weblibrarymanager/blob/e1e5e06d7221a4e77196798ca8bdc3908025eb51/src/InlineWebLibrary.php#L159-L162 |
3,575 | thecodingmachine/html.utils.weblibrarymanager | src/InlineWebLibrary.php | InlineWebLibrary.setAdditionalElementFromFile | public function setAdditionalElementFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
{
$this->additionalElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
} | php | public function setAdditionalElementFromFile(string $filename, Scopable $scope = null, bool $relativeToRootPath = true): void
{
$this->additionalElement = new HtmlFromFile($filename, $scope, $relativeToRootPath);
} | [
"public",
"function",
"setAdditionalElementFromFile",
"(",
"string",
"$",
"filename",
",",
"Scopable",
"$",
"scope",
"=",
"null",
",",
"bool",
"$",
"relativeToRootPath",
"=",
"true",
")",
":",
"void",
"{",
"$",
"this",
"->",
"additionalElement",
"=",
"new",
... | Sets the additional items outputed below the JS and CSS sections
@param string $filename
@param Scopable $scope
@param bool $relativeToRootPath | [
"Sets",
"the",
"additional",
"items",
"outputed",
"below",
"the",
"JS",
"and",
"CSS",
"sections"
] | e1e5e06d7221a4e77196798ca8bdc3908025eb51 | https://github.com/thecodingmachine/html.utils.weblibrarymanager/blob/e1e5e06d7221a4e77196798ca8bdc3908025eb51/src/InlineWebLibrary.php#L180-L183 |
3,576 | phpthinktank/blast-config | src/Loader/JsonLoader.php | JsonLoader.load | public function load(FilesystemResource $resource)
{
if(!$this->validateExtension($resource)){
return false;
}
return $this->transform($resource);
} | php | public function load(FilesystemResource $resource)
{
if(!$this->validateExtension($resource)){
return false;
}
return $this->transform($resource);
} | [
"public",
"function",
"load",
"(",
"FilesystemResource",
"$",
"resource",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"validateExtension",
"(",
"$",
"resource",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->",
"transform",
"(",
... | Load config as Array from resource
@param FilesystemResource $resource
@return array | [
"Load",
"config",
"as",
"Array",
"from",
"resource"
] | ffa9645425091c7f0da115f1181c195dce2a5393 | https://github.com/phpthinktank/blast-config/blob/ffa9645425091c7f0da115f1181c195dce2a5393/src/Loader/JsonLoader.php#L33-L41 |
3,577 | railsphp/framework | src/Rails/ActionController/Rendering.php | Rendering.setAssigns | protected function setAssigns(array &$options)
{
$assigns = $this->controller->assigns();
if (isset($options['assigns']) && is_array($options['assigns'])) {
foreach ($options['assigns'] as $name => $value) {
$assigns->set($name, $value);
}
}
$o... | php | protected function setAssigns(array &$options)
{
$assigns = $this->controller->assigns();
if (isset($options['assigns']) && is_array($options['assigns'])) {
foreach ($options['assigns'] as $name => $value) {
$assigns->set($name, $value);
}
}
$o... | [
"protected",
"function",
"setAssigns",
"(",
"array",
"&",
"$",
"options",
")",
"{",
"$",
"assigns",
"=",
"$",
"this",
"->",
"controller",
"->",
"assigns",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'assigns'",
"]",
")",
"&&",
"is_a... | Set assigns for template
Checks if the 'assigns' value was passed as option, and
sets all the assigns set there to the Assigns object.
If the value for 'assigns' isn't an array, it is ignored.
Then the 'assigns' value is set to the Assigns object, which
will be used when rendering the template.
@return void | [
"Set",
"assigns",
"for",
"template",
"Checks",
"if",
"the",
"assigns",
"value",
"was",
"passed",
"as",
"option",
"and",
"sets",
"all",
"the",
"assigns",
"set",
"there",
"to",
"the",
"Assigns",
"object",
".",
"If",
"the",
"value",
"for",
"assigns",
"isn",
... | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionController/Rendering.php#L169-L178 |
3,578 | railsphp/framework | src/Rails/ActionController/Rendering.php | Rendering.generateRenderOptions | protected function generateRenderOptions(array &$options)
{
$i18n = $this->controller->getService('i18n');
$defaultLocales = $i18n->fallbacks();
array_unshift($defaultLocales, $i18n->defaultLocale());
$format = $this->controller->request() ?
$this->controller->re... | php | protected function generateRenderOptions(array &$options)
{
$i18n = $this->controller->getService('i18n');
$defaultLocales = $i18n->fallbacks();
array_unshift($defaultLocales, $i18n->defaultLocale());
$format = $this->controller->request() ?
$this->controller->re... | [
"protected",
"function",
"generateRenderOptions",
"(",
"array",
"&",
"$",
"options",
")",
"{",
"$",
"i18n",
"=",
"$",
"this",
"->",
"controller",
"->",
"getService",
"(",
"'i18n'",
")",
";",
"$",
"defaultLocales",
"=",
"$",
"i18n",
"->",
"fallbacks",
"(",
... | Generate render options
Sets the default 'details' for template rendering. | [
"Generate",
"render",
"options",
"Sets",
"the",
"default",
"details",
"for",
"template",
"rendering",
"."
] | 2ac9d3e493035dcc68f3c3812423327127327cd5 | https://github.com/railsphp/framework/blob/2ac9d3e493035dcc68f3c3812423327127327cd5/src/Rails/ActionController/Rendering.php#L184-L228 |
3,579 | synga-nl/inheritance-finder | src/Parser/Visitors/ClassNodeVisitor.php | ClassNodeVisitor.leaveNode | public function leaveNode(Node $node) {
if ($this->phpClass instanceof PhpClass) {
if ($node instanceof Class_) {
if (!empty($node->extends) && count($node->extends->parts) > 0) {
$this->phpClass->setExtends(implode('\\', $node->extends->parts));
}... | php | public function leaveNode(Node $node) {
if ($this->phpClass instanceof PhpClass) {
if ($node instanceof Class_) {
if (!empty($node->extends) && count($node->extends->parts) > 0) {
$this->phpClass->setExtends(implode('\\', $node->extends->parts));
}... | [
"public",
"function",
"leaveNode",
"(",
"Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"phpClass",
"instanceof",
"PhpClass",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"Class_",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"node",
... | This code can evaluate the data from the parser. It sorts out which object type we are dealing with and passes
this to the PhpClass
@param Node $node
@return false|null|Node|\PhpParser\Node[]|void | [
"This",
"code",
"can",
"evaluate",
"the",
"data",
"from",
"the",
"parser",
".",
"It",
"sorts",
"out",
"which",
"object",
"type",
"we",
"are",
"dealing",
"with",
"and",
"passes",
"this",
"to",
"the",
"PhpClass"
] | 52669ac662b58dfeb6142b2e1bffbfba6f17d4b0 | https://github.com/synga-nl/inheritance-finder/blob/52669ac662b58dfeb6142b2e1bffbfba6f17d4b0/src/Parser/Visitors/ClassNodeVisitor.php#L45-L89 |
3,580 | Puzzlout/FrameworkMvcLegacy | src/Core/ResourceManagers/ControllerResxBase.php | ControllerResxBase.GetValue | public function GetValue($key) {
$resources = $this->GetList();
$actionLower = strtolower($this->ActionValue);
$keyLower = strtolower($key);
$actionExists = array_key_exists($actionLower, $resources);
$keyExist = $actionExists ?
array_key_exists($keyLower, $resour... | php | public function GetValue($key) {
$resources = $this->GetList();
$actionLower = strtolower($this->ActionValue);
$keyLower = strtolower($key);
$actionExists = array_key_exists($actionLower, $resources);
$keyExist = $actionExists ?
array_key_exists($keyLower, $resour... | [
"public",
"function",
"GetValue",
"(",
"$",
"key",
")",
"{",
"$",
"resources",
"=",
"$",
"this",
"->",
"GetList",
"(",
")",
";",
"$",
"actionLower",
"=",
"strtolower",
"(",
"$",
"this",
"->",
"ActionValue",
")",
";",
"$",
"keyLower",
"=",
"strtolower",... | Get the resource by module, action and key.
@param string $key the resource key to find
@return string the resource value
@todo activate the exception? | [
"Get",
"the",
"resource",
"by",
"module",
"action",
"and",
"key",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Core/ResourceManagers/ControllerResxBase.php#L43-L63 |
3,581 | Puzzlout/FrameworkMvcLegacy | src/Core/ResourceManagers/ControllerResxBase.php | ControllerResxBase.GetComment | public function GetComment($key) {
$resources = $this->GetList();
$actionExists = array_key_exists($this->ActionValue, $resources);
$keyExist = $actionExists ?
array_key_exists($key, $resources[$this->ActionValue]) :
false;
if ($keyExist) {
ret... | php | public function GetComment($key) {
$resources = $this->GetList();
$actionExists = array_key_exists($this->ActionValue, $resources);
$keyExist = $actionExists ?
array_key_exists($key, $resources[$this->ActionValue]) :
false;
if ($keyExist) {
ret... | [
"public",
"function",
"GetComment",
"(",
"$",
"key",
")",
"{",
"$",
"resources",
"=",
"$",
"this",
"->",
"GetList",
"(",
")",
";",
"$",
"actionExists",
"=",
"array_key_exists",
"(",
"$",
"this",
"->",
"ActionValue",
",",
"$",
"resources",
")",
";",
"$"... | Get the resource comment by module, action and key.
@param string $key the resource key to find
@return string the resource comment
@todo activate the exception? | [
"Get",
"the",
"resource",
"comment",
"by",
"module",
"action",
"and",
"key",
"."
] | 14e0fc5b16978cbd209f552ee9c649f66a0dfc6e | https://github.com/Puzzlout/FrameworkMvcLegacy/blob/14e0fc5b16978cbd209f552ee9c649f66a0dfc6e/src/Core/ResourceManagers/ControllerResxBase.php#L72-L90 |
3,582 | dotfilesphp/core | Util/Filesystem.php | Filesystem.removeDir | public function removeDir($dir, ?callable $onRemoveCallback = null): void
{
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ('.' != $object && '..' != $object) {
if ('dir' == filetype($dir.DIRECTORY_SEPARATOR.$objec... | php | public function removeDir($dir, ?callable $onRemoveCallback = null): void
{
if (is_dir($dir)) {
$objects = scandir($dir);
foreach ($objects as $object) {
if ('.' != $object && '..' != $object) {
if ('dir' == filetype($dir.DIRECTORY_SEPARATOR.$objec... | [
"public",
"function",
"removeDir",
"(",
"$",
"dir",
",",
"?",
"callable",
"$",
"onRemoveCallback",
"=",
"null",
")",
":",
"void",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"$",
"objects",
"=",
"scandir",
"(",
"$",
"dir",
")",
";",
... | Remove directory recursively.
@param $dir
@param callable|null $onRemoveCallback | [
"Remove",
"directory",
"recursively",
"."
] | d55e44449cf67e9d56a22863447fd782c88d9b2d | https://github.com/dotfilesphp/core/blob/d55e44449cf67e9d56a22863447fd782c88d9b2d/Util/Filesystem.php#L48-L70 |
3,583 | glendmaatita/Tolkien | src/Tolkien/Factories/GenerateFactory.php | GenerateFactory.generate | public function generate()
{
switch ($this->properties['node']) {
case 'post':
return new GeneratePost($this->prepareConfig($this->config), $this->properties);
break;
case 'page':
return new GeneratePage($this->prepareConfig($this->config), $this->properties);
break;
default:
return... | php | public function generate()
{
switch ($this->properties['node']) {
case 'post':
return new GeneratePost($this->prepareConfig($this->config), $this->properties);
break;
case 'page':
return new GeneratePage($this->prepareConfig($this->config), $this->properties);
break;
default:
return... | [
"public",
"function",
"generate",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"properties",
"[",
"'node'",
"]",
")",
"{",
"case",
"'post'",
":",
"return",
"new",
"GeneratePost",
"(",
"$",
"this",
"->",
"prepareConfig",
"(",
"$",
"this",
"->",
"con... | Create class instance of GenerateNode | [
"Create",
"class",
"instance",
"of",
"GenerateNode"
] | e7c27a103f1a87411dfb8eef626cba381b27d233 | https://github.com/glendmaatita/Tolkien/blob/e7c27a103f1a87411dfb8eef626cba381b27d233/src/Tolkien/Factories/GenerateFactory.php#L39-L54 |
3,584 | maestrano/maestrano-php | lib/Util/Cache.php | Maestrano_Util_Cache.get_cached_file | public function get_cached_file($label)
{
$filename = $this->cache_path . $this->safe_filename($label) . $this->cache_extension;
if(file_exists($filename))
return file_get_contents($filename);
return false;
} | php | public function get_cached_file($label)
{
$filename = $this->cache_path . $this->safe_filename($label) . $this->cache_extension;
if(file_exists($filename))
return file_get_contents($filename);
return false;
} | [
"public",
"function",
"get_cached_file",
"(",
"$",
"label",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"cache_path",
".",
"$",
"this",
"->",
"safe_filename",
"(",
"$",
"label",
")",
".",
"$",
"this",
"->",
"cache_extension",
";",
"if",
"(",
"fi... | Non-existing method in SimpleCache
Fetch the cache without regarding its expiry
@param $label
@return bool|string | [
"Non",
"-",
"existing",
"method",
"in",
"SimpleCache",
"Fetch",
"the",
"cache",
"without",
"regarding",
"its",
"expiry"
] | 757cbefb0f0bf07cb35ea7442041d9bfdcce1558 | https://github.com/maestrano/maestrano-php/blob/757cbefb0f0bf07cb35ea7442041d9bfdcce1558/lib/Util/Cache.php#L11-L19 |
3,585 | mattjs/mlib | src/Mlib/Model/User.php | User.details | public function details() {
return array_intersect_key(count($this->_details)?$this->_details:array(), array_flip($this->_public_details));
} | php | public function details() {
return array_intersect_key(count($this->_details)?$this->_details:array(), array_flip($this->_public_details));
} | [
"public",
"function",
"details",
"(",
")",
"{",
"return",
"array_intersect_key",
"(",
"count",
"(",
"$",
"this",
"->",
"_details",
")",
"?",
"$",
"this",
"->",
"_details",
":",
"array",
"(",
")",
",",
"array_flip",
"(",
"$",
"this",
"->",
"_public_detail... | Return public user details | [
"Return",
"public",
"user",
"details"
] | da5437b23f5bd094b9ed4232b3bffa665ffbcb50 | https://github.com/mattjs/mlib/blob/da5437b23f5bd094b9ed4232b3bffa665ffbcb50/src/Mlib/Model/User.php#L171-L173 |
3,586 | gliverphp/helpers | src/Url/Url.php | Url.base | public static function base()
{
//get the server name from global $_SERVER[] array()
$base = $_SERVER['SERVER_NAME'];
$url = Registry::getUrl();
//check if there is a uri string
if ( ! empty($url) )
{
//prepend installation folder to server name
$base .= substr($_SERVER['REQUEST_URI'], 0, strp... | php | public static function base()
{
//get the server name from global $_SERVER[] array()
$base = $_SERVER['SERVER_NAME'];
$url = Registry::getUrl();
//check if there is a uri string
if ( ! empty($url) )
{
//prepend installation folder to server name
$base .= substr($_SERVER['REQUEST_URI'], 0, strp... | [
"public",
"static",
"function",
"base",
"(",
")",
"{",
"//get the server name from global $_SERVER[] array()",
"$",
"base",
"=",
"$",
"_SERVER",
"[",
"'SERVER_NAME'",
"]",
";",
"$",
"url",
"=",
"Registry",
"::",
"getUrl",
"(",
")",
";",
"//check if there is a uri ... | This method returns the base url
@param null
@return string $url the base url for this application
@throws this method does not throw an error | [
"This",
"method",
"returns",
"the",
"base",
"url"
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/Url/Url.php#L45-L74 |
3,587 | gliverphp/helpers | src/Url/Url.php | Url.assets | public static function assets($assetName = null)
{
//get the server name from global $_SERVER[] array()
$base = $_SERVER['SERVER_NAME'];
$url = Registry::getUrl();
//check if there is a uri string
if ( ! empty($url) )
{
//prepend installation folder to server name
$base .= substr($_SERVER['REQUE... | php | public static function assets($assetName = null)
{
//get the server name from global $_SERVER[] array()
$base = $_SERVER['SERVER_NAME'];
$url = Registry::getUrl();
//check if there is a uri string
if ( ! empty($url) )
{
//prepend installation folder to server name
$base .= substr($_SERVER['REQUE... | [
"public",
"static",
"function",
"assets",
"(",
"$",
"assetName",
"=",
"null",
")",
"{",
"//get the server name from global $_SERVER[] array()",
"$",
"base",
"=",
"$",
"_SERVER",
"[",
"'SERVER_NAME'",
"]",
";",
"$",
"url",
"=",
"Registry",
"::",
"getUrl",
"(",
... | This method returns the assets url
@param null
@return string $url the assets url for this application
@throws this method does not throw an error | [
"This",
"method",
"returns",
"the",
"assets",
"url"
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/Url/Url.php#L84-L113 |
3,588 | gliverphp/helpers | src/Url/Url.php | Url.link | public static function link($linkParams = null)
{
if($linkParams === null){
$link_params = null;
}
elseif(is_array($linkParams)){
$link_params = join(Registry::getConfig()['url_component_separator'], $linkParams);
}
else{
$params = func_get_args();
$link_params = join(Registry::getConfig(... | php | public static function link($linkParams = null)
{
if($linkParams === null){
$link_params = null;
}
elseif(is_array($linkParams)){
$link_params = join(Registry::getConfig()['url_component_separator'], $linkParams);
}
else{
$params = func_get_args();
$link_params = join(Registry::getConfig(... | [
"public",
"static",
"function",
"link",
"(",
"$",
"linkParams",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"linkParams",
"===",
"null",
")",
"{",
"$",
"link_params",
"=",
"null",
";",
"}",
"elseif",
"(",
"is_array",
"(",
"$",
"linkParams",
")",
")",
"{",... | This method returns the url string.
@param mixed $linkParams The params to add to the link to generate
@return string $url the base url for this application
@throws this method does not throw an error | [
"This",
"method",
"returns",
"the",
"url",
"string",
"."
] | c5204df8169fad55f5b273422e45f56164373ab8 | https://github.com/gliverphp/helpers/blob/c5204df8169fad55f5b273422e45f56164373ab8/src/Url/Url.php#L121-L166 |
3,589 | donbidon/core | src/Event/Manager.php | Manager.addHandler | public function addHandler($name, $handler, $priority = self::PRIORITY_DEFAULT)
{
$priority = (int)$priority;
if ($priority >= self::PRIORITY_MIN || $priority < self::PRIORITY_MAX) {
throw new InvalidArgumentException("Invalid event priority");
}
$isObject = false;
... | php | public function addHandler($name, $handler, $priority = self::PRIORITY_DEFAULT)
{
$priority = (int)$priority;
if ($priority >= self::PRIORITY_MIN || $priority < self::PRIORITY_MAX) {
throw new InvalidArgumentException("Invalid event priority");
}
$isObject = false;
... | [
"public",
"function",
"addHandler",
"(",
"$",
"name",
",",
"$",
"handler",
",",
"$",
"priority",
"=",
"self",
"::",
"PRIORITY_DEFAULT",
")",
"{",
"$",
"priority",
"=",
"(",
"int",
")",
"$",
"priority",
";",
"if",
"(",
"$",
"priority",
">=",
"self",
"... | Adds event handler.
To break event handling handler must call $args->set(':break:', true).<br /><br />
@param string $name Event name
@param callback $handler Event handler callback
@param int $priority Event priority:
Manager::PRIORITY_LOW, Manager::PRIORITY_DEFAULT or
Manager::PRIORITY_HIGH, lower... | [
"Adds",
"event",
"handler",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L228-L286 |
3,590 | donbidon/core | src/Event/Manager.php | Manager.dropHandlers | public function dropHandlers($name = '', $handler = null)
{
if (in_array($name, self::$debugEvents)) {
throw new InvalidArgumentException("Cannot drop debug event");
}
if ($this->debug) {
$debugArgs = new Args([
'name' => $name,
... | php | public function dropHandlers($name = '', $handler = null)
{
if (in_array($name, self::$debugEvents)) {
throw new InvalidArgumentException("Cannot drop debug event");
}
if ($this->debug) {
$debugArgs = new Args([
'name' => $name,
... | [
"public",
"function",
"dropHandlers",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"handler",
"=",
"null",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"debugEvents",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(... | Drops event handlers.
Example:
```
// drop all 'someEventName' event handlers
Manager::dropHandler('someEventName');
// drop all 'someEventName' event handlers processing by $object methods only
Manager::dropHandler('someEventName', $object);
```
@param string $name Event name
@param mixed $handler Handler o... | [
"Drops",
"event",
"handlers",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L305-L320 |
3,591 | donbidon/core | src/Event/Manager.php | Manager.disableHandler | public function disableHandler($name)
{
if (in_array($name, self::$debugEvents)) {
throw new InvalidArgumentException("Cannot disable debug event");
}
if ($this->debug) {
$debugArgs = new Args([
'name' => $name,
'source' => ... | php | public function disableHandler($name)
{
if (in_array($name, self::$debugEvents)) {
throw new InvalidArgumentException("Cannot disable debug event");
}
if ($this->debug) {
$debugArgs = new Args([
'name' => $name,
'source' => ... | [
"public",
"function",
"disableHandler",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"name",
",",
"self",
"::",
"$",
"debugEvents",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"\"Cannot disable debug event\"",
")",
";",
"}... | Disables handler.
@param string $name Event name
@return void
@throws InvalidArgumentException In case of disabling debug event. | [
"Disables",
"handler",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L329-L343 |
3,592 | donbidon/core | src/Event/Manager.php | Manager.enableHandler | public function enableHandler($name)
{
if ($this->debug) {
$debugArgs = new Args([
'name' => $name,
'source' => 'core:event:debug',
'level' => E_NOTICE,
]);
$this->fire(':onEnableHandler:', $debugArgs);
... | php | public function enableHandler($name)
{
if ($this->debug) {
$debugArgs = new Args([
'name' => $name,
'source' => 'core:event:debug',
'level' => E_NOTICE,
]);
$this->fire(':onEnableHandler:', $debugArgs);
... | [
"public",
"function",
"enableHandler",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"debug",
")",
"{",
"$",
"debugArgs",
"=",
"new",
"Args",
"(",
"[",
"'name'",
"=>",
"$",
"name",
",",
"'source'",
"=>",
"'core:event:debug'",
",",
"'level'"... | Enables handler.
@param string $name Event name
@return void | [
"Enables",
"handler",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L351-L362 |
3,593 | donbidon/core | src/Event/Manager.php | Manager.hasHandlers | public function hasHandlers($name, $handler = null)
{
$args = new Args;
$this->runByHandler($name, $handler, [$this, 'hasHandler'], $args);
$result = $args->get('hasHandler');
return $result;
} | php | public function hasHandlers($name, $handler = null)
{
$args = new Args;
$this->runByHandler($name, $handler, [$this, 'hasHandler'], $args);
$result = $args->get('hasHandler');
return $result;
} | [
"public",
"function",
"hasHandlers",
"(",
"$",
"name",
",",
"$",
"handler",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"new",
"Args",
";",
"$",
"this",
"->",
"runByHandler",
"(",
"$",
"name",
",",
"$",
"handler",
",",
"[",
"$",
"this",
",",
"'hasHand... | Returns true if there are any handlers for specified event.
@param string $name Event name
@param mixed $handler Handler or its part criteria
@return bool | [
"Returns",
"true",
"if",
"there",
"are",
"any",
"handlers",
"for",
"specified",
"event",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L371-L378 |
3,594 | donbidon/core | src/Event/Manager.php | Manager.getHandlers | public function getHandlers($name = null)
{
$result = is_null($name) ? $this->handlers : $this->handlers[$name];
return $result;
} | php | public function getHandlers($name = null)
{
$result = is_null($name) ? $this->handlers : $this->handlers[$name];
return $result;
} | [
"public",
"function",
"getHandlers",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"is_null",
"(",
"$",
"name",
")",
"?",
"$",
"this",
"->",
"handlers",
":",
"$",
"this",
"->",
"handlers",
"[",
"$",
"name",
"]",
";",
"return",
"$",
... | Returns handlers for passed event or all.
@param string $name Event name
@return array | [
"Returns",
"handlers",
"for",
"passed",
"event",
"or",
"all",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L386-L391 |
3,595 | donbidon/core | src/Event/Manager.php | Manager.deleteHandler | protected function deleteHandler(/** @noinspection PhpUnusedParameterInspection */ I_Registry $args, $name, $index = null)
{
$cleanupAllHandlers = is_null($index);
if (!$cleanupAllHandlers) {
unset($this->handlers[$name][$index]);
if (sizeof($this->handlers[$name])) {
... | php | protected function deleteHandler(/** @noinspection PhpUnusedParameterInspection */ I_Registry $args, $name, $index = null)
{
$cleanupAllHandlers = is_null($index);
if (!$cleanupAllHandlers) {
unset($this->handlers[$name][$index]);
if (sizeof($this->handlers[$name])) {
... | [
"protected",
"function",
"deleteHandler",
"(",
"/** @noinspection PhpUnusedParameterInspection */",
"I_Registry",
"$",
"args",
",",
"$",
"name",
",",
"$",
"index",
"=",
"null",
")",
"{",
"$",
"cleanupAllHandlers",
"=",
"is_null",
"(",
"$",
"index",
")",
";",
"if... | Deletes handler.
@param I_Registry $args Any arguments, can be used to return something
@param string $name Event name
@param int $index Index in self::$handlers[$name] array or null
if $handler parameter not callback or its part
@return void
@see Manager::dropHandler()
@internal | [
"Deletes",
"handler",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L638-L654 |
3,596 | donbidon/core | src/Event/Manager.php | Manager.hasHandler | protected function hasHandler(I_Registry $args, $name, $index = null)
{
$result = is_null($index) ? !empty($this->handlers[$name]) : true;
$args->set('hasHandler', $result);
return $result;
} | php | protected function hasHandler(I_Registry $args, $name, $index = null)
{
$result = is_null($index) ? !empty($this->handlers[$name]) : true;
$args->set('hasHandler', $result);
return $result;
} | [
"protected",
"function",
"hasHandler",
"(",
"I_Registry",
"$",
"args",
",",
"$",
"name",
",",
"$",
"index",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"is_null",
"(",
"$",
"index",
")",
"?",
"!",
"empty",
"(",
"$",
"this",
"->",
"handlers",
"[",
"$... | Sets up 'hasHandler' flag.
@param I_Registry $args Call $args->get('hasHandler') to detect result
@param string $name Event name
@param int $index Index in self::$handlers[$name] array or null
if $handler parameter not callback or its part
@return bool true to continue, false t... | [
"Sets",
"up",
"hasHandler",
"flag",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L667-L673 |
3,597 | donbidon/core | src/Event/Manager.php | Manager.sortEvents | protected function sortEvents($name)
{
$priorities = [];
foreach ($this->orderedHandlers[$name] as $key => $row) {
if (is_array($row)) {
$priorities[$key] = $row[0];
}
}
Arrays::adaptOrderCol($priorities);
foreach ($priorit... | php | protected function sortEvents($name)
{
$priorities = [];
foreach ($this->orderedHandlers[$name] as $key => $row) {
if (is_array($row)) {
$priorities[$key] = $row[0];
}
}
Arrays::adaptOrderCol($priorities);
foreach ($priorit... | [
"protected",
"function",
"sortEvents",
"(",
"$",
"name",
")",
"{",
"$",
"priorities",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"orderedHandlers",
"[",
"$",
"name",
"]",
"as",
"$",
"key",
"=>",
"$",
"row",
")",
"{",
"if",
"(",
"is_arra... | Modifies priorities and sorts events.
@param string $name Event name
@return void
@see self::fire()
@internal | [
"Modifies",
"priorities",
"and",
"sorts",
"events",
"."
] | a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe | https://github.com/donbidon/core/blob/a22030c98ffb2dcbb8eb7a12f0498d88fb7531fe/src/Event/Manager.php#L696-L717 |
3,598 | fabsgc/framework | Core/Helper/Pagination/Pagination.php | Pagination.show | public function show($template = '.app/system/helper/pagination/default') {
$rand = rand(0, 2);
$tpl = new Template($template, 'pagination_' . $rand, 0);
$tpl->assign(['paginationFirst' => $this->_buttonFirst, 'paginationLast' => $this->_buttonLast, 'paginationBefore' => $this->_buttonBefore, 'p... | php | public function show($template = '.app/system/helper/pagination/default') {
$rand = rand(0, 2);
$tpl = new Template($template, 'pagination_' . $rand, 0);
$tpl->assign(['paginationFirst' => $this->_buttonFirst, 'paginationLast' => $this->_buttonLast, 'paginationBefore' => $this->_buttonBefore, 'p... | [
"public",
"function",
"show",
"(",
"$",
"template",
"=",
"'.app/system/helper/pagination/default'",
")",
"{",
"$",
"rand",
"=",
"rand",
"(",
"0",
",",
"2",
")",
";",
"$",
"tpl",
"=",
"new",
"Template",
"(",
"$",
"template",
",",
"'pagination_'",
".",
"$"... | display the pagination
@access public
@return string
@param $template string : template path
@since 3.0
@package helper\Pagination | [
"display",
"the",
"pagination"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Helper/Pagination/Pagination.php#L250-L256 |
3,599 | fabsgc/framework | Core/Helper/Pagination/Pagination.php | Pagination.getData | public function getData($data = []) {
for ($i = ((($this->_byPage * $this->_currentPage) - $this->_byPage)); $i <= (($this->_byPage * $this->_currentPage) - 1); $i++) {
if (isset($data[$i])) {
array_push($this->_data, $data[$i]);
}
}
return $this->_data;
... | php | public function getData($data = []) {
for ($i = ((($this->_byPage * $this->_currentPage) - $this->_byPage)); $i <= (($this->_byPage * $this->_currentPage) - 1); $i++) {
if (isset($data[$i])) {
array_push($this->_data, $data[$i]);
}
}
return $this->_data;
... | [
"public",
"function",
"getData",
"(",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"(",
"(",
"(",
"$",
"this",
"->",
"_byPage",
"*",
"$",
"this",
"->",
"_currentPage",
")",
"-",
"$",
"this",
"->",
"_byPage",
")",
")",
";",
... | get the data to be displayed from all data
@access public
@return array
@param $data : array of data
@return array
@since 3.0
@package helper\Pagination | [
"get",
"the",
"data",
"to",
"be",
"displayed",
"from",
"all",
"data"
] | 45e58182aba6a3c6381970a1fd3c17662cff2168 | https://github.com/fabsgc/framework/blob/45e58182aba6a3c6381970a1fd3c17662cff2168/Core/Helper/Pagination/Pagination.php#L297-L305 |
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.