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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
12,500 | vinala/kernel | src/Foundation/Bus.php | Bus.translator | private static function translator()
{
$files = ['Lang', 'Smiley'];
$folder = static::$root.'Translator'.'/';
self::call($files, $folder);
$files = ['LanguageKeyNotFoundException', 'LanguageNotSupportedException'];
$folder = static::$root.'Translator/Exceptions'.'/';
... | php | private static function translator()
{
$files = ['Lang', 'Smiley'];
$folder = static::$root.'Translator'.'/';
self::call($files, $folder);
$files = ['LanguageKeyNotFoundException', 'LanguageNotSupportedException'];
$folder = static::$root.'Translator/Exceptions'.'/';
... | [
"private",
"static",
"function",
"translator",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'Lang'",
",",
"'Smiley'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Translator'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"$",
"files",... | Call the Translator surface.
@return null | [
"Call",
"the",
"Translator",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L855-L866 |
12,501 | vinala/kernel | src/Foundation/Bus.php | Bus.model | private static function model()
{
$files = ['ORM_', 'CRUD', 'ORM', 'Collection', 'ModelArray'];
$folder = static::$root.'MVC/Model'.'/';
self::call($files, $folder);
$files = ['ForeingKeyMethodException', 'ColumnNotEmptyException', 'ManyPrimaryKeysException', 'TableNotFoundExceptio... | php | private static function model()
{
$files = ['ORM_', 'CRUD', 'ORM', 'Collection', 'ModelArray'];
$folder = static::$root.'MVC/Model'.'/';
self::call($files, $folder);
$files = ['ForeingKeyMethodException', 'ColumnNotEmptyException', 'ManyPrimaryKeysException', 'TableNotFoundExceptio... | [
"private",
"static",
"function",
"model",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'ORM_'",
",",
"'CRUD'",
",",
"'ORM'",
",",
"'Collection'",
",",
"'ModelArray'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'MVC/Model'",
".",
"'/'",... | Call the Model surface.
@return null | [
"Call",
"the",
"Model",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L873-L884 |
12,502 | vinala/kernel | src/Foundation/Bus.php | Bus.relations | private static function relations()
{
$files = ['OneToOne', 'OneToMany', 'ManyToMany', 'BelongsTo'];
$folder = static::$root.'MVC/Relations'.'/';
self::call($files, $folder);
$files = ['ManyRelationException', 'ModelNotFindedException'];
$folder = static::$root.'MVC/Relatio... | php | private static function relations()
{
$files = ['OneToOne', 'OneToMany', 'ManyToMany', 'BelongsTo'];
$folder = static::$root.'MVC/Relations'.'/';
self::call($files, $folder);
$files = ['ManyRelationException', 'ModelNotFindedException'];
$folder = static::$root.'MVC/Relatio... | [
"private",
"static",
"function",
"relations",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'OneToOne'",
",",
"'OneToMany'",
",",
"'ManyToMany'",
",",
"'BelongsTo'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'MVC/Relations'",
".",
"'/'",
... | Call the Realtons surface.
@return null | [
"Call",
"the",
"Realtons",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L891-L902 |
12,503 | vinala/kernel | src/Foundation/Bus.php | Bus.view | private static function view()
{
$files = ['View'];
$folder = static::$root.'MVC/View'.'/';
self::call($files, $folder);
$files = ['Template', 'Views'];
$folder = static::$root.'MVC/View/Libs'.'/';
self::call($files, $folder);
$files = ['ViewNotFoundExcept... | php | private static function view()
{
$files = ['View'];
$folder = static::$root.'MVC/View'.'/';
self::call($files, $folder);
$files = ['Template', 'Views'];
$folder = static::$root.'MVC/View/Libs'.'/';
self::call($files, $folder);
$files = ['ViewNotFoundExcept... | [
"private",
"static",
"function",
"view",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'View'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'MVC/View'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"$",
"files",
",",
"$",
"folder",
... | Call the View surface.
@return null | [
"Call",
"the",
"View",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L922-L938 |
12,504 | vinala/kernel | src/Foundation/Bus.php | Bus.mail | private static function mail()
{
$files = ['Mail', 'Mailable', 'SMTP'];
$folder = static::$root.'Mailing'.'/';
self::call($files, $folder);
$files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];
$folder = $folder.'Exceptions/';
self::call($files,... | php | private static function mail()
{
$files = ['Mail', 'Mailable', 'SMTP'];
$folder = static::$root.'Mailing'.'/';
self::call($files, $folder);
$files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];
$folder = $folder.'Exceptions/';
self::call($files,... | [
"private",
"static",
"function",
"mail",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'Mail'",
",",
"'Mailable'",
",",
"'SMTP'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Mailing'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"$"... | Call the Mail surface.
@return null | [
"Call",
"the",
"Mail",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L958-L969 |
12,505 | vinala/kernel | src/Foundation/Bus.php | Bus.file | private static function file()
{
$files = ['File', 'Filesystem'];
$folder = static::$root.'Filesystem'.'/';
self::call($files, $folder);
$files = ['FileNotFoundException', 'DirectoryNotFoundException'];
$folder = static::$root.'Filesystem/Exceptions'.'/';
self::cal... | php | private static function file()
{
$files = ['File', 'Filesystem'];
$folder = static::$root.'Filesystem'.'/';
self::call($files, $folder);
$files = ['FileNotFoundException', 'DirectoryNotFoundException'];
$folder = static::$root.'Filesystem/Exceptions'.'/';
self::cal... | [
"private",
"static",
"function",
"file",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'File'",
",",
"'Filesystem'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Filesystem'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"$",
"files",
... | Call the Files surface.
@return null | [
"Call",
"the",
"Files",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L989-L1000 |
12,506 | vinala/kernel | src/Foundation/Bus.php | Bus.plugins | private static function plugins()
{
$files = ['Plugins'];
$folder = static::$root.'Plugins'.'/';
self::call($files, $folder);
$files = ['AutoloadFileNotFoundException', 'InfoStructureException'];
$folder = static::$root.'Plugins/Exceptions'.'/';
self::call($files, ... | php | private static function plugins()
{
$files = ['Plugins'];
$folder = static::$root.'Plugins'.'/';
self::call($files, $folder);
$files = ['AutoloadFileNotFoundException', 'InfoStructureException'];
$folder = static::$root.'Plugins/Exceptions'.'/';
self::call($files, ... | [
"private",
"static",
"function",
"plugins",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'Plugins'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Plugins'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"$",
"files",
",",
"$",
"folder... | Call the Plugins surface.
@return null | [
"Call",
"the",
"Plugins",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L1020-L1031 |
12,507 | vinala/kernel | src/Foundation/Bus.php | Bus.lumos | private static function lumos()
{
$files = ['cmdOutput', 'bashOutput', 'Argument', 'Option', 'Commands'];
$folder = static::$root.'Lumos'.'/';
self::call($files, $folder);
// Call Kernel commands
static::commands();
$files = ['Console'];
$folder = static::$... | php | private static function lumos()
{
$files = ['cmdOutput', 'bashOutput', 'Argument', 'Option', 'Commands'];
$folder = static::$root.'Lumos'.'/';
self::call($files, $folder);
// Call Kernel commands
static::commands();
$files = ['Console'];
$folder = static::$... | [
"private",
"static",
"function",
"lumos",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'cmdOutput'",
",",
"'bashOutput'",
",",
"'Argument'",
",",
"'Option'",
",",
"'Commands'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Lumos'",
".",
... | Call the Lumos surface.
@return null | [
"Call",
"the",
"Lumos",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L1038-L1057 |
12,508 | vinala/kernel | src/Foundation/Bus.php | Bus.atomium | private static function atomium()
{
$path = static::$root.'Atomium/';
$files = ['Atomium', 'Compiler'];
$folder = $path;
self::call($files, $folder);
$files = [
'AtomiumUserTags',
//
'AtomiumCompileCSS', 'AtomiumC... | php | private static function atomium()
{
$path = static::$root.'Atomium/';
$files = ['Atomium', 'Compiler'];
$folder = $path;
self::call($files, $folder);
$files = [
'AtomiumUserTags',
//
'AtomiumCompileCSS', 'AtomiumC... | [
"private",
"static",
"function",
"atomium",
"(",
")",
"{",
"$",
"path",
"=",
"static",
"::",
"$",
"root",
".",
"'Atomium/'",
";",
"$",
"files",
"=",
"[",
"'Atomium'",
",",
"'Compiler'",
"]",
";",
"$",
"folder",
"=",
"$",
"path",
";",
"self",
"::",
... | Call the Atomium surface.
@return null | [
"Call",
"the",
"Atomium",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L1076-L1108 |
12,509 | vinala/kernel | src/Foundation/Bus.php | Bus.proccess | private static function proccess()
{
$files = ['Process', 'Command', 'Translator', 'Migrations', 'Links', 'Tag', 'Model', 'View', 'Controller', 'Seeds', 'Router', 'Exception', 'Events', 'Alias', 'Middleware', 'Helper', 'Tests', 'Mail', 'Query'];
$folder = static::$root.'Processes'.'/';
self... | php | private static function proccess()
{
$files = ['Process', 'Command', 'Translator', 'Migrations', 'Links', 'Tag', 'Model', 'View', 'Controller', 'Seeds', 'Router', 'Exception', 'Events', 'Alias', 'Middleware', 'Helper', 'Tests', 'Mail', 'Query'];
$folder = static::$root.'Processes'.'/';
self... | [
"private",
"static",
"function",
"proccess",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'Process'",
",",
"'Command'",
",",
"'Translator'",
",",
"'Migrations'",
",",
"'Links'",
",",
"'Tag'",
",",
"'Model'",
",",
"'View'",
",",
"'Controller'",
",",
"'Seeds'",
"... | Call the Process surface.
@return null | [
"Call",
"the",
"Process",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L1115-L1126 |
12,510 | vinala/kernel | src/Foundation/Bus.php | Bus.setup | private static function setup()
{
$files = ['Routes', 'Setup', 'Response'];
$folder = static::$root.'Setup'.'/';
self::call($files, $folder);
$files = ['Database', 'Panel', 'Security', 'Maintenance', 'Loggin', 'Translator', 'App', 'Robots'];
$folder = static::$root.'Setup/D... | php | private static function setup()
{
$files = ['Routes', 'Setup', 'Response'];
$folder = static::$root.'Setup'.'/';
self::call($files, $folder);
$files = ['Database', 'Panel', 'Security', 'Maintenance', 'Loggin', 'Translator', 'App', 'Robots'];
$folder = static::$root.'Setup/D... | [
"private",
"static",
"function",
"setup",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'Routes'",
",",
"'Setup'",
",",
"'Response'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Setup'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"... | Call the Setup surface.
@return null | [
"Call",
"the",
"Setup",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L1133-L1149 |
12,511 | vinala/kernel | src/Foundation/Bus.php | Bus.event | private static function event()
{
$files = ['Event', 'EventListener'];
$folder = static::$root.'Event'.'/';
self::call($files, $folder);
$files = ['ManyListenersArgumentsException'];
$folder = static::$root.'Event/Exceptions'.'/';
self::call($files, $folder);
} | php | private static function event()
{
$files = ['Event', 'EventListener'];
$folder = static::$root.'Event'.'/';
self::call($files, $folder);
$files = ['ManyListenersArgumentsException'];
$folder = static::$root.'Event/Exceptions'.'/';
self::call($files, $folder);
} | [
"private",
"static",
"function",
"event",
"(",
")",
"{",
"$",
"files",
"=",
"[",
"'Event'",
",",
"'EventListener'",
"]",
";",
"$",
"folder",
"=",
"static",
"::",
"$",
"root",
".",
"'Event'",
".",
"'/'",
";",
"self",
"::",
"call",
"(",
"$",
"files",
... | Call the Event surface.
@return null | [
"Call",
"the",
"Event",
"surface",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/Foundation/Bus.php#L1156-L1167 |
12,512 | 0x20h/phloppy | src/Client/Cluster.php | Cluster.meet | public function meet(array $nodeUrls)
{
$current = $this->stream->getNodeUrl();
return array_filter($nodeUrls, function($url) use ($current) {
if ($url === $current) {
return true;
}
$parts = parse_url($url);
try {
$r... | php | public function meet(array $nodeUrls)
{
$current = $this->stream->getNodeUrl();
return array_filter($nodeUrls, function($url) use ($current) {
if ($url === $current) {
return true;
}
$parts = parse_url($url);
try {
$r... | [
"public",
"function",
"meet",
"(",
"array",
"$",
"nodeUrls",
")",
"{",
"$",
"current",
"=",
"$",
"this",
"->",
"stream",
"->",
"getNodeUrl",
"(",
")",
";",
"return",
"array_filter",
"(",
"$",
"nodeUrls",
",",
"function",
"(",
"$",
"url",
")",
"use",
... | Introduce the provided nodes to the connected Disque instance.
@param string[] $nodeUrls
@return string[]
@see http://redis.io/commands/cluster-meet | [
"Introduce",
"the",
"provided",
"nodes",
"to",
"the",
"connected",
"Disque",
"instance",
"."
] | d917f0578360395899bd583724046d36ac459535 | https://github.com/0x20h/phloppy/blob/d917f0578360395899bd583724046d36ac459535/src/Client/Cluster.php#L24-L44 |
12,513 | CakeCMS/Community | src/Model/Table/UsersTable.php | UsersTable.save | public function save(EntityInterface $entity, $options = [])
{
EventManager::trigger('Model.User.beforeSave', $this, [
'user' => $entity
]);
$success = parent::save($entity, $options);
EventManager::trigger('Model.User.afterSave', $this, [
'user' => $enti... | php | public function save(EntityInterface $entity, $options = [])
{
EventManager::trigger('Model.User.beforeSave', $this, [
'user' => $entity
]);
$success = parent::save($entity, $options);
EventManager::trigger('Model.User.afterSave', $this, [
'user' => $enti... | [
"public",
"function",
"save",
"(",
"EntityInterface",
"$",
"entity",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"EventManager",
"::",
"trigger",
"(",
"'Model.User.beforeSave'",
",",
"$",
"this",
",",
"[",
"'user'",
"=>",
"$",
"entity",
"]",
")",
";",
... | Persists an entity based on the fields that are marked as dirty and
returns the same entity after a successful save or false in case
of any error.
@param \Cake\Datasource\EntityInterface $entity the entity to be saved
@param array|\ArrayAccess $options The options to use when saving.
@return \Cake\Datasource\Enti... | [
"Persists",
"an",
"entity",
"based",
"on",
"the",
"fields",
"that",
"are",
"marked",
"as",
"dirty",
"and",
"returns",
"the",
"same",
"entity",
"after",
"a",
"successful",
"save",
"or",
"false",
"in",
"case",
"of",
"any",
"error",
"."
] | cc2bdb596dd9617d42fd81f59e981024caa062e8 | https://github.com/CakeCMS/Community/blob/cc2bdb596dd9617d42fd81f59e981024caa062e8/src/Model/Table/UsersTable.php#L76-L90 |
12,514 | WellCommerce/DataSet | Context/FlatTreeContext.php | FlatTreeContext.makeTree | private function makeTree(array $result)
{
$tree = [];
foreach ($result as $row) {
$this->makeNode($row, $tree);
}
return $tree;
} | php | private function makeTree(array $result)
{
$tree = [];
foreach ($result as $row) {
$this->makeNode($row, $tree);
}
return $tree;
} | [
"private",
"function",
"makeTree",
"(",
"array",
"$",
"result",
")",
"{",
"$",
"tree",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"result",
"as",
"$",
"row",
")",
"{",
"$",
"this",
"->",
"makeNode",
"(",
"$",
"row",
",",
"$",
"tree",
")",
";",
"}... | Creates flat tree structure from result rows
@param array $result
@return array | [
"Creates",
"flat",
"tree",
"structure",
"from",
"result",
"rows"
] | 18720dc5416f245d22c502ceafce1a1b2db2b905 | https://github.com/WellCommerce/DataSet/blob/18720dc5416f245d22c502ceafce1a1b2db2b905/Context/FlatTreeContext.php#L45-L54 |
12,515 | WellCommerce/DataSet | Context/FlatTreeContext.php | FlatTreeContext.makeNode | private function makeNode(&$row, &$tree)
{
$hasChildren = $this->propertyAccessor->getValue($row, "[{$this->options['children_column']}]");
$weight = $this->propertyAccessor->getValue($row, "[{$this->options['hierarchy_column']}]");
$row['hasChildren'] = (bool)($hasChildren > 0);
... | php | private function makeNode(&$row, &$tree)
{
$hasChildren = $this->propertyAccessor->getValue($row, "[{$this->options['children_column']}]");
$weight = $this->propertyAccessor->getValue($row, "[{$this->options['hierarchy_column']}]");
$row['hasChildren'] = (bool)($hasChildren > 0);
... | [
"private",
"function",
"makeNode",
"(",
"&",
"$",
"row",
",",
"&",
"$",
"tree",
")",
"{",
"$",
"hasChildren",
"=",
"$",
"this",
"->",
"propertyAccessor",
"->",
"getValue",
"(",
"$",
"row",
",",
"\"[{$this->options['children_column']}]\"",
")",
";",
"$",
"w... | Converts single row to flat-tree node
@param array $row
@param array $tree | [
"Converts",
"single",
"row",
"to",
"flat",
"-",
"tree",
"node"
] | 18720dc5416f245d22c502ceafce1a1b2db2b905 | https://github.com/WellCommerce/DataSet/blob/18720dc5416f245d22c502ceafce1a1b2db2b905/Context/FlatTreeContext.php#L62-L70 |
12,516 | infinity-se/infinity-base | src/InfinityBase/EntityManager/EntityManagerAwareTrait.php | EntityManagerAwareTrait.getEntityManager | public function getEntityManager()
{
if (!isset($this->_entityManager)) {
$this->_entityManager = $this->getServiceLocator()
->get('Doctrine\ORM\EntityManager');
}
return $this->_entityManager;
} | php | public function getEntityManager()
{
if (!isset($this->_entityManager)) {
$this->_entityManager = $this->getServiceLocator()
->get('Doctrine\ORM\EntityManager');
}
return $this->_entityManager;
} | [
"public",
"function",
"getEntityManager",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_entityManager",
")",
")",
"{",
"$",
"this",
"->",
"_entityManager",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'D... | Get entity manager
@return EntityManager | [
"Get",
"entity",
"manager"
] | 4f869ae4b549e779560a83528d2ed2664f6deb5b | https://github.com/infinity-se/infinity-base/blob/4f869ae4b549e779560a83528d2ed2664f6deb5b/src/InfinityBase/EntityManager/EntityManagerAwareTrait.php#L23-L30 |
12,517 | morrelinko/simple-photo | src/SimplePhoto.php | SimplePhoto.collection | public function collection(array $ids, array $options = array())
{
$photos = $this->dataStore->getPhotos($ids);
if (empty($photos) && !$this->storageManager->hasFallback()) {
// If no fallback has been defined, and no photo was found
// lets just skip the computation that fo... | php | public function collection(array $ids, array $options = array())
{
$photos = $this->dataStore->getPhotos($ids);
if (empty($photos) && !$this->storageManager->hasFallback()) {
// If no fallback has been defined, and no photo was found
// lets just skip the computation that fo... | [
"public",
"function",
"collection",
"(",
"array",
"$",
"ids",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"photos",
"=",
"$",
"this",
"->",
"dataStore",
"->",
"getPhotos",
"(",
"$",
"ids",
")",
";",
"if",
"(",
"empty",
"(",... | Gets multiple photos
@param array $ids List of photo ids
@param array $options
@see SimplePhoto::build()
@return mixed|PhotoCollection | [
"Gets",
"multiple",
"photos"
] | be1fbe3139d32eb39e88cff93f847154bb6a8cb2 | https://github.com/morrelinko/simple-photo/blob/be1fbe3139d32eb39e88cff93f847154bb6a8cb2/src/SimplePhoto.php#L282-L315 |
12,518 | buybrain/nervus-php | src/Buybrain/Nervus/Util/Tcp.php | Tcp.dial | public static function dial($addr)
{
$socket = stream_socket_client('tcp://' . $addr);
if ($socket === false) {
throw new Exception('Could not dial to ' . $addr . ': ' . socket_strerror(socket_last_error()));
}
return $socket;
} | php | public static function dial($addr)
{
$socket = stream_socket_client('tcp://' . $addr);
if ($socket === false) {
throw new Exception('Could not dial to ' . $addr . ': ' . socket_strerror(socket_last_error()));
}
return $socket;
} | [
"public",
"static",
"function",
"dial",
"(",
"$",
"addr",
")",
"{",
"$",
"socket",
"=",
"stream_socket_client",
"(",
"'tcp://'",
".",
"$",
"addr",
")",
";",
"if",
"(",
"$",
"socket",
"===",
"false",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Could n... | Connect to a TCP address and return a stream resource
@param $addr string
@return resource | [
"Connect",
"to",
"a",
"TCP",
"address",
"and",
"return",
"a",
"stream",
"resource"
] | 96e00e30571b3ea4cf3494cd26c930ffa336c3bf | https://github.com/buybrain/nervus-php/blob/96e00e30571b3ea4cf3494cd26c930ffa336c3bf/src/Buybrain/Nervus/Util/Tcp.php#L17-L24 |
12,519 | cyberspectrum/i18n-xliff | src/WritableXliffDictionary.php | WritableXliffDictionary.markChanged | public function markChanged(): void
{
$this->changed = true;
$this->xliff->setDate(new \DateTime());
if (!$this->buffering) {
$this->xliff->save($this->filename);
}
} | php | public function markChanged(): void
{
$this->changed = true;
$this->xliff->setDate(new \DateTime());
if (!$this->buffering) {
$this->xliff->save($this->filename);
}
} | [
"public",
"function",
"markChanged",
"(",
")",
":",
"void",
"{",
"$",
"this",
"->",
"changed",
"=",
"true",
";",
"$",
"this",
"->",
"xliff",
"->",
"setDate",
"(",
"new",
"\\",
"DateTime",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"bu... | Mark the file as changed.
@return void
@internal Should only be called from Xliff dictionary classes. | [
"Mark",
"the",
"file",
"as",
"changed",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/WritableXliffDictionary.php#L169-L176 |
12,520 | cyberspectrum/i18n-xliff | src/WritableXliffDictionary.php | WritableXliffDictionary.setOriginal | public function setOriginal(string $source): void
{
$this->xliff->setOriginal($source);
$this->markChanged();
} | php | public function setOriginal(string $source): void
{
$this->xliff->setOriginal($source);
$this->markChanged();
} | [
"public",
"function",
"setOriginal",
"(",
"string",
"$",
"source",
")",
":",
"void",
"{",
"$",
"this",
"->",
"xliff",
"->",
"setOriginal",
"(",
"$",
"source",
")",
";",
"$",
"this",
"->",
"markChanged",
"(",
")",
";",
"}"
] | Set the original.
@param string $source The original.
@return void | [
"Set",
"the",
"original",
"."
] | 9d03f85a33c8f6fc9acd99770f23800679f130b3 | https://github.com/cyberspectrum/i18n-xliff/blob/9d03f85a33c8f6fc9acd99770f23800679f130b3/src/WritableXliffDictionary.php#L211-L215 |
12,521 | uthando-cms/uthando-common | src/UthandoCommon/Service/AbstractRelationalMapperService.php | AbstractRelationalMapperService.populate | public function populate($model, $children)
{
$allChildren = ($children === true) ? true : false;
$children = (is_array($children)) ? $children : [];
foreach ($this->getReferenceMap() as $name => $options) {
if ($allChildren || in_array($name, $children)) {
$ser... | php | public function populate($model, $children)
{
$allChildren = ($children === true) ? true : false;
$children = (is_array($children)) ? $children : [];
foreach ($this->getReferenceMap() as $name => $options) {
if ($allChildren || in_array($name, $children)) {
$ser... | [
"public",
"function",
"populate",
"(",
"$",
"model",
",",
"$",
"children",
")",
"{",
"$",
"allChildren",
"=",
"(",
"$",
"children",
"===",
"true",
")",
"?",
"true",
":",
"false",
";",
"$",
"children",
"=",
"(",
"is_array",
"(",
"$",
"children",
")",
... | populate relational records.
@param \UthandoCommon\Model\Model $model
@param bool|array $children
@return \UthandoCommon\Model\Model | [
"populate",
"relational",
"records",
"."
] | feb915da5d26b60f536282e1bc3ad5c22e53f485 | https://github.com/uthando-cms/uthando-common/blob/feb915da5d26b60f536282e1bc3ad5c22e53f485/src/UthandoCommon/Service/AbstractRelationalMapperService.php#L77-L106 |
12,522 | detailnet/dfw-bernard | src/Detail/Bernard/Message/Messenger.php | Messenger.encodeMessage | public function encodeMessage($message, $queue)
{
$messageFactory = $this->getMessageFactory();
if (!$this->messageFactory->accepts($message)) {
throw new Exception\RuntimeException(
sprintf(
'%s does not accept message of type "%s"',
... | php | public function encodeMessage($message, $queue)
{
$messageFactory = $this->getMessageFactory();
if (!$this->messageFactory->accepts($message)) {
throw new Exception\RuntimeException(
sprintf(
'%s does not accept message of type "%s"',
... | [
"public",
"function",
"encodeMessage",
"(",
"$",
"message",
",",
"$",
"queue",
")",
"{",
"$",
"messageFactory",
"=",
"$",
"this",
"->",
"getMessageFactory",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"messageFactory",
"->",
"accepts",
"(",
"$",
... | Encode message for Bernard.
@param mixed $message
@param string $queue
@throws Exception\RuntimeException
@return BernardDefaultMessage | [
"Encode",
"message",
"for",
"Bernard",
"."
] | 44fc049b4392095ba328fafb49012c136edb56c8 | https://github.com/detailnet/dfw-bernard/blob/44fc049b4392095ba328fafb49012c136edb56c8/src/Detail/Bernard/Message/Messenger.php#L133-L154 |
12,523 | detailnet/dfw-bernard | src/Detail/Bernard/Message/Messenger.php | Messenger.decodeMessage | public function decodeMessage(BernardMessage $message)
{
if (!isset($message->{self::MESSAGE_CLASS_KEY})) {
throw new Exception\RuntimeException(
sprintf('Message is missing key "%s"', self::MESSAGE_CLASS_KEY)
);
}
if (!is_string($message->{self::MESS... | php | public function decodeMessage(BernardMessage $message)
{
if (!isset($message->{self::MESSAGE_CLASS_KEY})) {
throw new Exception\RuntimeException(
sprintf('Message is missing key "%s"', self::MESSAGE_CLASS_KEY)
);
}
if (!is_string($message->{self::MESS... | [
"public",
"function",
"decodeMessage",
"(",
"BernardMessage",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"message",
"->",
"{",
"self",
"::",
"MESSAGE_CLASS_KEY",
"}",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"RuntimeException",
"... | Decode message from Bernard.
@param BernardMessage $message
@return mixed
@throws Exception\RuntimeException | [
"Decode",
"message",
"from",
"Bernard",
"."
] | 44fc049b4392095ba328fafb49012c136edb56c8 | https://github.com/detailnet/dfw-bernard/blob/44fc049b4392095ba328fafb49012c136edb56c8/src/Detail/Bernard/Message/Messenger.php#L163-L193 |
12,524 | dmitrymomot/slim-mvc | src/Controller.php | Controller.param | public function param($key = NULL, $default = NULL)
{
$params = $this->app->router->getCurrentRoute()->getParams();
return (array_key_exists($key, $params))
? $params[$key]
: $default;
} | php | public function param($key = NULL, $default = NULL)
{
$params = $this->app->router->getCurrentRoute()->getParams();
return (array_key_exists($key, $params))
? $params[$key]
: $default;
} | [
"public",
"function",
"param",
"(",
"$",
"key",
"=",
"NULL",
",",
"$",
"default",
"=",
"NULL",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"app",
"->",
"router",
"->",
"getCurrentRoute",
"(",
")",
"->",
"getParams",
"(",
")",
";",
"return",
"(... | Gets route params
@param string $key
@param string $default
@return string | [
"Gets",
"route",
"params"
] | 432f694bc7263204e09a1261177d5df84353a8af | https://github.com/dmitrymomot/slim-mvc/blob/432f694bc7263204e09a1261177d5df84353a8af/src/Controller.php#L79-L86 |
12,525 | znframework/package-image | ImageTypeCreator.php | ImageTypeCreator.create | public static function create($files, $path, $quality = 0)
{
switch( self::getFileExtension($path) )
{
case 'png' :
if( $quality > 10 )
{
$quality = (int) ($quality / 10);
}
return imagepng($files, $path... | php | public static function create($files, $path, $quality = 0)
{
switch( self::getFileExtension($path) )
{
case 'png' :
if( $quality > 10 )
{
$quality = (int) ($quality / 10);
}
return imagepng($files, $path... | [
"public",
"static",
"function",
"create",
"(",
"$",
"files",
",",
"$",
"path",
",",
"$",
"quality",
"=",
"0",
")",
"{",
"switch",
"(",
"self",
"::",
"getFileExtension",
"(",
"$",
"path",
")",
")",
"{",
"case",
"'png'",
":",
"if",
"(",
"$",
"quality... | Image type creator
@param resources $files
@param string $path
@param int $quality = 0
@return bool | [
"Image",
"type",
"creator"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/ImageTypeCreator.php#L25-L40 |
12,526 | znframework/package-image | ImageTypeCreator.php | ImageTypeCreator.from | public static function from($path)
{
switch( self::getFileExtension($path) )
{
case 'png' : return imagecreatefrompng($path);
case 'gif' : return imagecreatefromgif($path);
case 'jpg' :
case 'jpeg':
default : return imagecreatefromjpeg($... | php | public static function from($path)
{
switch( self::getFileExtension($path) )
{
case 'png' : return imagecreatefrompng($path);
case 'gif' : return imagecreatefromgif($path);
case 'jpg' :
case 'jpeg':
default : return imagecreatefromjpeg($... | [
"public",
"static",
"function",
"from",
"(",
"$",
"path",
")",
"{",
"switch",
"(",
"self",
"::",
"getFileExtension",
"(",
"$",
"path",
")",
")",
"{",
"case",
"'png'",
":",
"return",
"imagecreatefrompng",
"(",
"$",
"path",
")",
";",
"case",
"'gif'",
":"... | Image create from | [
"Image",
"create",
"from"
] | a4eee7468e2c8b9334b121bd358ab8acbccf11a2 | https://github.com/znframework/package-image/blob/a4eee7468e2c8b9334b121bd358ab8acbccf11a2/ImageTypeCreator.php#L45-L55 |
12,527 | keeko/api-app | src/ApiApplication.php | ApiApplication.postProcessing | private function postProcessing(JsonResponse $response) {
$apiUrl = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences()->getApiUrl();
$response->setContent(str_replace('%apiurl%', $apiUrl, $response->getContent()));
return $response;
} | php | private function postProcessing(JsonResponse $response) {
$apiUrl = $this->getServiceContainer()->getPreferenceLoader()->getSystemPreferences()->getApiUrl();
$response->setContent(str_replace('%apiurl%', $apiUrl, $response->getContent()));
return $response;
} | [
"private",
"function",
"postProcessing",
"(",
"JsonResponse",
"$",
"response",
")",
"{",
"$",
"apiUrl",
"=",
"$",
"this",
"->",
"getServiceContainer",
"(",
")",
"->",
"getPreferenceLoader",
"(",
")",
"->",
"getSystemPreferences",
"(",
")",
"->",
"getApiUrl",
"... | Some post processing on the generated result. Replacing some variables.
@param JsonResponse $response
@return JsonResponse | [
"Some",
"post",
"processing",
"on",
"the",
"generated",
"result",
".",
"Replacing",
"some",
"variables",
"."
] | 245f9e64777005518894c5ec93a7f9ce9ab28bfb | https://github.com/keeko/api-app/blob/245f9e64777005518894c5ec93a7f9ce9ab28bfb/src/ApiApplication.php#L92-L96 |
12,528 | rseyferth/activerecord | lib/Config.php | Config.setConnections | public function setConnections($connections, $defaultConnection=null)
{
if (!is_array($connections)) {
throw new ConfigException("Connections must be an array");
}
if ($defaultConnection) {
$this->setDefaultConnection($defaultConnection);
}
// Store it!
$this->_connections = $connections;
} | php | public function setConnections($connections, $defaultConnection=null)
{
if (!is_array($connections)) {
throw new ConfigException("Connections must be an array");
}
if ($defaultConnection) {
$this->setDefaultConnection($defaultConnection);
}
// Store it!
$this->_connections = $connections;
} | [
"public",
"function",
"setConnections",
"(",
"$",
"connections",
",",
"$",
"defaultConnection",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"connections",
")",
")",
"{",
"throw",
"new",
"ConfigException",
"(",
"\"Connections must be an array\"",... | Sets the list of database connection strings.
<code>
$config->setConnections(array(
'development' => 'mysql://username:[email protected]/database_name'));
</code>
@param array Array of connections
@param string Optionally specify the default_connection
@return void
@throws ActiveRecord\ConfigException | [
"Sets",
"the",
"list",
"of",
"database",
"connection",
"strings",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Config.php#L125-L138 |
12,529 | rseyferth/activerecord | lib/Config.php | Config.getConnection | public function getConnection($name)
{
if (array_key_exists($name, $this->_connections))
return $this->_connections[$name];
return null;
} | php | public function getConnection($name)
{
if (array_key_exists($name, $this->_connections))
return $this->_connections[$name];
return null;
} | [
"public",
"function",
"getConnection",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"_connections",
")",
")",
"return",
"$",
"this",
"->",
"_connections",
"[",
"$",
"name",
"]",
";",
"return",
"nu... | Returns a connection string if found otherwise null.
@param string $name Name of connection to retrieve
@return string connection info for specified connection name | [
"Returns",
"a",
"connection",
"string",
"if",
"found",
"otherwise",
"null",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Config.php#L156-L162 |
12,530 | rseyferth/activerecord | lib/Config.php | Config.getDefaultConnectionString | public function getDefaultConnectionString()
{
return array_key_exists($this->_defaultConnection, $this->_connections) ?
$this->_connections[$this->_defaultConnection] : null;
} | php | public function getDefaultConnectionString()
{
return array_key_exists($this->_defaultConnection, $this->_connections) ?
$this->_connections[$this->_defaultConnection] : null;
} | [
"public",
"function",
"getDefaultConnectionString",
"(",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"this",
"->",
"_defaultConnection",
",",
"$",
"this",
"->",
"_connections",
")",
"?",
"$",
"this",
"->",
"_connections",
"[",
"$",
"this",
"->",
"_defaul... | Returns the default connection string or null if there is none.
@return string | [
"Returns",
"the",
"default",
"connection",
"string",
"or",
"null",
"if",
"there",
"is",
"none",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Config.php#L169-L173 |
12,531 | rseyferth/activerecord | lib/Config.php | Config.getModelDirectory | public function getModelDirectory()
{
if ($this->_modelDirectory && !file_exists($this->_modelDirectory))
throw new ConfigException('Invalid or non-existent directory: '.$this->_modelDirectory);
return $this->_modelDirectory;
} | php | public function getModelDirectory()
{
if ($this->_modelDirectory && !file_exists($this->_modelDirectory))
throw new ConfigException('Invalid or non-existent directory: '.$this->_modelDirectory);
return $this->_modelDirectory;
} | [
"public",
"function",
"getModelDirectory",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"_modelDirectory",
"&&",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"_modelDirectory",
")",
")",
"throw",
"new",
"ConfigException",
"(",
"'Invalid or non-existent directory: '... | Returns the model directory.
@return string
@throws ConfigException if specified directory was not found | [
"Returns",
"the",
"model",
"directory",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Config.php#L213-L219 |
12,532 | wpplex/wp-mvc | Admin/Controller.php | Controller.add_menu | public function add_menu() {
if ( !isset( $this->page_id ) && !isset( $this->title ) && !isset( $this->name ) && !isset( $this->parent ) && !isset( $this->cap ) ) {
return;
}
if ( $this->parent ) {
$this->screen_name = add_submenu_page( $this->parent, $this->title, $this->name, $this->cap, $this->page_id,... | php | public function add_menu() {
if ( !isset( $this->page_id ) && !isset( $this->title ) && !isset( $this->name ) && !isset( $this->parent ) && !isset( $this->cap ) ) {
return;
}
if ( $this->parent ) {
$this->screen_name = add_submenu_page( $this->parent, $this->title, $this->name, $this->cap, $this->page_id,... | [
"public",
"function",
"add_menu",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"page_id",
")",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"title",
")",
"&&",
"!",
"isset",
"(",
"$",
"this",
"->",
"name",
")",
"&&",
"!",
"iss... | Add the Admin PAge to the WordPress Menu
@return void | [
"Add",
"the",
"Admin",
"PAge",
"to",
"the",
"WordPress",
"Menu"
] | 9778379d42f949462e76d969fb45ec37fc789a75 | https://github.com/wpplex/wp-mvc/blob/9778379d42f949462e76d969fb45ec37fc789a75/Admin/Controller.php#L95-L105 |
12,533 | wpplex/wp-mvc | Admin/Controller.php | Controller.validate_screen | public function validate_screen() {
$screen = get_current_screen();
if ( $screen->id === $this->screen_name ) {
// Load the Page resources
add_action( 'admin_print_scripts', array( &$this, 'load_scripts' ) );
add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
// WordPress Contextual He... | php | public function validate_screen() {
$screen = get_current_screen();
if ( $screen->id === $this->screen_name ) {
// Load the Page resources
add_action( 'admin_print_scripts', array( &$this, 'load_scripts' ) );
add_action( 'admin_print_styles', array( &$this, 'load_styles' ) );
// WordPress Contextual He... | [
"public",
"function",
"validate_screen",
"(",
")",
"{",
"$",
"screen",
"=",
"get_current_screen",
"(",
")",
";",
"if",
"(",
"$",
"screen",
"->",
"id",
"===",
"$",
"this",
"->",
"screen_name",
")",
"{",
"// Load the Page resources",
"add_action",
"(",
"'admin... | Verify that we are on the correct screen
@return void | [
"Verify",
"that",
"we",
"are",
"on",
"the",
"correct",
"screen"
] | 9778379d42f949462e76d969fb45ec37fc789a75 | https://github.com/wpplex/wp-mvc/blob/9778379d42f949462e76d969fb45ec37fc789a75/Admin/Controller.php#L112-L142 |
12,534 | octris/db | libs/Db/Type/DataObject.php | DataObject.merge | public function merge(array $data)
{
if (array_key_exists('_id', $data)) {
throw new \Exception('Property "_id" is read-only');
} else {
$this->import($data);
parent::merge($data);
}
} | php | public function merge(array $data)
{
if (array_key_exists('_id', $data)) {
throw new \Exception('Property "_id" is read-only');
} else {
$this->import($data);
parent::merge($data);
}
} | [
"public",
"function",
"merge",
"(",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'_id'",
",",
"$",
"data",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Property \"_id\" is read-only'",
")",
";",
"}",
"else",
"{",
"$",
... | Merge specified data into dataobject. Note, that the method will throw an exception, if the data to
merge contains a new object ID.
@param array $data Data to merge. | [
"Merge",
"specified",
"data",
"into",
"dataobject",
".",
"Note",
"that",
"the",
"method",
"will",
"throw",
"an",
"exception",
"if",
"the",
"data",
"to",
"merge",
"contains",
"a",
"new",
"object",
"ID",
"."
] | d34d143ea057e3912c7d4113662ebdb8dfd061c7 | https://github.com/octris/db/blob/d34d143ea057e3912c7d4113662ebdb8dfd061c7/libs/Db/Type/DataObject.php#L85-L94 |
12,535 | octris/db | libs/Db/Type/DataObject.php | DataObject.save | public function save($new_key = null)
{
$return = true;
$cn = $this->device->getConnection(\Octris\Db::DB_MASTER);
$cl = $cn->getCollection($this->collection);
if (is_null($this->_id) || (!is_null($new_key) && $this->_id !== $new_key)) {
// insert new object
... | php | public function save($new_key = null)
{
$return = true;
$cn = $this->device->getConnection(\Octris\Db::DB_MASTER);
$cl = $cn->getCollection($this->collection);
if (is_null($this->_id) || (!is_null($new_key) && $this->_id !== $new_key)) {
// insert new object
... | [
"public",
"function",
"save",
"(",
"$",
"new_key",
"=",
"null",
")",
"{",
"$",
"return",
"=",
"true",
";",
"$",
"cn",
"=",
"$",
"this",
"->",
"device",
"->",
"getConnection",
"(",
"\\",
"Octris",
"\\",
"Db",
"::",
"DB_MASTER",
")",
";",
"$",
"cl",
... | Save dataobject to bucket.
@param string $new_key Force inserting with the specified key. The method will fall back to an update,
if the specified key and the object internal key are identically.
@return bool Returns true on success otherwise false. | [
"Save",
"dataobject",
"to",
"bucket",
"."
] | d34d143ea057e3912c7d4113662ebdb8dfd061c7 | https://github.com/octris/db/blob/d34d143ea057e3912c7d4113662ebdb8dfd061c7/libs/Db/Type/DataObject.php#L103-L123 |
12,536 | octris/db | libs/Db/Type/DataObject.php | DataObject.export | protected function export(array &$data)
{
array_walk_recursive($data, function (&$value, $name) {
$value = $this->castPhpToDb($value, $name);
});
} | php | protected function export(array &$data)
{
array_walk_recursive($data, function (&$value, $name) {
$value = $this->castPhpToDb($value, $name);
});
} | [
"protected",
"function",
"export",
"(",
"array",
"&",
"$",
"data",
")",
"{",
"array_walk_recursive",
"(",
"$",
"data",
",",
"function",
"(",
"&",
"$",
"value",
",",
"$",
"name",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"castPhpToDb",
"(",
"$",... | Recursive data iteration and casting for preparing data for export to database.
@param array $data Data to process. | [
"Recursive",
"data",
"iteration",
"and",
"casting",
"for",
"preparing",
"data",
"for",
"export",
"to",
"database",
"."
] | d34d143ea057e3912c7d4113662ebdb8dfd061c7 | https://github.com/octris/db/blob/d34d143ea057e3912c7d4113662ebdb8dfd061c7/libs/Db/Type/DataObject.php#L196-L201 |
12,537 | octris/db | libs/Db/Type/DataObject.php | DataObject.import | protected function import(array &$data)
{
array_walk_recursive($data, function (&$value, $name) {
$value = $this->castDbToPhp($value, $name);
});
} | php | protected function import(array &$data)
{
array_walk_recursive($data, function (&$value, $name) {
$value = $this->castDbToPhp($value, $name);
});
} | [
"protected",
"function",
"import",
"(",
"array",
"&",
"$",
"data",
")",
"{",
"array_walk_recursive",
"(",
"$",
"data",
",",
"function",
"(",
"&",
"$",
"value",
",",
"$",
"name",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"castDbToPhp",
"(",
"$",... | Recursive data iteration and casting for preparing data for import into dataobject.
@param array $data Data to process. | [
"Recursive",
"data",
"iteration",
"and",
"casting",
"for",
"preparing",
"data",
"for",
"import",
"into",
"dataobject",
"."
] | d34d143ea057e3912c7d4113662ebdb8dfd061c7 | https://github.com/octris/db/blob/d34d143ea057e3912c7d4113662ebdb8dfd061c7/libs/Db/Type/DataObject.php#L208-L213 |
12,538 | felixarntz/config | src/ConfigAwareTrait.php | ConfigAwareTrait.setConfig | protected function setConfig(Config $config, ConfigSchema $schema = null)
{
if ($schema) {
$schema->validate($config);
}
$config->validate();
$this->config = $config;
} | php | protected function setConfig(Config $config, ConfigSchema $schema = null)
{
if ($schema) {
$schema->validate($config);
}
$config->validate();
$this->config = $config;
} | [
"protected",
"function",
"setConfig",
"(",
"Config",
"$",
"config",
",",
"ConfigSchema",
"$",
"schema",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"schema",
")",
"{",
"$",
"schema",
"->",
"validate",
"(",
"$",
"config",
")",
";",
"}",
"$",
"config",
"->"... | Validates and sets the configuration object.
@since 1.0.0
@param Config $config Configuration object.
@param ConfigSchema|null $schema Optional. Extra configuration schema to validate the configuration object
against. Default null.
@throws ConfigValidationException Thrown when validation fails. | [
"Validates",
"and",
"sets",
"the",
"configuration",
"object",
"."
] | 7e4d6041927974800f850336a51e5dad11b4bdd8 | https://github.com/felixarntz/config/blob/7e4d6041927974800f850336a51e5dad11b4bdd8/src/ConfigAwareTrait.php#L42-L51 |
12,539 | tweedegolf/generator | src/TweedeGolf/Generator/Action/TemplateAction.php | TemplateAction.getTemplateContent | public function getTemplateContent($template, array $variables)
{
$dir = dirname($template);
$file = basename($template);
$twig = new \Twig_Environment(new \Twig_Loader_Filesystem(array($dir)), array(
'debug' => true,
'cache' => false,
... | php | public function getTemplateContent($template, array $variables)
{
$dir = dirname($template);
$file = basename($template);
$twig = new \Twig_Environment(new \Twig_Loader_Filesystem(array($dir)), array(
'debug' => true,
'cache' => false,
... | [
"public",
"function",
"getTemplateContent",
"(",
"$",
"template",
",",
"array",
"$",
"variables",
")",
"{",
"$",
"dir",
"=",
"dirname",
"(",
"$",
"template",
")",
";",
"$",
"file",
"=",
"basename",
"(",
"$",
"template",
")",
";",
"$",
"twig",
"=",
"n... | Return the rendered content of a template.
@param string $template
@param array $variables
@return string | [
"Return",
"the",
"rendered",
"content",
"of",
"a",
"template",
"."
] | f931d659ddf6a531ebf00bbfc11d417c527cd21b | https://github.com/tweedegolf/generator/blob/f931d659ddf6a531ebf00bbfc11d417c527cd21b/src/TweedeGolf/Generator/Action/TemplateAction.php#L51-L63 |
12,540 | anonymous-php/containers | src/NestedContainer.php | NestedContainer.setHasCache | protected function setHasCache($id, $value)
{
if (!$this->useHasCache) {
return true;
}
unset($this->hasCache[$id]);
$this->hasCache[$id] = $value;
if (count($this->hasCache) > $this->hasCacheLength) {
$this->hasCache = array_slice($this->hasCache, -... | php | protected function setHasCache($id, $value)
{
if (!$this->useHasCache) {
return true;
}
unset($this->hasCache[$id]);
$this->hasCache[$id] = $value;
if (count($this->hasCache) > $this->hasCacheLength) {
$this->hasCache = array_slice($this->hasCache, -... | [
"protected",
"function",
"setHasCache",
"(",
"$",
"id",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"useHasCache",
")",
"{",
"return",
"true",
";",
"}",
"unset",
"(",
"$",
"this",
"->",
"hasCache",
"[",
"$",
"id",
"]",
")",
";... | Stores index of the container to the cache
@param $id
@param $value
@return bool | [
"Stores",
"index",
"of",
"the",
"container",
"to",
"the",
"cache"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/NestedContainer.php#L130-L144 |
12,541 | anonymous-php/containers | src/NestedContainer.php | NestedContainer.getHasCache | protected function getHasCache($id)
{
return $this->useHasCache && array_key_exists($id, $this->hasCache)
? $this->hasCache[$id]
: false;
} | php | protected function getHasCache($id)
{
return $this->useHasCache && array_key_exists($id, $this->hasCache)
? $this->hasCache[$id]
: false;
} | [
"protected",
"function",
"getHasCache",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"useHasCache",
"&&",
"array_key_exists",
"(",
"$",
"id",
",",
"$",
"this",
"->",
"hasCache",
")",
"?",
"$",
"this",
"->",
"hasCache",
"[",
"$",
"id",
"]",
... | Gets index of the container from the cache
@param $id
@return bool|mixed | [
"Gets",
"index",
"of",
"the",
"container",
"from",
"the",
"cache"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/NestedContainer.php#L151-L156 |
12,542 | anonymous-php/containers | src/NestedContainer.php | NestedContainer.add | public function add(ContainerInterface $container, $name = null)
{
if ($name !== null) {
$this->containers[$name] = $container;
} else {
array_push($this->containers, $container);
}
} | php | public function add(ContainerInterface $container, $name = null)
{
if ($name !== null) {
$this->containers[$name] = $container;
} else {
array_push($this->containers, $container);
}
} | [
"public",
"function",
"add",
"(",
"ContainerInterface",
"$",
"container",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"containers",
"[",
"$",
"name",
"]",
"=",
"$",
"container",
";",
... | Adds container to the collection
@param ContainerInterface $container
@param string $name | [
"Adds",
"container",
"to",
"the",
"collection"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/NestedContainer.php#L163-L170 |
12,543 | anonymous-php/containers | src/NestedContainer.php | NestedContainer.addPrepend | public function addPrepend(ContainerInterface $container, $name = null)
{
if ($name !== null) {
unset($this->containers[$name]);
$this->containers = array_merge([$name => $container], $this->containers);
} else {
array_unshift($this->containers, $container);
... | php | public function addPrepend(ContainerInterface $container, $name = null)
{
if ($name !== null) {
unset($this->containers[$name]);
$this->containers = array_merge([$name => $container], $this->containers);
} else {
array_unshift($this->containers, $container);
... | [
"public",
"function",
"addPrepend",
"(",
"ContainerInterface",
"$",
"container",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"name",
"!==",
"null",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"containers",
"[",
"$",
"name",
"]",
")",
";",... | Adds container to the beginning of the collection
@param ContainerInterface $container
@param string $name | [
"Adds",
"container",
"to",
"the",
"beginning",
"of",
"the",
"collection"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/NestedContainer.php#L187-L195 |
12,544 | anonymous-php/containers | src/NestedContainer.php | NestedContainer.getContainer | public function getContainer($name)
{
if (!array_key_exists($name, $this->containers)) {
throw new ContainerNotFoundException("No container with name '{$name}' found");
}
return $this->containers[$name];
} | php | public function getContainer($name)
{
if (!array_key_exists($name, $this->containers)) {
throw new ContainerNotFoundException("No container with name '{$name}' found");
}
return $this->containers[$name];
} | [
"public",
"function",
"getContainer",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"containers",
")",
")",
"{",
"throw",
"new",
"ContainerNotFoundException",
"(",
"\"No container with name '{$name}' fo... | Gets named container
@param $name
@return ContainerInterface
@throws ContainerNotFoundException | [
"Gets",
"named",
"container"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/NestedContainer.php#L203-L210 |
12,545 | anonymous-php/containers | src/NestedContainer.php | NestedContainer.setUseHasCache | public function setUseHasCache($useHasCache = true, $hasCacheLength = null)
{
$this->useHasCache = (bool)$useHasCache;
if ($hasCacheLength !== null) {
$this->hasCacheLength = (int)$hasCacheLength;
}
return $this;
} | php | public function setUseHasCache($useHasCache = true, $hasCacheLength = null)
{
$this->useHasCache = (bool)$useHasCache;
if ($hasCacheLength !== null) {
$this->hasCacheLength = (int)$hasCacheLength;
}
return $this;
} | [
"public",
"function",
"setUseHasCache",
"(",
"$",
"useHasCache",
"=",
"true",
",",
"$",
"hasCacheLength",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"useHasCache",
"=",
"(",
"bool",
")",
"$",
"useHasCache",
";",
"if",
"(",
"$",
"hasCacheLength",
"!==",
"n... | Sets the property useHasCache and size of cache
@param bool $useHasCache
@param null $hasCacheLength
@return $this | [
"Sets",
"the",
"property",
"useHasCache",
"and",
"size",
"of",
"cache"
] | c16275f05f14d188cf4d3043e7f037aea40aa7ba | https://github.com/anonymous-php/containers/blob/c16275f05f14d188cf4d3043e7f037aea40aa7ba/src/NestedContainer.php#L218-L227 |
12,546 | cyruscollier/phpspec-php-mock | src/Runner/Maintainer/FunctionCollaboratorMaintainer.php | FunctionCollaboratorMaintainer.teardown | public function teardown(
ExampleNode $example,
Specification $context,
MatcherManager $matchers,
CollaboratorManager $collaborators
) {
if (!isset($this->collaborator)) return false;
$this->collaborator->checkProphetPredictions();
return true;
} | php | public function teardown(
ExampleNode $example,
Specification $context,
MatcherManager $matchers,
CollaboratorManager $collaborators
) {
if (!isset($this->collaborator)) return false;
$this->collaborator->checkProphetPredictions();
return true;
} | [
"public",
"function",
"teardown",
"(",
"ExampleNode",
"$",
"example",
",",
"Specification",
"$",
"context",
",",
"MatcherManager",
"$",
"matchers",
",",
"CollaboratorManager",
"$",
"collaborators",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"... | Adds call to unmock all registered mocked functions
{@inheritDoc}
@see \PhpSpec\Runner\Maintainer\CollaboratorsMaintainer::teardown() | [
"Adds",
"call",
"to",
"unmock",
"all",
"registered",
"mocked",
"functions"
] | 30668b7dcaa6163c2f1277af50fafd96e7f20a25 | https://github.com/cyruscollier/phpspec-php-mock/blob/30668b7dcaa6163c2f1277af50fafd96e7f20a25/src/Runner/Maintainer/FunctionCollaboratorMaintainer.php#L62-L71 |
12,547 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Service/ProductOrderItemService.php | ProductOrderItemService.findAll | public function findAll($page = 1, $max = 50)
{
$offset = (($page - 1) * $max);
$productOrderItems = $this->productOrderItemRepository->findBy(array(), array(), $max, $offset);
return $productOrderItems;
} | php | public function findAll($page = 1, $max = 50)
{
$offset = (($page - 1) * $max);
$productOrderItems = $this->productOrderItemRepository->findBy(array(), array(), $max, $offset);
return $productOrderItems;
} | [
"public",
"function",
"findAll",
"(",
"$",
"page",
"=",
"1",
",",
"$",
"max",
"=",
"50",
")",
"{",
"$",
"offset",
"=",
"(",
"(",
"$",
"page",
"-",
"1",
")",
"*",
"$",
"max",
")",
";",
"$",
"productOrderItems",
"=",
"$",
"this",
"->",
"productOr... | Find al ProductOrderItems with pagination options.
@param integer $page [description]
@param integer $max [description]
@return ArrayCollection ProductOrderItems. | [
"Find",
"al",
"ProductOrderItems",
"with",
"pagination",
"options",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Service/ProductOrderItemService.php#L35-L40 |
12,548 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Service/ProductOrderItemService.php | ProductOrderItemService.create | public function create(ProductOrderItem $productOrderItem)
{
$this->getEm()->persist($productOrderItem);
$this->getEm()->flush();
return $productOrderItem;
} | php | public function create(ProductOrderItem $productOrderItem)
{
$this->getEm()->persist($productOrderItem);
$this->getEm()->flush();
return $productOrderItem;
} | [
"public",
"function",
"create",
"(",
"ProductOrderItem",
"$",
"productOrderItem",
")",
"{",
"$",
"this",
"->",
"getEm",
"(",
")",
"->",
"persist",
"(",
"$",
"productOrderItem",
")",
";",
"$",
"this",
"->",
"getEm",
"(",
")",
"->",
"flush",
"(",
")",
";... | Create a new ProductOrderItem.
@param ProductOrderItem $productOrderItem the productOrderItem instance.
@return ProductOrderItem the productOrderItem instance. | [
"Create",
"a",
"new",
"ProductOrderItem",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Service/ProductOrderItemService.php#L57-L63 |
12,549 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Service/ProductOrderItemService.php | ProductOrderItemService.save | public function save(ProductOrderItem $productOrderItem)
{
if (!$productOrderItem->getId()) {
$this->getEm()->persist($productOrderItem);
}
$this->getEm()->flush();
return $productOrderItem;
} | php | public function save(ProductOrderItem $productOrderItem)
{
if (!$productOrderItem->getId()) {
$this->getEm()->persist($productOrderItem);
}
$this->getEm()->flush();
return $productOrderItem;
} | [
"public",
"function",
"save",
"(",
"ProductOrderItem",
"$",
"productOrderItem",
")",
"{",
"if",
"(",
"!",
"$",
"productOrderItem",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getEm",
"(",
")",
"->",
"persist",
"(",
"$",
"productOrderItem",
")"... | Save or update ProductOrderItem.
@param ProductOrderItem $productOrderItem the productOrderItem instance.
@return ProductOrderItem the productOrderItem instance. | [
"Save",
"or",
"update",
"ProductOrderItem",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Service/ProductOrderItemService.php#L70-L78 |
12,550 | flowcode/AmulenShopBundle | src/Flowcode/ShopBundle/Service/ProductOrderItemService.php | ProductOrderItemService.delete | public function delete(ProductOrderItem $productOrderItem)
{
$this->getEm()->remove($productOrderItem);
$this->getEm()->flush();
} | php | public function delete(ProductOrderItem $productOrderItem)
{
$this->getEm()->remove($productOrderItem);
$this->getEm()->flush();
} | [
"public",
"function",
"delete",
"(",
"ProductOrderItem",
"$",
"productOrderItem",
")",
"{",
"$",
"this",
"->",
"getEm",
"(",
")",
"->",
"remove",
"(",
"$",
"productOrderItem",
")",
";",
"$",
"this",
"->",
"getEm",
"(",
")",
"->",
"flush",
"(",
")",
";"... | Delete an ProductOrderItem.
@param ProductOrderItem $productOrderItem the productOrderItem instance. | [
"Delete",
"an",
"ProductOrderItem",
"."
] | 500aaf4364be3c42fca69ecd10a449da03993814 | https://github.com/flowcode/AmulenShopBundle/blob/500aaf4364be3c42fca69ecd10a449da03993814/src/Flowcode/ShopBundle/Service/ProductOrderItemService.php#L90-L94 |
12,551 | Flowpack/Flowpack.SingleSignOn.Client | Classes/Flowpack/SingleSignOn/Client/Command/SsoKeyCommandController.php | SsoKeyCommandController.exportPublicKeyCommand | public function exportPublicKeyCommand($publicKeyFingerprint) {
$publicKey = $this->rsaWalletService->getPublicKey($publicKeyFingerprint);
$this->output($publicKey->getKeyString());
} | php | public function exportPublicKeyCommand($publicKeyFingerprint) {
$publicKey = $this->rsaWalletService->getPublicKey($publicKeyFingerprint);
$this->output($publicKey->getKeyString());
} | [
"public",
"function",
"exportPublicKeyCommand",
"(",
"$",
"publicKeyFingerprint",
")",
"{",
"$",
"publicKey",
"=",
"$",
"this",
"->",
"rsaWalletService",
"->",
"getPublicKey",
"(",
"$",
"publicKeyFingerprint",
")",
";",
"$",
"this",
"->",
"output",
"(",
"$",
"... | Export a public key
@param string $publicKeyFingerprint
@return void | [
"Export",
"a",
"public",
"key"
] | 0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00 | https://github.com/Flowpack/Flowpack.SingleSignOn.Client/blob/0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00/Classes/Flowpack/SingleSignOn/Client/Command/SsoKeyCommandController.php#L43-L46 |
12,552 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.assert | public function assert(callable $callback): bool
{
foreach ($this->items as $key => $item) {
if ($callback($item, $key) === false) {
return false;
}
}
return true;
} | php | public function assert(callable $callback): bool
{
foreach ($this->items as $key => $item) {
if ($callback($item, $key) === false) {
return false;
}
}
return true;
} | [
"public",
"function",
"assert",
"(",
"callable",
"$",
"callback",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"callback",
"(",
"$",
"item",
",",
"$",
"key",
")"... | Assert that all elements pass the test provided by the callback
@param callable $callback
@return bool | [
"Assert",
"that",
"all",
"elements",
"pass",
"the",
"test",
"provided",
"by",
"the",
"callback"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L150-L159 |
12,553 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.contains | public function contains($value): bool
{
return \in_array($value, $this->items, (is_scalar($value) ? false : true));
} | php | public function contains($value): bool
{
return \in_array($value, $this->items, (is_scalar($value) ? false : true));
} | [
"public",
"function",
"contains",
"(",
"$",
"value",
")",
":",
"bool",
"{",
"return",
"\\",
"in_array",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"items",
",",
"(",
"is_scalar",
"(",
"$",
"value",
")",
"?",
"false",
":",
"true",
")",
")",
";",
"... | Returns true if the value is in the Collection
@link http://ca.php.net/in_array
@param mixed $value
@return boolean | [
"Returns",
"true",
"if",
"the",
"value",
"is",
"in",
"the",
"Collection"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L183-L186 |
12,554 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.match | public function match($regex)
{
$col = new static();
foreach ($this as $key => $value) {
if (\preg_match($regex, $key)) {
$col[$key] = $value;
}
}
return $col;
} | php | public function match($regex)
{
$col = new static();
foreach ($this as $key => $value) {
if (\preg_match($regex, $key)) {
$col[$key] = $value;
}
}
return $col;
} | [
"public",
"function",
"match",
"(",
"$",
"regex",
")",
"{",
"$",
"col",
"=",
"new",
"static",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"\\",
"preg_match",
"(",
"$",
"regex",
",",
"$"... | Find keys and values using a regular expression, returning a new Collection
Similar to {@link keys} but allows any PERL regular expression to be
used for locating a matching key. Returns a new Collection containing matching
keys and values.
@param string $regex PERL regular expression
@return static | [
"Find",
"keys",
"and",
"values",
"using",
"a",
"regular",
"expression",
"returning",
"a",
"new",
"Collection"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L578-L589 |
12,555 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.max | public function max($key = null)
{
$callback = $this->valueAccessor($key);
return $this->filter(function ($value) {
return !is_null($value);
})->reduce(function ($result, $item) use ($callback) {
$value = $callback($item);
return is_null($result) || $val... | php | public function max($key = null)
{
$callback = $this->valueAccessor($key);
return $this->filter(function ($value) {
return !is_null($value);
})->reduce(function ($result, $item) use ($callback) {
$value = $callback($item);
return is_null($result) || $val... | [
"public",
"function",
"max",
"(",
"$",
"key",
"=",
"null",
")",
"{",
"$",
"callback",
"=",
"$",
"this",
"->",
"valueAccessor",
"(",
"$",
"key",
")",
";",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"value",
")",
"{",
"return",... | Returns the highest value from the collection of values
Key can be a string key or callable. Based on Laravel: Illuminate\Support\Collection.max
@param null|string $key
@return mixed | [
"Returns",
"the",
"highest",
"value",
"from",
"the",
"collection",
"of",
"values"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L600-L611 |
12,556 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.only | public function only($keys)
{
$keys = is_array($keys) ? $keys : func_get_args();
return $this->filter(function ($value, $key) use ($keys) {
return in_array($key, $keys, true);
});
} | php | public function only($keys)
{
$keys = is_array($keys) ? $keys : func_get_args();
return $this->filter(function ($value, $key) use ($keys) {
return in_array($key, $keys, true);
});
} | [
"public",
"function",
"only",
"(",
"$",
"keys",
")",
"{",
"$",
"keys",
"=",
"is_array",
"(",
"$",
"keys",
")",
"?",
"$",
"keys",
":",
"func_get_args",
"(",
")",
";",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"value",
",",
... | Returns a new collection containing only these keys
@param mixed $keys Array of key names, or multiple arguments
@return Collection | [
"Returns",
"a",
"new",
"collection",
"containing",
"only",
"these",
"keys"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L662-L669 |
12,557 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.pad | public function pad($size, $value)
{
$this->items = \array_pad($this->items, $size, $value);
return $this;
} | php | public function pad($size, $value)
{
$this->items = \array_pad($this->items, $size, $value);
return $this;
} | [
"public",
"function",
"pad",
"(",
"$",
"size",
",",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"\\",
"array_pad",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"size",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Pads the Collection to size using value as the value of the new elements
@link http://ca.php.net/array_pad
@param integer $size
@param mixed $value
@return $this | [
"Pads",
"the",
"Collection",
"to",
"size",
"using",
"value",
"as",
"the",
"value",
"of",
"the",
"new",
"elements"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L681-L686 |
12,558 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.partition | public function partition($callback)
{
$partitions = [new static, new static];
$callback = $this->valueAccessor($callback);
foreach ($this->items as $key => $item) {
$partitions[(int) ! $callback($item)][$key] = $item;
}
return new static($partitions);
} | php | public function partition($callback)
{
$partitions = [new static, new static];
$callback = $this->valueAccessor($callback);
foreach ($this->items as $key => $item) {
$partitions[(int) ! $callback($item)][$key] = $item;
}
return new static($partitions);
} | [
"public",
"function",
"partition",
"(",
"$",
"callback",
")",
"{",
"$",
"partitions",
"=",
"[",
"new",
"static",
",",
"new",
"static",
"]",
";",
"$",
"callback",
"=",
"$",
"this",
"->",
"valueAccessor",
"(",
"$",
"callback",
")",
";",
"foreach",
"(",
... | Partition the Collection into two Collections using the given callback or key.
Based on Laravel: Illuminate\Support\Collection.partition
@param callable|string $callback
@return static[static, static] | [
"Partition",
"the",
"Collection",
"into",
"two",
"Collections",
"using",
"the",
"given",
"callback",
"or",
"key",
"."
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L697-L707 |
12,559 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.pipe | public function pipe(iterable $items, $through)
{
foreach ($this->items as $key => $operator) {
$new = new static();
if (!Support::isCallable($through)) {
$through = function ($operator, $item, $key) use ($through)
{
return $operat... | php | public function pipe(iterable $items, $through)
{
foreach ($this->items as $key => $operator) {
$new = new static();
if (!Support::isCallable($through)) {
$through = function ($operator, $item, $key) use ($through)
{
return $operat... | [
"public",
"function",
"pipe",
"(",
"iterable",
"$",
"items",
",",
"$",
"through",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"items",
"as",
"$",
"key",
"=>",
"$",
"operator",
")",
"{",
"$",
"new",
"=",
"new",
"static",
"(",
")",
";",
"if",
"(",... | Transformer a passed Collection of items using an Operator method
Given a set of Operators that all implement the same interface, pass the Collection of
items to each Operator, calling a method on the operator that will transform each item
in the items Collection, creating a new Collection that is passed to subsequent... | [
"Transformer",
"a",
"passed",
"Collection",
"of",
"items",
"using",
"an",
"Operator",
"method"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L734-L754 |
12,560 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.removeEmpty | public function removeEmpty(array $empty = [false, null, ''])
{
return $this->filter(function ($item) use ($empty) {
return !in_array($item, $empty, true);
});
} | php | public function removeEmpty(array $empty = [false, null, ''])
{
return $this->filter(function ($item) use ($empty) {
return !in_array($item, $empty, true);
});
} | [
"public",
"function",
"removeEmpty",
"(",
"array",
"$",
"empty",
"=",
"[",
"false",
",",
"null",
",",
"''",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"filter",
"(",
"function",
"(",
"$",
"item",
")",
"use",
"(",
"$",
"empty",
")",
"{",
"return",
... | Removes values that are matched as empty through an equivalence check
@param array $empty Array of values considered to be "empty"
@return Collection | [
"Removes",
"values",
"that",
"are",
"matched",
"as",
"empty",
"through",
"an",
"equivalence",
"check"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L820-L825 |
12,561 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.set | public function set($key, $value = null)
{
if (\is_array($key) && $value === null) {
$this->items = $key;
trigger_error('Replacing collection contents via set is deprecated', E_USER_DEPRECATED);
} else {
$this->offsetSet($key, $value);
}
return $t... | php | public function set($key, $value = null)
{
if (\is_array($key) && $value === null) {
$this->items = $key;
trigger_error('Replacing collection contents via set is deprecated', E_USER_DEPRECATED);
} else {
$this->offsetSet($key, $value);
}
return $t... | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"key",
")",
"&&",
"$",
"value",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"items",
"=",
"$",
"key",
";",
"trigger_e... | Add the item with key to the Collection
If item is an array and value is null, the Collection will be replaced with
the items.
Note: replacing the Collection contents is considered deprecated and will be removed
in the next major version.
@param mixed $key
@param mixed $value
@return $this | [
"Add",
"the",
"item",
"with",
"key",
"to",
"the",
"Collection"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L894-L904 |
12,562 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.slice | public function slice($offset, $limit = null, $keys = true)
{
return new static(\array_slice($this->items, $offset, $limit, $keys));
} | php | public function slice($offset, $limit = null, $keys = true)
{
return new static(\array_slice($this->items, $offset, $limit, $keys));
} | [
"public",
"function",
"slice",
"(",
"$",
"offset",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"keys",
"=",
"true",
")",
"{",
"return",
"new",
"static",
"(",
"\\",
"array_slice",
"(",
"$",
"this",
"->",
"items",
",",
"$",
"offset",
",",
"$",
"limit",... | Extracts a portion of the Collection, returning a new Collection
By default, preserves the keys.
@link http://ca.php.net/array_slice
@param int $offset
@param int|null $limit
@param bool $keys
@return static | [
"Extracts",
"a",
"portion",
"of",
"the",
"Collection",
"returning",
"a",
"new",
"Collection"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L946-L949 |
12,563 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.transform | public function transform(callable $callable)
{
$ret = new static();
foreach ($this as $key => $value) {
$ret->set($key, $callable($value, $key));
}
return $ret;
} | php | public function transform(callable $callable)
{
$ret = new static();
foreach ($this as $key => $value) {
$ret->set($key, $callable($value, $key));
}
return $ret;
} | [
"public",
"function",
"transform",
"(",
"callable",
"$",
"callable",
")",
"{",
"$",
"ret",
"=",
"new",
"static",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"ret",
"->",
"set",
"(",
"$",
"key",... | Creates a new Collection containing the results of the callable in the same keys
For example: with a collection of the same objects, call a method to export
part of each object into a new collection. Similar to using each() or walk()
except the callable should return the new value for the key.
Note: this method prese... | [
"Creates",
"a",
"new",
"Collection",
"containing",
"the",
"results",
"of",
"the",
"callable",
"in",
"the",
"same",
"keys"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L982-L991 |
12,564 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.value | public function value($key, $default = null)
{
$value = $this->get($key);
if (!$value) {
return $this->valueExecutor($default, $value, $key);
}
return $value;
} | php | public function value($key, $default = null)
{
$value = $this->get($key);
if (!$value) {
return $this->valueExecutor($default, $value, $key);
}
return $value;
} | [
"public",
"function",
"value",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"$",
"value",
")",
"{",
"return",
"$",
"this",
"->",
"valueExecu... | Returns the value for the specified key or if there is no value, returns the default
Default can be a callable (closure) that will be executed. This method differs to
{@link static::get()} in that the default will be returned even when the key exists and
has no "truthy" value (null, false, empty string etc). Default c... | [
"Returns",
"the",
"value",
"for",
"the",
"specified",
"key",
"or",
"if",
"there",
"is",
"no",
"value",
"returns",
"the",
"default"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L1016-L1025 |
12,565 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.walk | public function walk($callback, $userdata = null)
{
$elements = $this->items;
\array_walk($elements, $callback, $userdata);
return new static($elements);
} | php | public function walk($callback, $userdata = null)
{
$elements = $this->items;
\array_walk($elements, $callback, $userdata);
return new static($elements);
} | [
"public",
"function",
"walk",
"(",
"$",
"callback",
",",
"$",
"userdata",
"=",
"null",
")",
"{",
"$",
"elements",
"=",
"$",
"this",
"->",
"items",
";",
"\\",
"array_walk",
"(",
"$",
"elements",
",",
"$",
"callback",
",",
"$",
"userdata",
")",
";",
... | Applies the callback to all elements in the Collection, returning a new Collection
@link http://ca.php.net/array_walk
@param callable $callback Receives: (&$value, $key, ?$userdata)
@param mixed $userdata (optional) additional user data for the callback
@return static | [
"Applies",
"the",
"callback",
"to",
"all",
"elements",
"in",
"the",
"Collection",
"returning",
"a",
"new",
"Collection"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L1075-L1081 |
12,566 | dave-redfern/somnambulist-collection | src/Collection.php | Collection.valueAccessor | protected function valueAccessor($value, $returnNull = false)
{
if (Support::isCallable($value)) {
return $value;
}
return function ($item) use ($value, $returnNull) {
if (is_null($value)) {
return $returnNull ? null : $item;
}
... | php | protected function valueAccessor($value, $returnNull = false)
{
if (Support::isCallable($value)) {
return $value;
}
return function ($item) use ($value, $returnNull) {
if (is_null($value)) {
return $returnNull ? null : $item;
}
... | [
"protected",
"function",
"valueAccessor",
"(",
"$",
"value",
",",
"$",
"returnNull",
"=",
"false",
")",
"{",
"if",
"(",
"Support",
"::",
"isCallable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"$",
"value",
";",
"}",
"return",
"function",
"(",
"$",
... | Providers a callable for fetching data from a collection item
Based on Laravel: Illuminate\Support\Collection.valueRetriever
@param string|callable $value
@param bool $returnNull If true, returns null instead of the item
@return callable | [
"Providers",
"a",
"callable",
"for",
"fetching",
"data",
"from",
"a",
"collection",
"item"
] | 82cf33c333b00ff375c403fbc7f32e4b476ee0b1 | https://github.com/dave-redfern/somnambulist-collection/blob/82cf33c333b00ff375c403fbc7f32e4b476ee0b1/src/Collection.php#L1095-L1120 |
12,567 | php-packages/dumpy | src/PhpPackages/Dumpy/Dumpy.php | Dumpy.getConfigOption | public function getConfigOption($option)
{
// An exception will be thrown instead of returning NULL or something similar.
if ( ! array_key_exists($option, $this->config)) {
throw new UnexpectedValueException("Unexpected option name: {$option}");
}
return $this->config[$o... | php | public function getConfigOption($option)
{
// An exception will be thrown instead of returning NULL or something similar.
if ( ! array_key_exists($option, $this->config)) {
throw new UnexpectedValueException("Unexpected option name: {$option}");
}
return $this->config[$o... | [
"public",
"function",
"getConfigOption",
"(",
"$",
"option",
")",
"{",
"// An exception will be thrown instead of returning NULL or something similar.",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"config",
")",
")",
"{",
"throw",
... | Returns the value of given configuration option.
@throws \UnexpectedValueException
@param string $option
@return mixed | [
"Returns",
"the",
"value",
"of",
"given",
"configuration",
"option",
"."
] | 220820139a2b1361a1bd122d59bbc41b1533b41e | https://github.com/php-packages/dumpy/blob/220820139a2b1361a1bd122d59bbc41b1533b41e/src/PhpPackages/Dumpy/Dumpy.php#L57-L65 |
12,568 | php-packages/dumpy | src/PhpPackages/Dumpy/Dumpy.php | Dumpy.configure | public function configure($option, $value)
{
// Dumpy won't let you add any custom config options, only update the existing ones.
if ( ! array_key_exists($option, $this->config)) {
// Note: something really weird is going to happen if $option is, say, an array.
throw new Inva... | php | public function configure($option, $value)
{
// Dumpy won't let you add any custom config options, only update the existing ones.
if ( ! array_key_exists($option, $this->config)) {
// Note: something really weird is going to happen if $option is, say, an array.
throw new Inva... | [
"public",
"function",
"configure",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"// Dumpy won't let you add any custom config options, only update the existing ones.",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"option",
",",
"$",
"this",
"->",
"config",
")",
... | Sets a configuration option to given value.
@throws \InvalidArgumentException
@param string $option
@param mixed $value
@return void | [
"Sets",
"a",
"configuration",
"option",
"to",
"given",
"value",
"."
] | 220820139a2b1361a1bd122d59bbc41b1533b41e | https://github.com/php-packages/dumpy/blob/220820139a2b1361a1bd122d59bbc41b1533b41e/src/PhpPackages/Dumpy/Dumpy.php#L75-L87 |
12,569 | php-packages/dumpy | src/PhpPackages/Dumpy/Dumpy.php | Dumpy.dump | public function dump($value)
{
switch (gettype($value)) {
// Handle boolean values.
case "boolean": {
$output = $value ? "true" : "false";
// You can represent booleans (and NULLs) in either lower- or uppercase format.
return $this->co... | php | public function dump($value)
{
switch (gettype($value)) {
// Handle boolean values.
case "boolean": {
$output = $value ? "true" : "false";
// You can represent booleans (and NULLs) in either lower- or uppercase format.
return $this->co... | [
"public",
"function",
"dump",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"gettype",
"(",
"$",
"value",
")",
")",
"{",
"// Handle boolean values.",
"case",
"\"boolean\"",
":",
"{",
"$",
"output",
"=",
"$",
"value",
"?",
"\"true\"",
":",
"\"false\"",
";",... | This method helps you get string representations of various PHP data types.
@param mixed $value
@return string | [
"This",
"method",
"helps",
"you",
"get",
"string",
"representations",
"of",
"various",
"PHP",
"data",
"types",
"."
] | 220820139a2b1361a1bd122d59bbc41b1533b41e | https://github.com/php-packages/dumpy/blob/220820139a2b1361a1bd122d59bbc41b1533b41e/src/PhpPackages/Dumpy/Dumpy.php#L95-L153 |
12,570 | php-packages/dumpy | src/PhpPackages/Dumpy/Dumpy.php | Dumpy.printArray | protected function printArray(array $value, $level = 1)
{
if (count($value) < 1) {
return "[]";
}
// Open bracket.
$result = "[" . PHP_EOL;
// This approach is much faster than the one that uses array_values function.
// To make it even faster, we cache ... | php | protected function printArray(array $value, $level = 1)
{
if (count($value) < 1) {
return "[]";
}
// Open bracket.
$result = "[" . PHP_EOL;
// This approach is much faster than the one that uses array_values function.
// To make it even faster, we cache ... | [
"protected",
"function",
"printArray",
"(",
"array",
"$",
"value",
",",
"$",
"level",
"=",
"1",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"value",
")",
"<",
"1",
")",
"{",
"return",
"\"[]\"",
";",
"}",
"// Open bracket.",
"$",
"result",
"=",
"\"[\"",
... | Returns a string representation of given array.
@param array $value
@param integer $level
@return string | [
"Returns",
"a",
"string",
"representation",
"of",
"given",
"array",
"."
] | 220820139a2b1361a1bd122d59bbc41b1533b41e | https://github.com/php-packages/dumpy/blob/220820139a2b1361a1bd122d59bbc41b1533b41e/src/PhpPackages/Dumpy/Dumpy.php#L162-L214 |
12,571 | php-packages/dumpy | src/PhpPackages/Dumpy/Dumpy.php | Dumpy.printObject | protected function printObject($value, $level = 0)
{
$reflector = new ReflectionClass($value);
// Display the general information about given object.
$result = $this->getGeneralObjectInfo($value) . PHP_EOL;
if ( ! $this->config["object_limited_info"]) {
// Display all p... | php | protected function printObject($value, $level = 0)
{
$reflector = new ReflectionClass($value);
// Display the general information about given object.
$result = $this->getGeneralObjectInfo($value) . PHP_EOL;
if ( ! $this->config["object_limited_info"]) {
// Display all p... | [
"protected",
"function",
"printObject",
"(",
"$",
"value",
",",
"$",
"level",
"=",
"0",
")",
"{",
"$",
"reflector",
"=",
"new",
"ReflectionClass",
"(",
"$",
"value",
")",
";",
"// Display the general information about given object.",
"$",
"result",
"=",
"$",
"... | Returns a string representation of given object.
@param object $value
@param integer $level
@return string | [
"Returns",
"a",
"string",
"representation",
"of",
"given",
"object",
"."
] | 220820139a2b1361a1bd122d59bbc41b1533b41e | https://github.com/php-packages/dumpy/blob/220820139a2b1361a1bd122d59bbc41b1533b41e/src/PhpPackages/Dumpy/Dumpy.php#L223-L255 |
12,572 | jeromeklam/freefw | src/FreeFW/Core/Model.php | Model.initWithJson | public function initWithJson(array $p_datas = [])
{
$props = $this->getProperties();
$this->init();
foreach ($p_datas as $name => $value) {
foreach ($props as $prp => $property) {
$test = $prp;
if (array_key_exists(FFCST::PROPERTY_PUBLIC, $property... | php | public function initWithJson(array $p_datas = [])
{
$props = $this->getProperties();
$this->init();
foreach ($p_datas as $name => $value) {
foreach ($props as $prp => $property) {
$test = $prp;
if (array_key_exists(FFCST::PROPERTY_PUBLIC, $property... | [
"public",
"function",
"initWithJson",
"(",
"array",
"$",
"p_datas",
"=",
"[",
"]",
")",
"{",
"$",
"props",
"=",
"$",
"this",
"->",
"getProperties",
"(",
")",
";",
"$",
"this",
"->",
"init",
"(",
")",
";",
"foreach",
"(",
"$",
"p_datas",
"as",
"$",
... | Init object with datas
@param array $p_datas
@return \FreeFW\Core\Model | [
"Init",
"object",
"with",
"datas"
] | 16ecf24192375c920a070296f396b9d3fd994a1e | https://github.com/jeromeklam/freefw/blob/16ecf24192375c920a070296f396b9d3fd994a1e/src/FreeFW/Core/Model.php#L91-L109 |
12,573 | canis-io/yii2-canis-lib | lib/web/grid/Grid.php | Grid.setCells | public function setCells($items)
{
Yii::beginProfile(__CLASS__ . ':' . __FUNCTION__);
while (!empty($items)) {
$this->currentRow->addCells($items);
if (!empty($items)) {
$this->_currentRow = null;
}
}
Yii::endProfile(__CLASS__ . ':'... | php | public function setCells($items)
{
Yii::beginProfile(__CLASS__ . ':' . __FUNCTION__);
while (!empty($items)) {
$this->currentRow->addCells($items);
if (!empty($items)) {
$this->_currentRow = null;
}
}
Yii::endProfile(__CLASS__ . ':'... | [
"public",
"function",
"setCells",
"(",
"$",
"items",
")",
"{",
"Yii",
"::",
"beginProfile",
"(",
"__CLASS__",
".",
"':'",
".",
"__FUNCTION__",
")",
";",
"while",
"(",
"!",
"empty",
"(",
"$",
"items",
")",
")",
"{",
"$",
"this",
"->",
"currentRow",
"-... | Set cells.
@param [[@doctodo param_type:items]] $items [[@doctodo param_description:items]] | [
"Set",
"cells",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Grid.php#L146-L156 |
12,574 | canis-io/yii2-canis-lib | lib/web/grid/Grid.php | Grid.getCurrentRow | public function getCurrentRow()
{
if (isset($this->_currentRow) && $this->_currentRow->isFilled()) {
$this->_currentRow = null;
}
if (is_null($this->_currentRow)) {
$this->_currentRow = Yii::createObject(array_merge(['class' => $this->rowClass], $this->baseRow));
... | php | public function getCurrentRow()
{
if (isset($this->_currentRow) && $this->_currentRow->isFilled()) {
$this->_currentRow = null;
}
if (is_null($this->_currentRow)) {
$this->_currentRow = Yii::createObject(array_merge(['class' => $this->rowClass], $this->baseRow));
... | [
"public",
"function",
"getCurrentRow",
"(",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_currentRow",
")",
"&&",
"$",
"this",
"->",
"_currentRow",
"->",
"isFilled",
"(",
")",
")",
"{",
"$",
"this",
"->",
"_currentRow",
"=",
"null",
";",
"}... | Get current row.
@return [[@doctodo return_type:getCurrentRow]] [[@doctodo return_description:getCurrentRow]] | [
"Get",
"current",
"row",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/web/grid/Grid.php#L163-L174 |
12,575 | osflab/view | Component.php | Component.buildComponent | protected static function buildComponent(string $className)
{
if (!isset(self::$components[$className])) {
self::$components[$className] = Container::buildObject("\\Osf\\View\\Component\\" . $className);
if (!(self::$components[$className] instanceof Component\AbstractComponent)) {
... | php | protected static function buildComponent(string $className)
{
if (!isset(self::$components[$className])) {
self::$components[$className] = Container::buildObject("\\Osf\\View\\Component\\" . $className);
if (!(self::$components[$className] instanceof Component\AbstractComponent)) {
... | [
"protected",
"static",
"function",
"buildComponent",
"(",
"string",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"components",
"[",
"$",
"className",
"]",
")",
")",
"{",
"self",
"::",
"$",
"components",
"[",
"$",
"classN... | Manage components instances
@param string $className
@return type
@throws \Osf\Exception\ArchException
@return \Osf\View\Component\AbstractComponent | [
"Manage",
"components",
"instances"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Component.php#L37-L46 |
12,576 | osflab/view | Component.php | Component.registerScripts | public static function registerScripts(HelperInterface $layout)
{
foreach (self::$components as $component) {
foreach ($component->getScripts() as $script) {
switch ($script[0]) {
case 'headjs' :
$layout->headTags->appendFile($script[1... | php | public static function registerScripts(HelperInterface $layout)
{
foreach (self::$components as $component) {
foreach ($component->getScripts() as $script) {
switch ($script[0]) {
case 'headjs' :
$layout->headTags->appendFile($script[1... | [
"public",
"static",
"function",
"registerScripts",
"(",
"HelperInterface",
"$",
"layout",
")",
"{",
"foreach",
"(",
"self",
"::",
"$",
"components",
"as",
"$",
"component",
")",
"{",
"foreach",
"(",
"$",
"component",
"->",
"getScripts",
"(",
")",
"as",
"$"... | Attache les fichiers et styles des composants au layout
@param \Osf\View\Helper $layout | [
"Attache",
"les",
"fichiers",
"et",
"styles",
"des",
"composants",
"au",
"layout"
] | e06601013e8ec86dc2055e000e58dffd963c78e2 | https://github.com/osflab/view/blob/e06601013e8ec86dc2055e000e58dffd963c78e2/Component.php#L132-L155 |
12,577 | didbot/didbot-api | src/Models/Source.php | Source.getSourceFromCurrentUser | public function getSourceFromCurrentUser($user)
{
$token = $user->token();
$client = $token->client;
if($client->personal_access_client){
$name = $token->name;
$sourceable_id = $token->token_id;
$sourceable_type = 'token';
} else {
$na... | php | public function getSourceFromCurrentUser($user)
{
$token = $user->token();
$client = $token->client;
if($client->personal_access_client){
$name = $token->name;
$sourceable_id = $token->token_id;
$sourceable_type = 'token';
} else {
$na... | [
"public",
"function",
"getSourceFromCurrentUser",
"(",
"$",
"user",
")",
"{",
"$",
"token",
"=",
"$",
"user",
"->",
"token",
"(",
")",
";",
"$",
"client",
"=",
"$",
"token",
"->",
"client",
";",
"if",
"(",
"$",
"client",
"->",
"personal_access_client",
... | Why create this intermediary table rather then referring to the oauth_clients table directly?
We want every did record to have a source_id that identifies where the did
was created (web, android, ios, google home, ifttt.com, ect). Every did must have come from exactly one source
that source record should not be remove... | [
"Why",
"create",
"this",
"intermediary",
"table",
"rather",
"then",
"referring",
"to",
"the",
"oauth_clients",
"table",
"directly?"
] | 5e4080ed8d2429acd46c4f2146eb60598a72021b | https://github.com/didbot/didbot-api/blob/5e4080ed8d2429acd46c4f2146eb60598a72021b/src/Models/Source.php#L104-L133 |
12,578 | joffreydemetz/registry | src/Format/JsonFormat.php | JsonFormat.stringToObject | public function stringToObject($data, array $options=[])
{
$data = trim($data);
if ( substr($data, 0, 1) !== '{' && substr($data, -1, 1) !== '}' ){
return Format::getInstance('Yaml')->stringToObject($data, $options);
}
$decoded = json_decode($data);
if ( $decoded === null ){
... | php | public function stringToObject($data, array $options=[])
{
$data = trim($data);
if ( substr($data, 0, 1) !== '{' && substr($data, -1, 1) !== '}' ){
return Format::getInstance('Yaml')->stringToObject($data, $options);
}
$decoded = json_decode($data);
if ( $decoded === null ){
... | [
"public",
"function",
"stringToObject",
"(",
"$",
"data",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"trim",
"(",
"$",
"data",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"data",
",",
"0",
",",
"1",
")",
"!==",
"'{'",... | Parse a JSON formatted string and convert it into an object
If not JSON tries YML.
@param string $data JSON formatted string to convert
@param array $options Options used by the formatter
@return object Data object | [
"Parse",
"a",
"JSON",
"formatted",
"string",
"and",
"convert",
"it",
"into",
"an",
"object"
] | b96f1a78f04871f62deb1187f54b80a742b17938 | https://github.com/joffreydemetz/registry/blob/b96f1a78f04871f62deb1187f54b80a742b17938/src/Format/JsonFormat.php#L38-L52 |
12,579 | Notifier/Notifier | src/ParameterBag/ParameterBagTrait.php | ParameterBagTrait.getParameterBag | public function getParameterBag($identifier)
{
if (isset($this->parameterBags[$identifier])) {
return $this->parameterBags[$identifier];
}
return null;
} | php | public function getParameterBag($identifier)
{
if (isset($this->parameterBags[$identifier])) {
return $this->parameterBags[$identifier];
}
return null;
} | [
"public",
"function",
"getParameterBag",
"(",
"$",
"identifier",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"parameterBags",
"[",
"$",
"identifier",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"parameterBags",
"[",
"$",
"identifier",
"]",... | Get a specific ParameterBag based on identifier.
@param string $identifier
@return ParameterBagInterface | [
"Get",
"a",
"specific",
"ParameterBag",
"based",
"on",
"identifier",
"."
] | 1f95656ae963b68734935773c11e44c0af412303 | https://github.com/Notifier/Notifier/blob/1f95656ae963b68734935773c11e44c0af412303/src/ParameterBag/ParameterBagTrait.php#L38-L45 |
12,580 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.colors | public function colors( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_panel(
'colors',
array(
'title' => esc_html__( 'Colors', 'rock' ),
'description' => 'Get what you need.',
'priority' => 40,
)
);
$wp_customize->add_section(
'colors-scheme',
array(
'title' =... | php | public function colors( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_panel(
'colors',
array(
'title' => esc_html__( 'Colors', 'rock' ),
'description' => 'Get what you need.',
'priority' => 40,
)
);
$wp_customize->add_section(
'colors-scheme',
array(
'title' =... | [
"public",
"function",
"colors",
"(",
"WP_Customize_Manager",
"$",
"wp_customize",
")",
"{",
"$",
"wp_customize",
"->",
"add_panel",
"(",
"'colors'",
",",
"array",
"(",
"'title'",
"=>",
"esc_html__",
"(",
"'Colors'",
",",
"'rock'",
")",
",",
"'description'",
"=... | Register color panel, sections, controls, and settings.
@action customize_register
@since 1.0.0
@param WP_Customize_Manager $wp_customize | [
"Register",
"color",
"panel",
"sections",
"controls",
"and",
"settings",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L706-L771 |
12,581 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.register_color_setting | public function register_color_setting( WP_Customize_Manager $wp_customize, $name, array $args ) {
if ( empty( $name ) || empty( $args['default'] ) ) {
return;
}
$name = sanitize_key( $name );
$wp_customize->add_setting(
$name,
array(
'default' => sanitize_hex_color_no_hash( $args... | php | public function register_color_setting( WP_Customize_Manager $wp_customize, $name, array $args ) {
if ( empty( $name ) || empty( $args['default'] ) ) {
return;
}
$name = sanitize_key( $name );
$wp_customize->add_setting(
$name,
array(
'default' => sanitize_hex_color_no_hash( $args... | [
"public",
"function",
"register_color_setting",
"(",
"WP_Customize_Manager",
"$",
"wp_customize",
",",
"$",
"name",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
"||",
"empty",
"(",
"$",
"args",
"[",
"'default'",
"]",
")... | Register a custom color setting.
@since 1.0.0
@see $this->colors()
@param WP_Customize_Manager $wp_customize
@param string $name
@param array $args | [
"Register",
"a",
"custom",
"color",
"setting",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L783-L817 |
12,582 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.enqueue_colors_inline_css | public function enqueue_colors_inline_css() {
foreach ( $this->colors as $name => $args ) {
$this->add_color_inline_css( $name, $args );
}
} | php | public function enqueue_colors_inline_css() {
foreach ( $this->colors as $name => $args ) {
$this->add_color_inline_css( $name, $args );
}
} | [
"public",
"function",
"enqueue_colors_inline_css",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"colors",
"as",
"$",
"name",
"=>",
"$",
"args",
")",
"{",
"$",
"this",
"->",
"add_color_inline_css",
"(",
"$",
"name",
",",
"$",
"args",
")",
";",
"}",... | Enqueue inline CSS for custom colors.
@action wp_enqueue_scripts
@since 1.0.0 | [
"Enqueue",
"inline",
"CSS",
"for",
"custom",
"colors",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L825-L833 |
12,583 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.add_color_inline_css | public function add_color_inline_css( $name, array $args ) {
if ( empty( $name ) || empty( $args['css'] ) ) {
return;
}
$default = $this->get_default_color( $name, 'default' );
$hex = trim( get_theme_mod( $name, $default ), '#' );
$css = sprintf( Rock_Customizer::parse_css_rules( $args['css'] )... | php | public function add_color_inline_css( $name, array $args ) {
if ( empty( $name ) || empty( $args['css'] ) ) {
return;
}
$default = $this->get_default_color( $name, 'default' );
$hex = trim( get_theme_mod( $name, $default ), '#' );
$css = sprintf( Rock_Customizer::parse_css_rules( $args['css'] )... | [
"public",
"function",
"add_color_inline_css",
"(",
"$",
"name",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"name",
")",
"||",
"empty",
"(",
"$",
"args",
"[",
"'css'",
"]",
")",
")",
"{",
"return",
";",
"}",
"$",
"default",
... | Add color inline CSS.
@see $this->enqueue_colors_inline_css()
@since 1.0.0
@param string $name
@param array $args | [
"Add",
"color",
"inline",
"CSS",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L844-L867 |
12,584 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.get_default_color | public function get_default_color( $color, $scheme = '', $hash = false ) {
/**
* Load for backwards compatibility prior to WordPress 4.6.
*
* @link https://core.trac.wordpress.org/ticket/27583
* @since 1.0.0
*/
if ( ! function_exists( 'sanitize_hex_color' ) || ! function_exists( 'sanitize_hex_color... | php | public function get_default_color( $color, $scheme = '', $hash = false ) {
/**
* Load for backwards compatibility prior to WordPress 4.6.
*
* @link https://core.trac.wordpress.org/ticket/27583
* @since 1.0.0
*/
if ( ! function_exists( 'sanitize_hex_color' ) || ! function_exists( 'sanitize_hex_color... | [
"public",
"function",
"get_default_color",
"(",
"$",
"color",
",",
"$",
"scheme",
"=",
"''",
",",
"$",
"hash",
"=",
"false",
")",
"{",
"/**\n\t\t * Load for backwards compatibility prior to WordPress 4.6.\n\t\t *\n\t\t * @link https://core.trac.wordpress.org/ticket/27583\n\t\t *... | Return the default HEX value for a color in a scheme.
@param string $color
@param string $scheme (optional)
@param bool $hash (optional)
@return string|null | [
"Return",
"the",
"default",
"HEX",
"value",
"for",
"a",
"color",
"in",
"a",
"scheme",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L878-L897 |
12,585 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.get_rgba_css | public function get_rgba_css() {
$colors = array();
foreach ( $this->colors as $name => $args ) {
if ( ! empty( $name ) && ! empty( $args['rgba_css'] ) && is_array( $args['rgba_css'] ) ) {
$colors[ $name ] = $args['rgba_css'];
}
}
return $colors;
} | php | public function get_rgba_css() {
$colors = array();
foreach ( $this->colors as $name => $args ) {
if ( ! empty( $name ) && ! empty( $args['rgba_css'] ) && is_array( $args['rgba_css'] ) ) {
$colors[ $name ] = $args['rgba_css'];
}
}
return $colors;
} | [
"public",
"function",
"get_rgba_css",
"(",
")",
"{",
"$",
"colors",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"colors",
"as",
"$",
"name",
"=>",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"name",
")",
"&&",
... | Return an array of CSS for colors supporting RGBA.
@return array | [
"Return",
"an",
"array",
"of",
"CSS",
"for",
"colors",
"supporting",
"RGBA",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L919-L935 |
12,586 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.color_scheme | public function color_scheme( WP_Customize_Manager $wp_customize ) {
if ( count( $this->color_schemes ) < 2 ) {
return;
}
$wp_customize->add_setting(
'color_scheme',
array(
'default' => 'default',
'sanitize_callback' => array( $this, 'sanitize_color_scheme' ),
'transport' ... | php | public function color_scheme( WP_Customize_Manager $wp_customize ) {
if ( count( $this->color_schemes ) < 2 ) {
return;
}
$wp_customize->add_setting(
'color_scheme',
array(
'default' => 'default',
'sanitize_callback' => array( $this, 'sanitize_color_scheme' ),
'transport' ... | [
"public",
"function",
"color_scheme",
"(",
"WP_Customize_Manager",
"$",
"wp_customize",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"color_schemes",
")",
"<",
"2",
")",
"{",
"return",
";",
"}",
"$",
"wp_customize",
"->",
"add_setting",
"(",
"'col... | Register a color scheme setting.
@action customize_register
@since 1.0.0
@param WP_Customize_Manager $wp_customize | [
"Register",
"a",
"color",
"scheme",
"setting",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L945-L978 |
12,587 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.colors_control_js | public function colors_control_js() {
$suffix = SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script( 'rock-colors-control', get_template_directory_uri() . "/assets/js/admin/colors-control{$suffix}.js", array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), ROCK_VERSION, true );
wp_localize_script( 'rock-col... | php | public function colors_control_js() {
$suffix = SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script( 'rock-colors-control', get_template_directory_uri() . "/assets/js/admin/colors-control{$suffix}.js", array( 'customize-controls', 'iris', 'underscore', 'wp-util' ), ROCK_VERSION, true );
wp_localize_script( 'rock-col... | [
"public",
"function",
"colors_control_js",
"(",
")",
"{",
"$",
"suffix",
"=",
"SCRIPT_DEBUG",
"?",
"''",
":",
"'.min'",
";",
"wp_enqueue_script",
"(",
"'rock-colors-control'",
",",
"get_template_directory_uri",
"(",
")",
".",
"\"/assets/js/admin/colors-control{$suffix}.... | Enqueue color scheme control in the Customizer.
@action customize_controls_enqueue_scripts
@since 1.0.0 | [
"Enqueue",
"color",
"scheme",
"control",
"in",
"the",
"Customizer",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L986-L994 |
12,588 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.colors_preview_css | public function colors_preview_css() {
?>
<script type="text/html" id="tmpl-rock-colors-css">
<?php
foreach ( $this->colors as $name => $args ) {
if ( empty( $name ) || empty( $args['css'] ) || ! is_array( $args['css'] ) ) {
continue;
}
printf(
Rock_Customizer::parse_css_rules( $ar... | php | public function colors_preview_css() {
?>
<script type="text/html" id="tmpl-rock-colors-css">
<?php
foreach ( $this->colors as $name => $args ) {
if ( empty( $name ) || empty( $args['css'] ) || ! is_array( $args['css'] ) ) {
continue;
}
printf(
Rock_Customizer::parse_css_rules( $ar... | [
"public",
"function",
"colors_preview_css",
"(",
")",
"{",
"?>\n\t\t<script type=\"text/html\" id=\"tmpl-rock-colors-css\">\n\t\t\t<?php",
"foreach",
"(",
"$",
"this",
"->",
"colors",
"as",
"$",
"name",
"=>",
"$",
"args",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"n... | Inline style for color scheme
@action customize_controls_print_footer_scripts | [
"Inline",
"style",
"for",
"color",
"scheme"
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L1001-L1052 |
12,589 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.sanitize_color_scheme | public function sanitize_color_scheme( $scheme ) {
return ( $this->color_scheme_exists( $scheme ) && $this->is_valid_color_scheme_array( $this->color_schemes[ $scheme ] ) ) ? $scheme : 'default';
} | php | public function sanitize_color_scheme( $scheme ) {
return ( $this->color_scheme_exists( $scheme ) && $this->is_valid_color_scheme_array( $this->color_schemes[ $scheme ] ) ) ? $scheme : 'default';
} | [
"public",
"function",
"sanitize_color_scheme",
"(",
"$",
"scheme",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"color_scheme_exists",
"(",
"$",
"scheme",
")",
"&&",
"$",
"this",
"->",
"is_valid_color_scheme_array",
"(",
"$",
"this",
"->",
"color_schemes",
"[",... | Sanitize a color scheme by ensuring it exists and is valid.
@since 1.0.0
@param string $scheme
@return string | [
"Sanitize",
"a",
"color",
"scheme",
"by",
"ensuring",
"it",
"exists",
"and",
"is",
"valid",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L1099-L1103 |
12,590 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.header | public function header() {
/**
* Filter the custom header args.
*
* @since 1.0.0
*
* @var array
*/
$args = (array) apply_filters( 'rock_custom_header_args',
array(
'default-text-color' => $this->get_default_color( 'header_textcolor', 'default' ),
'width' => 2400,
'heig... | php | public function header() {
/**
* Filter the custom header args.
*
* @since 1.0.0
*
* @var array
*/
$args = (array) apply_filters( 'rock_custom_header_args',
array(
'default-text-color' => $this->get_default_color( 'header_textcolor', 'default' ),
'width' => 2400,
'heig... | [
"public",
"function",
"header",
"(",
")",
"{",
"/**\n\t\t * Filter the custom header args.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @var array\n\t\t */",
"$",
"args",
"=",
"(",
"array",
")",
"apply_filters",
"(",
"'rock_custom_header_args'",
",",
"array",
"(",
"'default-tex... | Add custom header support.
@action after_setup_theme
@since 1.0.0
@uses $this->header_css() | [
"Add",
"custom",
"header",
"support",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L1138-L1197 |
12,591 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.header_css | public function header_css() {
$color = get_header_textcolor();
$css = $this->get_color_css( 'header_textcolor' );
if ( 'blank' === $color ) {
$css = array(
'.site-title, .site-description' => array(
'position' => 'absolute',
'clip' => 'rect(1px, 1px, 1px, 1px)',
),
);
}
if ... | php | public function header_css() {
$color = get_header_textcolor();
$css = $this->get_color_css( 'header_textcolor' );
if ( 'blank' === $color ) {
$css = array(
'.site-title, .site-description' => array(
'position' => 'absolute',
'clip' => 'rect(1px, 1px, 1px, 1px)',
),
);
}
if ... | [
"public",
"function",
"header_css",
"(",
")",
"{",
"$",
"color",
"=",
"get_header_textcolor",
"(",
")",
";",
"$",
"css",
"=",
"$",
"this",
"->",
"get_color_css",
"(",
"'header_textcolor'",
")",
";",
"if",
"(",
"'blank'",
"===",
"$",
"color",
")",
"{",
... | Custom header CSS.
@see $this->header()
@since 1.0.0 | [
"Custom",
"header",
"CSS",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L1205-L1230 |
12,592 | faithmade/rock | inc/customizer/colors.php | Rock_Customizer_Colors.color_overlay_transparency | public function color_overlay_transparency( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_setting(
'hero_image_color_overlay',
array(
'default' => $this->get_color_overlay_transparency_default_value(),
'sanitize_callback' => 'absint',
'transport' => 'postMessage',
)... | php | public function color_overlay_transparency( WP_Customize_Manager $wp_customize ) {
$wp_customize->add_setting(
'hero_image_color_overlay',
array(
'default' => $this->get_color_overlay_transparency_default_value(),
'sanitize_callback' => 'absint',
'transport' => 'postMessage',
)... | [
"public",
"function",
"color_overlay_transparency",
"(",
"WP_Customize_Manager",
"$",
"wp_customize",
")",
"{",
"$",
"wp_customize",
"->",
"add_setting",
"(",
"'hero_image_color_overlay'",
",",
"array",
"(",
"'default'",
"=>",
"$",
"this",
"->",
"get_color_overlay_trans... | Add setting and control for the hero image color overlay transparency.
@action customize_register
@since 1.0.0
@param WP_Customize_Manager $wp_customize | [
"Add",
"setting",
"and",
"control",
"for",
"the",
"hero",
"image",
"color",
"overlay",
"transparency",
"."
] | 2a95ae1ed38cff3d0c20e21530bac30734e434ce | https://github.com/faithmade/rock/blob/2a95ae1ed38cff3d0c20e21530bac30734e434ce/inc/customizer/colors.php#L1265-L1293 |
12,593 | tadcka/Mapper | src/Tadcka/Mapper/Extension/Source/Tree/MapperTreeHelper.php | MapperTreeHelper.getTreeItemFullPath | public function getTreeItemFullPath($itemId, MapperTreeItemInterface $tree)
{
$path = $this->findRecursiveFullPath($itemId, $tree);
if (0 < count($path)) {
$path[$tree->getId()] = $tree->getTitle();
$path = array_reverse($path, true);
}
return $path;
} | php | public function getTreeItemFullPath($itemId, MapperTreeItemInterface $tree)
{
$path = $this->findRecursiveFullPath($itemId, $tree);
if (0 < count($path)) {
$path[$tree->getId()] = $tree->getTitle();
$path = array_reverse($path, true);
}
return $path;
} | [
"public",
"function",
"getTreeItemFullPath",
"(",
"$",
"itemId",
",",
"MapperTreeItemInterface",
"$",
"tree",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"findRecursiveFullPath",
"(",
"$",
"itemId",
",",
"$",
"tree",
")",
";",
"if",
"(",
"0",
"<",
"co... | Get mapper tree item full path.
@param string $itemId
@param MapperTreeItemInterface $tree
@return array | [
"Get",
"mapper",
"tree",
"item",
"full",
"path",
"."
] | 6853a2be08dcd35a1013c0a4aba9b71a727ff7da | https://github.com/tadcka/Mapper/blob/6853a2be08dcd35a1013c0a4aba9b71a727ff7da/src/Tadcka/Mapper/Extension/Source/Tree/MapperTreeHelper.php#L29-L39 |
12,594 | tadcka/Mapper | src/Tadcka/Mapper/Extension/Source/Tree/MapperTreeHelper.php | MapperTreeHelper.findRecursiveFullPath | private function findRecursiveFullPath($itemId, MapperTreeItemInterface $tree)
{
foreach ($tree->getChildren() as $child) {
if ($itemId === $child->getId()) {
return [$itemId => $child->getTitle()];
} else {
$path = $this->findRecursiveFullPath($itemId... | php | private function findRecursiveFullPath($itemId, MapperTreeItemInterface $tree)
{
foreach ($tree->getChildren() as $child) {
if ($itemId === $child->getId()) {
return [$itemId => $child->getTitle()];
} else {
$path = $this->findRecursiveFullPath($itemId... | [
"private",
"function",
"findRecursiveFullPath",
"(",
"$",
"itemId",
",",
"MapperTreeItemInterface",
"$",
"tree",
")",
"{",
"foreach",
"(",
"$",
"tree",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"itemId",
"===",
"$",
"ch... | Find recursive full path.
@param string $itemId
@param MapperTreeItemInterface $tree
@return array | [
"Find",
"recursive",
"full",
"path",
"."
] | 6853a2be08dcd35a1013c0a4aba9b71a727ff7da | https://github.com/tadcka/Mapper/blob/6853a2be08dcd35a1013c0a4aba9b71a727ff7da/src/Tadcka/Mapper/Extension/Source/Tree/MapperTreeHelper.php#L49-L65 |
12,595 | Apatis/Middleware | src/Middleware.php | Middleware.currentStackMiddleware | protected function currentStackMiddleware() : MiddlewareStorage
{
// add current object as first middleware middleware
if (count($this->middleware) === 0) {
$middleware = method_exists($this, '__invoke')
? $this
: new FakeMiddlewareInvokable();
... | php | protected function currentStackMiddleware() : MiddlewareStorage
{
// add current object as first middleware middleware
if (count($this->middleware) === 0) {
$middleware = method_exists($this, '__invoke')
? $this
: new FakeMiddlewareInvokable();
... | [
"protected",
"function",
"currentStackMiddleware",
"(",
")",
":",
"MiddlewareStorage",
"{",
"// add current object as first middleware middleware",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"middleware",
")",
"===",
"0",
")",
"{",
"$",
"middleware",
"=",
"method_e... | Initialize middleware stack
this recommended to intended for middleware empty
@access protected | [
"Initialize",
"middleware",
"stack",
"this",
"recommended",
"to",
"intended",
"for",
"middleware",
"empty"
] | 4335f7c9fa37992d5f7d66f99557c06d97f77abb | https://github.com/Apatis/Middleware/blob/4335f7c9fa37992d5f7d66f99557c06d97f77abb/src/Middleware.php#L52-L64 |
12,596 | diatem-net/jin-webapp | src/WebApp/Utils/Navigation.php | Navigation.clearQueryArg | public static function clearQueryArg($code)
{
if (StringTools::left($code, 1) == '/') {
$code = StringTools::right($code, StringTools::len($code)-1);
}
if (StringTools::right($code, 1) == '/') {
$code = StringTools::left($code, StringTools::len($code)-1);
}
return $code;
} | php | public static function clearQueryArg($code)
{
if (StringTools::left($code, 1) == '/') {
$code = StringTools::right($code, StringTools::len($code)-1);
}
if (StringTools::right($code, 1) == '/') {
$code = StringTools::left($code, StringTools::len($code)-1);
}
return $code;
} | [
"public",
"static",
"function",
"clearQueryArg",
"(",
"$",
"code",
")",
"{",
"if",
"(",
"StringTools",
"::",
"left",
"(",
"$",
"code",
",",
"1",
")",
"==",
"'/'",
")",
"{",
"$",
"code",
"=",
"StringTools",
"::",
"right",
"(",
"$",
"code",
",",
"Str... | Clean the Url code
@param string $code Url code
@return string | [
"Clean",
"the",
"Url",
"code"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/Utils/Navigation.php#L41-L51 |
12,597 | diatem-net/jin-webapp | src/WebApp/Utils/Navigation.php | Navigation.redirectToSame | public static function redirectToSame($exceptedArgs = array(), $addedArgs = array(), $anchor = null)
{
self::initialize();
header('Location: '.self::getCurrentUrl($exceptedArgs, $addedArgs, $anchor));
exit;
} | php | public static function redirectToSame($exceptedArgs = array(), $addedArgs = array(), $anchor = null)
{
self::initialize();
header('Location: '.self::getCurrentUrl($exceptedArgs, $addedArgs, $anchor));
exit;
} | [
"public",
"static",
"function",
"redirectToSame",
"(",
"$",
"exceptedArgs",
"=",
"array",
"(",
")",
",",
"$",
"addedArgs",
"=",
"array",
"(",
")",
",",
"$",
"anchor",
"=",
"null",
")",
"{",
"self",
"::",
"initialize",
"(",
")",
";",
"header",
"(",
"'... | Redirect to the same page
@param array $exceptedArgs (optional) Arguments to remove during the redirection
@param array $addedArgs (optional) Arguments to add during the redirection
@param string $anchor (optional) Anchor | [
"Redirect",
"to",
"the",
"same",
"page"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/Utils/Navigation.php#L75-L81 |
12,598 | diatem-net/jin-webapp | src/WebApp/Utils/Navigation.php | Navigation.getUrlFromCode | public static function getUrlFromCode($code, $addedArgs = array(), $anchor = null)
{
self::initialize();
$code = self::clearQueryArg($code);
if ($code == '_root') {
return WebApp::url();
}
if (StringTools::right($code, 1) != '/') {
$code .= '/';
}
$args = arra... | php | public static function getUrlFromCode($code, $addedArgs = array(), $anchor = null)
{
self::initialize();
$code = self::clearQueryArg($code);
if ($code == '_root') {
return WebApp::url();
}
if (StringTools::right($code, 1) != '/') {
$code .= '/';
}
$args = arra... | [
"public",
"static",
"function",
"getUrlFromCode",
"(",
"$",
"code",
",",
"$",
"addedArgs",
"=",
"array",
"(",
")",
",",
"$",
"anchor",
"=",
"null",
")",
"{",
"self",
"::",
"initialize",
"(",
")",
";",
"$",
"code",
"=",
"self",
"::",
"clearQueryArg",
... | Get a full url from an url code
@param string $code Url code
@param array $addedArgs (optional) Additional arguments
@param string $anchor (optional) Anchor | [
"Get",
"a",
"full",
"url",
"from",
"an",
"url",
"code"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/Utils/Navigation.php#L90-L107 |
12,599 | diatem-net/jin-webapp | src/WebApp/Utils/Navigation.php | Navigation.getCurrentUrl | public static function getCurrentUrl($exceptedArgs = array(), $addedArgs = array(), $anchor = null)
{
self::initialize();
return Url::getCurrentUrl(null, $addedArgs, $exceptedArgs, true, $anchor);
} | php | public static function getCurrentUrl($exceptedArgs = array(), $addedArgs = array(), $anchor = null)
{
self::initialize();
return Url::getCurrentUrl(null, $addedArgs, $exceptedArgs, true, $anchor);
} | [
"public",
"static",
"function",
"getCurrentUrl",
"(",
"$",
"exceptedArgs",
"=",
"array",
"(",
")",
",",
"$",
"addedArgs",
"=",
"array",
"(",
")",
",",
"$",
"anchor",
"=",
"null",
")",
"{",
"self",
"::",
"initialize",
"(",
")",
";",
"return",
"Url",
"... | Return the current url
@param array $exceptedArgs (optional) Arguments to remove from the current url
@param array $addedArgs (optional) Arguments to add to the current url
@param string $anchor (optional) Anchor | [
"Return",
"the",
"current",
"url"
] | 43e85f780c3841a536e3a5d41929523e5aacd272 | https://github.com/diatem-net/jin-webapp/blob/43e85f780c3841a536e3a5d41929523e5aacd272/src/WebApp/Utils/Navigation.php#L116-L121 |
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.