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 |
|---|---|---|---|---|---|---|---|---|---|---|
commerceguys/addressing | src/AddressFormat/AddressFormat.php | AddressFormat.getUsedSubdivisionFields | public function getUsedSubdivisionFields()
{
$fields = [
AddressField::ADMINISTRATIVE_AREA,
AddressField::LOCALITY,
AddressField::DEPENDENT_LOCALITY,
];
// Remove fields not used by the format, and reset the keys.
$fields = array_intersect($fields,... | php | public function getUsedSubdivisionFields()
{
$fields = [
AddressField::ADMINISTRATIVE_AREA,
AddressField::LOCALITY,
AddressField::DEPENDENT_LOCALITY,
];
// Remove fields not used by the format, and reset the keys.
$fields = array_intersect($fields,... | [
"public",
"function",
"getUsedSubdivisionFields",
"(",
")",
"{",
"$",
"fields",
"=",
"[",
"AddressField",
"::",
"ADMINISTRATIVE_AREA",
",",
"AddressField",
"::",
"LOCALITY",
",",
"AddressField",
"::",
"DEPENDENT_LOCALITY",
",",
"]",
";",
"// Remove fields not used by ... | Gets the list of used subdivision fields.
@return array An array of address fields. | [
"Gets",
"the",
"list",
"of",
"used",
"subdivision",
"fields",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/AddressFormat/AddressFormat.php#L262-L274 |
commerceguys/addressing | src/Country/CountryRepository.php | CountryRepository.get | public function get($countryCode, $locale = null)
{
$countryCode = strtoupper($countryCode);
$baseDefinitions = $this->getBaseDefinitions();
if (!isset($baseDefinitions[$countryCode])) {
throw new UnknownCountryException($countryCode);
}
$locale = $locale ?: $this... | php | public function get($countryCode, $locale = null)
{
$countryCode = strtoupper($countryCode);
$baseDefinitions = $this->getBaseDefinitions();
if (!isset($baseDefinitions[$countryCode])) {
throw new UnknownCountryException($countryCode);
}
$locale = $locale ?: $this... | [
"public",
"function",
"get",
"(",
"$",
"countryCode",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"countryCode",
"=",
"strtoupper",
"(",
"$",
"countryCode",
")",
";",
"$",
"baseDefinitions",
"=",
"$",
"this",
"->",
"getBaseDefinitions",
"(",
")",
";"... | {@inheritdoc} | [
"{"
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Country/CountryRepository.php#L102-L122 |
commerceguys/addressing | src/Country/CountryRepository.php | CountryRepository.getAll | public function getAll($locale = null)
{
$locale = $locale ?: $this->defaultLocale;
$locale = Locale::resolve($this->availableLocales, $locale, $this->fallbackLocale);
$baseDefinitions = $this->getBaseDefinitions();
$definitions = $this->loadDefinitions($locale);
$countries =... | php | public function getAll($locale = null)
{
$locale = $locale ?: $this->defaultLocale;
$locale = Locale::resolve($this->availableLocales, $locale, $this->fallbackLocale);
$baseDefinitions = $this->getBaseDefinitions();
$definitions = $this->loadDefinitions($locale);
$countries =... | [
"public",
"function",
"getAll",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"defaultLocale",
";",
"$",
"locale",
"=",
"Locale",
"::",
"resolve",
"(",
"$",
"this",
"->",
"availableLocales",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Country/CountryRepository.php#L127-L146 |
commerceguys/addressing | src/Country/CountryRepository.php | CountryRepository.getList | public function getList($locale = null)
{
$locale = $locale ?: $this->defaultLocale;
$locale = Locale::resolve($this->availableLocales, $locale, $this->fallbackLocale);
$definitions = $this->loadDefinitions($locale);
$list = [];
foreach ($definitions as $countryCode => $count... | php | public function getList($locale = null)
{
$locale = $locale ?: $this->defaultLocale;
$locale = Locale::resolve($this->availableLocales, $locale, $this->fallbackLocale);
$definitions = $this->loadDefinitions($locale);
$list = [];
foreach ($definitions as $countryCode => $count... | [
"public",
"function",
"getList",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"locale",
"=",
"$",
"locale",
"?",
":",
"$",
"this",
"->",
"defaultLocale",
";",
"$",
"locale",
"=",
"Locale",
"::",
"resolve",
"(",
"$",
"this",
"->",
"availableLocales",... | {@inheritdoc} | [
"{"
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Country/CountryRepository.php#L151-L162 |
commerceguys/addressing | src/Country/CountryRepository.php | CountryRepository.loadDefinitions | protected function loadDefinitions($locale)
{
if (!isset($this->definitions[$locale])) {
$filename = $this->definitionPath . $locale . '.json';
$this->definitions[$locale] = json_decode(file_get_contents($filename), true);
}
return $this->definitions[$locale];
} | php | protected function loadDefinitions($locale)
{
if (!isset($this->definitions[$locale])) {
$filename = $this->definitionPath . $locale . '.json';
$this->definitions[$locale] = json_decode(file_get_contents($filename), true);
}
return $this->definitions[$locale];
} | [
"protected",
"function",
"loadDefinitions",
"(",
"$",
"locale",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"definitions",
"[",
"$",
"locale",
"]",
")",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"definitionPath",
".",
"$",
"lo... | Loads the country definitions for the provided locale.
@param string $locale The desired locale.
@return array | [
"Loads",
"the",
"country",
"definitions",
"for",
"the",
"provided",
"locale",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Country/CountryRepository.php#L171-L179 |
commerceguys/addressing | src/Country/CountryRepository.php | CountryRepository.getBaseDefinitions | protected function getBaseDefinitions()
{
return [
'AC' => ['ASC', null, 'SHP'],
'AD' => ['AND', '020', 'EUR'],
'AE' => ['ARE', '784', 'AED'],
'AF' => ['AFG', '004', 'AFN'],
'AG' => ['ATG', '028', 'XCD'],
'AI' => ['AIA', '660', 'XCD'],
... | php | protected function getBaseDefinitions()
{
return [
'AC' => ['ASC', null, 'SHP'],
'AD' => ['AND', '020', 'EUR'],
'AE' => ['ARE', '784', 'AED'],
'AF' => ['AFG', '004', 'AFN'],
'AG' => ['ATG', '028', 'XCD'],
'AI' => ['AIA', '660', 'XCD'],
... | [
"protected",
"function",
"getBaseDefinitions",
"(",
")",
"{",
"return",
"[",
"'AC'",
"=>",
"[",
"'ASC'",
",",
"null",
",",
"'SHP'",
"]",
",",
"'AD'",
"=>",
"[",
"'AND'",
",",
"'020'",
",",
"'EUR'",
"]",
",",
"'AE'",
"=>",
"[",
"'ARE'",
",",
"'784'",
... | Gets the base country definitions.
Contains data common to all locales: three letter code, numeric code.
@return array
An array of definitions, keyed by country code.
Each definition is a numerically indexed array containing:
- The three letter code.
- The numeric code.
- The currency code. | [
"Gets",
"the",
"base",
"country",
"definitions",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Country/CountryRepository.php#L193-L453 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.get | public function get($code, array $parents)
{
$definitions = $this->loadDefinitions($parents);
return $this->createSubdivisionFromDefinitions($code, $definitions);
} | php | public function get($code, array $parents)
{
$definitions = $this->loadDefinitions($parents);
return $this->createSubdivisionFromDefinitions($code, $definitions);
} | [
"public",
"function",
"get",
"(",
"$",
"code",
",",
"array",
"$",
"parents",
")",
"{",
"$",
"definitions",
"=",
"$",
"this",
"->",
"loadDefinitions",
"(",
"$",
"parents",
")",
";",
"return",
"$",
"this",
"->",
"createSubdivisionFromDefinitions",
"(",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L59-L63 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.getAll | public function getAll(array $parents)
{
$definitions = $this->loadDefinitions($parents);
if (empty($definitions)) {
return [];
}
$subdivisions = [];
foreach (array_keys($definitions['subdivisions']) as $code) {
$subdivisions[$code] = $this->createSub... | php | public function getAll(array $parents)
{
$definitions = $this->loadDefinitions($parents);
if (empty($definitions)) {
return [];
}
$subdivisions = [];
foreach (array_keys($definitions['subdivisions']) as $code) {
$subdivisions[$code] = $this->createSub... | [
"public",
"function",
"getAll",
"(",
"array",
"$",
"parents",
")",
"{",
"$",
"definitions",
"=",
"$",
"this",
"->",
"loadDefinitions",
"(",
"$",
"parents",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"definitions",
")",
")",
"{",
"return",
"[",
"]",
";",... | {@inheritdoc} | [
"{"
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L68-L81 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.getList | public function getList(array $parents, $locale = null)
{
$definitions = $this->loadDefinitions($parents);
if (empty($definitions)) {
return [];
}
$definitionLocale = isset($definitions['locale']) ? $definitions['locale'] : '';
$useLocalName = Locale::matchCandid... | php | public function getList(array $parents, $locale = null)
{
$definitions = $this->loadDefinitions($parents);
if (empty($definitions)) {
return [];
}
$definitionLocale = isset($definitions['locale']) ? $definitions['locale'] : '';
$useLocalName = Locale::matchCandid... | [
"public",
"function",
"getList",
"(",
"array",
"$",
"parents",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"definitions",
"=",
"$",
"this",
"->",
"loadDefinitions",
"(",
"$",
"parents",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"definitions",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L86-L101 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.hasData | protected function hasData(array $parents)
{
$countryCode = $parents[0];
$addressFormat = $this->addressFormatRepository->get($countryCode);
$depth = $addressFormat->getSubdivisionDepth();
if ($depth == 0) {
return false;
}
// At least the first level has ... | php | protected function hasData(array $parents)
{
$countryCode = $parents[0];
$addressFormat = $this->addressFormatRepository->get($countryCode);
$depth = $addressFormat->getSubdivisionDepth();
if ($depth == 0) {
return false;
}
// At least the first level has ... | [
"protected",
"function",
"hasData",
"(",
"array",
"$",
"parents",
")",
"{",
"$",
"countryCode",
"=",
"$",
"parents",
"[",
"0",
"]",
";",
"$",
"addressFormat",
"=",
"$",
"this",
"->",
"addressFormatRepository",
"->",
"get",
"(",
"$",
"countryCode",
")",
"... | Checks whether predefined subdivisions exist for the provided parents.
@param array $parents The parents (country code, subdivision codes).
@return bool TRUE if predefined subdivisions exist for the provided
parents, FALSE otherwise. | [
"Checks",
"whether",
"predefined",
"subdivisions",
"exist",
"for",
"the",
"provided",
"parents",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L111-L139 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.loadDefinitions | protected function loadDefinitions(array $parents)
{
$group = $this->buildGroup($parents);
if (isset($this->definitions[$group])) {
return $this->definitions[$group];
}
// If there are predefined subdivisions at this level, try to load them.
$this->definitions[$g... | php | protected function loadDefinitions(array $parents)
{
$group = $this->buildGroup($parents);
if (isset($this->definitions[$group])) {
return $this->definitions[$group];
}
// If there are predefined subdivisions at this level, try to load them.
$this->definitions[$g... | [
"protected",
"function",
"loadDefinitions",
"(",
"array",
"$",
"parents",
")",
"{",
"$",
"group",
"=",
"$",
"this",
"->",
"buildGroup",
"(",
"$",
"parents",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"definitions",
"[",
"$",
"group",
"]",
... | Loads the subdivision definitions for the provided parents.
@param array $parents The parents (country code, subdivision codes).
@return array The subdivision definitions. | [
"Loads",
"the",
"subdivision",
"definitions",
"for",
"the",
"provided",
"parents",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L148-L166 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.processDefinitions | protected function processDefinitions(array $definitions)
{
foreach ($definitions['subdivisions'] as $code => &$definition) {
// Add common keys from the root level.
$definition['country_code'] = $definitions['country_code'];
if (isset($definitions['locale'])) {
... | php | protected function processDefinitions(array $definitions)
{
foreach ($definitions['subdivisions'] as $code => &$definition) {
// Add common keys from the root level.
$definition['country_code'] = $definitions['country_code'];
if (isset($definitions['locale'])) {
... | [
"protected",
"function",
"processDefinitions",
"(",
"array",
"$",
"definitions",
")",
"{",
"foreach",
"(",
"$",
"definitions",
"[",
"'subdivisions'",
"]",
"as",
"$",
"code",
"=>",
"&",
"$",
"definition",
")",
"{",
"// Add common keys from the root level.",
"$",
... | Processes the loaded definitions.
Adds keys and values that were removed from the JSON files for brevity.
@param array $definitions The definitions.
@return array The processed definitions. | [
"Processes",
"the",
"loaded",
"definitions",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L177-L196 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.buildGroup | protected function buildGroup(array $parents)
{
if (empty($parents)) {
throw new \InvalidArgumentException('The $parents argument must not be empty.');
}
$countryCode = array_shift($parents);
$group = strtoupper($countryCode);
if ($parents) {
// A dash... | php | protected function buildGroup(array $parents)
{
if (empty($parents)) {
throw new \InvalidArgumentException('The $parents argument must not be empty.');
}
$countryCode = array_shift($parents);
$group = strtoupper($countryCode);
if ($parents) {
// A dash... | [
"protected",
"function",
"buildGroup",
"(",
"array",
"$",
"parents",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"parents",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'The $parents argument must not be empty.'",
")",
";",
"}",
"$",
"cou... | Builds a group from the provided parents.
Used for storing a country's subdivisions of a specific level.
@param array $parents The parents (country code, subdivision codes).
@return string The group. | [
"Builds",
"a",
"group",
"from",
"the",
"provided",
"parents",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L207-L225 |
commerceguys/addressing | src/Subdivision/SubdivisionRepository.php | SubdivisionRepository.createSubdivisionFromDefinitions | protected function createSubdivisionFromDefinitions($code, array $definitions)
{
if (!isset($definitions['subdivisions'][$code])) {
// No matching definition found.
return null;
}
$definition = $definitions['subdivisions'][$code];
// The 'parents' key is omit... | php | protected function createSubdivisionFromDefinitions($code, array $definitions)
{
if (!isset($definitions['subdivisions'][$code])) {
// No matching definition found.
return null;
}
$definition = $definitions['subdivisions'][$code];
// The 'parents' key is omit... | [
"protected",
"function",
"createSubdivisionFromDefinitions",
"(",
"$",
"code",
",",
"array",
"$",
"definitions",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"definitions",
"[",
"'subdivisions'",
"]",
"[",
"$",
"code",
"]",
")",
")",
"{",
"// No matching def... | Creates a subdivision object from the provided definitions.
@param int $code The subdivision code.
@param array $definitions The subdivision definitions.
@return Subdivision | [
"Creates",
"a",
"subdivision",
"object",
"from",
"the",
"provided",
"definitions",
"."
] | train | https://github.com/commerceguys/addressing/blob/43e974be8b523d9295b7a520fd4f66cc3246749b/src/Subdivision/SubdivisionRepository.php#L235-L268 |
salsify/jsonstreamingparser | src/Listener/InMemoryListener.php | InMemoryListener.insertValue | protected function insertValue($value): void
{
// Grab the top item from the stack that we're currently parsing.
$currentItem = array_pop($this->stack);
// Examine the current item, and then:
// - if it's an object, associate the newly-parsed value with the most recent key
... | php | protected function insertValue($value): void
{
// Grab the top item from the stack that we're currently parsing.
$currentItem = array_pop($this->stack);
// Examine the current item, and then:
// - if it's an object, associate the newly-parsed value with the most recent key
... | [
"protected",
"function",
"insertValue",
"(",
"$",
"value",
")",
":",
"void",
"{",
"// Grab the top item from the stack that we're currently parsing.",
"$",
"currentItem",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"stack",
")",
";",
"// Examine the current item, and then:"... | based on whether that value is an array or an object. | [
"based",
"on",
"whether",
"that",
"value",
"is",
"an",
"array",
"or",
"an",
"object",
"."
] | train | https://github.com/salsify/jsonstreamingparser/blob/20cb85b65e36c613c1f9dffd919be61194b501bc/src/Listener/InMemoryListener.php#L93-L109 |
salsify/jsonstreamingparser | src/Listener/CorruptedJsonListener.php | CorruptedJsonListener.value | public function value($value): void
{
$obj = array_pop($this->stack);
if (!empty($this->keys[$this->level])) {
$obj[$this->keys[$this->level]] = $value;
$this->keys[$this->level] = null;
} else {
$obj[] = $value;
}
$this->stack[] = $obj;
... | php | public function value($value): void
{
$obj = array_pop($this->stack);
if (!empty($this->keys[$this->level])) {
$obj[$this->keys[$this->level]] = $value;
$this->keys[$this->level] = null;
} else {
$obj[] = $value;
}
$this->stack[] = $obj;
... | [
"public",
"function",
"value",
"(",
"$",
"value",
")",
":",
"void",
"{",
"$",
"obj",
"=",
"array_pop",
"(",
"$",
"this",
"->",
"stack",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"keys",
"[",
"$",
"this",
"->",
"level",
"]",
")"... | Value may be a string, integer, boolean, null. | [
"Value",
"may",
"be",
"a",
"string",
"integer",
"boolean",
"null",
"."
] | train | https://github.com/salsify/jsonstreamingparser/blob/20cb85b65e36c613c1f9dffd919be61194b501bc/src/Listener/CorruptedJsonListener.php#L74-L84 |
salsify/jsonstreamingparser | src/Listener/CorruptedJsonListener.php | CorruptedJsonListener.forceEndDocument | public function forceEndDocument(): void
{
if (empty($this->stack)) {
return;
}
$key = $this->keys;
for ($i = $this->level - 1; $i > 0; --$i) {
$value = array_pop($this->stack);
//value
$obj = array_pop($this->stack);
if (!... | php | public function forceEndDocument(): void
{
if (empty($this->stack)) {
return;
}
$key = $this->keys;
for ($i = $this->level - 1; $i > 0; --$i) {
$value = array_pop($this->stack);
//value
$obj = array_pop($this->stack);
if (!... | [
"public",
"function",
"forceEndDocument",
"(",
")",
":",
"void",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"stack",
")",
")",
"{",
"return",
";",
"}",
"$",
"key",
"=",
"$",
"this",
"->",
"keys",
";",
"for",
"(",
"$",
"i",
"=",
"$",
"this... | Forcefully finish the document, end all objects and arrays
and set final object to the json property. | [
"Forcefully",
"finish",
"the",
"document",
"end",
"all",
"objects",
"and",
"arrays",
"and",
"set",
"final",
"object",
"to",
"the",
"json",
"property",
"."
] | train | https://github.com/salsify/jsonstreamingparser/blob/20cb85b65e36c613c1f9dffd919be61194b501bc/src/Listener/CorruptedJsonListener.php#L100-L123 |
doctrine/common | lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php | InvalidArgumentException.invalidClassNotFoundCallback | public static function invalidClassNotFoundCallback($callback)
{
$type = is_object($callback) ? get_class($callback) : gettype($callback);
return new self(sprintf('Invalid \$notFoundCallback given: must be a callable, "%s" given', $type));
} | php | public static function invalidClassNotFoundCallback($callback)
{
$type = is_object($callback) ? get_class($callback) : gettype($callback);
return new self(sprintf('Invalid \$notFoundCallback given: must be a callable, "%s" given', $type));
} | [
"public",
"static",
"function",
"invalidClassNotFoundCallback",
"(",
"$",
"callback",
")",
"{",
"$",
"type",
"=",
"is_object",
"(",
"$",
"callback",
")",
"?",
"get_class",
"(",
"$",
"callback",
")",
":",
"gettype",
"(",
"$",
"callback",
")",
";",
"return",... | @param mixed $callback
@return self | [
"@param",
"mixed",
"$callback"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/Exception/InvalidArgumentException.php#L70-L75 |
doctrine/common | lib/Doctrine/Common/Util/Debug.php | Debug.dump | public static function dump($var, $maxDepth = 2, $stripTags = true, $echo = true)
{
$html = ini_get('html_errors');
if ($html !== true) {
ini_set('html_errors', true);
}
if (extension_loaded('xdebug')) {
ini_set('xdebug.var_display_max_depth', $maxDepth);
... | php | public static function dump($var, $maxDepth = 2, $stripTags = true, $echo = true)
{
$html = ini_get('html_errors');
if ($html !== true) {
ini_set('html_errors', true);
}
if (extension_loaded('xdebug')) {
ini_set('xdebug.var_display_max_depth', $maxDepth);
... | [
"public",
"static",
"function",
"dump",
"(",
"$",
"var",
",",
"$",
"maxDepth",
"=",
"2",
",",
"$",
"stripTags",
"=",
"true",
",",
"$",
"echo",
"=",
"true",
")",
"{",
"$",
"html",
"=",
"ini_get",
"(",
"'html_errors'",
")",
";",
"if",
"(",
"$",
"ht... | Prints a dump of the public, protected and private properties of $var.
@link https://xdebug.org/
@param mixed $var The variable to dump.
@param integer $maxDepth The maximum nesting level for object properties.
@param boolean $stripTags Whether output should strip HTML tags.
@param boolean $echo Send th... | [
"Prints",
"a",
"dump",
"of",
"the",
"public",
"protected",
"and",
"private",
"properties",
"of",
"$var",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Util/Debug.php#L40-L70 |
doctrine/common | lib/Doctrine/Common/Util/Debug.php | Debug.export | public static function export($var, $maxDepth)
{
$return = null;
$isObj = is_object($var);
if ($var instanceof Collection) {
$var = $var->toArray();
}
if ( ! $maxDepth) {
return is_object($var) ? get_class($var)
: (is_array($var) ? '... | php | public static function export($var, $maxDepth)
{
$return = null;
$isObj = is_object($var);
if ($var instanceof Collection) {
$var = $var->toArray();
}
if ( ! $maxDepth) {
return is_object($var) ? get_class($var)
: (is_array($var) ? '... | [
"public",
"static",
"function",
"export",
"(",
"$",
"var",
",",
"$",
"maxDepth",
")",
"{",
"$",
"return",
"=",
"null",
";",
"$",
"isObj",
"=",
"is_object",
"(",
"$",
"var",
")",
";",
"if",
"(",
"$",
"var",
"instanceof",
"Collection",
")",
"{",
"$",... | @param mixed $var
@param int $maxDepth
@return mixed | [
"@param",
"mixed",
"$var",
"@param",
"int",
"$maxDepth"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Util/Debug.php#L78-L127 |
doctrine/common | lib/Doctrine/Common/Util/Debug.php | Debug.toString | public static function toString($obj)
{
return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj);
} | php | public static function toString($obj)
{
return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj);
} | [
"public",
"static",
"function",
"toString",
"(",
"$",
"obj",
")",
"{",
"return",
"method_exists",
"(",
"$",
"obj",
",",
"'__toString'",
")",
"?",
"(",
"string",
")",
"$",
"obj",
":",
"get_class",
"(",
"$",
"obj",
")",
".",
"'@'",
".",
"spl_object_hash"... | Returns a string representation of an object.
@param object $obj
@return string | [
"Returns",
"a",
"string",
"representation",
"of",
"an",
"object",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Util/Debug.php#L163-L166 |
doctrine/common | lib/Doctrine/Common/Proxy/AbstractProxyFactory.php | AbstractProxyFactory.getProxy | public function getProxy($className, array $identifier)
{
$definition = isset($this->definitions[$className])
? $this->definitions[$className]
: $this->getProxyDefinition($className);
$fqcn = $definition->proxyClassName;
$proxy = new $fqcn($definition->init... | php | public function getProxy($className, array $identifier)
{
$definition = isset($this->definitions[$className])
? $this->definitions[$className]
: $this->getProxyDefinition($className);
$fqcn = $definition->proxyClassName;
$proxy = new $fqcn($definition->init... | [
"public",
"function",
"getProxy",
"(",
"$",
"className",
",",
"array",
"$",
"identifier",
")",
"{",
"$",
"definition",
"=",
"isset",
"(",
"$",
"this",
"->",
"definitions",
"[",
"$",
"className",
"]",
")",
"?",
"$",
"this",
"->",
"definitions",
"[",
"$"... | Gets a reference proxy instance for the entity of the given type and identified by
the given identifier.
@param string $className
@param array $identifier
@return \Doctrine\Common\Proxy\Proxy
@throws \Doctrine\Common\Proxy\Exception\OutOfBoundsException | [
"Gets",
"a",
"reference",
"proxy",
"instance",
"for",
"the",
"entity",
"of",
"the",
"given",
"type",
"and",
"identified",
"by",
"the",
"given",
"identifier",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php#L112-L129 |
doctrine/common | lib/Doctrine/Common/Proxy/AbstractProxyFactory.php | AbstractProxyFactory.generateProxyClasses | public function generateProxyClasses(array $classes, $proxyDir = null)
{
$generated = 0;
foreach ($classes as $class) {
if ($this->skipClass($class)) {
continue;
}
$proxyFileName = $this->proxyGenerator->getProxyFileName($class->getName(), $proxy... | php | public function generateProxyClasses(array $classes, $proxyDir = null)
{
$generated = 0;
foreach ($classes as $class) {
if ($this->skipClass($class)) {
continue;
}
$proxyFileName = $this->proxyGenerator->getProxyFileName($class->getName(), $proxy... | [
"public",
"function",
"generateProxyClasses",
"(",
"array",
"$",
"classes",
",",
"$",
"proxyDir",
"=",
"null",
")",
"{",
"$",
"generated",
"=",
"0",
";",
"foreach",
"(",
"$",
"classes",
"as",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"ski... | Generates proxy classes for all given classes.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata[] $classes The classes (ClassMetadata instances)
for which to generate proxies.
@param string $proxyDir The target directory of the proxy classes. If not specified, the
directory configured on the Configuration of ... | [
"Generates",
"proxy",
"classes",
"for",
"all",
"given",
"classes",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php#L141-L158 |
doctrine/common | lib/Doctrine/Common/Proxy/AbstractProxyFactory.php | AbstractProxyFactory.resetUninitializedProxy | public function resetUninitializedProxy(Proxy $proxy)
{
if ($proxy->__isInitialized()) {
throw InvalidArgumentException::unitializedProxyExpected($proxy);
}
$className = ClassUtils::getClass($proxy);
$definition = isset($this->definitions[$className])
? $thi... | php | public function resetUninitializedProxy(Proxy $proxy)
{
if ($proxy->__isInitialized()) {
throw InvalidArgumentException::unitializedProxyExpected($proxy);
}
$className = ClassUtils::getClass($proxy);
$definition = isset($this->definitions[$className])
? $thi... | [
"public",
"function",
"resetUninitializedProxy",
"(",
"Proxy",
"$",
"proxy",
")",
"{",
"if",
"(",
"$",
"proxy",
"->",
"__isInitialized",
"(",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"unitializedProxyExpected",
"(",
"$",
"proxy",
")",
";",
"}"... | Reset initialization/cloning logic for an un-initialized proxy
@param \Doctrine\Common\Proxy\Proxy $proxy
@return \Doctrine\Common\Proxy\Proxy
@throws \Doctrine\Common\Proxy\Exception\InvalidArgumentException | [
"Reset",
"initialization",
"/",
"cloning",
"logic",
"for",
"an",
"un",
"-",
"initialized",
"proxy"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php#L169-L184 |
doctrine/common | lib/Doctrine/Common/Proxy/AbstractProxyFactory.php | AbstractProxyFactory.getProxyDefinition | private function getProxyDefinition($className)
{
$classMetadata = $this->metadataFactory->getMetadataFor($className);
$className = $classMetadata->getName(); // aliases and case sensitivity
$this->definitions[$className] = $this->createProxyDefinition($className);
$proxyClassNa... | php | private function getProxyDefinition($className)
{
$classMetadata = $this->metadataFactory->getMetadataFor($className);
$className = $classMetadata->getName(); // aliases and case sensitivity
$this->definitions[$className] = $this->createProxyDefinition($className);
$proxyClassNa... | [
"private",
"function",
"getProxyDefinition",
"(",
"$",
"className",
")",
"{",
"$",
"classMetadata",
"=",
"$",
"this",
"->",
"metadataFactory",
"->",
"getMetadataFor",
"(",
"$",
"className",
")",
";",
"$",
"className",
"=",
"$",
"classMetadata",
"->",
"getName"... | Get a proxy definition for the given class name.
@param string $className
@return ProxyDefinition | [
"Get",
"a",
"proxy",
"definition",
"for",
"the",
"given",
"class",
"name",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php#L193-L228 |
doctrine/common | lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php | UnexpectedValueException.invalidParameterTypeHint | public static function invalidParameterTypeHint(
$className,
$methodName,
$parameterName,
\Exception $previous = null
) {
return new self(
sprintf(
'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.',
$paramet... | php | public static function invalidParameterTypeHint(
$className,
$methodName,
$parameterName,
\Exception $previous = null
) {
return new self(
sprintf(
'The type hint of parameter "%s" in method "%s" in class "%s" is invalid.',
$paramet... | [
"public",
"static",
"function",
"invalidParameterTypeHint",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"$",
"parameterName",
",",
"\\",
"Exception",
"$",
"previous",
"=",
"null",
")",
"{",
"return",
"new",
"self",
"(",
"sprintf",
"(",
"'The type hint ... | @param string $className
@param string $methodName
@param string $parameterName
@param \Exception|null $previous
@return self | [
"@param",
"string",
"$className",
"@param",
"string",
"$methodName",
"@param",
"string",
"$parameterName",
"@param",
"\\",
"Exception|null",
"$previous"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php#L35-L51 |
doctrine/common | lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php | UnexpectedValueException.invalidReturnTypeHint | public static function invalidReturnTypeHint($className, $methodName, \Exception $previous = null)
{
return new self(
sprintf(
'The return type of method "%s" in class "%s" is invalid.',
$methodName,
$className
),
0,
... | php | public static function invalidReturnTypeHint($className, $methodName, \Exception $previous = null)
{
return new self(
sprintf(
'The return type of method "%s" in class "%s" is invalid.',
$methodName,
$className
),
0,
... | [
"public",
"static",
"function",
"invalidReturnTypeHint",
"(",
"$",
"className",
",",
"$",
"methodName",
",",
"\\",
"Exception",
"$",
"previous",
"=",
"null",
")",
"{",
"return",
"new",
"self",
"(",
"sprintf",
"(",
"'The return type of method \"%s\" in class \"%s\" i... | @param string $className
@param string $methodName
@param \Exception|null $previous
@return self | [
"@param",
"string",
"$className",
"@param",
"string",
"$methodName",
"@param",
"\\",
"Exception|null",
"$previous"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/Exception/UnexpectedValueException.php#L60-L71 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.setPlaceholder | public function setPlaceholder($name, $placeholder)
{
if ( ! is_string($placeholder) && ! is_callable($placeholder)) {
throw InvalidArgumentException::invalidPlaceholder($name);
}
$this->placeholders[$name] = $placeholder;
} | php | public function setPlaceholder($name, $placeholder)
{
if ( ! is_string($placeholder) && ! is_callable($placeholder)) {
throw InvalidArgumentException::invalidPlaceholder($name);
}
$this->placeholders[$name] = $placeholder;
} | [
"public",
"function",
"setPlaceholder",
"(",
"$",
"name",
",",
"$",
"placeholder",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"placeholder",
")",
"&&",
"!",
"is_callable",
"(",
"$",
"placeholder",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"... | Sets a placeholder to be replaced in the template.
@param string $name
@param string|callable $placeholder
@throws InvalidArgumentException | [
"Sets",
"a",
"placeholder",
"to",
"be",
"replaced",
"in",
"the",
"template",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L218-L225 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateProxyClass | public function generateProxyClass(ClassMetadata $class, $fileName = false)
{
$this->verifyClassCanBeProxied($class);
preg_match_all('(<([a-zA-Z]+)>)', $this->proxyClassTemplate, $placeholderMatches);
$placeholderMatches = array_combine($placeholderMatches[0], $placeholderMatches[1]);
... | php | public function generateProxyClass(ClassMetadata $class, $fileName = false)
{
$this->verifyClassCanBeProxied($class);
preg_match_all('(<([a-zA-Z]+)>)', $this->proxyClassTemplate, $placeholderMatches);
$placeholderMatches = array_combine($placeholderMatches[0], $placeholderMatches[1]);
... | [
"public",
"function",
"generateProxyClass",
"(",
"ClassMetadata",
"$",
"class",
",",
"$",
"fileName",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"verifyClassCanBeProxied",
"(",
"$",
"class",
")",
";",
"preg_match_all",
"(",
"'(<([a-zA-Z]+)>)'",
",",
"$",
"this... | Generates a proxy class file.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class Metadata for the original class.
@param string|bool $fileName Filename (full path) for the generated class. If none is given, eval() is used.
@throws InvalidArgumentException
@throw... | [
"Generates",
"a",
"proxy",
"class",
"file",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L246-L294 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.verifyClassCanBeProxied | private function verifyClassCanBeProxied(ClassMetadata $class)
{
if ($class->getReflectionClass()->isFinal()) {
throw InvalidArgumentException::classMustNotBeFinal($class->getName());
}
if ($class->getReflectionClass()->isAbstract()) {
throw InvalidArgumentException:... | php | private function verifyClassCanBeProxied(ClassMetadata $class)
{
if ($class->getReflectionClass()->isFinal()) {
throw InvalidArgumentException::classMustNotBeFinal($class->getName());
}
if ($class->getReflectionClass()->isAbstract()) {
throw InvalidArgumentException:... | [
"private",
"function",
"verifyClassCanBeProxied",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"class",
"->",
"getReflectionClass",
"(",
")",
"->",
"isFinal",
"(",
")",
")",
"{",
"throw",
"InvalidArgumentException",
"::",
"classMustNotBeFinal",
... | @param ClassMetadata $class
@throws InvalidArgumentException | [
"@param",
"ClassMetadata",
"$class"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L301-L310 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateProxyShortClassName | private function generateProxyShortClassName(ClassMetadata $class)
{
$proxyClassName = ClassUtils::generateProxyClassName($class->getName(), $this->proxyNamespace);
$parts = explode('\\', strrev($proxyClassName), 2);
return strrev($parts[0]);
} | php | private function generateProxyShortClassName(ClassMetadata $class)
{
$proxyClassName = ClassUtils::generateProxyClassName($class->getName(), $this->proxyNamespace);
$parts = explode('\\', strrev($proxyClassName), 2);
return strrev($parts[0]);
} | [
"private",
"function",
"generateProxyShortClassName",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"proxyClassName",
"=",
"ClassUtils",
"::",
"generateProxyClassName",
"(",
"$",
"class",
"->",
"getName",
"(",
")",
",",
"$",
"this",
"->",
"proxyNamespace",
... | Generates the proxy short class name to be used in the template.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"the",
"proxy",
"short",
"class",
"name",
"to",
"be",
"used",
"in",
"the",
"template",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L319-L325 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateLazyPropertiesDefaults | private function generateLazyPropertiesDefaults(ClassMetadata $class)
{
$lazyPublicProperties = $this->getLazyLoadedPublicProperties($class);
$values = [];
foreach ($lazyPublicProperties as $key => $value) {
$values[] = var_export($key, true) . ' => ' . var_export(... | php | private function generateLazyPropertiesDefaults(ClassMetadata $class)
{
$lazyPublicProperties = $this->getLazyLoadedPublicProperties($class);
$values = [];
foreach ($lazyPublicProperties as $key => $value) {
$values[] = var_export($key, true) . ' => ' . var_export(... | [
"private",
"function",
"generateLazyPropertiesDefaults",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"lazyPublicProperties",
"=",
"$",
"this",
"->",
"getLazyLoadedPublicProperties",
"(",
"$",
"class",
")",
";",
"$",
"values",
"=",
"[",
"]",
";",
"foreach"... | Generates the array representation of lazy loaded public properties and their default values.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"the",
"array",
"representation",
"of",
"lazy",
"loaded",
"public",
"properties",
"and",
"their",
"default",
"values",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L361-L371 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateConstructorImpl | private function generateConstructorImpl(ClassMetadata $class)
{
$constructorImpl = <<<'EOT'
/**
* @param \Closure $initializer
* @param \Closure $cloner
*/
public function __construct($initializer = null, $cloner = null)
{
EOT;
$toUnset = [];
foreach ($t... | php | private function generateConstructorImpl(ClassMetadata $class)
{
$constructorImpl = <<<'EOT'
/**
* @param \Closure $initializer
* @param \Closure $cloner
*/
public function __construct($initializer = null, $cloner = null)
{
EOT;
$toUnset = [];
foreach ($t... | [
"private",
"function",
"generateConstructorImpl",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"constructorImpl",
"=",
" <<<'EOT'\n /**\n * @param \\Closure $initializer\n * @param \\Closure $cloner\n */\n public function __construct($initializer = null, $cloner = nul... | Generates the constructor code (un-setting public lazy loaded properties, setting identifier field values).
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"the",
"constructor",
"code",
"(",
"un",
"-",
"setting",
"public",
"lazy",
"loaded",
"properties",
"setting",
"identifier",
"field",
"values",
")",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L380-L406 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateMagicGet | private function generateMagicGet(ClassMetadata $class)
{
$lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
$reflectionClass = $class->getReflectionClass();
$hasParentGet = false;
$returnReference = '';
$inheritDoc =... | php | private function generateMagicGet(ClassMetadata $class)
{
$lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
$reflectionClass = $class->getReflectionClass();
$hasParentGet = false;
$returnReference = '';
$inheritDoc =... | [
"private",
"function",
"generateMagicGet",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"lazyPublicProperties",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"getLazyLoadedPublicProperties",
"(",
"$",
"class",
")",
")",
";",
"$",
"reflectionClass",
"=",
"$",
... | Generates the magic getter invoked when lazy loaded public properties are requested.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"the",
"magic",
"getter",
"invoked",
"when",
"lazy",
"loaded",
"public",
"properties",
"are",
"requested",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L415-L475 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateMagicSet | private function generateMagicSet(ClassMetadata $class)
{
$lazyPublicProperties = $this->getLazyLoadedPublicProperties($class);
$hasParentSet = $class->getReflectionClass()->hasMethod('__set');
if (empty($lazyPublicProperties) && ! $hasParentSet) {
return '';
}
... | php | private function generateMagicSet(ClassMetadata $class)
{
$lazyPublicProperties = $this->getLazyLoadedPublicProperties($class);
$hasParentSet = $class->getReflectionClass()->hasMethod('__set');
if (empty($lazyPublicProperties) && ! $hasParentSet) {
return '';
}
... | [
"private",
"function",
"generateMagicSet",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"lazyPublicProperties",
"=",
"$",
"this",
"->",
"getLazyLoadedPublicProperties",
"(",
"$",
"class",
")",
";",
"$",
"hasParentSet",
"=",
"$",
"class",
"->",
"getReflecti... | Generates the magic setter (currently unused).
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"the",
"magic",
"setter",
"(",
"currently",
"unused",
")",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L484-L532 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateMagicIsset | private function generateMagicIsset(ClassMetadata $class)
{
$lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
$hasParentIsset = $class->getReflectionClass()->hasMethod('__isset');
if (empty($lazyPublicProperties) && ! $hasParentIsset) {
retu... | php | private function generateMagicIsset(ClassMetadata $class)
{
$lazyPublicProperties = array_keys($this->getLazyLoadedPublicProperties($class));
$hasParentIsset = $class->getReflectionClass()->hasMethod('__isset');
if (empty($lazyPublicProperties) && ! $hasParentIsset) {
retu... | [
"private",
"function",
"generateMagicIsset",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"lazyPublicProperties",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"getLazyLoadedPublicProperties",
"(",
"$",
"class",
")",
")",
";",
"$",
"hasParentIsset",
"=",
"$",... | Generates the magic issetter invoked when lazy loaded public properties are checked against isset().
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"the",
"magic",
"issetter",
"invoked",
"when",
"lazy",
"loaded",
"public",
"properties",
"are",
"checked",
"against",
"isset",
"()",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L541-L586 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateSleepImpl | private function generateSleepImpl(ClassMetadata $class)
{
$hasParentSleep = $class->getReflectionClass()->hasMethod('__sleep');
$inheritDoc = $hasParentSleep ? '{@inheritDoc}' : '';
$sleepImpl = <<<EOT
/**
* $inheritDoc
* @return array
*/
public function __sl... | php | private function generateSleepImpl(ClassMetadata $class)
{
$hasParentSleep = $class->getReflectionClass()->hasMethod('__sleep');
$inheritDoc = $hasParentSleep ? '{@inheritDoc}' : '';
$sleepImpl = <<<EOT
/**
* $inheritDoc
* @return array
*/
public function __sl... | [
"private",
"function",
"generateSleepImpl",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"hasParentSleep",
"=",
"$",
"class",
"->",
"getReflectionClass",
"(",
")",
"->",
"hasMethod",
"(",
"'__sleep'",
")",
";",
"$",
"inheritDoc",
"=",
"$",
"hasParentSlee... | Generates implementation for the `__sleep` method of proxies.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"implementation",
"for",
"the",
"__sleep",
"method",
"of",
"proxies",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L595-L657 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateWakeupImpl | private function generateWakeupImpl(ClassMetadata $class)
{
$unsetPublicProperties = [];
$hasWakeup = $class->getReflectionClass()->hasMethod('__wakeup');
foreach (array_keys($this->getLazyLoadedPublicProperties($class)) as $lazyPublicProperty) {
$unsetPublicProperti... | php | private function generateWakeupImpl(ClassMetadata $class)
{
$unsetPublicProperties = [];
$hasWakeup = $class->getReflectionClass()->hasMethod('__wakeup');
foreach (array_keys($this->getLazyLoadedPublicProperties($class)) as $lazyPublicProperty) {
$unsetPublicProperti... | [
"private",
"function",
"generateWakeupImpl",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"unsetPublicProperties",
"=",
"[",
"]",
";",
"$",
"hasWakeup",
"=",
"$",
"class",
"->",
"getReflectionClass",
"(",
")",
"->",
"hasMethod",
"(",
"'__wakeup'",
")",
... | Generates implementation for the `__wakeup` method of proxies.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"implementation",
"for",
"the",
"__wakeup",
"method",
"of",
"proxies",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L666-L712 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.generateMethods | private function generateMethods(ClassMetadata $class)
{
$methods = '';
$methodNames = [];
$reflectionMethods = $class->getReflectionClass()->getMethods(\ReflectionMethod::IS_PUBLIC);
$skippedMethods = [
'__sleep' => true,
'__clone' => t... | php | private function generateMethods(ClassMetadata $class)
{
$methods = '';
$methodNames = [];
$reflectionMethods = $class->getReflectionClass()->getMethods(\ReflectionMethod::IS_PUBLIC);
$skippedMethods = [
'__sleep' => true,
'__clone' => t... | [
"private",
"function",
"generateMethods",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"methods",
"=",
"''",
";",
"$",
"methodNames",
"=",
"[",
"]",
";",
"$",
"reflectionMethods",
"=",
"$",
"class",
"->",
"getReflectionClass",
"(",
")",
"->",
"getMet... | Generates decorated methods by picking those available in the parent class.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return string | [
"Generates",
"decorated",
"methods",
"by",
"picking",
"those",
"available",
"in",
"the",
"parent",
"class",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L745-L811 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.getProxyFileName | public function getProxyFileName($className, $baseDirectory = null)
{
$baseDirectory = $baseDirectory ?: $this->proxyDirectory;
return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . Proxy::MARKER
. str_replace('\\', '', $className) . '.php';
} | php | public function getProxyFileName($className, $baseDirectory = null)
{
$baseDirectory = $baseDirectory ?: $this->proxyDirectory;
return rtrim($baseDirectory, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . Proxy::MARKER
. str_replace('\\', '', $className) . '.php';
} | [
"public",
"function",
"getProxyFileName",
"(",
"$",
"className",
",",
"$",
"baseDirectory",
"=",
"null",
")",
"{",
"$",
"baseDirectory",
"=",
"$",
"baseDirectory",
"?",
":",
"$",
"this",
"->",
"proxyDirectory",
";",
"return",
"rtrim",
"(",
"$",
"baseDirector... | Generates the Proxy file name.
@param string $className
@param string $baseDirectory Optional base directory for proxy file name generation.
If not specified, the directory configured on the Configuration of the
EntityManager will be used by this factory.
@return string | [
"Generates",
"the",
"Proxy",
"file",
"name",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L823-L829 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.isShortIdentifierGetter | private function isShortIdentifierGetter($method, ClassMetadata $class)
{
$identifier = lcfirst(substr($method->getName(), 3));
$startLine = $method->getStartLine();
$endLine = $method->getEndLine();
$cheapCheck = (
$method->getNumberOfParameters() == 0
&&... | php | private function isShortIdentifierGetter($method, ClassMetadata $class)
{
$identifier = lcfirst(substr($method->getName(), 3));
$startLine = $method->getStartLine();
$endLine = $method->getEndLine();
$cheapCheck = (
$method->getNumberOfParameters() == 0
&&... | [
"private",
"function",
"isShortIdentifierGetter",
"(",
"$",
"method",
",",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"identifier",
"=",
"lcfirst",
"(",
"substr",
"(",
"$",
"method",
"->",
"getName",
"(",
")",
",",
"3",
")",
")",
";",
"$",
"startLine"... | Checks if the method is a short identifier getter.
What does this mean? For proxy objects the identifier is already known,
however accessing the getter for this identifier usually triggers the
lazy loading, leading to a query that may not be necessary if only the
ID is interesting for the userland code (for example in... | [
"Checks",
"if",
"the",
"method",
"is",
"a",
"short",
"identifier",
"getter",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L845-L870 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.getLazyLoadedPublicProperties | private function getLazyLoadedPublicProperties(ClassMetadata $class)
{
$defaultProperties = $class->getReflectionClass()->getDefaultProperties();
$properties = [];
foreach ($class->getReflectionClass()->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
$name =... | php | private function getLazyLoadedPublicProperties(ClassMetadata $class)
{
$defaultProperties = $class->getReflectionClass()->getDefaultProperties();
$properties = [];
foreach ($class->getReflectionClass()->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
$name =... | [
"private",
"function",
"getLazyLoadedPublicProperties",
"(",
"ClassMetadata",
"$",
"class",
")",
"{",
"$",
"defaultProperties",
"=",
"$",
"class",
"->",
"getReflectionClass",
"(",
")",
"->",
"getDefaultProperties",
"(",
")",
";",
"$",
"properties",
"=",
"[",
"]"... | Generates the list of public properties to be lazy loaded, with their default values.
@param \Doctrine\Common\Persistence\Mapping\ClassMetadata $class
@return mixed[] | [
"Generates",
"the",
"list",
"of",
"public",
"properties",
"to",
"be",
"lazy",
"loaded",
"with",
"their",
"default",
"values",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L879-L893 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.buildParametersString | private function buildParametersString(array $parameters)
{
$parameterDefinitions = [];
/* @var $param \ReflectionParameter */
foreach ($parameters as $param) {
$parameterDefinition = '';
if ($parameterType = $this->getParameterType($param)) {
$param... | php | private function buildParametersString(array $parameters)
{
$parameterDefinitions = [];
/* @var $param \ReflectionParameter */
foreach ($parameters as $param) {
$parameterDefinition = '';
if ($parameterType = $this->getParameterType($param)) {
$param... | [
"private",
"function",
"buildParametersString",
"(",
"array",
"$",
"parameters",
")",
"{",
"$",
"parameterDefinitions",
"=",
"[",
"]",
";",
"/* @var $param \\ReflectionParameter */",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"param",
")",
"{",
"$",
"parameterD... | @param \ReflectionParameter[] $parameters
@return string | [
"@param",
"\\",
"ReflectionParameter",
"[]",
"$parameters"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L900-L930 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.getParameterType | private function getParameterType(\ReflectionParameter $parameter)
{
if ( ! $parameter->hasType()) {
return null;
}
return $this->formatType($parameter->getType(), $parameter->getDeclaringFunction(), $parameter);
} | php | private function getParameterType(\ReflectionParameter $parameter)
{
if ( ! $parameter->hasType()) {
return null;
}
return $this->formatType($parameter->getType(), $parameter->getDeclaringFunction(), $parameter);
} | [
"private",
"function",
"getParameterType",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"$",
"parameter",
"->",
"hasType",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"$",
"this",
"->",
"formatType",
"(",
"$... | @param \ReflectionParameter $parameter
@return string|null | [
"@param",
"\\",
"ReflectionParameter",
"$parameter"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L937-L944 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.getParameterNamesForParentCall | private function getParameterNamesForParentCall(array $parameters)
{
return array_map(
function (\ReflectionParameter $parameter) {
$name = '';
if ($parameter->isVariadic()) {
$name .= '...';
}
$name .= '$' . $... | php | private function getParameterNamesForParentCall(array $parameters)
{
return array_map(
function (\ReflectionParameter $parameter) {
$name = '';
if ($parameter->isVariadic()) {
$name .= '...';
}
$name .= '$' . $... | [
"private",
"function",
"getParameterNamesForParentCall",
"(",
"array",
"$",
"parameters",
")",
"{",
"return",
"array_map",
"(",
"function",
"(",
"\\",
"ReflectionParameter",
"$",
"parameter",
")",
"{",
"$",
"name",
"=",
"''",
";",
"if",
"(",
"$",
"parameter",
... | @param \ReflectionParameter[] $parameters
@return string[] | [
"@param",
"\\",
"ReflectionParameter",
"[]",
"$parameters"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L966-L982 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.getMethodReturnType | private function getMethodReturnType(\ReflectionMethod $method)
{
if ( ! $method->hasReturnType()) {
return '';
}
return ': ' . $this->formatType($method->getReturnType(), $method);
} | php | private function getMethodReturnType(\ReflectionMethod $method)
{
if ( ! $method->hasReturnType()) {
return '';
}
return ': ' . $this->formatType($method->getReturnType(), $method);
} | [
"private",
"function",
"getMethodReturnType",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"$",
"method",
"->",
"hasReturnType",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"return",
"': '",
".",
"$",
"this",
"->",
"formatTyp... | @param \ReflectionMethod $method
@return string | [
"@param",
"\\",
"ReflectionMethod",
"$method"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L989-L996 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.shouldProxiedMethodReturn | private function shouldProxiedMethodReturn(\ReflectionMethod $method)
{
if ( ! $method->hasReturnType()) {
return true;
}
return 'void' !== strtolower($this->formatType($method->getReturnType(), $method));
} | php | private function shouldProxiedMethodReturn(\ReflectionMethod $method)
{
if ( ! $method->hasReturnType()) {
return true;
}
return 'void' !== strtolower($this->formatType($method->getReturnType(), $method));
} | [
"private",
"function",
"shouldProxiedMethodReturn",
"(",
"\\",
"ReflectionMethod",
"$",
"method",
")",
"{",
"if",
"(",
"!",
"$",
"method",
"->",
"hasReturnType",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"'void'",
"!==",
"strtolower",
"(",
... | @param \ReflectionMethod $method
@return bool | [
"@param",
"\\",
"ReflectionMethod",
"$method"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L1003-L1010 |
doctrine/common | lib/Doctrine/Common/Proxy/ProxyGenerator.php | ProxyGenerator.formatType | private function formatType(
\ReflectionType $type,
\ReflectionMethod $method,
\ReflectionParameter $parameter = null
) {
$name = (string) $type;
$nameLower = strtolower($name);
if ('self' === $nameLower) {
$name = $method->getDeclaringClass()->getNa... | php | private function formatType(
\ReflectionType $type,
\ReflectionMethod $method,
\ReflectionParameter $parameter = null
) {
$name = (string) $type;
$nameLower = strtolower($name);
if ('self' === $nameLower) {
$name = $method->getDeclaringClass()->getNa... | [
"private",
"function",
"formatType",
"(",
"\\",
"ReflectionType",
"$",
"type",
",",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"\\",
"ReflectionParameter",
"$",
"parameter",
"=",
"null",
")",
"{",
"$",
"name",
"=",
"(",
"string",
")",
"$",
"type",
";",
... | @param \ReflectionType $type
@param \ReflectionMethod $method
@param \ReflectionParameter|null $parameter
@return string | [
"@param",
"\\",
"ReflectionType",
"$type",
"@param",
"\\",
"ReflectionMethod",
"$method",
"@param",
"\\",
"ReflectionParameter|null",
"$parameter"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/ProxyGenerator.php#L1019-L1061 |
doctrine/common | lib/Doctrine/Common/Proxy/Autoloader.php | Autoloader.resolveFile | public static function resolveFile($proxyDir, $proxyNamespace, $className)
{
if (0 !== strpos($className, $proxyNamespace)) {
throw InvalidArgumentException::notProxyClass($className, $proxyNamespace);
}
// remove proxy namespace from class name
$classNameRelativeToProxy... | php | public static function resolveFile($proxyDir, $proxyNamespace, $className)
{
if (0 !== strpos($className, $proxyNamespace)) {
throw InvalidArgumentException::notProxyClass($className, $proxyNamespace);
}
// remove proxy namespace from class name
$classNameRelativeToProxy... | [
"public",
"static",
"function",
"resolveFile",
"(",
"$",
"proxyDir",
",",
"$",
"proxyNamespace",
",",
"$",
"className",
")",
"{",
"if",
"(",
"0",
"!==",
"strpos",
"(",
"$",
"className",
",",
"$",
"proxyNamespace",
")",
")",
"{",
"throw",
"InvalidArgumentEx... | Resolves proxy class name to a filename based on the following pattern.
1. Remove Proxy namespace from class name.
2. Remove namespace separators from remaining class name.
3. Return PHP filename from proxy-dir with the result from 2.
@param string $proxyDir
@param string $proxyNamespace
@param string $className
@re... | [
"Resolves",
"proxy",
"class",
"name",
"to",
"a",
"filename",
"based",
"on",
"the",
"following",
"pattern",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/Autoloader.php#L32-L45 |
doctrine/common | lib/Doctrine/Common/Proxy/Autoloader.php | Autoloader.register | public static function register($proxyDir, $proxyNamespace, $notFoundCallback = null)
{
$proxyNamespace = ltrim($proxyNamespace, '\\');
if ( ! (null === $notFoundCallback || is_callable($notFoundCallback))) {
throw InvalidArgumentException::invalidClassNotFoundCallback($notFoundCallback... | php | public static function register($proxyDir, $proxyNamespace, $notFoundCallback = null)
{
$proxyNamespace = ltrim($proxyNamespace, '\\');
if ( ! (null === $notFoundCallback || is_callable($notFoundCallback))) {
throw InvalidArgumentException::invalidClassNotFoundCallback($notFoundCallback... | [
"public",
"static",
"function",
"register",
"(",
"$",
"proxyDir",
",",
"$",
"proxyNamespace",
",",
"$",
"notFoundCallback",
"=",
"null",
")",
"{",
"$",
"proxyNamespace",
"=",
"ltrim",
"(",
"$",
"proxyNamespace",
",",
"'\\\\'",
")",
";",
"if",
"(",
"!",
"... | Registers and returns autoloader callback for the given proxy dir and namespace.
@param string $proxyDir
@param string $proxyNamespace
@param callable|null $notFoundCallback Invoked when the proxy file is not found.
@return \Closure
@throws InvalidArgumentException | [
"Registers",
"and",
"returns",
"autoloader",
"callback",
"for",
"the",
"given",
"proxy",
"dir",
"and",
"namespace",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/Proxy/Autoloader.php#L58-L81 |
doctrine/common | lib/Doctrine/Common/ClassLoader.php | ClassLoader.loadClass | public function loadClass($className)
{
if (self::typeExists($className)) {
return true;
}
if ( ! $this->canLoadClass($className)) {
return false;
}
require($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
.... | php | public function loadClass($className)
{
if (self::typeExists($className)) {
return true;
}
if ( ! $this->canLoadClass($className)) {
return false;
}
require($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '')
.... | [
"public",
"function",
"loadClass",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"self",
"::",
"typeExists",
"(",
"$",
"className",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"canLoadClass",
"(",
"$",
"className",
")"... | Loads the given class or interface.
@param string $className The name of the class to load.
@return boolean TRUE if the class has been successfully loaded, FALSE otherwise. | [
"Loads",
"the",
"given",
"class",
"or",
"interface",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/ClassLoader.php#L163-L178 |
doctrine/common | lib/Doctrine/Common/ClassLoader.php | ClassLoader.getClassLoader | public static function getClassLoader($className)
{
foreach (spl_autoload_functions() as $loader) {
if (is_array($loader)
&& ($classLoader = reset($loader))
&& $classLoader instanceof ClassLoader
&& $classLoader->canLoadClass($className)
)... | php | public static function getClassLoader($className)
{
foreach (spl_autoload_functions() as $loader) {
if (is_array($loader)
&& ($classLoader = reset($loader))
&& $classLoader instanceof ClassLoader
&& $classLoader->canLoadClass($className)
)... | [
"public",
"static",
"function",
"getClassLoader",
"(",
"$",
"className",
")",
"{",
"foreach",
"(",
"spl_autoload_functions",
"(",
")",
"as",
"$",
"loader",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"loader",
")",
"&&",
"(",
"$",
"classLoader",
"=",
"res... | Gets the <tt>ClassLoader</tt> from the SPL autoload stack that is responsible
for (and is able to load) the class with the given name.
@param string $className The name of the class.
@return ClassLoader|null The <tt>ClassLoader</tt> for the class or NULL if no such <tt>ClassLoader</tt> exists. | [
"Gets",
"the",
"<tt",
">",
"ClassLoader<",
"/",
"tt",
">",
"from",
"the",
"SPL",
"autoload",
"stack",
"that",
"is",
"responsible",
"for",
"(",
"and",
"is",
"able",
"to",
"load",
")",
"the",
"class",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/ClassLoader.php#L238-L251 |
doctrine/common | lib/Doctrine/Common/ClassLoader.php | ClassLoader.typeExists | private static function typeExists($type, $autoload = false)
{
return class_exists($type, $autoload)
|| interface_exists($type, $autoload)
|| trait_exists($type, $autoload);
} | php | private static function typeExists($type, $autoload = false)
{
return class_exists($type, $autoload)
|| interface_exists($type, $autoload)
|| trait_exists($type, $autoload);
} | [
"private",
"static",
"function",
"typeExists",
"(",
"$",
"type",
",",
"$",
"autoload",
"=",
"false",
")",
"{",
"return",
"class_exists",
"(",
"$",
"type",
",",
"$",
"autoload",
")",
"||",
"interface_exists",
"(",
"$",
"type",
",",
"$",
"autoload",
")",
... | Checks whether a given type exists
@param string $type
@param bool $autoload
@return bool | [
"Checks",
"whether",
"a",
"given",
"type",
"exists"
] | train | https://github.com/doctrine/common/blob/9f57494fc8b85b01c686b5a6000414978e553dab/lib/Doctrine/Common/ClassLoader.php#L261-L266 |
sensiolabs/SensioFrameworkExtraBundle | Routing/AnnotatedRouteControllerLoader.php | AnnotatedRouteControllerLoader.configureRoute | protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
// controller
$classAnnot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass);
if ($classAnnot instanceof FrameworkExtraBundleRoute && $service = $classAnnot->ge... | php | protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
// controller
$classAnnot = $this->reader->getClassAnnotation($class, $this->routeAnnotationClass);
if ($classAnnot instanceof FrameworkExtraBundleRoute && $service = $classAnnot->ge... | [
"protected",
"function",
"configureRoute",
"(",
"Route",
"$",
"route",
",",
"\\",
"ReflectionClass",
"$",
"class",
",",
"\\",
"ReflectionMethod",
"$",
"method",
",",
"$",
"annot",
")",
"{",
"// controller",
"$",
"classAnnot",
"=",
"$",
"this",
"->",
"reader"... | Configures the _controller default parameter and eventually the HTTP method
requirement of a given Route instance.
@param mixed $annot The annotation class instance
@throws \LogicException When the service option is specified on a method | [
"Configures",
"the",
"_controller",
"default",
"parameter",
"and",
"eventually",
"the",
"HTTP",
"method",
"requirement",
"of",
"a",
"given",
"Route",
"instance",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Routing/AnnotatedRouteControllerLoader.php#L41-L61 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/PsrResponseListener.php | PsrResponseListener.onKernelView | public function onKernelView(GetResponseForControllerResultEvent $event)
{
$controllerResult = $event->getControllerResult();
if (!$controllerResult instanceof ResponseInterface) {
return;
}
$event->setResponse($this->httpFoundationFactory->createResponse($controllerRes... | php | public function onKernelView(GetResponseForControllerResultEvent $event)
{
$controllerResult = $event->getControllerResult();
if (!$controllerResult instanceof ResponseInterface) {
return;
}
$event->setResponse($this->httpFoundationFactory->createResponse($controllerRes... | [
"public",
"function",
"onKernelView",
"(",
"GetResponseForControllerResultEvent",
"$",
"event",
")",
"{",
"$",
"controllerResult",
"=",
"$",
"event",
"->",
"getControllerResult",
"(",
")",
";",
"if",
"(",
"!",
"$",
"controllerResult",
"instanceof",
"ResponseInterfac... | Do the conversion if applicable and update the response of the event. | [
"Do",
"the",
"conversion",
"if",
"applicable",
"and",
"update",
"the",
"response",
"of",
"the",
"event",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/PsrResponseListener.php#L40-L49 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/SecurityListener.php | SecurityListener.getVariables | private function getVariables(FilterControllerArgumentsEvent $event)
{
$request = $event->getRequest();
$token = $this->tokenStorage->getToken();
if (null !== $this->roleHierarchy) {
$roles = $this->roleHierarchy->getReachableRoles($token->getRoles());
} else {
... | php | private function getVariables(FilterControllerArgumentsEvent $event)
{
$request = $event->getRequest();
$token = $this->tokenStorage->getToken();
if (null !== $this->roleHierarchy) {
$roles = $this->roleHierarchy->getReachableRoles($token->getRoles());
} else {
... | [
"private",
"function",
"getVariables",
"(",
"FilterControllerArgumentsEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"$",
"token",
"=",
"$",
"this",
"->",
"tokenStorage",
"->",
"getToken",
"(",
")",
";... | code should be sync with Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter | [
"code",
"should",
"be",
"sync",
"with",
"Symfony",
"\\",
"Component",
"\\",
"Security",
"\\",
"Core",
"\\",
"Authorization",
"\\",
"Voter",
"\\",
"ExpressionVoter"
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/SecurityListener.php#L84-L128 |
sensiolabs/SensioFrameworkExtraBundle | Request/ArgumentNameConverter.php | ArgumentNameConverter.getControllerArguments | public function getControllerArguments(FilterControllerArgumentsEvent $event)
{
$namedArguments = $event->getRequest()->attributes->all();
$argumentMetadatas = $this->argumentMetadataFactory->createArgumentMetadata($event->getController());
$controllerArguments = $event->getArguments();
... | php | public function getControllerArguments(FilterControllerArgumentsEvent $event)
{
$namedArguments = $event->getRequest()->attributes->all();
$argumentMetadatas = $this->argumentMetadataFactory->createArgumentMetadata($event->getController());
$controllerArguments = $event->getArguments();
... | [
"public",
"function",
"getControllerArguments",
"(",
"FilterControllerArgumentsEvent",
"$",
"event",
")",
"{",
"$",
"namedArguments",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
"->",
"attributes",
"->",
"all",
"(",
")",
";",
"$",
"argumentMetadatas",
"=",
... | Returns an associative array of the controller arguments for the event.
@param FilterControllerArgumentsEvent $event
@return array | [
"Returns",
"an",
"associative",
"array",
"of",
"the",
"controller",
"arguments",
"for",
"the",
"event",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ArgumentNameConverter.php#L36-L58 |
sensiolabs/SensioFrameworkExtraBundle | Request/ArgumentValueResolver/Psr7ServerRequestResolver.php | Psr7ServerRequestResolver.supports | public function supports(Request $request, ArgumentMetadata $argument)
{
return isset(self::$supportedTypes[$argument->getType()]);
} | php | public function supports(Request $request, ArgumentMetadata $argument)
{
return isset(self::$supportedTypes[$argument->getType()]);
} | [
"public",
"function",
"supports",
"(",
"Request",
"$",
"request",
",",
"ArgumentMetadata",
"$",
"argument",
")",
"{",
"return",
"isset",
"(",
"self",
"::",
"$",
"supportedTypes",
"[",
"$",
"argument",
"->",
"getType",
"(",
")",
"]",
")",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ArgumentValueResolver/Psr7ServerRequestResolver.php#L42-L45 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/ParamConverterManager.php | ParamConverterManager.apply | public function apply(Request $request, $configurations)
{
if (\is_object($configurations)) {
$configurations = [$configurations];
}
foreach ($configurations as $configuration) {
$this->applyConverter($request, $configuration);
}
} | php | public function apply(Request $request, $configurations)
{
if (\is_object($configurations)) {
$configurations = [$configurations];
}
foreach ($configurations as $configuration) {
$this->applyConverter($request, $configuration);
}
} | [
"public",
"function",
"apply",
"(",
"Request",
"$",
"request",
",",
"$",
"configurations",
")",
"{",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"configurations",
")",
")",
"{",
"$",
"configurations",
"=",
"[",
"$",
"configurations",
"]",
";",
"}",
"foreach"... | Applies all converters to the passed configurations and stops when a
converter is applied it will move on to the next configuration and so on.
@param array|object $configurations | [
"Applies",
"all",
"converters",
"to",
"the",
"passed",
"configurations",
"and",
"stops",
"when",
"a",
"converter",
"is",
"applied",
"it",
"will",
"move",
"on",
"to",
"the",
"next",
"configuration",
"and",
"so",
"on",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/ParamConverterManager.php#L41-L50 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/ParamConverterManager.php | ParamConverterManager.applyConverter | private function applyConverter(Request $request, ParamConverter $configuration)
{
$value = $request->attributes->get($configuration->getName());
$className = $configuration->getClass();
// If the value is already an instance of the class we are trying to convert it into
// we shoul... | php | private function applyConverter(Request $request, ParamConverter $configuration)
{
$value = $request->attributes->get($configuration->getName());
$className = $configuration->getClass();
// If the value is already an instance of the class we are trying to convert it into
// we shoul... | [
"private",
"function",
"applyConverter",
"(",
"Request",
"$",
"request",
",",
"ParamConverter",
"$",
"configuration",
")",
"{",
"$",
"value",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"$",
"configuration",
"->",
"getName",
"(",
")",
")",
"... | Applies converter on request based on the given configuration. | [
"Applies",
"converter",
"on",
"request",
"based",
"on",
"the",
"given",
"configuration",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/ParamConverterManager.php#L55-L97 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/ParamConverterManager.php | ParamConverterManager.add | public function add(ParamConverterInterface $converter, $priority = 0, $name = null)
{
if (null !== $priority) {
if (!isset($this->converters[$priority])) {
$this->converters[$priority] = [];
}
$this->converters[$priority][] = $converter;
}
... | php | public function add(ParamConverterInterface $converter, $priority = 0, $name = null)
{
if (null !== $priority) {
if (!isset($this->converters[$priority])) {
$this->converters[$priority] = [];
}
$this->converters[$priority][] = $converter;
}
... | [
"public",
"function",
"add",
"(",
"ParamConverterInterface",
"$",
"converter",
",",
"$",
"priority",
"=",
"0",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"priority",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
... | Adds a parameter converter.
Converters match either explicitly via $name or by iteration over all
converters with a $priority. If you pass a $priority = null then the
added converter will not be part of the iteration chain and can only
be invoked explicitly.
@param int $priority the priority (between -10 and 10)
@... | [
"Adds",
"a",
"parameter",
"converter",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/ParamConverterManager.php#L110-L123 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/ParamConverterManager.php | ParamConverterManager.all | public function all()
{
krsort($this->converters);
$converters = [];
foreach ($this->converters as $all) {
$converters = array_merge($converters, $all);
}
return $converters;
} | php | public function all()
{
krsort($this->converters);
$converters = [];
foreach ($this->converters as $all) {
$converters = array_merge($converters, $all);
}
return $converters;
} | [
"public",
"function",
"all",
"(",
")",
"{",
"krsort",
"(",
"$",
"this",
"->",
"converters",
")",
";",
"$",
"converters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"converters",
"as",
"$",
"all",
")",
"{",
"$",
"converters",
"=",
"array... | Returns all registered param converters.
@return array An array of param converters | [
"Returns",
"all",
"registered",
"param",
"converters",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/ParamConverterManager.php#L130-L140 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/ControllerListener.php | ControllerListener.onKernelController | public function onKernelController(FilterControllerEvent $event)
{
$controller = $event->getController();
if (!\is_array($controller) && method_exists($controller, '__invoke')) {
$controller = [$controller, '__invoke'];
}
if (!\is_array($controller)) {
retur... | php | public function onKernelController(FilterControllerEvent $event)
{
$controller = $event->getController();
if (!\is_array($controller) && method_exists($controller, '__invoke')) {
$controller = [$controller, '__invoke'];
}
if (!\is_array($controller)) {
retur... | [
"public",
"function",
"onKernelController",
"(",
"FilterControllerEvent",
"$",
"event",
")",
"{",
"$",
"controller",
"=",
"$",
"event",
"->",
"getController",
"(",
")",
";",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"controller",
")",
"&&",
"method_exists"... | Modifies the Request object to apply configuration information found in
controllers annotations like the template to render or HTTP caching
configuration. | [
"Modifies",
"the",
"Request",
"object",
"to",
"apply",
"configuration",
"information",
"found",
"in",
"controllers",
"annotations",
"like",
"the",
"template",
"to",
"render",
"or",
"HTTP",
"caching",
"configuration",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/ControllerListener.php#L44-L86 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/DoctrineParamConverter.php | DoctrineParamConverter.apply | public function apply(Request $request, ParamConverter $configuration)
{
$name = $configuration->getName();
$class = $configuration->getClass();
$options = $this->getOptions($configuration);
if (null === $request->attributes->get($name, false)) {
$configuration->setIsOpt... | php | public function apply(Request $request, ParamConverter $configuration)
{
$name = $configuration->getName();
$class = $configuration->getClass();
$options = $this->getOptions($configuration);
if (null === $request->attributes->get($name, false)) {
$configuration->setIsOpt... | [
"public",
"function",
"apply",
"(",
"Request",
"$",
"request",
",",
"ParamConverter",
"$",
"configuration",
")",
"{",
"$",
"name",
"=",
"$",
"configuration",
"->",
"getName",
"(",
")",
";",
"$",
"class",
"=",
"$",
"configuration",
"->",
"getClass",
"(",
... | {@inheritdoc}
@throws \LogicException When unable to guess how to get a Doctrine instance from the request information
@throws NotFoundHttpException When object not found | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/DoctrineParamConverter.php#L72-L113 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/HttpCacheListener.php | HttpCacheListener.onKernelController | public function onKernelController(FilterControllerEvent $event)
{
$request = $event->getRequest();
if (!$configuration = $request->attributes->get('_cache')) {
return;
}
$response = new Response();
$lastModifiedDate = '';
if ($configuration->getLastModi... | php | public function onKernelController(FilterControllerEvent $event)
{
$request = $event->getRequest();
if (!$configuration = $request->attributes->get('_cache')) {
return;
}
$response = new Response();
$lastModifiedDate = '';
if ($configuration->getLastModi... | [
"public",
"function",
"onKernelController",
"(",
"FilterControllerEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"configuration",
"=",
"$",
"request",
"->",
"attributes",
"->",
"ge... | Handles HTTP validation headers. | [
"Handles",
"HTTP",
"validation",
"headers",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/HttpCacheListener.php#L43-L77 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/HttpCacheListener.php | HttpCacheListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
$request = $event->getRequest();
if (!$configuration = $request->attributes->get('_cache')) {
return;
}
$response = $event->getResponse();
// http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditi... | php | public function onKernelResponse(FilterResponseEvent $event)
{
$request = $event->getRequest();
if (!$configuration = $request->attributes->get('_cache')) {
return;
}
$response = $event->getResponse();
// http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditi... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"if",
"(",
"!",
"$",
"configuration",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
... | Modifies the response to apply HTTP cache headers when needed. | [
"Modifies",
"the",
"response",
"to",
"apply",
"HTTP",
"cache",
"headers",
"when",
"needed",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/HttpCacheListener.php#L82-L147 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/HttpCacheListener.php | HttpCacheListener.convertToSecondsIfNeeded | private function convertToSecondsIfNeeded($time)
{
if (!is_numeric($time)) {
$now = microtime(true);
$time = ceil(strtotime($time, $now) - $now);
}
return $time;
} | php | private function convertToSecondsIfNeeded($time)
{
if (!is_numeric($time)) {
$now = microtime(true);
$time = ceil(strtotime($time, $now) - $now);
}
return $time;
} | [
"private",
"function",
"convertToSecondsIfNeeded",
"(",
"$",
"time",
")",
"{",
"if",
"(",
"!",
"is_numeric",
"(",
"$",
"time",
")",
")",
"{",
"$",
"now",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"time",
"=",
"ceil",
"(",
"strtotime",
"(",
"$",
... | @param int|string $time Time that can be either expressed in seconds or with relative time format (1 day, 2 weeks, ...)
@return int | [
"@param",
"int|string",
"$time",
"Time",
"that",
"can",
"be",
"either",
"expressed",
"in",
"seconds",
"or",
"with",
"relative",
"time",
"format",
"(",
"1",
"day",
"2",
"weeks",
"...",
")"
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/HttpCacheListener.php#L174-L183 |
sensiolabs/SensioFrameworkExtraBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('sensio_framework_extra');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode =... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('sensio_framework_extra');
if (method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->getRootNode();
} else {
// BC layer for symfony/config 4.1 and older
$rootNode =... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
"'sensio_framework_extra'",
")",
";",
"if",
"(",
"method_exists",
"(",
"$",
"treeBuilder",
",",
"'getRootNode'",
")",
")",
"{",
"$",
"rootNode",
"=... | Generates the configuration tree.
@return NodeInterface | [
"Generates",
"the",
"configuration",
"tree",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/DependencyInjection/Configuration.php#L31-L95 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/TemplateListener.php | TemplateListener.onKernelController | public function onKernelController(FilterControllerEvent $event)
{
$request = $event->getRequest();
$template = $request->attributes->get('_template');
if (!$template instanceof Template) {
return;
}
$controller = $event->getController();
if (!\is_array(... | php | public function onKernelController(FilterControllerEvent $event)
{
$request = $event->getRequest();
$template = $request->attributes->get('_template');
if (!$template instanceof Template) {
return;
}
$controller = $event->getController();
if (!\is_array(... | [
"public",
"function",
"onKernelController",
"(",
"FilterControllerEvent",
"$",
"event",
")",
"{",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"$",
"template",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'_template'",... | Guesses the template name to render and its variables and adds them to
the request object. | [
"Guesses",
"the",
"template",
"name",
"to",
"render",
"and",
"its",
"variables",
"and",
"adds",
"them",
"to",
"the",
"request",
"object",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/TemplateListener.php#L46-L65 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/TemplateListener.php | TemplateListener.onKernelView | public function onKernelView(GetResponseForControllerResultEvent $event)
{
/* @var Template $template */
$request = $event->getRequest();
$template = $request->attributes->get('_template');
if (!$template instanceof Template) {
return;
}
if (null === $th... | php | public function onKernelView(GetResponseForControllerResultEvent $event)
{
/* @var Template $template */
$request = $event->getRequest();
$template = $request->attributes->get('_template');
if (!$template instanceof Template) {
return;
}
if (null === $th... | [
"public",
"function",
"onKernelView",
"(",
"GetResponseForControllerResultEvent",
"$",
"event",
")",
"{",
"/* @var Template $template */",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"$",
"template",
"=",
"$",
"request",
"->",
"attributes... | Renders the template and initializes a new response object with the
rendered template content. | [
"Renders",
"the",
"template",
"and",
"initializes",
"a",
"new",
"response",
"object",
"with",
"the",
"rendered",
"template",
"content",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/TemplateListener.php#L71-L108 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/DateTimeParamConverter.php | DateTimeParamConverter.apply | public function apply(Request $request, ParamConverter $configuration)
{
$param = $configuration->getName();
if (!$request->attributes->has($param)) {
return false;
}
$options = $configuration->getOptions();
$value = $request->attributes->get($param);
i... | php | public function apply(Request $request, ParamConverter $configuration)
{
$param = $configuration->getName();
if (!$request->attributes->has($param)) {
return false;
}
$options = $configuration->getOptions();
$value = $request->attributes->get($param);
i... | [
"public",
"function",
"apply",
"(",
"Request",
"$",
"request",
",",
"ParamConverter",
"$",
"configuration",
")",
"{",
"$",
"param",
"=",
"$",
"configuration",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"!",
"$",
"request",
"->",
"attributes",
"->",
"has"... | {@inheritdoc}
@throws NotFoundHttpException When invalid date given | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/DateTimeParamConverter.php#L31-L71 |
sensiolabs/SensioFrameworkExtraBundle | Request/ParamConverter/DateTimeParamConverter.php | DateTimeParamConverter.supports | public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return 'DateTime' === $configuration->getClass() || is_subclass_of($configuration->getClass(), \PHP_VERSION_ID < 50500 ? 'DateTime' : 'DateTimeInterface');
} | php | public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return 'DateTime' === $configuration->getClass() || is_subclass_of($configuration->getClass(), \PHP_VERSION_ID < 50500 ? 'DateTime' : 'DateTimeInterface');
} | [
"public",
"function",
"supports",
"(",
"ParamConverter",
"$",
"configuration",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"configuration",
"->",
"getClass",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"'DateTime'",
"===",
"$",
"configuration",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Request/ParamConverter/DateTimeParamConverter.php#L76-L83 |
sensiolabs/SensioFrameworkExtraBundle | Templating/TemplateGuesser.php | TemplateGuesser.guessTemplateName | public function guessTemplateName($controller, Request $request)
{
if (\is_object($controller) && method_exists($controller, '__invoke')) {
$controller = [$controller, '__invoke'];
} elseif (!\is_array($controller)) {
throw new \InvalidArgumentException(sprintf('First argumen... | php | public function guessTemplateName($controller, Request $request)
{
if (\is_object($controller) && method_exists($controller, '__invoke')) {
$controller = [$controller, '__invoke'];
} elseif (!\is_array($controller)) {
throw new \InvalidArgumentException(sprintf('First argumen... | [
"public",
"function",
"guessTemplateName",
"(",
"$",
"controller",
",",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"\\",
"is_object",
"(",
"$",
"controller",
")",
"&&",
"method_exists",
"(",
"$",
"controller",
",",
"'__invoke'",
")",
")",
"{",
"$",
... | Guesses and returns the template name to render based on the controller
and action names.
@param callable $controller An array storing the controller object and action method
@return string The template name
@throws \InvalidArgumentException | [
"Guesses",
"and",
"returns",
"the",
"template",
"name",
"to",
"render",
"based",
"on",
"the",
"controller",
"and",
"action",
"names",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Templating/TemplateGuesser.php#L57-L89 |
sensiolabs/SensioFrameworkExtraBundle | Templating/TemplateGuesser.php | TemplateGuesser.getBundleForClass | private function getBundleForClass($class)
{
$reflectionClass = new \ReflectionClass($class);
$bundles = $this->kernel->getBundles();
do {
$namespace = $reflectionClass->getNamespaceName();
foreach ($bundles as $bundle) {
if ('Symfony\Bundle\Framework... | php | private function getBundleForClass($class)
{
$reflectionClass = new \ReflectionClass($class);
$bundles = $this->kernel->getBundles();
do {
$namespace = $reflectionClass->getNamespaceName();
foreach ($bundles as $bundle) {
if ('Symfony\Bundle\Framework... | [
"private",
"function",
"getBundleForClass",
"(",
"$",
"class",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"$",
"bundles",
"=",
"$",
"this",
"->",
"kernel",
"->",
"getBundles",
"(",
")",
";",
"do",
... | Returns the bundle name in which the given class name is located.
@param string $class A fully qualified controller class name
@return string|null $bundle A bundle name | [
"Returns",
"the",
"bundle",
"name",
"in",
"which",
"the",
"given",
"class",
"name",
"is",
"located",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/Templating/TemplateGuesser.php#L98-L115 |
sensiolabs/SensioFrameworkExtraBundle | EventListener/ParamConverterListener.php | ParamConverterListener.onKernelController | public function onKernelController(FilterControllerEvent $event)
{
$controller = $event->getController();
$request = $event->getRequest();
$configurations = [];
if ($configuration = $request->attributes->get('_converters')) {
foreach (\is_array($configuration) ? $configu... | php | public function onKernelController(FilterControllerEvent $event)
{
$controller = $event->getController();
$request = $event->getRequest();
$configurations = [];
if ($configuration = $request->attributes->get('_converters')) {
foreach (\is_array($configuration) ? $configu... | [
"public",
"function",
"onKernelController",
"(",
"FilterControllerEvent",
"$",
"event",
")",
"{",
"$",
"controller",
"=",
"$",
"event",
"->",
"getController",
"(",
")",
";",
"$",
"request",
"=",
"$",
"event",
"->",
"getRequest",
"(",
")",
";",
"$",
"config... | Modifies the ParamConverterManager instance. | [
"Modifies",
"the",
"ParamConverterManager",
"instance",
"."
] | train | https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/5f75c4658b03301cba17baa15a840b57b72b4262/EventListener/ParamConverterListener.php#L53-L79 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.getCreated | public function getCreated()
{
$rtn = $this->data['created'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
} | php | public function getCreated()
{
$rtn = $this->data['created'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
} | [
"public",
"function",
"getCreated",
"(",
")",
"{",
"$",
"rtn",
"=",
"$",
"this",
"->",
"data",
"[",
"'created'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"rtn",
")",
")",
"{",
"$",
"rtn",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"rtn",
")",
... | Get the value of Created / created.
@return \DateTime | [
"Get",
"the",
"value",
"of",
"Created",
"/",
"created",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L262-L271 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.getStarted | public function getStarted()
{
$rtn = $this->data['started'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
} | php | public function getStarted()
{
$rtn = $this->data['started'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
} | [
"public",
"function",
"getStarted",
"(",
")",
"{",
"$",
"rtn",
"=",
"$",
"this",
"->",
"data",
"[",
"'started'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"rtn",
")",
")",
"{",
"$",
"rtn",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"rtn",
")",
... | Get the value of Started / started.
@return \DateTime | [
"Get",
"the",
"value",
"of",
"Started",
"/",
"started",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L278-L287 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.getFinished | public function getFinished()
{
$rtn = $this->data['finished'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
} | php | public function getFinished()
{
$rtn = $this->data['finished'];
if (!empty($rtn)) {
$rtn = new \DateTime($rtn);
}
return $rtn;
} | [
"public",
"function",
"getFinished",
"(",
")",
"{",
"$",
"rtn",
"=",
"$",
"this",
"->",
"data",
"[",
"'finished'",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"rtn",
")",
")",
"{",
"$",
"rtn",
"=",
"new",
"\\",
"DateTime",
"(",
"$",
"rtn",
")"... | Get the value of Finished / finished.
@return \DateTime | [
"Get",
"the",
"value",
"of",
"Finished",
"/",
"finished",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L294-L303 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setId | public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
}
$this->data['id'] = $value;
$this->_setModified('id');
} | php | public function setId($value)
{
$this->_validateNotNull('Id', $value);
$this->_validateInt('Id', $value);
if ($this->data['id'] === $value) {
return;
}
$this->data['id'] = $value;
$this->_setModified('id');
} | [
"public",
"function",
"setId",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateNotNull",
"(",
"'Id'",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"_validateInt",
"(",
"'Id'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
... | Set the value of Id / id.
Must not be null.
@param $value int | [
"Set",
"the",
"value",
"of",
"Id",
"/",
"id",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L347-L359 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setProjectId | public function setProjectId($value)
{
$this->_validateNotNull('ProjectId', $value);
$this->_validateInt('ProjectId', $value);
if ($this->data['project_id'] === $value) {
return;
}
$this->data['project_id'] = $value;
$this->_setModified('project_id');
... | php | public function setProjectId($value)
{
$this->_validateNotNull('ProjectId', $value);
$this->_validateInt('ProjectId', $value);
if ($this->data['project_id'] === $value) {
return;
}
$this->data['project_id'] = $value;
$this->_setModified('project_id');
... | [
"public",
"function",
"setProjectId",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateNotNull",
"(",
"'ProjectId'",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"_validateInt",
"(",
"'ProjectId'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$... | Set the value of ProjectId / project_id.
Must not be null.
@param $value int | [
"Set",
"the",
"value",
"of",
"ProjectId",
"/",
"project_id",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L367-L379 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setCommitId | public function setCommitId($value)
{
$this->_validateNotNull('CommitId', $value);
$this->_validateString('CommitId', $value);
if ($this->data['commit_id'] === $value) {
return;
}
$this->data['commit_id'] = $value;
$this->_setModified('commit_id');
... | php | public function setCommitId($value)
{
$this->_validateNotNull('CommitId', $value);
$this->_validateString('CommitId', $value);
if ($this->data['commit_id'] === $value) {
return;
}
$this->data['commit_id'] = $value;
$this->_setModified('commit_id');
... | [
"public",
"function",
"setCommitId",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateNotNull",
"(",
"'CommitId'",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"_validateString",
"(",
"'CommitId'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$... | Set the value of CommitId / commit_id.
Must not be null.
@param $value string | [
"Set",
"the",
"value",
"of",
"CommitId",
"/",
"commit_id",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L387-L399 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setStatus | public function setStatus($value)
{
$this->_validateNotNull('Status', $value);
$this->_validateInt('Status', $value);
if ($this->data['status'] === $value) {
return;
}
$this->data['status'] = $value;
$this->_setModified('status');
} | php | public function setStatus($value)
{
$this->_validateNotNull('Status', $value);
$this->_validateInt('Status', $value);
if ($this->data['status'] === $value) {
return;
}
$this->data['status'] = $value;
$this->_setModified('status');
} | [
"public",
"function",
"setStatus",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateNotNull",
"(",
"'Status'",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"_validateInt",
"(",
"'Status'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"thi... | Set the value of Status / status.
Must not be null.
@param $value int | [
"Set",
"the",
"value",
"of",
"Status",
"/",
"status",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L407-L419 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setLog | public function setLog($value)
{
$this->_validateString('Log', $value);
if ($this->data['log'] === $value) {
return;
}
$this->data['log'] = $value;
$this->_setModified('log');
} | php | public function setLog($value)
{
$this->_validateString('Log', $value);
if ($this->data['log'] === $value) {
return;
}
$this->data['log'] = $value;
$this->_setModified('log');
} | [
"public",
"function",
"setLog",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateString",
"(",
"'Log'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'log'",
"]",
"===",
"$",
"value",
")",
"{",
"return",
";",
"... | Set the value of Log / log.
@param $value string | [
"Set",
"the",
"value",
"of",
"Log",
"/",
"log",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L426-L437 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setBranch | public function setBranch($value)
{
$this->_validateNotNull('Branch', $value);
$this->_validateString('Branch', $value);
if ($this->data['branch'] === $value) {
return;
}
$this->data['branch'] = $value;
$this->_setModified('branch');
} | php | public function setBranch($value)
{
$this->_validateNotNull('Branch', $value);
$this->_validateString('Branch', $value);
if ($this->data['branch'] === $value) {
return;
}
$this->data['branch'] = $value;
$this->_setModified('branch');
} | [
"public",
"function",
"setBranch",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateNotNull",
"(",
"'Branch'",
",",
"$",
"value",
")",
";",
"$",
"this",
"->",
"_validateString",
"(",
"'Branch'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"... | Set the value of Branch / branch.
Must not be null.
@param $value string | [
"Set",
"the",
"value",
"of",
"Branch",
"/",
"branch",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L445-L457 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setCreated | public function setCreated($value)
{
$this->_validateDate('Created', $value);
if ($this->data['created'] === $value) {
return;
}
$this->data['created'] = $value;
$this->_setModified('created');
} | php | public function setCreated($value)
{
$this->_validateDate('Created', $value);
if ($this->data['created'] === $value) {
return;
}
$this->data['created'] = $value;
$this->_setModified('created');
} | [
"public",
"function",
"setCreated",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateDate",
"(",
"'Created'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'created'",
"]",
"===",
"$",
"value",
")",
"{",
"return",
... | Set the value of Created / created.
@param $value \DateTime | [
"Set",
"the",
"value",
"of",
"Created",
"/",
"created",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L464-L475 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setStarted | public function setStarted($value)
{
$this->_validateDate('Started', $value);
if ($this->data['started'] === $value) {
return;
}
$this->data['started'] = $value;
$this->_setModified('started');
} | php | public function setStarted($value)
{
$this->_validateDate('Started', $value);
if ($this->data['started'] === $value) {
return;
}
$this->data['started'] = $value;
$this->_setModified('started');
} | [
"public",
"function",
"setStarted",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateDate",
"(",
"'Started'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'started'",
"]",
"===",
"$",
"value",
")",
"{",
"return",
... | Set the value of Started / started.
@param $value \DateTime | [
"Set",
"the",
"value",
"of",
"Started",
"/",
"started",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L482-L493 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setFinished | public function setFinished($value)
{
$this->_validateDate('Finished', $value);
if ($this->data['finished'] === $value) {
return;
}
$this->data['finished'] = $value;
$this->_setModified('finished');
} | php | public function setFinished($value)
{
$this->_validateDate('Finished', $value);
if ($this->data['finished'] === $value) {
return;
}
$this->data['finished'] = $value;
$this->_setModified('finished');
} | [
"public",
"function",
"setFinished",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateDate",
"(",
"'Finished'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'finished'",
"]",
"===",
"$",
"value",
")",
"{",
"return... | Set the value of Finished / finished.
@param $value \DateTime | [
"Set",
"the",
"value",
"of",
"Finished",
"/",
"finished",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L500-L511 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setCommitterEmail | public function setCommitterEmail($value)
{
$this->_validateString('CommitterEmail', $value);
if ($this->data['committer_email'] === $value) {
return;
}
$this->data['committer_email'] = $value;
$this->_setModified('committer_email');
} | php | public function setCommitterEmail($value)
{
$this->_validateString('CommitterEmail', $value);
if ($this->data['committer_email'] === $value) {
return;
}
$this->data['committer_email'] = $value;
$this->_setModified('committer_email');
} | [
"public",
"function",
"setCommitterEmail",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateString",
"(",
"'CommitterEmail'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'committer_email'",
"]",
"===",
"$",
"value",
... | Set the value of CommitterEmail / committer_email.
@param $value string | [
"Set",
"the",
"value",
"of",
"CommitterEmail",
"/",
"committer_email",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L518-L529 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setCommitMessage | public function setCommitMessage($value)
{
$this->_validateString('CommitMessage', $value);
if ($this->data['commit_message'] === $value) {
return;
}
$this->data['commit_message'] = $value;
$this->_setModified('commit_message');
} | php | public function setCommitMessage($value)
{
$this->_validateString('CommitMessage', $value);
if ($this->data['commit_message'] === $value) {
return;
}
$this->data['commit_message'] = $value;
$this->_setModified('commit_message');
} | [
"public",
"function",
"setCommitMessage",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateString",
"(",
"'CommitMessage'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'commit_message'",
"]",
"===",
"$",
"value",
")"... | Set the value of CommitMessage / commit_message.
@param $value string | [
"Set",
"the",
"value",
"of",
"CommitMessage",
"/",
"commit_message",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L536-L547 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setExtra | public function setExtra($value)
{
$this->_validateString('Extra', $value);
if ($this->data['extra'] === $value) {
return;
}
$this->data['extra'] = $value;
$this->_setModified('extra');
} | php | public function setExtra($value)
{
$this->_validateString('Extra', $value);
if ($this->data['extra'] === $value) {
return;
}
$this->data['extra'] = $value;
$this->_setModified('extra');
} | [
"public",
"function",
"setExtra",
"(",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"_validateString",
"(",
"'Extra'",
",",
"$",
"value",
")",
";",
"if",
"(",
"$",
"this",
"->",
"data",
"[",
"'extra'",
"]",
"===",
"$",
"value",
")",
"{",
"return",
";... | Set the value of Extra / extra.
@param $value string | [
"Set",
"the",
"value",
"of",
"Extra",
"/",
"extra",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L554-L565 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.getProject | public function getProject()
{
$key = $this->getProjectId();
if (empty($key)) {
return null;
}
$cacheKey = 'Cache.Project.' . $key;
$rtn = $this->cache->get($cacheKey, null);
if (empty($rtn)) {
$rtn = Factory::getStore('Project',... | php | public function getProject()
{
$key = $this->getProjectId();
if (empty($key)) {
return null;
}
$cacheKey = 'Cache.Project.' . $key;
$rtn = $this->cache->get($cacheKey, null);
if (empty($rtn)) {
$rtn = Factory::getStore('Project',... | [
"public",
"function",
"getProject",
"(",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getProjectId",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"cacheKey",
"=",
"'Cache.Project.'",
".",
"$"... | Get the Project model for this Build by Id.
@uses \PHPCI\Store\ProjectStore::getById()
@uses \PHPCI\Model\Project
@return \PHPCI\Model\Project | [
"Get",
"the",
"Project",
"model",
"for",
"this",
"Build",
"by",
"Id",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L574-L591 |
dancryer/PHPCI | PHPCI/Model/Base/BuildBase.php | BuildBase.setProject | public function setProject($value)
{
// Is this an instance of Project?
if ($value instanceof \PHPCI\Model\Project) {
return $this->setProjectObject($value);
}
// Is this an array representing a Project item?
if (is_array($value) && !empty($value['id'])) {
... | php | public function setProject($value)
{
// Is this an instance of Project?
if ($value instanceof \PHPCI\Model\Project) {
return $this->setProjectObject($value);
}
// Is this an array representing a Project item?
if (is_array($value) && !empty($value['id'])) {
... | [
"public",
"function",
"setProject",
"(",
"$",
"value",
")",
"{",
"// Is this an instance of Project?",
"if",
"(",
"$",
"value",
"instanceof",
"\\",
"PHPCI",
"\\",
"Model",
"\\",
"Project",
")",
"{",
"return",
"$",
"this",
"->",
"setProjectObject",
"(",
"$",
... | Set Project - Accepts an ID, an array representing a Project or a Project model.
@param $value mixed | [
"Set",
"Project",
"-",
"Accepts",
"an",
"ID",
"an",
"array",
"representing",
"a",
"Project",
"or",
"a",
"Project",
"model",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Base/BuildBase.php#L598-L612 |
dancryer/PHPCI | PHPCI/Migrations/20151009100610_remove_unique_name_index.php | RemoveUniqueNameIndex.change | public function change()
{
$user = $this->table('user');
if ($user->hasIndex('name', array('unique' => true))) {
$user->removeIndex('name', array('unique' => true));
$user->save();
}
$user->addIndex('name', array('unique' => false));
$user->save();
... | php | public function change()
{
$user = $this->table('user');
if ($user->hasIndex('name', array('unique' => true))) {
$user->removeIndex('name', array('unique' => true));
$user->save();
}
$user->addIndex('name', array('unique' => false));
$user->save();
... | [
"public",
"function",
"change",
"(",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"table",
"(",
"'user'",
")",
";",
"if",
"(",
"$",
"user",
"->",
"hasIndex",
"(",
"'name'",
",",
"array",
"(",
"'unique'",
"=>",
"true",
")",
")",
")",
"{",
"$",
... | Change Method.
Write your reversible migrations using this method.
More information on writing migrations is available here:
http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
The following commands can be used in this method and Phinx will
automatically reverse them when rolling back:
crea... | [
"Change",
"Method",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Migrations/20151009100610_remove_unique_name_index.php#L28-L39 |
dancryer/PHPCI | PHPCI/Model/Build/LocalBuild.php | LocalBuild.createWorkingCopy | public function createWorkingCopy(Builder $builder, $buildPath)
{
$reference = $this->getProject()->getReference();
$reference = substr($reference, -1) == '/' ? substr($reference, 0, -1) : $reference;
$buildPath = substr($buildPath, 0, -1);
// If there's a /config file in the ref... | php | public function createWorkingCopy(Builder $builder, $buildPath)
{
$reference = $this->getProject()->getReference();
$reference = substr($reference, -1) == '/' ? substr($reference, 0, -1) : $reference;
$buildPath = substr($buildPath, 0, -1);
// If there's a /config file in the ref... | [
"public",
"function",
"createWorkingCopy",
"(",
"Builder",
"$",
"builder",
",",
"$",
"buildPath",
")",
"{",
"$",
"reference",
"=",
"$",
"this",
"->",
"getProject",
"(",
")",
"->",
"getReference",
"(",
")",
";",
"$",
"reference",
"=",
"substr",
"(",
"$",
... | Create a working copy by cloning, copying, or similar. | [
"Create",
"a",
"working",
"copy",
"by",
"cloning",
"copying",
"or",
"similar",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/LocalBuild.php#L26-L57 |
dancryer/PHPCI | PHPCI/Model/Build/LocalBuild.php | LocalBuild.handleBareRepository | protected function handleBareRepository(Builder $builder, $reference, $buildPath)
{
$gitConfig = parse_ini_file($reference.'/config', true);
// If it is indeed a bare repository, then extract it into our build path:
if ($gitConfig['core']['bare']) {
$cmd = 'mkdir %2$s; git --git... | php | protected function handleBareRepository(Builder $builder, $reference, $buildPath)
{
$gitConfig = parse_ini_file($reference.'/config', true);
// If it is indeed a bare repository, then extract it into our build path:
if ($gitConfig['core']['bare']) {
$cmd = 'mkdir %2$s; git --git... | [
"protected",
"function",
"handleBareRepository",
"(",
"Builder",
"$",
"builder",
",",
"$",
"reference",
",",
"$",
"buildPath",
")",
"{",
"$",
"gitConfig",
"=",
"parse_ini_file",
"(",
"$",
"reference",
".",
"'/config'",
",",
"true",
")",
";",
"// If it is indee... | Check if this is a "bare" git repository, and if so, unarchive it.
@param Builder $builder
@param $reference
@param $buildPath
@return bool | [
"Check",
"if",
"this",
"is",
"a",
"bare",
"git",
"repository",
"and",
"if",
"so",
"unarchive",
"it",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/LocalBuild.php#L66-L78 |
dancryer/PHPCI | PHPCI/Model/Build/LocalBuild.php | LocalBuild.handleSymlink | protected function handleSymlink(Builder $builder, $reference, $buildPath)
{
if (is_link($buildPath) && is_file($buildPath)) {
unlink($buildPath);
}
$builder->log(sprintf('Symlinking: %s to %s', $reference, $buildPath));
if (!symlink($reference, $buildPath)) {
... | php | protected function handleSymlink(Builder $builder, $reference, $buildPath)
{
if (is_link($buildPath) && is_file($buildPath)) {
unlink($buildPath);
}
$builder->log(sprintf('Symlinking: %s to %s', $reference, $buildPath));
if (!symlink($reference, $buildPath)) {
... | [
"protected",
"function",
"handleSymlink",
"(",
"Builder",
"$",
"builder",
",",
"$",
"reference",
",",
"$",
"buildPath",
")",
"{",
"if",
"(",
"is_link",
"(",
"$",
"buildPath",
")",
"&&",
"is_file",
"(",
"$",
"buildPath",
")",
")",
"{",
"unlink",
"(",
"$... | Create a symlink if required.
@param Builder $builder
@param $reference
@param $buildPath
@return bool | [
"Create",
"a",
"symlink",
"if",
"required",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Model/Build/LocalBuild.php#L87-L101 |
dancryer/PHPCI | PHPCI/Plugin/PhpMessDetector.php | PhpMessDetector.execute | public function execute()
{
if (!$this->tryAndProcessRules()) {
return false;
}
$phpmdBinaryPath = $this->phpci->findBinary('phpmd');
$this->executePhpMd($phpmdBinaryPath);
$errorCount = $this->processReport(trim($this->phpci->getLastOutput()));
$this->... | php | public function execute()
{
if (!$this->tryAndProcessRules()) {
return false;
}
$phpmdBinaryPath = $this->phpci->findBinary('phpmd');
$this->executePhpMd($phpmdBinaryPath);
$errorCount = $this->processReport(trim($this->phpci->getLastOutput()));
$this->... | [
"public",
"function",
"execute",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"tryAndProcessRules",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"phpmdBinaryPath",
"=",
"$",
"this",
"->",
"phpci",
"->",
"findBinary",
"(",
"'phpmd'",
")",
... | Runs PHP Mess Detector in a specified directory. | [
"Runs",
"PHP",
"Mess",
"Detector",
"in",
"a",
"specified",
"directory",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L116-L130 |
dancryer/PHPCI | PHPCI/Plugin/PhpMessDetector.php | PhpMessDetector.overrideSetting | protected function overrideSetting($options, $key)
{
if (isset($options[$key]) && is_array($options[$key])) {
$this->{$key} = $options[$key];
}
} | php | protected function overrideSetting($options, $key)
{
if (isset($options[$key]) && is_array($options[$key])) {
$this->{$key} = $options[$key];
}
} | [
"protected",
"function",
"overrideSetting",
"(",
"$",
"options",
",",
"$",
"key",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"$",
"key",
"]",
")",
"&&",
"is_array",
"(",
"$",
"options",
"[",
"$",
"key",
"]",
")",
")",
"{",
"$",
"this... | Override a default setting.
@param $options
@param $key | [
"Override",
"a",
"default",
"setting",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L137-L142 |
dancryer/PHPCI | PHPCI/Plugin/PhpMessDetector.php | PhpMessDetector.processReport | protected function processReport($xmlString)
{
$xml = simplexml_load_string($xmlString);
if ($xml === false) {
$this->phpci->log($xmlString);
throw new \Exception('Could not process PHPMD report XML.');
}
$warnings = 0;
foreach ($xml->file as $file)... | php | protected function processReport($xmlString)
{
$xml = simplexml_load_string($xmlString);
if ($xml === false) {
$this->phpci->log($xmlString);
throw new \Exception('Could not process PHPMD report XML.');
}
$warnings = 0;
foreach ($xml->file as $file)... | [
"protected",
"function",
"processReport",
"(",
"$",
"xmlString",
")",
"{",
"$",
"xml",
"=",
"simplexml_load_string",
"(",
"$",
"xmlString",
")",
";",
"if",
"(",
"$",
"xml",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"phpci",
"->",
"log",
"(",
"$",
... | Process PHPMD's XML output report.
@param $xmlString
@return array
@throws \Exception | [
"Process",
"PHPMD",
"s",
"XML",
"output",
"report",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L150-L181 |
dancryer/PHPCI | PHPCI/Plugin/PhpMessDetector.php | PhpMessDetector.tryAndProcessRules | protected function tryAndProcessRules()
{
if (!empty($this->rules) && !is_array($this->rules)) {
$this->phpci->logFailure('The "rules" option must be an array.');
return false;
}
foreach ($this->rules as &$rule) {
if (strpos($rule, '/') !== false) {
... | php | protected function tryAndProcessRules()
{
if (!empty($this->rules) && !is_array($this->rules)) {
$this->phpci->logFailure('The "rules" option must be an array.');
return false;
}
foreach ($this->rules as &$rule) {
if (strpos($rule, '/') !== false) {
... | [
"protected",
"function",
"tryAndProcessRules",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"rules",
")",
"&&",
"!",
"is_array",
"(",
"$",
"this",
"->",
"rules",
")",
")",
"{",
"$",
"this",
"->",
"phpci",
"->",
"logFailure",
"(",
... | Try and process the rules parameter from phpci.yml.
@return bool | [
"Try",
"and",
"process",
"the",
"rules",
"parameter",
"from",
"phpci",
".",
"yml",
"."
] | train | https://github.com/dancryer/PHPCI/blob/71ab3875ac822c8f138e4dddd045cc992229811e/PHPCI/Plugin/PhpMessDetector.php#L187-L201 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.