repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
fisharebest/webtrees | app/Individual.php | Individual.getBirthDate | public function getBirthDate(): Date
{
foreach ($this->getAllBirthDates() as $date) {
if ($date->isOK()) {
return $date;
}
}
return new Date('');
} | php | public function getBirthDate(): Date
{
foreach ($this->getAllBirthDates() as $date) {
if ($date->isOK()) {
return $date;
}
}
return new Date('');
} | [
"public",
"function",
"getBirthDate",
"(",
")",
":",
"Date",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllBirthDates",
"(",
")",
"as",
"$",
"date",
")",
"{",
"if",
"(",
"$",
"date",
"->",
"isOK",
"(",
")",
")",
"{",
"return",
"$",
"date",
";",
... | Get the date of birth
@return Date | [
"Get",
"the",
"date",
"of",
"birth"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L477-L486 | train |
fisharebest/webtrees | app/Individual.php | Individual.getBirthPlace | public function getBirthPlace(): Place
{
foreach ($this->getAllBirthPlaces() as $place) {
return $place;
}
return new Place('', $this->tree);
} | php | public function getBirthPlace(): Place
{
foreach ($this->getAllBirthPlaces() as $place) {
return $place;
}
return new Place('', $this->tree);
} | [
"public",
"function",
"getBirthPlace",
"(",
")",
":",
"Place",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllBirthPlaces",
"(",
")",
"as",
"$",
"place",
")",
"{",
"return",
"$",
"place",
";",
"}",
"return",
"new",
"Place",
"(",
"''",
",",
"$",
"this... | Get the place of birth
@return Place | [
"Get",
"the",
"place",
"of",
"birth"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L493-L500 | train |
fisharebest/webtrees | app/Individual.php | Individual.getDeathDate | public function getDeathDate(): Date
{
foreach ($this->getAllDeathDates() as $date) {
if ($date->isOK()) {
return $date;
}
}
return new Date('');
} | php | public function getDeathDate(): Date
{
foreach ($this->getAllDeathDates() as $date) {
if ($date->isOK()) {
return $date;
}
}
return new Date('');
} | [
"public",
"function",
"getDeathDate",
"(",
")",
":",
"Date",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllDeathDates",
"(",
")",
"as",
"$",
"date",
")",
"{",
"if",
"(",
"$",
"date",
"->",
"isOK",
"(",
")",
")",
"{",
"return",
"$",
"date",
";",
... | Get the date of death
@return Date | [
"Get",
"the",
"date",
"of",
"death"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L517-L526 | train |
fisharebest/webtrees | app/Individual.php | Individual.getDeathPlace | public function getDeathPlace(): Place
{
foreach ($this->getAllDeathPlaces() as $place) {
return $place;
}
return new Place('', $this->tree);
} | php | public function getDeathPlace(): Place
{
foreach ($this->getAllDeathPlaces() as $place) {
return $place;
}
return new Place('', $this->tree);
} | [
"public",
"function",
"getDeathPlace",
"(",
")",
":",
"Place",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllDeathPlaces",
"(",
")",
"as",
"$",
"place",
")",
"{",
"return",
"$",
"place",
";",
"}",
"return",
"new",
"Place",
"(",
"''",
",",
"$",
"this... | Get the place of death
@return Place | [
"Get",
"the",
"place",
"of",
"death"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L533-L540 | train |
fisharebest/webtrees | app/Individual.php | Individual.getAllBirthDates | public function getAllBirthDates(): array
{
foreach (Gedcom::BIRTH_EVENTS as $event) {
$tmp = $this->getAllEventDates([$event]);
if ($tmp) {
return $tmp;
}
}
return [];
} | php | public function getAllBirthDates(): array
{
foreach (Gedcom::BIRTH_EVENTS as $event) {
$tmp = $this->getAllEventDates([$event]);
if ($tmp) {
return $tmp;
}
}
return [];
} | [
"public",
"function",
"getAllBirthDates",
"(",
")",
":",
"array",
"{",
"foreach",
"(",
"Gedcom",
"::",
"BIRTH_EVENTS",
"as",
"$",
"event",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
"getAllEventDates",
"(",
"[",
"$",
"event",
"]",
")",
";",
"if",
... | Get all the birth dates - for the individual lists.
@return Date[] | [
"Get",
"all",
"the",
"birth",
"dates",
"-",
"for",
"the",
"individual",
"lists",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L583-L593 | train |
fisharebest/webtrees | app/Individual.php | Individual.getAllBirthPlaces | public function getAllBirthPlaces(): array
{
foreach (Gedcom::BIRTH_EVENTS as $event) {
$places = $this->getAllEventPlaces([$event]);
if (!empty($places)) {
return $places;
}
}
return [];
} | php | public function getAllBirthPlaces(): array
{
foreach (Gedcom::BIRTH_EVENTS as $event) {
$places = $this->getAllEventPlaces([$event]);
if (!empty($places)) {
return $places;
}
}
return [];
} | [
"public",
"function",
"getAllBirthPlaces",
"(",
")",
":",
"array",
"{",
"foreach",
"(",
"Gedcom",
"::",
"BIRTH_EVENTS",
"as",
"$",
"event",
")",
"{",
"$",
"places",
"=",
"$",
"this",
"->",
"getAllEventPlaces",
"(",
"[",
"$",
"event",
"]",
")",
";",
"if... | Gat all the birth places - for the individual lists.
@return Place[] | [
"Gat",
"all",
"the",
"birth",
"places",
"-",
"for",
"the",
"individual",
"lists",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L600-L610 | train |
fisharebest/webtrees | app/Individual.php | Individual.getAllDeathDates | public function getAllDeathDates(): array
{
foreach (Gedcom::DEATH_EVENTS as $event) {
$tmp = $this->getAllEventDates([$event]);
if ($tmp) {
return $tmp;
}
}
return [];
} | php | public function getAllDeathDates(): array
{
foreach (Gedcom::DEATH_EVENTS as $event) {
$tmp = $this->getAllEventDates([$event]);
if ($tmp) {
return $tmp;
}
}
return [];
} | [
"public",
"function",
"getAllDeathDates",
"(",
")",
":",
"array",
"{",
"foreach",
"(",
"Gedcom",
"::",
"DEATH_EVENTS",
"as",
"$",
"event",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
"getAllEventDates",
"(",
"[",
"$",
"event",
"]",
")",
";",
"if",
... | Get all the death dates - for the individual lists.
@return Date[] | [
"Get",
"all",
"the",
"death",
"dates",
"-",
"for",
"the",
"individual",
"lists",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L617-L627 | train |
fisharebest/webtrees | app/Individual.php | Individual.getAllDeathPlaces | public function getAllDeathPlaces(): array
{
foreach (Gedcom::DEATH_EVENTS as $event) {
$places = $this->getAllEventPlaces([$event]);
if (!empty($places)) {
return $places;
}
}
return [];
} | php | public function getAllDeathPlaces(): array
{
foreach (Gedcom::DEATH_EVENTS as $event) {
$places = $this->getAllEventPlaces([$event]);
if (!empty($places)) {
return $places;
}
}
return [];
} | [
"public",
"function",
"getAllDeathPlaces",
"(",
")",
":",
"array",
"{",
"foreach",
"(",
"Gedcom",
"::",
"DEATH_EVENTS",
"as",
"$",
"event",
")",
"{",
"$",
"places",
"=",
"$",
"this",
"->",
"getAllEventPlaces",
"(",
"[",
"$",
"event",
"]",
")",
";",
"if... | Get all the death places - for the individual lists.
@return Place[] | [
"Get",
"all",
"the",
"death",
"places",
"-",
"for",
"the",
"individual",
"lists",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L634-L644 | train |
fisharebest/webtrees | app/Individual.php | Individual.getEstimatedDeathDate | public function getEstimatedDeathDate(): Date
{
if ($this->estimated_death_date === null) {
foreach ($this->getAllDeathDates() as $date) {
if ($date->isOK()) {
$this->estimated_death_date = $date;
break;
}
}
... | php | public function getEstimatedDeathDate(): Date
{
if ($this->estimated_death_date === null) {
foreach ($this->getAllDeathDates() as $date) {
if ($date->isOK()) {
$this->estimated_death_date = $date;
break;
}
}
... | [
"public",
"function",
"getEstimatedDeathDate",
"(",
")",
":",
"Date",
"{",
"if",
"(",
"$",
"this",
"->",
"estimated_death_date",
"===",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllDeathDates",
"(",
")",
"as",
"$",
"date",
")",
"{",
"if",
... | Generate an estimated date of death.
@return Date | [
"Generate",
"an",
"estimated",
"date",
"of",
"death",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L739-L759 | train |
fisharebest/webtrees | app/Individual.php | Individual.getCurrentSpouse | public function getCurrentSpouse(): ?Individual
{
$family = $this->spouseFamilies()->last();
if ($family instanceof Family) {
return $family->spouse($this);
}
return null;
} | php | public function getCurrentSpouse(): ?Individual
{
$family = $this->spouseFamilies()->last();
if ($family instanceof Family) {
return $family->spouse($this);
}
return null;
} | [
"public",
"function",
"getCurrentSpouse",
"(",
")",
":",
"?",
"Individual",
"{",
"$",
"family",
"=",
"$",
"this",
"->",
"spouseFamilies",
"(",
")",
"->",
"last",
"(",
")",
";",
"if",
"(",
"$",
"family",
"instanceof",
"Family",
")",
"{",
"return",
"$",
... | Get the current spouse of this individual.
Where an individual has multiple spouses, assume they are stored
in chronological order, and take the last one found.
@return Individual|null | [
"Get",
"the",
"current",
"spouse",
"of",
"this",
"individual",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L859-L868 | train |
fisharebest/webtrees | app/Individual.php | Individual.numberOfChildren | public function numberOfChildren(): int
{
if (preg_match('/\n1 NCHI (\d+)(?:\n|$)/', $this->gedcom(), $match)) {
return (int) $match[1];
}
$children = [];
foreach ($this->spouseFamilies() as $fam) {
foreach ($fam->children() as $child) {
$chil... | php | public function numberOfChildren(): int
{
if (preg_match('/\n1 NCHI (\d+)(?:\n|$)/', $this->gedcom(), $match)) {
return (int) $match[1];
}
$children = [];
foreach ($this->spouseFamilies() as $fam) {
foreach ($fam->children() as $child) {
$chil... | [
"public",
"function",
"numberOfChildren",
"(",
")",
":",
"int",
"{",
"if",
"(",
"preg_match",
"(",
"'/\\n1 NCHI (\\d+)(?:\\n|$)/'",
",",
"$",
"this",
"->",
"gedcom",
"(",
")",
",",
"$",
"match",
")",
")",
"{",
"return",
"(",
"int",
")",
"$",
"match",
"... | Count the children belonging to this individual.
@return int | [
"Count",
"the",
"children",
"belonging",
"to",
"this",
"individual",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L875-L889 | train |
fisharebest/webtrees | app/Individual.php | Individual.primaryChildFamily | public function primaryChildFamily(): ?Family
{
$families = $this->childFamilies();
switch ($families->count()) {
case 0:
return null;
case 1:
return $families[0];
default:
// If there is more than one FAMC record, c... | php | public function primaryChildFamily(): ?Family
{
$families = $this->childFamilies();
switch ($families->count()) {
case 0:
return null;
case 1:
return $families[0];
default:
// If there is more than one FAMC record, c... | [
"public",
"function",
"primaryChildFamily",
"(",
")",
":",
"?",
"Family",
"{",
"$",
"families",
"=",
"$",
"this",
"->",
"childFamilies",
"(",
")",
";",
"switch",
"(",
"$",
"families",
"->",
"count",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"nu... | Get the preferred parents for this individual.
An individual may multiple parents (e.g. birth, adopted, disputed).
The preferred family record is:
(a) the first one with an explicit tag "_PRIMARY Y"
(b) the first one with a pedigree of "birth"
(c) the first one with no pedigree (default is "birth")
(d) the first one f... | [
"Get",
"the",
"preferred",
"parents",
"for",
"this",
"individual",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L931-L966 | train |
fisharebest/webtrees | app/Individual.php | Individual.getSpouseFamilyLabel | public function getSpouseFamilyLabel(Family $family): string
{
$spouse = $family->spouse($this);
if ($spouse) {
/* I18N: %s is the spouse name */
return I18N::translate('Family with %s', $spouse->fullName());
}
return $family->fullName();
} | php | public function getSpouseFamilyLabel(Family $family): string
{
$spouse = $family->spouse($this);
if ($spouse) {
/* I18N: %s is the spouse name */
return I18N::translate('Family with %s', $spouse->fullName());
}
return $family->fullName();
} | [
"public",
"function",
"getSpouseFamilyLabel",
"(",
"Family",
"$",
"family",
")",
":",
"string",
"{",
"$",
"spouse",
"=",
"$",
"family",
"->",
"spouse",
"(",
"$",
"this",
")",
";",
"if",
"(",
"$",
"spouse",
")",
"{",
"/* I18N: %s is the spouse name */",
"re... | Get the description for the family.
For example, "XXX's family with new wife".
@param Family $family
@return string | [
"Get",
"the",
"description",
"for",
"the",
"family",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L1098-L1107 | train |
fisharebest/webtrees | app/Individual.php | Individual.getPrimaryParentsNames | public function getPrimaryParentsNames($classname = '', $display = ''): string
{
$fam = $this->primaryChildFamily();
if (!$fam) {
return '';
}
$txt = '<div';
if ($classname) {
$txt .= ' class="' . $classname . '"';
}
if ($display) {
... | php | public function getPrimaryParentsNames($classname = '', $display = ''): string
{
$fam = $this->primaryChildFamily();
if (!$fam) {
return '';
}
$txt = '<div';
if ($classname) {
$txt .= ' class="' . $classname . '"';
}
if ($display) {
... | [
"public",
"function",
"getPrimaryParentsNames",
"(",
"$",
"classname",
"=",
"''",
",",
"$",
"display",
"=",
"''",
")",
":",
"string",
"{",
"$",
"fam",
"=",
"$",
"this",
"->",
"primaryChildFamily",
"(",
")",
";",
"if",
"(",
"!",
"$",
"fam",
")",
"{",
... | get primary parents names for this individual
@param string $classname optional css class
@param string $display optional css style display
@return string a div block with father & mother names | [
"get",
"primary",
"parents",
"names",
"for",
"this",
"individual"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L1117-L1154 | train |
fisharebest/webtrees | app/Individual.php | Individual.formatListDetails | public function formatListDetails(): string
{
return
$this->formatFirstMajorFact(Gedcom::BIRTH_EVENTS, 1) .
$this->formatFirstMajorFact(Gedcom::DEATH_EVENTS, 1);
} | php | public function formatListDetails(): string
{
return
$this->formatFirstMajorFact(Gedcom::BIRTH_EVENTS, 1) .
$this->formatFirstMajorFact(Gedcom::DEATH_EVENTS, 1);
} | [
"public",
"function",
"formatListDetails",
"(",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"formatFirstMajorFact",
"(",
"Gedcom",
"::",
"BIRTH_EVENTS",
",",
"1",
")",
".",
"$",
"this",
"->",
"formatFirstMajorFact",
"(",
"Gedcom",
"::",
"DEATH_EVENTS... | Extra info to display when displaying this record in a list of
selection items or favorites.
@return string | [
"Extra",
"info",
"to",
"display",
"when",
"displaying",
"this",
"record",
"in",
"a",
"list",
"of",
"selection",
"items",
"or",
"favorites",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Individual.php#L1362-L1367 | train |
fisharebest/webtrees | app/Http/Controllers/BranchesController.php | BranchesController.allAncestors | protected function allAncestors(Individual $individual): array
{
/** @var Individual[] $ancestors */
$ancestors = [
1 => $individual,
];
do {
$sosa = key($ancestors);
$family = $ancestors[$sosa]->primaryChildFamily();
if ($family !==... | php | protected function allAncestors(Individual $individual): array
{
/** @var Individual[] $ancestors */
$ancestors = [
1 => $individual,
];
do {
$sosa = key($ancestors);
$family = $ancestors[$sosa]->primaryChildFamily();
if ($family !==... | [
"protected",
"function",
"allAncestors",
"(",
"Individual",
"$",
"individual",
")",
":",
"array",
"{",
"/** @var Individual[] $ancestors */",
"$",
"ancestors",
"=",
"[",
"1",
"=>",
"$",
"individual",
",",
"]",
";",
"do",
"{",
"$",
"sosa",
"=",
"key",
"(",
... | Find all ancestors of an individual, indexed by the Sosa-Stradonitz number.
@param Individual $individual
@return Individual[] | [
"Find",
"all",
"ancestors",
"of",
"an",
"individual",
"indexed",
"by",
"the",
"Sosa",
"-",
"Stradonitz",
"number",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/BranchesController.php#L135-L158 | train |
fisharebest/webtrees | app/Http/Controllers/BranchesController.php | BranchesController.loadIndividuals | private function loadIndividuals(Tree $tree, string $surname, bool $soundex_dm, bool $soundex_std): array
{
$individuals = DB::table('individuals')
->join('name', static function (JoinClause $join): void {
$join
->on('name.n_file', '=', 'individuals.i_file')
... | php | private function loadIndividuals(Tree $tree, string $surname, bool $soundex_dm, bool $soundex_std): array
{
$individuals = DB::table('individuals')
->join('name', static function (JoinClause $join): void {
$join
->on('name.n_file', '=', 'individuals.i_file')
... | [
"private",
"function",
"loadIndividuals",
"(",
"Tree",
"$",
"tree",
",",
"string",
"$",
"surname",
",",
"bool",
"$",
"soundex_dm",
",",
"bool",
"$",
"soundex_std",
")",
":",
"array",
"{",
"$",
"individuals",
"=",
"DB",
"::",
"table",
"(",
"'individuals'",
... | Fetch all individuals with a matching surname
@param Tree $tree
@param string $surname
@param bool $soundex_dm
@param bool $soundex_std
@return Individual[] | [
"Fetch",
"all",
"individuals",
"with",
"a",
"matching",
"surname"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/BranchesController.php#L170-L213 | train |
fisharebest/webtrees | app/Http/Controllers/BranchesController.php | BranchesController.getPatriarchsHtml | public function getPatriarchsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std): string
{
$html = '';
foreach ($individuals as $individual) {
foreach ($individual->childFamilies() as $family) {
foreach ($family->sp... | php | public function getPatriarchsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std): string
{
$html = '';
foreach ($individuals as $individual) {
foreach ($individual->childFamilies() as $family) {
foreach ($family->sp... | [
"public",
"function",
"getPatriarchsHtml",
"(",
"Tree",
"$",
"tree",
",",
"array",
"$",
"individuals",
",",
"array",
"$",
"ancestors",
",",
"string",
"$",
"surname",
",",
"bool",
"$",
"soundex_dm",
",",
"bool",
"$",
"soundex_std",
")",
":",
"string",
"{",
... | For each individual with no ancestors, list their descendants.
@param Tree $tree
@param Individual[] $individuals
@param Individual[] $ancestors
@param string $surname
@param bool $soundex_dm
@param bool $soundex_std
@return string | [
"For",
"each",
"individual",
"with",
"no",
"ancestors",
"list",
"their",
"descendants",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/BranchesController.php#L227-L242 | train |
fisharebest/webtrees | app/Module/ModuleHistoricEventsTrait.php | ModuleHistoricEventsTrait.historicEventsForIndividual | public function historicEventsForIndividual(Individual $individual): Collection
{
$min_date = $individual->getEstimatedBirthDate();
$max_date = $individual->getEstimatedDeathDate();
return (new Collection($this->historicEventsAll()))
->map(static function (string $gedcom) use ($... | php | public function historicEventsForIndividual(Individual $individual): Collection
{
$min_date = $individual->getEstimatedBirthDate();
$max_date = $individual->getEstimatedDeathDate();
return (new Collection($this->historicEventsAll()))
->map(static function (string $gedcom) use ($... | [
"public",
"function",
"historicEventsForIndividual",
"(",
"Individual",
"$",
"individual",
")",
":",
"Collection",
"{",
"$",
"min_date",
"=",
"$",
"individual",
"->",
"getEstimatedBirthDate",
"(",
")",
";",
"$",
"max_date",
"=",
"$",
"individual",
"->",
"getEsti... | Which events should we show for an individual?
@param Individual $individual
@return Collection | [
"Which",
"events",
"should",
"we",
"show",
"for",
"an",
"individual?"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleHistoricEventsTrait.php#L60-L72 | train |
fisharebest/webtrees | app/Statistics/Repository/HitCountRepository.php | HitCountRepository.hitCountQuery | private function hitCountQuery($page_name, string $page_parameter = ''): string
{
if ($page_name === '') {
// index.php?ctype=gedcom
$page_name = 'index.php';
$page_parameter = 'gedcom:' . $this->tree->id();
} elseif ($page_name === 'index.php') {
... | php | private function hitCountQuery($page_name, string $page_parameter = ''): string
{
if ($page_name === '') {
// index.php?ctype=gedcom
$page_name = 'index.php';
$page_parameter = 'gedcom:' . $this->tree->id();
} elseif ($page_name === 'index.php') {
... | [
"private",
"function",
"hitCountQuery",
"(",
"$",
"page_name",
",",
"string",
"$",
"page_parameter",
"=",
"''",
")",
":",
"string",
"{",
"if",
"(",
"$",
"page_name",
"===",
"''",
")",
"{",
"// index.php?ctype=gedcom",
"$",
"page_name",
"=",
"'index.php'",
";... | These functions provide access to hitcounter for use in the HTML block.
@param string $page_name
@param string $page_parameter
@return string | [
"These",
"functions",
"provide",
"access",
"to",
"hitcounter",
"for",
"use",
"in",
"the",
"HTML",
"block",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Repository/HitCountRepository.php#L60-L84 | train |
fisharebest/webtrees | app/Http/Controllers/Admin/LocationController.php | LocationController.getPlaceListLocation | private function getPlaceListLocation(int $id): array
{
// We know the id of the place in the placelocation table,
// now get the id of the same place in the places table
if ($id === 0) {
$fqpn = '';
} else {
$hierarchy = $this->getHierarchy($id);
... | php | private function getPlaceListLocation(int $id): array
{
// We know the id of the place in the placelocation table,
// now get the id of the same place in the places table
if ($id === 0) {
$fqpn = '';
} else {
$hierarchy = $this->getHierarchy($id);
... | [
"private",
"function",
"getPlaceListLocation",
"(",
"int",
"$",
"id",
")",
":",
"array",
"{",
"// We know the id of the place in the placelocation table,",
"// now get the id of the same place in the places table",
"if",
"(",
"$",
"id",
"===",
"0",
")",
"{",
"$",
"fqpn",
... | Find all of the places in the hierarchy
@param int $id
@return stdClass[] | [
"Find",
"all",
"of",
"the",
"places",
"in",
"the",
"hierarchy"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/Admin/LocationController.php#L120-L159 | train |
fisharebest/webtrees | app/Http/Controllers/Admin/LocationController.php | LocationController.childLocationStatus | private function childLocationStatus(int $parent_id): stdClass
{
$prefix = DB::connection()->getTablePrefix();
$expression =
$prefix . 'p0.pl_place IS NOT NULL AND ' . $prefix . 'p0.pl_lati IS NULL OR ' .
$prefix . 'p1.pl_place IS NOT NULL AND ' . $prefix . 'p1.pl_lati IS NU... | php | private function childLocationStatus(int $parent_id): stdClass
{
$prefix = DB::connection()->getTablePrefix();
$expression =
$prefix . 'p0.pl_place IS NOT NULL AND ' . $prefix . 'p0.pl_lati IS NULL OR ' .
$prefix . 'p1.pl_place IS NOT NULL AND ' . $prefix . 'p1.pl_lati IS NU... | [
"private",
"function",
"childLocationStatus",
"(",
"int",
"$",
"parent_id",
")",
":",
"stdClass",
"{",
"$",
"prefix",
"=",
"DB",
"::",
"connection",
"(",
")",
"->",
"getTablePrefix",
"(",
")",
";",
"$",
"expression",
"=",
"$",
"prefix",
".",
"'p0.pl_place ... | How many children does place have? How many have co-ordinates?
@param int $parent_id
@return stdClass | [
"How",
"many",
"children",
"does",
"place",
"have?",
"How",
"many",
"have",
"co",
"-",
"ordinates?"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/Admin/LocationController.php#L168-L197 | train |
fisharebest/webtrees | app/Http/Controllers/Admin/LocationController.php | LocationController.isLocationActive | private function isLocationActive(string $place_name): bool
{
$places = explode(Gedcom::PLACE_SEPARATOR, $place_name);
$query = DB::table('places AS p0')
->where('p0.p_place', '=', $places[0])
->select(['pl0.*']);
array_shift($places);
foreach ($places as $... | php | private function isLocationActive(string $place_name): bool
{
$places = explode(Gedcom::PLACE_SEPARATOR, $place_name);
$query = DB::table('places AS p0')
->where('p0.p_place', '=', $places[0])
->select(['pl0.*']);
array_shift($places);
foreach ($places as $... | [
"private",
"function",
"isLocationActive",
"(",
"string",
"$",
"place_name",
")",
":",
"bool",
"{",
"$",
"places",
"=",
"explode",
"(",
"Gedcom",
"::",
"PLACE_SEPARATOR",
",",
"$",
"place_name",
")",
";",
"$",
"query",
"=",
"DB",
"::",
"table",
"(",
"'pl... | Is a place name used in any tree?
@param string $place_name
@return bool | [
"Is",
"a",
"place",
"name",
"used",
"in",
"any",
"tree?"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/Admin/LocationController.php#L206-L225 | train |
fisharebest/webtrees | app/Webtrees.php | Webtrees.createServerRequest | public function createServerRequest(): ServerRequestInterface
{
$server_request_creator = new ServerRequestCreator(
app(ServerRequestFactoryInterface::class),
app(UriFactoryInterface::class),
app(UploadedFileFactoryInterface::class),
app(StreamFactoryInterface... | php | public function createServerRequest(): ServerRequestInterface
{
$server_request_creator = new ServerRequestCreator(
app(ServerRequestFactoryInterface::class),
app(UriFactoryInterface::class),
app(UploadedFileFactoryInterface::class),
app(StreamFactoryInterface... | [
"public",
"function",
"createServerRequest",
"(",
")",
":",
"ServerRequestInterface",
"{",
"$",
"server_request_creator",
"=",
"new",
"ServerRequestCreator",
"(",
"app",
"(",
"ServerRequestFactoryInterface",
"::",
"class",
")",
",",
"app",
"(",
"UriFactoryInterface",
... | We can use any PSR-7 compatible requests.
@return ServerRequestInterface | [
"We",
"can",
"use",
"any",
"PSR",
"-",
"7",
"compatible",
"requests",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Webtrees.php#L174-L189 | train |
fisharebest/webtrees | app/Webtrees.php | Webtrees.middleware | public function middleware(): array
{
return [
PhpEnvironment::class,
EmitResponse::class,
HandleExceptions::class,
ReadConfigIni::class,
UseDatabase::class,
UseDebugbar::class,
UpdateDatabaseSchema::class,
UseCa... | php | public function middleware(): array
{
return [
PhpEnvironment::class,
EmitResponse::class,
HandleExceptions::class,
ReadConfigIni::class,
UseDatabase::class,
UseDebugbar::class,
UpdateDatabaseSchema::class,
UseCa... | [
"public",
"function",
"middleware",
"(",
")",
":",
"array",
"{",
"return",
"[",
"PhpEnvironment",
"::",
"class",
",",
"EmitResponse",
"::",
"class",
",",
"HandleExceptions",
"::",
"class",
",",
"ReadConfigIni",
"::",
"class",
",",
"UseDatabase",
"::",
"class",... | The webtrees application is built from middleware.
@return string[] | [
"The",
"webtrees",
"application",
"is",
"built",
"from",
"middleware",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Webtrees.php#L196-L221 | train |
fisharebest/webtrees | app/Http/Controllers/AdminController.php | AdminController.privacyRestrictions | private function privacyRestrictions(Tree $tree): array
{
return DB::table('default_resn')
->where('gedcom_id', '=', $tree->id())
->get()
->map(static function (stdClass $row) use ($tree): stdClass {
$row->record = null;
$row->label = '';
... | php | private function privacyRestrictions(Tree $tree): array
{
return DB::table('default_resn')
->where('gedcom_id', '=', $tree->id())
->get()
->map(static function (stdClass $row) use ($tree): stdClass {
$row->record = null;
$row->label = '';
... | [
"private",
"function",
"privacyRestrictions",
"(",
"Tree",
"$",
"tree",
")",
":",
"array",
"{",
"return",
"DB",
"::",
"table",
"(",
"'default_resn'",
")",
"->",
"where",
"(",
"'gedcom_id'",
",",
"'='",
",",
"$",
"tree",
"->",
"id",
"(",
")",
")",
"->",... | The current privacy restrictions for a tree.
@param Tree $tree
@return array | [
"The",
"current",
"privacy",
"restrictions",
"for",
"a",
"tree",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminController.php#L380-L405 | train |
fisharebest/webtrees | app/Http/Controllers/AdminController.php | AdminController.tagsForPrivacy | private function tagsForPrivacy(Tree $tree): array
{
$tags = array_unique(array_merge(
explode(',', $tree->getPreference('INDI_FACTS_ADD')),
explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')),
explode(',', $tree->getPreference('FAM_FACTS_ADD')),
explode('... | php | private function tagsForPrivacy(Tree $tree): array
{
$tags = array_unique(array_merge(
explode(',', $tree->getPreference('INDI_FACTS_ADD')),
explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')),
explode(',', $tree->getPreference('FAM_FACTS_ADD')),
explode('... | [
"private",
"function",
"tagsForPrivacy",
"(",
"Tree",
"$",
"tree",
")",
":",
"array",
"{",
"$",
"tags",
"=",
"array_unique",
"(",
"array_merge",
"(",
"explode",
"(",
"','",
",",
"$",
"tree",
"->",
"getPreference",
"(",
"'INDI_FACTS_ADD'",
")",
")",
",",
... | Generate a list of potential problems with the server.
@param Tree $tree
@return string[] | [
"Generate",
"a",
"list",
"of",
"potential",
"problems",
"with",
"the",
"server",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/AdminController.php#L414-L454 | train |
fisharebest/webtrees | app/Services/ServerCheckService.php | ServerCheckService.serverErrors | public function serverErrors($driver = ''): Collection
{
$errors = Collection::make([
$this->databaseDriverErrors($driver),
$this->checkPhpExtension('mbstring'),
$this->checkPhpExtension('iconv'),
$this->checkPhpExtension('pcre'),
$this->checkPhpEx... | php | public function serverErrors($driver = ''): Collection
{
$errors = Collection::make([
$this->databaseDriverErrors($driver),
$this->checkPhpExtension('mbstring'),
$this->checkPhpExtension('iconv'),
$this->checkPhpExtension('pcre'),
$this->checkPhpEx... | [
"public",
"function",
"serverErrors",
"(",
"$",
"driver",
"=",
"''",
")",
":",
"Collection",
"{",
"$",
"errors",
"=",
"Collection",
"::",
"make",
"(",
"[",
"$",
"this",
"->",
"databaseDriverErrors",
"(",
"$",
"driver",
")",
",",
"$",
"this",
"->",
"che... | Things that may cause webtrees to break.
@param string $driver
@return Collection
@return string[] | [
"Things",
"that",
"may",
"cause",
"webtrees",
"to",
"break",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ServerCheckService.php#L60-L75 | train |
fisharebest/webtrees | app/Services/ServerCheckService.php | ServerCheckService.serverWarnings | public function serverWarnings($driver = ''): Collection
{
$warnings = Collection::make([
$this->databaseDriverWarnings($driver),
$this->checkPhpExtension('curl'),
$this->checkPhpExtension('gd'),
$this->checkPhpExtension('simplexml'),
$this->checkP... | php | public function serverWarnings($driver = ''): Collection
{
$warnings = Collection::make([
$this->databaseDriverWarnings($driver),
$this->checkPhpExtension('curl'),
$this->checkPhpExtension('gd'),
$this->checkPhpExtension('simplexml'),
$this->checkP... | [
"public",
"function",
"serverWarnings",
"(",
"$",
"driver",
"=",
"''",
")",
":",
"Collection",
"{",
"$",
"warnings",
"=",
"Collection",
"::",
"make",
"(",
"[",
"$",
"this",
"->",
"databaseDriverWarnings",
"(",
"$",
"driver",
")",
",",
"$",
"this",
"->",
... | Things that should be fixed, but which won't stop completely webtrees from running.
@param string $driver
@return Collection
@return string[] | [
"Things",
"that",
"should",
"be",
"fixed",
"but",
"which",
"won",
"t",
"stop",
"completely",
"webtrees",
"from",
"running",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ServerCheckService.php#L85-L100 | train |
fisharebest/webtrees | app/Services/ServerCheckService.php | ServerCheckService.isFunctionDisabled | public function isFunctionDisabled(string $function): bool
{
$disable_functions = explode(',', ini_get('disable_functions'));
$disable_functions = array_map(static function (string $func): string {
return strtolower(trim($func));
}, $disable_functions);
$function = strto... | php | public function isFunctionDisabled(string $function): bool
{
$disable_functions = explode(',', ini_get('disable_functions'));
$disable_functions = array_map(static function (string $func): string {
return strtolower(trim($func));
}, $disable_functions);
$function = strto... | [
"public",
"function",
"isFunctionDisabled",
"(",
"string",
"$",
"function",
")",
":",
"bool",
"{",
"$",
"disable_functions",
"=",
"explode",
"(",
"','",
",",
"ini_get",
"(",
"'disable_functions'",
")",
")",
";",
"$",
"disable_functions",
"=",
"array_map",
"(",... | Check if a PHP function is in the list of disabled functions.
@param string $function
@return bool | [
"Check",
"if",
"a",
"PHP",
"function",
"is",
"in",
"the",
"list",
"of",
"disabled",
"functions",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ServerCheckService.php#L148-L158 | train |
fisharebest/webtrees | app/Module/ModuleAnalyticsTrait.php | ModuleAnalyticsTrait.analyticsCanShow | public function analyticsCanShow(): bool
{
$request = app(ServerRequestInterface::class);
// If the browser sets the DNT header, then we won't use analytics.
$dnt = $request->getServerParams()['HTTP_DNT'] ?? '';
if ($dnt === '1') {
return false;
}
forea... | php | public function analyticsCanShow(): bool
{
$request = app(ServerRequestInterface::class);
// If the browser sets the DNT header, then we won't use analytics.
$dnt = $request->getServerParams()['HTTP_DNT'] ?? '';
if ($dnt === '1') {
return false;
}
forea... | [
"public",
"function",
"analyticsCanShow",
"(",
")",
":",
"bool",
"{",
"$",
"request",
"=",
"app",
"(",
"ServerRequestInterface",
"::",
"class",
")",
";",
"// If the browser sets the DNT header, then we won't use analytics.",
"$",
"dnt",
"=",
"$",
"request",
"->",
"g... | Should we add this tracker?
@return bool | [
"Should",
"we",
"add",
"this",
"tracker?"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleAnalyticsTrait.php#L36-L54 | train |
fisharebest/webtrees | app/Http/Controllers/MessageController.php | MessageController.contactPage | public function contactPage(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$referer = $request->getHeaderLine('referer');
$body = $request->get('body', '');
$from_email = $request->get('from_email', '');
$from_name = $request->get('from_name', '');
... | php | public function contactPage(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$referer = $request->getHeaderLine('referer');
$body = $request->get('body', '');
$from_email = $request->get('from_email', '');
$from_name = $request->get('from_name', '');
... | [
"public",
"function",
"contactPage",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"Tree",
"$",
"tree",
")",
":",
"ResponseInterface",
"{",
"$",
"referer",
"=",
"$",
"request",
"->",
"getHeaderLine",
"(",
"'referer'",
")",
";",
"$",
"body",
"=",
"$",
... | A form to compose a message from a visitor.
@param ServerRequestInterface $request
@param Tree $tree
@return ResponseInterface | [
"A",
"form",
"to",
"compose",
"a",
"message",
"from",
"a",
"visitor",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MessageController.php#L148-L179 | train |
fisharebest/webtrees | app/Http/Controllers/MessageController.php | MessageController.validContacts | private function validContacts(Tree $tree): array
{
$contacts = [
$this->user_service->find((int) $tree->getPreference('CONTACT_USER_ID')),
$this->user_service->find((int) $tree->getPreference('WEBMASTER_USER_ID')),
];
return array_filter($contacts);
} | php | private function validContacts(Tree $tree): array
{
$contacts = [
$this->user_service->find((int) $tree->getPreference('CONTACT_USER_ID')),
$this->user_service->find((int) $tree->getPreference('WEBMASTER_USER_ID')),
];
return array_filter($contacts);
} | [
"private",
"function",
"validContacts",
"(",
"Tree",
"$",
"tree",
")",
":",
"array",
"{",
"$",
"contacts",
"=",
"[",
"$",
"this",
"->",
"user_service",
"->",
"find",
"(",
"(",
"int",
")",
"$",
"tree",
"->",
"getPreference",
"(",
"'CONTACT_USER_ID'",
")",... | Contact messages can only be sent to the designated contacts
@param Tree $tree
@return UserInterface[] | [
"Contact",
"messages",
"can",
"only",
"be",
"sent",
"to",
"the",
"designated",
"contacts"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MessageController.php#L353-L361 | train |
fisharebest/webtrees | app/Http/Controllers/MessageController.php | MessageController.deliverMessage | private function deliverMessage(Tree $tree, UserInterface $sender, UserInterface $recipient, string $subject, string $body, string $url, string $ip): bool
{
$success = true;
// Temporarily switch to the recipient's language
I18N::init($recipient->getPreference('language'));
$body_t... | php | private function deliverMessage(Tree $tree, UserInterface $sender, UserInterface $recipient, string $subject, string $body, string $url, string $ip): bool
{
$success = true;
// Temporarily switch to the recipient's language
I18N::init($recipient->getPreference('language'));
$body_t... | [
"private",
"function",
"deliverMessage",
"(",
"Tree",
"$",
"tree",
",",
"UserInterface",
"$",
"sender",
",",
"UserInterface",
"$",
"recipient",
",",
"string",
"$",
"subject",
",",
"string",
"$",
"body",
",",
"string",
"$",
"url",
",",
"string",
"$",
"ip",
... | Add a message to a user's inbox, send it to them via email, or both.
@param Tree $tree
@param UserInterface $sender
@param UserInterface $recipient
@param string $subject
@param string $body
@param string $url
@param string $ip
@return bool | [
"Add",
"a",
"message",
"to",
"a",
"user",
"s",
"inbox",
"send",
"it",
"to",
"them",
"via",
"email",
"or",
"both",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MessageController.php#L376-L423 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.searchFamilyNames | public function searchFamilyNames(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('families')
->leftJoin('name AS husb_name', static function (JoinClause $join): void {
$join
->on('husb_name.n_file', '='... | php | public function searchFamilyNames(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('families')
->leftJoin('name AS husb_name', static function (JoinClause $join): void {
$join
->on('husb_name.n_file', '='... | [
"public",
"function",
"searchFamilyNames",
"(",
"array",
"$",
"trees",
",",
"array",
"$",
"search",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"int",
"$",
"limit",
"=",
"PHP_INT_MAX",
")",
":",
"Collection",
"{",
"$",
"query",
"=",
"DB",
"::",
"table",
... | Search for families by name.
@param Tree[] $trees
@param string[] $search
@param int $offset
@param int $limit
@return Collection
@return Family[] | [
"Search",
"for",
"families",
"by",
"name",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L81-L110 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.searchIndividualNames | public function searchIndividualNames(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('individuals')
->join('name', static function (JoinClause $join): void {
$join
->on('name.n_file', '=', 'individuals.... | php | public function searchIndividualNames(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('individuals')
->join('name', static function (JoinClause $join): void {
$join
->on('name.n_file', '=', 'individuals.... | [
"public",
"function",
"searchIndividualNames",
"(",
"array",
"$",
"trees",
",",
"array",
"$",
"search",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"int",
"$",
"limit",
"=",
"PHP_INT_MAX",
")",
":",
"Collection",
"{",
"$",
"query",
"=",
"DB",
"::",
"tabl... | Search for individuals by name.
@param Tree[] $trees
@param string[] $search
@param int $offset
@param int $limit
@return Collection
@return Individual[] | [
"Search",
"for",
"individuals",
"by",
"name",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L145-L160 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.searchMedia | public function searchMedia(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('media');
$this->whereTrees($query, 'media.m_file', $trees);
$this->whereSearch($query, 'm_gedcom', $search);
return $this->paginateQuery($query, Med... | php | public function searchMedia(array $trees, array $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('media');
$this->whereTrees($query, 'media.m_file', $trees);
$this->whereSearch($query, 'm_gedcom', $search);
return $this->paginateQuery($query, Med... | [
"public",
"function",
"searchMedia",
"(",
"array",
"$",
"trees",
",",
"array",
"$",
"search",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"int",
"$",
"limit",
"=",
"PHP_INT_MAX",
")",
":",
"Collection",
"{",
"$",
"query",
"=",
"DB",
"::",
"table",
"(",... | Search for media objects.
@param Tree[] $trees
@param string[] $search
@param int $offset
@param int $limit
@return Collection
@return Media[] | [
"Search",
"for",
"media",
"objects",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L173-L181 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.searchPlaces | public function searchPlaces(Tree $tree, string $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('places AS p0')
->where('p0.p_file', '=', $tree->id())
->leftJoin('places AS p1', 'p1.p_id', '=', 'p0.p_parent_id')
->leftJoin('places AS p... | php | public function searchPlaces(Tree $tree, string $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection
{
$query = DB::table('places AS p0')
->where('p0.p_file', '=', $tree->id())
->leftJoin('places AS p1', 'p1.p_id', '=', 'p0.p_parent_id')
->leftJoin('places AS p... | [
"public",
"function",
"searchPlaces",
"(",
"Tree",
"$",
"tree",
",",
"string",
"$",
"search",
",",
"int",
"$",
"offset",
"=",
"0",
",",
"int",
"$",
"limit",
"=",
"PHP_INT_MAX",
")",
":",
"Collection",
"{",
"$",
"query",
"=",
"DB",
"::",
"table",
"(",... | Search for places.
@param Tree $tree
@param string $search
@param int $offset
@param int $limit
@return Collection
@return Place[] | [
"Search",
"for",
"places",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L303-L352 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.paginateQuery | private function paginateQuery(Builder $query, Closure $row_mapper, Closure $row_filter, int $offset, int $limit): Collection
{
$collection = new Collection();
foreach ($query->cursor() as $row) {
$record = $row_mapper($row);
// If the object has a method "canShow()", then u... | php | private function paginateQuery(Builder $query, Closure $row_mapper, Closure $row_filter, int $offset, int $limit): Collection
{
$collection = new Collection();
foreach ($query->cursor() as $row) {
$record = $row_mapper($row);
// If the object has a method "canShow()", then u... | [
"private",
"function",
"paginateQuery",
"(",
"Builder",
"$",
"query",
",",
"Closure",
"$",
"row_mapper",
",",
"Closure",
"$",
"row_filter",
",",
"int",
"$",
"offset",
",",
"int",
"$",
"limit",
")",
":",
"Collection",
"{",
"$",
"collection",
"=",
"new",
"... | Paginate a search query.
@param Builder $query Searches the database for the desired records.
@param Closure $row_mapper Converts a row from the query into a record.
@param Closure $row_filter
@param int $offset Skip this many rows.
@param int $limit Take this many rows.
@return Collection | [
"Paginate",
"a",
"search",
"query",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L853-L879 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.whereSearch | private function whereSearch(Builder $query, $field, array $search_terms): void
{
if ($field instanceof Expression) {
$field = $field->getValue();
}
foreach ($search_terms as $search_term) {
$query->whereContains(DB::raw($field), $search_term);
}
} | php | private function whereSearch(Builder $query, $field, array $search_terms): void
{
if ($field instanceof Expression) {
$field = $field->getValue();
}
foreach ($search_terms as $search_term) {
$query->whereContains(DB::raw($field), $search_term);
}
} | [
"private",
"function",
"whereSearch",
"(",
"Builder",
"$",
"query",
",",
"$",
"field",
",",
"array",
"$",
"search_terms",
")",
":",
"void",
"{",
"if",
"(",
"$",
"field",
"instanceof",
"Expression",
")",
"{",
"$",
"field",
"=",
"$",
"field",
"->",
"getV... | Apply search filters to a SQL query column. Apply collation rules to MySQL.
@param Builder $query
@param Expression|string $field
@param string[] $search_terms | [
"Apply",
"search",
"filters",
"to",
"a",
"SQL",
"query",
"column",
".",
"Apply",
"collation",
"rules",
"to",
"MySQL",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L888-L897 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.wherePhonetic | private function wherePhonetic(Builder $query, $field, string $soundex): void
{
if ($soundex !== '') {
$query->where(static function (Builder $query) use ($soundex, $field): void {
foreach (explode(':', $soundex) as $sdx) {
$query->orWhere($field, 'LIKE', '%' ... | php | private function wherePhonetic(Builder $query, $field, string $soundex): void
{
if ($soundex !== '') {
$query->where(static function (Builder $query) use ($soundex, $field): void {
foreach (explode(':', $soundex) as $sdx) {
$query->orWhere($field, 'LIKE', '%' ... | [
"private",
"function",
"wherePhonetic",
"(",
"Builder",
"$",
"query",
",",
"$",
"field",
",",
"string",
"$",
"soundex",
")",
":",
"void",
"{",
"if",
"(",
"$",
"soundex",
"!==",
"''",
")",
"{",
"$",
"query",
"->",
"where",
"(",
"static",
"function",
"... | Apply soundex search filters to a SQL query column.
@param Builder $query
@param Expression|string $field
@param string $soundex | [
"Apply",
"soundex",
"search",
"filters",
"to",
"a",
"SQL",
"query",
"column",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L906-L915 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.rawGedcomFilter | private function rawGedcomFilter(array $search_terms): Closure
{
return static function (GedcomRecord $record) use ($search_terms): bool {
// Ignore non-genealogy fields
$gedcom = preg_replace('/\n\d (?:_UID) .*/', '', $record->gedcom());
// Ignore matches in links
... | php | private function rawGedcomFilter(array $search_terms): Closure
{
return static function (GedcomRecord $record) use ($search_terms): bool {
// Ignore non-genealogy fields
$gedcom = preg_replace('/\n\d (?:_UID) .*/', '', $record->gedcom());
// Ignore matches in links
... | [
"private",
"function",
"rawGedcomFilter",
"(",
"array",
"$",
"search_terms",
")",
":",
"Closure",
"{",
"return",
"static",
"function",
"(",
"GedcomRecord",
"$",
"record",
")",
"use",
"(",
"$",
"search_terms",
")",
":",
"bool",
"{",
"// Ignore non-genealogy field... | A closure to filter records by privacy-filtered GEDCOM data.
@param array $search_terms
@return Closure | [
"A",
"closure",
"to",
"filter",
"records",
"by",
"privacy",
"-",
"filtered",
"GEDCOM",
"data",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L938-L956 | train |
fisharebest/webtrees | app/Services/SearchService.php | SearchService.rowLimiter | private function rowLimiter(int $limit = 1000): Closure
{
return static function () use ($limit): void {
static $n = 0;
if (++$n > $limit) {
$message = I18N::translate('The search returned too many results.');
throw new InternalServerErrorException($... | php | private function rowLimiter(int $limit = 1000): Closure
{
return static function () use ($limit): void {
static $n = 0;
if (++$n > $limit) {
$message = I18N::translate('The search returned too many results.');
throw new InternalServerErrorException($... | [
"private",
"function",
"rowLimiter",
"(",
"int",
"$",
"limit",
"=",
"1000",
")",
":",
"Closure",
"{",
"return",
"static",
"function",
"(",
")",
"use",
"(",
"$",
"limit",
")",
":",
"void",
"{",
"static",
"$",
"n",
"=",
"0",
";",
"if",
"(",
"++",
"... | Searching for short or common text can give more results than the system can process.
@param int $limit
@return Closure | [
"Searching",
"for",
"short",
"or",
"common",
"text",
"can",
"give",
"more",
"results",
"than",
"the",
"system",
"can",
"process",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/SearchService.php#L965-L976 | train |
fisharebest/webtrees | app/Http/Controllers/MediaFileController.php | MediaFileController.mediaDownload | public function mediaDownload(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$xref = $request->get('xref', '');
$fact_id = $request->get('fact_id');
$media = Media::getInstance($xref, $tree);
if ($media === null) {
throw new MediaNotFoundException... | php | public function mediaDownload(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$xref = $request->get('xref', '');
$fact_id = $request->get('fact_id');
$media = Media::getInstance($xref, $tree);
if ($media === null) {
throw new MediaNotFoundException... | [
"public",
"function",
"mediaDownload",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"Tree",
"$",
"tree",
")",
":",
"ResponseInterface",
"{",
"$",
"xref",
"=",
"$",
"request",
"->",
"get",
"(",
"'xref'",
",",
"''",
")",
";",
"$",
"fact_id",
"=",
"$... | Download a non-image media file.
@param ServerRequestInterface $request
@param Tree $tree
@return ResponseInterface | [
"Download",
"a",
"non",
"-",
"image",
"media",
"file",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MediaFileController.php#L60-L92 | train |
fisharebest/webtrees | app/Http/Controllers/MediaFileController.php | MediaFileController.generateImage | private function generateImage(MediaFile $media_file, array $params): ResponseInterface
{
try {
// Validate HTTP signature
$signature = $this->glideSignature();
$signature->validateRequest(parse_url(WT_BASE_URL . 'index.php', PHP_URL_PATH), $params);
$server... | php | private function generateImage(MediaFile $media_file, array $params): ResponseInterface
{
try {
// Validate HTTP signature
$signature = $this->glideSignature();
$signature->validateRequest(parse_url(WT_BASE_URL . 'index.php', PHP_URL_PATH), $params);
$server... | [
"private",
"function",
"generateImage",
"(",
"MediaFile",
"$",
"media_file",
",",
"array",
"$",
"params",
")",
":",
"ResponseInterface",
"{",
"try",
"{",
"// Validate HTTP signature",
"$",
"signature",
"=",
"$",
"this",
"->",
"glideSignature",
"(",
")",
";",
"... | Generate a thumbnail image for a file.
@param MediaFile $media_file
@param array $params
@return ResponseInterface | [
"Generate",
"a",
"thumbnail",
"image",
"for",
"a",
"file",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MediaFileController.php#L172-L198 | train |
fisharebest/webtrees | app/Http/Controllers/MediaFileController.php | MediaFileController.httpStatusAsImage | private function httpStatusAsImage(int $status): ResponseInterface
{
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#F88" /><text x="5" y="55" font-family="Verdana" font-size="35">' . $status . '</text></svg>';
// We can't use the actua... | php | private function httpStatusAsImage(int $status): ResponseInterface
{
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#F88" /><text x="5" y="55" font-family="Verdana" font-size="35">' . $status . '</text></svg>';
// We can't use the actua... | [
"private",
"function",
"httpStatusAsImage",
"(",
"int",
"$",
"status",
")",
":",
"ResponseInterface",
"{",
"$",
"svg",
"=",
"'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\"><rect width=\"100\" height=\"100\" fill=\"#F88\" /><text x=\"5\" y=\"55\" font-family=\"Ver... | Send a dummy image, to replace one that could not be found or created.
@param int $status HTTP status code
@return ResponseInterface | [
"Send",
"a",
"dummy",
"image",
"to",
"replace",
"one",
"that",
"could",
"not",
"be",
"found",
"or",
"created",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MediaFileController.php#L259-L268 | train |
fisharebest/webtrees | app/Http/Controllers/MediaFileController.php | MediaFileController.fileExtensionAsImage | private function fileExtensionAsImage(string $extension): ResponseInterface
{
$extension = '.' . strtolower($extension);
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#88F" /><text x="5" y="60" font-family="Verdana" font-size="30">' . ... | php | private function fileExtensionAsImage(string $extension): ResponseInterface
{
$extension = '.' . strtolower($extension);
$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100" height="100" fill="#88F" /><text x="5" y="60" font-family="Verdana" font-size="30">' . ... | [
"private",
"function",
"fileExtensionAsImage",
"(",
"string",
"$",
"extension",
")",
":",
"ResponseInterface",
"{",
"$",
"extension",
"=",
"'.'",
".",
"strtolower",
"(",
"$",
"extension",
")",
";",
"$",
"svg",
"=",
"'<svg xmlns=\"http://www.w3.org/2000/svg\" width=\... | Send a dummy image, to replace a non-image file.
@param string $extension
@return ResponseInterface | [
"Send",
"a",
"dummy",
"image",
"to",
"replace",
"a",
"non",
"-",
"image",
"file",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/MediaFileController.php#L277-L287 | train |
fisharebest/webtrees | app/Services/DatatablesService.php | DatatablesService.handle | public function handle(ServerRequestInterface $request, Builder $query, array $search_columns, array $sort_columns, Closure $callback): ResponseInterface
{
$search = $request->getQueryParams()['search']['value'] ?? '';
$start = (int) ($request->getQueryParams()['start'] ?? 0);
$length = (in... | php | public function handle(ServerRequestInterface $request, Builder $query, array $search_columns, array $sort_columns, Closure $callback): ResponseInterface
{
$search = $request->getQueryParams()['search']['value'] ?? '';
$start = (int) ($request->getQueryParams()['start'] ?? 0);
$length = (in... | [
"public",
"function",
"handle",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"Builder",
"$",
"query",
",",
"array",
"$",
"search_columns",
",",
"array",
"$",
"sort_columns",
",",
"Closure",
"$",
"callback",
")",
":",
"ResponseInterface",
"{",
"$",
"sear... | Apply filtering and pagination to a query, and generate a response suitable for datatables.
@link http://www.datatables.net/usage/server-side
@param ServerRequestInterface $request Includes the datatables request parameters.
@param Builder $query A query to fetch the unfiltered rows and... | [
"Apply",
"filtering",
"and",
"pagination",
"to",
"a",
"query",
"and",
"generate",
"a",
"response",
"suitable",
"for",
"datatables",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/DatatablesService.php#L44-L98 | train |
fisharebest/webtrees | app/Report/ReportParserBase.php | ReportParserBase.endElement | protected function endElement($parser, string $name): void
{
$method = $name . 'EndHandler';
if (method_exists($this, $method)) {
$this->$method();
}
} | php | protected function endElement($parser, string $name): void
{
$method = $name . 'EndHandler';
if (method_exists($this, $method)) {
$this->$method();
}
} | [
"protected",
"function",
"endElement",
"(",
"$",
"parser",
",",
"string",
"$",
"name",
")",
":",
"void",
"{",
"$",
"method",
"=",
"$",
"name",
".",
"'EndHandler'",
";",
"if",
"(",
"method_exists",
"(",
"$",
"this",
",",
"$",
"method",
")",
")",
"{",
... | XML handler for a closing tag.
@param resource $parser the resource handler for the xml parser
@param string $name the name of the xml element parsed
@return void | [
"XML",
"handler",
"for",
"a",
"closing",
"tag",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Report/ReportParserBase.php#L111-L118 | train |
fisharebest/webtrees | app/Http/Controllers/EditIndividualController.php | EditIndividualController.addUnlinked | public function addUnlinked(Tree $tree): ResponseInterface
{
return $this->viewResponse('edit/new-individual', [
'tree' => $tree,
'title' => I18N::translate('Create an individual'),
'nextaction' => 'add_unlinked_indi_action',
'individual' => null,
... | php | public function addUnlinked(Tree $tree): ResponseInterface
{
return $this->viewResponse('edit/new-individual', [
'tree' => $tree,
'title' => I18N::translate('Create an individual'),
'nextaction' => 'add_unlinked_indi_action',
'individual' => null,
... | [
"public",
"function",
"addUnlinked",
"(",
"Tree",
"$",
"tree",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"viewResponse",
"(",
"'edit/new-individual'",
",",
"[",
"'tree'",
"=>",
"$",
"tree",
",",
"'title'",
"=>",
"I18N",
"::",
"translat... | Add an unlinked individual
@param Tree $tree
@return ResponseInterface | [
"Add",
"an",
"unlinked",
"individual"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/EditIndividualController.php#L519-L531 | train |
fisharebest/webtrees | app/Http/Controllers/EditIndividualController.php | EditIndividualController.editName | public function editName(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$fact_id = $request->get('fact_id', '');
$xref = $request->get('xref', '');
$individual = Individual::getInstance($xref, $tree);
Auth::checkIndividualAccess($individual, true);
//... | php | public function editName(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$fact_id = $request->get('fact_id', '');
$xref = $request->get('xref', '');
$individual = Individual::getInstance($xref, $tree);
Auth::checkIndividualAccess($individual, true);
//... | [
"public",
"function",
"editName",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"Tree",
"$",
"tree",
")",
":",
"ResponseInterface",
"{",
"$",
"fact_id",
"=",
"$",
"request",
"->",
"get",
"(",
"'fact_id'",
",",
"''",
")",
";",
"$",
"xref",
"=",
"$",... | Edit a name record.
@param ServerRequestInterface $request
@param Tree $tree
@return ResponseInterface | [
"Edit",
"a",
"name",
"record",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/EditIndividualController.php#L578-L604 | train |
fisharebest/webtrees | app/Date/JewishDate.php | JewishDate.formatDay | protected function formatDay(): string
{
$locale = app(LocaleInterface::class)->language()->code();
if ($locale === 'he' || $locale === 'yi') {
return (new JewishCalendar())->numberToHebrewNumerals($this->day, true);
}
return parent::formatDay();
} | php | protected function formatDay(): string
{
$locale = app(LocaleInterface::class)->language()->code();
if ($locale === 'he' || $locale === 'yi') {
return (new JewishCalendar())->numberToHebrewNumerals($this->day, true);
}
return parent::formatDay();
} | [
"protected",
"function",
"formatDay",
"(",
")",
":",
"string",
"{",
"$",
"locale",
"=",
"app",
"(",
"LocaleInterface",
"::",
"class",
")",
"->",
"language",
"(",
")",
"->",
"code",
"(",
")",
";",
"if",
"(",
"$",
"locale",
"===",
"'he'",
"||",
"$",
... | Generate the %j format for a date.
@return string | [
"Generate",
"the",
"%j",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/JewishDate.php#L69-L78 | train |
fisharebest/webtrees | app/Date/JewishDate.php | JewishDate.formatShortYear | protected function formatShortYear(): string
{
$locale = app(LocaleInterface::class)->language()->code();
if ($locale === 'he' || $locale === 'yi') {
return (new JewishCalendar())->numberToHebrewNumerals($this->year, false);
}
return parent::formatLongYear();
} | php | protected function formatShortYear(): string
{
$locale = app(LocaleInterface::class)->language()->code();
if ($locale === 'he' || $locale === 'yi') {
return (new JewishCalendar())->numberToHebrewNumerals($this->year, false);
}
return parent::formatLongYear();
} | [
"protected",
"function",
"formatShortYear",
"(",
")",
":",
"string",
"{",
"$",
"locale",
"=",
"app",
"(",
"LocaleInterface",
"::",
"class",
")",
"->",
"language",
"(",
")",
"->",
"code",
"(",
")",
";",
"if",
"(",
"$",
"locale",
"===",
"'he'",
"||",
"... | Generate the %y format for a date.
NOTE Short year is NOT a 2-digit year. It is for calendars such as hebrew
which have a 3-digit form of 4-digit years.
@return string | [
"Generate",
"the",
"%y",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/JewishDate.php#L88-L97 | train |
fisharebest/webtrees | app/Date/JewishDate.php | JewishDate.monthNameNominativeCase | protected function monthNameNominativeCase(int $month, bool $leap_year): string
{
static $translated_month_names;
if ($translated_month_names === null) {
$translated_month_names = [
0 => '',
/* I18N: a month in the Jewish calendar */
1 =... | php | protected function monthNameNominativeCase(int $month, bool $leap_year): string
{
static $translated_month_names;
if ($translated_month_names === null) {
$translated_month_names = [
0 => '',
/* I18N: a month in the Jewish calendar */
1 =... | [
"protected",
"function",
"monthNameNominativeCase",
"(",
"int",
"$",
"month",
",",
"bool",
"$",
"leap_year",
")",
":",
"string",
"{",
"static",
"$",
"translated_month_names",
";",
"if",
"(",
"$",
"translated_month_names",
"===",
"null",
")",
"{",
"$",
"transla... | Full month name in nominative case.
@param int $month
@param bool $leap_year Some calendars use leap months
@return string | [
"Full",
"month",
"name",
"in",
"nominative",
"case",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/JewishDate.php#L123-L166 | train |
fisharebest/webtrees | app/Date/JewishDate.php | JewishDate.monthNameAbbreviated | protected function monthNameAbbreviated(int $month, bool $leap_year): string
{
return $this->monthNameNominativeCase($month, $leap_year);
} | php | protected function monthNameAbbreviated(int $month, bool $leap_year): string
{
return $this->monthNameNominativeCase($month, $leap_year);
} | [
"protected",
"function",
"monthNameAbbreviated",
"(",
"int",
"$",
"month",
",",
"bool",
"$",
"leap_year",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"monthNameNominativeCase",
"(",
"$",
"month",
",",
"$",
"leap_year",
")",
";",
"}"
] | Abbreviated month name
@param int $month
@param bool $leap_year Some calendars use leap months
@return string | [
"Abbreviated",
"month",
"name"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/JewishDate.php#L335-L338 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.dayNames | public function dayNames(int $day_number): string
{
static $translated_day_names;
if ($translated_day_names === null) {
$translated_day_names = [
0 => I18N::translate('Monday'),
1 => I18N::translate('Tuesday'),
2 => I18N::translate('Wednes... | php | public function dayNames(int $day_number): string
{
static $translated_day_names;
if ($translated_day_names === null) {
$translated_day_names = [
0 => I18N::translate('Monday'),
1 => I18N::translate('Tuesday'),
2 => I18N::translate('Wednes... | [
"public",
"function",
"dayNames",
"(",
"int",
"$",
"day_number",
")",
":",
"string",
"{",
"static",
"$",
"translated_day_names",
";",
"if",
"(",
"$",
"translated_day_names",
"===",
"null",
")",
"{",
"$",
"translated_day_names",
"=",
"[",
"0",
"=>",
"I18N",
... | Full day of the week
@param int $day_number
@return string | [
"Full",
"day",
"of",
"the",
"week"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L230-L247 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.dayNamesAbbreviated | protected function dayNamesAbbreviated(int $day_number): string
{
static $translated_day_names;
if ($translated_day_names === null) {
$translated_day_names = [
/* I18N: abbreviation for Monday */
0 => I18N::translate('Mon'),
/* I18N: abbre... | php | protected function dayNamesAbbreviated(int $day_number): string
{
static $translated_day_names;
if ($translated_day_names === null) {
$translated_day_names = [
/* I18N: abbreviation for Monday */
0 => I18N::translate('Mon'),
/* I18N: abbre... | [
"protected",
"function",
"dayNamesAbbreviated",
"(",
"int",
"$",
"day_number",
")",
":",
"string",
"{",
"static",
"$",
"translated_day_names",
";",
"if",
"(",
"$",
"translated_day_names",
"===",
"null",
")",
"{",
"$",
"translated_day_names",
"=",
"[",
"/* I18N: ... | Abbreviated day of the week
@param int $day_number
@return string | [
"Abbreviated",
"day",
"of",
"the",
"week"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L256-L280 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.compare | public static function compare(AbstractCalendarDate $d1, AbstractCalendarDate $d2): int
{
if ($d1->maximum_julian_day < $d2->minimum_julian_day) {
return -1;
}
if ($d2->maximum_julian_day < $d1->minimum_julian_day) {
return 1;
}
return 0;
} | php | public static function compare(AbstractCalendarDate $d1, AbstractCalendarDate $d2): int
{
if ($d1->maximum_julian_day < $d2->minimum_julian_day) {
return -1;
}
if ($d2->maximum_julian_day < $d1->minimum_julian_day) {
return 1;
}
return 0;
} | [
"public",
"static",
"function",
"compare",
"(",
"AbstractCalendarDate",
"$",
"d1",
",",
"AbstractCalendarDate",
"$",
"d2",
")",
":",
"int",
"{",
"if",
"(",
"$",
"d1",
"->",
"maximum_julian_day",
"<",
"$",
"d2",
"->",
"minimum_julian_day",
")",
"{",
"return",... | Compare two dates, for sorting
@param AbstractCalendarDate $d1
@param AbstractCalendarDate $d2
@return int | [
"Compare",
"two",
"dates",
"for",
"sorting"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L314-L325 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.getAge | public function getAge(int $jd): int
{
if ($this->year === 0 || $jd === 0) {
return 0;
}
if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
return 0;
}
if ($this->minimum_julian_day === $jd) {
return 0;
}
... | php | public function getAge(int $jd): int
{
if ($this->year === 0 || $jd === 0) {
return 0;
}
if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
return 0;
}
if ($this->minimum_julian_day === $jd) {
return 0;
}
... | [
"public",
"function",
"getAge",
"(",
"int",
"$",
"jd",
")",
":",
"int",
"{",
"if",
"(",
"$",
"this",
"->",
"year",
"===",
"0",
"||",
"$",
"jd",
"===",
"0",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"minimum_julian_day",
"... | How long between an event and a given julian day
Return result as a number of years.
@param int $jd date for calculation
@return int | [
"How",
"long",
"between",
"an",
"event",
"and",
"a",
"given",
"julian",
"day",
"Return",
"result",
"as",
"a",
"number",
"of",
"years",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L378-L402 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.getAgeFull | public function getAgeFull(int $jd): string
{
if ($this->year === 0 || $jd === 0) {
return '';
}
if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
return '';
}
if ($this->minimum_julian_day === $jd) {
return '';
... | php | public function getAgeFull(int $jd): string
{
if ($this->year === 0 || $jd === 0) {
return '';
}
if ($this->minimum_julian_day < $jd && $this->maximum_julian_day > $jd) {
return '';
}
if ($this->minimum_julian_day === $jd) {
return '';
... | [
"public",
"function",
"getAgeFull",
"(",
"int",
"$",
"jd",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"year",
"===",
"0",
"||",
"$",
"jd",
"===",
"0",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"minimum_julian_d... | How long between an event and a given julian day
Return result as a gedcom-style age string.
@param int $jd date for calculation
@return string | [
"How",
"long",
"between",
"an",
"event",
"and",
"a",
"given",
"julian",
"day",
"Return",
"result",
"as",
"a",
"gedcom",
"-",
"style",
"age",
"string",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L412-L449 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.convertToCalendar | public function convertToCalendar(string $calendar): AbstractCalendarDate
{
switch ($calendar) {
case 'gregorian':
return new GregorianDate($this);
case 'julian':
return new JulianDate($this);
case 'jewish':
return new Jewis... | php | public function convertToCalendar(string $calendar): AbstractCalendarDate
{
switch ($calendar) {
case 'gregorian':
return new GregorianDate($this);
case 'julian':
return new JulianDate($this);
case 'jewish':
return new Jewis... | [
"public",
"function",
"convertToCalendar",
"(",
"string",
"$",
"calendar",
")",
":",
"AbstractCalendarDate",
"{",
"switch",
"(",
"$",
"calendar",
")",
"{",
"case",
"'gregorian'",
":",
"return",
"new",
"GregorianDate",
"(",
"$",
"this",
")",
";",
"case",
"'ju... | Convert a date from one calendar to another.
@param string $calendar
@return AbstractCalendarDate | [
"Convert",
"a",
"date",
"from",
"one",
"calendar",
"to",
"another",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L458-L476 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.inValidRange | public function inValidRange(): bool
{
return $this->minimum_julian_day >= $this->calendar->jdStart() && $this->maximum_julian_day <= $this->calendar->jdEnd();
} | php | public function inValidRange(): bool
{
return $this->minimum_julian_day >= $this->calendar->jdStart() && $this->maximum_julian_day <= $this->calendar->jdEnd();
} | [
"public",
"function",
"inValidRange",
"(",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"minimum_julian_day",
">=",
"$",
"this",
"->",
"calendar",
"->",
"jdStart",
"(",
")",
"&&",
"$",
"this",
"->",
"maximum_julian_day",
"<=",
"$",
"this",
"->",
"... | Is this date within the valid range of the calendar
@return bool | [
"Is",
"this",
"date",
"within",
"the",
"valid",
"range",
"of",
"the",
"calendar"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L483-L486 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.daysInMonth | public function daysInMonth(): int
{
try {
return $this->calendar->daysInMonth($this->year, $this->month);
} catch (InvalidArgumentException $ex) {
// calendar.php calls this with "DD MMM" dates, for which we cannot calculate
// the length of a month. Should we va... | php | public function daysInMonth(): int
{
try {
return $this->calendar->daysInMonth($this->year, $this->month);
} catch (InvalidArgumentException $ex) {
// calendar.php calls this with "DD MMM" dates, for which we cannot calculate
// the length of a month. Should we va... | [
"public",
"function",
"daysInMonth",
"(",
")",
":",
"int",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"calendar",
"->",
"daysInMonth",
"(",
"$",
"this",
"->",
"year",
",",
"$",
"this",
"->",
"month",
")",
";",
"}",
"catch",
"(",
"InvalidArgumentExce... | How many days in the current month
@return int | [
"How",
"many",
"days",
"in",
"the",
"current",
"month"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L503-L512 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.formatDayZeros | protected function formatDayZeros(): string
{
if ($this->day > 9) {
return I18N::digits($this->day);
}
return I18N::digits('0' . $this->day);
} | php | protected function formatDayZeros(): string
{
if ($this->day > 9) {
return I18N::digits($this->day);
}
return I18N::digits('0' . $this->day);
} | [
"protected",
"function",
"formatDayZeros",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"day",
">",
"9",
")",
"{",
"return",
"I18N",
"::",
"digits",
"(",
"$",
"this",
"->",
"day",
")",
";",
"}",
"return",
"I18N",
"::",
"digits",
"(",... | Generate the %d format for a date.
@return string | [
"Generate",
"the",
"%d",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L661-L668 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.formatDayOfYear | protected function formatDayOfYear(): string
{
return I18N::digits($this->minimum_julian_day - $this->calendar->ymdToJd($this->year, 1, 1));
} | php | protected function formatDayOfYear(): string
{
return I18N::digits($this->minimum_julian_day - $this->calendar->ymdToJd($this->year, 1, 1));
} | [
"protected",
"function",
"formatDayOfYear",
"(",
")",
":",
"string",
"{",
"return",
"I18N",
"::",
"digits",
"(",
"$",
"this",
"->",
"minimum_julian_day",
"-",
"$",
"this",
"->",
"calendar",
"->",
"ymdToJd",
"(",
"$",
"this",
"->",
"year",
",",
"1",
",",
... | Generate the %z format for a date.
@return string | [
"Generate",
"the",
"%z",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L725-L728 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.formatMonthZeros | protected function formatMonthZeros(): string
{
if ($this->month > 9) {
return I18N::digits($this->month);
}
return I18N::digits('0' . $this->month);
} | php | protected function formatMonthZeros(): string
{
if ($this->month > 9) {
return I18N::digits($this->month);
}
return I18N::digits('0' . $this->month);
} | [
"protected",
"function",
"formatMonthZeros",
"(",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"month",
">",
"9",
")",
"{",
"return",
"I18N",
"::",
"digits",
"(",
"$",
"this",
"->",
"month",
")",
";",
"}",
"return",
"I18N",
"::",
"digits",
... | Generate the %m format for a date.
@return string | [
"Generate",
"the",
"%m",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L745-L752 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.formatLongMonth | protected function formatLongMonth($case = 'NOMINATIVE'): string
{
switch ($case) {
case 'GENITIVE':
return $this->monthNameGenitiveCase($this->month, $this->isLeapYear());
case 'NOMINATIVE':
return $this->monthNameNominativeCase($this->month, $this->i... | php | protected function formatLongMonth($case = 'NOMINATIVE'): string
{
switch ($case) {
case 'GENITIVE':
return $this->monthNameGenitiveCase($this->month, $this->isLeapYear());
case 'NOMINATIVE':
return $this->monthNameNominativeCase($this->month, $this->i... | [
"protected",
"function",
"formatLongMonth",
"(",
"$",
"case",
"=",
"'NOMINATIVE'",
")",
":",
"string",
"{",
"switch",
"(",
"$",
"case",
")",
"{",
"case",
"'GENITIVE'",
":",
"return",
"$",
"this",
"->",
"monthNameGenitiveCase",
"(",
"$",
"this",
"->",
"mont... | Generate the %F format for a date.
@param string $case Which grammatical case shall we use
@return string | [
"Generate",
"the",
"%F",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L761-L775 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.formatGedcomMonth | protected function formatGedcomMonth(): string
{
// Our simple lookup table doesn't work correctly for Adar on leap years
if ($this->month === 7 && $this->calendar instanceof JewishCalendar && !$this->calendar->isLeapYear($this->year)) {
return 'ADR';
}
return array_sear... | php | protected function formatGedcomMonth(): string
{
// Our simple lookup table doesn't work correctly for Adar on leap years
if ($this->month === 7 && $this->calendar instanceof JewishCalendar && !$this->calendar->isLeapYear($this->year)) {
return 'ADR';
}
return array_sear... | [
"protected",
"function",
"formatGedcomMonth",
"(",
")",
":",
"string",
"{",
"// Our simple lookup table doesn't work correctly for Adar on leap years",
"if",
"(",
"$",
"this",
"->",
"month",
"===",
"7",
"&&",
"$",
"this",
"->",
"calendar",
"instanceof",
"JewishCalendar"... | Generate the %O format for a date.
@return string | [
"Generate",
"the",
"%O",
"format",
"for",
"a",
"date",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L868-L876 | train |
fisharebest/webtrees | app/Date/AbstractCalendarDate.php | AbstractCalendarDate.calendarUrl | public function calendarUrl(string $date_format, Tree $tree): string
{
if ($this->day !== 0 && strpbrk($date_format, 'dDj')) {
// If the format includes a day, and the date also includes a day, then use the day view
$view = 'day';
} elseif ($this->month !== 0 && strpbrk($date... | php | public function calendarUrl(string $date_format, Tree $tree): string
{
if ($this->day !== 0 && strpbrk($date_format, 'dDj')) {
// If the format includes a day, and the date also includes a day, then use the day view
$view = 'day';
} elseif ($this->month !== 0 && strpbrk($date... | [
"public",
"function",
"calendarUrl",
"(",
"string",
"$",
"date_format",
",",
"Tree",
"$",
"tree",
")",
":",
"string",
"{",
"if",
"(",
"$",
"this",
"->",
"day",
"!==",
"0",
"&&",
"strpbrk",
"(",
"$",
"date_format",
",",
"'dDj'",
")",
")",
"{",
"// If ... | Create a URL that links this date to the WT calendar
@param string $date_format
@param Tree $tree
@return string | [
"Create",
"a",
"URL",
"that",
"links",
"this",
"date",
"to",
"the",
"WT",
"calendar"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Date/AbstractCalendarDate.php#L960-L981 | train |
fisharebest/webtrees | app/View.php | View.endpushunique | public static function endpushunique(): void
{
$content = ob_get_clean();
self::$stacks[self::$stack][sha1($content)] = $content;
} | php | public static function endpushunique(): void
{
$content = ob_get_clean();
self::$stacks[self::$stack][sha1($content)] = $content;
} | [
"public",
"static",
"function",
"endpushunique",
"(",
")",
":",
"void",
"{",
"$",
"content",
"=",
"ob_get_clean",
"(",
")",
";",
"self",
"::",
"$",
"stacks",
"[",
"self",
"::",
"$",
"stack",
"]",
"[",
"sha1",
"(",
"$",
"content",
")",
"]",
"=",
"$"... | Variant of push that will only add one copy of each item.
@return void | [
"Variant",
"of",
"push",
"that",
"will",
"only",
"add",
"one",
"copy",
"of",
"each",
"item",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/View.php#L153-L158 | train |
fisharebest/webtrees | app/View.php | View.stack | public static function stack(string $stack): string
{
$content = implode('', self::$stacks[$stack] ?? []);
self::$stacks[$stack] = [];
return $content;
} | php | public static function stack(string $stack): string
{
$content = implode('', self::$stacks[$stack] ?? []);
self::$stacks[$stack] = [];
return $content;
} | [
"public",
"static",
"function",
"stack",
"(",
"string",
"$",
"stack",
")",
":",
"string",
"{",
"$",
"content",
"=",
"implode",
"(",
"''",
",",
"self",
"::",
"$",
"stacks",
"[",
"$",
"stack",
"]",
"??",
"[",
"]",
")",
";",
"self",
"::",
"$",
"stac... | Implementation of Blade "stacks".
@param string $stack
@return string | [
"Implementation",
"of",
"Blade",
"stacks",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/View.php#L167-L174 | train |
fisharebest/webtrees | app/View.php | View.getFilenameForView | public function getFilenameForView(string $view_name): string
{
// If we request "::view", then use it explicityly. Don't allow replacements.
$explicit = Str::startsWith($view_name, self::NAMESPACE_SEPARATOR);
if (!Str::contains($view_name, self::NAMESPACE_SEPARATOR)) {
$view_n... | php | public function getFilenameForView(string $view_name): string
{
// If we request "::view", then use it explicityly. Don't allow replacements.
$explicit = Str::startsWith($view_name, self::NAMESPACE_SEPARATOR);
if (!Str::contains($view_name, self::NAMESPACE_SEPARATOR)) {
$view_n... | [
"public",
"function",
"getFilenameForView",
"(",
"string",
"$",
"view_name",
")",
":",
"string",
"{",
"// If we request \"::view\", then use it explicityly. Don't allow replacements.",
"$",
"explicit",
"=",
"Str",
"::",
"startsWith",
"(",
"$",
"view_name",
",",
"self",
... | Find the file for a view.
@param string $view_name
@return string
@throws Exception | [
"Find",
"the",
"file",
"for",
"a",
"view",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/View.php#L241-L268 | train |
fisharebest/webtrees | app/View.php | View.make | public static function make($name, $data = []): string
{
$view = new static($name, $data);
DebugBar::addView($name, $data);
return $view->render();
} | php | public static function make($name, $data = []): string
{
$view = new static($name, $data);
DebugBar::addView($name, $data);
return $view->render();
} | [
"public",
"static",
"function",
"make",
"(",
"$",
"name",
",",
"$",
"data",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"view",
"=",
"new",
"static",
"(",
"$",
"name",
",",
"$",
"data",
")",
";",
"DebugBar",
"::",
"addView",
"(",
"$",
"name",
... | Cerate and render a view in a single operation.
@param string $name
@param mixed[] $data
@return string | [
"Cerate",
"and",
"render",
"a",
"view",
"in",
"a",
"single",
"operation",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/View.php#L278-L285 | train |
fisharebest/webtrees | app/Services/ClipboardService.php | ClipboardService.pasteFact | public function pasteFact(string $fact_id, GedcomRecord $record): bool
{
$clipboard = Session::get('clipboard');
$record_type = $record::RECORD_TYPE;
if (isset($clipboard[$record_type][$fact_id])) {
$record->createFact($clipboard[$record_type][$fact_id]['factrec'], true);
... | php | public function pasteFact(string $fact_id, GedcomRecord $record): bool
{
$clipboard = Session::get('clipboard');
$record_type = $record::RECORD_TYPE;
if (isset($clipboard[$record_type][$fact_id])) {
$record->createFact($clipboard[$record_type][$fact_id]['factrec'], true);
... | [
"public",
"function",
"pasteFact",
"(",
"string",
"$",
"fact_id",
",",
"GedcomRecord",
"$",
"record",
")",
":",
"bool",
"{",
"$",
"clipboard",
"=",
"Session",
"::",
"get",
"(",
"'clipboard'",
")",
";",
"$",
"record_type",
"=",
"$",
"record",
"::",
"RECOR... | Copy a fact from the clipboard to a record.
@param string $fact_id
@param GedcomRecord $record
@return bool | [
"Copy",
"a",
"fact",
"from",
"the",
"clipboard",
"to",
"a",
"record",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ClipboardService.php#L66-L79 | train |
fisharebest/webtrees | app/Services/ClipboardService.php | ClipboardService.pastableFacts | public function pastableFacts(GedcomRecord $record, Collection $exclude_types): Collection
{
// The facts are stored in the session.
return (new Collection(Session::get('clipboard', [])[$record::RECORD_TYPE] ?? []))
// Put the most recently copied fact at the top of the list.
... | php | public function pastableFacts(GedcomRecord $record, Collection $exclude_types): Collection
{
// The facts are stored in the session.
return (new Collection(Session::get('clipboard', [])[$record::RECORD_TYPE] ?? []))
// Put the most recently copied fact at the top of the list.
... | [
"public",
"function",
"pastableFacts",
"(",
"GedcomRecord",
"$",
"record",
",",
"Collection",
"$",
"exclude_types",
")",
":",
"Collection",
"{",
"// The facts are stored in the session.",
"return",
"(",
"new",
"Collection",
"(",
"Session",
"::",
"get",
"(",
"'clipbo... | Create a list of facts that can be pasted into a given record
@param GedcomRecord $record
@param Collection $exclude_types
@return Collection
@return Fact[] | [
"Create",
"a",
"list",
"of",
"facts",
"that",
"can",
"be",
"pasted",
"into",
"a",
"given",
"record"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ClipboardService.php#L90-L102 | train |
fisharebest/webtrees | app/Services/ClipboardService.php | ClipboardService.pastableFactsOfType | public function pastableFactsOfType(GedcomRecord $record, Collection $types): Collection
{
// The facts are stored in the session.
return (new Collection(Session::get('clipboard', [])))
->flatten(1)
->reverse()
->map(static function (array $clipping) use ($record)... | php | public function pastableFactsOfType(GedcomRecord $record, Collection $types): Collection
{
// The facts are stored in the session.
return (new Collection(Session::get('clipboard', [])))
->flatten(1)
->reverse()
->map(static function (array $clipping) use ($record)... | [
"public",
"function",
"pastableFactsOfType",
"(",
"GedcomRecord",
"$",
"record",
",",
"Collection",
"$",
"types",
")",
":",
"Collection",
"{",
"// The facts are stored in the session.",
"return",
"(",
"new",
"Collection",
"(",
"Session",
"::",
"get",
"(",
"'clipboar... | Find facts of a given type, from all records.
@param GedcomRecord $record
@param Collection $types
@return Collection
@return Fact[] | [
"Find",
"facts",
"of",
"a",
"given",
"type",
"from",
"all",
"records",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/ClipboardService.php#L113-L125 | train |
fisharebest/webtrees | app/Tree.php | Tree.getAll | public static function getAll(): array
{
if (empty(self::$trees)) {
self::$trees = self::all()->all();
}
return self::$trees;
} | php | public static function getAll(): array
{
if (empty(self::$trees)) {
self::$trees = self::all()->all();
}
return self::$trees;
} | [
"public",
"static",
"function",
"getAll",
"(",
")",
":",
"array",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"trees",
")",
")",
"{",
"self",
"::",
"$",
"trees",
"=",
"self",
"::",
"all",
"(",
")",
"->",
"all",
"(",
")",
";",
"}",
"return"... | Fetch all the trees that we have permission to access.
@return Tree[] | [
"Fetch",
"all",
"the",
"trees",
"that",
"we",
"have",
"permission",
"to",
"access",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L118-L125 | train |
fisharebest/webtrees | app/Tree.php | Tree.all | public static function all(): Collection
{
return app('cache.array')->rememberForever(__CLASS__, static function (): Collection {
// Admins see all trees
$query = DB::table('gedcom')
->leftJoin('gedcom_setting', static function (JoinClause $join): void {
... | php | public static function all(): Collection
{
return app('cache.array')->rememberForever(__CLASS__, static function (): Collection {
// Admins see all trees
$query = DB::table('gedcom')
->leftJoin('gedcom_setting', static function (JoinClause $join): void {
... | [
"public",
"static",
"function",
"all",
"(",
")",
":",
"Collection",
"{",
"return",
"app",
"(",
"'cache.array'",
")",
"->",
"rememberForever",
"(",
"__CLASS__",
",",
"static",
"function",
"(",
")",
":",
"Collection",
"{",
"// Admins see all trees",
"$",
"query"... | All the trees that we have permission to access.
@return Collection
@return Tree[] | [
"All",
"the",
"trees",
"that",
"we",
"have",
"permission",
"to",
"access",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L133-L193 | train |
fisharebest/webtrees | app/Tree.php | Tree.create | public static function create(string $tree_name, string $tree_title): Tree
{
try {
// Create a new tree
DB::table('gedcom')->insert([
'gedcom_name' => $tree_name,
]);
$tree_id = (int) DB::connection()->getPdo()->lastInsertId();
$t... | php | public static function create(string $tree_name, string $tree_title): Tree
{
try {
// Create a new tree
DB::table('gedcom')->insert([
'gedcom_name' => $tree_name,
]);
$tree_id = (int) DB::connection()->getPdo()->lastInsertId();
$t... | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"tree_name",
",",
"string",
"$",
"tree_title",
")",
":",
"Tree",
"{",
"try",
"{",
"// Create a new tree",
"DB",
"::",
"table",
"(",
"'gedcom'",
")",
"->",
"insert",
"(",
"[",
"'gedcom_name'",
"=... | Create a new tree
@param string $tree_name
@param string $tree_title
@return Tree | [
"Create",
"a",
"new",
"tree"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L235-L318 | train |
fisharebest/webtrees | app/Tree.php | Tree.findByName | public static function findByName($tree_name): ?Tree
{
foreach (self::getAll() as $tree) {
if ($tree->name === $tree_name) {
return $tree;
}
}
return null;
} | php | public static function findByName($tree_name): ?Tree
{
foreach (self::getAll() as $tree) {
if ($tree->name === $tree_name) {
return $tree;
}
}
return null;
} | [
"public",
"static",
"function",
"findByName",
"(",
"$",
"tree_name",
")",
":",
"?",
"Tree",
"{",
"foreach",
"(",
"self",
"::",
"getAll",
"(",
")",
"as",
"$",
"tree",
")",
"{",
"if",
"(",
"$",
"tree",
"->",
"name",
"===",
"$",
"tree_name",
")",
"{",... | Find the tree with a specific name.
@param string $tree_name
@return Tree|null | [
"Find",
"the",
"tree",
"with",
"a",
"specific",
"name",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L327-L336 | train |
fisharebest/webtrees | app/Tree.php | Tree.delete | public function delete(): void
{
// If this is the default tree, then unset it
if (Site::getPreference('DEFAULT_GEDCOM') === $this->name) {
Site::setPreference('DEFAULT_GEDCOM', '');
}
$this->deleteGenealogyData(false);
DB::table('block_setting')
->j... | php | public function delete(): void
{
// If this is the default tree, then unset it
if (Site::getPreference('DEFAULT_GEDCOM') === $this->name) {
Site::setPreference('DEFAULT_GEDCOM', '');
}
$this->deleteGenealogyData(false);
DB::table('block_setting')
->j... | [
"public",
"function",
"delete",
"(",
")",
":",
"void",
"{",
"// If this is the default tree, then unset it",
"if",
"(",
"Site",
"::",
"getPreference",
"(",
"'DEFAULT_GEDCOM'",
")",
"===",
"$",
"this",
"->",
"name",
")",
"{",
"Site",
"::",
"setPreference",
"(",
... | Delete everything relating to a tree
@return void | [
"Delete",
"everything",
"relating",
"to",
"a",
"tree"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L528-L553 | train |
fisharebest/webtrees | app/Tree.php | Tree.exportGedcom | public function exportGedcom($stream): void
{
$buffer = FunctionsExport::reformatRecord(FunctionsExport::gedcomHeader($this, 'UTF-8'));
$union_families = DB::table('families')
->where('f_file', '=', $this->id)
->select(['f_gedcom AS gedcom', 'f_id AS xref', DB::raw('LENGTH(f... | php | public function exportGedcom($stream): void
{
$buffer = FunctionsExport::reformatRecord(FunctionsExport::gedcomHeader($this, 'UTF-8'));
$union_families = DB::table('families')
->where('f_file', '=', $this->id)
->select(['f_gedcom AS gedcom', 'f_id AS xref', DB::raw('LENGTH(f... | [
"public",
"function",
"exportGedcom",
"(",
"$",
"stream",
")",
":",
"void",
"{",
"$",
"buffer",
"=",
"FunctionsExport",
"::",
"reformatRecord",
"(",
"FunctionsExport",
"::",
"gedcomHeader",
"(",
"$",
"this",
",",
"'UTF-8'",
")",
")",
";",
"$",
"union_familie... | Export the tree to a GEDCOM file
@param resource $stream
@return void | [
"Export",
"the",
"tree",
"to",
"a",
"GEDCOM",
"file"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L596-L638 | train |
fisharebest/webtrees | app/Tree.php | Tree.importGedcomFile | public function importGedcomFile(StreamInterface $stream, string $filename): void
{
// Read the file in blocks of roughly 64K. Ensure that each block
// contains complete gedcom records. This will ensure we don’t split
// multi-byte characters, as well as simplifying the code to import
... | php | public function importGedcomFile(StreamInterface $stream, string $filename): void
{
// Read the file in blocks of roughly 64K. Ensure that each block
// contains complete gedcom records. This will ensure we don’t split
// multi-byte characters, as well as simplifying the code to import
... | [
"public",
"function",
"importGedcomFile",
"(",
"StreamInterface",
"$",
"stream",
",",
"string",
"$",
"filename",
")",
":",
"void",
"{",
"// Read the file in blocks of roughly 64K. Ensure that each block",
"// contains complete gedcom records. This will ensure we don’t split",
"// m... | Import data from a gedcom file into this tree.
@param StreamInterface $stream The GEDCOM file.
@param string $filename The preferred filename, for export/download.
@return void | [
"Import",
"data",
"from",
"a",
"gedcom",
"file",
"into",
"this",
"tree",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L648-L685 | train |
fisharebest/webtrees | app/Tree.php | Tree.createRecord | public function createRecord(string $gedcom): GedcomRecord
{
if (!Str::startsWith($gedcom, '0 @@ ')) {
throw new InvalidArgumentException('GedcomRecord::createRecord(' . $gedcom . ') does not begin 0 @@');
}
$xref = $this->getNewXref();
$gedcom = '0 @' . $xref . '@ ' .... | php | public function createRecord(string $gedcom): GedcomRecord
{
if (!Str::startsWith($gedcom, '0 @@ ')) {
throw new InvalidArgumentException('GedcomRecord::createRecord(' . $gedcom . ') does not begin 0 @@');
}
$xref = $this->getNewXref();
$gedcom = '0 @' . $xref . '@ ' .... | [
"public",
"function",
"createRecord",
"(",
"string",
"$",
"gedcom",
")",
":",
"GedcomRecord",
"{",
"if",
"(",
"!",
"Str",
"::",
"startsWith",
"(",
"$",
"gedcom",
",",
"'0 @@ '",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'GedcomRecord::... | Create a new record from GEDCOM data.
@param string $gedcom
@return GedcomRecord|Individual|Family|Note|Source|Repository|Media
@throws InvalidArgumentException | [
"Create",
"a",
"new",
"record",
"from",
"GEDCOM",
"data",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L695-L724 | train |
fisharebest/webtrees | app/Tree.php | Tree.getNewXref | public function getNewXref(): string
{
// Lock the row, so that only one new XREF may be generated at a time.
DB::table('site_setting')
->where('setting_name', '=', 'next_xref')
->lockForUpdate()
->get();
$prefix = 'X';
$increment = 1.0;
... | php | public function getNewXref(): string
{
// Lock the row, so that only one new XREF may be generated at a time.
DB::table('site_setting')
->where('setting_name', '=', 'next_xref')
->lockForUpdate()
->get();
$prefix = 'X';
$increment = 1.0;
... | [
"public",
"function",
"getNewXref",
"(",
")",
":",
"string",
"{",
"// Lock the row, so that only one new XREF may be generated at a time.",
"DB",
"::",
"table",
"(",
"'site_setting'",
")",
"->",
"where",
"(",
"'setting_name'",
",",
"'='",
",",
"'next_xref'",
")",
"->"... | Generate a new XREF, unique across all family trees
@return string | [
"Generate",
"a",
"new",
"XREF",
"unique",
"across",
"all",
"family",
"trees"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L731-L764 | train |
fisharebest/webtrees | app/Tree.php | Tree.significantIndividual | public function significantIndividual(UserInterface $user): Individual
{
$individual = null;
if ($this->getUserPreference($user, 'rootid') !== '') {
$individual = Individual::getInstance($this->getUserPreference($user, 'rootid'), $this);
}
if ($individual === null && $t... | php | public function significantIndividual(UserInterface $user): Individual
{
$individual = null;
if ($this->getUserPreference($user, 'rootid') !== '') {
$individual = Individual::getInstance($this->getUserPreference($user, 'rootid'), $this);
}
if ($individual === null && $t... | [
"public",
"function",
"significantIndividual",
"(",
"UserInterface",
"$",
"user",
")",
":",
"Individual",
"{",
"$",
"individual",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"getUserPreference",
"(",
"$",
"user",
",",
"'rootid'",
")",
"!==",
"''",
")",... | What is the most significant individual in this tree.
@param UserInterface $user
@return Individual | [
"What",
"is",
"the",
"most",
"significant",
"individual",
"in",
"this",
"tree",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Tree.php#L890-L918 | train |
fisharebest/webtrees | app/Http/Controllers/SetupController.php | SetupController.setup | public function setup(ServerRequestInterface $request): ResponseInterface
{
// Mini "bootstrap"
define('WT_DATA_DIR', 'data/');
app()->instance(ServerRequestInterface::class, $request);
app()->instance('cache.array', new Repository(new ArrayStore()));
$data = $this->userData... | php | public function setup(ServerRequestInterface $request): ResponseInterface
{
// Mini "bootstrap"
define('WT_DATA_DIR', 'data/');
app()->instance(ServerRequestInterface::class, $request);
app()->instance('cache.array', new Repository(new ArrayStore()));
$data = $this->userData... | [
"public",
"function",
"setup",
"(",
"ServerRequestInterface",
"$",
"request",
")",
":",
"ResponseInterface",
"{",
"// Mini \"bootstrap\"",
"define",
"(",
"'WT_DATA_DIR'",
",",
"'data/'",
")",
";",
"app",
"(",
")",
"->",
"instance",
"(",
"ServerRequestInterface",
"... | Installation wizard - check user input and proceed to the next step.
@param ServerRequestInterface $request
@return ResponseInterface | [
"Installation",
"wizard",
"-",
"check",
"user",
"input",
"and",
"proceed",
"to",
"the",
"next",
"step",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/SetupController.php#L103-L154 | train |
fisharebest/webtrees | app/Http/Controllers/SetupController.php | SetupController.setupLocales | private function setupLocales(): array
{
return app(ModuleService::class)
->setupLanguages()
->map(static function (ModuleLanguageInterface $module): LocaleInterface {
return $module->locale();
})
->all();
} | php | private function setupLocales(): array
{
return app(ModuleService::class)
->setupLanguages()
->map(static function (ModuleLanguageInterface $module): LocaleInterface {
return $module->locale();
})
->all();
} | [
"private",
"function",
"setupLocales",
"(",
")",
":",
"array",
"{",
"return",
"app",
"(",
"ModuleService",
"::",
"class",
")",
"->",
"setupLanguages",
"(",
")",
"->",
"map",
"(",
"static",
"function",
"(",
"ModuleLanguageInterface",
"$",
"module",
")",
":",
... | Which languages are available during the installation.
@return LocaleInterface[] | [
"Which",
"languages",
"are",
"available",
"during",
"the",
"installation",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/SetupController.php#L187-L195 | train |
fisharebest/webtrees | app/Http/Controllers/SetupController.php | SetupController.checkFolderIsWritable | private function checkFolderIsWritable(string $data_dir): bool
{
$text1 = random_bytes(32);
try {
file_put_contents($data_dir . 'test.txt', $text1);
$text2 = file_get_contents(WT_DATA_DIR . 'test.txt');
unlink(WT_DATA_DIR . 'test.txt');
} catch (Exception... | php | private function checkFolderIsWritable(string $data_dir): bool
{
$text1 = random_bytes(32);
try {
file_put_contents($data_dir . 'test.txt', $text1);
$text2 = file_get_contents(WT_DATA_DIR . 'test.txt');
unlink(WT_DATA_DIR . 'test.txt');
} catch (Exception... | [
"private",
"function",
"checkFolderIsWritable",
"(",
"string",
"$",
"data_dir",
")",
":",
"bool",
"{",
"$",
"text1",
"=",
"random_bytes",
"(",
"32",
")",
";",
"try",
"{",
"file_put_contents",
"(",
"$",
"data_dir",
".",
"'test.txt'",
",",
"$",
"text1",
")",... | Check we can write to the data folder.
@param string $data_dir
@return bool | [
"Check",
"we",
"can",
"write",
"to",
"the",
"data",
"folder",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/SetupController.php#L237-L250 | train |
fisharebest/webtrees | app/Statistics/Google/ChartBirth.php | ChartBirth.chartBirth | public function chartBirth(string $color_from = null, string $color_to = null): string
{
$chart_color1 = (string) $this->theme->parameter('distribution-chart-no-values');
$chart_color2 = (string) $this->theme->parameter('distribution-chart-high-values');
$color_from = $color_from ?? $chart... | php | public function chartBirth(string $color_from = null, string $color_to = null): string
{
$chart_color1 = (string) $this->theme->parameter('distribution-chart-no-values');
$chart_color2 = (string) $this->theme->parameter('distribution-chart-high-values');
$color_from = $color_from ?? $chart... | [
"public",
"function",
"chartBirth",
"(",
"string",
"$",
"color_from",
"=",
"null",
",",
"string",
"$",
"color_to",
"=",
"null",
")",
":",
"string",
"{",
"$",
"chart_color1",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"theme",
"->",
"parameter",
"(",
"... | Create a chart of birth places.
@param string|null $color_from
@param string|null $color_to
@return string | [
"Create",
"a",
"chart",
"of",
"birth",
"places",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Google/ChartBirth.php#L95-L126 | train |
fisharebest/webtrees | app/Statistics/Service/CountryService.php | CountryService.mapTwoLetterToName | public function mapTwoLetterToName(string $twoLetterCode): string
{
$threeLetterCode = array_search($twoLetterCode, $this->iso3166(), true);
$threeLetterCode = $threeLetterCode ?: '???';
return $this->getAllCountries()[$threeLetterCode];
} | php | public function mapTwoLetterToName(string $twoLetterCode): string
{
$threeLetterCode = array_search($twoLetterCode, $this->iso3166(), true);
$threeLetterCode = $threeLetterCode ?: '???';
return $this->getAllCountries()[$threeLetterCode];
} | [
"public",
"function",
"mapTwoLetterToName",
"(",
"string",
"$",
"twoLetterCode",
")",
":",
"string",
"{",
"$",
"threeLetterCode",
"=",
"array_search",
"(",
"$",
"twoLetterCode",
",",
"$",
"this",
"->",
"iso3166",
"(",
")",
",",
"true",
")",
";",
"$",
"thre... | Returns the translated country name based on the given two letter country code.
@param string $twoLetterCode The two letter country code
@return string | [
"Returns",
"the",
"translated",
"country",
"name",
"based",
"on",
"the",
"given",
"two",
"letter",
"country",
"code",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Service/CountryService.php#L810-L816 | train |
fisharebest/webtrees | app/Http/Controllers/GedcomRecordController.php | GedcomRecordController.show | public function show(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$xref = $request->get('xref', '');
$record = GedcomRecord::getInstance($xref, $tree);
Auth::checkRecordAccess($record);
if ($this->hasCustomPage($record)) {
return redirect($record-... | php | public function show(ServerRequestInterface $request, Tree $tree): ResponseInterface
{
$xref = $request->get('xref', '');
$record = GedcomRecord::getInstance($xref, $tree);
Auth::checkRecordAccess($record);
if ($this->hasCustomPage($record)) {
return redirect($record-... | [
"public",
"function",
"show",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"Tree",
"$",
"tree",
")",
":",
"ResponseInterface",
"{",
"$",
"xref",
"=",
"$",
"request",
"->",
"get",
"(",
"'xref'",
",",
"''",
")",
";",
"$",
"record",
"=",
"GedcomRecor... | Show a gedcom record's page.
@param ServerRequestInterface $request
@param Tree $tree
@return ResponseInterface | [
"Show",
"a",
"gedcom",
"record",
"s",
"page",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/GedcomRecordController.php#L45-L67 | train |
fisharebest/webtrees | app/Http/Controllers/GedcomRecordController.php | GedcomRecordController.hasCustomPage | private function hasCustomPage(GedcomRecord $record): bool
{
return
$record instanceof Individual ||
$record instanceof Family ||
$record instanceof Source ||
$record instanceof Repository ||
$record instanceof Note ||
$record instanceo... | php | private function hasCustomPage(GedcomRecord $record): bool
{
return
$record instanceof Individual ||
$record instanceof Family ||
$record instanceof Source ||
$record instanceof Repository ||
$record instanceof Note ||
$record instanceo... | [
"private",
"function",
"hasCustomPage",
"(",
"GedcomRecord",
"$",
"record",
")",
":",
"bool",
"{",
"return",
"$",
"record",
"instanceof",
"Individual",
"||",
"$",
"record",
"instanceof",
"Family",
"||",
"$",
"record",
"instanceof",
"Source",
"||",
"$",
"record... | Is there a better place to display this record?
@param GedcomRecord $record
@return bool | [
"Is",
"there",
"a",
"better",
"place",
"to",
"display",
"this",
"record?"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Http/Controllers/GedcomRecordController.php#L76-L85 | train |
fisharebest/webtrees | app/Services/GedcomService.php | GedcomService.canonicalTag | public function canonicalTag(string $tag): string
{
$tag = strtoupper($tag);
$tag = self::TAG_NAMES[$tag] ?? self::TAG_SYNONYMS[$tag] ?? $tag;
return $tag;
} | php | public function canonicalTag(string $tag): string
{
$tag = strtoupper($tag);
$tag = self::TAG_NAMES[$tag] ?? self::TAG_SYNONYMS[$tag] ?? $tag;
return $tag;
} | [
"public",
"function",
"canonicalTag",
"(",
"string",
"$",
"tag",
")",
":",
"string",
"{",
"$",
"tag",
"=",
"strtoupper",
"(",
"$",
"tag",
")",
";",
"$",
"tag",
"=",
"self",
"::",
"TAG_NAMES",
"[",
"$",
"tag",
"]",
"??",
"self",
"::",
"TAG_SYNONYMS",
... | Convert a GEDCOM tag to a canonical form.
@param string $tag
@return string | [
"Convert",
"a",
"GEDCOM",
"tag",
"to",
"a",
"canonical",
"form",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/GedcomService.php#L205-L212 | train |
fisharebest/webtrees | app/Services/GedcomService.php | GedcomService.readSex | public function readSex(string $text): string
{
$text = strtoupper($text);
if ($text !== self::SEX_MALE && $text !== self::SEX_FEMALE) {
$text = self::SEX_UNKNOWN;
}
return $text;
} | php | public function readSex(string $text): string
{
$text = strtoupper($text);
if ($text !== self::SEX_MALE && $text !== self::SEX_FEMALE) {
$text = self::SEX_UNKNOWN;
}
return $text;
} | [
"public",
"function",
"readSex",
"(",
"string",
"$",
"text",
")",
":",
"string",
"{",
"$",
"text",
"=",
"strtoupper",
"(",
"$",
"text",
")",
";",
"if",
"(",
"$",
"text",
"!==",
"self",
"::",
"SEX_MALE",
"&&",
"$",
"text",
"!==",
"self",
"::",
"SEX_... | Some applications use non-standard values for unknown.
@param string $text
@return string | [
"Some",
"applications",
"use",
"non",
"-",
"standard",
"values",
"for",
"unknown",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Services/GedcomService.php#L349-L358 | train |
fisharebest/webtrees | app/Module/ModuleCustomTrait.php | ModuleCustomTrait.assetUrl | public function assetUrl(string $asset): string
{
$file = $this->resourcesFolder() . $asset;
// Add the file's modification time to the URL, so we can set long expiry cache headers.
$hash = filemtime($file);
return route('module', [
'module' => $this->name(),
... | php | public function assetUrl(string $asset): string
{
$file = $this->resourcesFolder() . $asset;
// Add the file's modification time to the URL, so we can set long expiry cache headers.
$hash = filemtime($file);
return route('module', [
'module' => $this->name(),
... | [
"public",
"function",
"assetUrl",
"(",
"string",
"$",
"asset",
")",
":",
"string",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"resourcesFolder",
"(",
")",
".",
"$",
"asset",
";",
"// Add the file's modification time to the URL, so we can set long expiry cache headers."... | Create a URL for an asset.
@param string $asset e.g. "css/theme.css" or "img/banner.png"
@return string | [
"Create",
"a",
"URL",
"for",
"an",
"asset",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Module/ModuleCustomTrait.php#L106-L119 | train |
fisharebest/webtrees | app/Report/ReportHtmlFootnote.php | ReportHtmlFootnote.render | public function render($renderer)
{
$renderer->setCurrentStyle('footnotenum');
echo '<a href="#footnote', $this->num, '"><sup>';
$renderer->write($renderer->entityRTL . $this->num);
echo "</sup></a>\n";
} | php | public function render($renderer)
{
$renderer->setCurrentStyle('footnotenum');
echo '<a href="#footnote', $this->num, '"><sup>';
$renderer->write($renderer->entityRTL . $this->num);
echo "</sup></a>\n";
} | [
"public",
"function",
"render",
"(",
"$",
"renderer",
")",
"{",
"$",
"renderer",
"->",
"setCurrentStyle",
"(",
"'footnotenum'",
")",
";",
"echo",
"'<a href=\"#footnote'",
",",
"$",
"this",
"->",
"num",
",",
"'\"><sup>'",
";",
"$",
"renderer",
"->",
"write",
... | HTML Footnotes number renderer
@param ReportHtml $renderer
@return void | [
"HTML",
"Footnotes",
"number",
"renderer"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Report/ReportHtmlFootnote.php#L32-L38 | train |
fisharebest/webtrees | app/Report/ReportHtmlFootnote.php | ReportHtmlFootnote.getFootnoteHeight | public function getFootnoteHeight($html, float $cellWidth = 0): float
{
if ($html->getCurrentStyle() != $this->styleName) {
$html->setCurrentStyle($this->styleName);
}
if ($cellWidth > 0) {
$this->text = $html->textWrap($this->text, $cellWidth);
}
$t... | php | public function getFootnoteHeight($html, float $cellWidth = 0): float
{
if ($html->getCurrentStyle() != $this->styleName) {
$html->setCurrentStyle($this->styleName);
}
if ($cellWidth > 0) {
$this->text = $html->textWrap($this->text, $cellWidth);
}
$t... | [
"public",
"function",
"getFootnoteHeight",
"(",
"$",
"html",
",",
"float",
"$",
"cellWidth",
"=",
"0",
")",
":",
"float",
"{",
"if",
"(",
"$",
"html",
"->",
"getCurrentStyle",
"(",
")",
"!=",
"$",
"this",
"->",
"styleName",
")",
"{",
"$",
"html",
"->... | Calculates the Footnotes height
@param ReportHtml $html
@param float $cellWidth The width of the cell to use it for text wraping
@return float Footnote height in points | [
"Calculates",
"the",
"Footnotes",
"height"
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Report/ReportHtmlFootnote.php#L78-L93 | train |
fisharebest/webtrees | app/Statistics/Service/ColorService.php | ColorService.interpolateRgb | public function interpolateRgb(string $startColor, string $endColor, int $steps): array
{
if (!$steps) {
return [];
}
$s = $this->hexToRgb($startColor);
$e = $this->hexToRgb($endColor);
$colors = [];
$factorR = ($e[0] - $s[0]) / $steps;
... | php | public function interpolateRgb(string $startColor, string $endColor, int $steps): array
{
if (!$steps) {
return [];
}
$s = $this->hexToRgb($startColor);
$e = $this->hexToRgb($endColor);
$colors = [];
$factorR = ($e[0] - $s[0]) / $steps;
... | [
"public",
"function",
"interpolateRgb",
"(",
"string",
"$",
"startColor",
",",
"string",
"$",
"endColor",
",",
"int",
"$",
"steps",
")",
":",
"array",
"{",
"if",
"(",
"!",
"$",
"steps",
")",
"{",
"return",
"[",
"]",
";",
"}",
"$",
"s",
"=",
"$",
... | Interpolates the number of color steps between a given start and end color.
@param string $startColor The start color
@param string $endColor The end color
@param int $steps The number of steps to interpolate
@return array | [
"Interpolates",
"the",
"number",
"of",
"color",
"steps",
"between",
"a",
"given",
"start",
"and",
"end",
"color",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Service/ColorService.php#L34-L58 | train |
fisharebest/webtrees | app/Statistics/Service/ColorService.php | ColorService.rgbToHex | private function rgbToHex(int $r, int $g, int $b): string
{
return sprintf('#%02x%02x%02x', $r, $g, $b);
} | php | private function rgbToHex(int $r, int $g, int $b): string
{
return sprintf('#%02x%02x%02x', $r, $g, $b);
} | [
"private",
"function",
"rgbToHex",
"(",
"int",
"$",
"r",
",",
"int",
"$",
"g",
",",
"int",
"$",
"b",
")",
":",
"string",
"{",
"return",
"sprintf",
"(",
"'#%02x%02x%02x'",
",",
"$",
"r",
",",
"$",
"g",
",",
"$",
"b",
")",
";",
"}"
] | Converts the color values to the HTML hex representation.
@param int $r The red color value
@param int $g The green color value
@param int $b The blue color value
@return string | [
"Converts",
"the",
"color",
"values",
"to",
"the",
"HTML",
"hex",
"representation",
"."
] | 840bd0d721dc479520ec24a065996bc6becb8348 | https://github.com/fisharebest/webtrees/blob/840bd0d721dc479520ec24a065996bc6becb8348/app/Statistics/Service/ColorService.php#L69-L72 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.