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 |
|---|---|---|---|---|---|---|---|---|---|---|
ekuiter/feature-php | FeaturePhp/Helper/XmlParser.php | XmlParser.parseString | public function parseString($str) {
if (!extension_loaded("SimpleXML"))
throw new XmlParserException("SimpleXML extension not loaded, can not parse XML");
libxml_use_internal_errors(true);
$xml = simplexml_load_string($str);
if ($xml === false) {
... | php | public function parseString($str) {
if (!extension_loaded("SimpleXML"))
throw new XmlParserException("SimpleXML extension not loaded, can not parse XML");
libxml_use_internal_errors(true);
$xml = simplexml_load_string($str);
if ($xml === false) {
... | [
"public",
"function",
"parseString",
"(",
"$",
"str",
")",
"{",
"if",
"(",
"!",
"extension_loaded",
"(",
"\"SimpleXML\"",
")",
")",
"throw",
"new",
"XmlParserException",
"(",
"\"SimpleXML extension not loaded, can not parse XML\"",
")",
";",
"libxml_use_internal_errors"... | Parses an XML string.
@param string $str
@return XmlParser | [
"Parses",
"an",
"XML",
"string",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/XmlParser.php#L50-L67 |
ekuiter/feature-php | FeaturePhp/Helper/XmlParser.php | XmlParser.validate | public function validate($schemaFile) {
if (!$this->xmlString)
throw new XmlParserException("attempting to validate before parsing");
if (!extension_loaded("DOM")) {
trigger_error("DOM extension not loaded, will not validate XML", E_USER_NOTICE);
return $... | php | public function validate($schemaFile) {
if (!$this->xmlString)
throw new XmlParserException("attempting to validate before parsing");
if (!extension_loaded("DOM")) {
trigger_error("DOM extension not loaded, will not validate XML", E_USER_NOTICE);
return $... | [
"public",
"function",
"validate",
"(",
"$",
"schemaFile",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"xmlString",
")",
"throw",
"new",
"XmlParserException",
"(",
"\"attempting to validate before parsing\"",
")",
";",
"if",
"(",
"!",
"extension_loaded",
"(",
... | Validates XML using a schema.
@param string $schemaFile
@return XmlParser | [
"Validates",
"XML",
"using",
"a",
"schema",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/XmlParser.php#L86-L107 |
ekuiter/feature-php | FeaturePhp/Helper/XmlParser.php | XmlParser.get | public static function get($node, $tagName, $count = 1) {
$node = $node->{$tagName};
if ($node->count() !== $count)
throw new XmlParserException("xml does not have exactly $count $tagName's");
return $node[0];
} | php | public static function get($node, $tagName, $count = 1) {
$node = $node->{$tagName};
if ($node->count() !== $count)
throw new XmlParserException("xml does not have exactly $count $tagName's");
return $node[0];
} | [
"public",
"static",
"function",
"get",
"(",
"$",
"node",
",",
"$",
"tagName",
",",
"$",
"count",
"=",
"1",
")",
"{",
"$",
"node",
"=",
"$",
"node",
"->",
"{",
"$",
"tagName",
"}",
";",
"if",
"(",
"$",
"node",
"->",
"count",
"(",
")",
"!==",
"... | Returns a child node for a tag name from an XML node.
@param \SimpleXMLElement $node
@param string $tagName
@param int $count how many child nodes for the tag name are allowed
@return \SimpleXMLElement | [
"Returns",
"a",
"child",
"node",
"for",
"a",
"tag",
"name",
"from",
"an",
"XML",
"node",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Helper/XmlParser.php#L116-L121 |
zhouyl/mellivora | Mellivora/Database/Connectors/ConnectionFactory.php | ConnectionFactory.createConnector | public function createConnector(array $config)
{
if (!isset($config['driver'])) {
throw new InvalidArgumentException('A driver must be specified.');
}
if ($this->container->has($key = "db.connector.{$config['driver']}")) {
return $this->container->get($key);
... | php | public function createConnector(array $config)
{
if (!isset($config['driver'])) {
throw new InvalidArgumentException('A driver must be specified.');
}
if ($this->container->has($key = "db.connector.{$config['driver']}")) {
return $this->container->get($key);
... | [
"public",
"function",
"createConnector",
"(",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'driver'",
"]",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'A driver must be specified.'",
")",
";",
"}",... | Create a connector instance based on the configuration.
@param array $config
@throws \InvalidArgumentException
@return \Mellivora\Database\Connectors\ConnectorInterface | [
"Create",
"a",
"connector",
"instance",
"based",
"on",
"the",
"configuration",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Connectors/ConnectionFactory.php#L246-L268 |
zhouyl/mellivora | Mellivora/Database/Connectors/ConnectionFactory.php | ConnectionFactory.createConnection | protected function createConnection($driver, $connection, $database, $prefix = '', array $config = [])
{
if ($resolver = Connection::getResolver($driver)) {
return $resolver($connection, $database, $prefix, $config);
}
switch ($driver) {
case 'mysql':
... | php | protected function createConnection($driver, $connection, $database, $prefix = '', array $config = [])
{
if ($resolver = Connection::getResolver($driver)) {
return $resolver($connection, $database, $prefix, $config);
}
switch ($driver) {
case 'mysql':
... | [
"protected",
"function",
"createConnection",
"(",
"$",
"driver",
",",
"$",
"connection",
",",
"$",
"database",
",",
"$",
"prefix",
"=",
"''",
",",
"array",
"$",
"config",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"resolver",
"=",
"Connection",
"::",
"... | Create a new connection instance.
@param string $driver
@param \Closure|\PDO $connection
@param string $database
@param string $prefix
@param array $config
@throws \InvalidArgumentException
@return \Mellivora\Database\Connection | [
"Create",
"a",
"new",
"connection",
"instance",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Connectors/ConnectionFactory.php#L283-L301 |
leoshtika/database | src/Mysql.php | Mysql.connect | public static function connect($mysqlConfig)
{
$dbConfig = array(
'dsn' => 'mysql:dbname=' . $mysqlConfig['dbname'] . ';host=' . $mysqlConfig['host'],
'user' => $mysqlConfig['user'],
'pass' => $mysqlConfig['pass'],
'options' => array(PDO::MYSQL_ATTR_INIT_COMMA... | php | public static function connect($mysqlConfig)
{
$dbConfig = array(
'dsn' => 'mysql:dbname=' . $mysqlConfig['dbname'] . ';host=' . $mysqlConfig['host'],
'user' => $mysqlConfig['user'],
'pass' => $mysqlConfig['pass'],
'options' => array(PDO::MYSQL_ATTR_INIT_COMMA... | [
"public",
"static",
"function",
"connect",
"(",
"$",
"mysqlConfig",
")",
"{",
"$",
"dbConfig",
"=",
"array",
"(",
"'dsn'",
"=>",
"'mysql:dbname='",
".",
"$",
"mysqlConfig",
"[",
"'dbname'",
"]",
".",
"';host='",
".",
"$",
"mysqlConfig",
"[",
"'host'",
"]",... | Returns a PDO instance
@param array $mysqlConfig
@return PDO | [
"Returns",
"a",
"PDO",
"instance"
] | train | https://github.com/leoshtika/database/blob/a8a82cb6b16eb97caf8b583506c0e08ab944f761/src/Mysql.php#L27-L37 |
philiplb/Valdi | src/Valdi/Validator/DateTime.php | DateTime.isValid | public function isValid($value, array $parameters) {
$format = 'Y-m-d H:i:s';
if (count($parameters) > 0) {
$format = $parameters[0];
}
return in_array($value, ['', null], true) ||
\DateTime::createFromFormat($format, $value) !== false;
} | php | public function isValid($value, array $parameters) {
$format = 'Y-m-d H:i:s';
if (count($parameters) > 0) {
$format = $parameters[0];
}
return in_array($value, ['', null], true) ||
\DateTime::createFromFormat($format, $value) !== false;
} | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"format",
"=",
"'Y-m-d H:i:s'",
";",
"if",
"(",
"count",
"(",
"$",
"parameters",
")",
">",
"0",
")",
"{",
"$",
"format",
"=",
"$",
"parameters",
"[",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/philiplb/Valdi/blob/9927ec34a2cb00cec705e952d3c2374e2dc3c972/src/Valdi/Validator/DateTime.php#L24-L31 |
php-lug/lug | src/Component/Behat/Context/PagerContext.php | PagerContext.followPage | public function followPage($page)
{
\PHPUnit_Framework_Assert::assertNotNull(
$link = $this->findPager()->findLink($page),
sprintf('The page "%s" could not be found.', $page)
);
$link->click();
} | php | public function followPage($page)
{
\PHPUnit_Framework_Assert::assertNotNull(
$link = $this->findPager()->findLink($page),
sprintf('The page "%s" could not be found.', $page)
);
$link->click();
} | [
"public",
"function",
"followPage",
"(",
"$",
"page",
")",
"{",
"\\",
"PHPUnit_Framework_Assert",
"::",
"assertNotNull",
"(",
"$",
"link",
"=",
"$",
"this",
"->",
"findPager",
"(",
")",
"->",
"findLink",
"(",
"$",
"page",
")",
",",
"sprintf",
"(",
"'The ... | @param string|int $page
@Given I follow the page ":page" | [
"@param",
"string|int",
"$page"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Context/PagerContext.php#L30-L38 |
php-lug/lug | src/Component/Behat/Context/PagerContext.php | PagerContext.assertPager | public function assertPager($count)
{
\PHPUnit_Framework_Assert::assertCount(
$count + ($offset = 2),
$pages = $this->findPager()->findAll('xpath', '/li'),
sprintf('The number of pages "%d" does not match "%d".', count($pages) - $offset, $count)
);
} | php | public function assertPager($count)
{
\PHPUnit_Framework_Assert::assertCount(
$count + ($offset = 2),
$pages = $this->findPager()->findAll('xpath', '/li'),
sprintf('The number of pages "%d" does not match "%d".', count($pages) - $offset, $count)
);
} | [
"public",
"function",
"assertPager",
"(",
"$",
"count",
")",
"{",
"\\",
"PHPUnit_Framework_Assert",
"::",
"assertCount",
"(",
"$",
"count",
"+",
"(",
"$",
"offset",
"=",
"2",
")",
",",
"$",
"pages",
"=",
"$",
"this",
"->",
"findPager",
"(",
")",
"->",
... | @param string|int $count
@Given I should see a pager with ":count" pages | [
"@param",
"string|int",
"$count"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Behat/Context/PagerContext.php#L45-L52 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.writeField | private function writeField( $file, $fieldName, $field, $isPrimary )
{
fwrite( $file, "\n" );
if ( $isPrimary )
{
fwrite( $file, "\$def->idProperty = new ezcPersistentObjectIdProperty();\n" );
fwrite( $file, "\$def->idProperty->columnName = '$fieldName... | php | private function writeField( $file, $fieldName, $field, $isPrimary )
{
fwrite( $file, "\n" );
if ( $isPrimary )
{
fwrite( $file, "\$def->idProperty = new ezcPersistentObjectIdProperty();\n" );
fwrite( $file, "\$def->idProperty->columnName = '$fieldName... | [
"private",
"function",
"writeField",
"(",
"$",
"file",
",",
"$",
"fieldName",
",",
"$",
"field",
",",
"$",
"isPrimary",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\"\\n\"",
")",
";",
"if",
"(",
"$",
"isPrimary",
")",
"{",
"fwrite",
"(",
"$",
"file... | Write a field of the schema to the PersistentObject definition.
This method writes a database field to the PersistentObject definition
file.
@param resource(file) $file The file to write to.
@param string $fieldName The name of the field.
@param ezcDbSchemaField $field The field object.
@param bool $isPrimary... | [
"Write",
"a",
"field",
"of",
"the",
"schema",
"to",
"the",
"PersistentObject",
"definition",
".",
"This",
"method",
"writes",
"a",
"database",
"field",
"to",
"the",
"PersistentObject",
"definition",
"file",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L102-L128 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.writeTable | private function writeTable( $dir, $tableName, ezcDbSchemaTable $table )
{
$file = $this->openFile( $dir, $tableName );
fwrite( $file, "\$def = new ezcPersistentObjectDefinition();\n" );
fwrite( $file, "\$def->table = '$tableName';\n" );
fwrite( $file, "\$def->class = '{$this->prefi... | php | private function writeTable( $dir, $tableName, ezcDbSchemaTable $table )
{
$file = $this->openFile( $dir, $tableName );
fwrite( $file, "\$def = new ezcPersistentObjectDefinition();\n" );
fwrite( $file, "\$def->table = '$tableName';\n" );
fwrite( $file, "\$def->class = '{$this->prefi... | [
"private",
"function",
"writeTable",
"(",
"$",
"dir",
",",
"$",
"tableName",
",",
"ezcDbSchemaTable",
"$",
"table",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"openFile",
"(",
"$",
"dir",
",",
"$",
"tableName",
")",
";",
"fwrite",
"(",
"$",
"file... | Writes the PersistentObject defintion for a table.
This method writes the PersistentObject definition for a single database
table. It creates a new file in the given directory, named in the format
<table_name>.php, writes the start of the definition to it and calls the
{@link ezcDbschemaPersistentWriter::writeField()}... | [
"Writes",
"the",
"PersistentObject",
"defintion",
"for",
"a",
"table",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L181-L197 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.closeFile | private function closeFile( $file )
{
fwrite( $file, "return \$def;\n" );
fwrite( $file, "\n" );
fwrite( $file, "?>\n" );
fclose( $file );
} | php | private function closeFile( $file )
{
fwrite( $file, "return \$def;\n" );
fwrite( $file, "\n" );
fwrite( $file, "?>\n" );
fclose( $file );
} | [
"private",
"function",
"closeFile",
"(",
"$",
"file",
")",
"{",
"fwrite",
"(",
"$",
"file",
",",
"\"return \\$def;\\n\"",
")",
";",
"fwrite",
"(",
"$",
"file",
",",
"\"\\n\"",
")",
";",
"fwrite",
"(",
"$",
"file",
",",
"\"?>\\n\"",
")",
";",
"fclose",
... | Close a file where a PersistentObject definition has been written to.
This method closes a file after writing a PersistentObject definition to
it and writes the PHP closing tag to it.
@param resource(file) $file The file resource to close.
@return void | [
"Close",
"a",
"file",
"where",
"a",
"PersistentObject",
"definition",
"has",
"been",
"written",
"to",
".",
"This",
"method",
"closes",
"a",
"file",
"after",
"writing",
"a",
"PersistentObject",
"definition",
"to",
"it",
"and",
"writes",
"the",
"PHP",
"closing",... | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L240-L246 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php | ezcDbSchemaPersistentWriter.determinePrimaries | private function determinePrimaries( $indexes )
{
$primaries = array();
foreach ( $indexes as $index )
{
if ( $index->primary )
{
foreach ( $index->indexFields as $field => $definiton )
{
$primaries[$field] = true;
... | php | private function determinePrimaries( $indexes )
{
$primaries = array();
foreach ( $indexes as $index )
{
if ( $index->primary )
{
foreach ( $index->indexFields as $field => $definiton )
{
$primaries[$field] = true;
... | [
"private",
"function",
"determinePrimaries",
"(",
"$",
"indexes",
")",
"{",
"$",
"primaries",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"indexes",
"as",
"$",
"index",
")",
"{",
"if",
"(",
"$",
"index",
"->",
"primary",
")",
"{",
"foreach",
"(... | Extract primary keys from an index definition.
This method extracts the names of all primary keys from the index
defintions of a table.
@param array(string=>ezcDbSchemaIndex) $indexes Indices.
@return array(string=>bool) The primary keys. | [
"Extract",
"primary",
"keys",
"from",
"an",
"index",
"definition",
".",
"This",
"method",
"extracts",
"the",
"names",
"of",
"all",
"primary",
"keys",
"from",
"the",
"index",
"defintions",
"of",
"a",
"table",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/DatabaseSchema/src/handlers/persistent/writer.php#L256-L270 |
DesignPond/newsletter | src/Http/Controllers/Backend/SendController.php | SendController.campagne | public function campagne(Request $request)
{
// Get campagne
$campagne = $this->campagne->find($request->input('id'));
$date = $request->input('date',null);
//set or update html
$html = $this->worker->html($campagne->id);
$this->mailjet->setList($campagne->newsl... | php | public function campagne(Request $request)
{
// Get campagne
$campagne = $this->campagne->find($request->input('id'));
$date = $request->input('date',null);
//set or update html
$html = $this->worker->html($campagne->id);
$this->mailjet->setList($campagne->newsl... | [
"public",
"function",
"campagne",
"(",
"Request",
"$",
"request",
")",
"{",
"// Get campagne",
"$",
"campagne",
"=",
"$",
"this",
"->",
"campagne",
"->",
"find",
"(",
"$",
"request",
"->",
"input",
"(",
"'id'",
")",
")",
";",
"$",
"date",
"=",
"$",
"... | Send campagne
@return \Illuminate\Http\Response | [
"Send",
"campagne"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SendController.php#L35-L72 |
DesignPond/newsletter | src/Http/Controllers/Backend/SendController.php | SendController.forward | public function forward(SendTestRequest $request)
{
$campagne = $this->campagne->find($request->input('id'));
$sujet = ($campagne->status == 'brouillon' ? 'TEST | '.$campagne->sujet : $campagne->sujet );
// GET html
$html = $this->worker->html($campagne->id);
$email = $r... | php | public function forward(SendTestRequest $request)
{
$campagne = $this->campagne->find($request->input('id'));
$sujet = ($campagne->status == 'brouillon' ? 'TEST | '.$campagne->sujet : $campagne->sujet );
// GET html
$html = $this->worker->html($campagne->id);
$email = $r... | [
"public",
"function",
"forward",
"(",
"SendTestRequest",
"$",
"request",
")",
"{",
"$",
"campagne",
"=",
"$",
"this",
"->",
"campagne",
"->",
"find",
"(",
"$",
"request",
"->",
"input",
"(",
"'id'",
")",
")",
";",
"$",
"sujet",
"=",
"(",
"$",
"campag... | Send test campagne
@return \Illuminate\Http\Response | [
"Send",
"test",
"campagne"
] | train | https://github.com/DesignPond/newsletter/blob/0bf0e7a8a42fa4b90a5e937771bb80058e0a91c3/src/Http/Controllers/Backend/SendController.php#L120-L143 |
zhouyl/mellivora | Mellivora/Database/Console/Migrations/InstallCommand.php | InstallCommand.fire | public function fire()
{
$this->container['migration.repository']->setSource($this->input->getOption('database'));
$this->container['migration.repository']->createRepository();
$this->info('Migration table created successfully.');
} | php | public function fire()
{
$this->container['migration.repository']->setSource($this->input->getOption('database'));
$this->container['migration.repository']->createRepository();
$this->info('Migration table created successfully.');
} | [
"public",
"function",
"fire",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"'migration.repository'",
"]",
"->",
"setSource",
"(",
"$",
"this",
"->",
"input",
"->",
"getOption",
"(",
"'database'",
")",
")",
";",
"$",
"this",
"->",
"container",
"[",... | Execute the console command.
@return void | [
"Execute",
"the",
"console",
"command",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Console/Migrations/InstallCommand.php#L29-L36 |
tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.generateTransformer | protected function generateTransformer()
{
$name = (string) $this->argument('name');
$path = $this->laravel->basePath() . '/app/Transformers/' . $name . '.php';
if ($this->files->exists($path)) {
return $this->error($name . ' already exists!');
}
$this->makeDire... | php | protected function generateTransformer()
{
$name = (string) $this->argument('name');
$path = $this->laravel->basePath() . '/app/Transformers/' . $name . '.php';
if ($this->files->exists($path)) {
return $this->error($name . ' already exists!');
}
$this->makeDire... | [
"protected",
"function",
"generateTransformer",
"(",
")",
"{",
"$",
"name",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"argument",
"(",
"'name'",
")",
";",
"$",
"path",
"=",
"$",
"this",
"->",
"laravel",
"->",
"basePath",
"(",
")",
".",
"'/app/Transfo... | Generate the transformer class.
@return void | [
"Generate",
"the",
"transformer",
"class",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L68-L85 |
tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.makeTransformer | protected function makeTransformer(string $name, string $stub):string
{
$stub = $this->replaceNamespace($stub);
$stub = $this->replaceClass($stub, $name);
$stub = $this->replaceModel($stub, $name);
return $stub;
} | php | protected function makeTransformer(string $name, string $stub):string
{
$stub = $this->replaceNamespace($stub);
$stub = $this->replaceClass($stub, $name);
$stub = $this->replaceModel($stub, $name);
return $stub;
} | [
"protected",
"function",
"makeTransformer",
"(",
"string",
"$",
"name",
",",
"string",
"$",
"stub",
")",
":",
"string",
"{",
"$",
"stub",
"=",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"stub",
")",
";",
"$",
"stub",
"=",
"$",
"this",
"->",
"re... | Build the transformer class using the given name and stub.
@param string $name
@param string $stub
@return string | [
"Build",
"the",
"transformer",
"class",
"using",
"the",
"given",
"name",
"and",
"stub",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L107-L114 |
tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.replaceNamespace | protected function replaceNamespace(string $stub):string
{
if (method_exists($this->laravel, 'getNameSpace')) {
$namespace = $this->laravel->getNamespace() . 'Transformers';
} else {
$namespace = 'App\Transformers';
}
$stub = str_replace('DummyNamespace', $na... | php | protected function replaceNamespace(string $stub):string
{
if (method_exists($this->laravel, 'getNameSpace')) {
$namespace = $this->laravel->getNamespace() . 'Transformers';
} else {
$namespace = 'App\Transformers';
}
$stub = str_replace('DummyNamespace', $na... | [
"protected",
"function",
"replaceNamespace",
"(",
"string",
"$",
"stub",
")",
":",
"string",
"{",
"if",
"(",
"method_exists",
"(",
"$",
"this",
"->",
"laravel",
",",
"'getNameSpace'",
")",
")",
"{",
"$",
"namespace",
"=",
"$",
"this",
"->",
"laravel",
"-... | Replace the namespace for the given stub.
@param string $stub
@return string | [
"Replace",
"the",
"namespace",
"for",
"the",
"given",
"stub",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L122-L133 |
tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.replaceClass | protected function replaceClass(string $stub, string $name):string
{
$stub = str_replace('DummyClass', $name, $stub);
return $stub;
} | php | protected function replaceClass(string $stub, string $name):string
{
$stub = str_replace('DummyClass', $name, $stub);
return $stub;
} | [
"protected",
"function",
"replaceClass",
"(",
"string",
"$",
"stub",
",",
"string",
"$",
"name",
")",
":",
"string",
"{",
"$",
"stub",
"=",
"str_replace",
"(",
"'DummyClass'",
",",
"$",
"name",
",",
"$",
"stub",
")",
";",
"return",
"$",
"stub",
";",
... | Replace the class name for the given stub.
@param string $stub
@param string $name
@return string | [
"Replace",
"the",
"class",
"name",
"for",
"the",
"given",
"stub",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L142-L147 |
tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.replaceModel | protected function replaceModel(string $stub, string $name):string
{
$model = $this->getModelNamespace($name);
$class = $this->getClassFromNamespace($model);
$stub = str_replace('DummyModelNamespace', $model, $stub);
$stub = str_replace('DummyModelClass', $class, $stub);
$st... | php | protected function replaceModel(string $stub, string $name):string
{
$model = $this->getModelNamespace($name);
$class = $this->getClassFromNamespace($model);
$stub = str_replace('DummyModelNamespace', $model, $stub);
$stub = str_replace('DummyModelClass', $class, $stub);
$st... | [
"protected",
"function",
"replaceModel",
"(",
"string",
"$",
"stub",
",",
"string",
"$",
"name",
")",
":",
"string",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"getModelNamespace",
"(",
"$",
"name",
")",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"ge... | Replace the model for the given stub.
@param string $stub
@param string $name
@return string | [
"Replace",
"the",
"model",
"for",
"the",
"given",
"stub",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L156-L166 |
tttptd/laravel-responder | src/Console/MakeTransformer.php | MakeTransformer.getModelNamespace | protected function getModelNamespace(string $name):string
{
if ($this->option('model')) {
return $this->option('model');
}
return 'App\\' . str_replace('Transformer', '', $name);
} | php | protected function getModelNamespace(string $name):string
{
if ($this->option('model')) {
return $this->option('model');
}
return 'App\\' . str_replace('Transformer', '', $name);
} | [
"protected",
"function",
"getModelNamespace",
"(",
"string",
"$",
"name",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"option",
"(",
"'model'",
")",
";",
"}",
"return",
... | Get the full class path for the model.
@param string $name
@return string | [
"Get",
"the",
"full",
"class",
"path",
"for",
"the",
"model",
"."
] | train | https://github.com/tttptd/laravel-responder/blob/0e4a32701f0de755c1f1af458045829e1bd6caf6/src/Console/MakeTransformer.php#L174-L181 |
primipilus/fileinfo | src/FileTool.php | FileTool.size | public static function size(string $path) : ?int
{
$size = filesize($path);
return $size === false ? null : $size;
} | php | public static function size(string $path) : ?int
{
$size = filesize($path);
return $size === false ? null : $size;
} | [
"public",
"static",
"function",
"size",
"(",
"string",
"$",
"path",
")",
":",
"?",
"int",
"{",
"$",
"size",
"=",
"filesize",
"(",
"$",
"path",
")",
";",
"return",
"$",
"size",
"===",
"false",
"?",
"null",
":",
"$",
"size",
";",
"}"
] | @param string $path
@return int|null | [
"@param",
"string",
"$path"
] | train | https://github.com/primipilus/fileinfo/blob/734fd25b3dfd3b0706f9ef07499663578c0fa56e/src/FileTool.php#L35-L39 |
Eresus/EresusCMS | src/core/HTTP/Response.php | Eresus_HTTP_Response.sendHeaders | public function sendHeaders()
{
/* Отправляем основной заголовок */
$statusText = $this->statusText ?: self::getStatusText($this->getStatusCode());
$header = 'HTTP/'
. $this->getProtocolVersion() . ' '
. $this->getStatusCode() . ' '
. $statusText;
... | php | public function sendHeaders()
{
/* Отправляем основной заголовок */
$statusText = $this->statusText ?: self::getStatusText($this->getStatusCode());
$header = 'HTTP/'
. $this->getProtocolVersion() . ' '
. $this->getStatusCode() . ' '
. $statusText;
... | [
"public",
"function",
"sendHeaders",
"(",
")",
"{",
"/* Отправляем основной заголовок */",
"$",
"statusText",
"=",
"$",
"this",
"->",
"statusText",
"?",
":",
"self",
"::",
"getStatusText",
"(",
"$",
"this",
"->",
"getStatusCode",
"(",
")",
")",
";",
"$",
"he... | Отправляет заголовки ответа
@return $this
@since 3.01 | [
"Отправляет",
"заголовки",
"ответа"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/HTTP/Response.php#L165-L181 |
Eresus/EresusCMS | src/core/HTTP/Response.php | Eresus_HTTP_Response.setProtocolVersion | public function setProtocolVersion($version)
{
if (!preg_match('/^\d(\.\d+)+$/', $version))
{
throw new InvalidArgumentException('Invalid protocol version: ' . $version);
}
$this->protocolVersion = $version;
return $this;
} | php | public function setProtocolVersion($version)
{
if (!preg_match('/^\d(\.\d+)+$/', $version))
{
throw new InvalidArgumentException('Invalid protocol version: ' . $version);
}
$this->protocolVersion = $version;
return $this;
} | [
"public",
"function",
"setProtocolVersion",
"(",
"$",
"version",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^\\d(\\.\\d+)+$/'",
",",
"$",
"version",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'Invalid protocol version: '",
".",
"$",
"v... | Задаёт версию протокола
@param string $version версия (1.0, 1.1, 2.0…)
@throws InvalidArgumentException
@return $this
@since 3.01 | [
"Задаёт",
"версию",
"протокола"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/HTTP/Response.php#L219-L227 |
Eresus/EresusCMS | src/core/HTTP/Response.php | Eresus_HTTP_Response.setStatusCode | public function setStatusCode($code, $text = null)
{
$code = intval($code);
if ($code < 100 || $code > 999)
{
throw new InvalidArgumentException('Status code must be from 100 to 999');
}
$this->status = $code;
$this->statusText = $text;
return $thi... | php | public function setStatusCode($code, $text = null)
{
$code = intval($code);
if ($code < 100 || $code > 999)
{
throw new InvalidArgumentException('Status code must be from 100 to 999');
}
$this->status = $code;
$this->statusText = $text;
return $thi... | [
"public",
"function",
"setStatusCode",
"(",
"$",
"code",
",",
"$",
"text",
"=",
"null",
")",
"{",
"$",
"code",
"=",
"intval",
"(",
"$",
"code",
")",
";",
"if",
"(",
"$",
"code",
"<",
"100",
"||",
"$",
"code",
">",
"999",
")",
"{",
"throw",
"new... | Задаёт код состояния
@param int $code код состояния
@param mixed $text опциональное текстовое описание кода
@throws InvalidArgumentException
@return $this
@since 3.01 | [
"Задаёт",
"код",
"состояния"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/HTTP/Response.php#L251-L261 |
NuclearCMS/Hierarchy | src/Support/LocaleManager.php | LocaleManager.setAppLocale | public function setAppLocale($locale = null, $session = true)
{
$locale = $locale ?: $this->session->get('_locale', null);
if ($locale)
{
$this->app->setLocale($locale);
if ($session)
{
$this->session->put('_locale', $locale);
... | php | public function setAppLocale($locale = null, $session = true)
{
$locale = $locale ?: $this->session->get('_locale', null);
if ($locale)
{
$this->app->setLocale($locale);
if ($session)
{
$this->session->put('_locale', $locale);
... | [
"public",
"function",
"setAppLocale",
"(",
"$",
"locale",
"=",
"null",
",",
"$",
"session",
"=",
"true",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'_locale'",
",",
"null",
")",
";",
"if"... | Sets the app locale
@param string $locale
@param bool $session
@return void | [
"Sets",
"the",
"app",
"locale"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/LocaleManager.php#L43-L58 |
NuclearCMS/Hierarchy | src/Support/LocaleManager.php | LocaleManager.setTimeLocale | public function setTimeLocale($locale = null)
{
$locale = $locale ?: $this->session->get('_locale', $this->app->getLocale());
setlocale(LC_TIME, $this->config->get('translatable.full_locales.' . $locale, null));
Carbon::setLocale($locale);
} | php | public function setTimeLocale($locale = null)
{
$locale = $locale ?: $this->session->get('_locale', $this->app->getLocale());
setlocale(LC_TIME, $this->config->get('translatable.full_locales.' . $locale, null));
Carbon::setLocale($locale);
} | [
"public",
"function",
"setTimeLocale",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"session",
"->",
"get",
"(",
"'_locale'",
",",
"$",
"this",
"->",
"app",
"->",
"getLocale",
"(",
")",
... | Sets the time locale
@param string $locale
@return void | [
"Sets",
"the",
"time",
"locale"
] | train | https://github.com/NuclearCMS/Hierarchy/blob/535171c5e2db72265313fd2110aec8456e46f459/src/Support/LocaleManager.php#L66-L73 |
surebert/surebert-framework | src/sb/Files/ForceDownload.php | ForceDownload.send | public static function send($file, $display_file_name = '', $seekat=0)
{
$display_file_name = $display_file_name ? $display_file_name : basename($file);
$display_file_name = str_replace(" ", "_", $display_file_name);
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
header... | php | public static function send($file, $display_file_name = '', $seekat=0)
{
$display_file_name = $display_file_name ? $display_file_name : basename($file);
$display_file_name = str_replace(" ", "_", $display_file_name);
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
header... | [
"public",
"static",
"function",
"send",
"(",
"$",
"file",
",",
"$",
"display_file_name",
"=",
"''",
",",
"$",
"seekat",
"=",
"0",
")",
"{",
"$",
"display_file_name",
"=",
"$",
"display_file_name",
"?",
"$",
"display_file_name",
":",
"basename",
"(",
"$",
... | Send headers and begins force-download
@param string $file The path to the file to force download
@param string $display_file_name The filename to give to the
@param int $seekat Where to start in file stream
force download if different than the basename of the file arg | [
"Send",
"headers",
"and",
"begins",
"force",
"-",
"download"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Files/ForceDownload.php#L23-L40 |
surebert/surebert-framework | src/sb/Files/ForceDownload.php | ForceDownload.fileToZip | public static function fileToZip($path)
{
if (is_file($path) || is_dir($path)) {
$zip = new \ZipArchive;
$zip_file = ROOT . '/private/cache/zip/' . md5(microtime(true));
if (!is_dir(dirname($zip_file))) {
mkdir(dirname($zip_file), 0775, true);
... | php | public static function fileToZip($path)
{
if (is_file($path) || is_dir($path)) {
$zip = new \ZipArchive;
$zip_file = ROOT . '/private/cache/zip/' . md5(microtime(true));
if (!is_dir(dirname($zip_file))) {
mkdir(dirname($zip_file), 0775, true);
... | [
"public",
"static",
"function",
"fileToZip",
"(",
"$",
"path",
")",
"{",
"if",
"(",
"is_file",
"(",
"$",
"path",
")",
"||",
"is_dir",
"(",
"$",
"path",
")",
")",
"{",
"$",
"zip",
"=",
"new",
"\\",
"ZipArchive",
";",
"$",
"zip_file",
"=",
"ROOT",
... | Converts a file or directory into a zip file for consumption by the browser
@param string $path The path to the file or directory
@return string | [
"Converts",
"a",
"file",
"or",
"directory",
"into",
"a",
"zip",
"file",
"for",
"consumption",
"by",
"the",
"browser"
] | train | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Files/ForceDownload.php#L47-L80 |
david-mk/mail-map | src/MailMap/Connection.php | Connection.search | public function search($search = '', $criteria = SORTDATE, $opt = SE_UID, $dir = 1)
{
if ('' === ($search = trim($search))) {
$search = null;
}
return imap_sort($this->stream, $criteria, $dir, $opt, $search);
} | php | public function search($search = '', $criteria = SORTDATE, $opt = SE_UID, $dir = 1)
{
if ('' === ($search = trim($search))) {
$search = null;
}
return imap_sort($this->stream, $criteria, $dir, $opt, $search);
} | [
"public",
"function",
"search",
"(",
"$",
"search",
"=",
"''",
",",
"$",
"criteria",
"=",
"SORTDATE",
",",
"$",
"opt",
"=",
"SE_UID",
",",
"$",
"dir",
"=",
"1",
")",
"{",
"if",
"(",
"''",
"===",
"(",
"$",
"search",
"=",
"trim",
"(",
"$",
"searc... | Search mailbox for emails
@param string $search Search string as specified in http://php.net/manual/en/function.imap-search.php
@param int $criteria Sort flag from http://php.net/manual/en/function.imap-sort.php
@param int $opt Options flags from http://php.net/manual/en/function.imap-sort.php
@param int $dir Reve... | [
"Search",
"mailbox",
"for",
"emails"
] | train | https://github.com/david-mk/mail-map/blob/4eea346ece9fa35c0d309b5a909f657ad83e1e6a/src/MailMap/Connection.php#L45-L52 |
glynnforrest/blockade | src/Blockade/Exception/BlockadeException.php | BlockadeException.from | public static function from(DriverInterface $driver, $message = '', $code = 0, \Exception $previous = null)
{
//make sure that empty arguments don't get passed to exceptions as
//they have default messages and codes.
$self = $message ? ($code ? new static($message, $code, $previous) : new st... | php | public static function from(DriverInterface $driver, $message = '', $code = 0, \Exception $previous = null)
{
//make sure that empty arguments don't get passed to exceptions as
//they have default messages and codes.
$self = $message ? ($code ? new static($message, $code, $previous) : new st... | [
"public",
"static",
"function",
"from",
"(",
"DriverInterface",
"$",
"driver",
",",
"$",
"message",
"=",
"''",
",",
"$",
"code",
"=",
"0",
",",
"\\",
"Exception",
"$",
"previous",
"=",
"null",
")",
"{",
"//make sure that empty arguments don't get passed to excep... | Factory method to set the driver that created this exception.
@param DriverInterface $driver The driver | [
"Factory",
"method",
"to",
"set",
"the",
"driver",
"that",
"created",
"this",
"exception",
"."
] | train | https://github.com/glynnforrest/blockade/blob/5dfc8b2fa7b9f7029a1bdaa7c50e32ee8665ab3b/src/Blockade/Exception/BlockadeException.php#L21-L30 |
songshenzong/log | src/DebugBar.php | DebugBar.initStackSession | protected function initStackSession()
{
$http = $this->getHttpDriver();
if (!$http->isSessionStarted()) {
throw new DebugBarException('Session must be started before using stack data in the songshenzong');
}
if (!$http->hasSessionValue($this->stackSessionNamespace)) {
... | php | protected function initStackSession()
{
$http = $this->getHttpDriver();
if (!$http->isSessionStarted()) {
throw new DebugBarException('Session must be started before using stack data in the songshenzong');
}
if (!$http->hasSessionValue($this->stackSessionNamespace)) {
... | [
"protected",
"function",
"initStackSession",
"(",
")",
"{",
"$",
"http",
"=",
"$",
"this",
"->",
"getHttpDriver",
"(",
")",
";",
"if",
"(",
"!",
"$",
"http",
"->",
"isSessionStarted",
"(",
")",
")",
"{",
"throw",
"new",
"DebugBarException",
"(",
"'Sessio... | Initializes the session for stacked data
@return HttpDriverInterface
@throws DebugBarException | [
"Initializes",
"the",
"session",
"for",
"stacked",
"data"
] | train | https://github.com/songshenzong/log/blob/b1e01f7994da47737866eabf82367490eab17c46/src/DebugBar.php#L252-L264 |
heidelpay/PhpDoc | src/phpDocumentor/Plugin/LegacyNamespaceConverter/ServiceProvider.php | ServiceProvider.addNamespaceFilter | private function addNamespaceFilter(ProjectDescriptorBuilder $builder, Filter $filterManager)
{
$filter = new LegacyNamespaceFilter($builder);
// parse parameters
foreach ($this->plugin->getParameters() as $param) {
if ($param->getKey() == 'NamespacePrefix') {
$f... | php | private function addNamespaceFilter(ProjectDescriptorBuilder $builder, Filter $filterManager)
{
$filter = new LegacyNamespaceFilter($builder);
// parse parameters
foreach ($this->plugin->getParameters() as $param) {
if ($param->getKey() == 'NamespacePrefix') {
$f... | [
"private",
"function",
"addNamespaceFilter",
"(",
"ProjectDescriptorBuilder",
"$",
"builder",
",",
"Filter",
"$",
"filterManager",
")",
"{",
"$",
"filter",
"=",
"new",
"LegacyNamespaceFilter",
"(",
"$",
"builder",
")",
";",
"// parse parameters",
"foreach",
"(",
"... | Attaches the filter responsible for the conversion to all structural elements.
@param ProjectDescriptorBuilder $builder
@param Filter $filterManager
@return void | [
"Attaches",
"the",
"filter",
"responsible",
"for",
"the",
"conversion",
"to",
"all",
"structural",
"elements",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Plugin/LegacyNamespaceConverter/ServiceProvider.php#L67-L85 |
alevilar/ristorantino-vendor | Risto/Model/Behavior/DiaBuscableBehavior.php | DiaBuscableBehavior.setUp | public function setUp ( Model $Model, $options = array() ) {
if ( !empty($options['fieldsParaSumatoria']) ) {
$this->fieldsParaSumatoria = $options['fieldsParaSumatoria'];
}
if ( !empty($options['fechaField']) ) {
$this->fechaField = $options['fechaField'];
}
} | php | public function setUp ( Model $Model, $options = array() ) {
if ( !empty($options['fieldsParaSumatoria']) ) {
$this->fieldsParaSumatoria = $options['fieldsParaSumatoria'];
}
if ( !empty($options['fechaField']) ) {
$this->fechaField = $options['fechaField'];
}
} | [
"public",
"function",
"setUp",
"(",
"Model",
"$",
"Model",
",",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'fieldsParaSumatoria'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"fieldsParaSumatoria",
... | Setup the behavior | [
"Setup",
"the",
"behavior"
] | train | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Risto/Model/Behavior/DiaBuscableBehavior.php#L26-L35 |
Eresus/EresusCMS | src/core/HTTP/Redirect.php | Eresus_HTTP_Redirect.setStatusCode | public function setStatusCode($code, $text = null)
{
if ($this->getProtocolVersion() == '1.0'
&& !in_array($this->getStatusCode(), array(300, 301, 302, 304)))
{
$code = 302;
}
return parent::setStatusCode($code, $text);
} | php | public function setStatusCode($code, $text = null)
{
if ($this->getProtocolVersion() == '1.0'
&& !in_array($this->getStatusCode(), array(300, 301, 302, 304)))
{
$code = 302;
}
return parent::setStatusCode($code, $text);
} | [
"public",
"function",
"setStatusCode",
"(",
"$",
"code",
",",
"$",
"text",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getProtocolVersion",
"(",
")",
"==",
"'1.0'",
"&&",
"!",
"in_array",
"(",
"$",
"this",
"->",
"getStatusCode",
"(",
")",
"... | Задаёт код состояния
@param int $code код состояния
@param mixed $text опциональное текстовое описание кода
@throws InvalidArgumentException
@return $this
@since 3.01 | [
"Задаёт",
"код",
"состояния"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/HTTP/Redirect.php#L70-L78 |
Eresus/EresusCMS | src/core/HTTP/Redirect.php | Eresus_HTTP_Redirect.sendContent | public function sendContent()
{
$url = htmlspecialchars(strval($this->getContent()));
$message = $this->statusText ?: self::getStatusText($this->getStatusCode());
echo <<<PAGE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="Refresh" content="0; url=... | php | public function sendContent()
{
$url = htmlspecialchars(strval($this->getContent()));
$message = $this->statusText ?: self::getStatusText($this->getStatusCode());
echo <<<PAGE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta http-equiv="Refresh" content="0; url=... | [
"public",
"function",
"sendContent",
"(",
")",
"{",
"$",
"url",
"=",
"htmlspecialchars",
"(",
"strval",
"(",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
")",
";",
"$",
"message",
"=",
"$",
"this",
"->",
"statusText",
"?",
":",
"self",
"::",
"getS... | Отправляет тело ответа
@return $this
@since 3.01 | [
"Отправляет",
"тело",
"ответа"
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/HTTP/Redirect.php#L101-L126 |
hametuha/wpametu | src/WPametu/Http/PostRedirectGet.php | PostRedirectGet.writeSession | private function writeSession($message, $from = '', $is_error = false){
if( session_id() ){
$key = $is_error ? $this->error_key : $this->message_key;
// Initialize
if( !isset($_SESSION[$key]) || !is_array($_SESSION[$key]) ){
$_SESSION[$key] = [];
}... | php | private function writeSession($message, $from = '', $is_error = false){
if( session_id() ){
$key = $is_error ? $this->error_key : $this->message_key;
// Initialize
if( !isset($_SESSION[$key]) || !is_array($_SESSION[$key]) ){
$_SESSION[$key] = [];
}... | [
"private",
"function",
"writeSession",
"(",
"$",
"message",
",",
"$",
"from",
"=",
"''",
",",
"$",
"is_error",
"=",
"false",
")",
"{",
"if",
"(",
"session_id",
"(",
")",
")",
"{",
"$",
"key",
"=",
"$",
"is_error",
"?",
"$",
"this",
"->",
"error_key... | Write message to session
@param $message
@param string $from
@param bool $is_error | [
"Write",
"message",
"to",
"session"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Http/PostRedirectGet.php#L105-L115 |
hametuha/wpametu | src/WPametu/Http/PostRedirectGet.php | PostRedirectGet.flushMessage | public function flushMessage(){
if( session_id() ){
foreach( [ $this->error_key => 'error', $this->message_key => 'updated' ] as $key => $class_name ){
if( isset($_SESSION[$key]) && !empty($_SESSION[$key]) ){
$markup = sprintf('<div class="%s"><p>%s</p></div>', $c... | php | public function flushMessage(){
if( session_id() ){
foreach( [ $this->error_key => 'error', $this->message_key => 'updated' ] as $key => $class_name ){
if( isset($_SESSION[$key]) && !empty($_SESSION[$key]) ){
$markup = sprintf('<div class="%s"><p>%s</p></div>', $c... | [
"public",
"function",
"flushMessage",
"(",
")",
"{",
"if",
"(",
"session_id",
"(",
")",
")",
"{",
"foreach",
"(",
"[",
"$",
"this",
"->",
"error_key",
"=>",
"'error'",
",",
"$",
"this",
"->",
"message_key",
"=>",
"'updated'",
"]",
"as",
"$",
"key",
"... | Show message on screen | [
"Show",
"message",
"on",
"screen"
] | train | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Http/PostRedirectGet.php#L120-L143 |
WScore/Validation | src/Utils/HelperMultiple.php | HelperMultiple.prepare | public static function prepare($name, $source, $option)
{
// get options.
if (is_string($option)) {
$option = (array) Helper::arrGet(self::$multiples, $option, array());
}
$lists = self::find_multiple($name, $source, $option);
$found = self::merge_multiple($option... | php | public static function prepare($name, $source, $option)
{
// get options.
if (is_string($option)) {
$option = (array) Helper::arrGet(self::$multiples, $option, array());
}
$lists = self::find_multiple($name, $source, $option);
$found = self::merge_multiple($option... | [
"public",
"static",
"function",
"prepare",
"(",
"$",
"name",
",",
"$",
"source",
",",
"$",
"option",
")",
"{",
"// get options.",
"if",
"(",
"is_string",
"(",
"$",
"option",
")",
")",
"{",
"$",
"option",
"=",
"(",
"array",
")",
"Helper",
"::",
"arrGe... | prepares for validation by creating a value from multiple value.
@param string $name
@param array $source
@param string|array $option
@return mixed|null|string | [
"prepares",
"for",
"validation",
"by",
"creating",
"a",
"value",
"from",
"multiple",
"value",
"."
] | train | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperMultiple.php#L33-L44 |
WScore/Validation | src/Utils/HelperMultiple.php | HelperMultiple.find_multiple | private static function find_multiple($name, $source, $option)
{
$sep = Helper::arrGet($option, 'separator', '_');
$suffix = explode(',', $option['suffix']);
$lists = [];
foreach ($suffix as $sfx) {
$name_sfx = $name . $sep . $sfx;
if (array_key_exists($na... | php | private static function find_multiple($name, $source, $option)
{
$sep = Helper::arrGet($option, 'separator', '_');
$suffix = explode(',', $option['suffix']);
$lists = [];
foreach ($suffix as $sfx) {
$name_sfx = $name . $sep . $sfx;
if (array_key_exists($na... | [
"private",
"static",
"function",
"find_multiple",
"(",
"$",
"name",
",",
"$",
"source",
",",
"$",
"option",
")",
"{",
"$",
"sep",
"=",
"Helper",
"::",
"arrGet",
"(",
"$",
"option",
",",
"'separator'",
",",
"'_'",
")",
";",
"$",
"suffix",
"=",
"explod... | find multiples values from suffix list.
@param string $name
@param array $source
@param array $option
@return array | [
"find",
"multiples",
"values",
"from",
"suffix",
"list",
"."
] | train | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperMultiple.php#L54-L67 |
WScore/Validation | src/Utils/HelperMultiple.php | HelperMultiple.merge_multiple | private static function merge_multiple($option, $lists)
{
if (empty($lists)) {
return null;
}
// found format using sprintf.
if (isset($option['format'])) {
$param = array_merge(array($option['format']), $lists);
$found = call_user_func_array('spri... | php | private static function merge_multiple($option, $lists)
{
if (empty($lists)) {
return null;
}
// found format using sprintf.
if (isset($option['format'])) {
$param = array_merge(array($option['format']), $lists);
$found = call_user_func_array('spri... | [
"private",
"static",
"function",
"merge_multiple",
"(",
"$",
"option",
",",
"$",
"lists",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"lists",
")",
")",
"{",
"return",
"null",
";",
"}",
"// found format using sprintf.",
"if",
"(",
"isset",
"(",
"$",
"option"... | merge the found list into one value.
@param array $option
@param array $lists
@return mixed|null|string | [
"merge",
"the",
"found",
"list",
"into",
"one",
"value",
"."
] | train | https://github.com/WScore/Validation/blob/25c0dca37d624bb0bb22f8e79ba54db2f69e0950/src/Utils/HelperMultiple.php#L76-L91 |
WellCommerce/StandardEditionBundle | DataFixtures/ORM/LoadProductData.php | LoadProductData.load | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$limit = $this->container->getParameter('fixtures_product_limit');
$faker = $this->getFakerGenerator();
$names = [];
for ($i = 0; $i < $limit; $i++) {
... | php | public function load(ObjectManager $manager)
{
if (!$this->isEnabled()) {
return;
}
$limit = $this->container->getParameter('fixtures_product_limit');
$faker = $this->getFakerGenerator();
$names = [];
for ($i = 0; $i < $limit; $i++) {
... | [
"public",
"function",
"load",
"(",
"ObjectManager",
"$",
"manager",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isEnabled",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"limit",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'fixt... | {@inheritDoc} | [
"{"
] | train | https://github.com/WellCommerce/StandardEditionBundle/blob/6367bd20bbb6bde37c710a6ba87ae72b5f05f61e/DataFixtures/ORM/LoadProductData.php#L44-L82 |
ekuiter/feature-php | FeaturePhp/Collaboration/Role.php | Role.correspondsTo | public function correspondsTo($role) {
if ($this->fileSpecification->getRelativeSource() === $role->fileSpecification->getRelativeSource()) {
if ($this->fileSpecification->getTarget() !== $role->fileSpecification->getTarget())
throw new RoleException("mismatching targets for \"{$this... | php | public function correspondsTo($role) {
if ($this->fileSpecification->getRelativeSource() === $role->fileSpecification->getRelativeSource()) {
if ($this->fileSpecification->getTarget() !== $role->fileSpecification->getTarget())
throw new RoleException("mismatching targets for \"{$this... | [
"public",
"function",
"correspondsTo",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"fileSpecification",
"->",
"getRelativeSource",
"(",
")",
"===",
"$",
"role",
"->",
"fileSpecification",
"->",
"getRelativeSource",
"(",
")",
")",
"{",
"if",
"... | Returns whether two roles are refining the same class.
It requires the roles' files to reside in the same containment hierarchies
(i.e. their source paths match).
This is an equivalence relation and can be used by {@see \FeaturePhp\Helper\Partition}.
@param Role $role
@return bool | [
"Returns",
"whether",
"two",
"roles",
"are",
"refining",
"the",
"same",
"class",
".",
"It",
"requires",
"the",
"roles",
"files",
"to",
"reside",
"in",
"the",
"same",
"containment",
"hierarchies",
"(",
"i",
".",
"e",
".",
"their",
"source",
"paths",
"match"... | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Collaboration/Role.php#L76-L87 |
brightmarch/rest-easy | src/Brightmarch/RestEasy/Controller/Mixin/HttpJsonMiddlewareMixin.php | HttpJsonMiddlewareMixin.renderResource | public function renderResource($view, array $parameters=[], $statusCode=200)
{
$jsonHeader = 'application/json';
$response = parent::renderResource($view, $parameters, $statusCode);
// Only do this if they are actually sending JSON.
if (false !== stripos($response->headers->get('con... | php | public function renderResource($view, array $parameters=[], $statusCode=200)
{
$jsonHeader = 'application/json';
$response = parent::renderResource($view, $parameters, $statusCode);
// Only do this if they are actually sending JSON.
if (false !== stripos($response->headers->get('con... | [
"public",
"function",
"renderResource",
"(",
"$",
"view",
",",
"array",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"statusCode",
"=",
"200",
")",
"{",
"$",
"jsonHeader",
"=",
"'application/json'",
";",
"$",
"response",
"=",
"parent",
"::",
"renderResource... | This middleware method takes content from a
Symfony\Component\HttpFoundation\Response object
and pretty prints the JSON if the response is of
Content-Type application/json.
@param string $view
@param array $parameters
@param integer $statusCode
@return Symfony\Component\HttpFoundation\Response | [
"This",
"middleware",
"method",
"takes",
"content",
"from",
"a",
"Symfony",
"\\",
"Component",
"\\",
"HttpFoundation",
"\\",
"Response",
"object",
"and",
"pretty",
"prints",
"the",
"JSON",
"if",
"the",
"response",
"is",
"of",
"Content",
"-",
"Type",
"applicati... | train | https://github.com/brightmarch/rest-easy/blob/a6903cdff0a5de2e4466d3e3438c59b9903049f4/src/Brightmarch/RestEasy/Controller/Mixin/HttpJsonMiddlewareMixin.php#L19-L33 |
nabab/bbn | src/bbn/appui/menus.php | menus.to_path | public function to_path(string $id){
if ( bbn\str::is_uid($id) ){
return $this->options->to_path($id, '', $this->_get_public_root());
}
return false;
} | php | public function to_path(string $id){
if ( bbn\str::is_uid($id) ){
return $this->options->to_path($id, '', $this->_get_public_root());
}
return false;
} | [
"public",
"function",
"to_path",
"(",
"string",
"$",
"id",
")",
"{",
"if",
"(",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"options",
"->",
"to_path",
"(",
"$",
"id",
",",
"''",
",",
"$",
"th... | Returns the path corresponding to an ID
@param string $id
@return int|boolean | [
"Returns",
"the",
"path",
"corresponding",
"to",
"an",
"ID"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L160-L165 |
nabab/bbn | src/bbn/appui/menus.php | menus.add_shortcut | public function add_shortcut(string $id): ?string
{
if (
($bit = $this->pref->get_bit($id, false)) &&
($id_option = $this->from_path('shortcuts')) &&
($c = $this->pref->get_class_cfg())
){
if ( $id_menu = $this->pref->get_by_option($id_option) ){
$id_menu = $id_menu[$c['arch'][... | php | public function add_shortcut(string $id): ?string
{
if (
($bit = $this->pref->get_bit($id, false)) &&
($id_option = $this->from_path('shortcuts')) &&
($c = $this->pref->get_class_cfg())
){
if ( $id_menu = $this->pref->get_by_option($id_option) ){
$id_menu = $id_menu[$c['arch'][... | [
"public",
"function",
"add_shortcut",
"(",
"string",
"$",
"id",
")",
":",
"?",
"string",
"{",
"if",
"(",
"(",
"$",
"bit",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_bit",
"(",
"$",
"id",
",",
"false",
")",
")",
"&&",
"(",
"$",
"id_option",
"=",
... | Adds an user'shortcut from a menu
@param string $id The menu item's ID to link
@return string|null | [
"Adds",
"an",
"user",
"shortcut",
"from",
"a",
"menu"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L191-L223 |
nabab/bbn | src/bbn/appui/menus.php | menus.remove_shortcut | public function remove_shortcut($id): ?int
{
if ( \bbn\str::is_uid($id) ){
return $this->pref->delete_bit($id);
}
return null;
} | php | public function remove_shortcut($id): ?int
{
if ( \bbn\str::is_uid($id) ){
return $this->pref->delete_bit($id);
}
return null;
} | [
"public",
"function",
"remove_shortcut",
"(",
"$",
"id",
")",
":",
"?",
"int",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"pref",
"->",
"delete_bit",
"(",
"$",
"id",
")",
... | Removes an user'shortcut
@param string $id The shortcut's ID
@return null|int | [
"Removes",
"an",
"user",
"shortcut"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L231-L237 |
nabab/bbn | src/bbn/appui/menus.php | menus.shortcuts | public function shortcuts(): ?array
{
if (
($id_option = $this->from_path('shortcuts')) &&
($menu = $this->pref->get_by_option($id_option))
){
$links = $this->pref->get_bits($menu['id']);
$res = [];
foreach ( $links as $link ){
if ( ($url = $this->to_path($link['id_option... | php | public function shortcuts(): ?array
{
if (
($id_option = $this->from_path('shortcuts')) &&
($menu = $this->pref->get_by_option($id_option))
){
$links = $this->pref->get_bits($menu['id']);
$res = [];
foreach ( $links as $link ){
if ( ($url = $this->to_path($link['id_option... | [
"public",
"function",
"shortcuts",
"(",
")",
":",
"?",
"array",
"{",
"if",
"(",
"(",
"$",
"id_option",
"=",
"$",
"this",
"->",
"from_path",
"(",
"'shortcuts'",
")",
")",
"&&",
"(",
"$",
"menu",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_by_option",
... | Gets the user' shortcuts list
@return null|array | [
"Gets",
"the",
"user",
"shortcuts",
"list"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L244-L267 |
nabab/bbn | src/bbn/appui/menus.php | menus.remove | public function remove(string $id){
if ( \bbn\str::is_uid($id) ){
if ( $id_menu = $this->get_id_menu($id) ){
if ( $this->pref->delete_bit($id) ){
$this->delete_cache($id_menu);
return true;
}
}
else if ( $this->pref->delete($id) ){
$this->options->delete... | php | public function remove(string $id){
if ( \bbn\str::is_uid($id) ){
if ( $id_menu = $this->get_id_menu($id) ){
if ( $this->pref->delete_bit($id) ){
$this->delete_cache($id_menu);
return true;
}
}
else if ( $this->pref->delete($id) ){
$this->options->delete... | [
"public",
"function",
"remove",
"(",
"string",
"$",
"id",
")",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
")",
"{",
"if",
"(",
"$",
"id_menu",
"=",
"$",
"this",
"->",
"get_id_menu",
"(",
"$",
"id",
")",
")",
... | Removes menu and deletes parent cache
@param $id
@return int|boolean | [
"Removes",
"menu",
"and",
"deletes",
"parent",
"cache"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L285-L299 |
nabab/bbn | src/bbn/appui/menus.php | menus.add | public function add($id_menu, array $cfg = null): ?string
{
$ids = [];
if ( \is_array($id_menu) ){
$cfg = $id_menu;
$id_opt = $this->from_path('menus');
}
if ( !empty($cfg) ){
if ( \bbn\str::is_uid($id_menu) ){
$id = $this->pref->add_bit($id_menu, $cfg);
}
e... | php | public function add($id_menu, array $cfg = null): ?string
{
$ids = [];
if ( \is_array($id_menu) ){
$cfg = $id_menu;
$id_opt = $this->from_path('menus');
}
if ( !empty($cfg) ){
if ( \bbn\str::is_uid($id_menu) ){
$id = $this->pref->add_bit($id_menu, $cfg);
}
e... | [
"public",
"function",
"add",
"(",
"$",
"id_menu",
",",
"array",
"$",
"cfg",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"ids",
"=",
"[",
"]",
";",
"if",
"(",
"\\",
"is_array",
"(",
"$",
"id_menu",
")",
")",
"{",
"$",
"cfg",
"=",
"$",
"id_... | Add menu and delete the chache.
@param string|array $id_parent
@param array $cfg
@return null|string
@internal param $id | [
"Add",
"menu",
"and",
"delete",
"the",
"chache",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L309-L332 |
nabab/bbn | src/bbn/appui/menus.php | menus.set | public function set(string $id, array $cfg): bool
{
if (
\bbn\str::is_uid($id) &&
($id_menu = $this->get_id_menu($id)) &&
$this->pref->update_bit($id, $cfg)
){
$this->delete_cache($id_menu);
return true;
}
return false;
} | php | public function set(string $id, array $cfg): bool
{
if (
\bbn\str::is_uid($id) &&
($id_menu = $this->get_id_menu($id)) &&
$this->pref->update_bit($id, $cfg)
){
$this->delete_cache($id_menu);
return true;
}
return false;
} | [
"public",
"function",
"set",
"(",
"string",
"$",
"id",
",",
"array",
"$",
"cfg",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
"&&",
"(",
"$",
"id_menu",
"=",
"$",
"this",
"->",
"get_id_menu",
... | Updates a menu item and deletes the menu cache
@param string $id
@param array $cfg
@return bool | [
"Updates",
"a",
"menu",
"item",
"and",
"deletes",
"the",
"menu",
"cache"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L341-L352 |
nabab/bbn | src/bbn/appui/menus.php | menus.set_text | public function set_text(string $id, string $text): bool
{
if ( \bbn\str::is_uid($id) && $this->pref->set_text($id, $text) ){
$this->delete_cache($id);
return true;
}
return false;
} | php | public function set_text(string $id, string $text): bool
{
if ( \bbn\str::is_uid($id) && $this->pref->set_text($id, $text) ){
$this->delete_cache($id);
return true;
}
return false;
} | [
"public",
"function",
"set_text",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"text",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
"&&",
"$",
"this",
"->",
"pref",
"->",
"set_text",
"(",
"$",
... | Sets the menu's text and deletes its chache
@param string $id The menu's ID
@param array $text The new text tp set
@return bool | [
"Sets",
"the",
"menu",
"s",
"text",
"and",
"deletes",
"its",
"chache"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L361-L368 |
nabab/bbn | src/bbn/appui/menus.php | menus.delete_cache | public function delete_cache($id_menu){
$this->options->delete_cache($this->from_path('menus'), true);
return $this->cache_delete($id_menu);
} | php | public function delete_cache($id_menu){
$this->options->delete_cache($this->from_path('menus'), true);
return $this->cache_delete($id_menu);
} | [
"public",
"function",
"delete_cache",
"(",
"$",
"id_menu",
")",
"{",
"$",
"this",
"->",
"options",
"->",
"delete_cache",
"(",
"$",
"this",
"->",
"from_path",
"(",
"'menus'",
")",
",",
"true",
")",
";",
"return",
"$",
"this",
"->",
"cache_delete",
"(",
... | Clears the menu cache | [
"Clears",
"the",
"menu",
"cache"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L373-L376 |
nabab/bbn | src/bbn/appui/menus.php | menus.get_default | public function get_default(): ?string
{
if (
($id_opt = $this->from_path('default')) &&
($all = $this->pref->get_all($id_opt))
){
$id = false;
foreach ( $all as $a ){
if ( !empty($a['id_user']) ){
$id = $a['id_alias'];
break;
}
else if ( !em... | php | public function get_default(): ?string
{
if (
($id_opt = $this->from_path('default')) &&
($all = $this->pref->get_all($id_opt))
){
$id = false;
foreach ( $all as $a ){
if ( !empty($a['id_user']) ){
$id = $a['id_alias'];
break;
}
else if ( !em... | [
"public",
"function",
"get_default",
"(",
")",
":",
"?",
"string",
"{",
"if",
"(",
"(",
"$",
"id_opt",
"=",
"$",
"this",
"->",
"from_path",
"(",
"'default'",
")",
")",
"&&",
"(",
"$",
"all",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_all",
"(",
"... | Gets the user's default menu
@return string | [
"Gets",
"the",
"user",
"s",
"default",
"menu"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L383-L407 |
nabab/bbn | src/bbn/appui/menus.php | menus.get_menus | public function get_menus($k_text = 'text', $k_value = 'value'): ?array
{
$c = $this->pref->get_class_cfg();
return array_map(function($e) use($c, $k_text, $k_value){
return [
$k_text => $e[$c['arch']['user_options']['text']],
$k_value => $e[$c['arch']['user_options']['id']],
$c[... | php | public function get_menus($k_text = 'text', $k_value = 'value'): ?array
{
$c = $this->pref->get_class_cfg();
return array_map(function($e) use($c, $k_text, $k_value){
return [
$k_text => $e[$c['arch']['user_options']['text']],
$k_value => $e[$c['arch']['user_options']['id']],
$c[... | [
"public",
"function",
"get_menus",
"(",
"$",
"k_text",
"=",
"'text'",
",",
"$",
"k_value",
"=",
"'value'",
")",
":",
"?",
"array",
"{",
"$",
"c",
"=",
"$",
"this",
"->",
"pref",
"->",
"get_class_cfg",
"(",
")",
";",
"return",
"array_map",
"(",
"funct... | Gets the user's menus list (text-value form)
@param string $k_text The key used for the text. Default: 'text'
@param string $k_value The key used for the value. Default 'value'
@return array | [
"Gets",
"the",
"user",
"s",
"menus",
"list",
"(",
"text",
"-",
"value",
"form",
")"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L416-L428 |
nabab/bbn | src/bbn/appui/menus.php | menus.clone | public function clone(string $id, string $name): ?string
{
if ( \bbn\str::is_uid($id) && ($id_menu = $this->add(['text' => $name])) ){
if ( ($bits = $this->pref->get_full_bits($id)) && !$this->_clone($id_menu, $bits) ){
return null;
}
return $id_menu;
}
return null;
} | php | public function clone(string $id, string $name): ?string
{
if ( \bbn\str::is_uid($id) && ($id_menu = $this->add(['text' => $name])) ){
if ( ($bits = $this->pref->get_full_bits($id)) && !$this->_clone($id_menu, $bits) ){
return null;
}
return $id_menu;
}
return null;
} | [
"public",
"function",
"clone",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"name",
")",
":",
"?",
"string",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id",
")",
"&&",
"(",
"$",
"id_menu",
"=",
"$",
"this",
"->",
"add... | Clones a menu
@param string $id The menu's ID to clone
@param string $name The new menu's name
@return null|string The new ID | [
"Clones",
"a",
"menu"
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L439-L448 |
nabab/bbn | src/bbn/appui/menus.php | menus.copy | public function copy(string $id_menu, string $id_menu_to, array $cfg): ?string
{
if (
\bbn\str::is_uid($id_menu) &&
\bbn\str::is_uid($id_menu_to) &&
($bits = $this->pref->get_full_bits($id_menu)) &&
($id = $this->add($id_menu_to, $cfg)) &&
$this->_clone($id_menu_to, $bits, $id)
)... | php | public function copy(string $id_menu, string $id_menu_to, array $cfg): ?string
{
if (
\bbn\str::is_uid($id_menu) &&
\bbn\str::is_uid($id_menu_to) &&
($bits = $this->pref->get_full_bits($id_menu)) &&
($id = $this->add($id_menu_to, $cfg)) &&
$this->_clone($id_menu_to, $bits, $id)
)... | [
"public",
"function",
"copy",
"(",
"string",
"$",
"id_menu",
",",
"string",
"$",
"id_menu_to",
",",
"array",
"$",
"cfg",
")",
":",
"?",
"string",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id_menu",
")",
"&&",
"\\",
"bbn",... | Copies a menu into another one.
@param string $id The menu's ID to copy
@param string $id_menu_to The target menu's ID
@param array $cfg
@return null|string The new ID | [
"Copies",
"a",
"menu",
"into",
"another",
"one",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L460-L472 |
nabab/bbn | src/bbn/appui/menus.php | menus.copy_to | public function copy_to(string $id_bit, string $id_menu_to, array $cfg): ?string
{
if (
\bbn\str::is_uid($id_bit) &&
\bbn\str::is_uid($id_menu_to) &&
($bit = $this->pref->get_bit($id_bit)) &&
($id_menu = $this->get_id_menu($id_bit))
){
$bit = array_merge($bit, $cfg, [
'id... | php | public function copy_to(string $id_bit, string $id_menu_to, array $cfg): ?string
{
if (
\bbn\str::is_uid($id_bit) &&
\bbn\str::is_uid($id_menu_to) &&
($bit = $this->pref->get_bit($id_bit)) &&
($id_menu = $this->get_id_menu($id_bit))
){
$bit = array_merge($bit, $cfg, [
'id... | [
"public",
"function",
"copy_to",
"(",
"string",
"$",
"id_bit",
",",
"string",
"$",
"id_menu_to",
",",
"array",
"$",
"cfg",
")",
":",
"?",
"string",
"{",
"if",
"(",
"\\",
"bbn",
"\\",
"str",
"::",
"is_uid",
"(",
"$",
"id_bit",
")",
"&&",
"\\",
"bbn"... | Clones a section/link to an other menu.
@param string $id_bit The bit's ID to clone
@param string $id_menu_to The menu's ID to clone
@param string $cfgvaule of bit
@return null|string The new ID | [
"Clones",
"a",
"section",
"/",
"link",
"to",
"an",
"other",
"menu",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L483-L504 |
nabab/bbn | src/bbn/appui/menus.php | menus.order | public function order(string $id, int $pos): bool
{
if ( $res = $this->pref->order_bit($id, $pos) ){
$this->delete_cache($this->get_id_menu($id));
return true;
}
return false;
} | php | public function order(string $id, int $pos): bool
{
if ( $res = $this->pref->order_bit($id, $pos) ){
$this->delete_cache($this->get_id_menu($id));
return true;
}
return false;
} | [
"public",
"function",
"order",
"(",
"string",
"$",
"id",
",",
"int",
"$",
"pos",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"res",
"=",
"$",
"this",
"->",
"pref",
"->",
"order_bit",
"(",
"$",
"id",
",",
"$",
"pos",
")",
")",
"{",
"$",
"this",
"->... | Orders a section/link.
@param string $id The section/link's ID
@param int $pos The new position.
@return bool | [
"Orders",
"a",
"section",
"/",
"link",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L513-L520 |
nabab/bbn | src/bbn/appui/menus.php | menus.move | public function move(string $id, string $id_parent = null): bool
{
if ( $this->pref->move_bit($id, $id_parent) ){
$this->delete_cache($this->get_id_menu($id));
return true;
}
return false;
} | php | public function move(string $id, string $id_parent = null): bool
{
if ( $this->pref->move_bit($id, $id_parent) ){
$this->delete_cache($this->get_id_menu($id));
return true;
}
return false;
} | [
"public",
"function",
"move",
"(",
"string",
"$",
"id",
",",
"string",
"$",
"id_parent",
"=",
"null",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"this",
"->",
"pref",
"->",
"move_bit",
"(",
"$",
"id",
",",
"$",
"id_parent",
")",
")",
"{",
"$",
"this"... | Moves a section/link inside to another one.
@param string $id The section/link's ID.
@param string|null $id_parent The parent's ID.
@return bool | [
"Moves",
"a",
"section",
"/",
"link",
"inside",
"to",
"another",
"one",
"."
] | train | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/appui/menus.php#L529-L536 |
pinepain/amqpy | src/AMQPy/Client/Properties.php | Properties.setHeaders | public function setHeaders($headers)
{
$_headers = [];
if (is_array($headers)) {
$_headers = $headers;
} elseif ($headers instanceof Traversable) {
$_headers = iterator_to_array($headers);
} else {
$type = is_object($headers)
? get... | php | public function setHeaders($headers)
{
$_headers = [];
if (is_array($headers)) {
$_headers = $headers;
} elseif ($headers instanceof Traversable) {
$_headers = iterator_to_array($headers);
} else {
$type = is_object($headers)
? get... | [
"public",
"function",
"setHeaders",
"(",
"$",
"headers",
")",
"{",
"$",
"_headers",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"headers",
")",
")",
"{",
"$",
"_headers",
"=",
"$",
"headers",
";",
"}",
"elseif",
"(",
"$",
"headers",
"insta... | @param mixed $headers
@throws PropertiesException When try to set different from array or other iterable value as headers | [
"@param",
"mixed",
"$headers"
] | train | https://github.com/pinepain/amqpy/blob/fc61dacc37a97a100caf67232a72be32dd7cc896/src/AMQPy/Client/Properties.php#L152-L169 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.insert | public function insert($entity)
{
$values = $this->getInsertValues($entity, $this->namingContention);
$keyString = implode(array_keys($values), ', ');
$questionMarkString = count($values) === 0 ? '' : ('?' . str_repeat(', ?', count($values) - 1));
$sql = "INSERT INTO $this->tableNam... | php | public function insert($entity)
{
$values = $this->getInsertValues($entity, $this->namingContention);
$keyString = implode(array_keys($values), ', ');
$questionMarkString = count($values) === 0 ? '' : ('?' . str_repeat(', ?', count($values) - 1));
$sql = "INSERT INTO $this->tableNam... | [
"public",
"function",
"insert",
"(",
"$",
"entity",
")",
"{",
"$",
"values",
"=",
"$",
"this",
"->",
"getInsertValues",
"(",
"$",
"entity",
",",
"$",
"this",
"->",
"namingContention",
")",
";",
"$",
"keyString",
"=",
"implode",
"(",
"array_keys",
"(",
... | Insert an entity into the database.
You can optionally provide a property name. If you do the inserted id will be assigned to that property.
@param $entity
@return integer the id of the row that was inserted | [
"Insert",
"an",
"entity",
"into",
"the",
"database",
".",
"You",
"can",
"optionally",
"provide",
"a",
"property",
"name",
".",
"If",
"you",
"do",
"the",
"inserted",
"id",
"will",
"be",
"assigned",
"to",
"that",
"property",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L71-L87 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.update | public function update($entity)
{
if ($this->idProperty === null) {
throw new ConfigurationException('No idProperty set');
}
$id = $this->idProperty->getValue($entity);
if ($id === null) {
throw new ConfigurationException('Value of ' . $this->idProperty->get... | php | public function update($entity)
{
if ($this->idProperty === null) {
throw new ConfigurationException('No idProperty set');
}
$id = $this->idProperty->getValue($entity);
if ($id === null) {
throw new ConfigurationException('Value of ' . $this->idProperty->get... | [
"public",
"function",
"update",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"idProperty",
"===",
"null",
")",
"{",
"throw",
"new",
"ConfigurationException",
"(",
"'No idProperty set'",
")",
";",
"}",
"$",
"id",
"=",
"$",
"this",
"->",
"... | Update an existing entity in the database.
@param mixed $entity the entity
@return int the id of the entity
@throws ConfigurationException if no idProperty was set | [
"Update",
"an",
"existing",
"entity",
"in",
"the",
"database",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L95-L117 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.save | public function save($entity)
{
if ($this->idProperty->getValue($entity) === null) {
return $this->insert($entity);
} else {
return $this->update($entity);
}
} | php | public function save($entity)
{
if ($this->idProperty->getValue($entity) === null) {
return $this->insert($entity);
} else {
return $this->update($entity);
}
} | [
"public",
"function",
"save",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"idProperty",
"->",
"getValue",
"(",
"$",
"entity",
")",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"insert",
"(",
"$",
"entity",
")",
";",
"}",
... | Insert an entity into the database if it has no id yet. Otherwise update it by id.
@param mixed $entity the entity
@return int the id of the saved document
@throws ConfigurationException if no idProperty was set | [
"Insert",
"an",
"entity",
"into",
"the",
"database",
"if",
"it",
"has",
"no",
"id",
"yet",
".",
"Otherwise",
"update",
"it",
"by",
"id",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L125-L133 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.get | public function get($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("getBy$idName", array($id));
} | php | public function get($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("getBy$idName", array($id));
} | [
"public",
"function",
"get",
"(",
"$",
"id",
")",
"{",
"$",
"idName",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"idProperty",
"->",
"getName",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"__call",
"(",
"\"getBy$idName\"",
",",
"array",
"(",
"$",
... | Get an entity by it's idProperty value.
@param mixed $id the id value
@return mixed the entity
@throws ErrorException | [
"Get",
"an",
"entity",
"by",
"it",
"s",
"idProperty",
"value",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L141-L145 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.delete | public function delete($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("deleteBy$idName", array($id));
} | php | public function delete($id)
{
$idName = ucfirst($this->idProperty->getName());
return $this->__call("deleteBy$idName", array($id));
} | [
"public",
"function",
"delete",
"(",
"$",
"id",
")",
"{",
"$",
"idName",
"=",
"ucfirst",
"(",
"$",
"this",
"->",
"idProperty",
"->",
"getName",
"(",
")",
")",
";",
"return",
"$",
"this",
"->",
"__call",
"(",
"\"deleteBy$idName\"",
",",
"array",
"(",
... | Delete an entity by it's idProperty value.
@param mixed $id the id value
@return mixed the entity
@throws ErrorException | [
"Delete",
"an",
"entity",
"by",
"it",
"s",
"idProperty",
"value",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L153-L157 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.addMethod | private function addMethod($method)
{
$tokens = $this->methodParser->parse($method);
$query = $this->queryBuilder->build($tokens, $this->tableName, $this->namingContention, $this->entityClass);
if ($query->getResultMode() <= QueryBuilderResult::RESULT_SELECT_MULTIPLE) {
$this->ad... | php | private function addMethod($method)
{
$tokens = $this->methodParser->parse($method);
$query = $this->queryBuilder->build($tokens, $this->tableName, $this->namingContention, $this->entityClass);
if ($query->getResultMode() <= QueryBuilderResult::RESULT_SELECT_MULTIPLE) {
$this->ad... | [
"private",
"function",
"addMethod",
"(",
"$",
"method",
")",
"{",
"$",
"tokens",
"=",
"$",
"this",
"->",
"methodParser",
"->",
"parse",
"(",
"$",
"method",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"queryBuilder",
"->",
"build",
"(",
"$",
"toke... | Parse a dsl method and add it to this repository.
@param $method string the method name
@throws DslSyntaxException | [
"Parse",
"a",
"dsl",
"method",
"and",
"add",
"it",
"to",
"this",
"repository",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L201-L211 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.addSelectionMethod | private function addSelectionMethod(QueryBuilderResult $query, $methodName)
{
$findMethod = function () use ($query, $methodName) {
$sth = $this->pdo->prepare($query->getSql());
/** @noinspection PhpMethodParametersCountMismatchInspection */
$sth->setFetchMode(\PDO::FETC... | php | private function addSelectionMethod(QueryBuilderResult $query, $methodName)
{
$findMethod = function () use ($query, $methodName) {
$sth = $this->pdo->prepare($query->getSql());
/** @noinspection PhpMethodParametersCountMismatchInspection */
$sth->setFetchMode(\PDO::FETC... | [
"private",
"function",
"addSelectionMethod",
"(",
"QueryBuilderResult",
"$",
"query",
",",
"$",
"methodName",
")",
"{",
"$",
"findMethod",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"query",
",",
"$",
"methodName",
")",
"{",
"$",
"sth",
"=",
"$",
"this"... | Add a method that can either result in an entity or an array of entities.
@param $query QueryBuilderResult a parsed query
@param $methodName string the name of the dsl method
@throws DslSyntaxException if an unsupported result mode was requested | [
"Add",
"a",
"method",
"that",
"can",
"either",
"result",
"in",
"an",
"entity",
"or",
"an",
"array",
"of",
"entities",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L219-L244 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.addIntResultMethod | private function addIntResultMethod(QueryBuilderResult $query, $methodName)
{
$intResultMethod = function () use ($query) {
$sth = $this->pdo->prepare($query->getSql());
$sth->execute(func_get_args());
return $sth->rowCount();
};
$this->methods[$methodNam... | php | private function addIntResultMethod(QueryBuilderResult $query, $methodName)
{
$intResultMethod = function () use ($query) {
$sth = $this->pdo->prepare($query->getSql());
$sth->execute(func_get_args());
return $sth->rowCount();
};
$this->methods[$methodNam... | [
"private",
"function",
"addIntResultMethod",
"(",
"QueryBuilderResult",
"$",
"query",
",",
"$",
"methodName",
")",
"{",
"$",
"intResultMethod",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"query",
")",
"{",
"$",
"sth",
"=",
"$",
"this",
"->",
"pdo",
"->"... | Add a new method that will result in an integer.
@param $query QueryBuilderResult a parsed dsl query
@param $methodName string the name of the method | [
"Add",
"a",
"new",
"method",
"that",
"will",
"result",
"in",
"an",
"integer",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L251-L260 |
DataDo/data | src/main/php/DataDo/Data/Repository.php | Repository.checkDatabase | public function checkDatabase($showAllData = true)
{
switch ($this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql':
$sth = $this->pdo->prepare('SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = ?');
$sth->execute(array($this->tableNam... | php | public function checkDatabase($showAllData = true)
{
switch ($this->pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) {
case 'mysql':
$sth = $this->pdo->prepare('SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_NAME = ?');
$sth->execute(array($this->tableNam... | [
"public",
"function",
"checkDatabase",
"(",
"$",
"showAllData",
"=",
"true",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"pdo",
"->",
"getAttribute",
"(",
"PDO",
"::",
"ATTR_DRIVER_NAME",
")",
")",
"{",
"case",
"'mysql'",
":",
"$",
"sth",
"=",
"$",
"th... | This method will run some analysis on the correctness of your configuration. It will be exported to the screen.
@param boolean $showAllData set this to false if you want to hide the entities row | [
"This",
"method",
"will",
"run",
"some",
"analysis",
"on",
"the",
"correctness",
"of",
"your",
"configuration",
".",
"It",
"will",
"be",
"exported",
"to",
"the",
"screen",
"."
] | train | https://github.com/DataDo/data/blob/555b02a27755032fcd53e165b0674e81a68067c0/src/main/php/DataDo/Data/Repository.php#L285-L359 |
neyaoz/laravel-view-control | src/ViewControl/Vendor/Illuminate/View/Engines/ControlEngine.php | ControlEngine.get | public function get($path, array $data = [])
{
$name = $this->getName($path);
if (! $this->getFilesystem()->exists($this->getBladePath($path))) {
throw new InvalidArgumentException("Blade [$name] not found.");
}
$view = $this->getBladeEngine()->get($this->getBladePath($... | php | public function get($path, array $data = [])
{
$name = $this->getName($path);
if (! $this->getFilesystem()->exists($this->getBladePath($path))) {
throw new InvalidArgumentException("Blade [$name] not found.");
}
$view = $this->getBladeEngine()->get($this->getBladePath($... | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getName",
"(",
"$",
"path",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getFilesystem",
"(",
")",
"->",
... | Get the evaluated contents of the view.
@param string $path
@param array $data
@return string | [
"Get",
"the",
"evaluated",
"contents",
"of",
"the",
"view",
"."
] | train | https://github.com/neyaoz/laravel-view-control/blob/2f49777a5cd81223cd36da2ef4385ccd036a4b1e/src/ViewControl/Vendor/Illuminate/View/Engines/ControlEngine.php#L34-L48 |
php-lug/lug | src/Bundle/ResourceBundle/Form/DataTransformer/BooleanTransformer.php | BooleanTransformer.transform | public function transform($value)
{
if ($value === null) {
return;
}
if (!is_bool($value)) {
throw new TransformationFailedException(sprintf(
'The boolean type expects a boolean or null value, got "%s"',
is_object($value) ? get_class($... | php | public function transform($value)
{
if ($value === null) {
return;
}
if (!is_bool($value)) {
throw new TransformationFailedException(sprintf(
'The boolean type expects a boolean or null value, got "%s"',
is_object($value) ? get_class($... | [
"public",
"function",
"transform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"is_bool",
"(",
"$",
"value",
")",
")",
"{",
"throw",
"new",
"TransformationFailedException",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/DataTransformer/BooleanTransformer.php#L25-L39 |
php-lug/lug | src/Bundle/ResourceBundle/Form/DataTransformer/BooleanTransformer.php | BooleanTransformer.reverseTransform | public function reverseTransform($value)
{
if ($value === null || $value === '') {
return false;
}
if (!is_scalar($value)
|| ($value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) === null) {
throw new TransformationFailedException... | php | public function reverseTransform($value)
{
if ($value === null || $value === '') {
return false;
}
if (!is_scalar($value)
|| ($value = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)) === null) {
throw new TransformationFailedException... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"===",
"''",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"is_scalar",
"(",
"$",
"value",
")",
"||",
"(",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Bundle/ResourceBundle/Form/DataTransformer/BooleanTransformer.php#L44-L56 |
InactiveProjects/limoncello-illuminate | app/Database/Factories/Factory.php | Factory.getRandomUser | protected function getRandomUser()
{
if ($this->users === null) {
$this->users = User::all();
}
return $this->users->random();
} | php | protected function getRandomUser()
{
if ($this->users === null) {
$this->users = User::all();
}
return $this->users->random();
} | [
"protected",
"function",
"getRandomUser",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"users",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"users",
"=",
"User",
"::",
"all",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"users",
"->",
"random",... | @return User
@SuppressWarnings(PHPMD.StaticAccess) | [
"@return",
"User"
] | train | https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Database/Factories/Factory.php#L27-L34 |
expectation-php/expect | src/matcher/ToMatch.php | ToMatch.match | public function match($actual)
{
$this->actual = $actual;
$patternMatcher = new PatternMatcher($this->expected);
return $patternMatcher->match($this->actual);
} | php | public function match($actual)
{
$this->actual = $actual;
$patternMatcher = new PatternMatcher($this->expected);
return $patternMatcher->match($this->actual);
} | [
"public",
"function",
"match",
"(",
"$",
"actual",
")",
"{",
"$",
"this",
"->",
"actual",
"=",
"$",
"actual",
";",
"$",
"patternMatcher",
"=",
"new",
"PatternMatcher",
"(",
"$",
"this",
"->",
"expected",
")",
";",
"return",
"$",
"patternMatcher",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToMatch.php#L51-L57 |
f3ath/lazypdo | src/LazyPDO.php | LazyPDO.getPDO | protected function getPDO()
{
if (null === $this->pdo) {
$this->pdo = new \PDO($this->dsn, $this->user, $this->password, $this->options);
}
return $this->pdo;
} | php | protected function getPDO()
{
if (null === $this->pdo) {
$this->pdo = new \PDO($this->dsn, $this->user, $this->password, $this->options);
}
return $this->pdo;
} | [
"protected",
"function",
"getPDO",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"pdo",
")",
"{",
"$",
"this",
"->",
"pdo",
"=",
"new",
"\\",
"PDO",
"(",
"$",
"this",
"->",
"dsn",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
... | Get PDO object. Cache the result
@return \PDO | [
"Get",
"PDO",
"object",
".",
"Cache",
"the",
"result"
] | train | https://github.com/f3ath/lazypdo/blob/0ebdb3bc87d327d68a322d5fca049f4c21865928/src/LazyPDO.php#L43-L49 |
f3ath/lazypdo | src/LazyPDO.php | LazyPDO.serialize | public function serialize()
{
if ($this->inTransaction()) {
throw new \RuntimeException('Can not serialize in transaction');
}
return serialize(array(
$this->dsn,
$this->user,
$this->password,
$this->options,
));
} | php | public function serialize()
{
if ($this->inTransaction()) {
throw new \RuntimeException('Can not serialize in transaction');
}
return serialize(array(
$this->dsn,
$this->user,
$this->password,
$this->options,
));
} | [
"public",
"function",
"serialize",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"inTransaction",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'Can not serialize in transaction'",
")",
";",
"}",
"return",
"serialize",
"(",
"array",
"(",... | serialize
@return string | [
"serialize"
] | train | https://github.com/f3ath/lazypdo/blob/0ebdb3bc87d327d68a322d5fca049f4c21865928/src/LazyPDO.php#L67-L78 |
f3ath/lazypdo | src/LazyPDO.php | LazyPDO.unserialize | public function unserialize($serialized)
{
list($this->dsn, $this->user, $this->password, $this->options) = unserialize($serialized);
} | php | public function unserialize($serialized)
{
list($this->dsn, $this->user, $this->password, $this->options) = unserialize($serialized);
} | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"dsn",
",",
"$",
"this",
"->",
"user",
",",
"$",
"this",
"->",
"password",
",",
"$",
"this",
"->",
"options",
")",
"=",
"unserialize",
"(",
"$",
... | unserialize
@param string $serialized
@return void | [
"unserialize"
] | train | https://github.com/f3ath/lazypdo/blob/0ebdb3bc87d327d68a322d5fca049f4c21865928/src/LazyPDO.php#L86-L89 |
f3ath/lazypdo | src/LazyPDO.php | LazyPDO.setAttribute | public function setAttribute($attribute, $value)
{
if (parent::setAttribute($attribute, $value)) {
$this->options[$attribute] = $value;
return true;
}
return false;
} | php | public function setAttribute($attribute, $value)
{
if (parent::setAttribute($attribute, $value)) {
$this->options[$attribute] = $value;
return true;
}
return false;
} | [
"public",
"function",
"setAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"if",
"(",
"parent",
"::",
"setAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"$",
"attribute",
"]",
"=... | setAttribute
@param int $attribute
@param mixed $value
@return boolean | [
"setAttribute"
] | train | https://github.com/f3ath/lazypdo/blob/0ebdb3bc87d327d68a322d5fca049f4c21865928/src/LazyPDO.php#L98-L105 |
VincentChalnot/SidusDataGridBundle | Renderer/DefaultColumnLabelRenderer.php | DefaultColumnLabelRenderer.renderColumnLabel | public function renderColumnLabel(Column $column): string
{
$label = $column->getLabel();
if (!$label) {
$key = "datagrid.{$column->getDataGrid()->getCode()}.{$column->getCode()}";
if ($this->translator instanceof TranslatorBagInterface
&& $this->translator->g... | php | public function renderColumnLabel(Column $column): string
{
$label = $column->getLabel();
if (!$label) {
$key = "datagrid.{$column->getDataGrid()->getCode()}.{$column->getCode()}";
if ($this->translator instanceof TranslatorBagInterface
&& $this->translator->g... | [
"public",
"function",
"renderColumnLabel",
"(",
"Column",
"$",
"column",
")",
":",
"string",
"{",
"$",
"label",
"=",
"$",
"column",
"->",
"getLabel",
"(",
")",
";",
"if",
"(",
"!",
"$",
"label",
")",
"{",
"$",
"key",
"=",
"\"datagrid.{$column->getDataGri... | @param Column $column
@return string | [
"@param",
"Column",
"$column"
] | train | https://github.com/VincentChalnot/SidusDataGridBundle/blob/aa929113e2208ed335f514d2891affaf7fddf3f6/Renderer/DefaultColumnLabelRenderer.php#L40-L58 |
technote-space/wordpress-plugin-base | src/classes/controllers/admin/setting.php | Setting.post_action | protected function post_action() {
foreach ( $this->app->setting->get_groups() as $group ) {
foreach ( $this->app->setting->get_settings( $group ) as $setting ) {
$this->app->option->set_post_value( $this->app->utility->array_get( $this->app->setting->get_setting( $setting, true ), 'name', '' ) );
}
}
$... | php | protected function post_action() {
foreach ( $this->app->setting->get_groups() as $group ) {
foreach ( $this->app->setting->get_settings( $group ) as $setting ) {
$this->app->option->set_post_value( $this->app->utility->array_get( $this->app->setting->get_setting( $setting, true ), 'name', '' ) );
}
}
$... | [
"protected",
"function",
"post_action",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"app",
"->",
"setting",
"->",
"get_groups",
"(",
")",
"as",
"$",
"group",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"app",
"->",
"setting",
"->",
"get_settings... | post action | [
"post",
"action"
] | train | https://github.com/technote-space/wordpress-plugin-base/blob/02cfcba358432a2539af07a69d9db00ff7c14eac/src/classes/controllers/admin/setting.php#L46-L53 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/headers_holder.php | ezcMailHeadersHolder.offsetGet | public function offsetGet( $key )
{
$key = strtolower( $key );
if ( !array_key_exists( $key, $this->lookup ) )
{
return null;
}
return $this->map[$this->lookup[$key]];
} | php | public function offsetGet( $key )
{
$key = strtolower( $key );
if ( !array_key_exists( $key, $this->lookup ) )
{
return null;
}
return $this->map[$this->lookup[$key]];
} | [
"public",
"function",
"offsetGet",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"strtolower",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"lookup",
")",
")",
"{",
"return",
"null",
";",
"... | Returns the value recognized with $key.
@param string $key
@return mixed | [
"Returns",
"the",
"value",
"recognized",
"with",
"$key",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/headers_holder.php#L71-L79 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/headers_holder.php | ezcMailHeadersHolder.offsetSet | public function offsetSet( $key, $value )
{
$lowerKey = strtolower( $key );
if ( !array_key_exists( $lowerKey, $this->lookup ) )
{
$this->map[$key] = $value;
$this->lookup[$lowerKey] = $key;
}
else // use old case
{
$this->map[$this... | php | public function offsetSet( $key, $value )
{
$lowerKey = strtolower( $key );
if ( !array_key_exists( $lowerKey, $this->lookup ) )
{
$this->map[$key] = $value;
$this->lookup[$lowerKey] = $key;
}
else // use old case
{
$this->map[$this... | [
"public",
"function",
"offsetSet",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"lowerKey",
"=",
"strtolower",
"(",
"$",
"key",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"lowerKey",
",",
"$",
"this",
"->",
"lookup",
")",
")",
"{... | Sets the offset $key to the value $value.
If it is a new entry the case in $key will be stored. If the $key exists already
using a case insensitive lookup the new spelling will be discarded.
@param string $key
@param mixed $value | [
"Sets",
"the",
"offset",
"$key",
"to",
"the",
"value",
"$value",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/headers_holder.php#L90-L102 |
Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/headers_holder.php | ezcMailHeadersHolder.offsetUnset | public function offsetUnset( $key )
{
$key = strtolower( $key );
if ( array_key_exists( $key, $this->lookup ) )
{
unset( $this->map[$this->lookup[$key]] );
unset( $this->lookup[$key] );
}
} | php | public function offsetUnset( $key )
{
$key = strtolower( $key );
if ( array_key_exists( $key, $this->lookup ) )
{
unset( $this->map[$this->lookup[$key]] );
unset( $this->lookup[$key] );
}
} | [
"public",
"function",
"offsetUnset",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"strtolower",
"(",
"$",
"key",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"lookup",
")",
")",
"{",
"unset",
"(",
"$",
"this",
... | Unsets the key $key.
@param string $key | [
"Unsets",
"the",
"key",
"$key",
"."
] | train | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/headers_holder.php#L109-L117 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.register | public function register(Application $app)
{
$app['parser.example.finder'] = new Example\Finder();
$this->addCache($app);
$this->addAssemblers($app);
$this->addFilters($app);
$this->addValidators($app);
$this->addBuilder($app);
// I would prefer to extend it... | php | public function register(Application $app)
{
$app['parser.example.finder'] = new Example\Finder();
$this->addCache($app);
$this->addAssemblers($app);
$this->addFilters($app);
$this->addValidators($app);
$this->addBuilder($app);
// I would prefer to extend it... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'parser.example.finder'",
"]",
"=",
"new",
"Example",
"\\",
"Finder",
"(",
")",
";",
"$",
"this",
"->",
"addCache",
"(",
"$",
"app",
")",
";",
"$",
"this",
... | Adds the services needed to build the descriptors.
@param Application $app An Application instance
@return void | [
"Adds",
"the",
"services",
"needed",
"to",
"build",
"the",
"descriptors",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L89-L105 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.attachAssemblersToFactory | public function attachAssemblersToFactory(AssemblerFactory $factory, Application $app)
{
// @codingStandardsIgnoreStart because we limit the verbosity by making all closures single-line
$fileMatcher = function ($criteria) { return $criteria instanceof FileReflector; };
$constantMatcher ... | php | public function attachAssemblersToFactory(AssemblerFactory $factory, Application $app)
{
// @codingStandardsIgnoreStart because we limit the verbosity by making all closures single-line
$fileMatcher = function ($criteria) { return $criteria instanceof FileReflector; };
$constantMatcher ... | [
"public",
"function",
"attachAssemblersToFactory",
"(",
"AssemblerFactory",
"$",
"factory",
",",
"Application",
"$",
"app",
")",
"{",
"// @codingStandardsIgnoreStart because we limit the verbosity by making all closures single-line",
"$",
"fileMatcher",
"=",
"function",
"(",
"$... | Registers the Assemblers used to convert Reflection objects to Descriptors.
@param AssemblerFactory $factory
@param \Cilex\Application $app
@return AssemblerFactory | [
"Registers",
"the",
"Assemblers",
"used",
"to",
"convert",
"Reflection",
"objects",
"to",
"Descriptors",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L115-L181 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.attachFiltersToManager | public function attachFiltersToManager(Filter $filterManager, Application $app)
{
$stripOnVisibility = new StripOnVisibility($app['descriptor.builder']);
$filtersOnAllDescriptors = array(
new StripInternal($app['descriptor.builder']),
new StripIgnore($app['descriptor.builder'... | php | public function attachFiltersToManager(Filter $filterManager, Application $app)
{
$stripOnVisibility = new StripOnVisibility($app['descriptor.builder']);
$filtersOnAllDescriptors = array(
new StripInternal($app['descriptor.builder']),
new StripIgnore($app['descriptor.builder'... | [
"public",
"function",
"attachFiltersToManager",
"(",
"Filter",
"$",
"filterManager",
",",
"Application",
"$",
"app",
")",
"{",
"$",
"stripOnVisibility",
"=",
"new",
"StripOnVisibility",
"(",
"$",
"app",
"[",
"'descriptor.builder'",
"]",
")",
";",
"$",
"filtersOn... | Attaches filters to the manager.
@param Filter $filterManager
@param Application $app
@return Filter | [
"Attaches",
"filters",
"to",
"the",
"manager",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L191-L212 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.attachValidators | public function attachValidators(Validator $validator)
{
/** @var ClassMetadata $fileMetadata */
$fileMetadata = $validator->getMetadataFor('phpDocumentor\Descriptor\FileDescriptor');
/** @var ClassMetadata $constantMetadata */
$constantMetadata = $validator->getMetadataFor('phpDoc... | php | public function attachValidators(Validator $validator)
{
/** @var ClassMetadata $fileMetadata */
$fileMetadata = $validator->getMetadataFor('phpDocumentor\Descriptor\FileDescriptor');
/** @var ClassMetadata $constantMetadata */
$constantMetadata = $validator->getMetadataFor('phpDoc... | [
"public",
"function",
"attachValidators",
"(",
"Validator",
"$",
"validator",
")",
"{",
"/** @var ClassMetadata $fileMetadata */",
"$",
"fileMetadata",
"=",
"$",
"validator",
"->",
"getMetadataFor",
"(",
"'phpDocumentor\\Descriptor\\FileDescriptor'",
")",
";",
"/** @var Cla... | Adds validators to check the Descriptors.
@param Validator $validator
@return Validator | [
"Adds",
"validators",
"to",
"check",
"the",
"Descriptors",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L221-L272 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addCache | protected function addCache(Application $app)
{
$app['descriptor.cache'] = $app->share(
function () {
$cache = new Filesystem();
$cache->setOptions(
array(
'namespace' => 'phpdoc-cache',
'cache_... | php | protected function addCache(Application $app)
{
$app['descriptor.cache'] = $app->share(
function () {
$cache = new Filesystem();
$cache->setOptions(
array(
'namespace' => 'phpdoc-cache',
'cache_... | [
"protected",
"function",
"addCache",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'descriptor.cache'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
")",
"{",
"$",
"cache",
"=",
"new",
"Filesystem",
"(",
")",
";",
"$",
"ca... | Adds the caching mechanism to the dependency injection container with key 'descriptor.cache'.
@param Application $app
@return void | [
"Adds",
"the",
"caching",
"mechanism",
"to",
"the",
"dependency",
"injection",
"container",
"with",
"key",
"descriptor",
".",
"cache",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L281-L306 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addBuilder | protected function addBuilder(Application $app)
{
if (extension_loaded('igbinary')) {
$app['descriptor.builder.serializer'] = 'IgBinary';
} else {
$app['descriptor.builder.serializer'] = 'PhpSerialize';
}
$app['descriptor.builder'] = $app->share(
... | php | protected function addBuilder(Application $app)
{
if (extension_loaded('igbinary')) {
$app['descriptor.builder.serializer'] = 'IgBinary';
} else {
$app['descriptor.builder.serializer'] = 'PhpSerialize';
}
$app['descriptor.builder'] = $app->share(
... | [
"protected",
"function",
"addBuilder",
"(",
"Application",
"$",
"app",
")",
"{",
"if",
"(",
"extension_loaded",
"(",
"'igbinary'",
")",
")",
"{",
"$",
"app",
"[",
"'descriptor.builder.serializer'",
"]",
"=",
"'IgBinary'",
";",
"}",
"else",
"{",
"$",
"app",
... | Adds the Building mechanism using the key 'descriptor.builder'.
Please note that the type of serializer can be configured using the parameter 'descriptor.builder.serializer'; it
accepts any parameter that Zend\Serializer supports.
@param Application $app
@return void | [
"Adds",
"the",
"Building",
"mechanism",
"using",
"the",
"key",
"descriptor",
".",
"builder",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L318-L338 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addAssemblers | protected function addAssemblers(Application $app)
{
$app['descriptor.builder.assembler.factory'] = $app->share(
function () {
return new AssemblerFactory();
}
);
$provider = $this;
$app['descriptor.builder.assembler.factory'] = $app->share(
... | php | protected function addAssemblers(Application $app)
{
$app['descriptor.builder.assembler.factory'] = $app->share(
function () {
return new AssemblerFactory();
}
);
$provider = $this;
$app['descriptor.builder.assembler.factory'] = $app->share(
... | [
"protected",
"function",
"addAssemblers",
"(",
"Application",
"$",
"app",
")",
"{",
"$",
"app",
"[",
"'descriptor.builder.assembler.factory'",
"]",
"=",
"$",
"app",
"->",
"share",
"(",
"function",
"(",
")",
"{",
"return",
"new",
"AssemblerFactory",
"(",
")",
... | Adds the assembler factory and attaches the basic assemblers with key 'descriptor.builder.assembler.factory'.
@param Application $app
@return void | [
"Adds",
"the",
"assembler",
"factory",
"and",
"attaches",
"the",
"basic",
"assemblers",
"with",
"key",
"descriptor",
".",
"builder",
".",
"assembler",
".",
"factory",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L347-L364 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/ServiceProvider.php | ServiceProvider.addValidators | protected function addValidators(Application $app)
{
if (!isset($app['validator'])) {
throw new Exception\MissingDependencyException('The validator manager is missing');
}
$provider = $this;
$app['validator'] = $app->share(
$app->extend(
'vali... | php | protected function addValidators(Application $app)
{
if (!isset($app['validator'])) {
throw new Exception\MissingDependencyException('The validator manager is missing');
}
$provider = $this;
$app['validator'] = $app->share(
$app->extend(
'vali... | [
"protected",
"function",
"addValidators",
"(",
"Application",
"$",
"app",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"app",
"[",
"'validator'",
"]",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"MissingDependencyException",
"(",
"'The validator manager ... | Adds validators for the descriptors to the validator manager.
@param Application $app
@throws Exception\MissingDependencyException if the validator could not be found.
@return void | [
"Adds",
"validators",
"for",
"the",
"descriptors",
"to",
"the",
"validator",
"manager",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/ServiceProvider.php#L394-L409 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.add | public function add(
$id,
$parentId,
$blockType,
array $options = [],
$siblingId = null,
$prepend = null
) {
$this->addAdditionalBlockPrefixOption($id, $options);
$this
->replaceRoot($parentId)
->replaceRoot($siblingId);
... | php | public function add(
$id,
$parentId,
$blockType,
array $options = [],
$siblingId = null,
$prepend = null
) {
$this->addAdditionalBlockPrefixOption($id, $options);
$this
->replaceRoot($parentId)
->replaceRoot($siblingId);
... | [
"public",
"function",
"add",
"(",
"$",
"id",
",",
"$",
"parentId",
",",
"$",
"blockType",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"$",
"siblingId",
"=",
"null",
",",
"$",
"prepend",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"addAdditional... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L42-L64 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.remove | public function remove($id)
{
$this->replaceRoot($id);
$this->replaceNamespace($id);
$this->layoutManipulator->remove($id);
return $this;
} | php | public function remove($id)
{
$this->replaceRoot($id);
$this->replaceNamespace($id);
$this->layoutManipulator->remove($id);
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"replaceRoot",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"layoutManipulator",
"->",
"remove",
"(",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L69-L77 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.move | public function move($id, $parentId = null, $siblingId = null, $prepend = null)
{
$this
->replaceRoot($id)
->replaceRoot($parentId)
->replaceRoot($siblingId);
$this
->replaceNamespace($id)
->replaceNamespace($parentId)
->replace... | php | public function move($id, $parentId = null, $siblingId = null, $prepend = null)
{
$this
->replaceRoot($id)
->replaceRoot($parentId)
->replaceRoot($siblingId);
$this
->replaceNamespace($id)
->replaceNamespace($parentId)
->replace... | [
"public",
"function",
"move",
"(",
"$",
"id",
",",
"$",
"parentId",
"=",
"null",
",",
"$",
"siblingId",
"=",
"null",
",",
"$",
"prepend",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"replaceRoot",
"(",
"$",
"id",
")",
"->",
"replaceRoot",
"(",
"$",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L82-L96 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.addAlias | public function addAlias($alias, $id)
{
$this->replaceRoot($id);
$this
->replaceNamespace($alias)
->replaceNamespace($id);
$this->layoutManipulator->addAlias($alias, $id);
return $this;
} | php | public function addAlias($alias, $id)
{
$this->replaceRoot($id);
$this
->replaceNamespace($alias)
->replaceNamespace($id);
$this->layoutManipulator->addAlias($alias, $id);
return $this;
} | [
"public",
"function",
"addAlias",
"(",
"$",
"alias",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"replaceRoot",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"alias",
")",
"->",
"replaceNamespace",
"(",
"$",
"id",
")",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L101-L111 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.removeAlias | public function removeAlias($alias)
{
$this->replaceNamespace($alias);
$this->layoutManipulator->removeAlias($alias);
return $this;
} | php | public function removeAlias($alias)
{
$this->replaceNamespace($alias);
$this->layoutManipulator->removeAlias($alias);
return $this;
} | [
"public",
"function",
"removeAlias",
"(",
"$",
"alias",
")",
"{",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"alias",
")",
";",
"$",
"this",
"->",
"layoutManipulator",
"->",
"removeAlias",
"(",
"$",
"alias",
")",
";",
"return",
"$",
"this",
";",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L116-L123 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.setOption | public function setOption($id, $optionName, $optionValue)
{
$this->replaceRoot($id);
$this->replaceNamespace($id);
$this->layoutManipulator->setOption($id, $optionName, $optionValue);
return $this;
} | php | public function setOption($id, $optionName, $optionValue)
{
$this->replaceRoot($id);
$this->replaceNamespace($id);
$this->layoutManipulator->setOption($id, $optionName, $optionValue);
return $this;
} | [
"public",
"function",
"setOption",
"(",
"$",
"id",
",",
"$",
"optionName",
",",
"$",
"optionValue",
")",
"{",
"$",
"this",
"->",
"replaceRoot",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"id",
")",
";",
"$",
"this",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L128-L136 |
oroinc/OroLayoutComponent | ImportLayoutManipulator.php | ImportLayoutManipulator.appendOption | public function appendOption($id, $optionName, $optionValue)
{
$this->replaceRoot($id);
$this->replaceNamespace($id);
$this->layoutManipulator->appendOption($id, $optionName, $optionValue);
return $this;
} | php | public function appendOption($id, $optionName, $optionValue)
{
$this->replaceRoot($id);
$this->replaceNamespace($id);
$this->layoutManipulator->appendOption($id, $optionName, $optionValue);
return $this;
} | [
"public",
"function",
"appendOption",
"(",
"$",
"id",
",",
"$",
"optionName",
",",
"$",
"optionValue",
")",
"{",
"$",
"this",
"->",
"replaceRoot",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"replaceNamespace",
"(",
"$",
"id",
")",
";",
"$",
"this",... | {@inheritDoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/ImportLayoutManipulator.php#L141-L149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.