repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.createBlockView | public function createBlockView(RawLayout $rawLayout, ContextInterface $context)
{
$this->initializeState($rawLayout, $context);
try {
$rootId = $this->rawLayout->getRootId();
$this->buildBlocks($rootId);
$this->layoutManipulator->applyChanges($this->context, tru... | php | public function createBlockView(RawLayout $rawLayout, ContextInterface $context)
{
$this->initializeState($rawLayout, $context);
try {
$rootId = $this->rawLayout->getRootId();
$this->buildBlocks($rootId);
$this->layoutManipulator->applyChanges($this->context, tru... | [
"public",
"function",
"createBlockView",
"(",
"RawLayout",
"$",
"rawLayout",
",",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"initializeState",
"(",
"$",
"rawLayout",
",",
"$",
"context",
")",
";",
"try",
"{",
"$",
"rootId",
"=",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L60-L77 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.initializeState | protected function initializeState(RawLayout $rawLayout, ContextInterface $context)
{
$this->rawLayout = $rawLayout;
$this->context = $context;
$this->dataAccessor = new DataAccessor($this->registry, $this->context);
$this->optionsResolver = new BlockOptionsResolver($this->regi... | php | protected function initializeState(RawLayout $rawLayout, ContextInterface $context)
{
$this->rawLayout = $rawLayout;
$this->context = $context;
$this->dataAccessor = new DataAccessor($this->registry, $this->context);
$this->optionsResolver = new BlockOptionsResolver($this->regi... | [
"protected",
"function",
"initializeState",
"(",
"RawLayout",
"$",
"rawLayout",
",",
"ContextInterface",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"rawLayout",
"=",
"$",
"rawLayout",
";",
"$",
"this",
"->",
"context",
"=",
"$",
"context",
";",
"$",
"thi... | Initializes the state of this factory
@param RawLayout $rawLayout
@param ContextInterface $context | [
"Initializes",
"the",
"state",
"of",
"this",
"factory"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L85-L105 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.clearState | protected function clearState()
{
$this->rawLayout = null;
$this->context = null;
$this->dataAccessor = null;
$this->optionsResolver = null;
$this->typeHelper = null;
$this->blockBuilder = null;
$this->block = null;
} | php | protected function clearState()
{
$this->rawLayout = null;
$this->context = null;
$this->dataAccessor = null;
$this->optionsResolver = null;
$this->typeHelper = null;
$this->blockBuilder = null;
$this->block = null;
} | [
"protected",
"function",
"clearState",
"(",
")",
"{",
"$",
"this",
"->",
"rawLayout",
"=",
"null",
";",
"$",
"this",
"->",
"context",
"=",
"null",
";",
"$",
"this",
"->",
"dataAccessor",
"=",
"null",
";",
"$",
"this",
"->",
"optionsResolver",
"=",
"nul... | Clears the state of this factory | [
"Clears",
"the",
"state",
"of",
"this",
"factory"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L110-L119 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlocks | protected function buildBlocks($rootId)
{
// build the root block
if (!$this->rawLayout->hasProperty($rootId, RawLayout::RESOLVED_OPTIONS, true)) {
$this->buildBlock($rootId);
}
// build child blocks
$iterator = $this->rawLayout->getHierarchyIterator($rootId);
... | php | protected function buildBlocks($rootId)
{
// build the root block
if (!$this->rawLayout->hasProperty($rootId, RawLayout::RESOLVED_OPTIONS, true)) {
$this->buildBlock($rootId);
}
// build child blocks
$iterator = $this->rawLayout->getHierarchyIterator($rootId);
... | [
"protected",
"function",
"buildBlocks",
"(",
"$",
"rootId",
")",
"{",
"// build the root block",
"if",
"(",
"!",
"$",
"this",
"->",
"rawLayout",
"->",
"hasProperty",
"(",
"$",
"rootId",
",",
"RawLayout",
"::",
"RESOLVED_OPTIONS",
",",
"true",
")",
")",
"{",
... | Builds all blocks starting with and including the given root block
@param string $rootId
@throws Exception\LogicException if a child block is added to not container | [
"Builds",
"all",
"blocks",
"starting",
"with",
"and",
"including",
"the",
"given",
"root",
"block"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L128-L163 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlockViews | protected function buildBlockViews($rootId)
{
/** @var BlockView[] $views */
$views = [];
// build the root view
$rootView = $this->buildBlockView($rootId);
$views[$rootId] = $rootView;
// build child views
$iterator = $this->rawLayout->getHierarchyIter... | php | protected function buildBlockViews($rootId)
{
/** @var BlockView[] $views */
$views = [];
// build the root view
$rootView = $this->buildBlockView($rootId);
$views[$rootId] = $rootView;
// build child views
$iterator = $this->rawLayout->getHierarchyIter... | [
"protected",
"function",
"buildBlockViews",
"(",
"$",
"rootId",
")",
"{",
"/** @var BlockView[] $views */",
"$",
"views",
"=",
"[",
"]",
";",
"// build the root view",
"$",
"rootView",
"=",
"$",
"this",
"->",
"buildBlockView",
"(",
"$",
"rootId",
")",
";",
"$"... | Builds views for all blocks starting with and including the given root block
@param string $rootId
@return BlockView The root block view | [
"Builds",
"views",
"for",
"all",
"blocks",
"starting",
"with",
"and",
"including",
"the",
"given",
"root",
"block"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L172-L204 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlock | protected function buildBlock($id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$options = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true);
$types = $this->typeHelper->getTypes($blockType);
$this->setBlockResolvedOptions($id, $bl... | php | protected function buildBlock($id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$options = $this->rawLayout->getProperty($id, RawLayout::OPTIONS, true);
$types = $this->typeHelper->getTypes($blockType);
$this->setBlockResolvedOptions($id, $bl... | [
"protected",
"function",
"buildBlock",
"(",
"$",
"id",
")",
"{",
"$",
"blockType",
"=",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
"true",
")",
";",
"$",
"options",
"=",
"$",
"this",
... | Builds the block
@param string $id | [
"Builds",
"the",
"block"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L211-L218 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.buildBlockView | protected function buildBlockView($id, BlockView $parentView = null)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$resolvedOptions = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
$types = $this->typeHelper->getTypes(... | php | protected function buildBlockView($id, BlockView $parentView = null)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$resolvedOptions = $this->rawLayout->getProperty($id, RawLayout::RESOLVED_OPTIONS, true);
$types = $this->typeHelper->getTypes(... | [
"protected",
"function",
"buildBlockView",
"(",
"$",
"id",
",",
"BlockView",
"$",
"parentView",
"=",
"null",
")",
"{",
"$",
"blockType",
"=",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
... | Created and builds the block view
@param string $id
@param BlockView|null $parentView
@return BlockView | [
"Created",
"and",
"builds",
"the",
"block",
"view"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L228-L258 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.finishBlockView | protected function finishBlockView(BlockView $view, $id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$types = $this->typeHelper->getTypes($blockType);
// point the block view state to the current block
$this->block->initialize($id);
//... | php | protected function finishBlockView(BlockView $view, $id)
{
$blockType = $this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true);
$types = $this->typeHelper->getTypes($blockType);
// point the block view state to the current block
$this->block->initialize($id);
//... | [
"protected",
"function",
"finishBlockView",
"(",
"BlockView",
"$",
"view",
",",
"$",
"id",
")",
"{",
"$",
"blockType",
"=",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
"true",
")",
";",
... | Finishes the building of the block view
@param BlockView $view
@param string $id | [
"Finishes",
"the",
"building",
"of",
"the",
"block",
"view"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L266-L278 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.isContainerBlock | protected function isContainerBlock($id)
{
return $this->typeHelper->isInstanceOf(
$this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true),
ContainerType::NAME
);
} | php | protected function isContainerBlock($id)
{
return $this->typeHelper->isInstanceOf(
$this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true),
ContainerType::NAME
);
} | [
"protected",
"function",
"isContainerBlock",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"typeHelper",
"->",
"isInstanceOf",
"(",
"$",
"this",
"->",
"rawLayout",
"->",
"getProperty",
"(",
"$",
"id",
",",
"RawLayout",
"::",
"BLOCK_TYPE",
",",
"tr... | Checks whether the given block is a container for other blocks
@param string $id
@return bool | [
"Checks",
"whether",
"the",
"given",
"block",
"is",
"a",
"container",
"for",
"other",
"blocks"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L287-L293 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.processExpressions | protected function processExpressions(Options $options)
{
if (!$this->context->getOr('expressions_evaluate')) {
return;
}
$values = $options->toArray();
if ($this->context->getOr('expressions_evaluate_deferred')) {
$this->expressionProcessor->processExpressi... | php | protected function processExpressions(Options $options)
{
if (!$this->context->getOr('expressions_evaluate')) {
return;
}
$values = $options->toArray();
if ($this->context->getOr('expressions_evaluate_deferred')) {
$this->expressionProcessor->processExpressi... | [
"protected",
"function",
"processExpressions",
"(",
"Options",
"$",
"options",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"context",
"->",
"getOr",
"(",
"'expressions_evaluate'",
")",
")",
"{",
"return",
";",
"}",
"$",
"values",
"=",
"$",
"options",
"-... | Processes expressions that don't work with data
@param Options $options | [
"Processes",
"expressions",
"that",
"don",
"t",
"work",
"with",
"data"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L300-L321 |
oroinc/OroLayoutComponent | BlockFactory.php | BlockFactory.setBlockResolvedOptions | protected function setBlockResolvedOptions($id, $blockType, $options, $types)
{
// resolve options
$resolvedOptions = new Options($this->optionsResolver->resolveOptions($blockType, $options));
$this->processExpressions($resolvedOptions);
$resolvedOptions = $this->resolveValueBags($r... | php | protected function setBlockResolvedOptions($id, $blockType, $options, $types)
{
// resolve options
$resolvedOptions = new Options($this->optionsResolver->resolveOptions($blockType, $options));
$this->processExpressions($resolvedOptions);
$resolvedOptions = $this->resolveValueBags($r... | [
"protected",
"function",
"setBlockResolvedOptions",
"(",
"$",
"id",
",",
"$",
"blockType",
",",
"$",
"options",
",",
"$",
"types",
")",
"{",
"// resolve options",
"$",
"resolvedOptions",
"=",
"new",
"Options",
"(",
"$",
"this",
"->",
"optionsResolver",
"->",
... | Setting resolved options for block
@param string $id
@param string $blockType
@param array $options
@param array $types
@return Options | [
"Setting",
"resolved",
"options",
"for",
"block"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/BlockFactory.php#L354-L376 |
flipboxfactory/craft-psr3 | src/Logger.php | Logger.log | public function log($level, $message, array $context = [])
{
// Resolve category from 'context'
$category = ArrayHelper::remove($context, 'category', $this->category);
// Resolve level
$level = ArrayHelper::getValue($this->map, $level, $this->level);
$this->logger->log(
... | php | public function log($level, $message, array $context = [])
{
// Resolve category from 'context'
$category = ArrayHelper::remove($context, 'category', $this->category);
// Resolve level
$level = ArrayHelper::getValue($this->map, $level, $this->level);
$this->logger->log(
... | [
"public",
"function",
"log",
"(",
"$",
"level",
",",
"$",
"message",
",",
"array",
"$",
"context",
"=",
"[",
"]",
")",
"{",
"// Resolve category from 'context'",
"$",
"category",
"=",
"ArrayHelper",
"::",
"remove",
"(",
"$",
"context",
",",
"'category'",
"... | Log a message, transforming from PSR3 to the closest Yii2.
@inheritdoc | [
"Log",
"a",
"message",
"transforming",
"from",
"PSR3",
"to",
"the",
"closest",
"Yii2",
"."
] | train | https://github.com/flipboxfactory/craft-psr3/blob/cac258edc823fddd42f18904a94d603d51d80177/src/Logger.php#L76-L89 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.saveToDb | public function saveToDb( ezcDbHandler $db, ezcDbSchema $dbSchema )
{
$db->beginTransaction();
foreach ( $this->convertToDDL( $dbSchema ) as $query )
{
if ( $this->isQueryAllowed( $db, $query ) )
{
$db->exec( $query );
}
}
... | php | public function saveToDb( ezcDbHandler $db, ezcDbSchema $dbSchema )
{
$db->beginTransaction();
foreach ( $this->convertToDDL( $dbSchema ) as $query )
{
if ( $this->isQueryAllowed( $db, $query ) )
{
$db->exec( $query );
}
}
... | [
"public",
"function",
"saveToDb",
"(",
"ezcDbHandler",
"$",
"db",
",",
"ezcDbSchema",
"$",
"dbSchema",
")",
"{",
"$",
"db",
"->",
"beginTransaction",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"convertToDDL",
"(",
"$",
"dbSchema",
")",
"as",
"$",
... | Creates the tables contained in $schema in the database that is related to $db
This method takes the table definitions from $schema and will create the
tables according to this definition in the database that is references
by the $db handler. If tables with the same name as contained in the
definitions already exist t... | [
"Creates",
"the",
"tables",
"contained",
"in",
"$schema",
"in",
"the",
"database",
"that",
"is",
"related",
"to",
"$db"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L58-L69 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.convertToDDL | public function convertToDDL( ezcDbSchema $dbSchema )
{
$this->schema = $dbSchema->getSchema();
// reset queries
$this->queries = array();
$this->context = array();
$this->generateSchemaAsSql();
return $this->queries;
} | php | public function convertToDDL( ezcDbSchema $dbSchema )
{
$this->schema = $dbSchema->getSchema();
// reset queries
$this->queries = array();
$this->context = array();
$this->generateSchemaAsSql();
return $this->queries;
} | [
"public",
"function",
"convertToDDL",
"(",
"ezcDbSchema",
"$",
"dbSchema",
")",
"{",
"$",
"this",
"->",
"schema",
"=",
"$",
"dbSchema",
"->",
"getSchema",
"(",
")",
";",
"// reset queries",
"$",
"this",
"->",
"queries",
"=",
"array",
"(",
")",
";",
"$",
... | Returns an array with SQL DDL statements that creates the database definition in $dbSchema
Converts the schema definition contained in $dbSchema to DDL SQL. This
SQL can be used to create tables in an existing database according to
the definition. The SQL queries are returned as an array.
@param ezcDbSchema $dbSchem... | [
"Returns",
"an",
"array",
"with",
"SQL",
"DDL",
"statements",
"that",
"creates",
"the",
"database",
"definition",
"in",
"$dbSchema"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L81-L91 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.generateSchemaAsSql | protected function generateSchemaAsSql()
{
$prefix = ezcDbSchema::$options->tableNamePrefix;
foreach ( $this->schema as $tableName => $tableDefinition )
{
$this->generateDropTableSql( $prefix . $tableName );
$this->generateCreateTableSql( $prefix . $tableName, $tableD... | php | protected function generateSchemaAsSql()
{
$prefix = ezcDbSchema::$options->tableNamePrefix;
foreach ( $this->schema as $tableName => $tableDefinition )
{
$this->generateDropTableSql( $prefix . $tableName );
$this->generateCreateTableSql( $prefix . $tableName, $tableD... | [
"protected",
"function",
"generateSchemaAsSql",
"(",
")",
"{",
"$",
"prefix",
"=",
"ezcDbSchema",
"::",
"$",
"options",
"->",
"tableNamePrefix",
";",
"foreach",
"(",
"$",
"this",
"->",
"schema",
"as",
"$",
"tableName",
"=>",
"$",
"tableDefinition",
")",
"{",... | Creates SQL DDL statements from a schema definitin.
Loops over the tables in the schema definition in $this->schema and
creates SQL SSL statements for this which it stores internally into the
$this->queries array. | [
"Creates",
"SQL",
"DDL",
"statements",
"from",
"a",
"schema",
"definitin",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L116-L124 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.generateCreateTableSql | protected function generateCreateTableSql( $tableName, ezcDbSchemaTable $tableDefinition )
{
$sql = $this->generateCreateTableSqlStatement( $tableName );
$sql .= " (\n";
// dump fields
$fieldsSQL = array();
foreach ( $tableDefinition->fields as $fieldName => $fieldDefiniti... | php | protected function generateCreateTableSql( $tableName, ezcDbSchemaTable $tableDefinition )
{
$sql = $this->generateCreateTableSqlStatement( $tableName );
$sql .= " (\n";
// dump fields
$fieldsSQL = array();
foreach ( $tableDefinition->fields as $fieldName => $fieldDefiniti... | [
"protected",
"function",
"generateCreateTableSql",
"(",
"$",
"tableName",
",",
"ezcDbSchemaTable",
"$",
"tableDefinition",
")",
"{",
"$",
"sql",
"=",
"$",
"this",
"->",
"generateCreateTableSqlStatement",
"(",
"$",
"tableName",
")",
";",
"$",
"sql",
".=",
"\" (\\... | Adds a "create table" query for the table $tableName with definition $tableDefinition to the internal list of queries.
@param string $tableName
@param ezcDbSchemaTable $tableDefinition | [
"Adds",
"a",
"create",
"table",
"query",
"for",
"the",
"table",
"$tableName",
"with",
"definition",
"$tableDefinition",
"to",
"the",
"internal",
"list",
"of",
"queries",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L143-L168 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.generateDefault | protected function generateDefault( $type, $value )
{
switch ( $type )
{
case 'boolean':
return ( $value && $value != 'false' ) ? 'true' : 'false';
case 'integer':
return (int) $value;
case 'float':
case 'decimal':
... | php | protected function generateDefault( $type, $value )
{
switch ( $type )
{
case 'boolean':
return ( $value && $value != 'false' ) ? 'true' : 'false';
case 'integer':
return (int) $value;
case 'float':
case 'decimal':
... | [
"protected",
"function",
"generateDefault",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"type",
")",
"{",
"case",
"'boolean'",
":",
"return",
"(",
"$",
"value",
"&&",
"$",
"value",
"!=",
"'false'",
")",
"?",
"'true'",
":",
"'fa... | Returns an appropriate default value for $type with $value.
@param string $type
@param mixed $value
@return string | [
"Returns",
"an",
"appropriate",
"default",
"value",
"for",
"$type",
"with",
"$value",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L177-L197 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.generateDiffSchemaAsSql | protected function generateDiffSchemaAsSql()
{
foreach ( $this->diffSchema->changedTables as $tableName => $tableDiff )
{
$this->generateDiffSchemaTableAsSql( $tableName, $tableDiff );
}
foreach ( $this->diffSchema->newTables as $tableName => $tableDef )
{
... | php | protected function generateDiffSchemaAsSql()
{
foreach ( $this->diffSchema->changedTables as $tableName => $tableDiff )
{
$this->generateDiffSchemaTableAsSql( $tableName, $tableDiff );
}
foreach ( $this->diffSchema->newTables as $tableName => $tableDef )
{
... | [
"protected",
"function",
"generateDiffSchemaAsSql",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"diffSchema",
"->",
"changedTables",
"as",
"$",
"tableName",
"=>",
"$",
"tableDiff",
")",
"{",
"$",
"this",
"->",
"generateDiffSchemaTableAsSql",
"(",
"$",
"t... | Generates queries to upgrade an existing database with the changes stored in $this->diffSchema.
This method generates queries to migrate a database to a new version
with the changes that are stored in the $this->diffSchema property. It
will call different subfunctions for the different types of changes, and
those func... | [
"Generates",
"queries",
"to",
"upgrade",
"an",
"existing",
"database",
"with",
"the",
"changes",
"stored",
"in",
"$this",
"-",
">",
"diffSchema",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L208-L224 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php | ezcDbSchemaCommonSqlWriter.generateDiffSchemaTableAsSql | protected function generateDiffSchemaTableAsSql( $tableName, ezcDbSchemaTableDiff $tableDiff )
{
foreach ( $tableDiff->removedIndexes as $indexName => $isRemoved )
{
if ( $isRemoved )
{
$this->generateDropIndexSql( $tableName, $indexName );
}
... | php | protected function generateDiffSchemaTableAsSql( $tableName, ezcDbSchemaTableDiff $tableDiff )
{
foreach ( $tableDiff->removedIndexes as $indexName => $isRemoved )
{
if ( $isRemoved )
{
$this->generateDropIndexSql( $tableName, $indexName );
}
... | [
"protected",
"function",
"generateDiffSchemaTableAsSql",
"(",
"$",
"tableName",
",",
"ezcDbSchemaTableDiff",
"$",
"tableDiff",
")",
"{",
"foreach",
"(",
"$",
"tableDiff",
"->",
"removedIndexes",
"as",
"$",
"indexName",
"=>",
"$",
"isRemoved",
")",
"{",
"if",
"("... | Generates queries to upgrade a the table $tableName with the differences in $tableDiff.
This method generates queries to migrate a table to a new version
with the changes that are stored in the $tableDiff property. It
will call different subfunctions for the different types of changes, and
those functions will add que... | [
"Generates",
"queries",
"to",
"upgrade",
"a",
"the",
"table",
"$tableName",
"with",
"the",
"differences",
"in",
"$tableDiff",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/common_sql_writer.php#L238-L280 |
jim-moser/zf2-validators-empty-or | src/OrChain.php | OrChain.attachByName | public function attachByName($name,
$options = array(),
$showMessages = true,
$priority = self::DEFAULT_PRIORITY)
{
$validator = $this->plugin($name, $options);
if (isset($options['show_messages'])) {
... | php | public function attachByName($name,
$options = array(),
$showMessages = true,
$priority = self::DEFAULT_PRIORITY)
{
$validator = $this->plugin($name, $options);
if (isset($options['show_messages'])) {
... | [
"public",
"function",
"attachByName",
"(",
"$",
"name",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"showMessages",
"=",
"true",
",",
"$",
"priority",
"=",
"self",
"::",
"DEFAULT_PRIORITY",
")",
"{",
"$",
"validator",
"=",
"$",
"this",
"->",... | Uses plugin manager to add validator by name.
@param string $name
@param array $options
@param boolean $showMessages Show messages for this validator
on failure.
@param int $priority Validator's priority.
@return self | [
"Uses",
"plugin",
"manager",
"to",
"add",
"validator",
"by",
"name",
"."
] | train | https://github.com/jim-moser/zf2-validators-empty-or/blob/12f799e18ff59986c23ff3f934702834046438f2/src/OrChain.php#L222-L236 |
jim-moser/zf2-validators-empty-or | src/OrChain.php | OrChain.prependByName | public function prependByName($name,
$options = array(),
$showMessages = true)
{
$validator = $this->plugin($name, $options);
//To do. Investigate why Zend\Validator\ValidatorChain does not check
//for $options['break_on_... | php | public function prependByName($name,
$options = array(),
$showMessages = true)
{
$validator = $this->plugin($name, $options);
//To do. Investigate why Zend\Validator\ValidatorChain does not check
//for $options['break_on_... | [
"public",
"function",
"prependByName",
"(",
"$",
"name",
",",
"$",
"options",
"=",
"array",
"(",
")",
",",
"$",
"showMessages",
"=",
"true",
")",
"{",
"$",
"validator",
"=",
"$",
"this",
"->",
"plugin",
"(",
"$",
"name",
",",
"$",
"options",
")",
"... | Uses plugin manager to prepend validator by name.
@param string $name
@param array $options
@param boolean $showMessages Show messages for this validator
on failure.
@return self | [
"Uses",
"plugin",
"manager",
"to",
"prepend",
"validator",
"by",
"name",
"."
] | train | https://github.com/jim-moser/zf2-validators-empty-or/blob/12f799e18ff59986c23ff3f934702834046438f2/src/OrChain.php#L247-L260 |
jim-moser/zf2-validators-empty-or | src/OrChain.php | OrChain.isValid | public function isValid($value, $context = null)
{
$allMessageData = array();
$this->setValue($value);
foreach ($this->validators as $element) {
$validator = $element['instance'];
// Chain is valid if any single validator in chain is valid.
... | php | public function isValid($value, $context = null)
{
$allMessageData = array();
$this->setValue($value);
foreach ($this->validators as $element) {
$validator = $element['instance'];
// Chain is valid if any single validator in chain is valid.
... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"$",
"context",
"=",
"null",
")",
"{",
"$",
"allMessageData",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"setValue",
"(",
"$",
"value",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"vali... | Returns true if $value is valid for any validator in chain.
The validators are run in the order in which they appear in the priority
queue. If any validator in the chain validates then the chain is
considered valid and validation is not performed on any trailing
validators.
@param mixed $value
@param mixed $context... | [
"Returns",
"true",
"if",
"$value",
"is",
"valid",
"for",
"any",
"validator",
"in",
"chain",
"."
] | train | https://github.com/jim-moser/zf2-validators-empty-or/blob/12f799e18ff59986c23ff3f934702834046438f2/src/OrChain.php#L274-L302 |
jim-moser/zf2-validators-empty-or | src/OrChain.php | OrChain.getValidators | public function getValidators()
{
$allValidatorData = $this->validators->
toArray(PriorityQueue::EXTR_DATA);
foreach ($allValidatorData as $key => $validatorData) {
$allValidatorData[$key] = $validatorData['instance'];
}
return ... | php | public function getValidators()
{
$allValidatorData = $this->validators->
toArray(PriorityQueue::EXTR_DATA);
foreach ($allValidatorData as $key => $validatorData) {
$allValidatorData[$key] = $validatorData['instance'];
}
return ... | [
"public",
"function",
"getValidators",
"(",
")",
"{",
"$",
"allValidatorData",
"=",
"$",
"this",
"->",
"validators",
"->",
"toArray",
"(",
"PriorityQueue",
"::",
"EXTR_DATA",
")",
";",
"foreach",
"(",
"$",
"allValidatorData",
"as",
"$",
"key",
"=>",
"$",
"... | Returns array of all validators.
@return PriorityQueue | [
"Returns",
"array",
"of",
"all",
"validators",
"."
] | train | https://github.com/jim-moser/zf2-validators-empty-or/blob/12f799e18ff59986c23ff3f934702834046438f2/src/OrChain.php#L376-L384 |
activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encode | public function encode($action_result, ServerRequestInterface $request, ResponseInterface $response)
{
if ($action_result instanceof ResponseInterface) {
return $action_result;
}
if ($action_result instanceof FileDownloadResponse) {
return $action_result->createPsrRe... | php | public function encode($action_result, ServerRequestInterface $request, ResponseInterface $response)
{
if ($action_result instanceof ResponseInterface) {
return $action_result;
}
if ($action_result instanceof FileDownloadResponse) {
return $action_result->createPsrRe... | [
"public",
"function",
"encode",
"(",
"$",
"action_result",
",",
"ServerRequestInterface",
"$",
"request",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"if",
"(",
"$",
"action_result",
"instanceof",
"ResponseInterface",
")",
"{",
"return",
"$",
"action_resu... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L51-L84 |
activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeArray | protected function encodeArray(array $action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | php | protected function encodeArray(array $action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | [
"protected",
"function",
"encodeArray",
"(",
"array",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"200",
")",
"{",
"return",
"$",
"response",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"action_result",
")",
")"... | Encode regular array response, with status 200.
@param array $action_result
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"regular",
"array",
"response",
"with",
"status",
"200",
"."
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L107-L110 |
activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeScalar | protected function encodeScalar($action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | php | protected function encodeScalar($action_result, ResponseInterface $response, $status = 200)
{
return $response->write(json_encode($action_result))->withStatus($status);
} | [
"protected",
"function",
"encodeScalar",
"(",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"200",
")",
"{",
"return",
"$",
"response",
"->",
"write",
"(",
"json_encode",
"(",
"$",
"action_result",
")",
")",
"->",
... | Encode scalar value, with status 200.
@param mixed $action_result
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"scalar",
"value",
"with",
"status",
"200",
"."
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L120-L123 |
activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeStatus | protected function encodeStatus(StatusResponse $action_result, ResponseInterface $response)
{
$response = $response->withStatus($action_result->getHttpCode(), $action_result->getMessage());
if ($action_result->getHttpCode() >= 400) {
$response = $response->write(json_encode(['message' =... | php | protected function encodeStatus(StatusResponse $action_result, ResponseInterface $response)
{
$response = $response->withStatus($action_result->getHttpCode(), $action_result->getMessage());
if ($action_result->getHttpCode() >= 400) {
$response = $response->write(json_encode(['message' =... | [
"protected",
"function",
"encodeStatus",
"(",
"StatusResponse",
"$",
"action_result",
",",
"ResponseInterface",
"$",
"response",
")",
"{",
"$",
"response",
"=",
"$",
"response",
"->",
"withStatus",
"(",
"$",
"action_result",
"->",
"getHttpCode",
"(",
")",
",",
... | Encode and return status response.
@param StatusResponse $action_result
@param ResponseInterface $response
@return ResponseInterface | [
"Encode",
"and",
"return",
"status",
"response",
"."
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L132-L141 |
activecollab/controller | src/ResultEncoder/ResultEncoder.php | ResultEncoder.encodeException | protected function encodeException($exception, ResponseInterface $response, $status = 500)
{
$error = ['message' => $exception->getMessage(), 'type' => get_class($exception)];
if ($this->getDisplayErrorDetails()) {
$error['exception'] = [];
do {
$error['exce... | php | protected function encodeException($exception, ResponseInterface $response, $status = 500)
{
$error = ['message' => $exception->getMessage(), 'type' => get_class($exception)];
if ($this->getDisplayErrorDetails()) {
$error['exception'] = [];
do {
$error['exce... | [
"protected",
"function",
"encodeException",
"(",
"$",
"exception",
",",
"ResponseInterface",
"$",
"response",
",",
"$",
"status",
"=",
"500",
")",
"{",
"$",
"error",
"=",
"[",
"'message'",
"=>",
"$",
"exception",
"->",
"getMessage",
"(",
")",
",",
"'type'"... | Encode and return exception.
@param Throwable|Exception $exception
@param ResponseInterface $response
@param int $status
@return ResponseInterface | [
"Encode",
"and",
"return",
"exception",
"."
] | train | https://github.com/activecollab/controller/blob/51d24f3f203f7f5ae56edde2e35b5ef2d9293caa/src/ResultEncoder/ResultEncoder.php#L151-L171 |
zicht/z | src/Zicht/Tool/Application.php | Application.renderException | public function renderException($e, $output)
{
if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) {
parent::renderException($e, $output);
} else {
/** @var $ancestry \Exception[] */
$ancestry = array();
$maxLength = 0;
do {
... | php | public function renderException($e, $output)
{
if ($output->getVerbosity() > OutputInterface::VERBOSITY_VERBOSE) {
parent::renderException($e, $output);
} else {
/** @var $ancestry \Exception[] */
$ancestry = array();
$maxLength = 0;
do {
... | [
"public",
"function",
"renderException",
"(",
"$",
"e",
",",
"$",
"output",
")",
"{",
"if",
"(",
"$",
"output",
"->",
"getVerbosity",
"(",
")",
">",
"OutputInterface",
"::",
"VERBOSITY_VERBOSE",
")",
"{",
"parent",
"::",
"renderException",
"(",
"$",
"e",
... | Custom exception rendering, renders only the exception types and messages, hierarchically, but with regular
formatting if verbosity is higher.
@param \Exception $e
@param \Symfony\Component\Console\Output\OutputInterface $output
@return void | [
"Custom",
"exception",
"rendering",
"renders",
"only",
"the",
"exception",
"types",
"and",
"messages",
"hierarchically",
"but",
"with",
"regular",
"formatting",
"if",
"verbosity",
"is",
"higher",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Application.php#L66-L98 |
zicht/z | src/Zicht/Tool/Application.php | Application.getContainer | public function getContainer($forceRecompile = false)
{
if (null === $this->container) {
$config = $this->loader->processConfiguration();
$config['z']['sources'] = $this->loader->getSourceFiles();
$config['z']['cache_file'] = sys_get_temp_dir() . '/z_' . $this->getCacheKe... | php | public function getContainer($forceRecompile = false)
{
if (null === $this->container) {
$config = $this->loader->processConfiguration();
$config['z']['sources'] = $this->loader->getSourceFiles();
$config['z']['cache_file'] = sys_get_temp_dir() . '/z_' . $this->getCacheKe... | [
"public",
"function",
"getContainer",
"(",
"$",
"forceRecompile",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"container",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"loader",
"->",
"processConfiguration",
"(",
")",
";",
... | Returns the container instance, and initializes it if not yet available.
@param bool $forceRecompile
@return Container | [
"Returns",
"the",
"container",
"instance",
"and",
"initializes",
"it",
"if",
"not",
"yet",
"available",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Application.php#L134-L152 |
OKTOTV/OktolabMediaBundle | Controller/SeriesController.php | SeriesController.newAction | public function newAction(Request $request)
{
$series = $this->get('oktolab_media')->createSeries();
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.new_series_button', 'attr' => ['class' => 'btn btn-primary']]);
... | php | public function newAction(Request $request)
{
$series = $this->get('oktolab_media')->createSeries();
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.new_series_button', 'attr' => ['class' => 'btn btn-primary']]);
... | [
"public",
"function",
"newAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"series",
"=",
"$",
"this",
"->",
"get",
"(",
"'oktolab_media'",
")",
"->",
"createSeries",
"(",
")",
";",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"Series... | Displays a form to create a new Series entity.
@Route("/new", name="oktolab_series_new")
@Method({"GET", "POST"})
@Template() | [
"Displays",
"a",
"form",
"to",
"create",
"a",
"new",
"Series",
"entity",
"."
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/SeriesController.php#L60-L84 |
OKTOTV/OktolabMediaBundle | Controller/SeriesController.php | SeriesController.showAction | public function showAction($series)
{
$series = $this->get('oktolab_media')->getSeries($series);
if ($series) {
return ['series' => $series];
}
$this->get('session')->getFlashBag()->add(
'info',
'oktolab_media.series_not_found'
);
... | php | public function showAction($series)
{
$series = $this->get('oktolab_media')->getSeries($series);
if ($series) {
return ['series' => $series];
}
$this->get('session')->getFlashBag()->add(
'info',
'oktolab_media.series_not_found'
);
... | [
"public",
"function",
"showAction",
"(",
"$",
"series",
")",
"{",
"$",
"series",
"=",
"$",
"this",
"->",
"get",
"(",
"'oktolab_media'",
")",
"->",
"getSeries",
"(",
"$",
"series",
")",
";",
"if",
"(",
"$",
"series",
")",
"{",
"return",
"[",
"'series'... | Finds and displays a Series entity.
@ParamConverter("series", class="OktolabMediaBundle:Series")
@Method("GET")
@Template() | [
"Finds",
"and",
"displays",
"a",
"Series",
"entity",
"."
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/SeriesController.php#L93-L105 |
OKTOTV/OktolabMediaBundle | Controller/SeriesController.php | SeriesController.editAction | public function editAction(Request $request, $series)
{
$series = $this->get('oktolab_media')->getSeries($series);
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.edit_series_button', 'attr' => ['class' => 'btn btn-pri... | php | public function editAction(Request $request, $series)
{
$series = $this->get('oktolab_media')->getSeries($series);
$form = $this->createForm(SeriesType::class, $series);
$form->add('submit', SubmitType::class, ['label' => 'oktolab_media.edit_series_button', 'attr' => ['class' => 'btn btn-pri... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
",",
"$",
"series",
")",
"{",
"$",
"series",
"=",
"$",
"this",
"->",
"get",
"(",
"'oktolab_media'",
")",
"->",
"getSeries",
"(",
"$",
"series",
")",
";",
"$",
"form",
"=",
"$",
"this... | Displays a form to edit an existing Series entity.
@ ParamConverter("series", class="OktolabMediaBundle:Series")
@Method({"GET", "POST"})
@Template() | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"Series",
"entity",
"."
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/SeriesController.php#L114-L143 |
thupan/framework | src/Generator/Generator.php | Generator.setHeader | private function setHeader()
{
$campos = $_REQUEST['campos'];
if ($campos) {
foreach ($campos as $index => $key) {
$key2 = explode(':', $key)[1];
$label = explode('_', $key2);
$label = (strtolower($label[0]) == 'id') ? '#' : $label[1];... | php | private function setHeader()
{
$campos = $_REQUEST['campos'];
if ($campos) {
foreach ($campos as $index => $key) {
$key2 = explode(':', $key)[1];
$label = explode('_', $key2);
$label = (strtolower($label[0]) == 'id') ? '#' : $label[1];... | [
"private",
"function",
"setHeader",
"(",
")",
"{",
"$",
"campos",
"=",
"$",
"_REQUEST",
"[",
"'campos'",
"]",
";",
"if",
"(",
"$",
"campos",
")",
"{",
"foreach",
"(",
"$",
"campos",
"as",
"$",
"index",
"=>",
"$",
"key",
")",
"{",
"$",
"key2",
"="... | /*
<tr>
<th>#</th>
<th>LOGIN</th>
<th>FUNCIONÁRIO</th>
<th>UNIDADE GESTORA</th>
<th>MOTIVO</th>
<th>AÇÕES</th>
</tr>
<tr class="search-fields">
<form class="form-fields">
<td><input name="USUARIO.ID_USUARIO" class="form-control" type='text'/></td>
<td><input name="USUARIO.TX_LOGIN" class="form-control" type='text'/></... | [
"/",
"*"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Generator/Generator.php#L243-L258 |
thupan/framework | src/Generator/Generator.php | Generator.getFieldType | private function getFieldType($type = false, $label = false)
{
if (!$type) {
return false;
}
$html = "\n<div class='col-md-12'>\n";
switch ($type) {
case 1:
$html .= "
<div class='form-group'>
<label class='form-control-label obrigato... | php | private function getFieldType($type = false, $label = false)
{
if (!$type) {
return false;
}
$html = "\n<div class='col-md-12'>\n";
switch ($type) {
case 1:
$html .= "
<div class='form-group'>
<label class='form-control-label obrigato... | [
"private",
"function",
"getFieldType",
"(",
"$",
"type",
"=",
"false",
",",
"$",
"label",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"type",
")",
"{",
"return",
"false",
";",
"}",
"$",
"html",
"=",
"\"\\n<div class='col-md-12'>\\n\"",
";",
"switch",
... | } | [
"}"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Generator/Generator.php#L317-L503 |
richardhj/contao-widget-upload-preview | src/FormUploadPreview.php | FormUploadPreview.validate | public function validate()
{
// Delete the file when requested
if (true === $this->enableReset && $this->getPost($this->strName.'_reset')) {
if (null !== ($fileModel = FilesModel::findByPk($this->varValue))) {
$file = new File($fileModel->path);
$file->del... | php | public function validate()
{
// Delete the file when requested
if (true === $this->enableReset && $this->getPost($this->strName.'_reset')) {
if (null !== ($fileModel = FilesModel::findByPk($this->varValue))) {
$file = new File($fileModel->path);
$file->del... | [
"public",
"function",
"validate",
"(",
")",
"{",
"// Delete the file when requested",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"enableReset",
"&&",
"$",
"this",
"->",
"getPost",
"(",
"$",
"this",
"->",
"strName",
".",
"'_reset'",
")",
")",
"{",
"if",
... | Validate the user input and set the value.
@throws \Exception | [
"Validate",
"the",
"user",
"input",
"and",
"set",
"the",
"value",
"."
] | train | https://github.com/richardhj/contao-widget-upload-preview/blob/5de3488ad55c69cd311ff26e749a74097b7a9db1/src/FormUploadPreview.php#L133-L157 |
richardhj/contao-widget-upload-preview | src/FormUploadPreview.php | FormUploadPreview.generate | public function generate()
{
$return = '';
if (empty($this->thumbnailSize)) {
$this->thumbnailSize = [
Config::get('imageWidth'),
Config::get('imageHeight'),
'box',
];
}
$file = FilesModel::findByPk($this->varV... | php | public function generate()
{
$return = '';
if (empty($this->thumbnailSize)) {
$this->thumbnailSize = [
Config::get('imageWidth'),
Config::get('imageHeight'),
'box',
];
}
$file = FilesModel::findByPk($this->varV... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"return",
"=",
"''",
";",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"thumbnailSize",
")",
")",
"{",
"$",
"this",
"->",
"thumbnailSize",
"=",
"[",
"Config",
"::",
"get",
"(",
"'imageWidth'",
")",... | Generate the widget and return it as string
@return string | [
"Generate",
"the",
"widget",
"and",
"return",
"it",
"as",
"string"
] | train | https://github.com/richardhj/contao-widget-upload-preview/blob/5de3488ad55c69cd311ff26e749a74097b7a9db1/src/FormUploadPreview.php#L164-L209 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.create | public function create($uid, $stream)
{
return new $this->mailClass(
$uid,
$stream,
$this->parseMailHeader($stream, $uid),
$this->parseHeaders($stream, $uid),
$this->parseBody($stream, $uid)
);
} | php | public function create($uid, $stream)
{
return new $this->mailClass(
$uid,
$stream,
$this->parseMailHeader($stream, $uid),
$this->parseHeaders($stream, $uid),
$this->parseBody($stream, $uid)
);
} | [
"public",
"function",
"create",
"(",
"$",
"uid",
",",
"$",
"stream",
")",
"{",
"return",
"new",
"$",
"this",
"->",
"mailClass",
"(",
"$",
"uid",
",",
"$",
"stream",
",",
"$",
"this",
"->",
"parseMailHeader",
"(",
"$",
"stream",
",",
"$",
"uid",
")"... | Create new mail from uid
@param int $uid
@param resource $stream
@return \MailMap\Contracts\Mail | [
"Create",
"new",
"mail",
"from",
"uid"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L65-L74 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseMailHeader | protected function parseMailHeader($stream, $uid)
{
$header = imap_headerinfo($stream, imap_msgno($stream, $uid));
return [
'msgNo' => (int) $header->Msgno,
'subject' => $this->parseSubject($header->subject),
'date' => $header->udate,
'to' => isset($h... | php | protected function parseMailHeader($stream, $uid)
{
$header = imap_headerinfo($stream, imap_msgno($stream, $uid));
return [
'msgNo' => (int) $header->Msgno,
'subject' => $this->parseSubject($header->subject),
'date' => $header->udate,
'to' => isset($h... | [
"protected",
"function",
"parseMailHeader",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
"{",
"$",
"header",
"=",
"imap_headerinfo",
"(",
"$",
"stream",
",",
"imap_msgno",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
")",
";",
"return",
"[",
"'msgNo'",
"=>",... | Parse the mail header
@param resource $stream
@param int $uid
@return array | [
"Parse",
"the",
"mail",
"header"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L83-L110 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseAddress | protected function parseAddress(array $addresses)
{
return array_map(function ($address) {
return (object) [
'address' => $address->mailbox.'@'.$address->host,
'domain' => $address->host,
'name' => isset($address->personal)
? st... | php | protected function parseAddress(array $addresses)
{
return array_map(function ($address) {
return (object) [
'address' => $address->mailbox.'@'.$address->host,
'domain' => $address->host,
'name' => isset($address->personal)
? st... | [
"protected",
"function",
"parseAddress",
"(",
"array",
"$",
"addresses",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"address",
")",
"{",
"return",
"(",
"object",
")",
"[",
"'address'",
"=>",
"$",
"address",
"->",
"mailbox",
".",
"'@'",
"... | Parse email addresses from header
@param array $addresses
@return array | [
"Parse",
"email",
"addresses",
"from",
"header"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L118-L131 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseSubject | protected function parseSubject($subject)
{
$subject = imap_mime_header_decode($subject);
$subjectParts = array_map(function ($subj) {
if (strtolower($subj->charset) === 'default') {
return $subj->text;
}
return iconv($subj->charset, static::$char... | php | protected function parseSubject($subject)
{
$subject = imap_mime_header_decode($subject);
$subjectParts = array_map(function ($subj) {
if (strtolower($subj->charset) === 'default') {
return $subj->text;
}
return iconv($subj->charset, static::$char... | [
"protected",
"function",
"parseSubject",
"(",
"$",
"subject",
")",
"{",
"$",
"subject",
"=",
"imap_mime_header_decode",
"(",
"$",
"subject",
")",
";",
"$",
"subjectParts",
"=",
"array_map",
"(",
"function",
"(",
"$",
"subj",
")",
"{",
"if",
"(",
"strtolowe... | Parse the subject of the email
@param string $subject
@return string | [
"Parse",
"the",
"subject",
"of",
"the",
"email"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L151-L163 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseHeaders | protected function parseHeaders($stream, $uid)
{
$rawHeaders = imap_fetchheader($stream, $uid, static::$fetchFlags);
$headers = [];
$key = null;
foreach (explode("\n", $rawHeaders) as $line) {
// Test if continutation
if ($line !== '' && !preg_match('/^\s/',... | php | protected function parseHeaders($stream, $uid)
{
$rawHeaders = imap_fetchheader($stream, $uid, static::$fetchFlags);
$headers = [];
$key = null;
foreach (explode("\n", $rawHeaders) as $line) {
// Test if continutation
if ($line !== '' && !preg_match('/^\s/',... | [
"protected",
"function",
"parseHeaders",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
"{",
"$",
"rawHeaders",
"=",
"imap_fetchheader",
"(",
"$",
"stream",
",",
"$",
"uid",
",",
"static",
"::",
"$",
"fetchFlags",
")",
";",
"$",
"headers",
"=",
"[",
"]",
... | Parse the email headers into array structure
@param resource $stream
@param int $uid
@return array | [
"Parse",
"the",
"email",
"headers",
"into",
"array",
"structure"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L172-L196 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseNestedKeyPairHeader | protected function parseNestedKeyPairHeader($nestedPairs)
{
return array_reduce(explode(';', $nestedPairs), function($result, $pair) {
$keyVal = explode('=', $pair, 2);
$key = trim(array_shift($keyVal));
$val = trim(implode('=', $keyVal));
if ($key !== '' && $... | php | protected function parseNestedKeyPairHeader($nestedPairs)
{
return array_reduce(explode(';', $nestedPairs), function($result, $pair) {
$keyVal = explode('=', $pair, 2);
$key = trim(array_shift($keyVal));
$val = trim(implode('=', $keyVal));
if ($key !== '' && $... | [
"protected",
"function",
"parseNestedKeyPairHeader",
"(",
"$",
"nestedPairs",
")",
"{",
"return",
"array_reduce",
"(",
"explode",
"(",
"';'",
",",
"$",
"nestedPairs",
")",
",",
"function",
"(",
"$",
"result",
",",
"$",
"pair",
")",
"{",
"$",
"keyVal",
"=",... | Parse the any nested key-pair values in the header value
@param string $nestedPairs
@return array | [
"Parse",
"the",
"any",
"nested",
"key",
"-",
"pair",
"values",
"in",
"the",
"header",
"value"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L204-L215 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parseBody | protected function parseBody($stream, $uid)
{
$struct = imap_fetchstructure($stream, $uid, static::$fetchFlags);
if (!isset($struct->parts)) {
return array_filter([$this->parsePart($stream, $uid, $struct)]);
}
$parsedParts = [];
foreach ($this->flattenParts($str... | php | protected function parseBody($stream, $uid)
{
$struct = imap_fetchstructure($stream, $uid, static::$fetchFlags);
if (!isset($struct->parts)) {
return array_filter([$this->parsePart($stream, $uid, $struct)]);
}
$parsedParts = [];
foreach ($this->flattenParts($str... | [
"protected",
"function",
"parseBody",
"(",
"$",
"stream",
",",
"$",
"uid",
")",
"{",
"$",
"struct",
"=",
"imap_fetchstructure",
"(",
"$",
"stream",
",",
"$",
"uid",
",",
"static",
"::",
"$",
"fetchFlags",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
... | Parse the email body and its parts
@param resource $stream
@param int $uid
@return array | [
"Parse",
"the",
"email",
"body",
"and",
"its",
"parts"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L224-L237 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.flattenParts | protected function flattenParts(array $parts, array $flattened = [], $pre = '', $idx = 1, $full = true)
{
foreach ($parts as $part) {
$key = $pre.$idx;
$flattened[$key] = $part;
if (isset($part->parts)) {
if ($part->type == TYPEMULTIPART) {
$flattened = $th... | php | protected function flattenParts(array $parts, array $flattened = [], $pre = '', $idx = 1, $full = true)
{
foreach ($parts as $part) {
$key = $pre.$idx;
$flattened[$key] = $part;
if (isset($part->parts)) {
if ($part->type == TYPEMULTIPART) {
$flattened = $th... | [
"protected",
"function",
"flattenParts",
"(",
"array",
"$",
"parts",
",",
"array",
"$",
"flattened",
"=",
"[",
"]",
",",
"$",
"pre",
"=",
"''",
",",
"$",
"idx",
"=",
"1",
",",
"$",
"full",
"=",
"true",
")",
"{",
"foreach",
"(",
"$",
"parts",
"as"... | Flatten email structure recursively.
Parts re-keyed as 1, 1.1, 2, 2.1, 2.1.1 etc
@param array $parts
@param array $flattened
@param string $pre
@param int $idx
@param bool $full
@return array | [
"Flatten",
"email",
"structure",
"recursively",
"."
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L251-L270 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.parsePart | protected function parsePart($stream, $uid, $part, $partNo = 1)
{
if (!in_array($part->type, [TYPETEXT, TYPEMULTIPART])) {
return null;
}
$body = imap_fetchbody($stream, $uid, $partNo, static::$bodyFlags);
$body = static::decode($body, $part->encoding);
if ('' !... | php | protected function parsePart($stream, $uid, $part, $partNo = 1)
{
if (!in_array($part->type, [TYPETEXT, TYPEMULTIPART])) {
return null;
}
$body = imap_fetchbody($stream, $uid, $partNo, static::$bodyFlags);
$body = static::decode($body, $part->encoding);
if ('' !... | [
"protected",
"function",
"parsePart",
"(",
"$",
"stream",
",",
"$",
"uid",
",",
"$",
"part",
",",
"$",
"partNo",
"=",
"1",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"part",
"->",
"type",
",",
"[",
"TYPETEXT",
",",
"TYPEMULTIPART",
"]",
")",
... | Parse individual part of the structure
@param resource $stream
@param int $uid
@param stdClass $part
@param int $partNo
@return stdClass | null | [
"Parse",
"individual",
"part",
"of",
"the",
"structure"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L281-L298 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.decode | protected static function decode($body, $encoding)
{
if (ENCQUOTEDPRINTABLE === $encoding) {
return quoted_printable_decode($body);
}
if (ENCBASE64 === $encoding) {
return base64_decode($body);
}
return $body;
} | php | protected static function decode($body, $encoding)
{
if (ENCQUOTEDPRINTABLE === $encoding) {
return quoted_printable_decode($body);
}
if (ENCBASE64 === $encoding) {
return base64_decode($body);
}
return $body;
} | [
"protected",
"static",
"function",
"decode",
"(",
"$",
"body",
",",
"$",
"encoding",
")",
"{",
"if",
"(",
"ENCQUOTEDPRINTABLE",
"===",
"$",
"encoding",
")",
"{",
"return",
"quoted_printable_decode",
"(",
"$",
"body",
")",
";",
"}",
"if",
"(",
"ENCBASE64",
... | Decode the body text
@param string $body
@param int $encoding
@return string | [
"Decode",
"the",
"body",
"text"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L307-L318 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.convertBodyEncoding | protected static function convertBodyEncoding($body, $charset = '', $encoding = -1)
{
if ('' === $charset) {
$charset = static::$charset;
}
if (!mb_check_encoding($body, $charset)) {
$charset = mb_detect_encoding($body);
}
if ($charset === static::$c... | php | protected static function convertBodyEncoding($body, $charset = '', $encoding = -1)
{
if ('' === $charset) {
$charset = static::$charset;
}
if (!mb_check_encoding($body, $charset)) {
$charset = mb_detect_encoding($body);
}
if ($charset === static::$c... | [
"protected",
"static",
"function",
"convertBodyEncoding",
"(",
"$",
"body",
",",
"$",
"charset",
"=",
"''",
",",
"$",
"encoding",
"=",
"-",
"1",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"charset",
")",
"{",
"$",
"charset",
"=",
"static",
"::",
"$",
"... | Convert body encoding from given coding to default
@param string $body
@param string $charset
@param int $encoding
@return string | [
"Convert",
"body",
"encoding",
"from",
"given",
"coding",
"to",
"default"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L328-L347 |
david-mk/mail-map | src/MailMap/MailFactory.php | MailFactory.findCharset | protected function findCharset($struct)
{
if (isset($struct->parameters)) {
foreach ($struct->parameters as $param) {
if (strtolower($param->attribute) === 'charset') {
return strtoupper($param->value);
}
}
}
if (iss... | php | protected function findCharset($struct)
{
if (isset($struct->parameters)) {
foreach ($struct->parameters as $param) {
if (strtolower($param->attribute) === 'charset') {
return strtoupper($param->value);
}
}
}
if (iss... | [
"protected",
"function",
"findCharset",
"(",
"$",
"struct",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"struct",
"->",
"parameters",
")",
")",
"{",
"foreach",
"(",
"$",
"struct",
"->",
"parameters",
"as",
"$",
"param",
")",
"{",
"if",
"(",
"strtolower",
... | Locate the charset within the struct
@param stdClass $struct
@return string | [
"Locate",
"the",
"charset",
"within",
"the",
"struct"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/MailFactory.php#L355-L373 |
hametuha/wpametu | src/WPametu/UI/Admin/Screen.php | Screen.adminMenu | public function adminMenu(){
if( $this->parent ){
add_submenu_page($this->parent, $this->title, $this->menu_title, $this->caps, $this->slug, array($this, 'render'));
}else{
add_menu_page($this->title, $this->menu_title, $this->caps, $this->slug, array($this, 'render'), $this->icon, $this->position);
}
} | php | public function adminMenu(){
if( $this->parent ){
add_submenu_page($this->parent, $this->title, $this->menu_title, $this->caps, $this->slug, array($this, 'render'));
}else{
add_menu_page($this->title, $this->menu_title, $this->caps, $this->slug, array($this, 'render'), $this->icon, $this->position);
}
} | [
"public",
"function",
"adminMenu",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"parent",
")",
"{",
"add_submenu_page",
"(",
"$",
"this",
"->",
"parent",
",",
"$",
"this",
"->",
"title",
",",
"$",
"this",
"->",
"menu_title",
",",
"$",
"this",
"->",
... | Add menu | [
"Add",
"menu"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Admin/Screen.php#L101-L107 |
hametuha/wpametu | src/WPametu/UI/Admin/Screen.php | Screen.load | protected function load($template){
$template = get_stylesheet_directory()."/templates/admin/{$template}.php";
/**
* wpametu_admin_screen_template
*
* @param string $template
* @param string $class_name
* @return string
*/
$template = apply_filters('wpametu_admin_screen_template', $template, get... | php | protected function load($template){
$template = get_stylesheet_directory()."/templates/admin/{$template}.php";
/**
* wpametu_admin_screen_template
*
* @param string $template
* @param string $class_name
* @return string
*/
$template = apply_filters('wpametu_admin_screen_template', $template, get... | [
"protected",
"function",
"load",
"(",
"$",
"template",
")",
"{",
"$",
"template",
"=",
"get_stylesheet_directory",
"(",
")",
".",
"\"/templates/admin/{$template}.php\"",
";",
"/**\n\t\t * wpametu_admin_screen_template\n\t\t *\n\t\t * @param string $template\n\t\t * @param string $c... | Load template
@param string $template | [
"Load",
"template"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/UI/Admin/Screen.php#L160-L173 |
inhere/php-librarys | src/Collections/FixedArray.php | FixedArray.offsetUnset | public function offsetUnset($offset)
{
$index = $this->getKeyIndex($offset);
if ($index >= 0) {
// change size.
$this->values->setSize($index - 1);
unset($this->keys[$offset], $this->values[$index]);
}
} | php | public function offsetUnset($offset)
{
$index = $this->getKeyIndex($offset);
if ($index >= 0) {
// change size.
$this->values->setSize($index - 1);
unset($this->keys[$offset], $this->values[$index]);
}
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"offset",
")",
"{",
"$",
"index",
"=",
"$",
"this",
"->",
"getKeyIndex",
"(",
"$",
"offset",
")",
";",
"if",
"(",
"$",
"index",
">=",
"0",
")",
"{",
"// change size.",
"$",
"this",
"->",
"values",
"->",
... | Unset an offset in the iterator.
@param mixed $offset The array offset.
@return void | [
"Unset",
"an",
"offset",
"in",
"the",
"iterator",
"."
] | train | https://github.com/inhere/php-librarys/blob/e6ca598685469794f310e3ab0e2bc19519cd0ae6/src/Collections/FixedArray.php#L186-L196 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.linkedTo | public function linkedTo(
string $variable = null,
array $labels = []
): Clause {
$clause = clone $this;
$clause->path = $this->path->linkedTo($variable, $labels);
return $clause;
} | php | public function linkedTo(
string $variable = null,
array $labels = []
): Clause {
$clause = clone $this;
$clause->path = $this->path->linkedTo($variable, $labels);
return $clause;
} | [
"public",
"function",
"linkedTo",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"array",
"$",
"labels",
"=",
"[",
"]",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L24-L32 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.through | public function through(
string $variable = null,
string $type = null,
string $direction = Expression\Relationship::BOTH
): Clause {
$clause = clone $this;
$clause->path = $this->path->through($variable, $type, $direction);
return $clause;
} | php | public function through(
string $variable = null,
string $type = null,
string $direction = Expression\Relationship::BOTH
): Clause {
$clause = clone $this;
$clause->path = $this->path->through($variable, $type, $direction);
return $clause;
} | [
"public",
"function",
"through",
"(",
"string",
"$",
"variable",
"=",
"null",
",",
"string",
"$",
"type",
"=",
"null",
",",
"string",
"$",
"direction",
"=",
"Expression",
"\\",
"Relationship",
"::",
"BOTH",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L37-L46 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withADistanceOf | public function withADistanceOf(int $distance): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceOf($distance);
return $clause;
} | php | public function withADistanceOf(int $distance): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceOf($distance);
return $clause;
} | [
"public",
"function",
"withADistanceOf",
"(",
"int",
"$",
"distance",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withADistanceOf",
"(",
"$",
"distance",
")... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L51-L57 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withADistanceBetween | public function withADistanceBetween(int $min, int $max): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceBetween($min, $max);
return $clause;
} | php | public function withADistanceBetween(int $min, int $max): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceBetween($min, $max);
return $clause;
} | [
"public",
"function",
"withADistanceBetween",
"(",
"int",
"$",
"min",
",",
"int",
"$",
"max",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withADistanceBetwe... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L62-L68 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withADistanceOfAtLeast | public function withADistanceOfAtLeast(int $distance): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceOfAtLeast($distance);
return $clause;
} | php | public function withADistanceOfAtLeast(int $distance): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceOfAtLeast($distance);
return $clause;
} | [
"public",
"function",
"withADistanceOfAtLeast",
"(",
"int",
"$",
"distance",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withADistanceOfAtLeast",
"(",
"$",
"d... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L73-L79 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withADistanceOfAtMost | public function withADistanceOfAtMost(int $distance): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceOfAtMost($distance);
return $clause;
} | php | public function withADistanceOfAtMost(int $distance): Clause
{
$clause = clone $this;
$clause->path = $this->path->withADistanceOfAtMost($distance);
return $clause;
} | [
"public",
"function",
"withADistanceOfAtMost",
"(",
"int",
"$",
"distance",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withADistanceOfAtMost",
"(",
"$",
"dis... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L84-L90 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withAnyDistance | public function withAnyDistance(): Clause
{
$clause = clone $this;
$clause->path = $this->path->withAnyDistance();
return $clause;
} | php | public function withAnyDistance(): Clause
{
$clause = clone $this;
$clause->path = $this->path->withAnyDistance();
return $clause;
} | [
"public",
"function",
"withAnyDistance",
"(",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withAnyDistance",
"(",
")",
";",
"return",
"$",
"clause",
";",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L95-L101 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withProperty | public function withProperty(
string $property,
string $cypher
): Clause {
$clause = clone $this;
$clause->path = $this->path->withProperty($property, $cypher);
return $clause;
} | php | public function withProperty(
string $property,
string $cypher
): Clause {
$clause = clone $this;
$clause->path = $this->path->withProperty($property, $cypher);
return $clause;
} | [
"public",
"function",
"withProperty",
"(",
"string",
"$",
"property",
",",
"string",
"$",
"cypher",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withProperty... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L106-L114 |
Innmind/neo4j-dbal | src/Clause/PathAware/PathAware.php | PathAware.withParameter | public function withParameter(string $key, $value): Clause
{
$clause = clone $this;
$clause->path = $this->path->withParameter($key, $value);
return $clause;
} | php | public function withParameter(string $key, $value): Clause
{
$clause = clone $this;
$clause->path = $this->path->withParameter($key, $value);
return $clause;
} | [
"public",
"function",
"withParameter",
"(",
"string",
"$",
"key",
",",
"$",
"value",
")",
":",
"Clause",
"{",
"$",
"clause",
"=",
"clone",
"$",
"this",
";",
"$",
"clause",
"->",
"path",
"=",
"$",
"this",
"->",
"path",
"->",
"withParameter",
"(",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Innmind/neo4j-dbal/blob/12cb71e698cc0f4d55b7f2eb40f7b353c778a20b/src/Clause/PathAware/PathAware.php#L119-L125 |
php-lug/lug | src/Bundle/StorageBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder
->root('lug_storage')
->children()
->arrayNode('cookie')
->canBeEnabled()
->end()
->arrayNode('doctrine')
... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder
->root('lug_storage')
->children()
->arrayNode('cookie')
->canBeEnabled()
->end()
->arrayNode('doctrine')
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"treeBuilder",
"->",
"root",
"(",
"'lug_storage'",
")",
"->",
"children",
"(",
")",
"->",
"arrayNode",
"(",
"'cookie'",
")",
"->... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/StorageBundle/DependencyInjection/Configuration.php#L25-L49 |
mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php | FileToIntegerTransformer.transform | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof File)) {
throw new TransformationFailedException('Expected an instance of a concrete5 file object.');
}
return intval($value->getFileID())... | php | public function transform($value)
{
if ($value === null || $value == '') {
return null;
}
if (!($value instanceof File)) {
throw new TransformationFailedException('Expected an instance of a concrete5 file object.');
}
return intval($value->getFileID())... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"==",
"''",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"File",
")",
")",
"{",
... | Converts a concrete5 file object to an integer.
@param \Concrete\Core\File\File $value The file object value
@return int The integer value
@throws TransformationFailedException If the given value is not an
instance of Concrete\Core\File\File. | [
"Converts",
"a",
"concrete5",
"file",
"object",
"to",
"an",
"integer",
"."
] | train | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php#L34-L43 |
mainio/c5pkg_symfony_forms | src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php | FileToIntegerTransformer.reverseTransform | public function reverseTransform($fID)
{
if (!is_numeric($fID) || $fID == 0) {
return null;
}
$rep = $this->entityManager->getRepository('Concrete\Core\File\File');
$f = $rep->find($fID);
if (!is_object($f) || $f->isError()) {
throw new Transformatio... | php | public function reverseTransform($fID)
{
if (!is_numeric($fID) || $fID == 0) {
return null;
}
$rep = $this->entityManager->getRepository('Concrete\Core\File\File');
$f = $rep->find($fID);
if (!is_object($f) || $f->isError()) {
throw new Transformatio... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"fID",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"fID",
")",
"||",
"$",
"fID",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"$",
"rep",
"=",
"$",
"this",
"->",
"entityManager",
"->",
... | Converts an integer to a concrete5 file object.
@param int $fID
@return mixed The value
@throws TransformationFailedException If the given value is not a proper
concrete5 file ID. | [
"Converts",
"an",
"integer",
"to",
"a",
"concrete5",
"file",
"object",
"."
] | train | https://github.com/mainio/c5pkg_symfony_forms/blob/41a93c293d986574ec5cade8a7c8700e083dbaaa/src/Mainio/C5/Symfony/Form/Extension/Concrete5/DataTransformer/FileToIntegerTransformer.php#L53-L67 |
cartalyst/assetic-filters | src/SassphpFilter.php | SassphpFilter.filterLoad | public function filterLoad(AssetInterface $asset)
{
$root = $asset->getSourceRoot();
$path = $asset->getSourcePath();
$compiler = new \SassParser($this->presets);
if ($root and $path) {
$compiler->load_paths = array_merge($compiler->load_paths, array($root.'/'.$path));
... | php | public function filterLoad(AssetInterface $asset)
{
$root = $asset->getSourceRoot();
$path = $asset->getSourcePath();
$compiler = new \SassParser($this->presets);
if ($root and $path) {
$compiler->load_paths = array_merge($compiler->load_paths, array($root.'/'.$path));
... | [
"public",
"function",
"filterLoad",
"(",
"AssetInterface",
"$",
"asset",
")",
"{",
"$",
"root",
"=",
"$",
"asset",
"->",
"getSourceRoot",
"(",
")",
";",
"$",
"path",
"=",
"$",
"asset",
"->",
"getSourcePath",
"(",
")",
";",
"$",
"compiler",
"=",
"new",
... | Filters an asset after it has been loaded.
@param \Assetic\Asset\AssetInterface $asset
@return void | [
"Filters",
"an",
"asset",
"after",
"it",
"has",
"been",
"loaded",
"."
] | train | https://github.com/cartalyst/assetic-filters/blob/5e26328f7e46937bf1daa0bee2f744ab3493f471/src/SassphpFilter.php#L48-L62 |
sastrawi/string-span | src/Sastrawi/String/Span/Span.php | Span.contains | public function contains(SpanInterface $span)
{
return $this->start <= $span->getStart() && $span->getEnd() <= $this->end;
} | php | public function contains(SpanInterface $span)
{
return $this->start <= $span->getStart() && $span->getEnd() <= $this->end;
} | [
"public",
"function",
"contains",
"(",
"SpanInterface",
"$",
"span",
")",
"{",
"return",
"$",
"this",
"->",
"start",
"<=",
"$",
"span",
"->",
"getStart",
"(",
")",
"&&",
"$",
"span",
"->",
"getEnd",
"(",
")",
"<=",
"$",
"this",
"->",
"end",
";",
"}... | {@inheritdoc} | [
"{"
] | train | https://github.com/sastrawi/string-span/blob/8e927ea4bf94fcc2f678f31aa3d0a62c74b07fbe/src/Sastrawi/String/Span/Span.php#L104-L107 |
sastrawi/string-span | src/Sastrawi/String/Span/Span.php | Span.startsWith | public function startsWith(SpanInterface $span)
{
return $this->getStart() == $span->getStart() && $this->contains($span);
} | php | public function startsWith(SpanInterface $span)
{
return $this->getStart() == $span->getStart() && $this->contains($span);
} | [
"public",
"function",
"startsWith",
"(",
"SpanInterface",
"$",
"span",
")",
"{",
"return",
"$",
"this",
"->",
"getStart",
"(",
")",
"==",
"$",
"span",
"->",
"getStart",
"(",
")",
"&&",
"$",
"this",
"->",
"contains",
"(",
"$",
"span",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/sastrawi/string-span/blob/8e927ea4bf94fcc2f678f31aa3d0a62c74b07fbe/src/Sastrawi/String/Span/Span.php#L120-L123 |
sastrawi/string-span | src/Sastrawi/String/Span/Span.php | Span.intersects | public function intersects(SpanInterface $span)
{
$sstart = $span->getStart();
//either $span's start is in this or this' start is in $span
return $this->contains($span) || $span->contains($this) ||
$this->getStart() <= $sstart && $sstart < $this->getEnd() ||
$sstart... | php | public function intersects(SpanInterface $span)
{
$sstart = $span->getStart();
//either $span's start is in this or this' start is in $span
return $this->contains($span) || $span->contains($this) ||
$this->getStart() <= $sstart && $sstart < $this->getEnd() ||
$sstart... | [
"public",
"function",
"intersects",
"(",
"SpanInterface",
"$",
"span",
")",
"{",
"$",
"sstart",
"=",
"$",
"span",
"->",
"getStart",
"(",
")",
";",
"//either $span's start is in this or this' start is in $span",
"return",
"$",
"this",
"->",
"contains",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/sastrawi/string-span/blob/8e927ea4bf94fcc2f678f31aa3d0a62c74b07fbe/src/Sastrawi/String/Span/Span.php#L128-L136 |
sastrawi/string-span | src/Sastrawi/String/Span/Span.php | Span.crosses | public function crosses(SpanInterface $span)
{
$sstart = $span->getStart();
//either $span's start is in this or this' start is in $span
return !$this->contains($span) && !$span->contains($this) &&
($this->getStart() <= $sstart && $sstart < $this->getEnd() ||
$sstart <... | php | public function crosses(SpanInterface $span)
{
$sstart = $span->getStart();
//either $span's start is in this or this' start is in $span
return !$this->contains($span) && !$span->contains($this) &&
($this->getStart() <= $sstart && $sstart < $this->getEnd() ||
$sstart <... | [
"public",
"function",
"crosses",
"(",
"SpanInterface",
"$",
"span",
")",
"{",
"$",
"sstart",
"=",
"$",
"span",
"->",
"getStart",
"(",
")",
";",
"//either $span's start is in this or this' start is in $span",
"return",
"!",
"$",
"this",
"->",
"contains",
"(",
"$"... | {@inheritdoc} | [
"{"
] | train | https://github.com/sastrawi/string-span/blob/8e927ea4bf94fcc2f678f31aa3d0a62c74b07fbe/src/Sastrawi/String/Span/Span.php#L141-L149 |
webdevvie/pheanstalk-task-queue-bundle | Command/RegenerateFailedTaskCommand.php | RegenerateFailedTaskCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->initialiseWorker($input, $output);
$id = $input->getOption("id");
$identifier = intval($id);
if (strstr($id, ",")) {
$ids = explode(",", $id);
foreach ($ids as $identifier) {
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->initialiseWorker($input, $output);
$id = $input->getOption("id");
$identifier = intval($id);
if (strstr($id, ",")) {
$ids = explode(",", $id);
foreach ($ids as $identifier) {
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"initialiseWorker",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"id",
"=",
"$",
"input",
"->",
"getOpti... | {@inheritDoc}
@param InputInterface $input
@param OutputInterface $output
@return void
@throws \InvalidArgumentException | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/RegenerateFailedTaskCommand.php#L49-L64 |
webdevvie/pheanstalk-task-queue-bundle | Command/RegenerateFailedTaskCommand.php | RegenerateFailedTaskCommand.regenerateTaskById | private function regenerateTaskById($id)
{
try {
$response = $this->taskQueueService->regenerateTask($id);
if ($response) {
$this->output->writeln("<info>Regeneration succes</info>");
} else {
$this->output->writeln("<error>Regeneration suc... | php | private function regenerateTaskById($id)
{
try {
$response = $this->taskQueueService->regenerateTask($id);
if ($response) {
$this->output->writeln("<info>Regeneration succes</info>");
} else {
$this->output->writeln("<error>Regeneration suc... | [
"private",
"function",
"regenerateTaskById",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"taskQueueService",
"->",
"regenerateTask",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"response",
")",
"{",
"$",
"this",
"->",
... | Regenerates a task that has failed
@param integer $id
@return void | [
"Regenerates",
"a",
"task",
"that",
"has",
"failed"
] | train | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/RegenerateFailedTaskCommand.php#L72-L84 |
eghojansu/moe | src/Instance.php | Instance.__callstatic | static function __callstatic($func,array $args) {
if (!self::$fw)
self::$fw=Base::instance();
return call_user_func_array(array(self::$fw,$func),$args);
} | php | static function __callstatic($func,array $args) {
if (!self::$fw)
self::$fw=Base::instance();
return call_user_func_array(array(self::$fw,$func),$args);
} | [
"static",
"function",
"__callstatic",
"(",
"$",
"func",
",",
"array",
"$",
"args",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"fw",
")",
"self",
"::",
"$",
"fw",
"=",
"Base",
"::",
"instance",
"(",
")",
";",
"return",
"call_user_func_array",
"(",
... | Forward function calls to framework
@return mixed
@param $func callback
@param $args array | [
"Forward",
"function",
"calls",
"to",
"framework"
] | train | https://github.com/eghojansu/moe/blob/f58ec75a3116d1a572782256e2b38bb9aab95e3c/src/Instance.php#L19-L23 |
OKTOTV/OktolabMediaBundle | Controller/PublicApiController.php | PublicApiController.embedEpisodeAction | public function embedEpisodeAction(Request $request)
{
$uniqID = $request->query->get('uniqID');
$episode = $this->get('oktolab_media')->getEpisode($uniqID);
return ['episode' => $episode];
} | php | public function embedEpisodeAction(Request $request)
{
$uniqID = $request->query->get('uniqID');
$episode = $this->get('oktolab_media')->getEpisode($uniqID);
return ['episode' => $episode];
} | [
"public",
"function",
"embedEpisodeAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"uniqID",
"=",
"$",
"request",
"->",
"query",
"->",
"get",
"(",
"'uniqID'",
")",
";",
"$",
"episode",
"=",
"$",
"this",
"->",
"get",
"(",
"'oktolab_media'",
")",
... | TODO: oneOrNone result, respond with empty embed
@Route("/embed/episode", name="oktolab_media_embed_episode")
@Method("GET")
@Template() | [
"TODO",
":",
"oneOrNone",
"result",
"respond",
"with",
"empty",
"embed"
] | train | https://github.com/OKTOTV/OktolabMediaBundle/blob/f9c1eac4f6b19d2ab25288b301dd0d9350478bb3/Controller/PublicApiController.php#L106-L111 |
php-lug/lug | src/Component/Locale/Form/Type/LocaleCodeType.php | LocaleCodeType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$locales = array_flip(array_map(function (LocaleInterface $locale) {
return (string) $locale->getCode();
}, $this->localeRepository->findAll()));
foreach ($view->vars['choices'] as $index => $choice... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$locales = array_flip(array_map(function (LocaleInterface $locale) {
return (string) $locale->getCode();
}, $this->localeRepository->findAll()));
foreach ($view->vars['choices'] as $index => $choice... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"locales",
"=",
"array_flip",
"(",
"array_map",
"(",
"function",
"(",
"LocaleInterface",
"$",
"locale",
")",
"{... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Locale/Form/Type/LocaleCodeType.php#L43-L54 |
zhouyl/mellivora | Mellivora/Database/Migrations/DatabaseMigrationRepository.php | DatabaseMigrationRepository.getMigrations | public function getMigrations($steps)
{
$query = $this->table()->where('batch', '>=', '1');
return $query->orderBy('migration', 'desc')->take($steps)->get()->all();
} | php | public function getMigrations($steps)
{
$query = $this->table()->where('batch', '>=', '1');
return $query->orderBy('migration', 'desc')->take($steps)->get()->all();
} | [
"public",
"function",
"getMigrations",
"(",
"$",
"steps",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"table",
"(",
")",
"->",
"where",
"(",
"'batch'",
",",
"'>='",
",",
"'1'",
")",
";",
"return",
"$",
"query",
"->",
"orderBy",
"(",
"'migration'"... | Get list of migrations.
@param int $steps
@return array | [
"Get",
"list",
"of",
"migrations",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Migrations/DatabaseMigrationRepository.php#L64-L69 |
zhouyl/mellivora | Mellivora/Database/Migrations/DatabaseMigrationRepository.php | DatabaseMigrationRepository.getLast | public function getLast()
{
$query = $this->table()->where('batch', $this->getLastBatchNumber());
return $query->orderBy('migration', 'desc')->get()->all();
} | php | public function getLast()
{
$query = $this->table()->where('batch', $this->getLastBatchNumber());
return $query->orderBy('migration', 'desc')->get()->all();
} | [
"public",
"function",
"getLast",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"table",
"(",
")",
"->",
"where",
"(",
"'batch'",
",",
"$",
"this",
"->",
"getLastBatchNumber",
"(",
")",
")",
";",
"return",
"$",
"query",
"->",
"orderBy",
"(",
... | Get the last migration batch.
@return array | [
"Get",
"the",
"last",
"migration",
"batch",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Migrations/DatabaseMigrationRepository.php#L76-L81 |
odiaseo/pagebuilder | src/PageBuilder/Service/LayoutService.php | LayoutService.getPageThemeLayout | public function getPageThemeLayout($pageThemeId)
{
/** @var $themeModel \PageBuilder\Model\PageTemplateModel */
$themeModel = $this->getServiceLocator()->get('pagebuilder\model\pageTheme');
$pageTheme = $themeModel->findObject($pageThemeId);
return $this->getPageLayout($page... | php | public function getPageThemeLayout($pageThemeId)
{
/** @var $themeModel \PageBuilder\Model\PageTemplateModel */
$themeModel = $this->getServiceLocator()->get('pagebuilder\model\pageTheme');
$pageTheme = $themeModel->findObject($pageThemeId);
return $this->getPageLayout($page... | [
"public",
"function",
"getPageThemeLayout",
"(",
"$",
"pageThemeId",
")",
"{",
"/** @var $themeModel \\PageBuilder\\Model\\PageTemplateModel */",
"$",
"themeModel",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"'pagebuilder\\model\\pageTheme'",
... | Get Page theme layout
@param $pageThemeId
@return array | [
"Get",
"Page",
"theme",
"layout"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Service/LayoutService.php#L101-L109 |
odiaseo/pagebuilder | src/PageBuilder/Service/LayoutService.php | LayoutService.getPageLayout | public function getPageLayout($pageId, $pageThemeId = null)
{
$sections = $templateSections = [];
$error = '';
$details = [];
/** @var $pageModel \PageBuilder\Model\PageModel */
$pageModel = $this->getServiceLocator()->get('pagebuilder\model\page');
/**... | php | public function getPageLayout($pageId, $pageThemeId = null)
{
$sections = $templateSections = [];
$error = '';
$details = [];
/** @var $pageModel \PageBuilder\Model\PageModel */
$pageModel = $this->getServiceLocator()->get('pagebuilder\model\page');
/**... | [
"public",
"function",
"getPageLayout",
"(",
"$",
"pageId",
",",
"$",
"pageThemeId",
"=",
"null",
")",
"{",
"$",
"sections",
"=",
"$",
"templateSections",
"=",
"[",
"]",
";",
"$",
"error",
"=",
"''",
";",
"$",
"details",
"=",
"[",
"]",
";",
"/** @var ... | Get page layout
@param $pageId
@param null $pageThemeId
@return array | [
"Get",
"page",
"layout"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Service/LayoutService.php#L119-L231 |
odiaseo/pagebuilder | src/PageBuilder/Service/LayoutService.php | LayoutService.resolvePageLayout | public function resolvePageLayout($pageId, $themeId = null)
{
/** @var $site \PageBuilder\Entity\Site */
/** @var $parent \PageBuilder\Entity\Page */
/** @var $page \PageBuilder\Entity\Page */
/** @var $templateObj \PageBuilder\Entity\Template */
/** @var PageModel $pag... | php | public function resolvePageLayout($pageId, $themeId = null)
{
/** @var $site \PageBuilder\Entity\Site */
/** @var $parent \PageBuilder\Entity\Page */
/** @var $page \PageBuilder\Entity\Page */
/** @var $templateObj \PageBuilder\Entity\Template */
/** @var PageModel $pag... | [
"public",
"function",
"resolvePageLayout",
"(",
"$",
"pageId",
",",
"$",
"themeId",
"=",
"null",
")",
"{",
"/** @var $site \\PageBuilder\\Entity\\Site */",
"/** @var $parent \\PageBuilder\\Entity\\Page */",
"/** @var $page \\PageBuilder\\Entity\\Page */",
"/** @var $templateObj \\Pag... | @param $pageId
@param null $themeId
@return array | [
"@param",
"$pageId",
"@param",
"null",
"$themeId"
] | train | https://github.com/odiaseo/pagebuilder/blob/88ef7cccf305368561307efe4ca07fac8e5774f3/src/PageBuilder/Service/LayoutService.php#L367-L402 |
ajgarlag/AjglCsv | src/Charset/MbStringConverter.php | MbStringConverter.convert | public function convert($value, $inputCharset, $outputCharset)
{
if ($inputCharset !== $outputCharset) {
$value = mb_convert_encoding($value, $outputCharset, $inputCharset);
}
return $value;
} | php | public function convert($value, $inputCharset, $outputCharset)
{
if ($inputCharset !== $outputCharset) {
$value = mb_convert_encoding($value, $outputCharset, $inputCharset);
}
return $value;
} | [
"public",
"function",
"convert",
"(",
"$",
"value",
",",
"$",
"inputCharset",
",",
"$",
"outputCharset",
")",
"{",
"if",
"(",
"$",
"inputCharset",
"!==",
"$",
"outputCharset",
")",
"{",
"$",
"value",
"=",
"mb_convert_encoding",
"(",
"$",
"value",
",",
"$... | {@inheritdoc} | [
"{"
] | train | https://github.com/ajgarlag/AjglCsv/blob/28872f58b9ef864893cac6faddfcb1229c2c2047/src/Charset/MbStringConverter.php#L22-L29 |
devbr/html | Html.php | Html.insertStyles | public function insertStyles($list)
{
if (!is_array($list)) {
$list = [$list];
}
$this->styles = $list;
return $this;
} | php | public function insertStyles($list)
{
if (!is_array($list)) {
$list = [$list];
}
$this->styles = $list;
return $this;
} | [
"public",
"function",
"insertStyles",
"(",
"$",
"list",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"list",
")",
")",
"{",
"$",
"list",
"=",
"[",
"$",
"list",
"]",
";",
"}",
"$",
"this",
"->",
"styles",
"=",
"$",
"list",
";",
"return",
"$",... | /* Style list insert | [
"/",
"*",
"Style",
"list",
"insert"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L335-L342 |
devbr/html | Html.php | Html.insertScripts | public function insertScripts($list)
{
if (!is_array($list)) {
$list = [$list];
}
$this->scripts = $list;
return $this;
} | php | public function insertScripts($list)
{
if (!is_array($list)) {
$list = [$list];
}
$this->scripts = $list;
return $this;
} | [
"public",
"function",
"insertScripts",
"(",
"$",
"list",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"list",
")",
")",
"{",
"$",
"list",
"=",
"[",
"$",
"list",
"]",
";",
"}",
"$",
"this",
"->",
"scripts",
"=",
"$",
"list",
";",
"return",
"$... | /* Javascript list insert | [
"/",
"*",
"Javascript",
"list",
"insert"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L346-L353 |
devbr/html | Html.php | Html.send | public function send()
{
if ($this->mode == 'pro') {
ob_end_clean();
ob_start('ob_gzhandler');
}
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
header('Cache-Control: must_revalidate, public, max-age=31536000');
header('X-S... | php | public function send()
{
if ($this->mode == 'pro') {
ob_end_clean();
ob_start('ob_gzhandler');
}
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 31536000) . ' GMT');
header('Cache-Control: must_revalidate, public, max-age=31536000');
header('X-S... | [
"public",
"function",
"send",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mode",
"==",
"'pro'",
")",
"{",
"ob_end_clean",
"(",
")",
";",
"ob_start",
"(",
"'ob_gzhandler'",
")",
";",
"}",
"header",
"(",
"'Expires: '",
".",
"gmdate",
"(",
"'D, d M Y H:... | /* SEND
Send headers & Output tris content | [
"/",
"*",
"SEND",
"Send",
"headers",
"&",
"Output",
"tris",
"content"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L435-L453 |
devbr/html | Html.php | Html.sendCache | public function sendCache()
{
if (!file_exists($this->pathHtmlCache.$this->name.'_cache.html')) {
$this->cached = true;
return $this;
}
$this->setContent(file_get_contents($this->pathHtmlCache.$this->name.'_cache.html'));
$this->send();
} | php | public function sendCache()
{
if (!file_exists($this->pathHtmlCache.$this->name.'_cache.html')) {
$this->cached = true;
return $this;
}
$this->setContent(file_get_contents($this->pathHtmlCache.$this->name.'_cache.html'));
$this->send();
} | [
"public",
"function",
"sendCache",
"(",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"pathHtmlCache",
".",
"$",
"this",
"->",
"name",
".",
"'_cache.html'",
")",
")",
"{",
"$",
"this",
"->",
"cached",
"=",
"true",
";",
"return",
"$... | /* Send cached version of compilation | [
"/",
"*",
"Send",
"cached",
"version",
"of",
"compilation"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L458-L467 |
devbr/html | Html.php | Html.sendWithCach | protected function sendWithCach()
{
$cache = $this->pathHtmlCache.$this->name.'_cache.html';
if (!file_exists($cache)) {
file_put_contents($cache, $this->content);
}
include $cache;
exit();
} | php | protected function sendWithCach()
{
$cache = $this->pathHtmlCache.$this->name.'_cache.html';
if (!file_exists($cache)) {
file_put_contents($cache, $this->content);
}
include $cache;
exit();
} | [
"protected",
"function",
"sendWithCach",
"(",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"pathHtmlCache",
".",
"$",
"this",
"->",
"name",
".",
"'_cache.html'",
";",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"cache",
")",
")",
"{",
"file_put_contents"... | Teste
@todo testando send with CACHE in PHP! | [
"Teste"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L472-L480 |
devbr/html | Html.php | Html.getBlock | protected function getBlock($name = null)
{
return ($name == null) ? $this->block : (isset($this->block[$name]) ? $this->block[$name] : false);
} | php | protected function getBlock($name = null)
{
return ($name == null) ? $this->block : (isset($this->block[$name]) ? $this->block[$name] : false);
} | [
"protected",
"function",
"getBlock",
"(",
"$",
"name",
"=",
"null",
")",
"{",
"return",
"(",
"$",
"name",
"==",
"null",
")",
"?",
"$",
"this",
"->",
"block",
":",
"(",
"isset",
"(",
"$",
"this",
"->",
"block",
"[",
"$",
"name",
"]",
")",
"?",
"... | Pega o conteúdo de um block | [
"Pega",
"o",
"conteúdo",
"de",
"um",
"block"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L509-L512 |
devbr/html | Html.php | Html.jsvar | public function jsvar($name, $value = null)
{
if (is_string($name)) {
$this->jsvalues[$name] = $value;
}
if (is_array($name)) {
$this->jsvalues = array_merge($this->jsvalues, $name);
}
return $this;
} | php | public function jsvar($name, $value = null)
{
if (is_string($name)) {
$this->jsvalues[$name] = $value;
}
if (is_array($name)) {
$this->jsvalues = array_merge($this->jsvalues, $name);
}
return $this;
} | [
"public",
"function",
"jsvar",
"(",
"$",
"name",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"jsvalues",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"}",
"if",
"(",
... | Registra uma variável para o Javascript | [
"Registra",
"uma",
"variável",
"para",
"o",
"Javascript"
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L531-L540 |
devbr/html | Html.php | Html.produceNTag | private function produceNTag()
{
$ponteiro = -1;
$content = $this->getContent();
//Loop de varredura para o arquivo HTML
while ($ret = $this->sTag($content, $ponteiro)) {
$ponteiro = 0 + $ret['-final-'];
$vartemp = '';
//constant URL
... | php | private function produceNTag()
{
$ponteiro = -1;
$content = $this->getContent();
//Loop de varredura para o arquivo HTML
while ($ret = $this->sTag($content, $ponteiro)) {
$ponteiro = 0 + $ret['-final-'];
$vartemp = '';
//constant URL
... | [
"private",
"function",
"produceNTag",
"(",
")",
"{",
"$",
"ponteiro",
"=",
"-",
"1",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
";",
"//Loop de varredura para o arquivo HTML",
"while",
"(",
"$",
"ret",
"=",
"$",
"this",
"->",
"s... | Renderiza o arquivo html com ©NeosTags.
@return void | [
"Renderiza",
"o",
"arquivo",
"html",
"com",
"©NeosTags",
"."
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L547-L574 |
devbr/html | Html.php | Html.clearData | public function clearData($ret)
{
unset($ret['var'],
$ret['-inicio-'],
$ret['-tamanho-'],
$ret['-final-'],
$ret['-tipo-'],
$ret['-content-'],
$ret['tag'],
$ret['data']);
return $ret;
} | php | public function clearData($ret)
{
unset($ret['var'],
$ret['-inicio-'],
$ret['-tamanho-'],
$ret['-final-'],
$ret['-tipo-'],
$ret['-content-'],
$ret['tag'],
$ret['data']);
return $ret;
} | [
"public",
"function",
"clearData",
"(",
"$",
"ret",
")",
"{",
"unset",
"(",
"$",
"ret",
"[",
"'var'",
"]",
",",
"$",
"ret",
"[",
"'-inicio-'",
"]",
",",
"$",
"ret",
"[",
"'-tamanho-'",
"]",
",",
"$",
"ret",
"[",
"'-final-'",
"]",
",",
"$",
"ret",... | ClearData :: Clear all extra data.
@param array $ret Starttag data array.
@return array Data array cleared. | [
"ClearData",
"::",
"Clear",
"all",
"extra",
"data",
"."
] | train | https://github.com/devbr/html/blob/c1ff54cbdfe3a1338eb8d0cd9c13a8a435fcf7ce/Html.php#L850-L861 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.getLayoutUpdates | public function getLayoutUpdates(LayoutItemInterface $item)
{
$idOrAlias = $item->getAlias() ?: $item->getId();
return isset($this->layoutUpdates[$idOrAlias])
? $this->layoutUpdates[$idOrAlias]
: [];
} | php | public function getLayoutUpdates(LayoutItemInterface $item)
{
$idOrAlias = $item->getAlias() ?: $item->getId();
return isset($this->layoutUpdates[$idOrAlias])
? $this->layoutUpdates[$idOrAlias]
: [];
} | [
"public",
"function",
"getLayoutUpdates",
"(",
"LayoutItemInterface",
"$",
"item",
")",
"{",
"$",
"idOrAlias",
"=",
"$",
"item",
"->",
"getAlias",
"(",
")",
"?",
":",
"$",
"item",
"->",
"getId",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L144-L151 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.hasLayoutUpdates | public function hasLayoutUpdates(LayoutItemInterface $item)
{
$idOrAlias = $item->getAlias() ?: $item->getId();
return !empty($this->layoutUpdates[$idOrAlias]);
} | php | public function hasLayoutUpdates(LayoutItemInterface $item)
{
$idOrAlias = $item->getAlias() ?: $item->getId();
return !empty($this->layoutUpdates[$idOrAlias]);
} | [
"public",
"function",
"hasLayoutUpdates",
"(",
"LayoutItemInterface",
"$",
"item",
")",
"{",
"$",
"idOrAlias",
"=",
"$",
"item",
"->",
"getAlias",
"(",
")",
"?",
":",
"$",
"item",
"->",
"getId",
"(",
")",
";",
"return",
"!",
"empty",
"(",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L156-L161 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.getDataProvider | public function getDataProvider($name)
{
if (!isset($this->dataProviders[$name])) {
throw new Exception\InvalidArgumentException(
sprintf('The data provider "%s" can not be loaded by this extension.', $name)
);
}
return $this->dataProviders[$name];
... | php | public function getDataProvider($name)
{
if (!isset($this->dataProviders[$name])) {
throw new Exception\InvalidArgumentException(
sprintf('The data provider "%s" can not be loaded by this extension.', $name)
);
}
return $this->dataProviders[$name];
... | [
"public",
"function",
"getDataProvider",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"dataProviders",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L182-L191 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.validateTypes | protected function validateTypes(array $types)
{
foreach ($types as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $types array must be strings.'
);
}
if (!$val instanceof ... | php | protected function validateTypes(array $types)
{
foreach ($types as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $types array must be strings.'
);
}
if (!$val instanceof ... | [
"protected",
"function",
"validateTypes",
"(",
"array",
"$",
"types",
")",
"{",
"foreach",
"(",
"$",
"types",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"Exception",
"\... | @param array $types
@throws Exception\InvalidArgumentException | [
"@param",
"array",
"$types"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L206-L220 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.validateTypeExtensions | protected function validateTypeExtensions(array $typeExtensions)
{
foreach ($typeExtensions as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $typeExtensions array must be strings.'
);
... | php | protected function validateTypeExtensions(array $typeExtensions)
{
foreach ($typeExtensions as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $typeExtensions array must be strings.'
);
... | [
"protected",
"function",
"validateTypeExtensions",
"(",
"array",
"$",
"typeExtensions",
")",
"{",
"foreach",
"(",
"$",
"typeExtensions",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"throw",
... | @param array $typeExtensions
@throws Exception\InvalidArgumentException | [
"@param",
"array",
"$typeExtensions"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L227-L248 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.validateLayoutUpdates | protected function validateLayoutUpdates(array $layoutUpdates)
{
foreach ($layoutUpdates as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $layoutUpdates array must be strings.'
);
}
... | php | protected function validateLayoutUpdates(array $layoutUpdates)
{
foreach ($layoutUpdates as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $layoutUpdates array must be strings.'
);
}
... | [
"protected",
"function",
"validateLayoutUpdates",
"(",
"array",
"$",
"layoutUpdates",
")",
"{",
"foreach",
"(",
"$",
"layoutUpdates",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"n... | @param array $layoutUpdates
@throws Exception\InvalidArgumentException | [
"@param",
"array",
"$layoutUpdates"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L255-L276 |
oroinc/OroLayoutComponent | Extension/PreloadedExtension.php | PreloadedExtension.validateDataProviders | protected function validateDataProviders(array $dataProviders)
{
foreach ($dataProviders as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $dataProviders array must be strings.'
);
}
... | php | protected function validateDataProviders(array $dataProviders)
{
foreach ($dataProviders as $key => $val) {
if (!is_string($key)) {
throw new Exception\InvalidArgumentException(
'Keys of $dataProviders array must be strings.'
);
}
... | [
"protected",
"function",
"validateDataProviders",
"(",
"array",
"$",
"dataProviders",
")",
"{",
"foreach",
"(",
"$",
"dataProviders",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"n... | @param array $dataProviders
@throws Exception\InvalidArgumentException | [
"@param",
"array",
"$dataProviders"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Extension/PreloadedExtension.php#L299-L308 |
php-comp/lite-database | src/Helper/DBHelper.php | DBHelper.handleConditions | public static function handleConditions($wheres, LitePdo $db): array
{
if (\is_object($wheres) && $wheres instanceof \Closure) {
$wheres = $wheres($db);
}
if (!$wheres || $wheres === 1) {
return [1, []];
}
if (\is_string($wheres)) {
retur... | php | public static function handleConditions($wheres, LitePdo $db): array
{
if (\is_object($wheres) && $wheres instanceof \Closure) {
$wheres = $wheres($db);
}
if (!$wheres || $wheres === 1) {
return [1, []];
}
if (\is_string($wheres)) {
retur... | [
"public",
"static",
"function",
"handleConditions",
"(",
"$",
"wheres",
",",
"LitePdo",
"$",
"db",
")",
":",
"array",
"{",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"wheres",
")",
"&&",
"$",
"wheres",
"instanceof",
"\\",
"Closure",
")",
"{",
"$",
"wheres... | handle where condition
@param array|string|\Closure|mixed $wheres
@param LitePdo $db
@example
```
$result = $db->findAll('user', [
'userId' => 23, // ==> 'AND `userId` = 23'
'title' => 'test', // value will auto add quote, equal to "AND title = 'test'"
'status' => [1, 2], // status IN (1,2)
['publishTime', '>', ... | [
"handle",
"where",
"condition",
"@param",
"array|string|",
"\\",
"Closure|mixed",
"$wheres",
"@param",
"LitePdo",
"$db",
"@example",
"$result",
"=",
"$db",
"-",
">",
"findAll",
"(",
"user",
"[",
"userId",
"=",
">",
"23",
"//",
"==",
">",
"AND",
"userId",
"... | train | https://github.com/php-comp/lite-database/blob/af5f73cb89e0e6cd24dd464f7a48fb5088eaafca/src/Helper/DBHelper.php#L87-L187 |
php-comp/lite-database | src/Helper/DBHelper.php | DBHelper.formatArrayValue | private static function formatArrayValue(string $col, array $val, string $op): string
{
return \sprintf(" %s %s ('%s')", $col, $op, \implode("','", $val));
} | php | private static function formatArrayValue(string $col, array $val, string $op): string
{
return \sprintf(" %s %s ('%s')", $col, $op, \implode("','", $val));
} | [
"private",
"static",
"function",
"formatArrayValue",
"(",
"string",
"$",
"col",
",",
"array",
"$",
"val",
",",
"string",
"$",
"op",
")",
":",
"string",
"{",
"return",
"\\",
"sprintf",
"(",
"\" %s %s ('%s')\"",
",",
"$",
"col",
",",
"$",
"op",
",",
"\\"... | handle IN/NOT IN
@param string $col
@param array $val
@param string $op
@return string | [
"handle",
"IN",
"/",
"NOT",
"IN"
] | train | https://github.com/php-comp/lite-database/blob/af5f73cb89e0e6cd24dd464f7a48fb5088eaafca/src/Helper/DBHelper.php#L196-L199 |
sciactive/nymph-server | src/Drivers/MySQLDriver.php | MySQLDriver.connect | public function connect() {
// Check that the MySQLi extension is installed.
if (!is_callable('mysqli_connect')) {
throw new Exceptions\UnableToConnectException(
'MySQLi PHP extension is not available. It probably has not been '.
'installed. Please install and configure it in order to ... | php | public function connect() {
// Check that the MySQLi extension is installed.
if (!is_callable('mysqli_connect')) {
throw new Exceptions\UnableToConnectException(
'MySQLi PHP extension is not available. It probably has not been '.
'installed. Please install and configure it in order to ... | [
"public",
"function",
"connect",
"(",
")",
"{",
"// Check that the MySQLi extension is installed.",
"if",
"(",
"!",
"is_callable",
"(",
"'mysqli_connect'",
")",
")",
"{",
"throw",
"new",
"Exceptions",
"\\",
"UnableToConnectException",
"(",
"'MySQLi PHP extension is not av... | Connect to the MySQL database.
@return bool Whether this instance is connected to a MySQL database after
the method has run. | [
"Connect",
"to",
"the",
"MySQL",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/MySQLDriver.php#L46-L97 |
sciactive/nymph-server | src/Drivers/MySQLDriver.php | MySQLDriver.disconnect | public function disconnect() {
if ($this->connected) {
if (is_a($this->link, 'mysqli')) {
unset($this->link);
}
$this->link = null;
$this->connected = false;
}
return $this->connected;
} | php | public function disconnect() {
if ($this->connected) {
if (is_a($this->link, 'mysqli')) {
unset($this->link);
}
$this->link = null;
$this->connected = false;
}
return $this->connected;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connected",
")",
"{",
"if",
"(",
"is_a",
"(",
"$",
"this",
"->",
"link",
",",
"'mysqli'",
")",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"link",
")",
";",
"}",
"... | Disconnect from the MySQL database.
@return bool Whether this instance is connected to a MySQL database after
the method has run. | [
"Disconnect",
"from",
"the",
"MySQL",
"database",
"."
] | train | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/MySQLDriver.php#L105-L114 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.