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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
196,600 | erenmustafaozdal/laravel-modules-base | src/Repositories/ImageRepository.php | ImageRepository.getUploadPath | public function getUploadPath($model)
{
$path = $this->options['path'] . '/' . $model->id;
$paths = [];
$paths['original'] = $path . '/original';
$paths['thumbnails'] = $path . '/thumbnails';
return $paths;
} | php | public function getUploadPath($model)
{
$path = $this->options['path'] . '/' . $model->id;
$paths = [];
$paths['original'] = $path . '/original';
$paths['thumbnails'] = $path . '/thumbnails';
return $paths;
} | [
"public",
"function",
"getUploadPath",
"(",
"$",
"model",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"options",
"[",
"'path'",
"]",
".",
"'/'",
".",
"$",
"model",
"->",
"id",
";",
"$",
"paths",
"=",
"[",
"]",
";",
"$",
"paths",
"[",
"'origina... | get upload path
@param $model
@return string|\Illuminate\Support\Collection | [
"get",
"upload",
"path"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/ImageRepository.php#L76-L84 |
196,601 | erenmustafaozdal/laravel-modules-base | src/Repositories/ImageRepository.php | ImageRepository.getCropTypeSize | public function getCropTypeSize($thumbnail,$crop_type)
{
if ($crop_type === 'square') {
return [
'width' => $thumbnail['width'],
'height' => $thumbnail['width']
];
}
$ratio = $thumbnail['width'] / $thumbnail['height'];
... | php | public function getCropTypeSize($thumbnail,$crop_type)
{
if ($crop_type === 'square') {
return [
'width' => $thumbnail['width'],
'height' => $thumbnail['width']
];
}
$ratio = $thumbnail['width'] / $thumbnail['height'];
... | [
"public",
"function",
"getCropTypeSize",
"(",
"$",
"thumbnail",
",",
"$",
"crop_type",
")",
"{",
"if",
"(",
"$",
"crop_type",
"===",
"'square'",
")",
"{",
"return",
"[",
"'width'",
"=>",
"$",
"thumbnail",
"[",
"'width'",
"]",
",",
"'height'",
"=>",
"$",
... | get crop type size
@param array $thumbnail
@param string $crop_type
@return array | [
"get",
"crop",
"type",
"size"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/ImageRepository.php#L163-L184 |
196,602 | erenmustafaozdal/laravel-modules-base | src/Repositories/ImageRepository.php | ImageRepository.getSizeParameters | private function getSizeParameters($request)
{
$input = isset($this->options['group'])
? "{$this->options['group']}.{$this->options['index']}"
: (isset($this->options['inputPrefix']) && $this->options['inputPrefix'] ? "{$this->options['inputPrefix']}" : '');
return [
... | php | private function getSizeParameters($request)
{
$input = isset($this->options['group'])
? "{$this->options['group']}.{$this->options['index']}"
: (isset($this->options['inputPrefix']) && $this->options['inputPrefix'] ? "{$this->options['inputPrefix']}" : '');
return [
... | [
"private",
"function",
"getSizeParameters",
"(",
"$",
"request",
")",
"{",
"$",
"input",
"=",
"isset",
"(",
"$",
"this",
"->",
"options",
"[",
"'group'",
"]",
")",
"?",
"\"{$this->options['group']}.{$this->options['index']}\"",
":",
"(",
"isset",
"(",
"$",
"th... | get size request parameter
@param $request
@return array | [
"get",
"size",
"request",
"parameter"
] | c26600543817642926bcf16ada84009e00d784e0 | https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Repositories/ImageRepository.php#L192-L211 |
196,603 | PenoaksDev/Milky-Framework | src/Milky/Http/Request.php | Request.allFiles | public function allFiles()
{
$files = $this->files->all();
return $this->convertedFiles ? $this->convertedFiles : $this->convertedFiles = $this->convertUploadedFiles( $files );
} | php | public function allFiles()
{
$files = $this->files->all();
return $this->convertedFiles ? $this->convertedFiles : $this->convertedFiles = $this->convertUploadedFiles( $files );
} | [
"public",
"function",
"allFiles",
"(",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"files",
"->",
"all",
"(",
")",
";",
"return",
"$",
"this",
"->",
"convertedFiles",
"?",
"$",
"this",
"->",
"convertedFiles",
":",
"$",
"this",
"->",
"convertedFiles... | Get an array of all of the files on the request.
@return array | [
"Get",
"an",
"array",
"of",
"all",
"of",
"the",
"files",
"on",
"the",
"request",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Request.php#L452-L457 |
196,604 | PenoaksDev/Milky-Framework | src/Milky/Http/Request.php | Request.convertUploadedFiles | protected function convertUploadedFiles( array $files )
{
return array_map( function ( $file )
{
if ( is_null( $file ) || ( is_array( $file ) && empty( array_filter( $file ) ) ) )
return $file;
return is_array( $file ) ? $this->convertUploadedFiles( $file ) : UploadedFile::createFromBase( $file );
}, ... | php | protected function convertUploadedFiles( array $files )
{
return array_map( function ( $file )
{
if ( is_null( $file ) || ( is_array( $file ) && empty( array_filter( $file ) ) ) )
return $file;
return is_array( $file ) ? $this->convertUploadedFiles( $file ) : UploadedFile::createFromBase( $file );
}, ... | [
"protected",
"function",
"convertUploadedFiles",
"(",
"array",
"$",
"files",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"file",
")",
"||",
"(",
"is_array",
"(",
"$",
"file",
")",
"&&",
... | Convert the given array of Symfony UploadedFiles to custom Framework UploadedFiles.
@param array $files
@return array | [
"Convert",
"the",
"given",
"array",
"of",
"Symfony",
"UploadedFiles",
"to",
"custom",
"Framework",
"UploadedFiles",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Request.php#L465-L474 |
196,605 | PenoaksDev/Milky-Framework | src/Milky/Http/Request.php | Request.prefers | public function prefers( $contentTypes )
{
$accepts = $this->getAcceptableContentTypes();
$contentTypes = (array) $contentTypes;
foreach ( $accepts as $accept )
{
if ( in_array( $accept, ['*/*', '*'] ) )
return $contentTypes[0];
foreach ( $contentTypes as $contentType )
{
$type = $contentTy... | php | public function prefers( $contentTypes )
{
$accepts = $this->getAcceptableContentTypes();
$contentTypes = (array) $contentTypes;
foreach ( $accepts as $accept )
{
if ( in_array( $accept, ['*/*', '*'] ) )
return $contentTypes[0];
foreach ( $contentTypes as $contentType )
{
$type = $contentTy... | [
"public",
"function",
"prefers",
"(",
"$",
"contentTypes",
")",
"{",
"$",
"accepts",
"=",
"$",
"this",
"->",
"getAcceptableContentTypes",
"(",
")",
";",
"$",
"contentTypes",
"=",
"(",
"array",
")",
"$",
"contentTypes",
";",
"foreach",
"(",
"$",
"accepts",
... | Return the most suitable content type from the given array based on content negotiation.
@param string|array $contentTypes
@return string|null | [
"Return",
"the",
"most",
"suitable",
"content",
"type",
"from",
"the",
"given",
"array",
"based",
"on",
"content",
"negotiation",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Http/Request.php#L772-L794 |
196,606 | jdmaymeow/cake-utility | src/Random/XorShift.php | XorShift.getRand | public function getRand($min = 0, $max = 0x7fffffff)
{
$t = ($this->x ^ ($this->x << 11)) & 0x7fffffff;
$this->x = $this->y;
$this->y = $this->z;
$this->z = $this->w;
$this->w = ( $this->w ^ ($this->w >> 19) ^ ( $t ^ ( $t >> 8 )) );
return $this->w % ($max - $min + 1)... | php | public function getRand($min = 0, $max = 0x7fffffff)
{
$t = ($this->x ^ ($this->x << 11)) & 0x7fffffff;
$this->x = $this->y;
$this->y = $this->z;
$this->z = $this->w;
$this->w = ( $this->w ^ ($this->w >> 19) ^ ( $t ^ ( $t >> 8 )) );
return $this->w % ($max - $min + 1)... | [
"public",
"function",
"getRand",
"(",
"$",
"min",
"=",
"0",
",",
"$",
"max",
"=",
"0x7fffffff",
")",
"{",
"$",
"t",
"=",
"(",
"$",
"this",
"->",
"x",
"^",
"(",
"$",
"this",
"->",
"x",
"<<",
"11",
")",
")",
"&",
"0x7fffffff",
";",
"$",
"this",... | Function getTrand
Return random number between max and min
@param int $min Minimum value
@param int $max Maximum value
@return int | [
"Function",
"getTrand",
"Return",
"random",
"number",
"between",
"max",
"and",
"min"
] | 9da54f12a0f41fb1d590924db0c1130978b6e94e | https://github.com/jdmaymeow/cake-utility/blob/9da54f12a0f41fb1d590924db0c1130978b6e94e/src/Random/XorShift.php#L31-L39 |
196,607 | carno-php/http | src/Client.php | Client.close | public function close() : Promised
{
return
($this->pool
? $this->pool->shutdown()
: (
$this->session
? $this->session->close()
: Promise::resolved()
)
)->sync($this->c... | php | public function close() : Promised
{
return
($this->pool
? $this->pool->shutdown()
: (
$this->session
? $this->session->close()
: Promise::resolved()
)
)->sync($this->c... | [
"public",
"function",
"close",
"(",
")",
":",
"Promised",
"{",
"return",
"(",
"$",
"this",
"->",
"pool",
"?",
"$",
"this",
"->",
"pool",
"->",
"shutdown",
"(",
")",
":",
"(",
"$",
"this",
"->",
"session",
"?",
"$",
"this",
"->",
"session",
"->",
... | close pool connections or session client
@return Promised | [
"close",
"pool",
"connections",
"or",
"session",
"client"
] | 0a873d1feb9ae6ec50e84e03f2075ac87997aa44 | https://github.com/carno-php/http/blob/0a873d1feb9ae6ec50e84e03f2075ac87997aa44/src/Client.php#L131-L143 |
196,608 | donatj/mddom | src/AbstractNestingElement.php | AbstractNestingElement.appendChild | public function appendChild( $child = null /* .. AbstractElement $element .. */ ) {
$arg_list = func_get_args();
foreach( $arg_list as $arg ) {
if( $arg instanceof AbstractElement ) {
$inject = $arg;
} elseif( is_scalar($arg) ) {
$inject = new Text($arg);
} else {
throw new \InvalidArgumentExc... | php | public function appendChild( $child = null /* .. AbstractElement $element .. */ ) {
$arg_list = func_get_args();
foreach( $arg_list as $arg ) {
if( $arg instanceof AbstractElement ) {
$inject = $arg;
} elseif( is_scalar($arg) ) {
$inject = new Text($arg);
} else {
throw new \InvalidArgumentExc... | [
"public",
"function",
"appendChild",
"(",
"$",
"child",
"=",
"null",
"/* .. AbstractElement $element .. */",
")",
"{",
"$",
"arg_list",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"arg_list",
"as",
"$",
"arg",
")",
"{",
"if",
"(",
"$",
"arg",... | Inject One Or More Elements
@param AbstractElement|int|float|string $child,... Child Elements to Append
@return $this
@throws \InvalidArgumentException | [
"Inject",
"One",
"Or",
"More",
"Elements"
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractNestingElement.php#L30-L47 |
196,609 | donatj/mddom | src/AbstractNestingElement.php | AbstractNestingElement.removeChild | public function removeChild( AbstractElement $element ) {
$index = $this->indexOf($element);
if( $index !== null ) {
unset($this->childElements[$index]);
//Remove any gaps
$this->childElements = array_values($this->childElements);
return true;
}
return false;
} | php | public function removeChild( AbstractElement $element ) {
$index = $this->indexOf($element);
if( $index !== null ) {
unset($this->childElements[$index]);
//Remove any gaps
$this->childElements = array_values($this->childElements);
return true;
}
return false;
} | [
"public",
"function",
"removeChild",
"(",
"AbstractElement",
"$",
"element",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"indexOf",
"(",
"$",
"element",
")",
";",
"if",
"(",
"$",
"index",
"!==",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
... | Remove a child element
@param AbstractElement $element
@return bool False if the given element was not found. | [
"Remove",
"a",
"child",
"element"
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractNestingElement.php#L55-L67 |
196,610 | donatj/mddom | src/AbstractNestingElement.php | AbstractNestingElement.indexOf | public function indexOf( AbstractElement $element ) {
$search_result = array_search($element, $this->childElements, true);
return $search_result === false ? null : $search_result;
} | php | public function indexOf( AbstractElement $element ) {
$search_result = array_search($element, $this->childElements, true);
return $search_result === false ? null : $search_result;
} | [
"public",
"function",
"indexOf",
"(",
"AbstractElement",
"$",
"element",
")",
"{",
"$",
"search_result",
"=",
"array_search",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"childElements",
",",
"true",
")",
";",
"return",
"$",
"search_result",
"===",
"false",... | Get the index of a child element or null if not found.
@param AbstractElement $element
@return int|null | [
"Get",
"the",
"index",
"of",
"a",
"child",
"element",
"or",
"null",
"if",
"not",
"found",
"."
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractNestingElement.php#L93-L97 |
196,611 | donatj/mddom | src/AbstractNestingElement.php | AbstractNestingElement.childAtIndex | public function childAtIndex( $index ) {
if( $index !== null && isset($this->childElements[$index]) ) {
return $this->childElements[$index];
}
return null;
} | php | public function childAtIndex( $index ) {
if( $index !== null && isset($this->childElements[$index]) ) {
return $this->childElements[$index];
}
return null;
} | [
"public",
"function",
"childAtIndex",
"(",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"index",
"!==",
"null",
"&&",
"isset",
"(",
"$",
"this",
"->",
"childElements",
"[",
"$",
"index",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"childElements",
"[... | Gets the child element at a given index or null if not found.
@param int $index
@return AbstractElement|null | [
"Gets",
"the",
"child",
"element",
"at",
"a",
"given",
"index",
"or",
"null",
"if",
"not",
"found",
"."
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractNestingElement.php#L105-L111 |
196,612 | donatj/mddom | src/AbstractNestingElement.php | AbstractNestingElement.getNextSiblingOf | public function getNextSiblingOf( AbstractElement $element ) {
$index = $this->indexOf($element);
return $this->childAtIndex($index + 1);
} | php | public function getNextSiblingOf( AbstractElement $element ) {
$index = $this->indexOf($element);
return $this->childAtIndex($index + 1);
} | [
"public",
"function",
"getNextSiblingOf",
"(",
"AbstractElement",
"$",
"element",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"indexOf",
"(",
"$",
"element",
")",
";",
"return",
"$",
"this",
"->",
"childAtIndex",
"(",
"$",
"index",
"+",
"1",
")",
"... | Get the next sibling of a given child element or null if not found
@param AbstractElement $element
@return AbstractElement|null | [
"Get",
"the",
"next",
"sibling",
"of",
"a",
"given",
"child",
"element",
"or",
"null",
"if",
"not",
"found"
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractNestingElement.php#L119-L123 |
196,613 | donatj/mddom | src/AbstractNestingElement.php | AbstractNestingElement.getPreviousSiblingOf | public function getPreviousSiblingOf( AbstractElement $element ) {
$index = $this->indexOf($element);
return $this->childAtIndex($index - 1);
} | php | public function getPreviousSiblingOf( AbstractElement $element ) {
$index = $this->indexOf($element);
return $this->childAtIndex($index - 1);
} | [
"public",
"function",
"getPreviousSiblingOf",
"(",
"AbstractElement",
"$",
"element",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"indexOf",
"(",
"$",
"element",
")",
";",
"return",
"$",
"this",
"->",
"childAtIndex",
"(",
"$",
"index",
"-",
"1",
")",... | Get the previous sibling of a given child element or null if not found
@param AbstractElement $element
@return AbstractElement|null | [
"Get",
"the",
"previous",
"sibling",
"of",
"a",
"given",
"child",
"element",
"or",
"null",
"if",
"not",
"found"
] | c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d | https://github.com/donatj/mddom/blob/c6b66a4f5dfeaec9aeefe07c05d667d5bac70f8d/src/AbstractNestingElement.php#L131-L135 |
196,614 | fxpio/fxp-doctrine-extensions | Validator/Constraints/DoctrineCallback.php | DoctrineCallback.initArrayCallbackOption | protected function initArrayCallbackOption($options)
{
if (!isset($options['callback']) && !isset($options['groups']) && \is_callable($options)) {
$options = ['callback' => $options];
}
return $options;
} | php | protected function initArrayCallbackOption($options)
{
if (!isset($options['callback']) && !isset($options['groups']) && \is_callable($options)) {
$options = ['callback' => $options];
}
return $options;
} | [
"protected",
"function",
"initArrayCallbackOption",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"options",
"[",
"'callback'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"options",
"[",
"'groups'",
"]",
")",
"&&",
"\\",
"is_callable",
... | Init callback options.
@param array $options
@return array | [
"Init",
"callback",
"options",
"."
] | 82942f51d47cdd79a20a5725ee1b3ecfc69e9d77 | https://github.com/fxpio/fxp-doctrine-extensions/blob/82942f51d47cdd79a20a5725ee1b3ecfc69e9d77/Validator/Constraints/DoctrineCallback.php#L81-L88 |
196,615 | WellBloud/sovacore-core | src/model/CoreRepository.php | CoreRepository.fillData | public function fillData($entity,
ArrayHash $values)
{
$properties = $this->getEntityProperties($entity);
foreach ($properties as $property) {
if (array_key_exists($property, $values)) {
// You may want to process Collection property elsewhere
if (... | php | public function fillData($entity,
ArrayHash $values)
{
$properties = $this->getEntityProperties($entity);
foreach ($properties as $property) {
if (array_key_exists($property, $values)) {
// You may want to process Collection property elsewhere
if (... | [
"public",
"function",
"fillData",
"(",
"$",
"entity",
",",
"ArrayHash",
"$",
"values",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getEntityProperties",
"(",
"$",
"entity",
")",
";",
"foreach",
"(",
"$",
"properties",
"as",
"$",
"property",
")"... | Fills entity with set data from form
@param type $entity
@param ArrayHash $values
@return $entity | [
"Fills",
"entity",
"with",
"set",
"data",
"from",
"form"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/CoreRepository.php#L46-L60 |
196,616 | WellBloud/sovacore-core | src/model/CoreRepository.php | CoreRepository.getEntityArrayValues | public function getEntityArrayValues($entity)
{
$values = [];
$properties = $this->getEntityProperties($entity);
$metadata = $this->em->getClassMetadata(get_class($entity));
foreach ($properties as $property) {
$values[$property] = $metadata->getFieldValue($entity, $prope... | php | public function getEntityArrayValues($entity)
{
$values = [];
$properties = $this->getEntityProperties($entity);
$metadata = $this->em->getClassMetadata(get_class($entity));
foreach ($properties as $property) {
$values[$property] = $metadata->getFieldValue($entity, $prope... | [
"public",
"function",
"getEntityArrayValues",
"(",
"$",
"entity",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"$",
"properties",
"=",
"$",
"this",
"->",
"getEntityProperties",
"(",
"$",
"entity",
")",
";",
"$",
"metadata",
"=",
"$",
"this",
"->",
"em"... | Returns default values for forms
@param type $entity
@return array | [
"Returns",
"default",
"values",
"for",
"forms"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/CoreRepository.php#L119-L128 |
196,617 | WellBloud/sovacore-core | src/model/CoreRepository.php | CoreRepository.getEntityProperties | public function getEntityProperties($entity)
{
$metadata = $this->em->getClassMetadata(get_class($entity));
return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
} | php | public function getEntityProperties($entity)
{
$metadata = $this->em->getClassMetadata(get_class($entity));
return array_merge($metadata->getFieldNames(), $metadata->getAssociationNames());
} | [
"public",
"function",
"getEntityProperties",
"(",
"$",
"entity",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",
"(",
"get_class",
"(",
"$",
"entity",
")",
")",
";",
"return",
"array_merge",
"(",
"$",
"metadata",
"->",
... | Return entity properties names
@param type $entity
@return array | [
"Return",
"entity",
"properties",
"names"
] | 1816a0d7cd3ec4a90d64e301fc2469d171ad217f | https://github.com/WellBloud/sovacore-core/blob/1816a0d7cd3ec4a90d64e301fc2469d171ad217f/src/model/CoreRepository.php#L135-L139 |
196,618 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.getChartOfAccounts | public function getChartOfAccounts()
{
$organization = $this->oh->getOrganization();
if (!$organization->getChartOfAccounts()) {
$chart = $this->createChartOfAccounts($organization);
$this->em->persist($organization);
$this->em->flush();
}
retur... | php | public function getChartOfAccounts()
{
$organization = $this->oh->getOrganization();
if (!$organization->getChartOfAccounts()) {
$chart = $this->createChartOfAccounts($organization);
$this->em->persist($organization);
$this->em->flush();
}
retur... | [
"public",
"function",
"getChartOfAccounts",
"(",
")",
"{",
"$",
"organization",
"=",
"$",
"this",
"->",
"oh",
"->",
"getOrganization",
"(",
")",
";",
"if",
"(",
"!",
"$",
"organization",
"->",
"getChartOfAccounts",
"(",
")",
")",
"{",
"$",
"chart",
"=",
... | Get chart of accounts for current Organization
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.8.0
@return Account | [
"Get",
"chart",
"of",
"accounts",
"for",
"current",
"Organization"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L101-L113 |
196,619 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.createChartOfAccounts | public function createChartOfAccounts(OrganizationInterface $organization)
{
$account = $this->accountFqcn;
$chart = new $account($organization->getName());
$organization->setChartOfAccounts($chart);
$chart->addChild($assets = new $account('Assets'));
$assets->addChild($ban... | php | public function createChartOfAccounts(OrganizationInterface $organization)
{
$account = $this->accountFqcn;
$chart = new $account($organization->getName());
$organization->setChartOfAccounts($chart);
$chart->addChild($assets = new $account('Assets'));
$assets->addChild($ban... | [
"public",
"function",
"createChartOfAccounts",
"(",
"OrganizationInterface",
"$",
"organization",
")",
"{",
"$",
"account",
"=",
"$",
"this",
"->",
"accountFqcn",
";",
"$",
"chart",
"=",
"new",
"$",
"account",
"(",
"$",
"organization",
"->",
"getName",
"(",
... | Create new chart of accounts
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.8.0
@param OrganizationInterface $organization
@return Account | [
"Create",
"new",
"chart",
"of",
"accounts"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L125-L152 |
196,620 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.findAccountForPath | public function findAccountForPath($path)
{
$dql = '
SELECT a,p,j,op
FROM %s a
LEFT JOIN a.postings p
LEFT JOIN p.journal j
LEFT JOIN j.postings op
WHERE a.path = :path
AND a.organization = :organization
... | php | public function findAccountForPath($path)
{
$dql = '
SELECT a,p,j,op
FROM %s a
LEFT JOIN a.postings p
LEFT JOIN p.journal j
LEFT JOIN j.postings op
WHERE a.path = :path
AND a.organization = :organization
... | [
"public",
"function",
"findAccountForPath",
"(",
"$",
"path",
")",
"{",
"$",
"dql",
"=",
"'\n SELECT a,p,j,op\n FROM %s a\n LEFT JOIN a.postings p\n LEFT JOIN p.journal j\n LEFT JOIN j.postings op\n WHERE a.path = :p... | Find Account for path
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.8.0
@param string $path | [
"Find",
"Account",
"for",
"path"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L178-L196 |
196,621 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.createAccountsFromSegmentation | public function createAccountsFromSegmentation($segmentation)
{
$segments = explode(':', $segmentation);
$account = $this->oh->getOrganization()->getChartOfAccounts();
foreach ($segments as $segment) {
$parent = $account;
if (!$account = $account->getChildForName($... | php | public function createAccountsFromSegmentation($segmentation)
{
$segments = explode(':', $segmentation);
$account = $this->oh->getOrganization()->getChartOfAccounts();
foreach ($segments as $segment) {
$parent = $account;
if (!$account = $account->getChildForName($... | [
"public",
"function",
"createAccountsFromSegmentation",
"(",
"$",
"segmentation",
")",
"{",
"$",
"segments",
"=",
"explode",
"(",
"':'",
",",
"$",
"segmentation",
")",
";",
"$",
"account",
"=",
"$",
"this",
"->",
"oh",
"->",
"getOrganization",
"(",
")",
"-... | Create Account tree from segmentation
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.8.0
@param AccountInterface $chart
@param AccountSegmentation $segmentation | [
"Create",
"Account",
"tree",
"from",
"segmentation"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L220-L236 |
196,622 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.createAccount | public function createAccount($name = null)
{
$account = new $this->accountFqcn($name);
$account->setOrganization($this->oh->getOrganization());
return $account;
} | php | public function createAccount($name = null)
{
$account = new $this->accountFqcn($name);
$account->setOrganization($this->oh->getOrganization());
return $account;
} | [
"public",
"function",
"createAccount",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"account",
"=",
"new",
"$",
"this",
"->",
"accountFqcn",
"(",
"$",
"name",
")",
";",
"$",
"account",
"->",
"setOrganization",
"(",
"$",
"this",
"->",
"oh",
"->",
"ge... | Create new Account
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.8.0
@param string $name
@return Account | [
"Create",
"new",
"Account"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L248-L254 |
196,623 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.renderArray | public function renderArray(AccountInterface $account)
{
$array = array(
'name' => $account->getName(),
);
foreach ($account->getChildren() as $child) {
$array['children'][] = $this->renderArray($child);
}
return $array;
} | php | public function renderArray(AccountInterface $account)
{
$array = array(
'name' => $account->getName(),
);
foreach ($account->getChildren() as $child) {
$array['children'][] = $this->renderArray($child);
}
return $array;
} | [
"public",
"function",
"renderArray",
"(",
"AccountInterface",
"$",
"account",
")",
"{",
"$",
"array",
"=",
"array",
"(",
"'name'",
"=>",
"$",
"account",
"->",
"getName",
"(",
")",
",",
")",
";",
"foreach",
"(",
"$",
"account",
"->",
"getChildren",
"(",
... | Render Account tree as a multi-level array
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.8.0
@param AccountInterface $account
@return array | [
"Render",
"Account",
"tree",
"as",
"a",
"multi",
"-",
"level",
"array"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L266-L277 |
196,624 | phospr/DoubleEntryBundle | Model/AccountHandler.php | AccountHandler.getFavouriteAccountsForUser | public function getFavouriteAccountsForUser(UserInterface $user)
{
$criteria = new Criteria();
$criteria
->where($criteria->expr()->in(
'id',
$user->getMyFavouriteAccountIds()
))
;
return $this->oh->getOrganization()
... | php | public function getFavouriteAccountsForUser(UserInterface $user)
{
$criteria = new Criteria();
$criteria
->where($criteria->expr()->in(
'id',
$user->getMyFavouriteAccountIds()
))
;
return $this->oh->getOrganization()
... | [
"public",
"function",
"getFavouriteAccountsForUser",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
")",
";",
"$",
"criteria",
"->",
"where",
"(",
"$",
"criteria",
"->",
"expr",
"(",
")",
"->",
"in",
"(",
"'id'... | Get a collection of favourite Accounts for User
@author Tom Haskins-Vaughan <tom@tomhv.uk>
@since 0.10.0
@return Collection | [
"Get",
"a",
"collection",
"of",
"favourite",
"Accounts",
"for",
"User"
] | d9c421f30922b461483731983c59beb26047fb7f | https://github.com/phospr/DoubleEntryBundle/blob/d9c421f30922b461483731983c59beb26047fb7f/Model/AccountHandler.php#L287-L301 |
196,625 | anime-db/catalog-bundle | src/Command/ScanStoragesCommand.php | ScanStoragesCommand.getItemsOfDeletedFiles | protected function getItemsOfDeletedFiles(Storage $storage, Finder $finder)
{
$items = [];
// check of delete file for item
foreach ($storage->getItems() as $item) {
foreach ($finder as $file) {
if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilena... | php | protected function getItemsOfDeletedFiles(Storage $storage, Finder $finder)
{
$items = [];
// check of delete file for item
foreach ($storage->getItems() as $item) {
foreach ($finder as $file) {
if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilena... | [
"protected",
"function",
"getItemsOfDeletedFiles",
"(",
"Storage",
"$",
"storage",
",",
"Finder",
"$",
"finder",
")",
"{",
"$",
"items",
"=",
"[",
"]",
";",
"// check of delete file for item",
"foreach",
"(",
"$",
"storage",
"->",
"getItems",
"(",
")",
"as",
... | Get items of deleted files.
@param Storage $storage
@param Finder $finder
@return array | [
"Get",
"items",
"of",
"deleted",
"files",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Command/ScanStoragesCommand.php#L244-L258 |
196,626 | anime-db/catalog-bundle | src/Command/ScanStoragesCommand.php | ScanStoragesCommand.getItemFromFile | protected function getItemFromFile(Storage $storage, SplFileInfo $file)
{
/* @var $item Item */
foreach ($storage->getItems() as $item) {
if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilename()) {
return $item;
}
}
return fal... | php | protected function getItemFromFile(Storage $storage, SplFileInfo $file)
{
/* @var $item Item */
foreach ($storage->getItems() as $item) {
if (pathinfo($item->getPath(), PATHINFO_BASENAME) == $file->getFilename()) {
return $item;
}
}
return fal... | [
"protected",
"function",
"getItemFromFile",
"(",
"Storage",
"$",
"storage",
",",
"SplFileInfo",
"$",
"file",
")",
"{",
"/* @var $item Item */",
"foreach",
"(",
"$",
"storage",
"->",
"getItems",
"(",
")",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"pathinfo",
... | Get item from files.
@param Storage $storage
@param SplFileInfo $file
@return Item|bool | [
"Get",
"item",
"from",
"files",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Command/ScanStoragesCommand.php#L268-L278 |
196,627 | anime-db/catalog-bundle | src/Command/ScanStoragesCommand.php | ScanStoragesCommand.isAllowFile | protected function isAllowFile(SplFileInfo $file)
{
return in_array(strtolower(pathinfo($file->getFilename(), PATHINFO_EXTENSION)), $this->allow_ext);
} | php | protected function isAllowFile(SplFileInfo $file)
{
return in_array(strtolower(pathinfo($file->getFilename(), PATHINFO_EXTENSION)), $this->allow_ext);
} | [
"protected",
"function",
"isAllowFile",
"(",
"SplFileInfo",
"$",
"file",
")",
"{",
"return",
"in_array",
"(",
"strtolower",
"(",
"pathinfo",
"(",
"$",
"file",
"->",
"getFilename",
"(",
")",
",",
"PATHINFO_EXTENSION",
")",
")",
",",
"$",
"this",
"->",
"allo... | Is allow file.
@param SplFileInfo $file
@return bool | [
"Is",
"allow",
"file",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Command/ScanStoragesCommand.php#L303-L306 |
196,628 | anime-db/catalog-bundle | src/Command/ScanStoragesCommand.php | ScanStoragesCommand.checkStorageId | protected function checkStorageId($path, Storage $storage, StorageRepository $rep)
{
if (!file_exists($path.StorageListener::ID_FILE)) {
// path is free. reserve for me
file_put_contents($path.StorageListener::ID_FILE, $storage->getId());
} elseif (file_get_contents($path.Sto... | php | protected function checkStorageId($path, Storage $storage, StorageRepository $rep)
{
if (!file_exists($path.StorageListener::ID_FILE)) {
// path is free. reserve for me
file_put_contents($path.StorageListener::ID_FILE, $storage->getId());
} elseif (file_get_contents($path.Sto... | [
"protected",
"function",
"checkStorageId",
"(",
"$",
"path",
",",
"Storage",
"$",
"storage",
",",
"StorageRepository",
"$",
"rep",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"path",
".",
"StorageListener",
"::",
"ID_FILE",
")",
")",
"{",
"// path i... | Update storage id.
@param string $path
@param Storage $storage
@param StorageRepository $rep
@return Storage|bool | [
"Update",
"storage",
"id",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Command/ScanStoragesCommand.php#L317-L332 |
196,629 | anime-db/catalog-bundle | src/Command/ScanStoragesCommand.php | ScanStoragesCommand.getProgress | protected function getProgress(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('no-progress')) {
$output = new NullOutput();
}
// export progress only for one storage
if (!$input->getArgument('storage')) {
$input->setOption('export', n... | php | protected function getProgress(InputInterface $input, OutputInterface $output)
{
if ($input->getOption('no-progress')) {
$output = new NullOutput();
}
// export progress only for one storage
if (!$input->getArgument('storage')) {
$input->setOption('export', n... | [
"protected",
"function",
"getProgress",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"input",
"->",
"getOption",
"(",
"'no-progress'",
")",
")",
"{",
"$",
"output",
"=",
"new",
"NullOutput",
"(",
")"... | Get progress.
@param InputInterface $input
@param OutputInterface $output
@return Decorator | [
"Get",
"progress",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Command/ScanStoragesCommand.php#L342-L364 |
196,630 | Becklyn/Gluggi | src/Controller/CoreController.php | CoreController.indexAction | public function indexAction ()
{
$layoutGroups = array_map(
function ($elementType)
{
return [
"title" => ucfirst($elementType) . "s",
"elementType" => $elementType,
"elements" => $this->elementTypes... | php | public function indexAction ()
{
$layoutGroups = array_map(
function ($elementType)
{
return [
"title" => ucfirst($elementType) . "s",
"elementType" => $elementType,
"elements" => $this->elementTypes... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"layoutGroups",
"=",
"array_map",
"(",
"function",
"(",
"$",
"elementType",
")",
"{",
"return",
"[",
"\"title\"",
"=>",
"ucfirst",
"(",
"$",
"elementType",
")",
".",
"\"s\"",
",",
"\"elementType\"",
... | Handles the index action
@return string | [
"Handles",
"the",
"index",
"action"
] | 837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786 | https://github.com/Becklyn/Gluggi/blob/837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786/src/Controller/CoreController.php#L52-L71 |
196,631 | Becklyn/Gluggi | src/Controller/CoreController.php | CoreController.showElementAction | public function showElementAction ($elementType, $key)
{
try
{
$element = $this->elementTypesModel->getElement($key, $elementType);
if ((null === $element) || $element->isHidden())
{
throw new NotFoundHttpException("Element '{$key}' of type '{$ele... | php | public function showElementAction ($elementType, $key)
{
try
{
$element = $this->elementTypesModel->getElement($key, $elementType);
if ((null === $element) || $element->isHidden())
{
throw new NotFoundHttpException("Element '{$key}' of type '{$ele... | [
"public",
"function",
"showElementAction",
"(",
"$",
"elementType",
",",
"$",
"key",
")",
"{",
"try",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"elementTypesModel",
"->",
"getElement",
"(",
"$",
"key",
",",
"$",
"elementType",
")",
";",
"if",
"(",
"... | Displays a preview file
@param string $elementType
@param string $key
@return string|Response | [
"Displays",
"a",
"preview",
"file"
] | 837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786 | https://github.com/Becklyn/Gluggi/blob/837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786/src/Controller/CoreController.php#L83-L104 |
196,632 | Becklyn/Gluggi | src/Controller/CoreController.php | CoreController.elementsOverviewAction | public function elementsOverviewAction ($elementType)
{
try
{
$elementReferences = array_map(
function (Element $element)
{
return $element->getReference();
},
$this->elementTypesModel->getListedElements(... | php | public function elementsOverviewAction ($elementType)
{
try
{
$elementReferences = array_map(
function (Element $element)
{
return $element->getReference();
},
$this->elementTypesModel->getListedElements(... | [
"public",
"function",
"elementsOverviewAction",
"(",
"$",
"elementType",
")",
"{",
"try",
"{",
"$",
"elementReferences",
"=",
"array_map",
"(",
"function",
"(",
"Element",
"$",
"element",
")",
"{",
"return",
"$",
"element",
"->",
"getReference",
"(",
")",
";... | Returns a list of all elements of the given type
@param $elementType
@return string | [
"Returns",
"a",
"list",
"of",
"all",
"elements",
"of",
"the",
"given",
"type"
] | 837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786 | https://github.com/Becklyn/Gluggi/blob/837e7ee8d34f5b16a7f1ef53ca64b1ea8722b786/src/Controller/CoreController.php#L115-L135 |
196,633 | Kris-Kuiper/sFire-Framework | src/Logger/Logger.php | Logger.setDirectory | public function setDirectory($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
$this -> directory = new Directory($directory);
if(false === $this ->... | php | public function setDirectory($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
$this -> directory = new Directory($directory);
if(false === $this ->... | [
"public",
"function",
"setDirectory",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"directory",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",... | Sets the directory to write to
@param string $directory
@return sFire\Logger\Logger | [
"Sets",
"the",
"directory",
"to",
"write",
"to"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Logger/Logger.php#L55-L68 |
196,634 | Kris-Kuiper/sFire-Framework | src/Logger/Logger.php | Logger.setExtension | public function setExtension($extension) {
if(false === is_string($extension)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($extension)), E_USER_ERROR);
}
//Prepend dot for extension if necessary
$extension = ($extension[0] ==... | php | public function setExtension($extension) {
if(false === is_string($extension)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($extension)), E_USER_ERROR);
}
//Prepend dot for extension if necessary
$extension = ($extension[0] ==... | [
"public",
"function",
"setExtension",
"(",
"$",
"extension",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"extension",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",... | Set file extension
@param string $extension
@return sFire\Logger\Logger | [
"Set",
"file",
"extension"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Logger/Logger.php#L85-L97 |
196,635 | Kris-Kuiper/sFire-Framework | src/Logger/Logger.php | Logger.setMode | public function setMode($mode) {
if(false === is_string($mode)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR);
}
$this -> mode = $mode;
return $this;
} | php | public function setMode($mode) {
if(false === is_string($mode)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($mode)), E_USER_ERROR);
}
$this -> mode = $mode;
return $this;
} | [
"public",
"function",
"setMode",
"(",
"$",
"mode",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"mode",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__ME... | Sets the log rotate mode
@param string $mode
@return sFire\Logger\Logger | [
"Sets",
"the",
"log",
"rotate",
"mode"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Logger/Logger.php#L119-L128 |
196,636 | Kris-Kuiper/sFire-Framework | src/Logger/Logger.php | Logger.setSuffix | public function setSuffix($suffix) {
if(false === is_string($suffix)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($suffix)), E_USER_ERROR);
}
$this -> suffix = $suffix;
return $this;
} | php | public function setSuffix($suffix) {
if(false === is_string($suffix)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($suffix)), E_USER_ERROR);
}
$this -> suffix = $suffix;
return $this;
} | [
"public",
"function",
"setSuffix",
"(",
"$",
"suffix",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"suffix",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
... | Sets the suffix
@param string $suffix
@return sFire\Logger\Logger | [
"Sets",
"the",
"suffix"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Logger/Logger.php#L136-L145 |
196,637 | Kris-Kuiper/sFire-Framework | src/Logger/Logger.php | Logger.generateFileName | private function generateFileName() {
return $this -> directory -> entity() -> getPath() . date($this -> getMode()) . $this -> getSuffix() . $this -> getExtension();
} | php | private function generateFileName() {
return $this -> directory -> entity() -> getPath() . date($this -> getMode()) . $this -> getSuffix() . $this -> getExtension();
} | [
"private",
"function",
"generateFileName",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"directory",
"->",
"entity",
"(",
")",
"->",
"getPath",
"(",
")",
".",
"date",
"(",
"$",
"this",
"->",
"getMode",
"(",
")",
")",
".",
"$",
"this",
"->",
"getSuffix... | Generates a filename with current rotation mode
@return string | [
"Generates",
"a",
"filename",
"with",
"current",
"rotation",
"mode"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Logger/Logger.php#L200-L202 |
196,638 | rzajac/phptools | src/Lang/Calendar.php | Calendar.getDay | public static function getDay($day, $langCode, $style = self::STYLE_LONG)
{
$langCode = static::checkLanguageCode($langCode);
return self::$i18n[$langCode]['day'][$style][$day];
} | php | public static function getDay($day, $langCode, $style = self::STYLE_LONG)
{
$langCode = static::checkLanguageCode($langCode);
return self::$i18n[$langCode]['day'][$style][$day];
} | [
"public",
"static",
"function",
"getDay",
"(",
"$",
"day",
",",
"$",
"langCode",
",",
"$",
"style",
"=",
"self",
"::",
"STYLE_LONG",
")",
"{",
"$",
"langCode",
"=",
"static",
"::",
"checkLanguageCode",
"(",
"$",
"langCode",
")",
";",
"return",
"self",
... | Get translated day of the week.
@param int $day The day of the week number 1 - 7
@param string $langCode The supported language code ex: en
@param string $style The style to return day name in. One of the self::STYLE_* constants
@return mixed | [
"Get",
"translated",
"day",
"of",
"the",
"week",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Lang/Calendar.php#L58-L63 |
196,639 | rzajac/phptools | src/Lang/Calendar.php | Calendar.getMonth | public static function getMonth($month, $langCode, $style = self::STYLE_LONG)
{
$langCode = static::checkLanguageCode($langCode);
return self::$i18n[$langCode]['month'][$style][$month];
} | php | public static function getMonth($month, $langCode, $style = self::STYLE_LONG)
{
$langCode = static::checkLanguageCode($langCode);
return self::$i18n[$langCode]['month'][$style][$month];
} | [
"public",
"static",
"function",
"getMonth",
"(",
"$",
"month",
",",
"$",
"langCode",
",",
"$",
"style",
"=",
"self",
"::",
"STYLE_LONG",
")",
"{",
"$",
"langCode",
"=",
"static",
"::",
"checkLanguageCode",
"(",
"$",
"langCode",
")",
";",
"return",
"self"... | Get translated month.
@param int $month The month number 1 - 12
@param string $langCode The supported language code ex: en
@param string $style The style to return month name in. One of the self::STYLE_* constants
@return mixed | [
"Get",
"translated",
"month",
"."
] | 3cbece7645942d244603c14ba897d8a676ee3088 | https://github.com/rzajac/phptools/blob/3cbece7645942d244603c14ba897d8a676ee3088/src/Lang/Calendar.php#L74-L79 |
196,640 | Wedeto/DB | src/Query/Direction.php | Direction.toSQL | public function toSQL(Parameters $params, bool $inner_clause)
{
$expr = $this->getOperand();
$direction = $this->getDirection();
return $params->getDriver()->toSQL($params, $expr, false) . " " . $direction;
} | php | public function toSQL(Parameters $params, bool $inner_clause)
{
$expr = $this->getOperand();
$direction = $this->getDirection();
return $params->getDriver()->toSQL($params, $expr, false) . " " . $direction;
} | [
"public",
"function",
"toSQL",
"(",
"Parameters",
"$",
"params",
",",
"bool",
"$",
"inner_clause",
")",
"{",
"$",
"expr",
"=",
"$",
"this",
"->",
"getOperand",
"(",
")",
";",
"$",
"direction",
"=",
"$",
"this",
"->",
"getDirection",
"(",
")",
";",
"r... | Write a order direction clause as SQL query syntax
@param Parameters $params The query parameters: tables and placeholder values
@param bool $inner_clause Unused
@return string The generated SQL | [
"Write",
"a",
"order",
"direction",
"clause",
"as",
"SQL",
"query",
"syntax"
] | 715f8f2e3ae6b53c511c40b620921cb9c87e6f62 | https://github.com/Wedeto/DB/blob/715f8f2e3ae6b53c511c40b620921cb9c87e6f62/src/Query/Direction.php#L64-L70 |
196,641 | Rivsen/ladybug-service-provider | src/DataCollector/LadybugDataCollector.php | LadybugDataCollector.log | public function log()
{
$content = call_user_func_array(array($this->ladybug,'dump'), func_get_args());
$trace = debug_backtrace();
$this->data['vars'][] = array(
'file' => isset($trace[0]['file']) ? $trace[0]['file'] : '',
'line' => isset($trace[0]['line']) ? $tr... | php | public function log()
{
$content = call_user_func_array(array($this->ladybug,'dump'), func_get_args());
$trace = debug_backtrace();
$this->data['vars'][] = array(
'file' => isset($trace[0]['file']) ? $trace[0]['file'] : '',
'line' => isset($trace[0]['line']) ? $tr... | [
"public",
"function",
"log",
"(",
")",
"{",
"$",
"content",
"=",
"call_user_func_array",
"(",
"array",
"(",
"$",
"this",
"->",
"ladybug",
",",
"'dump'",
")",
",",
"func_get_args",
"(",
")",
")",
";",
"$",
"trace",
"=",
"debug_backtrace",
"(",
")",
";",... | Log an info. | [
"Log",
"an",
"info",
"."
] | af0103ceb696fb133c00989bfcda82424e39d660 | https://github.com/Rivsen/ladybug-service-provider/blob/af0103ceb696fb133c00989bfcda82424e39d660/src/DataCollector/LadybugDataCollector.php#L38-L49 |
196,642 | Repkit/PluginManager | src/RpkPluginManager/PluginChain.php | PluginChain.load | public function load()
{
static::$loaded = true;
$container = $this->getContainer();
if($container){
$config = $container->get('config');
$events = $config['plugin-manager'];
foreach($events as $event => $plugins){
foreach... | php | public function load()
{
static::$loaded = true;
$container = $this->getContainer();
if($container){
$config = $container->get('config');
$events = $config['plugin-manager'];
foreach($events as $event => $plugins){
foreach... | [
"public",
"function",
"load",
"(",
")",
"{",
"static",
"::",
"$",
"loaded",
"=",
"true",
";",
"$",
"container",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
";",
"if",
"(",
"$",
"container",
")",
"{",
"$",
"config",
"=",
"$",
"container",
"->"... | load events with their plugins | [
"load",
"events",
"with",
"their",
"plugins"
] | e5a333acb6b543a6b98aca9c3b1e4620ad3410b4 | https://github.com/Repkit/PluginManager/blob/e5a333acb6b543a6b98aca9c3b1e4620ad3410b4/src/RpkPluginManager/PluginChain.php#L220-L237 |
196,643 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/assetaggregator/AssetAggregator.php | AssetAggregator.buildCacheKey | protected function buildCacheKey(array $assets, array $options)
{
$cachekey = $this->Request->getServerName();
$cachekey .= "(asset(".implode('|', $assets).")(".implode('|', $options)."))";
return $cachekey;
} | php | protected function buildCacheKey(array $assets, array $options)
{
$cachekey = $this->Request->getServerName();
$cachekey .= "(asset(".implode('|', $assets).")(".implode('|', $options)."))";
return $cachekey;
} | [
"protected",
"function",
"buildCacheKey",
"(",
"array",
"$",
"assets",
",",
"array",
"$",
"options",
")",
"{",
"$",
"cachekey",
"=",
"$",
"this",
"->",
"Request",
"->",
"getServerName",
"(",
")",
";",
"$",
"cachekey",
".=",
"\"(asset(\"",
".",
"implode",
... | Builds a unique cache key based on the asset array and options
@param array $assets Array of asset file names
@param array $options Array of scalar option values
@return string Unique cache key | [
"Builds",
"a",
"unique",
"cache",
"key",
"based",
"on",
"the",
"asset",
"array",
"and",
"options"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/assetaggregator/AssetAggregator.php#L268-L274 |
196,644 | dubhunter/talon | src/Http/Response.php | Response.permanentRedirect | public static function permanentRedirect($url, $externalRedirect = false) {
/** @var Response $response */
$response = new static();
$response->redirect($url, $externalRedirect, self::HTTP_PERMANENT_REDIRECT);
return $response;
} | php | public static function permanentRedirect($url, $externalRedirect = false) {
/** @var Response $response */
$response = new static();
$response->redirect($url, $externalRedirect, self::HTTP_PERMANENT_REDIRECT);
return $response;
} | [
"public",
"static",
"function",
"permanentRedirect",
"(",
"$",
"url",
",",
"$",
"externalRedirect",
"=",
"false",
")",
"{",
"/** @var Response $response */",
"$",
"response",
"=",
"new",
"static",
"(",
")",
";",
"$",
"response",
"->",
"redirect",
"(",
"$",
"... | Convenience function to create a 301 response
@see Response::redirect()
@static
@param string $url The url to redirect to
@param boolean $externalRedirect Treat the redirect as external
@return Response | [
"Convenience",
"function",
"to",
"create",
"a",
"301",
"response"
] | 308b7284556dfaff0d9ac4c7739dc6a46930ef36 | https://github.com/dubhunter/talon/blob/308b7284556dfaff0d9ac4c7739dc6a46930ef36/src/Http/Response.php#L240-L245 |
196,645 | dubhunter/talon | src/Http/Response.php | Response.temporaryRedirect | public static function temporaryRedirect($url, $externalRedirect = false) {
/** @var Response $response */
$response = new static();
$response->redirect($url, $externalRedirect, self::HTTP_TEMPORARY_REDIRECT);
return $response;
} | php | public static function temporaryRedirect($url, $externalRedirect = false) {
/** @var Response $response */
$response = new static();
$response->redirect($url, $externalRedirect, self::HTTP_TEMPORARY_REDIRECT);
return $response;
} | [
"public",
"static",
"function",
"temporaryRedirect",
"(",
"$",
"url",
",",
"$",
"externalRedirect",
"=",
"false",
")",
"{",
"/** @var Response $response */",
"$",
"response",
"=",
"new",
"static",
"(",
")",
";",
"$",
"response",
"->",
"redirect",
"(",
"$",
"... | Convenience function to create a 302 response
@see Response::redirect()
@static
@param string $url The url to redirect to
@param boolean $externalRedirect Treat the redirect as external
@return Response HTTP 302 Response with URL | [
"Convenience",
"function",
"to",
"create",
"a",
"302",
"response"
] | 308b7284556dfaff0d9ac4c7739dc6a46930ef36 | https://github.com/dubhunter/talon/blob/308b7284556dfaff0d9ac4c7739dc6a46930ef36/src/Http/Response.php#L255-L260 |
196,646 | MasterkeyInformatica/browser-kit | CookieJar.php | CookieJar.expire | public function expire($name, $path = '/', $domain = null)
{
if (null === $path) {
$path = '/';
}
if (empty($domain)) {
// an empty domain means any domain
// this should never happen but it allows for a better BC
$domains = array_keys($this->... | php | public function expire($name, $path = '/', $domain = null)
{
if (null === $path) {
$path = '/';
}
if (empty($domain)) {
// an empty domain means any domain
// this should never happen but it allows for a better BC
$domains = array_keys($this->... | [
"public",
"function",
"expire",
"(",
"$",
"name",
",",
"$",
"path",
"=",
"'/'",
",",
"$",
"domain",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"'/'",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"doma... | Removes a cookie by name.
You should never use an empty domain, but if you do so,
all cookies for the given name/path expire (this behavior
ensures a BC behavior with previous versions of Symfony).
@param string $name The cookie name
@param string $path The cookie path
@param string $domain The cookie domain | [
"Removes",
"a",
"cookie",
"by",
"name",
"."
] | fd735ad31c00af54d5c060d01218aa48308557f7 | https://github.com/MasterkeyInformatica/browser-kit/blob/fd735ad31c00af54d5c060d01218aa48308557f7/CookieJar.php#L92-L117 |
196,647 | MasterkeyInformatica/browser-kit | CookieJar.php | CookieJar.all | public function all()
{
$this->flushExpiredCookies();
$flattenedCookies = array();
foreach ($this->cookieJar as $path) {
foreach ($path as $cookies) {
foreach ($cookies as $cookie) {
$flattenedCookies[] = $cookie;
}
... | php | public function all()
{
$this->flushExpiredCookies();
$flattenedCookies = array();
foreach ($this->cookieJar as $path) {
foreach ($path as $cookies) {
foreach ($cookies as $cookie) {
$flattenedCookies[] = $cookie;
}
... | [
"public",
"function",
"all",
"(",
")",
"{",
"$",
"this",
"->",
"flushExpiredCookies",
"(",
")",
";",
"$",
"flattenedCookies",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"cookieJar",
"as",
"$",
"path",
")",
"{",
"foreach",
"(",
"$... | Returns not yet expired cookies.
@return Cookie[] An array of cookies | [
"Returns",
"not",
"yet",
"expired",
"cookies",
"."
] | fd735ad31c00af54d5c060d01218aa48308557f7 | https://github.com/MasterkeyInformatica/browser-kit/blob/fd735ad31c00af54d5c060d01218aa48308557f7/CookieJar.php#L172-L186 |
196,648 | MasterkeyInformatica/browser-kit | CookieJar.php | CookieJar.allValues | public function allValues($uri, $returnsRawValue = false)
{
$this->flushExpiredCookies();
$parts = array_replace(array('path' => '/'), parse_url($uri));
$cookies = array();
foreach ($this->cookieJar as $domain => $pathCookies) {
if ($domain) {
$domain = '... | php | public function allValues($uri, $returnsRawValue = false)
{
$this->flushExpiredCookies();
$parts = array_replace(array('path' => '/'), parse_url($uri));
$cookies = array();
foreach ($this->cookieJar as $domain => $pathCookies) {
if ($domain) {
$domain = '... | [
"public",
"function",
"allValues",
"(",
"$",
"uri",
",",
"$",
"returnsRawValue",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"flushExpiredCookies",
"(",
")",
";",
"$",
"parts",
"=",
"array_replace",
"(",
"array",
"(",
"'path'",
"=>",
"'/'",
")",
",",
"p... | Returns not yet expired cookie values for the given URI.
@param string $uri A URI
@param bool $returnsRawValue Returns raw value or urldecoded value
@return array An array of cookie values | [
"Returns",
"not",
"yet",
"expired",
"cookie",
"values",
"for",
"the",
"given",
"URI",
"."
] | fd735ad31c00af54d5c060d01218aa48308557f7 | https://github.com/MasterkeyInformatica/browser-kit/blob/fd735ad31c00af54d5c060d01218aa48308557f7/CookieJar.php#L196-L226 |
196,649 | D3strukt0r/oauth2-orbitrondev | src/Provider/OrbitronDevResourceOwner.php | OrbitronDevResourceOwner.getActiveAddress | public function getActiveAddress()
{
if (null === $this->getAddresses()) {
return null;
}
if (1 === count($this->getAddresses())) {
foreach ($this->getAddresses() as $address) {
return $address;
}
}
if (null === $this->res... | php | public function getActiveAddress()
{
if (null === $this->getAddresses()) {
return null;
}
if (1 === count($this->getAddresses())) {
foreach ($this->getAddresses() as $address) {
return $address;
}
}
if (null === $this->res... | [
"public",
"function",
"getActiveAddress",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getAddresses",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"1",
"===",
"count",
"(",
"$",
"this",
"->",
"getAddresses",
"(",
")",
... | Return the surname.
@return array|null | [
"Return",
"the",
"surname",
"."
] | 9b8d4656254cb60d20d45ded269f147d487b1e4d | https://github.com/D3strukt0r/oauth2-orbitrondev/blob/9b8d4656254cb60d20d45ded269f147d487b1e4d/src/Provider/OrbitronDevResourceOwner.php#L106-L123 |
196,650 | koolkode/lexer | src/AbstractTokenContainer.php | AbstractTokenContainer.serialize | public function serialize()
{
$it = new SerializedTokenIterator([]);
$this->preSerialize($it);
foreach($this->tokens as $token)
{
$token->serialize($it);
}
$this->postSerialize($it);
return json_encode($it->getArrayCopy());
} | php | public function serialize()
{
$it = new SerializedTokenIterator([]);
$this->preSerialize($it);
foreach($this->tokens as $token)
{
$token->serialize($it);
}
$this->postSerialize($it);
return json_encode($it->getArrayCopy());
} | [
"public",
"function",
"serialize",
"(",
")",
"{",
"$",
"it",
"=",
"new",
"SerializedTokenIterator",
"(",
"[",
"]",
")",
";",
"$",
"this",
"->",
"preSerialize",
"(",
"$",
"it",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"tokens",
"as",
"$",
"token",... | Serializes a token container into an encoded string that consumes a
minimal amount of storage memory.
@return string | [
"Serializes",
"a",
"token",
"container",
"into",
"an",
"encoded",
"string",
"that",
"consumes",
"a",
"minimal",
"amount",
"of",
"storage",
"memory",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenContainer.php#L99-L113 |
196,651 | koolkode/lexer | src/AbstractTokenContainer.php | AbstractTokenContainer.unserialize | public function unserialize($serialized)
{
$this->tokens = [];
$tokenFactory = $this->getTokenFactory();
$it = new SerializedTokenIterator(json_decode($serialized, true));
$this->preUnserialize($it);
while($it->valid())
{
$this->tokens[] = $tokenFactory->createToken($it);
}
$this->postUnserializ... | php | public function unserialize($serialized)
{
$this->tokens = [];
$tokenFactory = $this->getTokenFactory();
$it = new SerializedTokenIterator(json_decode($serialized, true));
$this->preUnserialize($it);
while($it->valid())
{
$this->tokens[] = $tokenFactory->createToken($it);
}
$this->postUnserializ... | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"this",
"->",
"tokens",
"=",
"[",
"]",
";",
"$",
"tokenFactory",
"=",
"$",
"this",
"->",
"getTokenFactory",
"(",
")",
";",
"$",
"it",
"=",
"new",
"SerializedTokenIterator",
"(",
... | Reads a serialized token container and reconstitus all token objects.
@param string $serialized | [
"Reads",
"a",
"serialized",
"token",
"container",
"and",
"reconstitus",
"all",
"token",
"objects",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenContainer.php#L120-L135 |
196,652 | koolkode/lexer | src/AbstractTokenContainer.php | AbstractTokenContainer.offsetGet | public function offsetGet($offset)
{
if(empty($this->tokens[$offset]))
{
throw new \OutOfBoundsException('No token found at offset ' . $offset);
}
return $this->tokens[$offset];
} | php | public function offsetGet($offset)
{
if(empty($this->tokens[$offset]))
{
throw new \OutOfBoundsException('No token found at offset ' . $offset);
}
return $this->tokens[$offset];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"offset",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"tokens",
"[",
"$",
"offset",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"OutOfBoundsException",
"(",
"'No token found at offset '",
".",
"$",
"of... | Get the token at the given position.
@param integer $offset
@return AbstractToken
@throws \OutOfBoundsException | [
"Get",
"the",
"token",
"at",
"the",
"given",
"position",
"."
] | 1f33fb4e95bf3b6b21c63187e503bbe612a1646c | https://github.com/koolkode/lexer/blob/1f33fb4e95bf3b6b21c63187e503bbe612a1646c/src/AbstractTokenContainer.php#L187-L195 |
196,653 | jenskooij/cloudcontrol | src/storage/Cache.php | Cache.clearCache | public function clearCache()
{
$dbInstace = $this->getDbInstance();
$sql = '
DELETE FROM `cache`;
VACUUM;
';
$stmt = $dbInstace->prepare($sql);
if ($stmt->execute()) {
return;
} else {
$error = $stmt->errorInfo();
... | php | public function clearCache()
{
$dbInstace = $this->getDbInstance();
$sql = '
DELETE FROM `cache`;
VACUUM;
';
$stmt = $dbInstace->prepare($sql);
if ($stmt->execute()) {
return;
} else {
$error = $stmt->errorInfo();
... | [
"public",
"function",
"clearCache",
"(",
")",
"{",
"$",
"dbInstace",
"=",
"$",
"this",
"->",
"getDbInstance",
"(",
")",
";",
"$",
"sql",
"=",
"'\n DELETE FROM `cache`;\n VACUUM;\n '",
";",
"$",
"stmt",
"=",
"$",
"dbInstace",
"->",
"p... | Clears all cache | [
"Clears",
"all",
"cache"
] | 76e5d9ac8f9c50d06d39a995d13cc03742536548 | https://github.com/jenskooij/cloudcontrol/blob/76e5d9ac8f9c50d06d39a995d13cc03742536548/src/storage/Cache.php#L71-L86 |
196,654 | phpffcms/ffcms-core | src/Debug/DebugMeasure.php | DebugMeasure.startMeasure | public function startMeasure(string $name): void
{
if (App::$Debug) {
App::$Debug->startMeasure($name);
}
} | php | public function startMeasure(string $name): void
{
if (App::$Debug) {
App::$Debug->startMeasure($name);
}
} | [
"public",
"function",
"startMeasure",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"if",
"(",
"App",
"::",
"$",
"Debug",
")",
"{",
"App",
"::",
"$",
"Debug",
"->",
"startMeasure",
"(",
"$",
"name",
")",
";",
"}",
"}"
] | Start timeline measure
@param string $name | [
"Start",
"timeline",
"measure"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Debug/DebugMeasure.php#L17-L22 |
196,655 | phpffcms/ffcms-core | src/Debug/DebugMeasure.php | DebugMeasure.stopMeasure | public function stopMeasure(string $name): void
{
if (App::$Debug) {
App::$Debug->stopMeasure($name);
}
} | php | public function stopMeasure(string $name): void
{
if (App::$Debug) {
App::$Debug->stopMeasure($name);
}
} | [
"public",
"function",
"stopMeasure",
"(",
"string",
"$",
"name",
")",
":",
"void",
"{",
"if",
"(",
"App",
"::",
"$",
"Debug",
")",
"{",
"App",
"::",
"$",
"Debug",
"->",
"stopMeasure",
"(",
"$",
"name",
")",
";",
"}",
"}"
] | Stop timeline measure
@param string $name | [
"Stop",
"timeline",
"measure"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Debug/DebugMeasure.php#L28-L33 |
196,656 | liip/DataAggregator | src/Liip/DataAggregator/DataAggregator.php | DataAggregator.load | protected function load()
{
$data = array();
/** @var LoaderInterface $loader */
foreach ($this->loaders as $loader) {
try {
$data = array_merge($data, $loader->load());
if ($loader->stopPropagation()) {
break;
... | php | protected function load()
{
$data = array();
/** @var LoaderInterface $loader */
foreach ($this->loaders as $loader) {
try {
$data = array_merge($data, $loader->load());
if ($loader->stopPropagation()) {
break;
... | [
"protected",
"function",
"load",
"(",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"/** @var LoaderInterface $loader */",
"foreach",
"(",
"$",
"this",
"->",
"loaders",
"as",
"$",
"loader",
")",
"{",
"try",
"{",
"$",
"data",
"=",
"array_merge",
"("... | Loads and aggregates information from each registered loader.
@return array | [
"Loads",
"and",
"aggregates",
"information",
"from",
"each",
"registered",
"loader",
"."
] | 53da08ed3f5f24597be9f40ecf8ec44da7765e47 | https://github.com/liip/DataAggregator/blob/53da08ed3f5f24597be9f40ecf8ec44da7765e47/src/Liip/DataAggregator/DataAggregator.php#L175-L193 |
196,657 | phpffcms/ffcms-core | src/Helper/Type/Arr.php | Arr.merge | public static function merge(): array
{
$arguments = [];
foreach (func_get_args() as $key => $val) {
if (!Any::isArray($val)) {
$val = [];
}
$arguments[$key] = $val;
}
return call_user_func_array('array_merge', $arguments);
} | php | public static function merge(): array
{
$arguments = [];
foreach (func_get_args() as $key => $val) {
if (!Any::isArray($val)) {
$val = [];
}
$arguments[$key] = $val;
}
return call_user_func_array('array_merge', $arguments);
} | [
"public",
"static",
"function",
"merge",
"(",
")",
":",
"array",
"{",
"$",
"arguments",
"=",
"[",
"]",
";",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"Any",
"::",
"isArray",
"(",
"$",... | Alternative function for array_merge - safe for use with any-type params.
@return array | [
"Alternative",
"function",
"for",
"array_merge",
"-",
"safe",
"for",
"use",
"with",
"any",
"-",
"type",
"params",
"."
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Type/Arr.php#L33-L44 |
196,658 | phpffcms/ffcms-core | src/Helper/Type/Arr.php | Arr.pluck | public static function pluck(?string $key = null, ?array $array = null): array
{
if (!Any::isArray($array) || !Any::isStr($key)) {
return [];
}
$output = [];
foreach ($array as $item) {
$object = $item[$key];
if (!self::in($object, $output)) {
... | php | public static function pluck(?string $key = null, ?array $array = null): array
{
if (!Any::isArray($array) || !Any::isStr($key)) {
return [];
}
$output = [];
foreach ($array as $item) {
$object = $item[$key];
if (!self::in($object, $output)) {
... | [
"public",
"static",
"function",
"pluck",
"(",
"?",
"string",
"$",
"key",
"=",
"null",
",",
"?",
"array",
"$",
"array",
"=",
"null",
")",
":",
"array",
"{",
"if",
"(",
"!",
"Any",
"::",
"isArray",
"(",
"$",
"array",
")",
"||",
"!",
"Any",
"::",
... | Extract from multi-array elements by key to single-level array
@param string $key
@param array $array
@return array | [
"Extract",
"from",
"multi",
"-",
"array",
"elements",
"by",
"key",
"to",
"single",
"-",
"level",
"array"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Type/Arr.php#L100-L114 |
196,659 | phpffcms/ffcms-core | src/Helper/Type/Arr.php | Arr.exportVar | public static function exportVar($var, $indent = null, $guessTypes = false)
{
switch (gettype($var)) {
case 'string':
// guess boolean type for "1" and "0"
if (true === $guessTypes) {
if ($var === '0' || $var === '') {
r... | php | public static function exportVar($var, $indent = null, $guessTypes = false)
{
switch (gettype($var)) {
case 'string':
// guess boolean type for "1" and "0"
if (true === $guessTypes) {
if ($var === '0' || $var === '') {
r... | [
"public",
"static",
"function",
"exportVar",
"(",
"$",
"var",
",",
"$",
"indent",
"=",
"null",
",",
"$",
"guessTypes",
"=",
"false",
")",
"{",
"switch",
"(",
"gettype",
"(",
"$",
"var",
")",
")",
"{",
"case",
"'string'",
":",
"// guess boolean type for \... | Alternative var_export function for php >= 5.4 syntax
@param array|string $var
@param string|null $indent
@param boolean $guessTypes
@return string|null | [
"Alternative",
"var_export",
"function",
"for",
"php",
">",
"=",
"5",
".",
"4",
"syntax"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Helper/Type/Arr.php#L123-L150 |
196,660 | PSchwisow/phergie-irc-plugin-react-url-shorten | src/Adapter/AbstractAdapter.php | AbstractAdapter.getApiRequest | public function getApiRequest($apiUrl, $deferred)
{
return new Request([
'url' => $apiUrl,
'resolveCallback' =>
function (Response $response) use ($deferred) {
$data = (string) $response->getBody();
$headers = $response->getHead... | php | public function getApiRequest($apiUrl, $deferred)
{
return new Request([
'url' => $apiUrl,
'resolveCallback' =>
function (Response $response) use ($deferred) {
$data = (string) $response->getBody();
$headers = $response->getHead... | [
"public",
"function",
"getApiRequest",
"(",
"$",
"apiUrl",
",",
"$",
"deferred",
")",
"{",
"return",
"new",
"Request",
"(",
"[",
"'url'",
"=>",
"$",
"apiUrl",
",",
"'resolveCallback'",
"=>",
"function",
"(",
"Response",
"$",
"response",
")",
"use",
"(",
... | Create the API Request
@param string $apiUrl
@param Deferred $deferred
@return Request | [
"Create",
"the",
"API",
"Request"
] | 6147d7541520a99fe00e92e334a556650b3daa1f | https://github.com/PSchwisow/phergie-irc-plugin-react-url-shorten/blob/6147d7541520a99fe00e92e334a556650b3daa1f/src/Adapter/AbstractAdapter.php#L67-L85 |
196,661 | codemojo-dr/startkit-php-sdk | src/CodeMojo/Client/Http/HttpGuzzle.php | HttpGuzzle.fetch | public function fetch($protected_resource_url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, array $http_headers = array(), $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART)
{
if ($this->access_token) {
switch ($this->access_token_type) {
case self::ACCE... | php | public function fetch($protected_resource_url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, array $http_headers = array(), $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART)
{
if ($this->access_token) {
switch ($this->access_token_type) {
case self::ACCE... | [
"public",
"function",
"fetch",
"(",
"$",
"protected_resource_url",
",",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"http_method",
"=",
"self",
"::",
"HTTP_METHOD_GET",
",",
"array",
"$",
"http_headers",
"=",
"array",
"(",
")",
",",
"$",
"form_con... | Fetch a protected resource
@param string $protected_ressource_url Protected resource URL
@param array $parameters Array of parameters
@param string $http_method HTTP Method to use (POST, PUT, GET, HEAD, DELETE)
@param array $http_headers HTTP headers
@param int $form_content_type HTTP form content type to use
@re... | [
"Fetch",
"a",
"protected",
"resource"
] | cd2227e1a221be2cd75dc96d1c9e0acfda936fb3 | https://github.com/codemojo-dr/startkit-php-sdk/blob/cd2227e1a221be2cd75dc96d1c9e0acfda936fb3/src/CodeMojo/Client/Http/HttpGuzzle.php#L153-L183 |
196,662 | brightnucleus/options-store | src/ConfigurableOptionsStore.php | ConfigurableOptionsStore.configureRepository | protected function configureRepository(Config $config): OptionRepository
{
$repositories = [];
foreach ($config->getAll() as $class => $optionsArray) {
$prefix = array_key_exists(OptionRepository::PREFIX, $optionsArray)
? $optionsArray[OptionRepository::PREFIX]
... | php | protected function configureRepository(Config $config): OptionRepository
{
$repositories = [];
foreach ($config->getAll() as $class => $optionsArray) {
$prefix = array_key_exists(OptionRepository::PREFIX, $optionsArray)
? $optionsArray[OptionRepository::PREFIX]
... | [
"protected",
"function",
"configureRepository",
"(",
"Config",
"$",
"config",
")",
":",
"OptionRepository",
"{",
"$",
"repositories",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"config",
"->",
"getAll",
"(",
")",
"as",
"$",
"class",
"=>",
"$",
"optionsArray"... | Configure a single repository from a Config file.
This will automatically regroup an array of repositories into an AggregateOptionRepository.
@since 0.1.4
@param Config $config Config instance to use.
@return OptionRepository Option repository that was built from the passed-in repository.
@throws InvalidOptionRepos... | [
"Configure",
"a",
"single",
"repository",
"from",
"a",
"Config",
"file",
"."
] | 9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1 | https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/ConfigurableOptionsStore.php#L70-L98 |
196,663 | brightnucleus/options-store | src/ConfigurableOptionsStore.php | ConfigurableOptionsStore.configureOptions | protected function configureOptions(array $optionsArray): OptionCollection
{
$options = new OptionCollection\ArrayOptionCollection();
foreach ($optionsArray as $key => $option) {
if ($key === OptionRepository::PREFIX) {
continue;
}
if ($option ins... | php | protected function configureOptions(array $optionsArray): OptionCollection
{
$options = new OptionCollection\ArrayOptionCollection();
foreach ($optionsArray as $key => $option) {
if ($key === OptionRepository::PREFIX) {
continue;
}
if ($option ins... | [
"protected",
"function",
"configureOptions",
"(",
"array",
"$",
"optionsArray",
")",
":",
"OptionCollection",
"{",
"$",
"options",
"=",
"new",
"OptionCollection",
"\\",
"ArrayOptionCollection",
"(",
")",
";",
"foreach",
"(",
"$",
"optionsArray",
"as",
"$",
"key"... | Build a collection of options from an array of Config values.
@since 0.1.0
@param array $optionsArray Array of config values that are used to build the options.
@return OptionCollection Collection of instantiated options. | [
"Build",
"a",
"collection",
"of",
"options",
"from",
"an",
"array",
"of",
"Config",
"values",
"."
] | 9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1 | https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/ConfigurableOptionsStore.php#L109-L138 |
196,664 | brightnucleus/options-store | src/ConfigurableOptionsStore.php | ConfigurableOptionsStore.isPrefixable | protected function isPrefixable($objectOrClassName): bool
{
if (is_string($objectOrClassName)) {
return in_array(Prefixable::class, class_implements($objectOrClassName), true);
}
if (is_object($objectOrClassName)) {
return $objectOrClassName instanceof Prefixable;
... | php | protected function isPrefixable($objectOrClassName): bool
{
if (is_string($objectOrClassName)) {
return in_array(Prefixable::class, class_implements($objectOrClassName), true);
}
if (is_object($objectOrClassName)) {
return $objectOrClassName instanceof Prefixable;
... | [
"protected",
"function",
"isPrefixable",
"(",
"$",
"objectOrClassName",
")",
":",
"bool",
"{",
"if",
"(",
"is_string",
"(",
"$",
"objectOrClassName",
")",
")",
"{",
"return",
"in_array",
"(",
"Prefixable",
"::",
"class",
",",
"class_implements",
"(",
"$",
"o... | Check whether a FQCN or an object implements the Prefixable interface.
@since 0.1.0
@param OptionRepository|string $objectOrClassName Object instance or FQCN.
@return bool Whether the passed-in argument is prefixable. | [
"Check",
"whether",
"a",
"FQCN",
"or",
"an",
"object",
"implements",
"the",
"Prefixable",
"interface",
"."
] | 9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1 | https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/ConfigurableOptionsStore.php#L149-L160 |
196,665 | Sectorr/Core | Sectorr/Core/Config.php | Config.get | public static function get($key)
{
$config = json_decode(file_get_contents(PATH . '/app/config.json'), true);
if (! array_key_exists($key, $config)) {
throw new ConfigItemNotSetException($key);
}
return $config[$key];
} | php | public static function get($key)
{
$config = json_decode(file_get_contents(PATH . '/app/config.json'), true);
if (! array_key_exists($key, $config)) {
throw new ConfigItemNotSetException($key);
}
return $config[$key];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"config",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"PATH",
".",
"'/app/config.json'",
")",
",",
"true",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
... | Get Config item by key.
@param $key
@return mixed
@throws ConfigItemNotSetException | [
"Get",
"Config",
"item",
"by",
"key",
"."
] | 31df852dc6cc61642b0b87d9f0ae56c8e7da5a27 | https://github.com/Sectorr/Core/blob/31df852dc6cc61642b0b87d9f0ae56c8e7da5a27/Sectorr/Core/Config.php#L16-L25 |
196,666 | johnkrovitch/Sam | Task/Task.php | Task.setSources | public function setSources(array $sources)
{
$parameters = $this
->configuration
->getParameters();
$parameters['sources'] = $sources;
$this
->configuration
->setParameters($parameters);
} | php | public function setSources(array $sources)
{
$parameters = $this
->configuration
->getParameters();
$parameters['sources'] = $sources;
$this
->configuration
->setParameters($parameters);
} | [
"public",
"function",
"setSources",
"(",
"array",
"$",
"sources",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"configuration",
"->",
"getParameters",
"(",
")",
";",
"$",
"parameters",
"[",
"'sources'",
"]",
"=",
"$",
"sources",
";",
"$",
"this",... | Define the task new sources.
@param array $sources | [
"Define",
"the",
"task",
"new",
"sources",
"."
] | fbd3770c11eecc0a6d8070f439f149062316f606 | https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Task/Task.php#L67-L77 |
196,667 | jabernardo/lollipop-php | Library/Session.php | Session.getDriver | static private function getDriver() {
if (self::$_driver != null) return self::$_driver;
$driver = Utils::spare(Config::get('session.driver'), 'default');
switch (strtolower($driver)) {
case 'cookie':
self::$_driver = new \Lollipop\Session\Cookie();
... | php | static private function getDriver() {
if (self::$_driver != null) return self::$_driver;
$driver = Utils::spare(Config::get('session.driver'), 'default');
switch (strtolower($driver)) {
case 'cookie':
self::$_driver = new \Lollipop\Session\Cookie();
... | [
"static",
"private",
"function",
"getDriver",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"_driver",
"!=",
"null",
")",
"return",
"self",
"::",
"$",
"_driver",
";",
"$",
"driver",
"=",
"Utils",
"::",
"spare",
"(",
"Config",
"::",
"get",
"(",
"'sessi... | Get session driver
@return object | [
"Get",
"session",
"driver"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/Session.php#L32-L49 |
196,668 | kambalabs/KmbZendDbInfrastructure | src/KmbZendDbInfrastructure/Proxy/RevisionProxy.php | RevisionProxy.addGroup | public function addGroup($group)
{
if ($this->groups === null) {
$this->setGroups($this->groupRepository->getAllByRevision($this));
}
$this->groups[] = $group;
return $this;
} | php | public function addGroup($group)
{
if ($this->groups === null) {
$this->setGroups($this->groupRepository->getAllByRevision($this));
}
$this->groups[] = $group;
return $this;
} | [
"public",
"function",
"addGroup",
"(",
"$",
"group",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"groups",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setGroups",
"(",
"$",
"this",
"->",
"groupRepository",
"->",
"getAllByRevision",
"(",
"$",
"this",
")",
... | Add a group.
@param \KmbDomain\Model\GroupInterface $group
@return RevisionProxy | [
"Add",
"a",
"group",
"."
] | 9bf4df4272d2064965202d0e689f944d56a4c6bb | https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/RevisionProxy.php#L244-L251 |
196,669 | kambalabs/KmbZendDbInfrastructure | src/KmbZendDbInfrastructure/Proxy/RevisionProxy.php | RevisionProxy.getGroups | public function getGroups()
{
if ($this->groups === null) {
$this->setGroups($this->groupRepository->getAllByRevision($this));
}
return $this->groups;
} | php | public function getGroups()
{
if ($this->groups === null) {
$this->setGroups($this->groupRepository->getAllByRevision($this));
}
return $this->groups;
} | [
"public",
"function",
"getGroups",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"groups",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setGroups",
"(",
"$",
"this",
"->",
"groupRepository",
"->",
"getAllByRevision",
"(",
"$",
"this",
")",
")",
";",
"... | Get Groups.
@return \KmbDomain\Model\GroupInterface[] | [
"Get",
"Groups",
"."
] | 9bf4df4272d2064965202d0e689f944d56a4c6bb | https://github.com/kambalabs/KmbZendDbInfrastructure/blob/9bf4df4272d2064965202d0e689f944d56a4c6bb/src/KmbZendDbInfrastructure/Proxy/RevisionProxy.php#L258-L264 |
196,670 | locomotivemtl/charcoal-queue | src/Charcoal/Queue/QueueItemTrait.php | QueueItemTrait.setQueueItemData | public function setQueueItemData(array $data)
{
if (isset($data['queue_id'])) {
$this->setQueueId($data['queue_id']);
}
if (isset($data['processed'])) {
$this->setProcessed($data['processed']);
}
if (isset($data['queued_date'])) {
$this->... | php | public function setQueueItemData(array $data)
{
if (isset($data['queue_id'])) {
$this->setQueueId($data['queue_id']);
}
if (isset($data['processed'])) {
$this->setProcessed($data['processed']);
}
if (isset($data['queued_date'])) {
$this->... | [
"public",
"function",
"setQueueItemData",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'queue_id'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"setQueueId",
"(",
"$",
"data",
"[",
"'queue_id'",
"]",
")",
";",
"}",
"i... | Set the queue item's data.
@param array $data The queue item data to set.
@return self | [
"Set",
"the",
"queue",
"item",
"s",
"data",
"."
] | 90c47581cd35fbb554eca513f909171a70325b44 | https://github.com/locomotivemtl/charcoal-queue/blob/90c47581cd35fbb554eca513f909171a70325b44/src/Charcoal/Queue/QueueItemTrait.php#L73-L92 |
196,671 | marando/Units | src/Marando/Units/Velocity.php | Velocity.create | public static function create($value, $units)
{
// Explode units...
list($distUnit, $timeUnit) = static::explUnits($units);
// Create distance and time placeholders.
$dist = Distance::m(0);
$time = Time::sec(0);
// Set each distance/time unit.
$dist->{$distU... | php | public static function create($value, $units)
{
// Explode units...
list($distUnit, $timeUnit) = static::explUnits($units);
// Create distance and time placeholders.
$dist = Distance::m(0);
$time = Time::sec(0);
// Set each distance/time unit.
$dist->{$distU... | [
"public",
"static",
"function",
"create",
"(",
"$",
"value",
",",
"$",
"units",
")",
"{",
"// Explode units...",
"list",
"(",
"$",
"distUnit",
",",
"$",
"timeUnit",
")",
"=",
"static",
"::",
"explUnits",
"(",
"$",
"units",
")",
";",
"// Create distance and... | Creates a new velocity from a value and velocity unit.
@param $value Value of the velocity
@param $units Unit of measurement, e.g. m/s
@return static | [
"Creates",
"a",
"new",
"velocity",
"from",
"a",
"value",
"and",
"velocity",
"unit",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L84-L102 |
196,672 | marando/Units | src/Marando/Units/Velocity.php | Velocity.units | public function units($units, $string = false)
{
// Explode units
list($distUnit, $timeUnit) = static::explUnits($units);
// Get and format the distance and time unit values
$distVal = $this->dist->unit($distUnit);
$timeVal = $this->time->{$timeUnit};
$distVal = numb... | php | public function units($units, $string = false)
{
// Explode units
list($distUnit, $timeUnit) = static::explUnits($units);
// Get and format the distance and time unit values
$distVal = $this->dist->unit($distUnit);
$timeVal = $this->time->{$timeUnit};
$distVal = numb... | [
"public",
"function",
"units",
"(",
"$",
"units",
",",
"$",
"string",
"=",
"false",
")",
"{",
"// Explode units",
"list",
"(",
"$",
"distUnit",
",",
"$",
"timeUnit",
")",
"=",
"static",
"::",
"explUnits",
"(",
"$",
"units",
")",
";",
"// Get and format t... | Gets the value of this instance at the specified units.
@param $units Units, e.g. m/s
@param bool $string True to return as string for higher precision
@return double|string | [
"Gets",
"the",
"value",
"of",
"this",
"instance",
"at",
"the",
"specified",
"units",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L279-L296 |
196,673 | marando/Units | src/Marando/Units/Velocity.php | Velocity.format | public function format($format)
{
// Sprintf and unit regex
$pattern = '/(%(?:\d+\$)?[+-]?(?:[ 0]|\'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX])([ ]*)(.*)/';
// Check if string has sprintf and unit...
if (preg_match_all($pattern, $format, $m)) {
$sprintf = $m[1][0];
... | php | public function format($format)
{
// Sprintf and unit regex
$pattern = '/(%(?:\d+\$)?[+-]?(?:[ 0]|\'.{1})?-?\d*(?:\.\d+)?[bcdeEufFgGosxX])([ ]*)(.*)/';
// Check if string has sprintf and unit...
if (preg_match_all($pattern, $format, $m)) {
$sprintf = $m[1][0];
... | [
"public",
"function",
"format",
"(",
"$",
"format",
")",
"{",
"// Sprintf and unit regex",
"$",
"pattern",
"=",
"'/(%(?:\\d+\\$)?[+-]?(?:[ 0]|\\'.{1})?-?\\d*(?:\\.\\d+)?[bcdeEufFgGosxX])([ ]*)(.*)/'",
";",
"// Check if string has sprintf and unit...",
"if",
"(",
"preg_match_all",
... | Formats this instance as a string with the provided format.
@param $format Format, e.g. %1.3f m/s
@return string | [
"Formats",
"this",
"instance",
"as",
"a",
"string",
"with",
"the",
"provided",
"format",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L305-L327 |
196,674 | marando/Units | src/Marando/Units/Velocity.php | Velocity.add | public function add(Velocity $b)
{
$dist = $this->dist->add($b->dist);
$velocity = new Velocity($dist, $this->time);
$velocity->format = $this->format;
return $velocity;
} | php | public function add(Velocity $b)
{
$dist = $this->dist->add($b->dist);
$velocity = new Velocity($dist, $this->time);
$velocity->format = $this->format;
return $velocity;
} | [
"public",
"function",
"add",
"(",
"Velocity",
"$",
"b",
")",
"{",
"$",
"dist",
"=",
"$",
"this",
"->",
"dist",
"->",
"add",
"(",
"$",
"b",
"->",
"dist",
")",
";",
"$",
"velocity",
"=",
"new",
"Velocity",
"(",
"$",
"dist",
",",
"$",
"this",
"->"... | Adds another velocity to this instance and returns a new instance with
the sum.
@param Velocity $b Velocity to add
@return static Sum of the two velocity instances | [
"Adds",
"another",
"velocity",
"to",
"this",
"instance",
"and",
"returns",
"a",
"new",
"instance",
"with",
"the",
"sum",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L337-L345 |
196,675 | marando/Units | src/Marando/Units/Velocity.php | Velocity.sub | public function sub(Velocity $b)
{
$dist = $this->dist->sub($b->dist);
$velocity = new Velocity($dist, $this->time);
$velocity->format = $this->format;
return $velocity;
} | php | public function sub(Velocity $b)
{
$dist = $this->dist->sub($b->dist);
$velocity = new Velocity($dist, $this->time);
$velocity->format = $this->format;
return $velocity;
} | [
"public",
"function",
"sub",
"(",
"Velocity",
"$",
"b",
")",
"{",
"$",
"dist",
"=",
"$",
"this",
"->",
"dist",
"->",
"sub",
"(",
"$",
"b",
"->",
"dist",
")",
";",
"$",
"velocity",
"=",
"new",
"Velocity",
"(",
"$",
"dist",
",",
"$",
"this",
"->"... | Subtracts another velocity from this instance and returns a new instance
with the difference.
@param Velocity $b Velocity to subtract
@return static Difference of the two velocity instances | [
"Subtracts",
"another",
"velocity",
"from",
"this",
"instance",
"and",
"returns",
"a",
"new",
"instance",
"with",
"the",
"difference",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L355-L363 |
196,676 | marando/Units | src/Marando/Units/Velocity.php | Velocity.time | public function time(Distance $dist)
{
return Time::sec(($dist->m / $this->dist->m) * $this->time->sec);
} | php | public function time(Distance $dist)
{
return Time::sec(($dist->m / $this->dist->m) * $this->time->sec);
} | [
"public",
"function",
"time",
"(",
"Distance",
"$",
"dist",
")",
"{",
"return",
"Time",
"::",
"sec",
"(",
"(",
"$",
"dist",
"->",
"m",
"/",
"$",
"this",
"->",
"dist",
"->",
"m",
")",
"*",
"$",
"this",
"->",
"time",
"->",
"sec",
")",
";",
"}"
] | Calculates the time required to travel the provided distance at the
velocity of this instance.
@param Distance $dist
@return Time | [
"Calculates",
"the",
"time",
"required",
"to",
"travel",
"the",
"provided",
"distance",
"at",
"the",
"velocity",
"of",
"this",
"instance",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L373-L376 |
196,677 | marando/Units | src/Marando/Units/Velocity.php | Velocity.removeTrailingZeros | private static function removeTrailingZeros($num)
{
// Only do this if number has a decimal value.
if (strstr($num, '.')) {
$num = rtrim($num, '0');
$last = substr($num, strlen($num) - 1, 1) == '.';
$num = $last ? substr($num, 0, strlen($num) - 1) : $num;
... | php | private static function removeTrailingZeros($num)
{
// Only do this if number has a decimal value.
if (strstr($num, '.')) {
$num = rtrim($num, '0');
$last = substr($num, strlen($num) - 1, 1) == '.';
$num = $last ? substr($num, 0, strlen($num) - 1) : $num;
... | [
"private",
"static",
"function",
"removeTrailingZeros",
"(",
"$",
"num",
")",
"{",
"// Only do this if number has a decimal value.",
"if",
"(",
"strstr",
"(",
"$",
"num",
",",
"'.'",
")",
")",
"{",
"$",
"num",
"=",
"rtrim",
"(",
"$",
"num",
",",
"'0'",
")"... | Removes trailing zeros for a numeric value expressed as a string.
@param $num
@return string | [
"Removes",
"trailing",
"zeros",
"for",
"a",
"numeric",
"value",
"expressed",
"as",
"a",
"string",
"."
] | 1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70 | https://github.com/marando/Units/blob/1721f16a2fdbd3fd8acb9061d393ce9ef1ce6e70/src/Marando/Units/Velocity.php#L470-L483 |
196,678 | duncan3dc/php-ini | src/State.php | State.set | public function set(string $key, string $value): ConfigInterface
{
$this->settings[$key] = $value;
return $this;
} | php | public function set(string $key, string $value): ConfigInterface
{
$this->settings[$key] = $value;
return $this;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"key",
",",
"string",
"$",
"value",
")",
":",
"ConfigInterface",
"{",
"$",
"this",
"->",
"settings",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",
"return",
"$",
"this",
";",
"}"
] | Set an ini directive to be used when calling.
@param string $key The name of the setting
@param string $value The value to use
@return $this | [
"Set",
"an",
"ini",
"directive",
"to",
"be",
"used",
"when",
"calling",
"."
] | e07435d7ddbbc466e535783e5c4d2b92e3715c7a | https://github.com/duncan3dc/php-ini/blob/e07435d7ddbbc466e535783e5c4d2b92e3715c7a/src/State.php#L35-L40 |
196,679 | duncan3dc/php-ini | src/State.php | State.call | public function call(callable $callable, ...$params)
{
foreach ($this->settings as $key => $value) {
$this->ini->set($key, $value);
}
$result = null;
$exception = null;
try {
$result = $callable(...$params);
} catch (\Throwable $e) {
... | php | public function call(callable $callable, ...$params)
{
foreach ($this->settings as $key => $value) {
$this->ini->set($key, $value);
}
$result = null;
$exception = null;
try {
$result = $callable(...$params);
} catch (\Throwable $e) {
... | [
"public",
"function",
"call",
"(",
"callable",
"$",
"callable",
",",
"...",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"settings",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"ini",
"->",
"set",
"(",
"$",
"... | Run some code using the previous provided ini settings.
@param callable $callable $the code to run
@param mixed ...$params Any parameters to pass to the callable
@return mixed The result of the callable | [
"Run",
"some",
"code",
"using",
"the",
"previous",
"provided",
"ini",
"settings",
"."
] | e07435d7ddbbc466e535783e5c4d2b92e3715c7a | https://github.com/duncan3dc/php-ini/blob/e07435d7ddbbc466e535783e5c4d2b92e3715c7a/src/State.php#L64-L85 |
196,680 | spartan/console | src/App.php | App.withPath | public function withPath($path = __DIR__)
{
$before = get_declared_classes();
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
foreach ($iterator as $item) {
if (!$item->isDir() && substr($item->getPathname(), -4) == '.php') {
r... | php | public function withPath($path = __DIR__)
{
$before = get_declared_classes();
$iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path));
foreach ($iterator as $item) {
if (!$item->isDir() && substr($item->getPathname(), -4) == '.php') {
r... | [
"public",
"function",
"withPath",
"(",
"$",
"path",
"=",
"__DIR__",
")",
"{",
"$",
"before",
"=",
"get_declared_classes",
"(",
")",
";",
"$",
"iterator",
"=",
"new",
"\\",
"RecursiveIteratorIterator",
"(",
"new",
"\\",
"RecursiveDirectoryIterator",
"(",
"$",
... | Add commands from path recursively
@param string $path
@return $this | [
"Add",
"commands",
"from",
"path",
"recursively"
] | 66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838 | https://github.com/spartan/console/blob/66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838/src/App.php#L25-L42 |
196,681 | spartan/console | src/App.php | App.withStyles | public function withStyles(array $styles)
{
foreach ($styles as $name => $args) {
$this->formatter()->setStyle($name, new OutputFormatterStyle(...$args));
}
return $this;
} | php | public function withStyles(array $styles)
{
foreach ($styles as $name => $args) {
$this->formatter()->setStyle($name, new OutputFormatterStyle(...$args));
}
return $this;
} | [
"public",
"function",
"withStyles",
"(",
"array",
"$",
"styles",
")",
"{",
"foreach",
"(",
"$",
"styles",
"as",
"$",
"name",
"=>",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"formatter",
"(",
")",
"->",
"setStyle",
"(",
"$",
"name",
",",
"new",
"Out... | Change output formatting styles
@param array $styles
@return $this | [
"Change",
"output",
"formatting",
"styles"
] | 66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838 | https://github.com/spartan/console/blob/66e3e595b9bf9e274ce35d2f50f7cdd5d9e5e838/src/App.php#L72-L79 |
196,682 | ringoteam/RingoPhpRedmonBundle | Controller/DashController.php | DashController.indexAction | public function indexAction()
{
$instance = $this->getCurrentInstance();
if($instance) {
$worker = $this->getWorker();
// Worker can be undefined if server went away
// For the current instance or if there is no instance selected
if($worke... | php | public function indexAction()
{
$instance = $this->getCurrentInstance();
if($instance) {
$worker = $this->getWorker();
// Worker can be undefined if server went away
// For the current instance or if there is no instance selected
if($worke... | [
"public",
"function",
"indexAction",
"(",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"getCurrentInstance",
"(",
")",
";",
"if",
"(",
"$",
"instance",
")",
"{",
"$",
"worker",
"=",
"$",
"this",
"->",
"getWorker",
"(",
")",
";",
"// Worker can be... | Render choose action or dashboard action
@return mixed | [
"Render",
"choose",
"action",
"or",
"dashboard",
"action"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/DashController.php#L28-L50 |
196,683 | ringoteam/RingoPhpRedmonBundle | Controller/DashController.php | DashController.clientAction | public function clientAction()
{
$worker = $this->getWorker();
// Worker can be undefined if server went away
// For the current instance or if we have no instance selected
if(!$worker) {
return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
}
... | php | public function clientAction()
{
$worker = $this->getWorker();
// Worker can be undefined if server went away
// For the current instance or if we have no instance selected
if(!$worker) {
return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
}
... | [
"public",
"function",
"clientAction",
"(",
")",
"{",
"$",
"worker",
"=",
"$",
"this",
"->",
"getWorker",
"(",
")",
";",
"// Worker can be undefined if server went away",
"// For the current instance or if we have no instance selected",
"if",
"(",
"!",
"$",
"worker",
")"... | Render client list for the current instance
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Render",
"client",
"list",
"for",
"the",
"current",
"instance"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/DashController.php#L57-L72 |
196,684 | ringoteam/RingoPhpRedmonBundle | Controller/DashController.php | DashController.configurationAction | public function configurationAction()
{
$worker = $this->getWorker();
// Worker can be undefined if server went away
// For the current instance or if we have no instance selected
if(!$worker) {
return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
... | php | public function configurationAction()
{
$worker = $this->getWorker();
// Worker can be undefined if server went away
// For the current instance or if we have no instance selected
if(!$worker) {
return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
... | [
"public",
"function",
"configurationAction",
"(",
")",
"{",
"$",
"worker",
"=",
"$",
"this",
"->",
"getWorker",
"(",
")",
";",
"// Worker can be undefined if server went away",
"// For the current instance or if we have no instance selected",
"if",
"(",
"!",
"$",
"worker"... | Render configuration list for the current instance
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Render",
"configuration",
"list",
"for",
"the",
"current",
"instance"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/DashController.php#L79-L95 |
196,685 | ringoteam/RingoPhpRedmonBundle | Controller/DashController.php | DashController.selectAction | public function selectAction($id)
{
$instance = $this->getManager()->find($id);
// If instance exists
if($instance) {
$this->getRequest()->getSession()->set('instance', $instance);
if($this->getWorker()) {
$this->get('session')->getFlashBag()->add('suc... | php | public function selectAction($id)
{
$instance = $this->getManager()->find($id);
// If instance exists
if($instance) {
$this->getRequest()->getSession()->set('instance', $instance);
if($this->getWorker()) {
$this->get('session')->getFlashBag()->add('suc... | [
"public",
"function",
"selectAction",
"(",
"$",
"id",
")",
"{",
"$",
"instance",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
"// If instance exists",
"if",
"(",
"$",
"instance",
")",
"{",
"$",
"this",
"->",... | Select action
Change the current instance
@param string $id
@return \Symfony\Component\HttpFoundation\RedirectResponse | [
"Select",
"action",
"Change",
"the",
"current",
"instance"
] | 9aab989a9bee9e6152ec19f8a30bc24f3bde6012 | https://github.com/ringoteam/RingoPhpRedmonBundle/blob/9aab989a9bee9e6152ec19f8a30bc24f3bde6012/Controller/DashController.php#L104-L120 |
196,686 | tjwlucas/phpjstore | src/jstore.php | jstore.dir | public static function dir()
{
$JSTORE_DIR = str_replace(DIRECTORY_SEPARATOR, '/', __DIR__);
$JSTORE_DOCS_ROOT = str_replace(DIRECTORY_SEPARATOR, '/', isset($_SERVER['DOCUMENT_ROOT']) ? realpath($_SERVER['DOCUMENT_ROOT']) : dirname(__DIR__));
return trim(str_replace($JSTORE_DOCS_RO... | php | public static function dir()
{
$JSTORE_DIR = str_replace(DIRECTORY_SEPARATOR, '/', __DIR__);
$JSTORE_DOCS_ROOT = str_replace(DIRECTORY_SEPARATOR, '/', isset($_SERVER['DOCUMENT_ROOT']) ? realpath($_SERVER['DOCUMENT_ROOT']) : dirname(__DIR__));
return trim(str_replace($JSTORE_DOCS_RO... | [
"public",
"static",
"function",
"dir",
"(",
")",
"{",
"$",
"JSTORE_DIR",
"=",
"str_replace",
"(",
"DIRECTORY_SEPARATOR",
",",
"'/'",
",",
"__DIR__",
")",
";",
"$",
"JSTORE_DOCS_ROOT",
"=",
"str_replace",
"(",
"DIRECTORY_SEPARATOR",
",",
"'/'",
",",
"isset",
... | Used to get the directory where this class file is located | [
"Used",
"to",
"get",
"the",
"directory",
"where",
"this",
"class",
"file",
"is",
"located"
] | ebc8f821de38757724efb89992a9d3aa9f9834d2 | https://github.com/tjwlucas/phpjstore/blob/ebc8f821de38757724efb89992a9d3aa9f9834d2/src/jstore.php#L43-L48 |
196,687 | tjwlucas/phpjstore | src/jstore.php | jstore.ArrayToObj | public function ArrayToObj($array, $root = False){
$obj = !$root ? new jstoreRootObject($this) : new jstoreObject($this);
foreach( $array as $arraykey => $arrayval){
if( is_array($arrayval) ){
$obj->$arraykey = $this->ArrayToObj($arrayval);
}
else{
... | php | public function ArrayToObj($array, $root = False){
$obj = !$root ? new jstoreRootObject($this) : new jstoreObject($this);
foreach( $array as $arraykey => $arrayval){
if( is_array($arrayval) ){
$obj->$arraykey = $this->ArrayToObj($arrayval);
}
else{
... | [
"public",
"function",
"ArrayToObj",
"(",
"$",
"array",
",",
"$",
"root",
"=",
"False",
")",
"{",
"$",
"obj",
"=",
"!",
"$",
"root",
"?",
"new",
"jstoreRootObject",
"(",
"$",
"this",
")",
":",
"new",
"jstoreObject",
"(",
"$",
"this",
")",
";",
"fore... | Same as JsonToObj, except it takes in an array, rather than a JSON
For both methods, this is where the work actually happens | [
"Same",
"as",
"JsonToObj",
"except",
"it",
"takes",
"in",
"an",
"array",
"rather",
"than",
"a",
"JSON",
"For",
"both",
"methods",
"this",
"is",
"where",
"the",
"work",
"actually",
"happens"
] | ebc8f821de38757724efb89992a9d3aa9f9834d2 | https://github.com/tjwlucas/phpjstore/blob/ebc8f821de38757724efb89992a9d3aa9f9834d2/src/jstore.php#L86-L97 |
196,688 | Krinkle/toollabs-base | src/GitInfo.php | GitInfo.getHeadSHA1 | public function getHeadSHA1() {
$headFile = "{$this->dir}/HEAD";
if ( !is_readable( $headFile ) ) {
return false;
}
$head = file_get_contents( $headFile );
if ( preg_match( "/ref: (.*)/", $head, $m ) ) {
$head = rtrim( $m[1] );
} else {
$head = rtrim( $head );
}
if ( self::isSHA1( $head ) ) {... | php | public function getHeadSHA1() {
$headFile = "{$this->dir}/HEAD";
if ( !is_readable( $headFile ) ) {
return false;
}
$head = file_get_contents( $headFile );
if ( preg_match( "/ref: (.*)/", $head, $m ) ) {
$head = rtrim( $m[1] );
} else {
$head = rtrim( $head );
}
if ( self::isSHA1( $head ) ) {... | [
"public",
"function",
"getHeadSHA1",
"(",
")",
"{",
"$",
"headFile",
"=",
"\"{$this->dir}/HEAD\"",
";",
"if",
"(",
"!",
"is_readable",
"(",
"$",
"headFile",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"head",
"=",
"file_get_contents",
"(",
"$",
"hea... | Return the SHA1 for the current HEAD of the Git repository.
@return string|bool A SHA1, or boolean false | [
"Return",
"the",
"SHA1",
"for",
"the",
"current",
"HEAD",
"of",
"the",
"Git",
"repository",
"."
] | 784150ca58f4b48cc89534fd6142c54b4f138cd2 | https://github.com/Krinkle/toollabs-base/blob/784150ca58f4b48cc89534fd6142c54b4f138cd2/src/GitInfo.php#L40-L65 |
196,689 | Werkint/SpritesBundle | src/Service/Sprites.php | Sprites.getList | public function getList()
{
$data = [];
foreach ($this->providers as $provider) {
/** @var ProviderInterface $provider */
$data = array_merge_recursive(
$data, $provider->getImages()
);
}
return $data;
} | php | public function getList()
{
$data = [];
foreach ($this->providers as $provider) {
/** @var ProviderInterface $provider */
$data = array_merge_recursive(
$data, $provider->getImages()
);
}
return $data;
} | [
"public",
"function",
"getList",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"providers",
"as",
"$",
"provider",
")",
"{",
"/** @var ProviderInterface $provider */",
"$",
"data",
"=",
"array_merge_recursive",
"(",
"$",
... | Returns list of images to merge
@return array | [
"Returns",
"list",
"of",
"images",
"to",
"merge"
] | d0f2dd1f862cc79b6fe7a295302057aef6a01d91 | https://github.com/Werkint/SpritesBundle/blob/d0f2dd1f862cc79b6fe7a295302057aef6a01d91/src/Service/Sprites.php#L107-L118 |
196,690 | Werkint/SpritesBundle | src/Service/Sprites.php | Sprites.compile | public function compile()
{
// Path prefix
$prefix = $this->getNewPrefix();
// List of images
$data = $this->getList();
// sizes
$sizes = [];
foreach ($this->providers as $provider) {
if ($provider instanceof SizeProviderInterface) {
... | php | public function compile()
{
// Path prefix
$prefix = $this->getNewPrefix();
// List of images
$data = $this->getList();
// sizes
$sizes = [];
foreach ($this->providers as $provider) {
if ($provider instanceof SizeProviderInterface) {
... | [
"public",
"function",
"compile",
"(",
")",
"{",
"// Path prefix",
"$",
"prefix",
"=",
"$",
"this",
"->",
"getNewPrefix",
"(",
")",
";",
"// List of images",
"$",
"data",
"=",
"$",
"this",
"->",
"getList",
"(",
")",
";",
"// sizes",
"$",
"sizes",
"=",
"... | Compiles all sprites
@return int Number of images merged | [
"Compiles",
"all",
"sprites"
] | d0f2dd1f862cc79b6fe7a295302057aef6a01d91 | https://github.com/Werkint/SpritesBundle/blob/d0f2dd1f862cc79b6fe7a295302057aef6a01d91/src/Service/Sprites.php#L125-L178 |
196,691 | Werkint/SpritesBundle | src/Service/Sprites.php | Sprites.getNewPrefix | protected function getNewPrefix()
{
// Removing old sprites
$find = new Finder();
$fs = new Filesystem();
$fs->remove(
$find->in($this->imgDir)->directories(),
$this->stylePath
);
// New prefix
$prefix = substr(sha1(microtime(true) . '... | php | protected function getNewPrefix()
{
// Removing old sprites
$find = new Finder();
$fs = new Filesystem();
$fs->remove(
$find->in($this->imgDir)->directories(),
$this->stylePath
);
// New prefix
$prefix = substr(sha1(microtime(true) . '... | [
"protected",
"function",
"getNewPrefix",
"(",
")",
"{",
"// Removing old sprites",
"$",
"find",
"=",
"new",
"Finder",
"(",
")",
";",
"$",
"fs",
"=",
"new",
"Filesystem",
"(",
")",
";",
"$",
"fs",
"->",
"remove",
"(",
"$",
"find",
"->",
"in",
"(",
"$"... | Creates new prefix for sprites
@return string | [
"Creates",
"new",
"prefix",
"for",
"sprites"
] | d0f2dd1f862cc79b6fe7a295302057aef6a01d91 | https://github.com/Werkint/SpritesBundle/blob/d0f2dd1f862cc79b6fe7a295302057aef6a01d91/src/Service/Sprites.php#L277-L292 |
196,692 | wb-crowdfusion/crowdfusion | system/core/classes/nodedb/daos/NodeDAO.php | NodeDAO.insertIntoTree | protected function insertIntoTree(&$node, $existingNode = null)
{
$treeOriginTagDef = $node->getNodeRef()->getElement()->getSchema()->getTreeOriginTagDef();
if(empty($treeOriginTagDef))
throw new NodeException('Cannot insert a node in tree order mode without a tree origin tag definitio... | php | protected function insertIntoTree(&$node, $existingNode = null)
{
$treeOriginTagDef = $node->getNodeRef()->getElement()->getSchema()->getTreeOriginTagDef();
if(empty($treeOriginTagDef))
throw new NodeException('Cannot insert a node in tree order mode without a tree origin tag definitio... | [
"protected",
"function",
"insertIntoTree",
"(",
"&",
"$",
"node",
",",
"$",
"existingNode",
"=",
"null",
")",
"{",
"$",
"treeOriginTagDef",
"=",
"$",
"node",
"->",
"getNodeRef",
"(",
")",
"->",
"getElement",
"(",
")",
"->",
"getSchema",
"(",
")",
"->",
... | This only supports inserting nodes at the end of the tree or at the end of a list of children to a parent,
which inherently means the 2nd criteria to the tree beyond parent is creation date
@param $node
@return unknown_type | [
"This",
"only",
"supports",
"inserting",
"nodes",
"at",
"the",
"end",
"of",
"the",
"tree",
"or",
"at",
"the",
"end",
"of",
"a",
"list",
"of",
"children",
"to",
"a",
"parent",
"which",
"inherently",
"means",
"the",
"2nd",
"criteria",
"to",
"the",
"tree",
... | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/nodedb/daos/NodeDAO.php#L602-L665 |
196,693 | SlabPHP/bundle-stack | src/Cache/Directories.php | Directories.buildCache | public function buildCache()
{
if (!empty($this->viewDirectories) || !empty($this->configDirectories) || !empty($this->resourceDirectories)) {
return;
}
foreach ($this->orderReference as $namespace)
{
/**
* @var \Slab\Components\BundleInterface $... | php | public function buildCache()
{
if (!empty($this->viewDirectories) || !empty($this->configDirectories) || !empty($this->resourceDirectories)) {
return;
}
foreach ($this->orderReference as $namespace)
{
/**
* @var \Slab\Components\BundleInterface $... | [
"public",
"function",
"buildCache",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"viewDirectories",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
"->",
"configDirectories",
")",
"||",
"!",
"empty",
"(",
"$",
"this",
"->",
"resourceDirec... | Build directory cache, so we only do it once | [
"Build",
"directory",
"cache",
"so",
"we",
"only",
"do",
"it",
"once"
] | d96c4de469e58040968044d2d6525cb60d9dd8c6 | https://github.com/SlabPHP/bundle-stack/blob/d96c4de469e58040968044d2d6525cb60d9dd8c6/src/Cache/Directories.php#L52-L69 |
196,694 | spiral/console | src/Traits/HelpersTrait.php | HelpersTrait.sprintf | protected function sprintf(string $format, ...$args)
{
return $this->output->write(sprintf($format, ...$args), false);
} | php | protected function sprintf(string $format, ...$args)
{
return $this->output->write(sprintf($format, ...$args), false);
} | [
"protected",
"function",
"sprintf",
"(",
"string",
"$",
"format",
",",
"...",
"$",
"args",
")",
"{",
"return",
"$",
"this",
"->",
"output",
"->",
"write",
"(",
"sprintf",
"(",
"$",
"format",
",",
"...",
"$",
"args",
")",
",",
"false",
")",
";",
"}"... | Identical to write function but provides ability to format message. Does not add new line.
@param string $format
@param array ...$args | [
"Identical",
"to",
"write",
"function",
"but",
"provides",
"ability",
"to",
"format",
"message",
".",
"Does",
"not",
"add",
"new",
"line",
"."
] | c3d99450ddd32bcc6f87e2b2ed40821054a93da3 | https://github.com/spiral/console/blob/c3d99450ddd32bcc6f87e2b2ed40821054a93da3/src/Traits/HelpersTrait.php#L74-L77 |
196,695 | agentmedia/phine-core | src/Core/Snippets/BackendRights/ContainerRights.php | ContainerRights.Save | function Save()
{
$this->contentRights->Save();
if (!$this->rights)
{
$this->rights = new BackendContainerRights();
}
$this->rights->SetEdit($this->Value('Edit'));
$this->rights->SetRemove($this->Value('Remove'));
$this->rights->SetContentRights($t... | php | function Save()
{
$this->contentRights->Save();
if (!$this->rights)
{
$this->rights = new BackendContainerRights();
}
$this->rights->SetEdit($this->Value('Edit'));
$this->rights->SetRemove($this->Value('Remove'));
$this->rights->SetContentRights($t... | [
"function",
"Save",
"(",
")",
"{",
"$",
"this",
"->",
"contentRights",
"->",
"Save",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"rights",
")",
"{",
"$",
"this",
"->",
"rights",
"=",
"new",
"BackendContainerRights",
"(",
")",
";",
"}",
"$",
... | Saves the container rights | [
"Saves",
"the",
"container",
"rights"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Snippets/BackendRights/ContainerRights.php#L43-L54 |
196,696 | net-tools/core | src/Containers/Cache.php | Cache.unregister | public function unregister($k)
{
if ( array_key_exists($k, $this->_items) )
{
$item = $this->_items[$k];
unset($this->_items[$k]);
return $item;
}
else
return FALSE;
} | php | public function unregister($k)
{
if ( array_key_exists($k, $this->_items) )
{
$item = $this->_items[$k];
unset($this->_items[$k]);
return $item;
}
else
return FALSE;
} | [
"public",
"function",
"unregister",
"(",
"$",
"k",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"k",
",",
"$",
"this",
"->",
"_items",
")",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"_items",
"[",
"$",
"k",
"]",
";",
"unset",
"(",
"$... | Delete an item from cache
@param string $k Item key to remove
@return bool|mixed $item Returns the item removed or FALSE if item not found in cache | [
"Delete",
"an",
"item",
"from",
"cache"
] | 51446641cee22c0cf53d2b409c76cc8bd1a187e7 | https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Containers/Cache.php#L60-L70 |
196,697 | net-tools/core | src/Containers/Cache.php | Cache.get | public function get($k)
{
if ( array_key_exists($k, $this->_items) )
return $this->_items[$k];
else
return FALSE;
} | php | public function get($k)
{
if ( array_key_exists($k, $this->_items) )
return $this->_items[$k];
else
return FALSE;
} | [
"public",
"function",
"get",
"(",
"$",
"k",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"k",
",",
"$",
"this",
"->",
"_items",
")",
")",
"return",
"$",
"this",
"->",
"_items",
"[",
"$",
"k",
"]",
";",
"else",
"return",
"FALSE",
";",
"}"
] | Fetch an item from cache
@param string $k Item to fetch
@return bool|mixed $item Returns the item or FALSE if item not found in cache | [
"Fetch",
"an",
"item",
"from",
"cache"
] | 51446641cee22c0cf53d2b409c76cc8bd1a187e7 | https://github.com/net-tools/core/blob/51446641cee22c0cf53d2b409c76cc8bd1a187e7/src/Containers/Cache.php#L79-L85 |
196,698 | bartonlp/site-class | includes/SiteClass.class.php | SiteClass.counter2 | protected function counter2() {
if($this->nodb) {
return;
}
$this->query("select count(*) from information_schema.tables " .
"where (table_schema = '$this->masterdb') ".
"and (table_name = 'counter2')");
list($ok) = $this->fetchrow('num');
if($ok) {
i... | php | protected function counter2() {
if($this->nodb) {
return;
}
$this->query("select count(*) from information_schema.tables " .
"where (table_schema = '$this->masterdb') ".
"and (table_name = 'counter2')");
list($ok) = $this->fetchrow('num');
if($ok) {
i... | [
"protected",
"function",
"counter2",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"nodb",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"query",
"(",
"\"select count(*) from information_schema.tables \"",
".",
"\"where (table_schema = '$this->masterdb') \"",
".",... | counter2
count files accessed per day
WARNING this may be overriden is a child class | [
"counter2",
"count",
"files",
"accessed",
"per",
"day",
"WARNING",
"this",
"may",
"be",
"overriden",
"is",
"a",
"child",
"class"
] | 9095b101701ef0ae12ea9a2b4587a18072d04438 | https://github.com/bartonlp/site-class/blob/9095b101701ef0ae12ea9a2b4587a18072d04438/includes/SiteClass.class.php#L900-L934 |
196,699 | phpffcms/ffcms-core | src/Managers/MigrationsManager.php | MigrationsManager.makeUp | public function makeUp($file)
{
// check if argument is array of files and run recursion
if (Any::isArray($file)) {
$success = true;
foreach ($file as $single) {
$exec = $this->makeUp($single);
if (!$exec) {
$success = false... | php | public function makeUp($file)
{
// check if argument is array of files and run recursion
if (Any::isArray($file)) {
$success = true;
foreach ($file as $single) {
$exec = $this->makeUp($single);
if (!$exec) {
$success = false... | [
"public",
"function",
"makeUp",
"(",
"$",
"file",
")",
"{",
"// check if argument is array of files and run recursion",
"if",
"(",
"Any",
"::",
"isArray",
"(",
"$",
"file",
")",
")",
"{",
"$",
"success",
"=",
"true",
";",
"foreach",
"(",
"$",
"file",
"as",
... | Run migration up
@param string|array $file
@return bool | [
"Run",
"migration",
"up"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Managers/MigrationsManager.php#L91-L131 |
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.