repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.getProperty | public function getProperty($id, $name, $directAccess = false)
{
if ($directAccess) {
if (!isset($this->items[$id][$name])) {
return null;
}
return $this->items[$id][$name];
}
$id = $this->validateAndResolveId($id);
if (!isset($th... | php | public function getProperty($id, $name, $directAccess = false)
{
if ($directAccess) {
if (!isset($this->items[$id][$name])) {
return null;
}
return $this->items[$id][$name];
}
$id = $this->validateAndResolveId($id);
if (!isset($th... | [
"public",
"function",
"getProperty",
"(",
"$",
"id",
",",
"$",
"name",
",",
"$",
"directAccess",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"directAccess",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"id",
"]",
"[",... | Gets a value of an additional property for the layout item
@param string $id The id or alias of the layout item
@param string $name The property name
@param bool $directAccess Indicated whether the item id and property name validation should be skipped.
This flag can be used to increase performance... | [
"Gets",
"a",
"value",
"of",
"an",
"additional",
"property",
"for",
"the",
"layout",
"item"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L352-L370 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.setProperty | public function setProperty($id, $name, $value)
{
$id = $this->validateAndResolveId($id);
$this->items[$id][$name] = $value;
} | php | public function setProperty($id, $name, $value)
{
$id = $this->validateAndResolveId($id);
$this->items[$id][$name] = $value;
} | [
"public",
"function",
"setProperty",
"(",
"$",
"id",
",",
"$",
"name",
",",
"$",
"value",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"validateAndResolveId",
"(",
"$",
"id",
")",
";",
"$",
"this",
"->",
"items",
"[",
"$",
"id",
"]",
"[",
"$",
... | Sets a value of an additional property for the layout item
@param string $id The id or alias of the layout item
@param string $name The property name
@param mixed $value The property value
@throws Exception\InvalidArgumentException if the id is empty
@throws Exception\ItemNotFoundException if the layout item doe... | [
"Sets",
"a",
"value",
"of",
"an",
"additional",
"property",
"for",
"the",
"layout",
"item"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L382-L387 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.addAlias | public function addAlias($alias, $id)
{
$this->validateAlias($alias, true);
$this->validateId($id, true);
// perform additional validations
if ($alias === $id) {
throw new Exception\LogicException(
sprintf(
'The "%s" sting cannot be use... | php | public function addAlias($alias, $id)
{
$this->validateAlias($alias, true);
$this->validateId($id, true);
// perform additional validations
if ($alias === $id) {
throw new Exception\LogicException(
sprintf(
'The "%s" sting cannot be use... | [
"public",
"function",
"addAlias",
"(",
"$",
"alias",
",",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"validateAlias",
"(",
"$",
"alias",
",",
"true",
")",
";",
"$",
"this",
"->",
"validateId",
"(",
"$",
"id",
",",
"true",
")",
";",
"// perform additiona... | Creates an alias for the specified layout item
@param string $alias A string that can be used to access to the layout item instead of its id
@param string $id The layout item id
@throws Exception\InvalidArgumentException if the alias or id are empty or invalid
@throws Exception\ItemNotFoundException if the layout ... | [
"Creates",
"an",
"alias",
"for",
"the",
"specified",
"layout",
"item"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L412-L442 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.removeAlias | public function removeAlias($alias)
{
$this->validateAlias($alias);
if (!$this->aliases->has($alias)) {
throw new Exception\AliasNotFoundException(sprintf('The "%s" item alias does not exist.', $alias));
}
$this->aliases->remove($alias);
} | php | public function removeAlias($alias)
{
$this->validateAlias($alias);
if (!$this->aliases->has($alias)) {
throw new Exception\AliasNotFoundException(sprintf('The "%s" item alias does not exist.', $alias));
}
$this->aliases->remove($alias);
} | [
"public",
"function",
"removeAlias",
"(",
"$",
"alias",
")",
"{",
"$",
"this",
"->",
"validateAlias",
"(",
"$",
"alias",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"aliases",
"->",
"has",
"(",
"$",
"alias",
")",
")",
"{",
"throw",
"new",
"Excepti... | Removes the layout item alias
@param string $alias The layout item alias
@throws Exception\InvalidArgumentException if the alias is empty
@throws Exception\AliasNotFoundException if the alias does not exist | [
"Removes",
"the",
"layout",
"item",
"alias"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L452-L460 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.setBlockTheme | public function setBlockTheme($id, $themes)
{
$id = $this->validateAndResolveId($id);
if (empty($themes)) {
throw new Exception\InvalidArgumentException('The theme must not be empty.');
}
if (!is_string($themes) && !is_array($themes)) {
throw new Exception\Une... | php | public function setBlockTheme($id, $themes)
{
$id = $this->validateAndResolveId($id);
if (empty($themes)) {
throw new Exception\InvalidArgumentException('The theme must not be empty.');
}
if (!is_string($themes) && !is_array($themes)) {
throw new Exception\Une... | [
"public",
"function",
"setBlockTheme",
"(",
"$",
"id",
",",
"$",
"themes",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"validateAndResolveId",
"(",
"$",
"id",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"themes",
")",
")",
"{",
"throw",
"new",
"Except... | Sets the theme(s) to be used for rendering the layout item and its children
@param string $id The id of the layout item to assign the theme(s) to
@param string|string[] $themes The theme(s). For example 'MyBundle:Layout:my_theme.html.twig'
@return self | [
"Sets",
"the",
"theme",
"(",
"s",
")",
"to",
"be",
"used",
"for",
"rendering",
"the",
"layout",
"item",
"and",
"its",
"children"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L503-L517 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.setFormTheme | public function setFormTheme($themes)
{
if (empty($themes)) {
throw new Exception\InvalidArgumentException('The theme must not be empty.');
}
if (!is_string($themes) && !is_array($themes)) {
throw new Exception\UnexpectedTypeException($themes, 'string or array of stri... | php | public function setFormTheme($themes)
{
if (empty($themes)) {
throw new Exception\InvalidArgumentException('The theme must not be empty.');
}
if (!is_string($themes) && !is_array($themes)) {
throw new Exception\UnexpectedTypeException($themes, 'string or array of stri... | [
"public",
"function",
"setFormTheme",
"(",
"$",
"themes",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"themes",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"'The theme must not be empty.'",
")",
";",
"}",
"if",
"(",
"!",
... | Sets the theme(s) to be used for rendering the layout item and its children
@param string|string[] $themes The theme(s). For example 'MyBundle:Layout:my_theme.html.twig'
@return self | [
"Sets",
"the",
"theme",
"(",
"s",
")",
"to",
"be",
"used",
"for",
"rendering",
"the",
"layout",
"item",
"and",
"its",
"children"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L542-L552 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.getHierarchy | public function getHierarchy($id)
{
$path = $this->getProperty($id, self::PATH);
return $this->hierarchy->get($path);
} | php | public function getHierarchy($id)
{
$path = $this->getProperty($id, self::PATH);
return $this->hierarchy->get($path);
} | [
"public",
"function",
"getHierarchy",
"(",
"$",
"id",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"getProperty",
"(",
"$",
"id",
",",
"self",
"::",
"PATH",
")",
";",
"return",
"$",
"this",
"->",
"hierarchy",
"->",
"get",
"(",
"$",
"path",
")",
... | Returns the layout items hierarchy from the given path
@param string $id The id or alias of the layout item
@return array
@throws Exception\InvalidArgumentException if the id is empty
@throws Exception\ItemNotFoundException if the layout item does not exist | [
"Returns",
"the",
"layout",
"items",
"hierarchy",
"from",
"the",
"given",
"path"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L564-L569 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.getHierarchyIterator | public function getHierarchyIterator($id)
{
$id = $this->validateAndResolveId($id);
$children = $this->hierarchy->get($this->getProperty($id, self::PATH, true));
return new HierarchyIterator($id, $children);
} | php | public function getHierarchyIterator($id)
{
$id = $this->validateAndResolveId($id);
$children = $this->hierarchy->get($this->getProperty($id, self::PATH, true));
return new HierarchyIterator($id, $children);
} | [
"public",
"function",
"getHierarchyIterator",
"(",
"$",
"id",
")",
"{",
"$",
"id",
"=",
"$",
"this",
"->",
"validateAndResolveId",
"(",
"$",
"id",
")",
";",
"$",
"children",
"=",
"$",
"this",
"->",
"hierarchy",
"->",
"get",
"(",
"$",
"this",
"->",
"g... | Returns an iterator which can be used to get ids of all children of the given item
The iteration is performed from parent to child
@param string $id The id or alias of the layout item
@return HierarchyIterator
@throws Exception\InvalidArgumentException if the id is empty
@throws Exception\ItemNotFoundException if th... | [
"Returns",
"an",
"iterator",
"which",
"can",
"be",
"used",
"to",
"get",
"ids",
"of",
"all",
"children",
"of",
"the",
"given",
"item",
"The",
"iteration",
"is",
"performed",
"from",
"parent",
"to",
"child"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L582-L588 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.validateId | protected function validateId($id, $fullCheck = false)
{
if (!$id) {
throw new Exception\InvalidArgumentException('The item id must not be empty.');
}
if ($fullCheck) {
if (!is_string($id)) {
throw new Exception\UnexpectedTypeException($id, 'string', '... | php | protected function validateId($id, $fullCheck = false)
{
if (!$id) {
throw new Exception\InvalidArgumentException('The item id must not be empty.');
}
if ($fullCheck) {
if (!is_string($id)) {
throw new Exception\UnexpectedTypeException($id, 'string', '... | [
"protected",
"function",
"validateId",
"(",
"$",
"id",
",",
"$",
"fullCheck",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"id",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"'The item id must not be empty.'",
")",
";",
"}",
... | Checks if the given value can be used as the layout item id
@param string $id The layout item id
@param bool $fullCheck Determines whether all validation rules should be applied
or it is required to validate for empty value only
@throws Exception\InvalidArgumentException if the id is not valid | [
"Checks",
"if",
"the",
"given",
"value",
"can",
"be",
"used",
"as",
"the",
"layout",
"item",
"id"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L636-L656 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.validateAndResolveId | protected function validateAndResolveId($id)
{
$this->validateId($id);
$id = $this->resolveId($id);
if (!isset($this->items[$id])) {
throw new Exception\ItemNotFoundException(sprintf('The "%s" item does not exist.', $id));
}
return $id;
} | php | protected function validateAndResolveId($id)
{
$this->validateId($id);
$id = $this->resolveId($id);
if (!isset($this->items[$id])) {
throw new Exception\ItemNotFoundException(sprintf('The "%s" item does not exist.', $id));
}
return $id;
} | [
"protected",
"function",
"validateAndResolveId",
"(",
"$",
"id",
")",
"{",
"$",
"this",
"->",
"validateId",
"(",
"$",
"id",
")",
";",
"$",
"id",
"=",
"$",
"this",
"->",
"resolveId",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"th... | Checks the layout item id for empty and returns real id
Also this method raises an exception if the layout item does not exist
@param string $id The layout item id
@return string The resolved item id
@throws Exception\InvalidArgumentException if the id is empty
@throws Exception\ItemNotFoundException if the layout i... | [
"Checks",
"the",
"layout",
"item",
"id",
"for",
"empty",
"and",
"returns",
"real",
"id",
"Also",
"this",
"method",
"raises",
"an",
"exception",
"if",
"the",
"layout",
"item",
"does",
"not",
"exist"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L669-L678 |
oroinc/OroLayoutComponent | RawLayout.php | RawLayout.validateAlias | protected function validateAlias($alias, $fullCheck = false)
{
if (!$alias) {
throw new Exception\InvalidArgumentException('The item alias must not be empty.');
}
if ($fullCheck) {
if (!is_string($alias)) {
throw new Exception\UnexpectedTypeException($... | php | protected function validateAlias($alias, $fullCheck = false)
{
if (!$alias) {
throw new Exception\InvalidArgumentException('The item alias must not be empty.');
}
if ($fullCheck) {
if (!is_string($alias)) {
throw new Exception\UnexpectedTypeException($... | [
"protected",
"function",
"validateAlias",
"(",
"$",
"alias",
",",
"$",
"fullCheck",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"alias",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"InvalidArgumentException",
"(",
"'The item alias must not be empty.'",
")",
... | Checks if the given value can be used as an alias for the layout item
@param string $alias The layout item alias
@param bool $fullCheck Determines whether all validation rules should be applied
or it is required to validate for empty value only
@throws Exception\InvalidArgumentException if the alias is not vali... | [
"Checks",
"if",
"the",
"given",
"value",
"can",
"be",
"used",
"as",
"an",
"alias",
"for",
"the",
"layout",
"item"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/RawLayout.php#L689-L709 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Commands/Install.php | InstallCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setupEnvironment('administrator', $input, $output);
// Enable debug, so that JInstaller::install() throws exceptions on problems
$this->joomla->setCfg('debug', 1);
$installer = \JInstaller::getInstance();
if ($installer->i... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setupEnvironment('administrator', $input, $output);
// Enable debug, so that JInstaller::install() throws exceptions on problems
$this->joomla->setCfg('debug', 1);
$installer = \JInstaller::getInstance();
if ($installer->i... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"setupEnvironment",
"(",
"'administrator'",
",",
"$",
"input",
",",
"$",
"output",
")",
";",
"// Enable debug, so that JI... | Execute the install command
@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInterface instance
@return integer 0 if everything went fine, 1 on error | [
"Execute",
"the",
"install",
"command"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Commands/Install.php#L74-L95 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Commands/Install.php | InstallCommand.handleExtension | protected function handleExtension(InputInterface $input, OutputInterface $output)
{
$source = $input->getArgument('extension');
if (strpos($source, '://'))
{
$tmpPath = $this->handleDownload($output, $source);
}
elseif (is_dir($source))
{
$tmpPath = $this->handleDirectory($output, $source);
}
e... | php | protected function handleExtension(InputInterface $input, OutputInterface $output)
{
$source = $input->getArgument('extension');
if (strpos($source, '://'))
{
$tmpPath = $this->handleDownload($output, $source);
}
elseif (is_dir($source))
{
$tmpPath = $this->handleDirectory($output, $source);
}
e... | [
"protected",
"function",
"handleExtension",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"source",
"=",
"$",
"input",
"->",
"getArgument",
"(",
"'extension'",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
"source",
... | Handle the specified extension
An extension can be provided as a download, a directory, or an archive.
This method prepares the installation by providing the extension in a
temporary directory ready for install.
@param InputInterface $input An InputInterface instance
@param OutputInterface $output An OutputInter... | [
"Handle",
"the",
"specified",
"extension",
"An",
"extension",
"can",
"be",
"provided",
"as",
"a",
"download",
"a",
"directory",
"or",
"an",
"archive",
".",
"This",
"method",
"prepares",
"the",
"installation",
"by",
"providing",
"the",
"extension",
"in",
"a",
... | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Commands/Install.php#L108-L126 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Commands/Install.php | InstallCommand.getExtensionInfo | private function getExtensionInfo($installer)
{
$manifest = $installer->getManifest();
$data = $this->joomla->getExtensionInfo($manifest);
$message = array(
'Installed ' . $data['type'] . ' <info>' . $data['name'] . '</info> version <info>' . $data['version'] . '</info>',
'',
wordwrap($data['descri... | php | private function getExtensionInfo($installer)
{
$manifest = $installer->getManifest();
$data = $this->joomla->getExtensionInfo($manifest);
$message = array(
'Installed ' . $data['type'] . ' <info>' . $data['name'] . '</info> version <info>' . $data['version'] . '</info>',
'',
wordwrap($data['descri... | [
"private",
"function",
"getExtensionInfo",
"(",
"$",
"installer",
")",
"{",
"$",
"manifest",
"=",
"$",
"installer",
"->",
"getManifest",
"(",
")",
";",
"$",
"data",
"=",
"$",
"this",
"->",
"joomla",
"->",
"getExtensionInfo",
"(",
"$",
"manifest",
")",
";... | Get information about the installed extension
@param \JInstaller $installer
@return array A message array suitable for OutputInterface::write[ln] | [
"Get",
"information",
"about",
"the",
"installed",
"extension"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Commands/Install.php#L135-L148 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Commands/Install.php | InstallCommand.handleDownload | private function handleDownload(OutputInterface $output, $source)
{
$this->writeln($output, "Downloading $source", OutputInterface::VERBOSITY_VERBOSE);
return $this->unpack(\JInstallerHelper::downloadPackage($source));
} | php | private function handleDownload(OutputInterface $output, $source)
{
$this->writeln($output, "Downloading $source", OutputInterface::VERBOSITY_VERBOSE);
return $this->unpack(\JInstallerHelper::downloadPackage($source));
} | [
"private",
"function",
"handleDownload",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"writeln",
"(",
"$",
"output",
",",
"\"Downloading $source\"",
",",
"OutputInterface",
"::",
"VERBOSITY_VERBOSE",
")",
";",
"return",... | Prepare the installation for an extension specified by a URL
@param OutputInterface $output An OutputInterface instance
@param string $source The extension source
@return string The location of the prepared extension | [
"Prepare",
"the",
"installation",
"for",
"an",
"extension",
"specified",
"by",
"a",
"URL"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Commands/Install.php#L158-L163 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Commands/Install.php | InstallCommand.handleDirectory | private function handleDirectory(OutputInterface $output, $source)
{
$tmpDir = $this->joomla->getCfg('tmp_path');
$tmpPath = $tmpDir . '/' . uniqid('install_');
$this->writeln($output, "Copying $source", OutputInterface::VERBOSITY_VERBOSE);
mkdir($tmpPath);
copy($source, $tmpPath);
return $tmpPath;
} | php | private function handleDirectory(OutputInterface $output, $source)
{
$tmpDir = $this->joomla->getCfg('tmp_path');
$tmpPath = $tmpDir . '/' . uniqid('install_');
$this->writeln($output, "Copying $source", OutputInterface::VERBOSITY_VERBOSE);
mkdir($tmpPath);
copy($source, $tmpPath);
return $tmpPath;
} | [
"private",
"function",
"handleDirectory",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"source",
")",
"{",
"$",
"tmpDir",
"=",
"$",
"this",
"->",
"joomla",
"->",
"getCfg",
"(",
"'tmp_path'",
")",
";",
"$",
"tmpPath",
"=",
"$",
"tmpDir",
".",
"'/'",
... | Prepare the installation for an extension specified by a directory
@param OutputInterface $output An OutputInterface instance
@param string $source The extension source
@return string The location of the prepared extension | [
"Prepare",
"the",
"installation",
"for",
"an",
"extension",
"specified",
"by",
"a",
"directory"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Commands/Install.php#L173-L183 |
GreenCape/joomla-cli | src/GreenCape/JoomlaCLI/Commands/Install.php | InstallCommand.handleArchive | private function handleArchive(OutputInterface $output, $source)
{
$tmpDir = $this->joomla->getCfg('tmp_path');
$tmpPath = $tmpDir . '/' . basename($source);
$this->writeln($output, "Extracting $source", OutputInterface::VERBOSITY_VERBOSE);
copy($source, $tmpPath);
return $this->unpack($tmpPath);
} | php | private function handleArchive(OutputInterface $output, $source)
{
$tmpDir = $this->joomla->getCfg('tmp_path');
$tmpPath = $tmpDir . '/' . basename($source);
$this->writeln($output, "Extracting $source", OutputInterface::VERBOSITY_VERBOSE);
copy($source, $tmpPath);
return $this->unpack($tmpPath);
} | [
"private",
"function",
"handleArchive",
"(",
"OutputInterface",
"$",
"output",
",",
"$",
"source",
")",
"{",
"$",
"tmpDir",
"=",
"$",
"this",
"->",
"joomla",
"->",
"getCfg",
"(",
"'tmp_path'",
")",
";",
"$",
"tmpPath",
"=",
"$",
"tmpDir",
".",
"'/'",
"... | Prepare the installation for an extension in an archive
@param OutputInterface $output An OutputInterface instance
@param string $source The extension source
@return string The location of the prepared extension | [
"Prepare",
"the",
"installation",
"for",
"an",
"extension",
"in",
"an",
"archive"
] | train | https://github.com/GreenCape/joomla-cli/blob/74a6940f27b1f66c99330d4f9e2c5ac314cdd369/src/GreenCape/JoomlaCLI/Commands/Install.php#L193-L202 |
heidelpay/PhpDoc | src/phpDocumentor/Partials/ServiceProvider.php | ServiceProvider.register | public function register(Application $app)
{
/** @var Translator $translator */
$translator = $app['translator'];
$translator->addTranslationFolder(__DIR__ . DIRECTORY_SEPARATOR . 'Messages');
/** @var ApplicationConfiguration $config */
$config = $app['config'];
$... | php | public function register(Application $app)
{
/** @var Translator $translator */
$translator = $app['translator'];
$translator->addTranslationFolder(__DIR__ . DIRECTORY_SEPARATOR . 'Messages');
/** @var ApplicationConfiguration $config */
$config = $app['config'];
$... | [
"public",
"function",
"register",
"(",
"Application",
"$",
"app",
")",
"{",
"/** @var Translator $translator */",
"$",
"translator",
"=",
"$",
"app",
"[",
"'translator'",
"]",
";",
"$",
"translator",
"->",
"addTranslationFolder",
"(",
"__DIR__",
".",
"DIRECTORY_S... | Registers services on the given app.
@param Application $app An Application instance
@throws Exception\MissingNameForPartialException if a partial has no name provided.
@return void | [
"Registers",
"services",
"on",
"the",
"given",
"app",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Partials/ServiceProvider.php#L34-L70 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.setCustomerId | public function setCustomerId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->customer_id !== $v) {
$this->customer_id = $v;
$this->modifiedColumns[CustomerCustomerGroupTableMap::CUSTOMER_ID] = true;
}
if ($this->aCustomer !== null &... | php | public function setCustomerId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->customer_id !== $v) {
$this->customer_id = $v;
$this->modifiedColumns[CustomerCustomerGroupTableMap::CUSTOMER_ID] = true;
}
if ($this->aCustomer !== null &... | [
"public",
"function",
"setCustomerId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"customer_id",
"!==",
"$",
"v",
")",
"{",
"$",
"... | Set the value of [customer_id] column.
@param int $v new value
@return \CustomerGroup\Model\CustomerCustomerGroup The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"customer_id",
"]",
"column",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L374-L391 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.setCustomerGroupId | public function setCustomerGroupId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->customer_group_id !== $v) {
$this->customer_group_id = $v;
$this->modifiedColumns[CustomerCustomerGroupTableMap::CUSTOMER_GROUP_ID] = true;
}
if ($thi... | php | public function setCustomerGroupId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->customer_group_id !== $v) {
$this->customer_group_id = $v;
$this->modifiedColumns[CustomerCustomerGroupTableMap::CUSTOMER_GROUP_ID] = true;
}
if ($thi... | [
"public",
"function",
"setCustomerGroupId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"customer_group_id",
"!==",
"$",
"v",
")",
"{",... | Set the value of [customer_group_id] column.
@param int $v new value
@return \CustomerGroup\Model\CustomerCustomerGroup The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"customer_group_id",
"]",
"column",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L399-L416 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CustomerCustomerGroupTableMap::translateFieldName('CustomerId', TableMap::TYPE_PHPNAME, $indexType)];
$this->cust... | php | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : CustomerCustomerGroupTableMap::translateFieldName('CustomerId', TableMap::TYPE_PHPNAME, $indexType)];
$this->cust... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
",",
"$",
"indexType",
"=",
"TableMap",
"::",
"TYPE_NUM",
")",
"{",
"try",
"{",
"$",
"col",
"=",
"$",
"row",
"[",
"TableMap",
"::... | Hydrates (populates) the object variables with values from the database resultset.
An offset (0-based "start column") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows. This is needed, for example,
for results of JOIN queries where the resultset row includes columns from ... | [
"Hydrates",
"(",
"populates",
")",
"the",
"object",
"variables",
"with",
"values",
"from",
"the",
"database",
"resultset",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L450-L473 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.ensureConsistency | public function ensureConsistency()
{
if ($this->aCustomer !== null && $this->customer_id !== $this->aCustomer->getId()) {
$this->aCustomer = null;
}
if ($this->aCustomerGroup !== null && $this->customer_group_id !== $this->aCustomerGroup->getId()) {
$this->aCustomerG... | php | public function ensureConsistency()
{
if ($this->aCustomer !== null && $this->customer_id !== $this->aCustomer->getId()) {
$this->aCustomer = null;
}
if ($this->aCustomerGroup !== null && $this->customer_group_id !== $this->aCustomerGroup->getId()) {
$this->aCustomerG... | [
"public",
"function",
"ensureConsistency",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aCustomer",
"!==",
"null",
"&&",
"$",
"this",
"->",
"customer_id",
"!==",
"$",
"this",
"->",
"aCustomer",
"->",
"getId",
"(",
")",
")",
"{",
"$",
"this",
"->",
"... | Checks and repairs the internal consistency of the object.
This method is executed after an already-instantiated object is re-hydrated
from the database. It exists to check any foreign keys to make sure that
the objects related to the current object are correct based on foreign key.
You can override this method in t... | [
"Checks",
"and",
"repairs",
"the",
"internal",
"consistency",
"of",
"the",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L488-L496 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.doInsert | protected function doInsert(ConnectionInterface $con)
{
$modifiedColumns = array();
$index = 0;
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(CustomerCustomerGroupTableMap::CUSTOMER_ID)) {
$modifiedColumns[':p' . $index... | php | protected function doInsert(ConnectionInterface $con)
{
$modifiedColumns = array();
$index = 0;
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(CustomerCustomerGroupTableMap::CUSTOMER_ID)) {
$modifiedColumns[':p' . $index... | [
"protected",
"function",
"doInsert",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"$",
"modifiedColumns",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"// check the columns in natural order for more readable SQL queries",
"if",
"(",
"$",
"this",
... | Insert the row in the database.
@param ConnectionInterface $con
@throws PropelException
@see doSave() | [
"Insert",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L693-L732 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.toArray | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['CustomerCustomerGroup'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$a... | php | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['CustomerCustomerGroup'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$a... | [
"public",
"function",
"toArray",
"(",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"array",
"(",
")",
",",
"$",
"includeForeignObjects",
"=",
"false",
")",
"{",
... | Exports the object as an array.
You can specify the key type of the array by passing one of the class
type constants.
@param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
Defau... | [
"Exports",
"the",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L805-L831 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.setByPosition | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setCustomerId($value);
break;
case 1:
$this->setCustomerGroupId($value);
break;
} // switch()
} | php | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setCustomerId($value);
break;
case 1:
$this->setCustomerGroupId($value);
break;
} // switch()
} | [
"public",
"function",
"setByPosition",
"(",
"$",
"pos",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"$",
"this",
"->",
"setCustomerId",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"1",
":",
"$",
"thi... | Sets a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@param mixed $value field value
@return void | [
"Sets",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L859-L869 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.fromArray | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = CustomerCustomerGroupTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setCustomerId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCustomerGroupId($arr[$keys[1]]);
... | php | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = CustomerCustomerGroupTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setCustomerId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setCustomerGroupId($arr[$keys[1]]);
... | [
"public",
"function",
"fromArray",
"(",
"$",
"arr",
",",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"keys",
"=",
"CustomerCustomerGroupTableMap",
"::",
"getFieldNames",
"(",
"$",
"keyType",
")",
";",
"if",
"(",
"array_key_exists",
... | Populates the object using an array.
This is particularly useful when populating an object from one of the
request arrays (e.g. $_POST). This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.
You can specify... | [
"Populates",
"the",
"object",
"using",
"an",
"array",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L888-L894 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(CustomerCustomerGroupTableMap::DATABASE_NAME);
if ($this->isColumnModified(CustomerCustomerGroupTableMap::CUSTOMER_ID)) $criteria->add(CustomerCustomerGroupTableMap::CUSTOMER_ID, $this->customer_id);
if ($this->isColumnModified(Cust... | php | public function buildCriteria()
{
$criteria = new Criteria(CustomerCustomerGroupTableMap::DATABASE_NAME);
if ($this->isColumnModified(CustomerCustomerGroupTableMap::CUSTOMER_ID)) $criteria->add(CustomerCustomerGroupTableMap::CUSTOMER_ID, $this->customer_id);
if ($this->isColumnModified(Cust... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"CustomerCustomerGroupTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"CustomerCustomerGroupTableMap",
"::",
"CUS... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L901-L909 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.buildPkeyCriteria | public function buildPkeyCriteria()
{
$criteria = new Criteria(CustomerCustomerGroupTableMap::DATABASE_NAME);
$criteria->add(CustomerCustomerGroupTableMap::CUSTOMER_ID, $this->customer_id);
$criteria->add(CustomerCustomerGroupTableMap::CUSTOMER_GROUP_ID, $this->customer_group_id);
r... | php | public function buildPkeyCriteria()
{
$criteria = new Criteria(CustomerCustomerGroupTableMap::DATABASE_NAME);
$criteria->add(CustomerCustomerGroupTableMap::CUSTOMER_ID, $this->customer_id);
$criteria->add(CustomerCustomerGroupTableMap::CUSTOMER_GROUP_ID, $this->customer_group_id);
r... | [
"public",
"function",
"buildPkeyCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"CustomerCustomerGroupTableMap",
"::",
"DATABASE_NAME",
")",
";",
"$",
"criteria",
"->",
"add",
"(",
"CustomerCustomerGroupTableMap",
"::",
"CUSTOMER_ID",
",",
... | Builds a Criteria object containing the primary key for this object.
Unlike buildCriteria() this method includes the primary key values regardless
of whether or not they have been modified.
@return Criteria The Criteria object containing value(s) for primary key(s). | [
"Builds",
"a",
"Criteria",
"object",
"containing",
"the",
"primary",
"key",
"for",
"this",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L919-L926 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.copyInto | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setCustomerId($this->getCustomerId());
$copyObj->setCustomerGroupId($this->getCustomerGroupId());
if ($makeNew) {
$copyObj->setNew(true);
}
} | php | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setCustomerId($this->getCustomerId());
$copyObj->setCustomerGroupId($this->getCustomerGroupId());
if ($makeNew) {
$copyObj->setNew(true);
}
} | [
"public",
"function",
"copyInto",
"(",
"$",
"copyObj",
",",
"$",
"deepCopy",
"=",
"false",
",",
"$",
"makeNew",
"=",
"true",
")",
"{",
"$",
"copyObj",
"->",
"setCustomerId",
"(",
"$",
"this",
"->",
"getCustomerId",
"(",
")",
")",
";",
"$",
"copyObj",
... | Sets contents of passed object to values from current object.
If desired, this method can also make copies of all associated (fkey referrers)
objects.
@param object $copyObj An object of \CustomerGroup\Model\CustomerCustomerGroup (or compatible) type.
@param boolean $deepCopy Whether to also copy all rows t... | [
"Sets",
"contents",
"of",
"passed",
"object",
"to",
"values",
"from",
"current",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L975-L982 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.setCustomer | public function setCustomer(ChildCustomer $v = null)
{
if ($v === null) {
$this->setCustomerId(NULL);
} else {
$this->setCustomerId($v->getId());
}
$this->aCustomer = $v;
// Add binding for other direction of this n:n relationship.
// If this... | php | public function setCustomer(ChildCustomer $v = null)
{
if ($v === null) {
$this->setCustomerId(NULL);
} else {
$this->setCustomerId($v->getId());
}
$this->aCustomer = $v;
// Add binding for other direction of this n:n relationship.
// If this... | [
"public",
"function",
"setCustomer",
"(",
"ChildCustomer",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setCustomerId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"setCustomerId",... | Declares an association between this object and a ChildCustomer object.
@param ChildCustomer $v
@return \CustomerGroup\Model\CustomerCustomerGroup The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"ChildCustomer",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L1013-L1031 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.getCustomer | public function getCustomer(ConnectionInterface $con = null)
{
if ($this->aCustomer === null && ($this->customer_id !== null)) {
$this->aCustomer = CustomerQuery::create()->findPk($this->customer_id, $con);
/* The following can be used additionally to
guarantee the re... | php | public function getCustomer(ConnectionInterface $con = null)
{
if ($this->aCustomer === null && ($this->customer_id !== null)) {
$this->aCustomer = CustomerQuery::create()->findPk($this->customer_id, $con);
/* The following can be used additionally to
guarantee the re... | [
"public",
"function",
"getCustomer",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aCustomer",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"customer_id",
"!==",
"null",
")",
")",
"{",
"$",
"this",
"->",
... | Get the associated ChildCustomer object
@param ConnectionInterface $con Optional Connection object.
@return ChildCustomer The associated ChildCustomer object.
@throws PropelException | [
"Get",
"the",
"associated",
"ChildCustomer",
"object"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L1041-L1055 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.setCustomerGroup | public function setCustomerGroup(ChildCustomerGroup $v = null)
{
if ($v === null) {
$this->setCustomerGroupId(NULL);
} else {
$this->setCustomerGroupId($v->getId());
}
$this->aCustomerGroup = $v;
// Add binding for other direction of this n:n relatio... | php | public function setCustomerGroup(ChildCustomerGroup $v = null)
{
if ($v === null) {
$this->setCustomerGroupId(NULL);
} else {
$this->setCustomerGroupId($v->getId());
}
$this->aCustomerGroup = $v;
// Add binding for other direction of this n:n relatio... | [
"public",
"function",
"setCustomerGroup",
"(",
"ChildCustomerGroup",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setCustomerGroupId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"... | Declares an association between this object and a ChildCustomerGroup object.
@param ChildCustomerGroup $v
@return \CustomerGroup\Model\CustomerCustomerGroup The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"ChildCustomerGroup",
"object",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L1064-L1082 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.clear | public function clear()
{
$this->customer_id = null;
$this->customer_group_id = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
} | php | public function clear()
{
$this->customer_id = null;
$this->customer_group_id = null;
$this->alreadyInSave = false;
$this->clearAllReferences();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);
} | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"customer_id",
"=",
"null",
";",
"$",
"this",
"->",
"customer_group_id",
"=",
"null",
";",
"$",
"this",
"->",
"alreadyInSave",
"=",
"false",
";",
"$",
"this",
"->",
"clearAllReferences",
"(... | Clears the current object and sets all attributes to their default values | [
"Clears",
"the",
"current",
"object",
"and",
"sets",
"all",
"attributes",
"to",
"their",
"default",
"values"
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L1111-L1120 |
thelia-modules/CustomerGroup | Model/Base/CustomerCustomerGroup.php | CustomerCustomerGroup.clearAllReferences | public function clearAllReferences($deep = false)
{
if ($deep) {
} // if ($deep)
$this->aCustomer = null;
$this->aCustomerGroup = null;
} | php | public function clearAllReferences($deep = false)
{
if ($deep) {
} // if ($deep)
$this->aCustomer = null;
$this->aCustomerGroup = null;
} | [
"public",
"function",
"clearAllReferences",
"(",
"$",
"deep",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"deep",
")",
"{",
"}",
"// if ($deep)",
"$",
"this",
"->",
"aCustomer",
"=",
"null",
";",
"$",
"this",
"->",
"aCustomerGroup",
"=",
"null",
";",
"}"
] | Resets all references to other model objects or collections of model objects.
This method is a user-space workaround for PHP's inability to garbage collect
objects with circular references (even in PHP 5.3). This is currently necessary
when using Propel in certain daemon or large-volume/high-memory operations.
@param... | [
"Resets",
"all",
"references",
"to",
"other",
"model",
"objects",
"or",
"collections",
"of",
"model",
"objects",
"."
] | train | https://github.com/thelia-modules/CustomerGroup/blob/672cc64c686812f6a95cf0d702111f93d8c0e850/Model/Base/CustomerCustomerGroup.php#L1131-L1138 |
simbiosis-group/yii2-helper | widgets/ModalActiveForm.php | ModalActiveForm.init | public function init()
{
$this->getView()->registerJs(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/js/modal-active-form.js')));
$this->getView()->registerJs(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/js/modal-hint.js')));
$this->getView()->registerCss(file_g... | php | public function init()
{
$this->getView()->registerJs(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/js/modal-active-form.js')));
$this->getView()->registerJs(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/js/modal-hint.js')));
$this->getView()->registerCss(file_g... | [
"public",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"getView",
"(",
")",
"->",
"registerJs",
"(",
"file_get_contents",
"(",
"Yii",
"::",
"getAlias",
"(",
"'@vendor/anli/yii2-helper/js/modal-active-form.js'",
")",
")",
")",
";",
"$",
"this",
"->",
... | Renders the widget. | [
"Renders",
"the",
"widget",
"."
] | train | https://github.com/simbiosis-group/yii2-helper/blob/c85c4204dd06b16e54210e75fe6deb51869d1dd9/widgets/ModalActiveForm.php#L38-L50 |
skmetaly/laravel-twitch-restful-api | src/API/Follow.php | Follow.channelFollows | public function channelFollows($channel, $options = [])
{
$availableOptions = ['limit', 'offset', 'direction'];
// Filter the available options
foreach ($availableOptions as $option) {
if (isset($options[ $option ])) {
$options[ $option ] = $options[ $option ]... | php | public function channelFollows($channel, $options = [])
{
$availableOptions = ['limit', 'offset', 'direction'];
// Filter the available options
foreach ($availableOptions as $option) {
if (isset($options[ $option ])) {
$options[ $option ] = $options[ $option ]... | [
"public",
"function",
"channelFollows",
"(",
"$",
"channel",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"availableOptions",
"=",
"[",
"'limit'",
",",
"'offset'",
",",
"'direction'",
"]",
";",
"// Filter the available options",
"foreach",
"(",
"$",
"... | Returns a list of follow objects.
Name Required? Type Description
limit optional integer Maximum number of objects in array. Default is 25. Maximum is 100.
offset optional integer Object offset for pagination. Default is 0.
direction optional string Creation date sorting direction. ... | [
"Returns",
"a",
"list",
"of",
"follow",
"objects",
"."
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Follow.php#L31-L49 |
skmetaly/laravel-twitch-restful-api | src/API/Follow.php | Follow.userFollowsChannels | public function userFollowsChannels($user, $options = [])
{
$availableOptions = ['limit', 'offset', 'direction', 'sortby'];
// Filter the available options
foreach ($availableOptions as $option) {
if (isset($options[ $option ])) {
$options[ $option ] = $option... | php | public function userFollowsChannels($user, $options = [])
{
$availableOptions = ['limit', 'offset', 'direction', 'sortby'];
// Filter the available options
foreach ($availableOptions as $option) {
if (isset($options[ $option ])) {
$options[ $option ] = $option... | [
"public",
"function",
"userFollowsChannels",
"(",
"$",
"user",
",",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"availableOptions",
"=",
"[",
"'limit'",
",",
"'offset'",
",",
"'direction'",
",",
"'sortby'",
"]",
";",
"// Filter the available options",
"fore... | Returns a list of follows objects.
Parameters
Name Required? Type Description
limit optional integer Maximum number of objects in array. Default is 25. Maximum is 100.
offset optional integer Object offset for pagination. Default is 0.
direction optional string Sorting direction. Def... | [
"Returns",
"a",
"list",
"of",
"follows",
"objects",
".",
"Parameters",
"Name",
"Required?",
"Type",
"Description",
"limit",
"optional",
"integer",
"Maximum",
"number",
"of",
"objects",
"in",
"array",
".",
"Default",
"is",
"25",
".",
"Maximum",
"is",
"100",
"... | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Follow.php#L65-L83 |
skmetaly/laravel-twitch-restful-api | src/API/Follow.php | Follow.userFollowsChannel | public function userFollowsChannel($user, $channel)
{
$response = $this->client->get('kraken/users/' . $user . '/follows/channels/' . $channel);
return $response->json();
} | php | public function userFollowsChannel($user, $channel)
{
$response = $this->client->get('kraken/users/' . $user . '/follows/channels/' . $channel);
return $response->json();
} | [
"public",
"function",
"userFollowsChannel",
"(",
"$",
"user",
",",
"$",
"channel",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"'kraken/users/'",
".",
"$",
"user",
".",
"'/follows/channels/'",
".",
"$",
"channel",
")",
... | Returns 404 Not Found if :user is not following :target. Returns a follow object otherwise.
@param $user
@param $channel
@return mixed | [
"Returns",
"404",
"Not",
"Found",
"if",
":",
"user",
"is",
"not",
"following",
":",
"target",
".",
"Returns",
"a",
"follow",
"object",
"otherwise",
"."
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Follow.php#L93-L98 |
skmetaly/laravel-twitch-restful-api | src/API/Follow.php | Follow.authenticatedUserUnfollowsChannel | public function authenticatedUserUnfollowsChannel($user, $channel, $token = null)
{
$token = $this->getToken($token);
$request = $this->createRequest('DELETE',
config('twitch-api.api_url') . '/kraken/users/' . $user . '/follows/channels/' . $channel, $token);
$response = $this-... | php | public function authenticatedUserUnfollowsChannel($user, $channel, $token = null)
{
$token = $this->getToken($token);
$request = $this->createRequest('DELETE',
config('twitch-api.api_url') . '/kraken/users/' . $user . '/follows/channels/' . $channel, $token);
$response = $this-... | [
"public",
"function",
"authenticatedUserUnfollowsChannel",
"(",
"$",
"user",
",",
"$",
"channel",
",",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"token",
"=",
"$",
"this",
"->",
"getToken",
"(",
"$",
"token",
")",
";",
"$",
"request",
"=",
"$",
"this",... | Removes :user from :target's followers. :user is the authenticated user's name and :target is the name of the channel to be unfollowed.
Authenticated, required scope: user_follows_edit
@param $user
@param $channel
@param null $token
@return boolean | [
"Removes",
":",
"user",
"from",
":",
"target",
"s",
"followers",
".",
":",
"user",
"is",
"the",
"authenticated",
"user",
"s",
"name",
"and",
":",
"target",
"is",
"the",
"name",
"of",
"the",
"channel",
"to",
"be",
"unfollowed",
"."
] | train | https://github.com/skmetaly/laravel-twitch-restful-api/blob/70c83e441deb411ade2e343ad5cb0339c90dc6c2/src/API/Follow.php#L148-L163 |
Danack/GithubArtaxService | lib/GithubService/Operation/createAuthorization.php | createAuthorization.createRequest | public function createRequest() {
$request = new \Amp\Artax\Request();
$url = null;
$request->setMethod('POST');
$jsonParams = [];
if (array_key_exists('Accept', $this->parameters) == true) {
$value = $this->getFilteredParameter('Accept');
$request->setHeade... | php | public function createRequest() {
$request = new \Amp\Artax\Request();
$url = null;
$request->setMethod('POST');
$jsonParams = [];
if (array_key_exists('Accept', $this->parameters) == true) {
$value = $this->getFilteredParameter('Accept');
$request->setHeade... | [
"public",
"function",
"createRequest",
"(",
")",
"{",
"$",
"request",
"=",
"new",
"\\",
"Amp",
"\\",
"Artax",
"\\",
"Request",
"(",
")",
";",
"$",
"url",
"=",
"null",
";",
"$",
"request",
"->",
"setMethod",
"(",
"'POST'",
")",
";",
"$",
"jsonParams",... | Create an Amp\Artax\Request object from the operation.
@return \Amp\Artax\Request | [
"Create",
"an",
"Amp",
"\\",
"Artax",
"\\",
"Request",
"object",
"from",
"the",
"operation",
"."
] | train | https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/Operation/createAuthorization.php#L248-L300 |
getuisdk/getui-php-sdk | src/PBBytes.php | PBBytes.parseFromArray | public function parseFromArray()
{
$this->value = '';
// first byte is length
$length = $this->reader->next();
// just extract the string
$pointer = $this->reader->getPointer();
$this->reader->addPointer($length);
$this->value = $this->reader->getMes... | php | public function parseFromArray()
{
$this->value = '';
// first byte is length
$length = $this->reader->next();
// just extract the string
$pointer = $this->reader->getPointer();
$this->reader->addPointer($length);
$this->value = $this->reader->getMes... | [
"public",
"function",
"parseFromArray",
"(",
")",
"{",
"$",
"this",
"->",
"value",
"=",
"''",
";",
"// first byte is length\r",
"$",
"length",
"=",
"$",
"this",
"->",
"reader",
"->",
"next",
"(",
")",
";",
"// just extract the string\r",
"$",
"pointer",
"=",... | Parses the message for this type
@param array | [
"Parses",
"the",
"message",
"for",
"this",
"type"
] | train | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBBytes.php#L24-L34 |
getuisdk/getui-php-sdk | src/PBBytes.php | PBBytes.serializeToString | public function serializeToString($rec = -1)
{
$string = '';
if ($rec > -1) {
$string .= $this->base128->setValue($rec << 3 | $this->wired_type);
}
$string .= $this->base128->setValue(strlen($this->value));
$string .= $this->value;
return $st... | php | public function serializeToString($rec = -1)
{
$string = '';
if ($rec > -1) {
$string .= $this->base128->setValue($rec << 3 | $this->wired_type);
}
$string .= $this->base128->setValue(strlen($this->value));
$string .= $this->value;
return $st... | [
"public",
"function",
"serializeToString",
"(",
"$",
"rec",
"=",
"-",
"1",
")",
"{",
"$",
"string",
"=",
"''",
";",
"if",
"(",
"$",
"rec",
">",
"-",
"1",
")",
"{",
"$",
"string",
".=",
"$",
"this",
"->",
"base128",
"->",
"setValue",
"(",
"$",
"... | Serializes type
@param mixed $rec
@return mixed | [
"Serializes",
"type"
] | train | https://github.com/getuisdk/getui-php-sdk/blob/e91773b099bcbfd7492a44086b373d1c9fee37e2/src/PBBytes.php#L41-L53 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.incrementOrDecrement | protected function incrementOrDecrement($column, $amount, $extra, $method)
{
$query = $this->newQuery();
if (!$this->exists) {
return $query->{$method}($column, $amount, $extra);
}
$this->incrementOrDecrementAttributeValue($column, $amount, $method);
return $qu... | php | protected function incrementOrDecrement($column, $amount, $extra, $method)
{
$query = $this->newQuery();
if (!$this->exists) {
return $query->{$method}($column, $amount, $extra);
}
$this->incrementOrDecrementAttributeValue($column, $amount, $method);
return $qu... | [
"protected",
"function",
"incrementOrDecrement",
"(",
"$",
"column",
",",
"$",
"amount",
",",
"$",
"extra",
",",
"$",
"method",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"newQuery",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"exists",
... | Run the increment or decrement method on the model.
@param string $column
@param int $amount
@param array $extra
@param string $method
@return int | [
"Run",
"the",
"increment",
"or",
"decrement",
"method",
"on",
"the",
"model",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L417-L431 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.finishSave | protected function finishSave(array $options)
{
$this->fireModelEvent('saved', false);
$this->syncOriginal();
if (Arr::get($options, 'touch', true)) {
$this->touchOwners();
}
} | php | protected function finishSave(array $options)
{
$this->fireModelEvent('saved', false);
$this->syncOriginal();
if (Arr::get($options, 'touch', true)) {
$this->touchOwners();
}
} | [
"protected",
"function",
"finishSave",
"(",
"array",
"$",
"options",
")",
"{",
"$",
"this",
"->",
"fireModelEvent",
"(",
"'saved'",
",",
"false",
")",
";",
"$",
"this",
"->",
"syncOriginal",
"(",
")",
";",
"if",
"(",
"Arr",
"::",
"get",
"(",
"$",
"op... | Perform any actions that are necessary after the model is saved.
@param array $options
@return void | [
"Perform",
"any",
"actions",
"that",
"are",
"necessary",
"after",
"the",
"model",
"is",
"saved",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L560-L569 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.destroy | public static function destroy($ids)
{
// We'll initialize a count here so we will return the total number of deletes
// for the operation. The developers can then check this number as a boolean
// type value or get this total count of records deleted for logging, etc.
$count = 0;
... | php | public static function destroy($ids)
{
// We'll initialize a count here so we will return the total number of deletes
// for the operation. The developers can then check this number as a boolean
// type value or get this total count of records deleted for logging, etc.
$count = 0;
... | [
"public",
"static",
"function",
"destroy",
"(",
"$",
"ids",
")",
"{",
"// We'll initialize a count here so we will return the total number of deletes",
"// for the operation. The developers can then check this number as a boolean",
"// type value or get this total count of records deleted for ... | Destroy the models for the given IDs.
@param array|int $ids
@return int | [
"Destroy",
"the",
"models",
"for",
"the",
"given",
"IDs",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L708-L729 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.delete | public function delete()
{
if (is_null($this->getKeyName())) {
throw new Exception('No primary key defined on model.');
}
// If the model doesn't exist, there is nothing to delete so we'll just return
// immediately and not do anything else. Otherwise, we will continue w... | php | public function delete()
{
if (is_null($this->getKeyName())) {
throw new Exception('No primary key defined on model.');
}
// If the model doesn't exist, there is nothing to delete so we'll just return
// immediately and not do anything else. Otherwise, we will continue w... | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"getKeyName",
"(",
")",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'No primary key defined on model.'",
")",
";",
"}",
"// If the model doesn't exist, there is no... | Delete the model from the database.
@throws \Exception
@return null|bool | [
"Delete",
"the",
"model",
"from",
"the",
"database",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L738-L770 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.newQueryWithoutScopes | public function newQueryWithoutScopes()
{
$builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());
// Once we have the query builders, we will set the model instances so the
// builder can easily access any information it may need from the model
// while it is constructin... | php | public function newQueryWithoutScopes()
{
$builder = $this->newEloquentBuilder($this->newBaseQueryBuilder());
// Once we have the query builders, we will set the model instances so the
// builder can easily access any information it may need from the model
// while it is constructin... | [
"public",
"function",
"newQueryWithoutScopes",
"(",
")",
"{",
"$",
"builder",
"=",
"$",
"this",
"->",
"newEloquentBuilder",
"(",
"$",
"this",
"->",
"newBaseQueryBuilder",
"(",
")",
")",
";",
"// Once we have the query builders, we will set the model instances so the",
"... | Get a new query builder that doesn't have any global scopes.
@return \Mellivora\Database\Eloquent\Builder|static | [
"Get",
"a",
"new",
"query",
"builder",
"that",
"doesn",
"t",
"have",
"any",
"global",
"scopes",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L825-L833 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.newPivot | public function newPivot(Model $parent, array $attributes, $table, $exists, $using = null)
{
return $using ? new $using($parent, $attributes, $table, $exists)
: new Pivot($parent, $attributes, $table, $exists);
} | php | public function newPivot(Model $parent, array $attributes, $table, $exists, $using = null)
{
return $using ? new $using($parent, $attributes, $table, $exists)
: new Pivot($parent, $attributes, $table, $exists);
} | [
"public",
"function",
"newPivot",
"(",
"Model",
"$",
"parent",
",",
"array",
"$",
"attributes",
",",
"$",
"table",
",",
"$",
"exists",
",",
"$",
"using",
"=",
"null",
")",
"{",
"return",
"$",
"using",
"?",
"new",
"$",
"using",
"(",
"$",
"parent",
"... | Create a new pivot model instance.
@param \Mellivora\Database\Eloquent\Model $parent
@param array $attributes
@param string $table
@param bool $exists
@param null|string $using
@return \Mellivora\Database\Elo... | [
"Create",
"a",
"new",
"pivot",
"model",
"instance",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L900-L904 |
zhouyl/mellivora | Mellivora/Database/Eloquent/Model.php | Model.getTable | public function getTable()
{
if (!isset($this->table)) {
return str_replace('\\', '', Str::snake(Str::plural(class_basename($this))));
}
return $this->table;
} | php | public function getTable()
{
if (!isset($this->table)) {
return str_replace('\\', '', Str::snake(Str::plural(class_basename($this))));
}
return $this->table;
} | [
"public",
"function",
"getTable",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"table",
")",
")",
"{",
"return",
"str_replace",
"(",
"'\\\\'",
",",
"''",
",",
"Str",
"::",
"snake",
"(",
"Str",
"::",
"plural",
"(",
"class_basename",... | Get the table associated with the model.
@return string | [
"Get",
"the",
"table",
"associated",
"with",
"the",
"model",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Database/Eloquent/Model.php#L1089-L1096 |
eymengunay/php-keyclient | src/Payment/AbstractPayment.php | AbstractPayment.get | public function get($key, $default = null)
{
if (array_key_exists($key, $this->params)) {
return $this->params[$key];
}
return $default;
} | php | public function get($key, $default = null)
{
if (array_key_exists($key, $this->params)) {
return $this->params[$key];
}
return $default;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"params",
")",
")",
"{",
"return",
"$",
"this",
"->",
"params",
"[",
"$",
"key",
"]"... | Getter
@param string $key
@param mixed $default
@return mixed | [
"Getter"
] | train | https://github.com/eymengunay/php-keyclient/blob/867e035a2a0707c5df4198a8c321ddfd048a9c56/src/Payment/AbstractPayment.php#L74-L81 |
vaibhavpandeyvpz/sandesh | src/UploadedFile.php | UploadedFile.getStream | public function getStream()
{
if (!$this->stream) {
$this->stream = new Stream($this->file, 'r+');
}
return $this->stream;
} | php | public function getStream()
{
if (!$this->stream) {
$this->stream = new Stream($this->file, 'r+');
}
return $this->stream;
} | [
"public",
"function",
"getStream",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stream",
")",
"{",
"$",
"this",
"->",
"stream",
"=",
"new",
"Stream",
"(",
"$",
"this",
"->",
"file",
",",
"'r+'",
")",
";",
"}",
"return",
"$",
"this",
"->",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/UploadedFile.php#L133-L139 |
vaibhavpandeyvpz/sandesh | src/UploadedFile.php | UploadedFile.moveTo | public function moveTo($targetPath)
{
if ($this->moved) {
throw new \RuntimeException('This file has already been moved');
}
$src = $this->getStream();
$src->rewind();
$dest = new Stream($targetPath, 'w');
while (!$src->eof()) {
$data = $src->r... | php | public function moveTo($targetPath)
{
if ($this->moved) {
throw new \RuntimeException('This file has already been moved');
}
$src = $this->getStream();
$src->rewind();
$dest = new Stream($targetPath, 'w');
while (!$src->eof()) {
$data = $src->r... | [
"public",
"function",
"moveTo",
"(",
"$",
"targetPath",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"moved",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"'This file has already been moved'",
")",
";",
"}",
"$",
"src",
"=",
"$",
"this",
"->",
"ge... | {@inheritdoc} | [
"{"
] | train | https://github.com/vaibhavpandeyvpz/sandesh/blob/bea2d06c7cac099ed82da973c922859de4158de0/src/UploadedFile.php#L144-L161 |
caffeinated/beverage | src/Command.php | Command.hasRootAccess | public function hasRootAccess()
{
$path = '/root/.' . md5('_radic-cli-perm-test' . time());
$root = (@file_put_contents($path, '1') === false ? false : true);
if ($root !== false) {
$this->getLaravel()->make('files')->delete($path);
}
return $root !== false;
... | php | public function hasRootAccess()
{
$path = '/root/.' . md5('_radic-cli-perm-test' . time());
$root = (@file_put_contents($path, '1') === false ? false : true);
if ($root !== false) {
$this->getLaravel()->make('files')->delete($path);
}
return $root !== false;
... | [
"public",
"function",
"hasRootAccess",
"(",
")",
"{",
"$",
"path",
"=",
"'/root/.'",
".",
"md5",
"(",
"'_radic-cli-perm-test'",
".",
"time",
"(",
")",
")",
";",
"$",
"root",
"=",
"(",
"@",
"file_put_contents",
"(",
"$",
"path",
",",
"'1'",
")",
"===",
... | hasRootAccess
@return bool | [
"hasRootAccess"
] | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Command.php#L92-L101 |
caffeinated/beverage | src/Command.php | Command.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
if (! $this->allowSudo and ! $this->requireSudo and $this->hasRootAccess()) {
$this->error('Cannot execute this command with root privileges');
exit;
}
if ($this->requireSudo and ! $this->ha... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
if (! $this->allowSudo and ! $this->requireSudo and $this->hasRootAccess()) {
$this->error('Cannot execute this command with root privileges');
exit;
}
if ($this->requireSudo and ! $this->ha... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"allowSudo",
"and",
"!",
"$",
"this",
"->",
"requireSudo",
"and",
"$",
"this",
"->",
"hasRootAccess... | execute
@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return mixed | [
"execute"
] | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Command.php#L110-L132 |
caffeinated/beverage | src/Command.php | Command.arrayTable | protected function arrayTable($arr, array $header = [ 'Key', 'Value' ])
{
$rows = [ ];
foreach ($arr as $key => $val) {
if (is_array($val)) {
$val = print_r(array_slice($val, 0, 5), true);
}
$rows[] = [ (string)$key, (string)$val ];
}
... | php | protected function arrayTable($arr, array $header = [ 'Key', 'Value' ])
{
$rows = [ ];
foreach ($arr as $key => $val) {
if (is_array($val)) {
$val = print_r(array_slice($val, 0, 5), true);
}
$rows[] = [ (string)$key, (string)$val ];
}
... | [
"protected",
"function",
"arrayTable",
"(",
"$",
"arr",
",",
"array",
"$",
"header",
"=",
"[",
"'Key'",
",",
"'Value'",
"]",
")",
"{",
"$",
"rows",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"i... | arrayTable
@param $arr
@param array $header | [
"arrayTable"
] | train | https://github.com/caffeinated/beverage/blob/c7d612a1d3bc1baddc97fec60ab17224550efaf3/src/Command.php#L155-L166 |
wplibs/rules | src/Operator/Between.php | Between.evaluate | public function evaluate( Context $context ) {
/**
* Extracts variables.
*
* @var \Ruler\Variable $left
* @var \Ruler\Variable $right
*/
list( $left, $right ) = $this->getOperands();
$left = $left->prepareValue( $context )->getValue();
$right = $right->prepareValue( $context )->getValue();
i... | php | public function evaluate( Context $context ) {
/**
* Extracts variables.
*
* @var \Ruler\Variable $left
* @var \Ruler\Variable $right
*/
list( $left, $right ) = $this->getOperands();
$left = $left->prepareValue( $context )->getValue();
$right = $right->prepareValue( $context )->getValue();
i... | [
"public",
"function",
"evaluate",
"(",
"Context",
"$",
"context",
")",
"{",
"/**\n\t\t * Extracts variables.\n\t\t *\n\t\t * @var \\Ruler\\Variable $left\n\t\t * @var \\Ruler\\Variable $right\n\t\t */",
"list",
"(",
"$",
"left",
",",
"$",
"right",
")",
"=",
"$",
"this",
"->... | Evaluate the operands.
@param Context $context Context with which to evaluate this Proposition.
@return boolean | [
"Evaluate",
"the",
"operands",
"."
] | train | https://github.com/wplibs/rules/blob/29b4495e2ae87349fd64fcd844f3ba96cc268e3d/src/Operator/Between.php#L16-L40 |
GrupaZero/api | src/Gzero/Api/Controller/Admin/FileController.php | FileController.index | public function index()
{
$this->authorize('readList', File::class);
$input = $this->validator->validate('list');
$params = $this->processor->process($input)->getProcessedFields();
$query = QueryBuilder::with($params['filter'], $params['orderBy'], $params['query']);
$query-... | php | public function index()
{
$this->authorize('readList', File::class);
$input = $this->validator->validate('list');
$params = $this->processor->process($input)->getProcessedFields();
$query = QueryBuilder::with($params['filter'], $params['orderBy'], $params['query']);
$query-... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'readList'",
",",
"File",
"::",
"class",
")",
";",
"$",
"input",
"=",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"'list'",
")",
";",
"$",
"params",
"=",
... | Display a listing of the resource.
@return \Illuminate\Http\JsonResponse | [
"Display",
"a",
"listing",
"of",
"the",
"resource",
"."
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/FileController.php#L62-L71 |
GrupaZero/api | src/Gzero/Api/Controller/Admin/FileController.php | FileController.show | public function show($id)
{
$file = $this->fileRepo->getById($id);
if (!empty($file)) {
$this->authorize('read', $file);
return $this->respondWithSuccess($file, new FileTransformer);
}
return $this->respondNotFound();
} | php | public function show($id)
{
$file = $this->fileRepo->getById($id);
if (!empty($file)) {
$this->authorize('read', $file);
return $this->respondWithSuccess($file, new FileTransformer);
}
return $this->respondNotFound();
} | [
"public",
"function",
"show",
"(",
"$",
"id",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"fileRepo",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
... | Display the specified resource.
@param int $id file id
@return Response | [
"Display",
"the",
"specified",
"resource",
"."
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/FileController.php#L80-L88 |
GrupaZero/api | src/Gzero/Api/Controller/Admin/FileController.php | FileController.store | public function store(Request $request)
{
$this->authorize('create', File::class);
$input = $this->validator->validate('create');
if ($request->hasFile('file')) {
$uploadedFile = $request->file('file');
if ($uploadedFile->isValid()) {
try {
... | php | public function store(Request $request)
{
$this->authorize('create', File::class);
$input = $this->validator->validate('create');
if ($request->hasFile('file')) {
$uploadedFile = $request->file('file');
if ($uploadedFile->isValid()) {
try {
... | [
"public",
"function",
"store",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'create'",
",",
"File",
"::",
"class",
")",
";",
"$",
"input",
"=",
"$",
"this",
"->",
"validator",
"->",
"validate",
"(",
"'create'",
")",
... | Stores newly created file in database.
@param Request $request Request object
@return \Illuminate\Http\JsonResponse | [
"Stores",
"newly",
"created",
"file",
"in",
"database",
"."
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/FileController.php#L97-L113 |
GrupaZero/api | src/Gzero/Api/Controller/Admin/FileController.php | FileController.destroy | public function destroy($id)
{
$file = $this->fileRepo->getById($id);
if (!empty($file)) {
$this->authorize('delete', $file);
$this->fileRepo->delete($file);
return $this->respondWithSimpleSuccess(['success' => true]);
}
return $this->respondNotFo... | php | public function destroy($id)
{
$file = $this->fileRepo->getById($id);
if (!empty($file)) {
$this->authorize('delete', $file);
$this->fileRepo->delete($file);
return $this->respondWithSimpleSuccess(['success' => true]);
}
return $this->respondNotFo... | [
"public",
"function",
"destroy",
"(",
"$",
"id",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"fileRepo",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"authorize",
"("... | Remove the specified file from database.
@param int $id Id of the file
@return \Illuminate\Http\JsonResponse | [
"Remove",
"the",
"specified",
"file",
"from",
"database",
"."
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/FileController.php#L122-L132 |
GrupaZero/api | src/Gzero/Api/Controller/Admin/FileController.php | FileController.update | public function update($id)
{
$file = $this->fileRepo->getById($id);
if (!empty($file)) {
$this->authorize('update', $file);
$input = $this->validator->validate('update');
$file = $this->fileRepo->update($file, $input, Auth::user());
return $this->res... | php | public function update($id)
{
$file = $this->fileRepo->getById($id);
if (!empty($file)) {
$this->authorize('update', $file);
$input = $this->validator->validate('update');
$file = $this->fileRepo->update($file, $input, Auth::user());
return $this->res... | [
"public",
"function",
"update",
"(",
"$",
"id",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"fileRepo",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"file",
")",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",... | Updates the specified resource in the database.
@param int $id File id
@return \Illuminate\Http\JsonResponse | [
"Updates",
"the",
"specified",
"resource",
"in",
"the",
"database",
"."
] | train | https://github.com/GrupaZero/api/blob/fc544bb6057274e9d5e7b617346c3f854ea5effd/src/Gzero/Api/Controller/Admin/FileController.php#L141-L151 |
wolfguarder/yii2-block | controllers/AdminController.php | AdminController.actionIndex | public function actionIndex()
{
$searchModel = $this->module->manager->createBlockSearch();
$dataProvider = $searchModel->search($_GET);
return $this->render('index', [
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
} | php | public function actionIndex()
{
$searchModel = $this->module->manager->createBlockSearch();
$dataProvider = $searchModel->search($_GET);
return $this->render('index', [
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
} | [
"public",
"function",
"actionIndex",
"(",
")",
"{",
"$",
"searchModel",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"createBlockSearch",
"(",
")",
";",
"$",
"dataProvider",
"=",
"$",
"searchModel",
"->",
"search",
"(",
"$",
"_GET",
")",
";",... | Lists all Block models.
@return mixed | [
"Lists",
"all",
"Block",
"models",
"."
] | train | https://github.com/wolfguarder/yii2-block/blob/b8f657a572eb5182584161acc2cfd77b20ab7680/controllers/AdminController.php#L48-L57 |
wolfguarder/yii2-block | controllers/AdminController.php | AdminController.actionCreate | public function actionCreate()
{
$model = $this->module->manager->createBlock(['scenario' => 'create']);
if ($model->load(\Yii::$app->request->post()) && $model->create()) {
\Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been created'));
retu... | php | public function actionCreate()
{
$model = $this->module->manager->createBlock(['scenario' => 'create']);
if ($model->load(\Yii::$app->request->post()) && $model->create()) {
\Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been created'));
retu... | [
"public",
"function",
"actionCreate",
"(",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"module",
"->",
"manager",
"->",
"createBlock",
"(",
"[",
"'scenario'",
"=>",
"'create'",
"]",
")",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"\\",
"Yii... | Creates a new Block model.
If creation is successful, the browser will be redirected to the 'index' page.
@return mixed | [
"Creates",
"a",
"new",
"Block",
"model",
".",
"If",
"creation",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | train | https://github.com/wolfguarder/yii2-block/blob/b8f657a572eb5182584161acc2cfd77b20ab7680/controllers/AdminController.php#L64-L76 |
wolfguarder/yii2-block | controllers/AdminController.php | AdminController.actionUpdate | public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->scenario = 'update';
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
if(\Yii::$app->request->get('returnUrl')){
$back = urldecode(\Yii::$app->request->get('returnUrl'))... | php | public function actionUpdate($id)
{
$model = $this->findModel($id);
$model->scenario = 'update';
if ($model->load(\Yii::$app->request->post()) && $model->save()) {
if(\Yii::$app->request->get('returnUrl')){
$back = urldecode(\Yii::$app->request->get('returnUrl'))... | [
"public",
"function",
"actionUpdate",
"(",
"$",
"id",
")",
"{",
"$",
"model",
"=",
"$",
"this",
"->",
"findModel",
"(",
"$",
"id",
")",
";",
"$",
"model",
"->",
"scenario",
"=",
"'update'",
";",
"if",
"(",
"$",
"model",
"->",
"load",
"(",
"\\",
"... | Updates an existing Block model.
If update is successful, the browser will be redirected to the 'index' page.
@param integer $id
@return mixed | [
"Updates",
"an",
"existing",
"Block",
"model",
".",
"If",
"update",
"is",
"successful",
"the",
"browser",
"will",
"be",
"redirected",
"to",
"the",
"index",
"page",
"."
] | train | https://github.com/wolfguarder/yii2-block/blob/b8f657a572eb5182584161acc2cfd77b20ab7680/controllers/AdminController.php#L84-L102 |
zhengb302/LumengPHP-Db | src/LumengPHP/Db/Connection/AbstractPDOProvider.php | AbstractPDOProvider.makePdo | protected function makePdo($dsn, $username, $password, array $options = null) {
$pdo = new PDO($dsn, $username, $password, $options);
//设置PDO错误模式为"抛出异常"
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//设置字符集
$pdo->exec("SET NAMES {$this->config['charset']}");
... | php | protected function makePdo($dsn, $username, $password, array $options = null) {
$pdo = new PDO($dsn, $username, $password, $options);
//设置PDO错误模式为"抛出异常"
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//设置字符集
$pdo->exec("SET NAMES {$this->config['charset']}");
... | [
"protected",
"function",
"makePdo",
"(",
"$",
"dsn",
",",
"$",
"username",
",",
"$",
"password",
",",
"array",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"pdo",
"=",
"new",
"PDO",
"(",
"$",
"dsn",
",",
"$",
"username",
",",
"$",
"password",
",",
... | 创建一个PDO对象并返回
@param string $dsn
@param string $username
@param string $password
@param array $options
@return PDO | [
"创建一个PDO对象并返回"
] | train | https://github.com/zhengb302/LumengPHP-Db/blob/47384aa37bc26352efb7ecda3c139cf8cb03db83/src/LumengPHP/Db/Connection/AbstractPDOProvider.php#L47-L57 |
Speicher210/monsum-api | src/Serializer/Handler/DateHandler.php | DateHandler.deserializeDateTimeFromJson | public function deserializeDateTimeFromJson(JsonDeserializationVisitor $visitor, $data, array $type)
{
// Handle empty or invalid date / datetime values.
if ('' === $data || null === $data || strpos($data, '0000-00-00') !== false) {
return null;
}
// We want to always sh... | php | public function deserializeDateTimeFromJson(JsonDeserializationVisitor $visitor, $data, array $type)
{
// Handle empty or invalid date / datetime values.
if ('' === $data || null === $data || strpos($data, '0000-00-00') !== false) {
return null;
}
// We want to always sh... | [
"public",
"function",
"deserializeDateTimeFromJson",
"(",
"JsonDeserializationVisitor",
"$",
"visitor",
",",
"$",
"data",
",",
"array",
"$",
"type",
")",
"{",
"// Handle empty or invalid date / datetime values.",
"if",
"(",
"''",
"===",
"$",
"data",
"||",
"null",
"=... | {@inheritdoc} | [
"{"
] | train | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Serializer/Handler/DateHandler.php#L34-L49 |
thupan/framework | src/Service/PDF.php | PDF.RowConfig | public function RowConfig($config){
$conf = (object) $config;
($conf->align ) ? $this->SetAligns ($conf->align ):false;
($conf->background) ? $this->SetBackgrounds($conf->background):false;
($conf->border ) ? $this->SetBorders ($conf->border ):false;
($conf... | php | public function RowConfig($config){
$conf = (object) $config;
($conf->align ) ? $this->SetAligns ($conf->align ):false;
($conf->background) ? $this->SetBackgrounds($conf->background):false;
($conf->border ) ? $this->SetBorders ($conf->border ):false;
($conf... | [
"public",
"function",
"RowConfig",
"(",
"$",
"config",
")",
"{",
"$",
"conf",
"=",
"(",
"object",
")",
"$",
"config",
";",
"(",
"$",
"conf",
"->",
"align",
")",
"?",
"$",
"this",
"->",
"SetAligns",
"(",
"$",
"conf",
"->",
"align",
")",
":",
"fals... | O formato do array segue nas especificações abaixo:
As chaves possíveis são:
CHAVE | OPÇÕES | DESCRIÇÃO
border : ('B' &| 'T' &| 'R' &| 'L') || 1 || 0 - string ou inteiro (bordas da celula)
style : 'B' | 'I' | 'U' | '' - string (formato d... | [
"O",
"formato",
"do",
"array",
"segue",
"nas",
"especificações",
"abaixo",
":",
"As",
"chaves",
"possíveis",
"são",
":"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/PDF.php#L509-L526 |
thupan/framework | src/Service/PDF.php | PDF.array_sum_interval | function array_sum_interval($array_external, $interval){
$n_interval=explode(":", $interval);
$sum = 0;
for($i=$n_interval[0]; $i < ($n_interval[1]+1) ; $i++){
$sum += $array_external[$i];
}
return $sum;
} | php | function array_sum_interval($array_external, $interval){
$n_interval=explode(":", $interval);
$sum = 0;
for($i=$n_interval[0]; $i < ($n_interval[1]+1) ; $i++){
$sum += $array_external[$i];
}
return $sum;
} | [
"function",
"array_sum_interval",
"(",
"$",
"array_external",
",",
"$",
"interval",
")",
"{",
"$",
"n_interval",
"=",
"explode",
"(",
"\":\"",
",",
"$",
"interval",
")",
";",
"$",
"sum",
"=",
"0",
";",
"for",
"(",
"$",
"i",
"=",
"$",
"n_interval",
"[... | Function for sum intervals of an array | [
"Function",
"for",
"sum",
"intervals",
"of",
"an",
"array"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/PDF.php#L531-L540 |
thupan/framework | src/Service/PDF.php | PDF.array_sum_intervals | function array_sum_intervals($array_external, $intervals){
$n_intervals=explode(";", $intervals);
$array_amount = count($n_intervals);
$result = 0;
for($i=0; $i < $array_amount ; $i++){
$result += $this->array_sum_interval($array_external, $n_intervals[$i]);
}
... | php | function array_sum_intervals($array_external, $intervals){
$n_intervals=explode(";", $intervals);
$array_amount = count($n_intervals);
$result = 0;
for($i=0; $i < $array_amount ; $i++){
$result += $this->array_sum_interval($array_external, $n_intervals[$i]);
}
... | [
"function",
"array_sum_intervals",
"(",
"$",
"array_external",
",",
"$",
"intervals",
")",
"{",
"$",
"n_intervals",
"=",
"explode",
"(",
"\";\"",
",",
"$",
"intervals",
")",
";",
"$",
"array_amount",
"=",
"count",
"(",
"$",
"n_intervals",
")",
";",
"$",
... | Function for sum a interval of an array | [
"Function",
"for",
"sum",
"a",
"interval",
"of",
"an",
"array"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/PDF.php#L542-L552 |
thupan/framework | src/Service/PDF.php | PDF.flipDiagonally | function flipDiagonally($arr)
{
$out = array();
foreach ($arr as $key => $subarr) {
foreach ($subarr as $subkey => $subvalue) {
$out[$subkey][$key] = $subvalue;
}
}
return $out;
} | php | function flipDiagonally($arr)
{
$out = array();
foreach ($arr as $key => $subarr) {
foreach ($subarr as $subkey => $subvalue) {
$out[$subkey][$key] = $subvalue;
}
}
return $out;
} | [
"function",
"flipDiagonally",
"(",
"$",
"arr",
")",
"{",
"$",
"out",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"arr",
"as",
"$",
"key",
"=>",
"$",
"subarr",
")",
"{",
"foreach",
"(",
"$",
"subarr",
"as",
"$",
"subkey",
"=>",
"$",
"subvalu... | Matriz Transposta - transforma array dados de linhas em colunas | [
"Matriz",
"Transposta",
"-",
"transforma",
"array",
"dados",
"de",
"linhas",
"em",
"colunas"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/PDF.php#L555-L564 |
thupan/framework | src/Service/PDF.php | PDF.Image | function Image($file, $x = null, $y = null, $w=0, $h=0, $type='', $link='', $isMask=false, $maskImg=0)
{
//Put an image on the page
if(!isset($this->images[$file]))
{
//First use of image, get info
if($type=='')
{
$pos=strrpos($file, '.');
if(!$pos)
... | php | function Image($file, $x = null, $y = null, $w=0, $h=0, $type='', $link='', $isMask=false, $maskImg=0)
{
//Put an image on the page
if(!isset($this->images[$file]))
{
//First use of image, get info
if($type=='')
{
$pos=strrpos($file, '.');
if(!$pos)
... | [
"function",
"Image",
"(",
"$",
"file",
",",
"$",
"x",
"=",
"null",
",",
"$",
"y",
"=",
"null",
",",
"$",
"w",
"=",
"0",
",",
"$",
"h",
"=",
"0",
",",
"$",
"type",
"=",
"''",
",",
"$",
"link",
"=",
"''",
",",
"$",
"isMask",
"=",
"false",
... | *****************************************************************************
*
Public methods *
*
***************************************************************************** | [
"*****************************************************************************",
"*",
"Public",
"methods",
"*",
"*",
"*****************************************************************************"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/PDF.php#L605-L670 |
thupan/framework | src/Service/PDF.php | PDF.ImagePngWithAlpha | function ImagePngWithAlpha($file, $x, $y, $w=0, $h=0, $link='')
{
$tmp_alpha = tempnam('.', 'mska');
$this->tmpFiles[] = $tmp_alpha;
$tmp_plain = tempnam('.', 'mskp');
$this->tmpFiles[] = $tmp_plain;
list($wpx, $hpx) = getimagesize($file);
$img = imagecreatefrompng($file);
$alpha_img... | php | function ImagePngWithAlpha($file, $x, $y, $w=0, $h=0, $link='')
{
$tmp_alpha = tempnam('.', 'mska');
$this->tmpFiles[] = $tmp_alpha;
$tmp_plain = tempnam('.', 'mskp');
$this->tmpFiles[] = $tmp_plain;
list($wpx, $hpx) = getimagesize($file);
$img = imagecreatefrompng($file);
$alpha_img... | [
"function",
"ImagePngWithAlpha",
"(",
"$",
"file",
",",
"$",
"x",
",",
"$",
"y",
",",
"$",
"w",
"=",
"0",
",",
"$",
"h",
"=",
"0",
",",
"$",
"link",
"=",
"''",
")",
"{",
"$",
"tmp_alpha",
"=",
"tempnam",
"(",
"'.'",
",",
"'mska'",
")",
";",
... | pixel-wise operation, not very fast | [
"pixel",
"-",
"wise",
"operation",
"not",
"very",
"fast"
] | train | https://github.com/thupan/framework/blob/43193c67e87942930fb0cbc53aa069b60b27e749/src/Service/PDF.php#L674-L715 |
zhouyl/mellivora | Mellivora/Encryption/CryptServiceProvider.php | CryptServiceProvider.register | public function register()
{
$this->container['crypt'] = function ($container) {
$config = $container['config']->get('security.crypt');
return new Crypt($config->key, $config->cipher, $config->padding);
};
} | php | public function register()
{
$this->container['crypt'] = function ($container) {
$config = $container['config']->get('security.crypt');
return new Crypt($config->key, $config->cipher, $config->padding);
};
} | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"[",
"'crypt'",
"]",
"=",
"function",
"(",
"$",
"container",
")",
"{",
"$",
"config",
"=",
"$",
"container",
"[",
"'config'",
"]",
"->",
"get",
"(",
"'security.crypt'",
")... | Register the service provider.
@return void | [
"Register",
"the",
"service",
"provider",
"."
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Encryption/CryptServiceProvider.php#L14-L21 |
expectation-php/expect | src/matcher/ToEndWith.php | ToEndWith.reportFailed | public function reportFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendValue($this->actual)
->appendText(' to end with ')
->appendValue($this->pattern);
} | php | public function reportFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendValue($this->actual)
->appendText(' to end with ')
->appendValue($this->pattern);
} | [
"public",
"function",
"reportFailed",
"(",
"FailedMessage",
"$",
"message",
")",
"{",
"$",
"message",
"->",
"appendText",
"(",
"'Expected '",
")",
"->",
"appendValue",
"(",
"$",
"this",
"->",
"actual",
")",
"->",
"appendText",
"(",
"' to end with '",
")",
"-... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToEndWith.php#L62-L68 |
expectation-php/expect | src/matcher/ToEndWith.php | ToEndWith.reportNegativeFailed | public function reportNegativeFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendValue($this->actual)
->appendText(' not to end with ')
->appendValue($this->pattern);
} | php | public function reportNegativeFailed(FailedMessage $message)
{
$message->appendText('Expected ')
->appendValue($this->actual)
->appendText(' not to end with ')
->appendValue($this->pattern);
} | [
"public",
"function",
"reportNegativeFailed",
"(",
"FailedMessage",
"$",
"message",
")",
"{",
"$",
"message",
"->",
"appendText",
"(",
"'Expected '",
")",
"->",
"appendValue",
"(",
"$",
"this",
"->",
"actual",
")",
"->",
"appendText",
"(",
"' not to end with '",... | {@inheritdoc} | [
"{"
] | train | https://github.com/expectation-php/expect/blob/1a32c5af37f3dc8dabe4e8eedeeb21aea16ce139/src/matcher/ToEndWith.php#L73-L79 |
zicht/z | src/Zicht/Tool/Script/Node/Task/ArgNode.php | ArgNode.compile | public function compile(Buffer $buffer)
{
$name = explode('.', $this->name);
$phpName = Util::toPhp($name);
if ($this->conditional) {
if ($this->multiple) {
$buffer->writeln(sprintf('if ($z->isEmpty(%1$s) || array() === $z->get(%1$s)) {', $phpName))->indent(1);
... | php | public function compile(Buffer $buffer)
{
$name = explode('.', $this->name);
$phpName = Util::toPhp($name);
if ($this->conditional) {
if ($this->multiple) {
$buffer->writeln(sprintf('if ($z->isEmpty(%1$s) || array() === $z->get(%1$s)) {', $phpName))->indent(1);
... | [
"public",
"function",
"compile",
"(",
"Buffer",
"$",
"buffer",
")",
"{",
"$",
"name",
"=",
"explode",
"(",
"'.'",
",",
"$",
"this",
"->",
"name",
")",
";",
"$",
"phpName",
"=",
"Util",
"::",
"toPhp",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
... | Compiles the arg node.
@param \Zicht\Tool\Script\Buffer $buffer
@return void | [
"Compiles",
"the",
"arg",
"node",
"."
] | train | https://github.com/zicht/z/blob/6a1731dad20b018555a96b726a61d4bf8ec8c886/src/Zicht/Tool/Script/Node/Task/ArgNode.php#L49-L84 |
heidelpay/PhpDoc | src/phpDocumentor/Command/Project/RunCommand.php | RunCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$parse_command = $this->getApplication()->find('project:parse');
$transform_command = $this->getApplication()->find('project:transform');
$parse_input = new ArrayInput(
array(
'comm... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$parse_command = $this->getApplication()->find('project:parse');
$transform_command = $this->getApplication()->find('project:transform');
$parse_input = new ArrayInput(
array(
'comm... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"parse_command",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"find",
"(",
"'project:parse'",
")",
";",
"$",
"transfor... | Executes the business logic involved with this command.
@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return int | [
"Executes",
"the",
"business",
"logic",
"involved",
"with",
"this",
"command",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Command/Project/RunCommand.php#L229-L287 |
oroinc/OroLayoutComponent | Loader/Driver/YamlDriver.php | YamlDriver.loadResourceGeneratorData | protected function loadResourceGeneratorData($file)
{
$data = Yaml::parse(file_get_contents($file));
$data = isset($data['layout']) ? $data['layout'] : [];
return new GeneratorData($data, $file);
} | php | protected function loadResourceGeneratorData($file)
{
$data = Yaml::parse(file_get_contents($file));
$data = isset($data['layout']) ? $data['layout'] : [];
return new GeneratorData($data, $file);
} | [
"protected",
"function",
"loadResourceGeneratorData",
"(",
"$",
"file",
")",
"{",
"$",
"data",
"=",
"Yaml",
"::",
"parse",
"(",
"file_get_contents",
"(",
"$",
"file",
")",
")",
";",
"$",
"data",
"=",
"isset",
"(",
"$",
"data",
"[",
"'layout'",
"]",
")"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oroinc/OroLayoutComponent/blob/682a96672393d81c63728e47c4a4c3618c515be0/Loader/Driver/YamlDriver.php#L28-L34 |
weew/http | src/Weew/Http/HttpResponse.php | HttpResponse.extend | public function extend(IHttpResponse $response) {
$this->setHeaders(clone($response->getHeaders()));
$this->setProtocol($response->getProtocol());
$this->setProtocolVersion($response->getProtocolVersion());
$this->setStatusCode($response->getStatusCode());
$this->setContent($resp... | php | public function extend(IHttpResponse $response) {
$this->setHeaders(clone($response->getHeaders()));
$this->setProtocol($response->getProtocol());
$this->setProtocolVersion($response->getProtocolVersion());
$this->setStatusCode($response->getStatusCode());
$this->setContent($resp... | [
"public",
"function",
"extend",
"(",
"IHttpResponse",
"$",
"response",
")",
"{",
"$",
"this",
"->",
"setHeaders",
"(",
"clone",
"(",
"$",
"response",
"->",
"getHeaders",
"(",
")",
")",
")",
";",
"$",
"this",
"->",
"setProtocol",
"(",
"$",
"response",
"... | Extend current response with another.
@param IHttpResponse $response | [
"Extend",
"current",
"response",
"with",
"another",
"."
] | train | https://github.com/weew/http/blob/fd34d3d5643ca01c8e0946e888224a8e8dcc3c0d/src/Weew/Http/HttpResponse.php#L311-L320 |
raideer/twitch-api | src/Resources/Search.php | Search.searchChannels | public function searchChannels($query, $params = [])
{
$defaults = [
'query' => urlencode($query),
'limit' => 25,
'offset' => 0,
];
return $this->wrapper->request('GET', 'search/channels', ['query' => $this->resolveOptions($params, $defaults)]);
} | php | public function searchChannels($query, $params = [])
{
$defaults = [
'query' => urlencode($query),
'limit' => 25,
'offset' => 0,
];
return $this->wrapper->request('GET', 'search/channels', ['query' => $this->resolveOptions($params, $defaults)]);
} | [
"public",
"function",
"searchChannels",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'query'",
"=>",
"urlencode",
"(",
"$",
"query",
")",
",",
"'limit'",
"=>",
"25",
",",
"'offset'",
"=>",
"0",
",",
"]... | Returns a list of channel objects matching the search query.
Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/search.md#get-searchchannels
@param string $query Search query
@param array $params Optional parameters
@return array | [
"Returns",
"a",
"list",
"of",
"channel",
"objects",
"matching",
"the",
"search",
"query",
"."
] | train | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Search.php#L31-L40 |
raideer/twitch-api | src/Resources/Search.php | Search.searchStreams | public function searchStreams($query, $params = [])
{
$defaults = [
'query' => urlencode($query),
'limit' => 25,
'offset' => 0,
'hls' => null,
];
return $this->wrapper->request('GET', 'search/streams', ['query' => $this->resolveOptions($params, $defaults)]);
} | php | public function searchStreams($query, $params = [])
{
$defaults = [
'query' => urlencode($query),
'limit' => 25,
'offset' => 0,
'hls' => null,
];
return $this->wrapper->request('GET', 'search/streams', ['query' => $this->resolveOptions($params, $defaults)]);
} | [
"public",
"function",
"searchStreams",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'query'",
"=>",
"urlencode",
"(",
"$",
"query",
")",
",",
"'limit'",
"=>",
"25",
",",
"'offset'",
"=>",
"0",
",",
"'h... | Returns a list of stream objects matching the search query.
Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/search.md#get-searchstreams
@param string $query Search query
@param array $params Optional params
@return array | [
"Returns",
"a",
"list",
"of",
"stream",
"objects",
"matching",
"the",
"search",
"query",
"."
] | train | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Search.php#L53-L63 |
raideer/twitch-api | src/Resources/Search.php | Search.searchGames | public function searchGames($query, $params = [])
{
$defaults = [
'query' => urlencode($query),
'limit' => 25,
'type' => 'suggest',
'live' => false,
];
return $this->wrapper->request('GET', 'search/games', ['query' => $this->resolveOptions($params, $default... | php | public function searchGames($query, $params = [])
{
$defaults = [
'query' => urlencode($query),
'limit' => 25,
'type' => 'suggest',
'live' => false,
];
return $this->wrapper->request('GET', 'search/games', ['query' => $this->resolveOptions($params, $default... | [
"public",
"function",
"searchGames",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"defaults",
"=",
"[",
"'query'",
"=>",
"urlencode",
"(",
"$",
"query",
")",
",",
"'limit'",
"=>",
"25",
",",
"'type'",
"=>",
"'suggest'",
",",
... | Returns a list of game objects matching the search query.
Learn more:
https://github.com/justintv/Twitch-API/blob/master/v3_resources/search.md#get-searchgames
@param string $query Search query
@param array $params Optional params
@return array | [
"Returns",
"a",
"list",
"of",
"game",
"objects",
"matching",
"the",
"search",
"query",
"."
] | train | https://github.com/raideer/twitch-api/blob/27ebf1dcb0315206300d507600b6a82ebe33d57e/src/Resources/Search.php#L76-L86 |
zhouyl/mellivora | Mellivora/Cache/Manager.php | Manager.setDefault | public function setDefault($name)
{
$name = strtolower($name);
if (!isset($this->drivers[$name])) {
throw new InvalidArgumentException(
"Unregistered cache driver name '$name'"
);
}
$this->default = $name;
return $this;
} | php | public function setDefault($name)
{
$name = strtolower($name);
if (!isset($this->drivers[$name])) {
throw new InvalidArgumentException(
"Unregistered cache driver name '$name'"
);
}
$this->default = $name;
return $this;
} | [
"public",
"function",
"setDefault",
"(",
"$",
"name",
")",
"{",
"$",
"name",
"=",
"strtolower",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"drivers",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"Invalid... | 设定默认的缓存名称
@param string $name
@throws \Symfony\Component\Cache\Exception\InvalidArgumentException
@return \Mellivora\Cache\Manager | [
"设定默认的缓存名称"
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/Manager.php#L66-L79 |
zhouyl/mellivora | Mellivora/Cache/Manager.php | Manager.setDrivers | public function setDrivers(array $drivers)
{
foreach ($drivers as $name => $config) {
$this->setDriver($name, $config);
}
return $this;
} | php | public function setDrivers(array $drivers)
{
foreach ($drivers as $name => $config) {
$this->setDriver($name, $config);
}
return $this;
} | [
"public",
"function",
"setDrivers",
"(",
"array",
"$",
"drivers",
")",
"{",
"foreach",
"(",
"$",
"drivers",
"as",
"$",
"name",
"=>",
"$",
"config",
")",
"{",
"$",
"this",
"->",
"setDriver",
"(",
"$",
"name",
",",
"$",
"config",
")",
";",
"}",
"retu... | 批量设定缓存驱动配置
@param array $drivers
@return \Mellivora\Cache\Manager | [
"批量设定缓存驱动配置"
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/Manager.php#L104-L111 |
zhouyl/mellivora | Mellivora/Cache/Manager.php | Manager.setDriver | public function setDriver($name, array $config)
{
if (!isset($config['connector'])) {
$config['connector'] = NullConnector::class;
}
$this->drivers[strtolower($name)] = $config;
return $this;
} | php | public function setDriver($name, array $config)
{
if (!isset($config['connector'])) {
$config['connector'] = NullConnector::class;
}
$this->drivers[strtolower($name)] = $config;
return $this;
} | [
"public",
"function",
"setDriver",
"(",
"$",
"name",
",",
"array",
"$",
"config",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"config",
"[",
"'connector'",
"]",
")",
")",
"{",
"$",
"config",
"[",
"'connector'",
"]",
"=",
"NullConnector",
"::",
"clas... | 设定缓存驱动配置
@param string $name
@param array $config
@return \Mellivora\Cache\Manager | [
"设定缓存驱动配置"
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/Manager.php#L121-L130 |
zhouyl/mellivora | Mellivora/Cache/Manager.php | Manager.getConnector | protected function getConnector($name)
{
$config = isset($this->drivers[$name]) ? $this->drivers[$name] : false;
if ($config === false) {
throw new InvalidArgumentException(
"Unregistered cache driver name '$name'"
);
}
if (!isset($this->conn... | php | protected function getConnector($name)
{
$config = isset($this->drivers[$name]) ? $this->drivers[$name] : false;
if ($config === false) {
throw new InvalidArgumentException(
"Unregistered cache driver name '$name'"
);
}
if (!isset($this->conn... | [
"protected",
"function",
"getConnector",
"(",
"$",
"name",
")",
"{",
"$",
"config",
"=",
"isset",
"(",
"$",
"this",
"->",
"drivers",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"this",
"->",
"drivers",
"[",
"$",
"name",
"]",
":",
"false",
";",
"if",
"(... | 根据名称获取缓存构造器
@param string $name
@throws \Symfony\Component\Cache\Exception\InvalidArgumentException
@return \Mellivora\Cache\Connector | [
"根据名称获取缓存构造器"
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/Manager.php#L141-L164 |
zhouyl/mellivora | Mellivora/Cache/Manager.php | Manager.getCache | public function getCache($name)
{
$cache = $this->getConnector($name)->getCacheAdapter();
if ($this->logger instanceof LoggerInterface) {
$cache->setLogger($this->logger);
}
return $cache;
} | php | public function getCache($name)
{
$cache = $this->getConnector($name)->getCacheAdapter();
if ($this->logger instanceof LoggerInterface) {
$cache->setLogger($this->logger);
}
return $cache;
} | [
"public",
"function",
"getCache",
"(",
"$",
"name",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"getConnector",
"(",
"$",
"name",
")",
"->",
"getCacheAdapter",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"logger",
"instanceof",
"LoggerInterface",
... | 获取 psr-6 标准 cache 适配器
@param string $name
@return \Symfony\Component\Cache\Adapter\AbstractAdapter | [
"获取",
"psr",
"-",
"6",
"标准",
"cache",
"适配器"
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/Manager.php#L173-L182 |
zhouyl/mellivora | Mellivora/Cache/Manager.php | Manager.getSimpleCache | public function getSimpleCache($name)
{
$cache = $this->getConnector($name)->getSimpleCacheAdapter();
if ($this->logger instanceof LoggerInterface) {
$cache->setLogger($this->logger);
}
return $cache;
} | php | public function getSimpleCache($name)
{
$cache = $this->getConnector($name)->getSimpleCacheAdapter();
if ($this->logger instanceof LoggerInterface) {
$cache->setLogger($this->logger);
}
return $cache;
} | [
"public",
"function",
"getSimpleCache",
"(",
"$",
"name",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"getConnector",
"(",
"$",
"name",
")",
"->",
"getSimpleCacheAdapter",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"logger",
"instanceof",
"LoggerIn... | 获取 psr-16 标准 simple-cache 适配器
@param string $name
@return \Symfony\Component\Cache\Simple\AbstractCache | [
"获取",
"psr",
"-",
"16",
"标准",
"simple",
"-",
"cache",
"适配器"
] | train | https://github.com/zhouyl/mellivora/blob/79f844c5c9c25ffbe18d142062e9bc3df00b36a1/Mellivora/Cache/Manager.php#L191-L200 |
php-lug/lug | src/Component/Grid/View/GridView.php | GridView.getDataSource | public function getDataSource(array $options = [])
{
if ($this->definition !== null) {
$options = array_merge($this->definition->getOptions(), $options);
}
ksort($options);
return isset($this->cache[$hash = sha1(json_encode($options))])
? $this->cache[$hash]... | php | public function getDataSource(array $options = [])
{
if ($this->definition !== null) {
$options = array_merge($this->definition->getOptions(), $options);
}
ksort($options);
return isset($this->cache[$hash = sha1(json_encode($options))])
? $this->cache[$hash]... | [
"public",
"function",
"getDataSource",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"definition",
"!==",
"null",
")",
"{",
"$",
"options",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"definition",
"->",
"getOptio... | {@inheritdoc} | [
"{"
] | train | https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Grid/View/GridView.php#L59-L70 |
ekuiter/feature-php | FeaturePhp/Exporter/ZipExporter.php | ZipExporter.open | private function open() {
if (file_exists($this->target) && !unlink($this->target))
throw new ZipExporterException("could not remove existing zip archive at \"$this->target\"");
$zip = new \ZipArchive();
if (!$zip->open($this->target, \ZipArchive::CREATE))
throw ... | php | private function open() {
if (file_exists($this->target) && !unlink($this->target))
throw new ZipExporterException("could not remove existing zip archive at \"$this->target\"");
$zip = new \ZipArchive();
if (!$zip->open($this->target, \ZipArchive::CREATE))
throw ... | [
"private",
"function",
"open",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"target",
")",
"&&",
"!",
"unlink",
"(",
"$",
"this",
"->",
"target",
")",
")",
"throw",
"new",
"ZipExporterException",
"(",
"\"could not remove existing zip arch... | Opens and returns the targeted ZIP archive.
@return \ZipArchive | [
"Opens",
"and",
"returns",
"the",
"targeted",
"ZIP",
"archive",
"."
] | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/ZipExporter.php#L41-L49 |
ekuiter/feature-php | FeaturePhp/Exporter/ZipExporter.php | ZipExporter.export | public function export($product) {
$productLineName = $product->getProductLine()->getName();
$files = $product->generateFiles();
$zip = $this->open();
if (count($files) === 0)
$files[] = new fphp\File\TextFile("NOTICE", "No files were generated.");
f... | php | public function export($product) {
$productLineName = $product->getProductLine()->getName();
$files = $product->generateFiles();
$zip = $this->open();
if (count($files) === 0)
$files[] = new fphp\File\TextFile("NOTICE", "No files were generated.");
f... | [
"public",
"function",
"export",
"(",
"$",
"product",
")",
"{",
"$",
"productLineName",
"=",
"$",
"product",
"->",
"getProductLine",
"(",
")",
"->",
"getName",
"(",
")",
";",
"$",
"files",
"=",
"$",
"product",
"->",
"generateFiles",
"(",
")",
";",
"$",
... | Exports a product as a ZIP archive.
Every generated file is added to the archive at its target path. If there are no files,
a NOTICE file is generated because \ZipArchive does not support saving an empty ZIP archive.
The archive's root directory has the product line's name.
@param \FeaturePhp\ProductLine\Product $produ... | [
"Exports",
"a",
"product",
"as",
"a",
"ZIP",
"archive",
".",
"Every",
"generated",
"file",
"is",
"added",
"to",
"the",
"archive",
"at",
"its",
"target",
"path",
".",
"If",
"there",
"are",
"no",
"files",
"a",
"NOTICE",
"file",
"is",
"generated",
"because"... | train | https://github.com/ekuiter/feature-php/blob/daf4a59098802fedcfd1f1a1d07847fcf2fea7bf/FeaturePhp/Exporter/ZipExporter.php#L67-L80 |
frdl/webfan | .ApplicationComposer/lib/frdl/webfan/Autoloading/SourceLoader.php | SourceLoader.addPsr0 | public function addPsr0($prefix, $base_dir, $prepend = false)
{
$prefix = trim($prefix, '\\') . '\\';
$base_dir = rtrim($base_dir, self::DS) . self::DS;
if(isset($this->autoloadersPsr0[$prefix]) === false) {
$this->autoloadersPsr0[$prefix] = array();
}
if($prepend... | php | public function addPsr0($prefix, $base_dir, $prepend = false)
{
$prefix = trim($prefix, '\\') . '\\';
$base_dir = rtrim($base_dir, self::DS) . self::DS;
if(isset($this->autoloadersPsr0[$prefix]) === false) {
$this->autoloadersPsr0[$prefix] = array();
}
if($prepend... | [
"public",
"function",
"addPsr0",
"(",
"$",
"prefix",
",",
"$",
"base_dir",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"$",
"prefix",
"=",
"trim",
"(",
"$",
"prefix",
",",
"'\\\\'",
")",
".",
"'\\\\'",
";",
"$",
"base_dir",
"=",
"rtrim",
"(",
"$",... | Psr-0 | [
"Psr",
"-",
"0"
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/webfan/Autoloading/SourceLoader.php#L344-L359 |
frdl/webfan | .ApplicationComposer/lib/frdl/webfan/Autoloading/SourceLoader.php | SourceLoader.addNamespace | public function addNamespace($prefix, $base_dir, $prepend = false)
{
return $this->addPsr4($prefix, $base_dir, $prepend);
} | php | public function addNamespace($prefix, $base_dir, $prepend = false)
{
return $this->addPsr4($prefix, $base_dir, $prepend);
} | [
"public",
"function",
"addNamespace",
"(",
"$",
"prefix",
",",
"$",
"base_dir",
",",
"$",
"prepend",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"addPsr4",
"(",
"$",
"prefix",
",",
"$",
"base_dir",
",",
"$",
"prepend",
")",
";",
"}"
] | Psr-4 | [
"Psr",
"-",
"4"
] | train | https://github.com/frdl/webfan/blob/84d270377685224e891cd9d571b103b36f05b845/.ApplicationComposer/lib/frdl/webfan/Autoloading/SourceLoader.php#L364-L367 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/TraitAssembler.php | TraitAssembler.create | public function create($data)
{
$traitDescriptor = new TraitDescriptor();
$traitDescriptor->setFullyQualifiedStructuralElementName($data->getName());
$traitDescriptor->setName($data->getShortName());
$traitDescriptor->setLine($data->getLinenumber());
$traitDescriptor->setPac... | php | public function create($data)
{
$traitDescriptor = new TraitDescriptor();
$traitDescriptor->setFullyQualifiedStructuralElementName($data->getName());
$traitDescriptor->setName($data->getShortName());
$traitDescriptor->setLine($data->getLinenumber());
$traitDescriptor->setPac... | [
"public",
"function",
"create",
"(",
"$",
"data",
")",
"{",
"$",
"traitDescriptor",
"=",
"new",
"TraitDescriptor",
"(",
")",
";",
"$",
"traitDescriptor",
"->",
"setFullyQualifiedStructuralElementName",
"(",
"$",
"data",
"->",
"getName",
"(",
")",
")",
";",
"... | Creates a Descriptor from the provided data.
@param TraitReflector $data
@return TraitDescriptor | [
"Creates",
"a",
"Descriptor",
"from",
"the",
"provided",
"data",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/TraitAssembler.php#L31-L51 |
heidelpay/PhpDoc | src/phpDocumentor/Descriptor/Builder/Reflector/TraitAssembler.php | TraitAssembler.addMethods | protected function addMethods($methods, $traitDescriptor)
{
foreach ($methods as $method) {
$methodDescriptor = $this->getBuilder()->buildDescriptor($method);
if ($methodDescriptor) {
$methodDescriptor->setParent($traitDescriptor);
$traitDescriptor->ge... | php | protected function addMethods($methods, $traitDescriptor)
{
foreach ($methods as $method) {
$methodDescriptor = $this->getBuilder()->buildDescriptor($method);
if ($methodDescriptor) {
$methodDescriptor->setParent($traitDescriptor);
$traitDescriptor->ge... | [
"protected",
"function",
"addMethods",
"(",
"$",
"methods",
",",
"$",
"traitDescriptor",
")",
"{",
"foreach",
"(",
"$",
"methods",
"as",
"$",
"method",
")",
"{",
"$",
"methodDescriptor",
"=",
"$",
"this",
"->",
"getBuilder",
"(",
")",
"->",
"buildDescripto... | Registers the child methods with the generated Trait Descriptor.
@param MethodReflector[] $methods
@param TraitDescriptor $traitDescriptor
@return void | [
"Registers",
"the",
"child",
"methods",
"with",
"the",
"generated",
"Trait",
"Descriptor",
"."
] | train | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Descriptor/Builder/Reflector/TraitAssembler.php#L80-L89 |
mothership-ec/composer | src/Composer/Command/InitCommand.php | InitCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$whitelist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license');
$options = array_filter(array_intersect_key($input->getOptions(), array_flip($whitelist)));
... | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$whitelist = array('name', 'description', 'author', 'type', 'homepage', 'require', 'require-dev', 'stability', 'license');
$options = array_filter(array_intersect_key($input->getOptions(), array_flip($whitelist)));
... | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"whitelist",
"=",
"array",
"(",
"'name'",
",",
"'description'",
",",
"'author'",
",",
"'type'",
",",
"'homepage'",
",",
"'require'",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Command/InitCommand.php#L79-L136 |
mothership-ec/composer | src/Composer/Command/InitCommand.php | InitCommand.interact | protected function interact(InputInterface $input, OutputInterface $output)
{
$git = $this->getGitConfig();
$formatter = $this->getHelperSet()->get('formatter');
$this->getIO()->writeError(array(
'',
$formatter->formatBlock('Welcome to the Composer config generator'... | php | protected function interact(InputInterface $input, OutputInterface $output)
{
$git = $this->getGitConfig();
$formatter = $this->getHelperSet()->get('formatter');
$this->getIO()->writeError(array(
'',
$formatter->formatBlock('Welcome to the Composer config generator'... | [
"protected",
"function",
"interact",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"git",
"=",
"$",
"this",
"->",
"getGitConfig",
"(",
")",
";",
"$",
"formatter",
"=",
"$",
"this",
"->",
"getHelperSet",
"(",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Command/InitCommand.php#L141-L282 |
mothership-ec/composer | src/Composer/Command/InitCommand.php | InitCommand.findBestVersionForPackage | private function findBestVersionForPackage(InputInterface $input, $name)
{
// find the latest version allowed in this pool
$versionSelector = new VersionSelector($this->getPool($input));
$package = $versionSelector->findBestCandidate($name);
if (!$package) {
throw new \I... | php | private function findBestVersionForPackage(InputInterface $input, $name)
{
// find the latest version allowed in this pool
$versionSelector = new VersionSelector($this->getPool($input));
$package = $versionSelector->findBestCandidate($name);
if (!$package) {
throw new \I... | [
"private",
"function",
"findBestVersionForPackage",
"(",
"InputInterface",
"$",
"input",
",",
"$",
"name",
")",
"{",
"// find the latest version allowed in this pool",
"$",
"versionSelector",
"=",
"new",
"VersionSelector",
"(",
"$",
"this",
"->",
"getPool",
"(",
"$",
... | Given a package name, this determines the best version to use in the require key.
This returns a version with the ~ operator prefixed when possible.
@param InputInterface $input
@param string $name
@return string
@throws \InvalidArgumentException | [
"Given",
"a",
"package",
"name",
"this",
"determines",
"the",
"best",
"version",
"to",
"use",
"in",
"the",
"require",
"key",
"."
] | train | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Command/InitCommand.php#L594-L609 |
meta-tech/pws-auth | src/MetaTech/Util/Tool.php | Tool.formatDate | public static function formatDate($date, $fromFormat='d-m-Y', $toFormat='Y-m-d')
{
$dt = \DateTime::createFromFormat($fromFormat, $date);
return !$dt ? null : $dt->format($toFormat);
} | php | public static function formatDate($date, $fromFormat='d-m-Y', $toFormat='Y-m-d')
{
$dt = \DateTime::createFromFormat($fromFormat, $date);
return !$dt ? null : $dt->format($toFormat);
} | [
"public",
"static",
"function",
"formatDate",
"(",
"$",
"date",
",",
"$",
"fromFormat",
"=",
"'d-m-Y'",
",",
"$",
"toFormat",
"=",
"'Y-m-d'",
")",
"{",
"$",
"dt",
"=",
"\\",
"DateTime",
"::",
"createFromFormat",
"(",
"$",
"fromFormat",
",",
"$",
"date",
... | /*!
@method formatDate
@public
@static
@param str $date
@param str $fromFormat
@param str $toFormat
@return str | [
"/",
"*",
"!"
] | train | https://github.com/meta-tech/pws-auth/blob/6ba2727cf82470ffbda65925b077fadcd64a77ee/src/MetaTech/Util/Tool.php#L57-L61 |
meta-tech/pws-auth | src/MetaTech/Util/Tool.php | Tool.dateFromTime | public static function dateFromTime($time=null)
{
return date(self::TIMESTAMP_SQLDATETIME, $time==null ? microtime(true) : $time);
} | php | public static function dateFromTime($time=null)
{
return date(self::TIMESTAMP_SQLDATETIME, $time==null ? microtime(true) : $time);
} | [
"public",
"static",
"function",
"dateFromTime",
"(",
"$",
"time",
"=",
"null",
")",
"{",
"return",
"date",
"(",
"self",
"::",
"TIMESTAMP_SQLDATETIME",
",",
"$",
"time",
"==",
"null",
"?",
"microtime",
"(",
"true",
")",
":",
"$",
"time",
")",
";",
"}"
] | /*!
@public
@static
@param float $time
@return string sqldatetime format | [
"/",
"*",
"!"
] | train | https://github.com/meta-tech/pws-auth/blob/6ba2727cf82470ffbda65925b077fadcd64a77ee/src/MetaTech/Util/Tool.php#L70-L73 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.