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 |
|---|---|---|---|---|---|---|---|---|---|---|
mvdbos/vdb-uri | src/VDB/Uri/Uri.php | Uri.equals | public function equals(UriInterface $that, $normalized = false)
{
$thisClone = $this;
$thatClone = $that;
if (false !== $normalized) {
$thisClone = clone $this;
$thatClone = clone $that;
$thisClone->normalize();
$thatClone->normalize();
... | php | public function equals(UriInterface $that, $normalized = false)
{
$thisClone = $this;
$thatClone = $that;
if (false !== $normalized) {
$thisClone = clone $this;
$thatClone = clone $that;
$thisClone->normalize();
$thatClone->normalize();
... | [
"public",
"function",
"equals",
"(",
"UriInterface",
"$",
"that",
",",
"$",
"normalized",
"=",
"false",
")",
"{",
"$",
"thisClone",
"=",
"$",
"this",
";",
"$",
"thatClone",
"=",
"$",
"that",
";",
"if",
"(",
"false",
"!==",
"$",
"normalized",
")",
"{"... | Test two URIs for equality. Will return true if and only if all Uri components are identical.
Note: will use the normalized versions of the Uri's to compare
@param UriInterface $that
@param bool $normalized whether the comparison will be done on normalized versions of the URIs.
This does not alter the arguments.
@retu... | [
"Test",
"two",
"URIs",
"for",
"equality",
".",
"Will",
"return",
"true",
"if",
"and",
"only",
"if",
"all",
"Uri",
"components",
"are",
"identical",
".",
"Note",
":",
"will",
"use",
"the",
"normalized",
"versions",
"of",
"the",
"Uri",
"s",
"to",
"compare"... | train | https://github.com/mvdbos/vdb-uri/blob/48264d5cd3a61b5166bf62468381cd58405b63ca/src/VDB/Uri/Uri.php#L180-L225 |
mvdbos/vdb-uri | src/VDB/Uri/Uri.php | Uri.normalize | public function normalize()
{
$this->normalizeSchemeCase();
$this->normalizeUsernamePercentageEncoding();
$this->normalizePasswordPercentageEncoding();
$this->normalizeHostCase();
$this->normalizePort();
$this->normalizePathPercentageEncoding();
$this->normali... | php | public function normalize()
{
$this->normalizeSchemeCase();
$this->normalizeUsernamePercentageEncoding();
$this->normalizePasswordPercentageEncoding();
$this->normalizeHostCase();
$this->normalizePort();
$this->normalizePathPercentageEncoding();
$this->normali... | [
"public",
"function",
"normalize",
"(",
")",
"{",
"$",
"this",
"->",
"normalizeSchemeCase",
"(",
")",
";",
"$",
"this",
"->",
"normalizeUsernamePercentageEncoding",
"(",
")",
";",
"$",
"this",
"->",
"normalizePasswordPercentageEncoding",
"(",
")",
";",
"$",
"t... | Normalization includes the following:
- dot segements in the path component,
- the port if it matches the default port for the scheme,
- percent encoding and character case where applicable to components, according to RFC 3986.
@return $this|UriInterface | [
"Normalization",
"includes",
"the",
"following",
":",
"-",
"dot",
"segements",
"in",
"the",
"path",
"component",
"-",
"the",
"port",
"if",
"it",
"matches",
"the",
"default",
"port",
"for",
"the",
"scheme",
"-",
"percent",
"encoding",
"and",
"character",
"cas... | train | https://github.com/mvdbos/vdb-uri/blob/48264d5cd3a61b5166bf62468381cd58405b63ca/src/VDB/Uri/Uri.php#L309-L322 |
mvdbos/vdb-uri | src/VDB/Uri/Uri.php | Uri.resolveRelativeReference | private function resolveRelativeReference()
{
if (null !== $this->scheme) {
$this->normalizeDotSegments();
} else {
$this->scheme = $this->baseUri->scheme;
if (null !== $this->authority) {
$this->normalizeDotSegments();
} else {
... | php | private function resolveRelativeReference()
{
if (null !== $this->scheme) {
$this->normalizeDotSegments();
} else {
$this->scheme = $this->baseUri->scheme;
if (null !== $this->authority) {
$this->normalizeDotSegments();
} else {
... | [
"private",
"function",
"resolveRelativeReference",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"scheme",
")",
"{",
"$",
"this",
"->",
"normalizeDotSegments",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"scheme",
"=",
"$",
"this"... | From RFC 3986 paragraph 4.2
relative-ref = relative-part [ "?" query ] [ "#" fragment ]
relative-part = "//" authority path-abempty
/ path-absolute
/ path-noscheme
/ path-empty
then:
From RFC 3986 paragraph 5.2.2
For each Uri reference (R), the following pseudocode describes an
algorithm for transforming R into it... | [
"From",
"RFC",
"3986",
"paragraph",
"4",
".",
"2"
] | train | https://github.com/mvdbos/vdb-uri/blob/48264d5cd3a61b5166bf62468381cd58405b63ca/src/VDB/Uri/Uri.php#L538-L564 |
mvdbos/vdb-uri | src/VDB/Uri/Uri.php | Uri.normalizeDotSegments | private function normalizeDotSegments()
{
$input = explode('/', $this->path);
$output = array();
while (!empty($input)) {
if ('..' === $input[0]) {
if (1 === count($input)) {
array_shift($input);
if ('' !== end($output)) {
... | php | private function normalizeDotSegments()
{
$input = explode('/', $this->path);
$output = array();
while (!empty($input)) {
if ('..' === $input[0]) {
if (1 === count($input)) {
array_shift($input);
if ('' !== end($output)) {
... | [
"private",
"function",
"normalizeDotSegments",
"(",
")",
"{",
"$",
"input",
"=",
"explode",
"(",
"'/'",
",",
"$",
"this",
"->",
"path",
")",
";",
"$",
"output",
"=",
"array",
"(",
")",
";",
"while",
"(",
"!",
"empty",
"(",
"$",
"input",
")",
")",
... | From RFC 3986 paragraph 5.2.4
1. The input buffer is initialized with the now-appended path
components and the output buffer is initialized to the empty
string.
2. While the input buffer is not empty, loop as follows:
A. If the input buffer begins with a prefix of "../" or "./",
then remove that prefix from the i... | [
"From",
"RFC",
"3986",
"paragraph",
"5",
".",
"2",
".",
"4"
] | train | https://github.com/mvdbos/vdb-uri/blob/48264d5cd3a61b5166bf62468381cd58405b63ca/src/VDB/Uri/Uri.php#L600-L631 |
mvdbos/vdb-uri | src/VDB/Uri/Uri.php | Uri.mergeBasePath | private function mergeBasePath()
{
if (null !== $this->baseUri->authority && '' === $this->baseUri->path) {
$this->path = '/' . $this->path;
} else {
if (false !== $lastSlashPos = strrpos($this->baseUri->path, '/')) {
$basePath = substr($this->baseUri->path, 0... | php | private function mergeBasePath()
{
if (null !== $this->baseUri->authority && '' === $this->baseUri->path) {
$this->path = '/' . $this->path;
} else {
if (false !== $lastSlashPos = strrpos($this->baseUri->path, '/')) {
$basePath = substr($this->baseUri->path, 0... | [
"private",
"function",
"mergeBasePath",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"baseUri",
"->",
"authority",
"&&",
"''",
"===",
"$",
"this",
"->",
"baseUri",
"->",
"path",
")",
"{",
"$",
"this",
"->",
"path",
"=",
"'/'",
".",
"... | From RFC 3986 paragraph 5.2.3 | [
"From",
"RFC",
"3986",
"paragraph",
"5",
".",
"2",
".",
"3"
] | train | https://github.com/mvdbos/vdb-uri/blob/48264d5cd3a61b5166bf62468381cd58405b63ca/src/VDB/Uri/Uri.php#L636-L646 |
mvdbos/vdb-uri | src/VDB/Uri/Uri.php | Uri.parseUriReference | private function parseUriReference()
{
$this->parseScheme();
$this->parseAuthority();
$this->parsePath();
$this->parseQuery();
$this->parseFragment();
$this->doSchemeSpecificPostProcessing();
if (strlen($this->remaining)) {
throw new ErrorExcepti... | php | private function parseUriReference()
{
$this->parseScheme();
$this->parseAuthority();
$this->parsePath();
$this->parseQuery();
$this->parseFragment();
$this->doSchemeSpecificPostProcessing();
if (strlen($this->remaining)) {
throw new ErrorExcepti... | [
"private",
"function",
"parseUriReference",
"(",
")",
"{",
"$",
"this",
"->",
"parseScheme",
"(",
")",
";",
"$",
"this",
"->",
"parseAuthority",
"(",
")",
";",
"$",
"this",
"->",
"parsePath",
"(",
")",
";",
"$",
"this",
"->",
"parseQuery",
"(",
")",
... | From RFC 3986 paragraph 4.1
Uri-reference = Uri / relative-ref | [
"From",
"RFC",
"3986",
"paragraph",
"4",
".",
"1"
] | train | https://github.com/mvdbos/vdb-uri/blob/48264d5cd3a61b5166bf62468381cd58405b63ca/src/VDB/Uri/Uri.php#L725-L738 |
digitalkaoz/versioneye-php | src/Output/BaseOutput.php | BaseOutput.printTable | protected function printTable(OutputInterface $output, array $headings, array $keys, $data, \Closure $callback = null)
{
$table = $this->createTable($output);
$table->setHeaders(array_map('trim', $headings));
foreach ($data as $row) {
$rowData = array_merge(array_flip($keys), a... | php | protected function printTable(OutputInterface $output, array $headings, array $keys, $data, \Closure $callback = null)
{
$table = $this->createTable($output);
$table->setHeaders(array_map('trim', $headings));
foreach ($data as $row) {
$rowData = array_merge(array_flip($keys), a... | [
"protected",
"function",
"printTable",
"(",
"OutputInterface",
"$",
"output",
",",
"array",
"$",
"headings",
",",
"array",
"$",
"keys",
",",
"$",
"data",
",",
"\\",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->"... | prints a table, values can be modified via $callback.
@param OutputInterface $output
@param string[] $headings
@param string[] $keys
@param array|Pager $data
@param \Closure $callback | [
"prints",
"a",
"table",
"values",
"can",
"be",
"modified",
"via",
"$callback",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/BaseOutput.php#L26-L41 |
digitalkaoz/versioneye-php | src/Output/BaseOutput.php | BaseOutput.printBoolean | protected function printBoolean(OutputInterface $output, $success, $fail, $value, $line = true)
{
if ($value) {
$message = '<info>' . $success . '</info>';
} else {
$message = '<error>' . $fail . '</error>';
}
if (false === $line) {
return $messag... | php | protected function printBoolean(OutputInterface $output, $success, $fail, $value, $line = true)
{
if ($value) {
$message = '<info>' . $success . '</info>';
} else {
$message = '<error>' . $fail . '</error>';
}
if (false === $line) {
return $messag... | [
"protected",
"function",
"printBoolean",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"success",
",",
"$",
"fail",
",",
"$",
"value",
",",
"$",
"line",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"message",
"=",
"'<info>'",
"."... | prints a simple boolean.
@param OutputInterface $output
@param string $success
@param string $fail
@param bool $value
@param bool $line
@return string | [
"prints",
"a",
"simple",
"boolean",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/BaseOutput.php#L54-L67 |
digitalkaoz/versioneye-php | src/Output/BaseOutput.php | BaseOutput.printList | protected function printList(OutputInterface $output, array $headings, array $keys, array $data, \Closure $callback = null)
{
$width = $this->getColumnWidth($headings);
$data = array_merge(array_flip($keys), array_intersect_key($data, array_flip($keys)));
foreach ($headings as $key => $hea... | php | protected function printList(OutputInterface $output, array $headings, array $keys, array $data, \Closure $callback = null)
{
$width = $this->getColumnWidth($headings);
$data = array_merge(array_flip($keys), array_intersect_key($data, array_flip($keys)));
foreach ($headings as $key => $hea... | [
"protected",
"function",
"printList",
"(",
"OutputInterface",
"$",
"output",
",",
"array",
"$",
"headings",
",",
"array",
"$",
"keys",
",",
"array",
"$",
"data",
",",
"\\",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"width",
"=",
"$",
"thi... | prints a list combined as <comment>Heading</comment> : <info>Value</info>, values can be modified via $callback.
@param OutputInterface $output
@param string[] $headings
@param string[] $keys
@param array $data
@param \Closure $callback | [
"prints",
"a",
"list",
"combined",
"as",
"<comment",
">",
"Heading<",
"/",
"comment",
">",
":",
"<info",
">",
"Value<",
"/",
"info",
">",
"values",
"can",
"be",
"modified",
"via",
"$callback",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/BaseOutput.php#L78-L92 |
digitalkaoz/versioneye-php | src/Output/BaseOutput.php | BaseOutput.printMessage | protected function printMessage(OutputInterface $output, array $response)
{
$this->printBoolean($output, $response['message'], $response['message'], true === $response['success']);
} | php | protected function printMessage(OutputInterface $output, array $response)
{
$this->printBoolean($output, $response['message'], $response['message'], true === $response['success']);
} | [
"protected",
"function",
"printMessage",
"(",
"OutputInterface",
"$",
"output",
",",
"array",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"printBoolean",
"(",
"$",
"output",
",",
"$",
"response",
"[",
"'message'",
"]",
",",
"$",
"response",
"[",
"'messag... | prints a simple message.
@param OutputInterface $output
@param array $response | [
"prints",
"a",
"simple",
"message",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/BaseOutput.php#L115-L118 |
digitalkaoz/versioneye-php | src/Output/BaseOutput.php | BaseOutput.getColumnWidth | private function getColumnWidth(array $headings)
{
$width = 0;
foreach ($headings as $heading) {
$width = strlen($heading) > $width ? strlen($heading) : $width;
}
return $width + 5;
} | php | private function getColumnWidth(array $headings)
{
$width = 0;
foreach ($headings as $heading) {
$width = strlen($heading) > $width ? strlen($heading) : $width;
}
return $width + 5;
} | [
"private",
"function",
"getColumnWidth",
"(",
"array",
"$",
"headings",
")",
"{",
"$",
"width",
"=",
"0",
";",
"foreach",
"(",
"$",
"headings",
"as",
"$",
"heading",
")",
"{",
"$",
"width",
"=",
"strlen",
"(",
"$",
"heading",
")",
">",
"$",
"width",
... | calculates the max width of a given set of string.
@param string[] $headings
@return int | [
"calculates",
"the",
"max",
"width",
"of",
"a",
"given",
"set",
"of",
"string",
"."
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/BaseOutput.php#L127-L135 |
digitalkaoz/versioneye-php | src/Output/BaseOutput.php | BaseOutput.createTable | protected function createTable(OutputInterface $output)
{
if (!class_exists('Symfony\Component\Console\Helper\Table')) {
$table = new TableHelper(false);
} else {
$table = new Table($output);
}
return $table;
} | php | protected function createTable(OutputInterface $output)
{
if (!class_exists('Symfony\Component\Console\Helper\Table')) {
$table = new TableHelper(false);
} else {
$table = new Table($output);
}
return $table;
} | [
"protected",
"function",
"createTable",
"(",
"OutputInterface",
"$",
"output",
")",
"{",
"if",
"(",
"!",
"class_exists",
"(",
"'Symfony\\Component\\Console\\Helper\\Table'",
")",
")",
"{",
"$",
"table",
"=",
"new",
"TableHelper",
"(",
"false",
")",
";",
"}",
"... | @param OutputInterface $output
@return Table|TableHelper | [
"@param",
"OutputInterface",
"$output"
] | train | https://github.com/digitalkaoz/versioneye-php/blob/7b8eb9cdc83e01138dda0e709c07e3beb6aad136/src/Output/BaseOutput.php#L142-L151 |
orzcc/autometa | src/AutoMeta/AutoMeta.php | AutoMeta.generate | public function generate()
{
$this->loadWebMasterTags();
$title = $this->getTitle();
$description = $this->getDescription();
$keywords = $this->getKeywords();
$metatags = $this->metatags;
$html = [];
if($title):
$html[] = "<title>$... | php | public function generate()
{
$this->loadWebMasterTags();
$title = $this->getTitle();
$description = $this->getDescription();
$keywords = $this->getKeywords();
$metatags = $this->metatags;
$html = [];
if($title):
$html[] = "<title>$... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"this",
"->",
"loadWebMasterTags",
"(",
")",
";",
"$",
"title",
"=",
"$",
"this",
"->",
"getTitle",
"(",
")",
";",
"$",
"description",
"=",
"$",
"this",
"->",
"getDescription",
"(",
")",
";",
"$",... | Generates meta tags
@return string | [
"Generates",
"meta",
"tags"
] | train | https://github.com/orzcc/autometa/blob/1e3bd93f364e2619c9c20820399735c9fe805c9c/src/AutoMeta/AutoMeta.php#L81-L112 |
orzcc/autometa | src/AutoMeta/AutoMeta.php | AutoMeta.setTitle | public function setTitle($title, $suffix='', $has_suffix=true)
{
// clean title
$title = strip_tags($title);
$suffix = strip_tags($suffix);
// store title session
$this->title_session = $title;
// store title
$this->title = $this->parseTitle($title, $suffix,... | php | public function setTitle($title, $suffix='', $has_suffix=true)
{
// clean title
$title = strip_tags($title);
$suffix = strip_tags($suffix);
// store title session
$this->title_session = $title;
// store title
$this->title = $this->parseTitle($title, $suffix,... | [
"public",
"function",
"setTitle",
"(",
"$",
"title",
",",
"$",
"suffix",
"=",
"''",
",",
"$",
"has_suffix",
"=",
"true",
")",
"{",
"// clean title",
"$",
"title",
"=",
"strip_tags",
"(",
"$",
"title",
")",
";",
"$",
"suffix",
"=",
"strip_tags",
"(",
... | Sets the title
@param string $title
@param string $suffix
@param boolean $has_suffix
@return MetaTagsContract | [
"Sets",
"the",
"title"
] | train | https://github.com/orzcc/autometa/blob/1e3bd93f364e2619c9c20820399735c9fe805c9c/src/AutoMeta/AutoMeta.php#L123-L136 |
orzcc/autometa | src/AutoMeta/AutoMeta.php | AutoMeta.setKeywords | public function setKeywords($keywords)
{
if (!is_array($keywords)):
$keywords = explode(', ', $this->keywords);
endif;
// clean keywords
$keywords = array_map('strip_tags', $keywords);
// store keywords
$this->keywords = $keywords;
return $this... | php | public function setKeywords($keywords)
{
if (!is_array($keywords)):
$keywords = explode(', ', $this->keywords);
endif;
// clean keywords
$keywords = array_map('strip_tags', $keywords);
// store keywords
$this->keywords = $keywords;
return $this... | [
"public",
"function",
"setKeywords",
"(",
"$",
"keywords",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"keywords",
")",
")",
":",
"$",
"keywords",
"=",
"explode",
"(",
"', '",
",",
"$",
"this",
"->",
"keywords",
")",
";",
"endif",
";",
"// clean ... | Sets the list of keywords, you can send an array or string separated with commas
also clears the previously set keywords
@param string|array $keywords
@return MetaTagsContract | [
"Sets",
"the",
"list",
"of",
"keywords",
"you",
"can",
"send",
"an",
"array",
"or",
"string",
"separated",
"with",
"commas",
"also",
"clears",
"the",
"previously",
"set",
"keywords"
] | train | https://github.com/orzcc/autometa/blob/1e3bd93f364e2619c9c20820399735c9fe805c9c/src/AutoMeta/AutoMeta.php#L174-L188 |
orzcc/autometa | src/AutoMeta/AutoMeta.php | AutoMeta.addKeyword | public function addKeyword($keyword)
{
if (is_array($keyword)):
$this->keywords = array_merge($keyword, $this->keywords);
else:
$this->keywords[] = strip_tags($keyword);
endif;
return $this;
} | php | public function addKeyword($keyword)
{
if (is_array($keyword)):
$this->keywords = array_merge($keyword, $this->keywords);
else:
$this->keywords[] = strip_tags($keyword);
endif;
return $this;
} | [
"public",
"function",
"addKeyword",
"(",
"$",
"keyword",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"keyword",
")",
")",
":",
"$",
"this",
"->",
"keywords",
"=",
"array_merge",
"(",
"$",
"keyword",
",",
"$",
"this",
"->",
"keywords",
")",
";",
"else"... | Add a keyword
@param string|array $keyword
@return MetaTagsContract | [
"Add",
"a",
"keyword"
] | train | https://github.com/orzcc/autometa/blob/1e3bd93f364e2619c9c20820399735c9fe805c9c/src/AutoMeta/AutoMeta.php#L197-L206 |
orzcc/autometa | src/AutoMeta/AutoMeta.php | AutoMeta.reset | public function reset()
{
$this->description = null;
$this->title_session = null;
$this->metatags = [];
$this->keywords = [];
} | php | public function reset()
{
$this->description = null;
$this->title_session = null;
$this->metatags = [];
$this->keywords = [];
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"description",
"=",
"null",
";",
"$",
"this",
"->",
"title_session",
"=",
"null",
";",
"$",
"this",
"->",
"metatags",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"keywords",
"=",
"[",
"]",... | Reset all data.
@return void | [
"Reset",
"all",
"data",
"."
] | train | https://github.com/orzcc/autometa/blob/1e3bd93f364e2619c9c20820399735c9fe805c9c/src/AutoMeta/AutoMeta.php#L283-L289 |
orzcc/autometa | src/AutoMeta/AutoMeta.php | AutoMeta.parseTitle | protected function parseTitle($title, $suffix, $has_suffix)
{
if (!$has_suffix):
return $title;
elseif(!empty($suffix)):
return $title . $this->getTitleSeperator() . $suffix;
else:
return $this->config->get('defaults.title') ? $title . $this->getTitleSeper... | php | protected function parseTitle($title, $suffix, $has_suffix)
{
if (!$has_suffix):
return $title;
elseif(!empty($suffix)):
return $title . $this->getTitleSeperator() . $suffix;
else:
return $this->config->get('defaults.title') ? $title . $this->getTitleSeper... | [
"protected",
"function",
"parseTitle",
"(",
"$",
"title",
",",
"$",
"suffix",
",",
"$",
"has_suffix",
")",
"{",
"if",
"(",
"!",
"$",
"has_suffix",
")",
":",
"return",
"$",
"title",
";",
"elseif",
"(",
"!",
"empty",
"(",
"$",
"suffix",
")",
")",
":"... | Get parsed title.
@param string $title
@param string @suffix
@return string | [
"Get",
"parsed",
"title",
"."
] | train | https://github.com/orzcc/autometa/blob/1e3bd93f364e2619c9c20820399735c9fe805c9c/src/AutoMeta/AutoMeta.php#L299-L308 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBOGeneratorBundle/Datatable/Data/DatatableDataManager.php | DatatableDataManager.getDatatable | public function getDatatable(DatatableViewInterface $datatableView)
{
$type = $datatableView->getAjax()->getType();
$entity = $datatableView->getEntity();
if ('GET' === strtoupper($type)) {
$this->parameterBag = $this->request->query;
}
if ('POST' === strtoupper... | php | public function getDatatable(DatatableViewInterface $datatableView)
{
$type = $datatableView->getAjax()->getType();
$entity = $datatableView->getEntity();
if ('GET' === strtoupper($type)) {
$this->parameterBag = $this->request->query;
}
if ('POST' === strtoupper... | [
"public",
"function",
"getDatatable",
"(",
"DatatableViewInterface",
"$",
"datatableView",
")",
"{",
"$",
"type",
"=",
"$",
"datatableView",
"->",
"getAjax",
"(",
")",
"->",
"getType",
"(",
")",
";",
"$",
"entity",
"=",
"$",
"datatableView",
"->",
"getEntity... | Get Datatable.
@param DatatableViewInterface $datatableView
@return DatatableData | [
"Get",
"Datatable",
"."
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBOGeneratorBundle/Datatable/Data/DatatableDataManager.php#L80-L111 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.normalize | public function normalize($object, $format = null, array $context = array())
{
$context['depth'] = isset($context['depth']) ? $context['depth']+1 : 0;
if (!isset($context['@references'])) {
$references = array();
$context['@references'] = &$references;
}
if ... | php | public function normalize($object, $format = null, array $context = array())
{
$context['depth'] = isset($context['depth']) ? $context['depth']+1 : 0;
if (!isset($context['@references'])) {
$references = array();
$context['@references'] = &$references;
}
if ... | [
"public",
"function",
"normalize",
"(",
"$",
"object",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"$",
"context",
"[",
"'depth'",
"]",
"=",
"isset",
"(",
"$",
"context",
"[",
"'depth'",
"]",
")"... | @param object $object
@param string $format
@param array $context
@return array | [
"@param",
"object",
"$object",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L51-L92 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.normalizeProperty | protected function normalizeProperty($value, $name, $format = null, array $context = array())
{
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
if ($meta->hasField($name)) {
return $value;
}
if (isset($meta->embeddedClasses[$name])) {
... | php | protected function normalizeProperty($value, $name, $format = null, array $context = array())
{
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
if ($meta->hasField($name)) {
return $value;
}
if (isset($meta->embeddedClasses[$name])) {
... | [
"protected",
"function",
"normalizeProperty",
"(",
"$",
"value",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"/** @var ClassMetadata $meta */",
"$",
"meta",
"=",
"$",
"context",
"[",
... | @param object $value
@param string $name
@param string $format
@param array $context
@return mixed|object | [
"@param",
"object",
"$value",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L102-L124 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.normalizeAssociation | protected function normalizeAssociation($association, $name, $format = null, array $context = array())
{
if ($association === null) {
return;
}
$hint = $this->getHintFromObject($association);
$ids = $this->getIdentifierFromObject($association);
$id = $this->getId... | php | protected function normalizeAssociation($association, $name, $format = null, array $context = array())
{
if ($association === null) {
return;
}
$hint = $this->getHintFromObject($association);
$ids = $this->getIdentifierFromObject($association);
$id = $this->getId... | [
"protected",
"function",
"normalizeAssociation",
"(",
"$",
"association",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"association",
"===",
"null",
")",
"{",
"return... | @param object $association
@param string $name
@param string $format
@param array $context
@return array | [
"@param",
"object",
"$association",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L134-L160 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.normalizeCollection | protected function normalizeCollection($collection, $name, $format = null, array $context = array())
{
if (empty($collection)) {
return array();
}
if ($collection instanceof AbstractLazyCollection and !$collection->isInitialized()) {
return array();
}
... | php | protected function normalizeCollection($collection, $name, $format = null, array $context = array())
{
if (empty($collection)) {
return array();
}
if ($collection instanceof AbstractLazyCollection and !$collection->isInitialized()) {
return array();
}
... | [
"protected",
"function",
"normalizeCollection",
"(",
"$",
"collection",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"collection",
")",
")",
"{",
"ret... | @param object $collection
@param string $name
@param string $format
@param array $context
@return array | [
"@param",
"object",
"$collection",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L170-L186 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.getAttributes | public function getAttributes($objectOrClass, $format = null, array $context)
{
$class = is_object($objectOrClass) ? get_class($objectOrClass) : $objectOrClass;
/** @var ClassMetadata $meta */
$meta = $this->entityMetadataFactory->getMetadataFor($class);
$fields = array_keys($meta-... | php | public function getAttributes($objectOrClass, $format = null, array $context)
{
$class = is_object($objectOrClass) ? get_class($objectOrClass) : $objectOrClass;
/** @var ClassMetadata $meta */
$meta = $this->entityMetadataFactory->getMetadataFor($class);
$fields = array_keys($meta-... | [
"public",
"function",
"getAttributes",
"(",
"$",
"objectOrClass",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
")",
"{",
"$",
"class",
"=",
"is_object",
"(",
"$",
"objectOrClass",
")",
"?",
"get_class",
"(",
"$",
"objectOrClass",
")",
"... | @param object|string $objectOrClass
@param string $format
@param array $context
@return array | [
"@param",
"object|string",
"$objectOrClass",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L195-L208 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.supportsNormalization | public function supportsNormalization($data, $format = null)
{
if (!is_object($data)) {
return false;
}
$class = get_class($data);
if (!$this->entityMetadataFactory->hasMetadataFor($class)
or $this->entityMetadataFactory->getMetadataFor($class)->isEmbeddedClass) ... | php | public function supportsNormalization($data, $format = null)
{
if (!is_object($data)) {
return false;
}
$class = get_class($data);
if (!$this->entityMetadataFactory->hasMetadataFor($class)
or $this->entityMetadataFactory->getMetadataFor($class)->isEmbeddedClass) ... | [
"public",
"function",
"supportsNormalization",
"(",
"$",
"data",
",",
"$",
"format",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"class",
"=",
"get_class",
"(",
"$",
"data",
... | @param object $data
@param string $format
@return bool | [
"@param",
"object",
"$data",
"@param",
"string",
"$format"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L216-L229 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.denormalize | public function denormalize($data, $class, $format = null, array $context = array())
{
if (isset($data['@references'])) {
$context['@references'] = &$data['@references'];
$ids = $this->getIdentifierFromArray($class, $data);
$objectId = $class.'#'.$this->getIdentifiersAsS... | php | public function denormalize($data, $class, $format = null, array $context = array())
{
if (isset($data['@references'])) {
$context['@references'] = &$data['@references'];
$ids = $this->getIdentifierFromArray($class, $data);
$objectId = $class.'#'.$this->getIdentifiersAsS... | [
"public",
"function",
"denormalize",
"(",
"$",
"data",
",",
"$",
"class",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'@references'",
"]",
")",
")",
... | @param array $data
@param string $class
@param string $format
@param array $context
@return object | [
"@param",
"array",
"$data",
"@param",
"string",
"$class",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L239-L260 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.hydrateObject | public function hydrateObject($object, $data, $class, $format, $context)
{
$attributes = $this->getAttributes($class, $format, $context);
foreach ($attributes as $attribute) {
$value = isset($data[$attribute]) ? $data[$attribute] : null;
$value = $this->denormalizeProperty($v... | php | public function hydrateObject($object, $data, $class, $format, $context)
{
$attributes = $this->getAttributes($class, $format, $context);
foreach ($attributes as $attribute) {
$value = isset($data[$attribute]) ? $data[$attribute] : null;
$value = $this->denormalizeProperty($v... | [
"public",
"function",
"hydrateObject",
"(",
"$",
"object",
",",
"$",
"data",
",",
"$",
"class",
",",
"$",
"format",
",",
"$",
"context",
")",
"{",
"$",
"attributes",
"=",
"$",
"this",
"->",
"getAttributes",
"(",
"$",
"class",
",",
"$",
"format",
",",... | @param object $object
@param array $data
@param string $class
@param string $format
@param array $context
@return object | [
"@param",
"object",
"$object",
"@param",
"array",
"$data",
"@param",
"string",
"$class",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L271-L282 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.denormalizeProperty | protected function denormalizeProperty($value, $class, $name, $format = null, array $context = array())
{
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
if ($meta->hasField($name)) {
return $value;
}
if (isset($meta->embeddedClasses[$name])) {
... | php | protected function denormalizeProperty($value, $class, $name, $format = null, array $context = array())
{
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
if ($meta->hasField($name)) {
return $value;
}
if (isset($meta->embeddedClasses[$name])) {
... | [
"protected",
"function",
"denormalizeProperty",
"(",
"$",
"value",
",",
"$",
"class",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"/** @var ClassMetadata $meta */",
"$",
"meta",
"=",
... | @param mixed $value
@param string $class
@param string $name
@param string $format
@param array $context
@return mixed|object | [
"@param",
"mixed",
"$value",
"@param",
"string",
"$class",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L293-L319 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.denormalizeAssociation | protected function denormalizeAssociation($value, $class, $name, $format = null, array $context = array())
{
if (empty($value)) {
return $value;
}
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
$class = $class ?: $meta->associationMappings[$name]... | php | protected function denormalizeAssociation($value, $class, $name, $format = null, array $context = array())
{
if (empty($value)) {
return $value;
}
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
$class = $class ?: $meta->associationMappings[$name]... | [
"protected",
"function",
"denormalizeAssociation",
"(",
"$",
"value",
",",
"$",
"class",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
... | @param mixed $value
@param string $class
@param string $name
@param string $format
@param array $context
@return mixed|object | [
"@param",
"mixed",
"$value",
"@param",
"string",
"$class",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L330-L356 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.denormalizeCollection | protected function denormalizeCollection($collection, $class, $name, $format = null, array $context = array())
{
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
$targetEntity = $meta->associationMappings[$name]['targetEntity'];
$result = array();
foreach ($c... | php | protected function denormalizeCollection($collection, $class, $name, $format = null, array $context = array())
{
/** @var ClassMetadata $meta */
$meta = $context['entityMeta'];
$targetEntity = $meta->associationMappings[$name]['targetEntity'];
$result = array();
foreach ($c... | [
"protected",
"function",
"denormalizeCollection",
"(",
"$",
"collection",
",",
"$",
"class",
",",
"$",
"name",
",",
"$",
"format",
"=",
"null",
",",
"array",
"$",
"context",
"=",
"array",
"(",
")",
")",
"{",
"/** @var ClassMetadata $meta */",
"$",
"meta",
... | @param mixed $collection
@param string $class
@param string $name
@param string $format
@param array $context
@return mixed|object | [
"@param",
"mixed",
"$collection",
"@param",
"string",
"$class",
"@param",
"string",
"$name",
"@param",
"string",
"$format",
"@param",
"array",
"$context"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L367-L382 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.supportsDenormalization | public function supportsDenormalization($data, $type, $format = null)
{
$class = $type ?: $this->getClassFromArray($data);
if (!$this->entityMetadataFactory->hasMetadataFor($class)
or $this->entityMetadataFactory->getMetadataFor($class)->isEmbeddedClass) {
return false;
}... | php | public function supportsDenormalization($data, $type, $format = null)
{
$class = $type ?: $this->getClassFromArray($data);
if (!$this->entityMetadataFactory->hasMetadataFor($class)
or $this->entityMetadataFactory->getMetadataFor($class)->isEmbeddedClass) {
return false;
}... | [
"public",
"function",
"supportsDenormalization",
"(",
"$",
"data",
",",
"$",
"type",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"$",
"type",
"?",
":",
"$",
"this",
"->",
"getClassFromArray",
"(",
"$",
"data",
")",
";",
"if",
"(",
... | @param array $data
@param string $type
@param string $format
@return bool | [
"@param",
"array",
"$data",
"@param",
"string",
"$type",
"@param",
"string",
"$format"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L391-L400 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.getIdentifierFromObject | protected function getIdentifierFromObject($object)
{
$class = get_class($object);
$meta = $this->entityMetadataFactory->getMetadataFor($class);
$values = $meta->getIdentifierValues($object);
$values = array_map(
function ($value) {
if (is_object($value))... | php | protected function getIdentifierFromObject($object)
{
$class = get_class($object);
$meta = $this->entityMetadataFactory->getMetadataFor($class);
$values = $meta->getIdentifierValues($object);
$values = array_map(
function ($value) {
if (is_object($value))... | [
"protected",
"function",
"getIdentifierFromObject",
"(",
"$",
"object",
")",
"{",
"$",
"class",
"=",
"get_class",
"(",
"$",
"object",
")",
";",
"$",
"meta",
"=",
"$",
"this",
"->",
"entityMetadataFactory",
"->",
"getMetadataFor",
"(",
"$",
"class",
")",
";... | @param object $object
@return array | [
"@param",
"object",
"$object"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L417-L435 |
mihai-stancu/serializer | Serializer/Normalizer/DoctrineNormalizer.php | DoctrineNormalizer.getIdentifierFromArray | protected function getIdentifierFromArray($class, $array)
{
$meta = $this->entityMetadataFactory->getMetadataFor($class);
$fields = $meta->getIdentifierFieldNames();
$ids = array();
foreach ($fields as $field) {
if (isset($array[$field])) {
$ids[$field] =... | php | protected function getIdentifierFromArray($class, $array)
{
$meta = $this->entityMetadataFactory->getMetadataFor($class);
$fields = $meta->getIdentifierFieldNames();
$ids = array();
foreach ($fields as $field) {
if (isset($array[$field])) {
$ids[$field] =... | [
"protected",
"function",
"getIdentifierFromArray",
"(",
"$",
"class",
",",
"$",
"array",
")",
"{",
"$",
"meta",
"=",
"$",
"this",
"->",
"entityMetadataFactory",
"->",
"getMetadataFor",
"(",
"$",
"class",
")",
";",
"$",
"fields",
"=",
"$",
"meta",
"->",
"... | @param string $class
@param array $array
@return array | [
"@param",
"string",
"$class",
"@param",
"array",
"$array"
] | train | https://github.com/mihai-stancu/serializer/blob/4d96f942a3c44d5b5652868be726af656bf1baad/Serializer/Normalizer/DoctrineNormalizer.php#L443-L470 |
ClanCats/Core | src/classes/CCShipyard/Class.php | CCShipyard_Class.create | public function create( $name, $extends = null, $implements = null )
{
$this->name = $name;
$this->extends = $extends;
if ( !is_array( $implements ) && !is_null( $implements ) )
{
$implements = array( $implements );
}
$this->implements = $implements;
} | php | public function create( $name, $extends = null, $implements = null )
{
$this->name = $name;
$this->extends = $extends;
if ( !is_array( $implements ) && !is_null( $implements ) )
{
$implements = array( $implements );
}
$this->implements = $implements;
} | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"extends",
"=",
"null",
",",
"$",
"implements",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"name",
";",
"$",
"this",
"->",
"extends",
"=",
"$",
"extends",
";",
"if",
"("... | Start new class builder
@param string $name
@param string $extends
@param string|array $implements
@return void | [
"Start",
"new",
"class",
"builder"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard/Class.php#L37-L48 |
ClanCats/Core | src/classes/CCShipyard/Class.php | CCShipyard_Class.add | public function add()
{
$args = func_get_args();
$component = array_shift( $args );
$method = 'build_'.strtolower( $component );
if ( !method_exists( $this, $method ) )
{
throw new CCException( 'CCShipyard_Class invalid component builder "'.$component.'".' );
}
$this->output .= call_user_f... | php | public function add()
{
$args = func_get_args();
$component = array_shift( $args );
$method = 'build_'.strtolower( $component );
if ( !method_exists( $this, $method ) )
{
throw new CCException( 'CCShipyard_Class invalid component builder "'.$component.'".' );
}
$this->output .= call_user_f... | [
"public",
"function",
"add",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"component",
"=",
"array_shift",
"(",
"$",
"args",
")",
";",
"$",
"method",
"=",
"'build_'",
".",
"strtolower",
"(",
"$",
"component",
")",
";",
"if",
... | Add a component to the class
@param mixed ...
@return void | [
"Add",
"a",
"component",
"to",
"the",
"class"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard/Class.php#L56-L70 |
ClanCats/Core | src/classes/CCShipyard/Class.php | CCShipyard_Class.build_property | public function build_property( $name, $context = null, $default = null, $comment = null, $export_default = true )
{
if ( is_null( $context ) )
{
$context = 'public';
}
if ( is_null( $comment ) )
{
$comment = ucfirst( $name );
}
if ( $default !== null )
{
$type = gettype( $default );
... | php | public function build_property( $name, $context = null, $default = null, $comment = null, $export_default = true )
{
if ( is_null( $context ) )
{
$context = 'public';
}
if ( is_null( $comment ) )
{
$comment = ucfirst( $name );
}
if ( $default !== null )
{
$type = gettype( $default );
... | [
"public",
"function",
"build_property",
"(",
"$",
"name",
",",
"$",
"context",
"=",
"null",
",",
"$",
"default",
"=",
"null",
",",
"$",
"comment",
"=",
"null",
",",
"$",
"export_default",
"=",
"true",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"contex... | Builds a new class property
@param string $name
@param string $context
@param mixed $default
@param string $comment
@param bool $export_default | [
"Builds",
"a",
"new",
"class",
"property"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard/Class.php#L81-L115 |
ClanCats/Core | src/classes/CCShipyard/Class.php | CCShipyard_Class.build_function | public function build_function( $name, $context = null, $content = null, $comment = null )
{
if ( is_null( $context ) )
{
$context = 'public';
}
if ( strpos( $name, '(' ) === false && strpos( $name, '(' ) === false )
{
$name .= '()';
}
if ( is_null( $comment ) )
{
$comment = ucfirst( $n... | php | public function build_function( $name, $context = null, $content = null, $comment = null )
{
if ( is_null( $context ) )
{
$context = 'public';
}
if ( strpos( $name, '(' ) === false && strpos( $name, '(' ) === false )
{
$name .= '()';
}
if ( is_null( $comment ) )
{
$comment = ucfirst( $n... | [
"public",
"function",
"build_function",
"(",
"$",
"name",
",",
"$",
"context",
"=",
"null",
",",
"$",
"content",
"=",
"null",
",",
"$",
"comment",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"context",
")",
")",
"{",
"$",
"context",
"=",... | Builds a new class property
@param string $name
@param string $context
@param mixed $content
@param string $comment | [
"Builds",
"a",
"new",
"class",
"property"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard/Class.php#L125-L144 |
ClanCats/Core | src/classes/CCShipyard/Class.php | CCShipyard_Class.file_header | protected function file_header( $title, $data = array() )
{
$conf = \CCConfig::create( 'shipyard' );
$data = CCDataObject::assign( $data );
// Build the authors string
$authors = $data->get( 'authors', $conf->get( 'defaults.authors' ) );
if ( is_array( $authors ) )
{
foreach( $authors as $pers... | php | protected function file_header( $title, $data = array() )
{
$conf = \CCConfig::create( 'shipyard' );
$data = CCDataObject::assign( $data );
// Build the authors string
$authors = $data->get( 'authors', $conf->get( 'defaults.authors' ) );
if ( is_array( $authors ) )
{
foreach( $authors as $pers... | [
"protected",
"function",
"file_header",
"(",
"$",
"title",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"conf",
"=",
"\\",
"CCConfig",
"::",
"create",
"(",
"'shipyard'",
")",
";",
"$",
"data",
"=",
"CCDataObject",
"::",
"assign",
"(",
"$"... | generates an file header string
@param string $title
@param array $data
@return string | [
"generates",
"an",
"file",
"header",
"string"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard/Class.php#L163-L193 |
ClanCats/Core | src/classes/CCShipyard/Class.php | CCShipyard_Class.output | public function output()
{
$namespace = null;
$class = $this->name;
extract( \CCConfig::create( 'shipyard' )->defaults );
// get namespace from the param
if ( strpos( $class, '::' ) !== false )
{
list( $namespace, $class ) = explode( '::', $this->name );
// try to get the ship from namespa... | php | public function output()
{
$namespace = null;
$class = $this->name;
extract( \CCConfig::create( 'shipyard' )->defaults );
// get namespace from the param
if ( strpos( $class, '::' ) !== false )
{
list( $namespace, $class ) = explode( '::', $this->name );
// try to get the ship from namespa... | [
"public",
"function",
"output",
"(",
")",
"{",
"$",
"namespace",
"=",
"null",
";",
"$",
"class",
"=",
"$",
"this",
"->",
"name",
";",
"extract",
"(",
"\\",
"CCConfig",
"::",
"create",
"(",
"'shipyard'",
")",
"->",
"defaults",
")",
";",
"// get namespac... | Get the current builder output
@return string | [
"Get",
"the",
"current",
"builder",
"output"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard/Class.php#L200-L250 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Template.php | PHPWord_Template.setValue | public function setValue($search, $replace) {
if(substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') {
$search = '${'.$search.'}';
}
$this->_documentXML = str_replace($search, $replace, $this->_documentXML);
} | php | public function setValue($search, $replace) {
if(substr($search, 0, 2) !== '${' && substr($search, -1) !== '}') {
$search = '${'.$search.'}';
}
$this->_documentXML = str_replace($search, $replace, $this->_documentXML);
} | [
"public",
"function",
"setValue",
"(",
"$",
"search",
",",
"$",
"replace",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"search",
",",
"0",
",",
"2",
")",
"!==",
"'${'",
"&&",
"substr",
"(",
"$",
"search",
",",
"-",
"1",
")",
"!==",
"'}'",
")",
"{"... | Set a Template value
@param mixed $search
@param mixed $replace | [
"Set",
"a",
"Template",
"value"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Template.php#L83-L89 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Template.php | PHPWord_Template.save | public function save($strFilename) {
if(file_exists($strFilename)) {
unlink($strFilename);
}
$this->_objZip->addFromString('word/document.xml', $this->_documentXML);
// Close zip file
if($this->_objZip->close() === false) {
throw... | php | public function save($strFilename) {
if(file_exists($strFilename)) {
unlink($strFilename);
}
$this->_objZip->addFromString('word/document.xml', $this->_documentXML);
// Close zip file
if($this->_objZip->close() === false) {
throw... | [
"public",
"function",
"save",
"(",
"$",
"strFilename",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"strFilename",
")",
")",
"{",
"unlink",
"(",
"$",
"strFilename",
")",
";",
"}",
"$",
"this",
"->",
"_objZip",
"->",
"addFromString",
"(",
"'word/document... | Save Template
@param string $strFilename | [
"Save",
"Template"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Template.php#L96-L109 |
steeffeen/FancyManiaLinks | FML/Stylesheet/Style3d.php | Style3d.render | public function render(\DOMDocument $domDocument)
{
$style3dXml = $domDocument->createElement("style3d");
$this->checkId();
if ($this->styleId) {
$style3dXml->setAttribute("id", $this->styleId);
}
if ($this->model) {
$style3dXml->setAttribute("model", ... | php | public function render(\DOMDocument $domDocument)
{
$style3dXml = $domDocument->createElement("style3d");
$this->checkId();
if ($this->styleId) {
$style3dXml->setAttribute("id", $this->styleId);
}
if ($this->model) {
$style3dXml->setAttribute("model", ... | [
"public",
"function",
"render",
"(",
"\\",
"DOMDocument",
"$",
"domDocument",
")",
"{",
"$",
"style3dXml",
"=",
"$",
"domDocument",
"->",
"createElement",
"(",
"\"style3d\"",
")",
";",
"$",
"this",
"->",
"checkId",
"(",
")",
";",
"if",
"(",
"$",
"this",
... | Render the Style3d
@param \DOMDocument $domDocument DOMDocument for which the Style3d should be rendered
@return \DOMElement | [
"Render",
"the",
"Style3d"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Stylesheet/Style3d.php#L394-L432 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.ExpectRetrievedValueIsString | public static function ExpectRetrievedValueIsString(
string $property,
$value,
string $class_name
) : string {
/**
* @psalm-var T
*/
$value = static::MaybeThrowIfNotType($property, $value, $class_name, 'string');
return $value;
} | php | public static function ExpectRetrievedValueIsString(
string $property,
$value,
string $class_name
) : string {
/**
* @psalm-var T
*/
$value = static::MaybeThrowIfNotType($property, $value, $class_name, 'string');
return $value;
} | [
"public",
"static",
"function",
"ExpectRetrievedValueIsString",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"class_name",
")",
":",
"string",
"{",
"/**\n * @psalm-var T\n */",
"$",
"value",
"=",
"static",
"::",
"MaybeThrowIfN... | @template T as string
@param scalar|array|object|null $value
@psalm-param class-string<DaftObject> $class_name | [
"@template",
"T",
"as",
"string"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L130-L141 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.ExpectRetrievedValueIsArray | public static function ExpectRetrievedValueIsArray(
string $property,
$value,
string $class_name
) : array {
/**
* @psalm-var T
*/
$value = static::MaybeThrowIfNotType($property, $value, $class_name, 'array');
return $value;
} | php | public static function ExpectRetrievedValueIsArray(
string $property,
$value,
string $class_name
) : array {
/**
* @psalm-var T
*/
$value = static::MaybeThrowIfNotType($property, $value, $class_name, 'array');
return $value;
} | [
"public",
"static",
"function",
"ExpectRetrievedValueIsArray",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"class_name",
")",
":",
"array",
"{",
"/**\n * @psalm-var T\n */",
"$",
"value",
"=",
"static",
"::",
"MaybeThrowIfNot... | @template T as array
@param scalar|array|object|null $value
@psalm-param class-string<DaftObject> $class_name | [
"@template",
"T",
"as",
"array"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L150-L161 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.ExpectRetrievedValueIsIntish | public static function ExpectRetrievedValueIsIntish(
string $property,
$value,
string $class_name
) : int {
if (is_string($value) && ctype_digit($value)) {
$value = (int) $value;
}
/**
* @psalm-var T
*/
$value = static::MaybeThrowI... | php | public static function ExpectRetrievedValueIsIntish(
string $property,
$value,
string $class_name
) : int {
if (is_string($value) && ctype_digit($value)) {
$value = (int) $value;
}
/**
* @psalm-var T
*/
$value = static::MaybeThrowI... | [
"public",
"static",
"function",
"ExpectRetrievedValueIsIntish",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"class_name",
")",
":",
"int",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
"&&",
"ctype_digit",
"(",
"$",
"value... | @template T as int
@param scalar|array|object|null $value
@psalm-param class-string<DaftObject> $class_name | [
"@template",
"T",
"as",
"int"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L170-L185 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.ExpectRetrievedValueIsFloatish | public static function ExpectRetrievedValueIsFloatish(
string $property,
$value,
string $class_name
) : float {
if (is_string($value) && is_numeric($value)) {
$value = (float) $value;
}
/**
* @psalm-var T
*/
$value = static::MaybeT... | php | public static function ExpectRetrievedValueIsFloatish(
string $property,
$value,
string $class_name
) : float {
if (is_string($value) && is_numeric($value)) {
$value = (float) $value;
}
/**
* @psalm-var T
*/
$value = static::MaybeT... | [
"public",
"static",
"function",
"ExpectRetrievedValueIsFloatish",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"class_name",
")",
":",
"float",
"{",
"if",
"(",
"is_string",
"(",
"$",
"value",
")",
"&&",
"is_numeric",
"(",
"$",
"va... | @template T as float
@param scalar|array|object|null $value
@psalm-param class-string<DaftObject> $class_name | [
"@template",
"T",
"as",
"float"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L194-L209 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.ExpectRetrievedValueIsBoolish | public static function ExpectRetrievedValueIsBoolish(
string $property,
$value,
string $class_name
) : bool {
if ('1' === $value || 1 === $value) {
return true;
} elseif ('0' === $value || 0 === $value) {
return false;
}
/**
* ... | php | public static function ExpectRetrievedValueIsBoolish(
string $property,
$value,
string $class_name
) : bool {
if ('1' === $value || 1 === $value) {
return true;
} elseif ('0' === $value || 0 === $value) {
return false;
}
/**
* ... | [
"public",
"static",
"function",
"ExpectRetrievedValueIsBoolish",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"class_name",
")",
":",
"bool",
"{",
"if",
"(",
"'1'",
"===",
"$",
"value",
"||",
"1",
"===",
"$",
"value",
")",
"{",
... | @template T as bool
@param scalar|array|object|null $value
@psalm-param class-string<DaftObject> $class_name | [
"@template",
"T",
"as",
"bool"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L218-L235 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.MaybeThrowOnNudge | public static function MaybeThrowOnNudge(
string $class_name,
string $property,
$value
) : void {
if (
! in_array(
$property,
$class_name::DaftObjectProperties(),
DefinitionAssistant::IN_ARRAY_STRICT_MODE
)
... | php | public static function MaybeThrowOnNudge(
string $class_name,
string $property,
$value
) : void {
if (
! in_array(
$property,
$class_name::DaftObjectProperties(),
DefinitionAssistant::IN_ARRAY_STRICT_MODE
)
... | [
"public",
"static",
"function",
"MaybeThrowOnNudge",
"(",
"string",
"$",
"class_name",
",",
"string",
"$",
"property",
",",
"$",
"value",
")",
":",
"void",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"property",
",",
"$",
"class_name",
"::",
"DaftObjectProp... | @psalm-param class-string<DaftObject> $class_name
@param scalar|array|object|null $value | [
"@psalm",
"-",
"param",
"class",
"-",
"string<DaftObject",
">",
"$class_name"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L242-L265 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.MaybeThrowIfNotType | protected static function MaybeThrowIfNotType(
string $property,
$value,
string $class_name,
string $type
) {
if ($type !== gettype($value)) {
throw Exceptions\Factory::PropertyValueNotOfExpectedTypeException(
$class_name,
$property... | php | protected static function MaybeThrowIfNotType(
string $property,
$value,
string $class_name,
string $type
) {
if ($type !== gettype($value)) {
throw Exceptions\Factory::PropertyValueNotOfExpectedTypeException(
$class_name,
$property... | [
"protected",
"static",
"function",
"MaybeThrowIfNotType",
"(",
"string",
"$",
"property",
",",
"$",
"value",
",",
"string",
"$",
"class_name",
",",
"string",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"!==",
"gettype",
"(",
"$",
"value",
")",
")",
... | @template T
@param scalar|array|object|null $value
@psalm-return T
@return mixed | [
"@template",
"T"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L276-L296 |
SignpostMarv/daft-object | src/TypeUtilities.php | TypeUtilities.CachePublicGettersAndSettersProperties | protected static function CachePublicGettersAndSettersProperties(string $class) : void
{
if (
is_a($class, AbstractDaftObject::class, true) &&
DefinitionAssistant::IsTypeUnregistered($class)
) {
/**
* @psalm-var class-string<T>
*/
... | php | protected static function CachePublicGettersAndSettersProperties(string $class) : void
{
if (
is_a($class, AbstractDaftObject::class, true) &&
DefinitionAssistant::IsTypeUnregistered($class)
) {
/**
* @psalm-var class-string<T>
*/
... | [
"protected",
"static",
"function",
"CachePublicGettersAndSettersProperties",
"(",
"string",
"$",
"class",
")",
":",
"void",
"{",
"if",
"(",
"is_a",
"(",
"$",
"class",
",",
"AbstractDaftObject",
"::",
"class",
",",
"true",
")",
"&&",
"DefinitionAssistant",
"::",
... | @template T as DaftObject
@psalm-param class-string<T> $class | [
"@template",
"T",
"as",
"DaftObject"
] | train | https://github.com/SignpostMarv/daft-object/blob/514886592b64986cc637040045f098335e27c037/src/TypeUtilities.php#L303-L320 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setIo($input, $output);
$outputFile = $input->getOption('generate');
$output->writeln("<info>Generating your {$outputFile}...</info>");
$output->writeln("<comment>{$this->banner}\n</comment>");
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setIo($input, $output);
$outputFile = $input->getOption('generate');
$output->writeln("<info>Generating your {$outputFile}...</info>");
$output->writeln("<comment>{$this->banner}\n</comment>");
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"setIo",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"outputFile",
"=",
"$",
"input",
"->",
"getOption"... | Execute the command.
@param InputInterface $input
@param OutputInterface $output
@return void | [
"Execute",
"the",
"command",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L89-L127 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.setupSources | protected function setupSources()
{
/** @var Repository $config */
$config = $this->container['config'];
$cwd = getcwd();
$source = [];
$this->output->writeln("Working directory is <path>{$cwd}</path>");
$this->title('Sources');
if ($this->isGitRepo('.')) {... | php | protected function setupSources()
{
/** @var Repository $config */
$config = $this->container['config'];
$cwd = getcwd();
$source = [];
$this->output->writeln("Working directory is <path>{$cwd}</path>");
$this->title('Sources');
if ($this->isGitRepo('.')) {... | [
"protected",
"function",
"setupSources",
"(",
")",
"{",
"/** @var Repository $config */",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
";",
"$",
"cwd",
"=",
"getcwd",
"(",
")",
";",
"$",
"source",
"=",
"[",
"]",
";",
"$",
"... | Get the config values related to steak sources.
@return array | [
"Get",
"the",
"config",
"values",
"related",
"to",
"steak",
"sources",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L134-L212 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.setupBuild | protected function setupBuild()
{
/** @var Repository $config */
$config = $this->container['config'];
$build = [];
$this->title('Build');
$build['directory'] = $this->ask("Where should we put the generated site files?", $config['build.directory']);
return $build;... | php | protected function setupBuild()
{
/** @var Repository $config */
$config = $this->container['config'];
$build = [];
$this->title('Build');
$build['directory'] = $this->ask("Where should we put the generated site files?", $config['build.directory']);
return $build;... | [
"protected",
"function",
"setupBuild",
"(",
")",
"{",
"/** @var Repository $config */",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
";",
"$",
"build",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"title",
"(",
"'Build'",
")",
";",... | Get the config values related to the build process.
@return array | [
"Get",
"the",
"config",
"values",
"related",
"to",
"the",
"build",
"process",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L219-L231 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.setupDeploy | protected function setupDeploy()
{
/** @var Repository $config */
$config = $this->container['config'];
$this->title('Deployment via Git');
$deploy = [];
if ($this->confirm('Push the generated static site to a git repository?')) {
$deploy['git.url'] = $this->a... | php | protected function setupDeploy()
{
/** @var Repository $config */
$config = $this->container['config'];
$this->title('Deployment via Git');
$deploy = [];
if ($this->confirm('Push the generated static site to a git repository?')) {
$deploy['git.url'] = $this->a... | [
"protected",
"function",
"setupDeploy",
"(",
")",
"{",
"/** @var Repository $config */",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
";",
"$",
"this",
"->",
"title",
"(",
"'Deployment via Git'",
")",
";",
"$",
"deploy",
"=",
"["... | Get the config values related to deployment.
@return array | [
"Get",
"the",
"config",
"values",
"related",
"to",
"deployment",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L238-L270 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.setupGulp | protected function setupGulp()
{
/** @var Repository $config */
$config = $this->container['config'];
$this->title('Gulp');
$gulp = [];
$this->output->writeln([
"steak uses the gulp taskrunner to:",
" 1. publish non-PHP files from your source direc... | php | protected function setupGulp()
{
/** @var Repository $config */
$config = $this->container['config'];
$this->title('Gulp');
$gulp = [];
$this->output->writeln([
"steak uses the gulp taskrunner to:",
" 1. publish non-PHP files from your source direc... | [
"protected",
"function",
"setupGulp",
"(",
")",
"{",
"/** @var Repository $config */",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
";",
"$",
"this",
"->",
"title",
"(",
"'Gulp'",
")",
";",
"$",
"gulp",
"=",
"[",
"]",
";",
... | Get the config values related to gulp.
@return array | [
"Get",
"the",
"config",
"values",
"related",
"to",
"gulp",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L277-L295 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.setupServe | protected function setupServe(array $newConfig)
{
$newConfig = array_dot($newConfig);
if (array_get($newConfig, 'deploy.git.branch') != 'gh-pages') {
return [];
}
$this->title('Local development server');
$this->output->writeln([
"When you publish t... | php | protected function setupServe(array $newConfig)
{
$newConfig = array_dot($newConfig);
if (array_get($newConfig, 'deploy.git.branch') != 'gh-pages') {
return [];
}
$this->title('Local development server');
$this->output->writeln([
"When you publish t... | [
"protected",
"function",
"setupServe",
"(",
"array",
"$",
"newConfig",
")",
"{",
"$",
"newConfig",
"=",
"array_dot",
"(",
"$",
"newConfig",
")",
";",
"if",
"(",
"array_get",
"(",
"$",
"newConfig",
",",
"'deploy.git.branch'",
")",
"!=",
"'gh-pages'",
")",
"... | Get the config values related to the development server.
@param array $newConfig
@return array | [
"Get",
"the",
"config",
"values",
"related",
"to",
"the",
"development",
"server",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L303-L325 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.ask | protected function ask($question, $default = null, Closure $validator = null)
{
if ($default) {
$question .= " [$default]";
}
$question = new Question($question . "\n > ", $default);
if ($validator) {
$question->setValidator($validator);
}
r... | php | protected function ask($question, $default = null, Closure $validator = null)
{
if ($default) {
$question .= " [$default]";
}
$question = new Question($question . "\n > ", $default);
if ($validator) {
$question->setValidator($validator);
}
r... | [
"protected",
"function",
"ask",
"(",
"$",
"question",
",",
"$",
"default",
"=",
"null",
",",
"Closure",
"$",
"validator",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"default",
")",
"{",
"$",
"question",
".=",
"\" [$default]\"",
";",
"}",
"$",
"question",
... | Ask a question.
@param string $question
@param null|string $default
@param Closure $validator
@return string | [
"Ask",
"a",
"question",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L336-L349 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.confirm | protected function confirm($text, $default = true)
{
$choices = $default ? 'Yn' : 'yN';
$confirm = new ConfirmationQuestion("$text [$choices] ", $default);
return $this->getHelper('question')->ask($this->input, $this->output, $confirm);
} | php | protected function confirm($text, $default = true)
{
$choices = $default ? 'Yn' : 'yN';
$confirm = new ConfirmationQuestion("$text [$choices] ", $default);
return $this->getHelper('question')->ask($this->input, $this->output, $confirm);
} | [
"protected",
"function",
"confirm",
"(",
"$",
"text",
",",
"$",
"default",
"=",
"true",
")",
"{",
"$",
"choices",
"=",
"$",
"default",
"?",
"'Yn'",
":",
"'yN'",
";",
"$",
"confirm",
"=",
"new",
"ConfirmationQuestion",
"(",
"\"$text [$choices] \"",
",",
"... | Ask for user confirmation.
@param string $text
@param bool $default
@return bool | [
"Ask",
"for",
"user",
"confirmation",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L358-L364 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.select | protected function select($text, $choices, $default = null)
{
$question = new ChoiceQuestion($text, $choices, $default);
return $this->getHelper('question')->ask($this->input, $this->output, $question);
} | php | protected function select($text, $choices, $default = null)
{
$question = new ChoiceQuestion($text, $choices, $default);
return $this->getHelper('question')->ask($this->input, $this->output, $question);
} | [
"protected",
"function",
"select",
"(",
"$",
"text",
",",
"$",
"choices",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"question",
"=",
"new",
"ChoiceQuestion",
"(",
"$",
"text",
",",
"$",
"choices",
",",
"$",
"default",
")",
";",
"return",
"$",
... | Ask user to choose from a list of options.
@param string $text
@param array $choices
@param mixed $default
@return mixed | [
"Ask",
"user",
"to",
"choose",
"from",
"a",
"list",
"of",
"options",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L374-L379 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.getPushUrl | protected function getPushUrl($dir, $throws = false)
{
try {
$remotes = $this->git->workingCopy($dir)->remote('show', 'origin', '-n')->getOutput();
if (preg_match('!Push\s*URL:\s*([^\s#]+)!', $remotes, $matches)) {
return $matches[1];
}
} catch (... | php | protected function getPushUrl($dir, $throws = false)
{
try {
$remotes = $this->git->workingCopy($dir)->remote('show', 'origin', '-n')->getOutput();
if (preg_match('!Push\s*URL:\s*([^\s#]+)!', $remotes, $matches)) {
return $matches[1];
}
} catch (... | [
"protected",
"function",
"getPushUrl",
"(",
"$",
"dir",
",",
"$",
"throws",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"remotes",
"=",
"$",
"this",
"->",
"git",
"->",
"workingCopy",
"(",
"$",
"dir",
")",
"->",
"remote",
"(",
"'show'",
",",
"'origin'",
... | Get the origin's push URL.
@param string $dir
@param bool $throws
@return null|string | [
"Get",
"the",
"origin",
"s",
"push",
"URL",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L399-L414 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.createYaml | protected function createYaml(array $config)
{
$nested = [];
array_walk(array_dot($config), function ($value, $key) use (&$nested) {
array_set($nested, $key, $value);
});
return $this->yaml->dump($nested, 4);
} | php | protected function createYaml(array $config)
{
$nested = [];
array_walk(array_dot($config), function ($value, $key) use (&$nested) {
array_set($nested, $key, $value);
});
return $this->yaml->dump($nested, 4);
} | [
"protected",
"function",
"createYaml",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"nested",
"=",
"[",
"]",
";",
"array_walk",
"(",
"array_dot",
"(",
"$",
"config",
")",
",",
"function",
"(",
"$",
"value",
",",
"$",
"key",
")",
"use",
"(",
"&",
"$"... | Create a YML string from a dotted array.
@param array $config
@return string | [
"Create",
"a",
"YML",
"string",
"from",
"a",
"dotted",
"array",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L422-L431 |
parsnick/steak | src/Console/InitCommand.php | InitCommand.dirExists | protected function dirExists($dir)
{
if ($this->files->exists($dir)) {
if ( ! $this->files->isDirectory($dir)) {
throw new RuntimeException("The given directory [$dir] is not a directory.");
}
return true;
}
return false;
} | php | protected function dirExists($dir)
{
if ($this->files->exists($dir)) {
if ( ! $this->files->isDirectory($dir)) {
throw new RuntimeException("The given directory [$dir] is not a directory.");
}
return true;
}
return false;
} | [
"protected",
"function",
"dirExists",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"dir",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"isDirectory",
"(",
"$",
"dir",
")",
")",
... | Check if a directory exists.
@param string $dir
@return bool | [
"Check",
"if",
"a",
"directory",
"exists",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/InitCommand.php#L440-L452 |
koriym/Koriym.QueryLocator | src/QueryLocator.php | QueryLocator.get | public function get(string $queryName) : string
{
$sqlFile = sprintf(
'%s/%s.sql',
$this->sqlDir,
$queryName
);
return trim($this->getFileContents($sqlFile));
} | php | public function get(string $queryName) : string
{
$sqlFile = sprintf(
'%s/%s.sql',
$this->sqlDir,
$queryName
);
return trim($this->getFileContents($sqlFile));
} | [
"public",
"function",
"get",
"(",
"string",
"$",
"queryName",
")",
":",
"string",
"{",
"$",
"sqlFile",
"=",
"sprintf",
"(",
"'%s/%s.sql'",
",",
"$",
"this",
"->",
"sqlDir",
",",
"$",
"queryName",
")",
";",
"return",
"trim",
"(",
"$",
"this",
"->",
"g... | {@inheritdoc} | [
"{"
] | train | https://github.com/koriym/Koriym.QueryLocator/blob/4e9b9ecfdd99c4850e39e88204a597af503c3823/src/QueryLocator.php#L27-L36 |
koriym/Koriym.QueryLocator | src/QueryLocator.php | QueryLocator.rewriteCountQuery | private function rewriteCountQuery(string $sql) : string
{
if (preg_match('/^\s*SELECT\s+\bDISTINCT\b/is', $sql) || preg_match('/\s+GROUP\s+BY\s+/is', $sql)) {
throw new CountQueryException($sql);
}
$openParenthesis = '(?:\()';
$closeParenthesis = '(?:\))';
$subQu... | php | private function rewriteCountQuery(string $sql) : string
{
if (preg_match('/^\s*SELECT\s+\bDISTINCT\b/is', $sql) || preg_match('/\s+GROUP\s+BY\s+/is', $sql)) {
throw new CountQueryException($sql);
}
$openParenthesis = '(?:\()';
$closeParenthesis = '(?:\))';
$subQu... | [
"private",
"function",
"rewriteCountQuery",
"(",
"string",
"$",
"sql",
")",
":",
"string",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\s*SELECT\\s+\\bDISTINCT\\b/is'",
",",
"$",
"sql",
")",
"||",
"preg_match",
"(",
"'/\\s+GROUP\\s+BY\\s+/is'",
",",
"$",
"sql",
")",... | Return count query
@see https://github.com/pear/Pager/blob/master/examples/Pager_Wrapper.php
Taken from pear/pager and modified.
tested at https://github.com/pear/Pager/blob/80c0e31c8b94f913cfbdeccbe83b63822f42a2f8/tests/pager_wrapper_test.php#L19
@codeCoverageIgnore | [
"Return",
"count",
"query"
] | train | https://github.com/koriym/Koriym.QueryLocator/blob/4e9b9ecfdd99c4850e39e88204a597af503c3823/src/QueryLocator.php#L86-L117 |
ondrakoupil/tools | src/Url.php | Url.builder | static function builder($params, $originalUrl, $clear=false, $clearArrays=true, $keepEntities = array()) {
$origParams=array();
if (!$clear) {
$query=parse_url($originalUrl,PHP_URL_QUERY);
if ($query) {
parse_str($query, $origParams);
}
if (!$origParams) {
$origParams=array();
}
}
if ($... | php | static function builder($params, $originalUrl, $clear=false, $clearArrays=true, $keepEntities = array()) {
$origParams=array();
if (!$clear) {
$query=parse_url($originalUrl,PHP_URL_QUERY);
if ($query) {
parse_str($query, $origParams);
}
if (!$origParams) {
$origParams=array();
}
}
if ($... | [
"static",
"function",
"builder",
"(",
"$",
"params",
",",
"$",
"originalUrl",
",",
"$",
"clear",
"=",
"false",
",",
"$",
"clearArrays",
"=",
"true",
",",
"$",
"keepEntities",
"=",
"array",
"(",
")",
")",
"{",
"$",
"origParams",
"=",
"array",
"(",
")"... | Pomůcka pro sestavení adresy s GET parametry.
@param array $params Asociativní pole [název-parametru] => hodnota-parametru. Null pro odstranění daného parametru, byl-li tam.
Hodnota může být array, pak se automaticky převede na několik samostatných parametrů ve tvaru název-parametru[]
@param string $originalUrl Původní... | [
"Pomůcka",
"pro",
"sestavení",
"adresy",
"s",
"GET",
"parametry",
"."
] | train | https://github.com/ondrakoupil/tools/blob/7ecbe3652e379802fbaabf4fe8f27b96dcbadb22/src/Url.php#L18-L69 |
simple-php-mvc/simple-php-mvc | src/MVC/Sessions/Session.php | Session.set | public function set($name, $value)
{
if (!$this->has($name)) {
$this->vars[$name] = $value;
} else {
return false;
}
} | php | public function set($name, $value)
{
if (!$this->has($name)) {
$this->vars[$name] = $value;
} else {
return false;
}
} | [
"public",
"function",
"set",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"vars",
"[",
"$",
"name",
"]",
"=",
"$",
"value",
";",
"}",
"else",
"{... | Set var session
@access public
@param string $name
@param mixed $value
@return bool | [
"Set",
"var",
"session"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Sessions/Session.php#L111-L118 |
dms-org/package.blog | src/Domain/Services/Comment/BlogArticleCommentingService.php | BlogArticleCommentingService.postComment | public function postComment(int $blogArticleId, string $authorName, EmailAddress $authorEmail, string $comment): BlogArticleComment
{
$blogArticle = $this->blogArticleRepo->get($blogArticleId);
$comment = $blogArticle->postComment($authorName, $authorEmail, $comment, $this->clock);
$this->... | php | public function postComment(int $blogArticleId, string $authorName, EmailAddress $authorEmail, string $comment): BlogArticleComment
{
$blogArticle = $this->blogArticleRepo->get($blogArticleId);
$comment = $blogArticle->postComment($authorName, $authorEmail, $comment, $this->clock);
$this->... | [
"public",
"function",
"postComment",
"(",
"int",
"$",
"blogArticleId",
",",
"string",
"$",
"authorName",
",",
"EmailAddress",
"$",
"authorEmail",
",",
"string",
"$",
"comment",
")",
":",
"BlogArticleComment",
"{",
"$",
"blogArticle",
"=",
"$",
"this",
"->",
... | @param int $blogArticleId
@param string $authorName
@param EmailAddress $authorEmail
@param string $comment
@return BlogArticleComment | [
"@param",
"int",
"$blogArticleId",
"@param",
"string",
"$authorName",
"@param",
"EmailAddress",
"$authorEmail",
"@param",
"string",
"$comment"
] | train | https://github.com/dms-org/package.blog/blob/1500f6fad20d81289a0dfa617fc1c54699f01e16/src/Domain/Services/Comment/BlogArticleCommentingService.php#L45-L54 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Validate/File/WordCount.php | Zend_Validate_File_WordCount.isValid | public function isValid($value, $file = null)
{
// Is file readable ?
require_once 'Zend/Loader.php';
if (!Zend_Loader::isReadable($value)) {
return $this->_throw($file, self::NOT_FOUND);
}
$content = file_get_contents($value);
$this->_count = str_word_co... | php | public function isValid($value, $file = null)
{
// Is file readable ?
require_once 'Zend/Loader.php';
if (!Zend_Loader::isReadable($value)) {
return $this->_throw($file, self::NOT_FOUND);
}
$content = file_get_contents($value);
$this->_count = str_word_co... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"$",
"file",
"=",
"null",
")",
"{",
"// Is file readable ?",
"require_once",
"'Zend/Loader.php'",
";",
"if",
"(",
"!",
"Zend_Loader",
"::",
"isReadable",
"(",
"$",
"value",
")",
")",
"{",
"return",
"... | Defined by Zend_Validate_Interface
Returns true if and only if the counted words are at least min and
not bigger than max (when max is not null).
@param string $value Filename to check for word count
@param array $file File data from Zend_File_Transfer
@return boolean | [
"Defined",
"by",
"Zend_Validate_Interface"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Validate/File/WordCount.php#L64-L83 |
xinix-technology/norm | src/Norm/Cursor/PDOCursor.php | PDOCursor.count | public function count($foundOnly = false)
{
$data = array();
$sql = $this->connection->getDialect()->grammarCount($this, $foundOnly, $data);
$statement = $this->connection->getRaw()->prepare($sql);
$statement->execute($data);
$count = $statement->fetch(PDO::FETCH_OBJ)->c;
... | php | public function count($foundOnly = false)
{
$data = array();
$sql = $this->connection->getDialect()->grammarCount($this, $foundOnly, $data);
$statement = $this->connection->getRaw()->prepare($sql);
$statement->execute($data);
$count = $statement->fetch(PDO::FETCH_OBJ)->c;
... | [
"public",
"function",
"count",
"(",
"$",
"foundOnly",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"array",
"(",
")",
";",
"$",
"sql",
"=",
"$",
"this",
"->",
"connection",
"->",
"getDialect",
"(",
")",
"->",
"grammarCount",
"(",
"$",
"this",
",",
"$"... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/PDOCursor.php#L41-L53 |
xinix-technology/norm | src/Norm/Cursor/PDOCursor.php | PDOCursor.next | public function next()
{
// Try to get the next element in our data buffer.
$this->next = each($this->buffer);
// Past the end of the data buffer
if (false === $this->next) {
// Fetch the next row of data
$row = $this->getStatement()->fetch(PDO::FETCH_ASSOC);... | php | public function next()
{
// Try to get the next element in our data buffer.
$this->next = each($this->buffer);
// Past the end of the data buffer
if (false === $this->next) {
// Fetch the next row of data
$row = $this->getStatement()->fetch(PDO::FETCH_ASSOC);... | [
"public",
"function",
"next",
"(",
")",
"{",
"// Try to get the next element in our data buffer.",
"$",
"this",
"->",
"next",
"=",
"each",
"(",
"$",
"this",
"->",
"buffer",
")",
";",
"// Past the end of the data buffer",
"if",
"(",
"false",
"===",
"$",
"this",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/PDOCursor.php#L82-L100 |
xinix-technology/norm | src/Norm/Cursor/PDOCursor.php | PDOCursor.getStatement | public function getStatement($type = null)
{
if (is_null($this->statement)) {
$this->buffer = array();
$this->next = false;
$sql = "SELECT * FROM {$this->connection->getDialect()->grammarEscape($this->collection->getName())}";
$wheres = array();
... | php | public function getStatement($type = null)
{
if (is_null($this->statement)) {
$this->buffer = array();
$this->next = false;
$sql = "SELECT * FROM {$this->connection->getDialect()->grammarEscape($this->collection->getName())}";
$wheres = array();
... | [
"public",
"function",
"getStatement",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"statement",
")",
")",
"{",
"$",
"this",
"->",
"buffer",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"next",
"=",
"fa... | Get query statement of current cursor.
@param mixed $type
@return \PDOStatement | [
"Get",
"query",
"statement",
"of",
"current",
"cursor",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Cursor/PDOCursor.php#L135-L188 |
ClanCats/Core | src/console/shipyard.php | shipyard.action_class | public function action_class( $params )
{
$options = \CCDataObject::assign( $params );
$name = $options->get( 0, null );
// get name if we dont have one
while( !$name )
{
$name = $this->read( 'Please enter the class name: ' );
}
// try to resolve the path
if ( !$path = \CCPath::classes( ... | php | public function action_class( $params )
{
$options = \CCDataObject::assign( $params );
$name = $options->get( 0, null );
// get name if we dont have one
while( !$name )
{
$name = $this->read( 'Please enter the class name: ' );
}
// try to resolve the path
if ( !$path = \CCPath::classes( ... | [
"public",
"function",
"action_class",
"(",
"$",
"params",
")",
"{",
"$",
"options",
"=",
"\\",
"CCDataObject",
"::",
"assign",
"(",
"$",
"params",
")",
";",
"$",
"name",
"=",
"$",
"options",
"->",
"get",
"(",
"0",
",",
"null",
")",
";",
"// get name ... | generate an class
exmample:
run shipyard::class <class>
run shipyard::class <namespace>::<class>
@param array $params
@return void | [
"generate",
"an",
"class"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/shipyard.php#L88-L126 |
ClanCats/Core | src/console/shipyard.php | shipyard.action_model | public function action_model( $params )
{
$options = \CCDataObject::assign( $params );
// params
$name = $options->get( 0, null );
$table = $options->get( 1, null );
// get name if we dont have one
while( !$name )
{
$name = $this->read( 'Please enter the class name: ' );
}
// get table... | php | public function action_model( $params )
{
$options = \CCDataObject::assign( $params );
// params
$name = $options->get( 0, null );
$table = $options->get( 1, null );
// get name if we dont have one
while( !$name )
{
$name = $this->read( 'Please enter the class name: ' );
}
// get table... | [
"public",
"function",
"action_model",
"(",
"$",
"params",
")",
"{",
"$",
"options",
"=",
"\\",
"CCDataObject",
"::",
"assign",
"(",
"$",
"params",
")",
";",
"// params",
"$",
"name",
"=",
"$",
"options",
"->",
"get",
"(",
"0",
",",
"null",
")",
";",
... | generate a model class
exmample:
run shipyard::model <class>
run shipyard::model <class> <table>
run shipyard::model <namespace>::<class>
@param array $params
@return void | [
"generate",
"a",
"model",
"class"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/shipyard.php#L139-L182 |
ClanCats/Core | src/console/shipyard.php | shipyard.action_controller | public function action_controller( $params )
{
$options = \CCDataObject::assign( $params );
$name = $options->get( 0, null );
$parent = $options->get( 1, null );
// get name if we dont have one
while( !$name )
{
$name = $this->read( 'Please enter the controller name: ' );
}
// fix contro... | php | public function action_controller( $params )
{
$options = \CCDataObject::assign( $params );
$name = $options->get( 0, null );
$parent = $options->get( 1, null );
// get name if we dont have one
while( !$name )
{
$name = $this->read( 'Please enter the controller name: ' );
}
// fix contro... | [
"public",
"function",
"action_controller",
"(",
"$",
"params",
")",
"{",
"$",
"options",
"=",
"\\",
"CCDataObject",
"::",
"assign",
"(",
"$",
"params",
")",
";",
"$",
"name",
"=",
"$",
"options",
"->",
"get",
"(",
"0",
",",
"null",
")",
";",
"$",
"... | generate an controller
exmample:
run shipyard::controller <controller>
run shipyard::controller <controller> <parent_class>
run shipyard::controller <namespace>::<controller>
@param array $params
@return void | [
"generate",
"an",
"controller"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/shipyard.php#L195-L270 |
ClanCats/Core | src/console/shipyard.php | shipyard.action_ship | public function action_ship( $params )
{
$options = \CCDataObject::assign( $params );
$name = $options->get( 0, null );
$namespace = $options->get( 1, null );
// get name if we dont have one
while( !$name )
{
$name = CCCli::read( 'Please enter the ship name: ' );
}
// set namespace
if... | php | public function action_ship( $params )
{
$options = \CCDataObject::assign( $params );
$name = $options->get( 0, null );
$namespace = $options->get( 1, null );
// get name if we dont have one
while( !$name )
{
$name = CCCli::read( 'Please enter the ship name: ' );
}
// set namespace
if... | [
"public",
"function",
"action_ship",
"(",
"$",
"params",
")",
"{",
"$",
"options",
"=",
"\\",
"CCDataObject",
"::",
"assign",
"(",
"$",
"params",
")",
";",
"$",
"name",
"=",
"$",
"options",
"->",
"get",
"(",
"0",
",",
"null",
")",
";",
"$",
"namesp... | generate ships
exmample:
run shipyard::ship <name>
run shipyard::ship <name> <namespace>
run shipyard::ship <name> --no-namespace
@param array $params
@return void | [
"generate",
"ships"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/shipyard.php#L283-L417 |
ClanCats/Core | src/console/shipyard.php | shipyard.make_comment_header | public function make_comment_header( $title, $data = array() ) {
// get author
$authors = \CCArr::get( 'authors', $data, \CCConfig::create( 'shipyard' )->get( 'defaults.authors' ) );
// author
if ( is_array( $authors ) )
{
foreach( $authors as $person )
{
$author_str .= $person['name']." ";
... | php | public function make_comment_header( $title, $data = array() ) {
// get author
$authors = \CCArr::get( 'authors', $data, \CCConfig::create( 'shipyard' )->get( 'defaults.authors' ) );
// author
if ( is_array( $authors ) )
{
foreach( $authors as $person )
{
$author_str .= $person['name']." ";
... | [
"public",
"function",
"make_comment_header",
"(",
"$",
"title",
",",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"// get author",
"$",
"authors",
"=",
"\\",
"CCArr",
"::",
"get",
"(",
"'authors'",
",",
"$",
"data",
",",
"\\",
"CCConfig",
"::",
"crea... | generates an file header string
@param string $title
@param array $data
@return string | [
"generates",
"an",
"file",
"header",
"string"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/console/shipyard.php#L426-L453 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBORuntimeBundle/Form/DataTransformer/EntityToIdTransformer.php | EntityToIdTransformer.transform | public function transform($item)
{
if (null === $item) {
return '';
}
$getter = 'get'.ucfirst($this->primaryKey);
if ($this->multiple && (is_array($item) || $item instanceof \Traversable)) {
$result = [];
foreach ($item as $it) {
... | php | public function transform($item)
{
if (null === $item) {
return '';
}
$getter = 'get'.ucfirst($this->primaryKey);
if ($this->multiple && (is_array($item) || $item instanceof \Traversable)) {
$result = [];
foreach ($item as $it) {
... | [
"public",
"function",
"transform",
"(",
"$",
"item",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"item",
")",
"{",
"return",
"''",
";",
"}",
"$",
"getter",
"=",
"'get'",
".",
"ucfirst",
"(",
"$",
"this",
"->",
"primaryKey",
")",
";",
"if",
"(",
"$",... | Transforms an object (issue) to a string (number).
@param object|array|null $item
@return string | [
"Transforms",
"an",
"object",
"(",
"issue",
")",
"to",
"a",
"string",
"(",
"number",
")",
"."
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Form/DataTransformer/EntityToIdTransformer.php#L71-L100 |
Sedona-Solutions/sedona-sbo | src/Sedona/SBORuntimeBundle/Form/DataTransformer/EntityToIdTransformer.php | EntityToIdTransformer.reverseTransform | public function reverseTransform($key)
{
if (!$key) {
return;
}
if ($this->multiple) {
$keys = explode($this->glue, $key);
$items = $this->om
->getRepository($this->class)
->findBy(array($this->primaryKey => $keys))
... | php | public function reverseTransform($key)
{
if (!$key) {
return;
}
if ($this->multiple) {
$keys = explode($this->glue, $key);
$items = $this->om
->getRepository($this->class)
->findBy(array($this->primaryKey => $keys))
... | [
"public",
"function",
"reverseTransform",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"key",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"multiple",
")",
"{",
"$",
"keys",
"=",
"explode",
"(",
"$",
"this",
"->",
"glue",
",",
... | Transforms a string (number) to an object (issue).
@param string $number
@return object|array|null
@throws TransformationFailedException if object (issue) is not found. | [
"Transforms",
"a",
"string",
"(",
"number",
")",
"to",
"an",
"object",
"(",
"issue",
")",
"."
] | train | https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Form/DataTransformer/EntityToIdTransformer.php#L111-L141 |
drsdre/yii2-xmlsoccer | Client.php | Client.init | public function init()
{
if (empty($this->serviceUrl)) {
throw new InvalidConfigException("service_url cannot be empty. Please configure.");
}
if (empty($this->apiKey)) {
throw new InvalidConfigException("api_key cannot be empty. Please configure.");
}
... | php | public function init()
{
if (empty($this->serviceUrl)) {
throw new InvalidConfigException("service_url cannot be empty. Please configure.");
}
if (empty($this->apiKey)) {
throw new InvalidConfigException("api_key cannot be empty. Please configure.");
}
... | [
"public",
"function",
"init",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"serviceUrl",
")",
")",
"{",
"throw",
"new",
"InvalidConfigException",
"(",
"\"service_url cannot be empty. Please configure.\"",
")",
";",
"}",
"if",
"(",
"empty",
"(",
... | Initialize component
@throws InvalidConfigException | [
"Initialize",
"component"
] | train | https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/Client.php#L114-L164 |
drsdre/yii2-xmlsoccer | Client.php | Client.getMethodArguments | protected function getMethodArguments($methodName)
{
if (!empty($this->_magicMethodArgumentNames)) {
return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
}
try {
$reflectionClass = new \ReflectionClass($this);
$comment = $reflec... | php | protected function getMethodArguments($methodName)
{
if (!empty($this->_magicMethodArgumentNames)) {
return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
}
try {
$reflectionClass = new \ReflectionClass($this);
$comment = $reflec... | [
"protected",
"function",
"getMethodArguments",
"(",
"$",
"methodName",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"_magicMethodArgumentNames",
")",
")",
"{",
"return",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"this",
"->",
"_magicMethodArgume... | Get argument names and positions and data types from phpdoc class comment
@param string $methodName method to get arguments from
@return mixed | [
"Get",
"argument",
"names",
"and",
"positions",
"and",
"data",
"types",
"from",
"phpdoc",
"class",
"comment"
] | train | https://github.com/drsdre/yii2-xmlsoccer/blob/a746edee6269ed0791bac6c6165a946adc30d994/Client.php#L269-L310 |
ClanCats/Core | src/bundles/Mail/PHPMailer/class.pop3.php | POP3.authorise | public function authorise($host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0)
{
$this->host = $host;
// If no port value provided, use default
if ($port === false) {
$this->port = $this->POP3_PORT;
} else {
$this->port = $por... | php | public function authorise($host, $port = false, $tval = false, $username = '', $password = '', $debug_level = 0)
{
$this->host = $host;
// If no port value provided, use default
if ($port === false) {
$this->port = $this->POP3_PORT;
} else {
$this->port = $por... | [
"public",
"function",
"authorise",
"(",
"$",
"host",
",",
"$",
"port",
"=",
"false",
",",
"$",
"tval",
"=",
"false",
",",
"$",
"username",
"=",
"''",
",",
"$",
"password",
"=",
"''",
",",
"$",
"debug_level",
"=",
"0",
")",
"{",
"$",
"this",
"->",... | Authenticate with a POP3 server.
A connect, login, disconnect sequence
appropriate for POP-before SMTP authorisation.
@access public
@param string $host
@param integer|boolean $port
@param integer|boolean $tval
@param string $username
@param string $password
@param integer $debug_level
@return boolean | [
"Authenticate",
"with",
"a",
"POP3",
"server",
".",
"A",
"connect",
"login",
"disconnect",
"sequence",
"appropriate",
"for",
"POP",
"-",
"before",
"SMTP",
"authorisation",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Mail/PHPMailer/class.pop3.php#L165-L197 |
fond-of/spryker-brand | src/FondOfSpryker/Client/Brand/Dependency/Client/BrandToZedRequestClientBridge.php | BrandToZedRequestClientBridge.call | public function call($url, TransferInterface $object, $requestOptions = null): TransferInterface
{
return $this->zedRequestClient->call($url, $object, $requestOptions);
} | php | public function call($url, TransferInterface $object, $requestOptions = null): TransferInterface
{
return $this->zedRequestClient->call($url, $object, $requestOptions);
} | [
"public",
"function",
"call",
"(",
"$",
"url",
",",
"TransferInterface",
"$",
"object",
",",
"$",
"requestOptions",
"=",
"null",
")",
":",
"TransferInterface",
"{",
"return",
"$",
"this",
"->",
"zedRequestClient",
"->",
"call",
"(",
"$",
"url",
",",
"$",
... | @param string $url
@param \Spryker\Shared\Kernel\Transfer\TransferInterface $object
@param array|null $requestOptions
@return \Spryker\Shared\Kernel\Transfer\TransferInterface | [
"@param",
"string",
"$url",
"@param",
"\\",
"Spryker",
"\\",
"Shared",
"\\",
"Kernel",
"\\",
"Transfer",
"\\",
"TransferInterface",
"$object",
"@param",
"array|null",
"$requestOptions"
] | train | https://github.com/fond-of/spryker-brand/blob/0ae25c381649b70845016606de9cf4e7dfdccffa/src/FondOfSpryker/Client/Brand/Dependency/Client/BrandToZedRequestClientBridge.php#L29-L32 |
andrelohmann/silverstripe-geolocation | code/models/fieldtypes/PostCodeLocation.php | PostCodeLocation.scaffoldFormField | public function scaffoldFormField($title = null) {
$field = new PostCodeLocationField($this->name);
$field->setLocale($this->getLocale());
return $field;
} | php | public function scaffoldFormField($title = null) {
$field = new PostCodeLocationField($this->name);
$field->setLocale($this->getLocale());
return $field;
} | [
"public",
"function",
"scaffoldFormField",
"(",
"$",
"title",
"=",
"null",
")",
"{",
"$",
"field",
"=",
"new",
"PostCodeLocationField",
"(",
"$",
"this",
"->",
"name",
")",
";",
"$",
"field",
"->",
"setLocale",
"(",
"$",
"this",
"->",
"getLocale",
"(",
... | Returns a CompositeField instance used as a default
for form scaffolding.
Used by {@link SearchContext}, {@link ModelAdmin}, {@link DataObject::scaffoldFormFields()}
@param string $title Optional. Localized title of the generated instance
@return FormField | [
"Returns",
"a",
"CompositeField",
"instance",
"used",
"as",
"a",
"default",
"for",
"form",
"scaffolding",
"."
] | train | https://github.com/andrelohmann/silverstripe-geolocation/blob/124062008d8fa25b631bf5bb69b2ca79b53ef81b/code/models/fieldtypes/PostCodeLocation.php#L243-L248 |
SachaMorard/phalcon-console | Library/Phalcon/Script/Color.php | Color.isSupportedShell | public static function isSupportedShell()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
}
return defined('STDOUT') && function_exists('posix_isatty') && posix_isatty(STDOUT);... | php | public static function isSupportedShell()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM');
}
return defined('STDOUT') && function_exists('posix_isatty') && posix_isatty(STDOUT);... | [
"public",
"static",
"function",
"isSupportedShell",
"(",
")",
"{",
"if",
"(",
"strtoupper",
"(",
"substr",
"(",
"PHP_OS",
",",
"0",
",",
"3",
")",
")",
"===",
"'WIN'",
")",
"{",
"return",
"false",
"!==",
"getenv",
"(",
"'ANSICON'",
")",
"||",
"'ON'",
... | Identify if console supports colors
@return boolean | [
"Identify",
"if",
"console",
"supports",
"colors"
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script/Color.php#L124-L131 |
SachaMorard/phalcon-console | Library/Phalcon/Script/Color.php | Color.colorize | public static function colorize($string, $fg = null, $at = null, $bg = null)
{
// Shell not supported, exit early
if (!static::isSupportedShell()) {
return $string;
}
$colored = '';
// Check if given foreground color is supported
if (isset(static::$_fg[$... | php | public static function colorize($string, $fg = null, $at = null, $bg = null)
{
// Shell not supported, exit early
if (!static::isSupportedShell()) {
return $string;
}
$colored = '';
// Check if given foreground color is supported
if (isset(static::$_fg[$... | [
"public",
"static",
"function",
"colorize",
"(",
"$",
"string",
",",
"$",
"fg",
"=",
"null",
",",
"$",
"at",
"=",
"null",
",",
"$",
"bg",
"=",
"null",
")",
"{",
"// Shell not supported, exit early",
"if",
"(",
"!",
"static",
"::",
"isSupportedShell",
"("... | Colorizes the string using provided colors.
@static
@param $string
@param null|integer $fg
@param null|integer $at
@param null|integer $bg
@return string | [
"Colorizes",
"the",
"string",
"using",
"provided",
"colors",
"."
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script/Color.php#L144-L172 |
SachaMorard/phalcon-console | Library/Phalcon/Script/Color.php | Color.error | public static function error($msg)
{
$msg = 'Error: ' . $msg;
$space = strlen($msg) + 4;
$out = static::colorize(str_pad(' ', $space), Color::FG_WHITE, Color::AT_BOLD, Color::BG_RED) . PHP_EOL;
$out .= static::colorize(' ' . $msg . ' ', Color::FG_WHITE, Color::AT_BOLD, Color::BG_R... | php | public static function error($msg)
{
$msg = 'Error: ' . $msg;
$space = strlen($msg) + 4;
$out = static::colorize(str_pad(' ', $space), Color::FG_WHITE, Color::AT_BOLD, Color::BG_RED) . PHP_EOL;
$out .= static::colorize(' ' . $msg . ' ', Color::FG_WHITE, Color::AT_BOLD, Color::BG_R... | [
"public",
"static",
"function",
"error",
"(",
"$",
"msg",
")",
"{",
"$",
"msg",
"=",
"'Error: '",
".",
"$",
"msg",
";",
"$",
"space",
"=",
"strlen",
"(",
"$",
"msg",
")",
"+",
"4",
";",
"$",
"out",
"=",
"static",
"::",
"colorize",
"(",
"str_pad",... | Color style for error messages.
@static
@param $msg
@return string | [
"Color",
"style",
"for",
"error",
"messages",
"."
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script/Color.php#L186-L195 |
SachaMorard/phalcon-console | Library/Phalcon/Script/Color.php | Color.success | public static function success($msg)
{
$msg = 'Success: ' . $msg;
$space = strlen($msg) + 4;
$out = static::colorize(str_pad(' ', $space), Color::FG_WHITE, Color::AT_BOLD, Color::BG_GREEN) . PHP_EOL;
$out .= static::colorize(' ' . $msg . ' ', Color::FG_WHITE, Color::AT_BOLD, Color... | php | public static function success($msg)
{
$msg = 'Success: ' . $msg;
$space = strlen($msg) + 4;
$out = static::colorize(str_pad(' ', $space), Color::FG_WHITE, Color::AT_BOLD, Color::BG_GREEN) . PHP_EOL;
$out .= static::colorize(' ' . $msg . ' ', Color::FG_WHITE, Color::AT_BOLD, Color... | [
"public",
"static",
"function",
"success",
"(",
"$",
"msg",
")",
"{",
"$",
"msg",
"=",
"'Success: '",
".",
"$",
"msg",
";",
"$",
"space",
"=",
"strlen",
"(",
"$",
"msg",
")",
"+",
"4",
";",
"$",
"out",
"=",
"static",
"::",
"colorize",
"(",
"str_p... | Color style for success messages.
@static
@param $msg
@return string | [
"Color",
"style",
"for",
"success",
"messages",
"."
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script/Color.php#L204-L213 |
SachaMorard/phalcon-console | Library/Phalcon/Script/Color.php | Color.info | public static function info($msg)
{
$msg = 'Info: ' . $msg;
$space = strlen($msg) + 4;
$out = static::colorize(str_pad(' ', $space), Color::FG_WHITE, Color::AT_BOLD, Color::BG_BLUE) . PHP_EOL;
$out .= static::colorize(' ' . $msg . ' ', Color::FG_WHITE, Color::AT_BOLD, Color::BG_BL... | php | public static function info($msg)
{
$msg = 'Info: ' . $msg;
$space = strlen($msg) + 4;
$out = static::colorize(str_pad(' ', $space), Color::FG_WHITE, Color::AT_BOLD, Color::BG_BLUE) . PHP_EOL;
$out .= static::colorize(' ' . $msg . ' ', Color::FG_WHITE, Color::AT_BOLD, Color::BG_BL... | [
"public",
"static",
"function",
"info",
"(",
"$",
"msg",
")",
"{",
"$",
"msg",
"=",
"'Info: '",
".",
"$",
"msg",
";",
"$",
"space",
"=",
"strlen",
"(",
"$",
"msg",
")",
"+",
"4",
";",
"$",
"out",
"=",
"static",
"::",
"colorize",
"(",
"str_pad",
... | Color style for info messages.
@static
@param $msg
@return string | [
"Color",
"style",
"for",
"info",
"messages",
"."
] | train | https://github.com/SachaMorard/phalcon-console/blob/a7922e4c488ea19bc0ecce793e6f01cf9cf3c0c3/Library/Phalcon/Script/Color.php#L222-L231 |
lmammino/e-foundation | src/Address/Model/Country.php | Country.setProvinces | public function setProvinces(Collection $provinces)
{
foreach ($provinces as $province) {
$this->addProvince($province);
}
return $this;
} | php | public function setProvinces(Collection $provinces)
{
foreach ($provinces as $province) {
$this->addProvince($province);
}
return $this;
} | [
"public",
"function",
"setProvinces",
"(",
"Collection",
"$",
"provinces",
")",
"{",
"foreach",
"(",
"$",
"provinces",
"as",
"$",
"province",
")",
"{",
"$",
"this",
"->",
"addProvince",
"(",
"$",
"province",
")",
";",
"}",
"return",
"$",
"this",
";",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Address/Model/Country.php#L89-L96 |
lmammino/e-foundation | src/Address/Model/Country.php | Country.addProvince | public function addProvince(ProvinceInterface $province)
{
if (!$this->hasProvince($province)) {
$province->setCountry($this);
$this->provinces->add($province);
}
return $this;
} | php | public function addProvince(ProvinceInterface $province)
{
if (!$this->hasProvince($province)) {
$province->setCountry($this);
$this->provinces->add($province);
}
return $this;
} | [
"public",
"function",
"addProvince",
"(",
"ProvinceInterface",
"$",
"province",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasProvince",
"(",
"$",
"province",
")",
")",
"{",
"$",
"province",
"->",
"setCountry",
"(",
"$",
"this",
")",
";",
"$",
"this... | {@inheritDoc} | [
"{"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Address/Model/Country.php#L101-L109 |
uthando-cms/uthando-dompdf | src/UthandoDomPdf/Service/DomPdfFactory.php | DomPdfFactory.createService | public function createService(ServiceLocatorInterface $serviceLocator)
{
/* @var DomPdfOptions $config */
$config = $serviceLocator->get(DomPdfOptions::class);
$options = $config->toArray();
return new Dompdf($options);
} | php | public function createService(ServiceLocatorInterface $serviceLocator)
{
/* @var DomPdfOptions $config */
$config = $serviceLocator->get(DomPdfOptions::class);
$options = $config->toArray();
return new Dompdf($options);
} | [
"public",
"function",
"createService",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
")",
"{",
"/* @var DomPdfOptions $config */",
"$",
"config",
"=",
"$",
"serviceLocator",
"->",
"get",
"(",
"DomPdfOptions",
"::",
"class",
")",
";",
"$",
"options",
"=",
... | Creates an instance of Dompdf.
@param ServiceLocatorInterface $serviceLocator
@return Dompdf | [
"Creates",
"an",
"instance",
"of",
"Dompdf",
"."
] | train | https://github.com/uthando-cms/uthando-dompdf/blob/60a750058c2db9ed167476192b20c7f544c32007/src/UthandoDomPdf/Service/DomPdfFactory.php#L31-L38 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Form/Type/TaxonChoiceType.php | TaxonChoiceType.buildView | public function buildView(FormView $view, FormInterface $form, array $options)
{
$rootLevel = 0;
/** @var ChoiceView $choice */
foreach ($view->vars['choices'] as $i => $choice) {
$dash = '— ';
if (0 === $i) {
$rootLevel = $choice->data->getLevel();
... | php | public function buildView(FormView $view, FormInterface $form, array $options)
{
$rootLevel = 0;
/** @var ChoiceView $choice */
foreach ($view->vars['choices'] as $i => $choice) {
$dash = '— ';
if (0 === $i) {
$rootLevel = $choice->data->getLevel();
... | [
"public",
"function",
"buildView",
"(",
"FormView",
"$",
"view",
",",
"FormInterface",
"$",
"form",
",",
"array",
"$",
"options",
")",
"{",
"$",
"rootLevel",
"=",
"0",
";",
"/** @var ChoiceView $choice */",
"foreach",
"(",
"$",
"view",
"->",
"vars",
"[",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Form/Type/TaxonChoiceType.php#L45-L64 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Form/Type/TaxonChoiceType.php | TaxonChoiceType.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults([
'choices' => function (Options $options) {
return $this->getTaxons($options['root'], $options['filter']);
},
'choice_value' => 'id',
... | php | public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefaults([
'choices' => function (Options $options) {
return $this->getTaxons($options['root'], $options['filter']);
},
'choice_value' => 'id',
... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"resolver",
"->",
"setDefaults",
"(",
"[",
"'choices'",
"=>",
"function",
"(",
"Options",
"$",
"options",
")",
"{",
"return",
"$",
"this",
"->",
"getTaxons",
"(... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Form/Type/TaxonChoiceType.php#L77-L102 |
phpmob/changmin | src/PhpMob/ChangMinBundle/Form/Type/TaxonChoiceType.php | TaxonChoiceType.getTaxons | private function getTaxons($rootCode = null, $filter = null)
{
$taxons = $this->taxonRepository->findNodesTreeSorted($rootCode);
if (null !== $filter) {
$taxons = array_filter($taxons, $filter);
}
return $taxons;
} | php | private function getTaxons($rootCode = null, $filter = null)
{
$taxons = $this->taxonRepository->findNodesTreeSorted($rootCode);
if (null !== $filter) {
$taxons = array_filter($taxons, $filter);
}
return $taxons;
} | [
"private",
"function",
"getTaxons",
"(",
"$",
"rootCode",
"=",
"null",
",",
"$",
"filter",
"=",
"null",
")",
"{",
"$",
"taxons",
"=",
"$",
"this",
"->",
"taxonRepository",
"->",
"findNodesTreeSorted",
"(",
"$",
"rootCode",
")",
";",
"if",
"(",
"null",
... | @param string|null $rootCode
@param callable|null $filter
@return TaxonInterface[] | [
"@param",
"string|null",
"$rootCode",
"@param",
"callable|null",
"$filter"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/ChangMinBundle/Form/Type/TaxonChoiceType.php#L110-L119 |
spiral-modules/scaffolder | source/Scaffolder/Commands/Database/DocumentCommand.php | DocumentCommand.perform | public function perform()
{
/** @var DocumentDeclaration $declaration */
$declaration = $this->createDeclaration();
foreach ($this->option('field') as $field) {
if (strpos($field, ':') === false) {
throw new ScaffolderException("Field definition must in 'name:typ... | php | public function perform()
{
/** @var DocumentDeclaration $declaration */
$declaration = $this->createDeclaration();
foreach ($this->option('field') as $field) {
if (strpos($field, ':') === false) {
throw new ScaffolderException("Field definition must in 'name:typ... | [
"public",
"function",
"perform",
"(",
")",
"{",
"/** @var DocumentDeclaration $declaration */",
"$",
"declaration",
"=",
"$",
"this",
"->",
"createDeclaration",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"option",
"(",
"'field'",
")",
"as",
"$",
"field"... | Create controller declaration. | [
"Create",
"controller",
"declaration",
"."
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Commands/Database/DocumentCommand.php#L36-L65 |
spiral-modules/scaffolder | source/Scaffolder/Commands/Database/DocumentCommand.php | DocumentCommand.defineOptions | protected function defineOptions(): array
{
return [
[
'field',
'f',
InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'Add field in a format "name:type"'
],
[
'collection',
... | php | protected function defineOptions(): array
{
return [
[
'field',
'f',
InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
'Add field in a format "name:type"'
],
[
'collection',
... | [
"protected",
"function",
"defineOptions",
"(",
")",
":",
"array",
"{",
"return",
"[",
"[",
"'field'",
",",
"'f'",
",",
"InputOption",
"::",
"VALUE_OPTIONAL",
"|",
"InputOption",
"::",
"VALUE_IS_ARRAY",
",",
"'Add field in a format \"name:type\"'",
"]",
",",
"[",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Commands/Database/DocumentCommand.php#L70-L104 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/RoleController.php | RoleController.store | public function store(Request $request)
{
$this->roles->create($request->only('name', 'label'));
return \Redirect::route('admin.roles.index', [
])->withMessage(trans('acl::role.roles-controller-successfully_created'));
} | php | public function store(Request $request)
{
$this->roles->create($request->only('name', 'label'));
return \Redirect::route('admin.roles.index', [
])->withMessage(trans('acl::role.roles-controller-successfully_created'));
} | [
"public",
"function",
"store",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"roles",
"->",
"create",
"(",
"$",
"request",
"->",
"only",
"(",
"'name'",
",",
"'label'",
")",
")",
";",
"return",
"\\",
"Redirect",
"::",
"route",
"(",
"'ad... | Store a newly created resource in storage.
@param \Illuminate\Http\Request $request
@return \Illuminate\Http\RedirectResponse | [
"Store",
"a",
"newly",
"created",
"resource",
"in",
"storage",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/RoleController.php#L56-L61 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/RoleController.php | RoleController.show | public function show($id)
{
$role = Role::with('permissions')->findOrFail($id);
return \View::make('admin.roles.show', compact('role'));
} | php | public function show($id)
{
$role = Role::with('permissions')->findOrFail($id);
return \View::make('admin.roles.show', compact('role'));
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"role",
"=",
"Role",
"::",
"with",
"(",
"'permissions'",
")",
"->",
"findOrFail",
"(",
"$",
"id",
")",
";",
"return",
"\\",
"View",
"::",
"make",
"(",
"'admin.roles.show'",
",",
"compact",
... | Display the specified resource.
@param int $id
@return \Illuminate\View\View | [
"Display",
"the",
"specified",
"resource",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/RoleController.php#L69-L73 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/RoleController.php | RoleController.edit | public function edit($id)
{
$role = $this->roles->findOrFail($id);
return \View::make('admin.roles.edit', [
'role' => $role,
'title' => 'edit',
]);
} | php | public function edit($id)
{
$role = $this->roles->findOrFail($id);
return \View::make('admin.roles.edit', [
'role' => $role,
'title' => 'edit',
]);
} | [
"public",
"function",
"edit",
"(",
"$",
"id",
")",
"{",
"$",
"role",
"=",
"$",
"this",
"->",
"roles",
"->",
"findOrFail",
"(",
"$",
"id",
")",
";",
"return",
"\\",
"View",
"::",
"make",
"(",
"'admin.roles.edit'",
",",
"[",
"'role'",
"=>",
"$",
"rol... | Show the form for editing the specified resource.
@param int $id
@return \Illuminate\View\View | [
"Show",
"the",
"form",
"for",
"editing",
"the",
"specified",
"resource",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/RoleController.php#L81-L88 |
meccado/acl-admin-control-panel | src/Http/Controllers/Admin/RoleController.php | RoleController.update | public function update(Request $request, $id)
{
$this->roles->findOrFail($id)->update($request->only('name', 'label'));
return \Redirect::route('admin.roles.index', [
])->withMessage(trans('acl::role.roles-controller-successfully_updated'));
} | php | public function update(Request $request, $id)
{
$this->roles->findOrFail($id)->update($request->only('name', 'label'));
return \Redirect::route('admin.roles.index', [
])->withMessage(trans('acl::role.roles-controller-successfully_updated'));
} | [
"public",
"function",
"update",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"roles",
"->",
"findOrFail",
"(",
"$",
"id",
")",
"->",
"update",
"(",
"$",
"request",
"->",
"only",
"(",
"'name'",
",",
"'label'",
")",
")... | Update the specified resource in storage.
@param \Illuminate\Http\Request $request
@param int $id
@return \Illuminate\Http\RedirectResponse | [
"Update",
"the",
"specified",
"resource",
"in",
"storage",
"."
] | train | https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/RoleController.php#L97-L102 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.