id int32 0 241k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
225,000 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.order | private function order()
{
if ($this->startDate > $this->endDate) {
$tmp = clone $this->startDate;
$this->startDate = clone $this->endDate;
$this->endDate = clone $tmp;
unset($tmp);
}
return $this;
} | php | private function order()
{
if ($this->startDate > $this->endDate) {
$tmp = clone $this->startDate;
$this->startDate = clone $this->endDate;
$this->endDate = clone $tmp;
unset($tmp);
}
return $this;
} | [
"private",
"function",
"order",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"startDate",
">",
"$",
"this",
"->",
"endDate",
")",
"{",
"$",
"tmp",
"=",
"clone",
"$",
"this",
"->",
"startDate",
";",
"$",
"this",
"->",
"startDate",
"=",
"clone",
"$",... | Swap start and end dates of the period if.
@return $this | [
"Swap",
"start",
"and",
"end",
"dates",
"of",
"the",
"period",
"if",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L26-L36 |
225,001 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.thisWeek | public static function thisWeek()
{
$start = CarbonDate::today();
$end = CarbonDate::tomorrow();
if ($start->dayOfWeek !== CarbonDate::MONDAY) {
$start->modify('last monday');
}
return new static($start, $end);
} | php | public static function thisWeek()
{
$start = CarbonDate::today();
$end = CarbonDate::tomorrow();
if ($start->dayOfWeek !== CarbonDate::MONDAY) {
$start->modify('last monday');
}
return new static($start, $end);
} | [
"public",
"static",
"function",
"thisWeek",
"(",
")",
"{",
"$",
"start",
"=",
"CarbonDate",
"::",
"today",
"(",
")",
";",
"$",
"end",
"=",
"CarbonDate",
"::",
"tomorrow",
"(",
")",
";",
"if",
"(",
"$",
"start",
"->",
"dayOfWeek",
"!==",
"CarbonDate",
... | Create a CarbonPeriod from closest monday to today.
@return static | [
"Create",
"a",
"CarbonPeriod",
"from",
"closest",
"monday",
"to",
"today",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L127-L136 |
225,002 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.each | public function each(\DateInterval $interval, \Closure $callback)
{
$period = new static($this->start(), $this->start()->add($interval));
do {
$callback(new static(
$period->start(),
$period->end() > $this->endDate ? $this->endDate : $period->end()
... | php | public function each(\DateInterval $interval, \Closure $callback)
{
$period = new static($this->start(), $this->start()->add($interval));
do {
$callback(new static(
$period->start(),
$period->end() > $this->endDate ? $this->endDate : $period->end()
... | [
"public",
"function",
"each",
"(",
"\\",
"DateInterval",
"$",
"interval",
",",
"\\",
"Closure",
"$",
"callback",
")",
"{",
"$",
"period",
"=",
"new",
"static",
"(",
"$",
"this",
"->",
"start",
"(",
")",
",",
"$",
"this",
"->",
"start",
"(",
")",
"-... | Set the internal iterator with interval for the instance.
@param \DateInterval $interval
@param \Closure $callback
@return CarbonDate|$this | [
"Set",
"the",
"internal",
"iterator",
"with",
"interval",
"for",
"the",
"instance",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L202-L214 |
225,003 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.eachWeeks | public function eachWeeks($weeks = 1, \Closure $callback, $onlyFullWeek = false)
{
if ($this->lengthInWeeks() > 0) {
return $this->each(
new \DateInterval("P{$weeks}W"),
function (CarbonPeriod $period) use ($weeks, $callback, $onlyFullWeek) {
i... | php | public function eachWeeks($weeks = 1, \Closure $callback, $onlyFullWeek = false)
{
if ($this->lengthInWeeks() > 0) {
return $this->each(
new \DateInterval("P{$weeks}W"),
function (CarbonPeriod $period) use ($weeks, $callback, $onlyFullWeek) {
i... | [
"public",
"function",
"eachWeeks",
"(",
"$",
"weeks",
"=",
"1",
",",
"\\",
"Closure",
"$",
"callback",
",",
"$",
"onlyFullWeek",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lengthInWeeks",
"(",
")",
">",
"0",
")",
"{",
"return",
"$",
"th... | Set the internal iterator with week interval for the instance.
@param int $weeks
@param callable $callback
@param bool $onlyFullWeek
@return CarbonDate|$this | [
"Set",
"the",
"internal",
"iterator",
"with",
"week",
"interval",
"for",
"the",
"instance",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L236-L250 |
225,004 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.eachMonths | public function eachMonths($months = 1, \Closure $callback, $onlyFullMonth = false)
{
if ($this->lengthInMonths() > 0) {
return $this->each(
new \DateInterval("P{$months}M"),
function (CarbonPeriod $period) use ($months, $callback, $onlyFullMonth) {
... | php | public function eachMonths($months = 1, \Closure $callback, $onlyFullMonth = false)
{
if ($this->lengthInMonths() > 0) {
return $this->each(
new \DateInterval("P{$months}M"),
function (CarbonPeriod $period) use ($months, $callback, $onlyFullMonth) {
... | [
"public",
"function",
"eachMonths",
"(",
"$",
"months",
"=",
"1",
",",
"\\",
"Closure",
"$",
"callback",
",",
"$",
"onlyFullMonth",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"lengthInMonths",
"(",
")",
">",
"0",
")",
"{",
"return",
"$",
... | Set the internal iterator with month interval for the instance.
@param int $months
@param callable $callback
@param bool $onlyFullMonth
@return CarbonDate|$this | [
"Set",
"the",
"internal",
"iterator",
"with",
"month",
"interval",
"for",
"the",
"instance",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L260-L274 |
225,005 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.eachDayOfWeek | public function eachDayOfWeek($dayOfWeek, \Closure $callback)
{
$start = $this->startDate->copy();
if ($start->dayOfWeek !== $dayOfWeek) {
$start->next($dayOfWeek);
}
if ($start < $this->endDate) {
$period = new static($start, $this->endDate);
$p... | php | public function eachDayOfWeek($dayOfWeek, \Closure $callback)
{
$start = $this->startDate->copy();
if ($start->dayOfWeek !== $dayOfWeek) {
$start->next($dayOfWeek);
}
if ($start < $this->endDate) {
$period = new static($start, $this->endDate);
$p... | [
"public",
"function",
"eachDayOfWeek",
"(",
"$",
"dayOfWeek",
",",
"\\",
"Closure",
"$",
"callback",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"startDate",
"->",
"copy",
"(",
")",
";",
"if",
"(",
"$",
"start",
"->",
"dayOfWeek",
"!==",
"$",
"da... | Set the internal iterator for day of week for the instance.
@param $dayOfWeek
@param callable $callback
@return $this | [
"Set",
"the",
"internal",
"iterator",
"for",
"day",
"of",
"week",
"for",
"the",
"instance",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L283-L299 |
225,006 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.add | public function add(\DateInterval $interval)
{
$this->startDate->add($interval);
$this->endDate->add($interval);
return $this;
} | php | public function add(\DateInterval $interval)
{
$this->startDate->add($interval);
$this->endDate->add($interval);
return $this;
} | [
"public",
"function",
"add",
"(",
"\\",
"DateInterval",
"$",
"interval",
")",
"{",
"$",
"this",
"->",
"startDate",
"->",
"add",
"(",
"$",
"interval",
")",
";",
"$",
"this",
"->",
"endDate",
"->",
"add",
"(",
"$",
"interval",
")",
";",
"return",
"$",
... | Add \DateInterval to the instance.
@param \DateInterval $interval
@return $this | [
"Add",
"\\",
"DateInterval",
"to",
"the",
"instance",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L377-L383 |
225,007 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.sub | public function sub(\DateInterval $interval)
{
$this->startDate->sub($interval);
$this->endDate->sub($interval);
return $this;
} | php | public function sub(\DateInterval $interval)
{
$this->startDate->sub($interval);
$this->endDate->sub($interval);
return $this;
} | [
"public",
"function",
"sub",
"(",
"\\",
"DateInterval",
"$",
"interval",
")",
"{",
"$",
"this",
"->",
"startDate",
"->",
"sub",
"(",
"$",
"interval",
")",
";",
"$",
"this",
"->",
"endDate",
"->",
"sub",
"(",
"$",
"interval",
")",
";",
"return",
"$",
... | Sub \DateInterval from the instance.
@param \DateInterval $interval
@return $this | [
"Sub",
"\\",
"DateInterval",
"from",
"the",
"instance",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L391-L397 |
225,008 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.contains | public function contains(CarbonDate $date, $equal = true)
{
return $date->between($this->startDate, $this->endDate, $equal);
} | php | public function contains(CarbonDate $date, $equal = true)
{
return $date->between($this->startDate, $this->endDate, $equal);
} | [
"public",
"function",
"contains",
"(",
"CarbonDate",
"$",
"date",
",",
"$",
"equal",
"=",
"true",
")",
"{",
"return",
"$",
"date",
"->",
"between",
"(",
"$",
"this",
"->",
"startDate",
",",
"$",
"this",
"->",
"endDate",
",",
"$",
"equal",
")",
";",
... | Determines if the instances contains a date.
@see \Carbon\Carbon::between
@param CarbonDate $date
@param bool $equal Indicates if a > and < comparison should be used or <= or >=
@return bool | [
"Determines",
"if",
"the",
"instances",
"contains",
"a",
"date",
"."
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L473-L476 |
225,009 | advmaker/carbon-period | src/CarbonPeriod.php | CarbonPeriod.iterateDates | public function iterateDates(\Closure $callback)
{
$interval = new \DateInterval('P1D');
$period = new \DatePeriod($this->start()->copy()->startOfDay(), $interval, $this->end()->copy()->startOfDay());
foreach ($period as $date) {
$callback($date);
}
return $thi... | php | public function iterateDates(\Closure $callback)
{
$interval = new \DateInterval('P1D');
$period = new \DatePeriod($this->start()->copy()->startOfDay(), $interval, $this->end()->copy()->startOfDay());
foreach ($period as $date) {
$callback($date);
}
return $thi... | [
"public",
"function",
"iterateDates",
"(",
"\\",
"Closure",
"$",
"callback",
")",
"{",
"$",
"interval",
"=",
"new",
"\\",
"DateInterval",
"(",
"'P1D'",
")",
";",
"$",
"period",
"=",
"new",
"\\",
"DatePeriod",
"(",
"$",
"this",
"->",
"start",
"(",
")",
... | Iterate period over each day
@param \Closure $callback
@return CarbonPeriod | [
"Iterate",
"period",
"over",
"each",
"day"
] | 4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d | https://github.com/advmaker/carbon-period/blob/4a2ae54dd9be2a4f5ba6bb279788a676a9910a0d/src/CarbonPeriod.php#L485-L496 |
225,010 | moeen-basra/laravel-passport-mongodb | src/RouteRegistrar.php | RouteRegistrar.forAuthorization | public function forAuthorization()
{
$this->router->group(['middleware' => ['web', 'auth']], function ($router) {
$router->get('/authorize', [
'uses' => 'AuthorizationController@authorize',
]);
$router->post('/authorize', [
'uses' => 'Appr... | php | public function forAuthorization()
{
$this->router->group(['middleware' => ['web', 'auth']], function ($router) {
$router->get('/authorize', [
'uses' => 'AuthorizationController@authorize',
]);
$router->post('/authorize', [
'uses' => 'Appr... | [
"public",
"function",
"forAuthorization",
"(",
")",
"{",
"$",
"this",
"->",
"router",
"->",
"group",
"(",
"[",
"'middleware'",
"=>",
"[",
"'web'",
",",
"'auth'",
"]",
"]",
",",
"function",
"(",
"$",
"router",
")",
"{",
"$",
"router",
"->",
"get",
"("... | Register the routes needed for authorization.
@return void | [
"Register",
"the",
"routes",
"needed",
"for",
"authorization",
"."
] | 738261912672e39f9f4f4e5bf420b99dbe303ef8 | https://github.com/moeen-basra/laravel-passport-mongodb/blob/738261912672e39f9f4f4e5bf420b99dbe303ef8/src/RouteRegistrar.php#L46-L61 |
225,011 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.create | public static function create(string $path, string $content = '', bool $overwrite = true): self
{
$path = normalize_path($path);
if (is_file($path) && $overwrite) {
self::unlink($path);
}
if (!is_file($path)) {
if (is_writeable(dirname($path))) {
... | php | public static function create(string $path, string $content = '', bool $overwrite = true): self
{
$path = normalize_path($path);
if (is_file($path) && $overwrite) {
self::unlink($path);
}
if (!is_file($path)) {
if (is_writeable(dirname($path))) {
... | [
"public",
"static",
"function",
"create",
"(",
"string",
"$",
"path",
",",
"string",
"$",
"content",
"=",
"''",
",",
"bool",
"$",
"overwrite",
"=",
"true",
")",
":",
"self",
"{",
"$",
"path",
"=",
"normalize_path",
"(",
"$",
"path",
")",
";",
"if",
... | Create new file.
@param string $path File path
@param string $content File content
@param bool $overwrite Set FALSE to prevent overwriting, when the a file with the new file path already exists
@return static
@throws FileException | [
"Create",
"new",
"file",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L84-L105 |
225,012 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.getName | public function getName(bool $withExtension = true): string
{
if ($withExtension) {
return pathinfo($this->path, PATHINFO_BASENAME);
}
return pathinfo($this->path, PATHINFO_FILENAME);
} | php | public function getName(bool $withExtension = true): string
{
if ($withExtension) {
return pathinfo($this->path, PATHINFO_BASENAME);
}
return pathinfo($this->path, PATHINFO_FILENAME);
} | [
"public",
"function",
"getName",
"(",
"bool",
"$",
"withExtension",
"=",
"true",
")",
":",
"string",
"{",
"if",
"(",
"$",
"withExtension",
")",
"{",
"return",
"pathinfo",
"(",
"$",
"this",
"->",
"path",
",",
"PATHINFO_BASENAME",
")",
";",
"}",
"return",
... | Get file name.
@param bool $withExtension Set FALSE for file name without extension
@return string | [
"Get",
"file",
"name",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L114-L121 |
225,013 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.getFormattedSize | public function getFormattedSize(): string
{
$kiloBytes = $this->getSize() / 1024;
if ($kiloBytes < 1024) {
return round($kiloBytes, 2).' KB';
}
$megaBytes = $kiloBytes / 1024;
if ($megaBytes < 1024) {
return round($megaBytes, 1).' MB';
}
... | php | public function getFormattedSize(): string
{
$kiloBytes = $this->getSize() / 1024;
if ($kiloBytes < 1024) {
return round($kiloBytes, 2).' KB';
}
$megaBytes = $kiloBytes / 1024;
if ($megaBytes < 1024) {
return round($megaBytes, 1).' MB';
}
... | [
"public",
"function",
"getFormattedSize",
"(",
")",
":",
"string",
"{",
"$",
"kiloBytes",
"=",
"$",
"this",
"->",
"getSize",
"(",
")",
"/",
"1024",
";",
"if",
"(",
"$",
"kiloBytes",
"<",
"1024",
")",
"{",
"return",
"round",
"(",
"$",
"kiloBytes",
","... | Get formatted size as KB, MB or GB.
@return string | [
"Get",
"formatted",
"size",
"as",
"KB",
"MB",
"or",
"GB",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L148-L160 |
225,014 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.delete | public function delete(): bool
{
if (is_file($this->path)) {
if (is_writable($this->path)) {
return unlink($this->path);
}
throw new FileException('Cannot delete file, because ('.$this->path.') is not writable', FileException::NOT_WRITEABLE);
}
... | php | public function delete(): bool
{
if (is_file($this->path)) {
if (is_writable($this->path)) {
return unlink($this->path);
}
throw new FileException('Cannot delete file, because ('.$this->path.') is not writable', FileException::NOT_WRITEABLE);
}
... | [
"public",
"function",
"delete",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"is_file",
"(",
"$",
"this",
"->",
"path",
")",
")",
"{",
"if",
"(",
"is_writable",
"(",
"$",
"this",
"->",
"path",
")",
")",
"{",
"return",
"unlink",
"(",
"$",
"this",
"->",
... | Delete file.
@return bool
@throws FileException | [
"Delete",
"file",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L199-L209 |
225,015 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.rename | public function rename(string $newFileName, bool $withExtension = true, bool $overwrite = true): self
{
if (!$withExtension) {
$newFileName = $newFileName.'.'.$this->getExtension();
}
$newFilePath = normalize_path($this->getDirectory().DIRECTORY_SEPARATOR.basename($newFileName))... | php | public function rename(string $newFileName, bool $withExtension = true, bool $overwrite = true): self
{
if (!$withExtension) {
$newFileName = $newFileName.'.'.$this->getExtension();
}
$newFilePath = normalize_path($this->getDirectory().DIRECTORY_SEPARATOR.basename($newFileName))... | [
"public",
"function",
"rename",
"(",
"string",
"$",
"newFileName",
",",
"bool",
"$",
"withExtension",
"=",
"true",
",",
"bool",
"$",
"overwrite",
"=",
"true",
")",
":",
"self",
"{",
"if",
"(",
"!",
"$",
"withExtension",
")",
"{",
"$",
"newFileName",
"=... | Rename file with new file name.
@param string $newFileName New file name
@param bool $withExtension Set FALSE to prevent renaming the the file extension too
@param bool $overwrite Set FALSE to prevent overwriting, when the a file with the new file name already exists
@return File
@throws FileException | [
"Rename",
"file",
"with",
"new",
"file",
"name",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L245-L257 |
225,016 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.moveToDirectory | public function moveToDirectory(string $newDirectoryPath, bool $overwrite = true): self
{
$newDirectoryPath = normalize_path($newDirectoryPath);
if (is_dir($newDirectoryPath)) {
if (is_writable($newDirectoryPath)) {
$newFilePath = $newDirectoryPath.DIRECTORY_SEPARATOR.$t... | php | public function moveToDirectory(string $newDirectoryPath, bool $overwrite = true): self
{
$newDirectoryPath = normalize_path($newDirectoryPath);
if (is_dir($newDirectoryPath)) {
if (is_writable($newDirectoryPath)) {
$newFilePath = $newDirectoryPath.DIRECTORY_SEPARATOR.$t... | [
"public",
"function",
"moveToDirectory",
"(",
"string",
"$",
"newDirectoryPath",
",",
"bool",
"$",
"overwrite",
"=",
"true",
")",
":",
"self",
"{",
"$",
"newDirectoryPath",
"=",
"normalize_path",
"(",
"$",
"newDirectoryPath",
")",
";",
"if",
"(",
"is_dir",
"... | Move file to new directory path.
@param string $newDirectoryPath New directory path
@param bool $overwrite Set FALSE to prevent overwriting, when a file with same name in the new directory path already exists
@return static
@throws FileException
@throws FolderException | [
"Move",
"file",
"to",
"new",
"directory",
"path",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L270-L292 |
225,017 | Everest/Everest-Filesystem | src/classes/Everest/Filesystem/File.php | File.copy | public function copy(string $newFilePath, bool $overwrite = true): self
{
$newFilePath = normalize_path($newFilePath);
if ($overwrite || !is_file($newFilePath)) {
if (copy($this->path, $newFilePath)) {
return new self($newFilePath);
}
throw new Fi... | php | public function copy(string $newFilePath, bool $overwrite = true): self
{
$newFilePath = normalize_path($newFilePath);
if ($overwrite || !is_file($newFilePath)) {
if (copy($this->path, $newFilePath)) {
return new self($newFilePath);
}
throw new Fi... | [
"public",
"function",
"copy",
"(",
"string",
"$",
"newFilePath",
",",
"bool",
"$",
"overwrite",
"=",
"true",
")",
":",
"self",
"{",
"$",
"newFilePath",
"=",
"normalize_path",
"(",
"$",
"newFilePath",
")",
";",
"if",
"(",
"$",
"overwrite",
"||",
"!",
"i... | Copy file to new file path.
@param string $newFilePath New file path
@param bool $overwrite Set FALSE to prevent overwriting, when the a file with the new file path already exist
@return static
@throws FileException | [
"Copy",
"file",
"to",
"new",
"file",
"path",
"."
] | 67782256e4b09adc7f761944b88ea317a194d677 | https://github.com/Everest/Everest-Filesystem/blob/67782256e4b09adc7f761944b88ea317a194d677/src/classes/Everest/Filesystem/File.php#L304-L315 |
225,018 | bytic/Common | src/Controllers/Traits/Models/HasModelLister.php | HasModelLister.doModelsListing | protected function doModelsListing()
{
$query = $this->newIndexQuery();
$filters = $this->getRequestFilters();
$query = $this->getModelManager()->filter($query, $filters);
$pageNumber = intval($this->getRequest()->query->get('page', 1));
$itemsPerPage = $this->getRecordPagin... | php | protected function doModelsListing()
{
$query = $this->newIndexQuery();
$filters = $this->getRequestFilters();
$query = $this->getModelManager()->filter($query, $filters);
$pageNumber = intval($this->getRequest()->query->get('page', 1));
$itemsPerPage = $this->getRecordPagin... | [
"protected",
"function",
"doModelsListing",
"(",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"newIndexQuery",
"(",
")",
";",
"$",
"filters",
"=",
"$",
"this",
"->",
"getRequestFilters",
"(",
")",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"getModel... | Does the model listing
@return void | [
"Does",
"the",
"model",
"listing"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Controllers/Traits/Models/HasModelLister.php#L24-L51 |
225,019 | Erebot/API | src/Autoload.php | Autoload.initialize | public static function initialize($path = null, $mapfile = null)
{
self::register();
self::addPath($path);
self::addMap($mapfile);
} | php | public static function initialize($path = null, $mapfile = null)
{
self::register();
self::addPath($path);
self::addMap($mapfile);
} | [
"public",
"static",
"function",
"initialize",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"mapfile",
"=",
"null",
")",
"{",
"self",
"::",
"register",
"(",
")",
";",
"self",
"::",
"addPath",
"(",
"$",
"path",
")",
";",
"self",
"::",
"addMap",
"(",
"$",... | Initialize the PEAR2 autoloader
\param string $path
Directory path to register
\param string $mapfile
Path to a classname-to-file map file.
\return
This method does not return anything. | [
"Initialize",
"the",
"PEAR2",
"autoloader"
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Autoload.php#L47-L52 |
225,020 | Erebot/API | src/Autoload.php | Autoload.register | protected static function register()
{
if (!self::$registered) {
// set up __autoload
$autoload = spl_autoload_functions();
spl_autoload_register(__CLASS__.'::load');
if (function_exists('__autoload') && ($autoload === false)) {
// __autoload()... | php | protected static function register()
{
if (!self::$registered) {
// set up __autoload
$autoload = spl_autoload_functions();
spl_autoload_register(__CLASS__.'::load');
if (function_exists('__autoload') && ($autoload === false)) {
// __autoload()... | [
"protected",
"static",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"registered",
")",
"{",
"// set up __autoload",
"$",
"autoload",
"=",
"spl_autoload_functions",
"(",
")",
";",
"spl_autoload_register",
"(",
"__CLASS__",
".",
"'::... | Register the PEAR2 autoload class with spl_autoload_register
\return
This method does not return anything. | [
"Register",
"the",
"PEAR2",
"autoload",
"class",
"with",
"spl_autoload_register"
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Autoload.php#L60-L73 |
225,021 | Erebot/API | src/Autoload.php | Autoload.addMap | protected static function addMap($mapfile)
{
if (! in_array($mapfile, self::$maps)) {
// keep track of specific map file loaded in this
// instance so we can update it if necessary
self::$mapfile = $mapfile;
if (file_exists($mapfile)) {
$map =... | php | protected static function addMap($mapfile)
{
if (! in_array($mapfile, self::$maps)) {
// keep track of specific map file loaded in this
// instance so we can update it if necessary
self::$mapfile = $mapfile;
if (file_exists($mapfile)) {
$map =... | [
"protected",
"static",
"function",
"addMap",
"(",
"$",
"mapfile",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"mapfile",
",",
"self",
"::",
"$",
"maps",
")",
")",
"{",
"// keep track of specific map file loaded in this",
"// instance so we can update it if neces... | Add a classname-to-file map
\param string $mapfile
The filename of the classmap
\return
This method does not return anything. | [
"Add",
"a",
"classname",
"-",
"to",
"-",
"file",
"map"
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Autoload.php#L113-L129 |
225,022 | Erebot/API | src/Autoload.php | Autoload.isMapped | protected static function isMapped($class)
{
if (isset(self::$map[$class])) {
return true;
}
if (isset(self::$mapfile) && ! isset(self::$map[$class])) {
self::$unmapped[] = $class;
return false;
}
return false;
} | php | protected static function isMapped($class)
{
if (isset(self::$map[$class])) {
return true;
}
if (isset(self::$mapfile) && ! isset(self::$map[$class])) {
self::$unmapped[] = $class;
return false;
}
return false;
} | [
"protected",
"static",
"function",
"isMapped",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"map",
"[",
"$",
"class",
"]",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"isset",
"(",
"self",
"::",
"$",
"mapfile... | Check if the class is already defined in a classmap
\param string $class
The class to look for
\retval bool
TRUE if the class is already defined,
FALSE otherwise. | [
"Check",
"if",
"the",
"class",
"is",
"already",
"defined",
"in",
"a",
"classmap"
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Autoload.php#L141-L151 |
225,023 | Erebot/API | src/Autoload.php | Autoload.load | public static function load($class)
{
/* Protects us from possible remote code inclusion due to:
https://bugs.php.net/bug.php?id=55475
We should already be safe without this check due to the
way this autoloader works, but this helps other autoloaders
that use othe... | php | public static function load($class)
{
/* Protects us from possible remote code inclusion due to:
https://bugs.php.net/bug.php?id=55475
We should already be safe without this check due to the
way this autoloader works, but this helps other autoloaders
that use othe... | [
"public",
"static",
"function",
"load",
"(",
"$",
"class",
")",
"{",
"/* Protects us from possible remote code inclusion due to:\n https://bugs.php.net/bug.php?id=55475\n We should already be safe without this check due to the\n way this autoloader works, but this hel... | Load a PEAR2 class
\param string $class
The class to load
\retval bool
TRUE if the class could be loaded,
FALSE otherwise. | [
"Load",
"a",
"PEAR2",
"class"
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Autoload.php#L163-L244 |
225,024 | Erebot/API | src/Autoload.php | Autoload.updateMap | protected static function updateMap($class, $origin)
{
if (is_writable(self::$mapfile) ||
is_writable(dirname(self::$mapfile))) {
self::$map[$class] = $origin;
file_put_contents(
self::$mapfile,
'<'."?php\n"
. "// Autoload a... | php | protected static function updateMap($class, $origin)
{
if (is_writable(self::$mapfile) ||
is_writable(dirname(self::$mapfile))) {
self::$map[$class] = $origin;
file_put_contents(
self::$mapfile,
'<'."?php\n"
. "// Autoload a... | [
"protected",
"static",
"function",
"updateMap",
"(",
"$",
"class",
",",
"$",
"origin",
")",
"{",
"if",
"(",
"is_writable",
"(",
"self",
"::",
"$",
"mapfile",
")",
"||",
"is_writable",
"(",
"dirname",
"(",
"self",
"::",
"$",
"mapfile",
")",
")",
")",
... | If possible, update the classmap file with newly-discovered
mapping.
\param string $class
Class name discovered
\param string $origin
File where class was found
\return
This method does not return anything. | [
"If",
"possible",
"update",
"the",
"classmap",
"file",
"with",
"newly",
"-",
"discovered",
"mapping",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Autoload.php#L278-L291 |
225,025 | byjg/convert | src/ToUTF8.php | ToUTF8.baseConversion | protected static function baseConversion($vector, $text)
{
foreach ($vector as $key => $value) {
$char = $value;
if (is_array($value)) {
$char = "";
foreach ($value as $ascii) {
$char .= chr($ascii);
}
}
... | php | protected static function baseConversion($vector, $text)
{
foreach ($vector as $key => $value) {
$char = $value;
if (is_array($value)) {
$char = "";
foreach ($value as $ascii) {
$char .= chr($ascii);
}
}
... | [
"protected",
"static",
"function",
"baseConversion",
"(",
"$",
"vector",
",",
"$",
"text",
")",
"{",
"foreach",
"(",
"$",
"vector",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"char",
"=",
"$",
"value",
";",
"if",
"(",
"is_array",
"(",
"$"... | Base convert based on array
@param string[] $vector
@param string $text
@return string | [
"Base",
"convert",
"based",
"on",
"array"
] | a1b360b80b624037b35fa512164bf33e38860ee8 | https://github.com/byjg/convert/blob/a1b360b80b624037b35fa512164bf33e38860ee8/src/ToUTF8.php#L485-L499 |
225,026 | RevisionTen/cqrs | Services/AggregateFactory.php | AggregateFactory.build | public function build(string $uuid, string $aggregateClass, int $max_version = null, int $user = null): AggregateInterface
{
try {
/**
* @var AggregateInterface $aggregate
*/
$aggregate = new $aggregateClass($uuid);
if ($aggregate instanceof Agg... | php | public function build(string $uuid, string $aggregateClass, int $max_version = null, int $user = null): AggregateInterface
{
try {
/**
* @var AggregateInterface $aggregate
*/
$aggregate = new $aggregateClass($uuid);
if ($aggregate instanceof Agg... | [
"public",
"function",
"build",
"(",
"string",
"$",
"uuid",
",",
"string",
"$",
"aggregateClass",
",",
"int",
"$",
"max_version",
"=",
"null",
",",
"int",
"$",
"user",
"=",
"null",
")",
":",
"AggregateInterface",
"{",
"try",
"{",
"/**\n * @var Agg... | Builds an aggregate from a provided Uuid and Aggregate class.
@param string $uuid
@param string $aggregateClass
@param int|null $max_version
@param int|null $user
@return AggregateInterface | [
"Builds",
"an",
"aggregate",
"from",
"a",
"provided",
"Uuid",
"and",
"Aggregate",
"class",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/AggregateFactory.php#L76-L136 |
225,027 | RevisionTen/cqrs | Services/AggregateFactory.php | AggregateFactory.loadFromHistory | public function loadFromHistory(AggregateInterface $aggregate, array $eventStreamObjects): AggregateInterface
{
// Arrays start at zero ;)
$count = \count($eventStreamObjects) - 1;
/**
* Get events and replay them.
*
* @var EventStreamObject $eventStreamObject
... | php | public function loadFromHistory(AggregateInterface $aggregate, array $eventStreamObjects): AggregateInterface
{
// Arrays start at zero ;)
$count = \count($eventStreamObjects) - 1;
/**
* Get events and replay them.
*
* @var EventStreamObject $eventStreamObject
... | [
"public",
"function",
"loadFromHistory",
"(",
"AggregateInterface",
"$",
"aggregate",
",",
"array",
"$",
"eventStreamObjects",
")",
":",
"AggregateInterface",
"{",
"// Arrays start at zero ;)",
"$",
"count",
"=",
"\\",
"count",
"(",
"$",
"eventStreamObjects",
")",
"... | Load an Aggregate from provided Event Stream Objects.
@param AggregateInterface $aggregate
@param array $eventStreamObjects
@return AggregateInterface | [
"Load",
"an",
"Aggregate",
"from",
"provided",
"Event",
"Stream",
"Objects",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/AggregateFactory.php#L157-L199 |
225,028 | RevisionTen/cqrs | Services/AggregateFactory.php | AggregateFactory.loadFromSnapshot | public function loadFromSnapshot(AggregateInterface $aggregate, Snapshot $snapshot): AggregateInterface
{
$snapshotData = $snapshot->getPayload();
$aggregate->setVersion($snapshot->getVersion());
$aggregate->setSnapshotVersion($snapshot->getVersion());
$aggregate->setCreated($snapsh... | php | public function loadFromSnapshot(AggregateInterface $aggregate, Snapshot $snapshot): AggregateInterface
{
$snapshotData = $snapshot->getPayload();
$aggregate->setVersion($snapshot->getVersion());
$aggregate->setSnapshotVersion($snapshot->getVersion());
$aggregate->setCreated($snapsh... | [
"public",
"function",
"loadFromSnapshot",
"(",
"AggregateInterface",
"$",
"aggregate",
",",
"Snapshot",
"$",
"snapshot",
")",
":",
"AggregateInterface",
"{",
"$",
"snapshotData",
"=",
"$",
"snapshot",
"->",
"getPayload",
"(",
")",
";",
"$",
"aggregate",
"->",
... | Loads the Aggregate from a Snapshot.
@param AggregateInterface $aggregate
@param Snapshot $snapshot
@return AggregateInterface | [
"Loads",
"the",
"Aggregate",
"from",
"a",
"Snapshot",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/AggregateFactory.php#L209-L236 |
225,029 | RevisionTen/cqrs | Services/AggregateFactory.php | AggregateFactory.applyChanges | public function applyChanges(AggregateInterface $aggregate): AggregateInterface
{
// Execute the handlers of pending Events.
/**
* @var EventInterface $event
*/
foreach ($aggregate->getPendingEvents() as $event) {
/**
* Get Handler for Command.
... | php | public function applyChanges(AggregateInterface $aggregate): AggregateInterface
{
// Execute the handlers of pending Events.
/**
* @var EventInterface $event
*/
foreach ($aggregate->getPendingEvents() as $event) {
/**
* Get Handler for Command.
... | [
"public",
"function",
"applyChanges",
"(",
"AggregateInterface",
"$",
"aggregate",
")",
":",
"AggregateInterface",
"{",
"// Execute the handlers of pending Events.",
"/**\n * @var EventInterface $event\n */",
"foreach",
"(",
"$",
"aggregate",
"->",
"getPendingEven... | Execute the Handlers of pending Events on Aggregate.
This changes the state of the Aggregate.
@param AggregateInterface $aggregate
@return AggregateInterface | [
"Execute",
"the",
"Handlers",
"of",
"pending",
"Events",
"on",
"Aggregate",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/AggregateFactory.php#L247-L268 |
225,030 | RevisionTen/cqrs | Services/AggregateFactory.php | AggregateFactory.apply | public function apply(AggregateInterface $aggregate, EventInterface $event): AggregateInterface
{
// Increase version on each apply call.
$aggregate->setVersion($event->getCommand()->getOnVersion() + 1);
// Add Event to pending Events.
return $aggregate->addPendingEvent($event);
... | php | public function apply(AggregateInterface $aggregate, EventInterface $event): AggregateInterface
{
// Increase version on each apply call.
$aggregate->setVersion($event->getCommand()->getOnVersion() + 1);
// Add Event to pending Events.
return $aggregate->addPendingEvent($event);
... | [
"public",
"function",
"apply",
"(",
"AggregateInterface",
"$",
"aggregate",
",",
"EventInterface",
"$",
"event",
")",
":",
"AggregateInterface",
"{",
"// Increase version on each apply call.",
"$",
"aggregate",
"->",
"setVersion",
"(",
"$",
"event",
"->",
"getCommand"... | Adds an Event to the Aggregates pending Events.
Events added here will be change the state of the Aggregate
when applyChanges() is called on the Aggregate.
@param AggregateInterface $aggregate
@param EventInterface $event
@return AggregateInterface | [
"Adds",
"an",
"Event",
"to",
"the",
"Aggregates",
"pending",
"Events",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/AggregateFactory.php#L281-L288 |
225,031 | sopinetchat/SopinetChatBundle | Entity/ChatRepository.php | ChatRepository.enabledChat | public function enabledChat(Chat $chat){
$em = $this->getEntityManager();
$chat->setEnabled(true);
$em->persist($chat);
$em->flush();
} | php | public function enabledChat(Chat $chat){
$em = $this->getEntityManager();
$chat->setEnabled(true);
$em->persist($chat);
$em->flush();
} | [
"public",
"function",
"enabledChat",
"(",
"Chat",
"$",
"chat",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
";",
"$",
"chat",
"->",
"setEnabled",
"(",
"true",
")",
";",
"$",
"em",
"->",
"persist",
"(",
"$",
"chat",
")"... | Function to enabled chat
@param Chat $chat | [
"Function",
"to",
"enabled",
"chat"
] | 92c306963d8e9c74ecaa06422cea65bcf1bb3ba2 | https://github.com/sopinetchat/SopinetChatBundle/blob/92c306963d8e9c74ecaa06422cea65bcf1bb3ba2/Entity/ChatRepository.php#L73-L81 |
225,032 | cmsgears/module-cms | common/components/Factory.php | Factory.registerResourceServices | public function registerResourceServices() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'cmsgears\cms\common\services\interfaces\resources\IFormService', 'cmsgears\cms\common\services\resources\FormService' );
$factory->set( 'cmsgears\cms\common\services\interfaces\resources\ICategoryService'... | php | public function registerResourceServices() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'cmsgears\cms\common\services\interfaces\resources\IFormService', 'cmsgears\cms\common\services\resources\FormService' );
$factory->set( 'cmsgears\cms\common\services\interfaces\resources\ICategoryService'... | [
"public",
"function",
"registerResourceServices",
"(",
")",
"{",
"$",
"factory",
"=",
"Yii",
"::",
"$",
"app",
"->",
"factory",
"->",
"getContainer",
"(",
")",
";",
"$",
"factory",
"->",
"set",
"(",
"'cmsgears\\cms\\common\\services\\interfaces\\resources\\IFormServ... | Registers resource services. | [
"Registers",
"resource",
"services",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/components/Factory.php#L68-L80 |
225,033 | cmsgears/module-cms | common/components/Factory.php | Factory.registerMapperServices | public function registerMapperServices() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelCategoryService', 'cmsgears\cms\common\services\mappers\ModelCategoryService' );
$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelT... | php | public function registerMapperServices() {
$factory = Yii::$app->factory->getContainer();
$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelCategoryService', 'cmsgears\cms\common\services\mappers\ModelCategoryService' );
$factory->set( 'cmsgears\cms\common\services\interfaces\mappers\IModelT... | [
"public",
"function",
"registerMapperServices",
"(",
")",
"{",
"$",
"factory",
"=",
"Yii",
"::",
"$",
"app",
"->",
"factory",
"->",
"getContainer",
"(",
")",
";",
"$",
"factory",
"->",
"set",
"(",
"'cmsgears\\cms\\common\\services\\interfaces\\mappers\\IModelCategor... | Registers mapper services. | [
"Registers",
"mapper",
"services",
"."
] | ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8 | https://github.com/cmsgears/module-cms/blob/ee35eac3eb8dc9001b2e5dd7dade7f69d9546de8/common/components/Factory.php#L85-L102 |
225,034 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Compiler/MinkExtensionBaseUrlPass.php | MinkExtensionBaseUrlPass.process | public function process(ContainerBuilder $container)
{
$frameworkPath = $container->getParameter('behat.silverstripe_extension.framework_path');
global $_FILE_TO_URL_MAPPING;
if($container->getParameter('behat.mink.base_url')) {
// If base_url is already defined, also set it in ... | php | public function process(ContainerBuilder $container)
{
$frameworkPath = $container->getParameter('behat.silverstripe_extension.framework_path');
global $_FILE_TO_URL_MAPPING;
if($container->getParameter('behat.mink.base_url')) {
// If base_url is already defined, also set it in ... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"frameworkPath",
"=",
"$",
"container",
"->",
"getParameter",
"(",
"'behat.silverstripe_extension.framework_path'",
")",
";",
"global",
"$",
"_FILE_TO_URL_MAPPING",
";",
"if",
... | Passes MinkExtension's base_url parameter
@param ContainerBuilder $container | [
"Passes",
"MinkExtension",
"s",
"base_url",
"parameter"
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Compiler/MinkExtensionBaseUrlPass.php#L22-L54 |
225,035 | edineibauer/config | public/src/Config/Config.php | Config.getEntityNotAllow | public static function getEntityNotAllow(): array
{
$file = [];
if (file_exists(PATH_HOME . "public/entity/-entity.json"))
$file = json_decode(file_get_contents(PATH_HOME . "public/entity/-entity.json"), true);
foreach (Helper::listFolder(PATH_HOME . VENDOR) as $lib) {
... | php | public static function getEntityNotAllow(): array
{
$file = [];
if (file_exists(PATH_HOME . "public/entity/-entity.json"))
$file = json_decode(file_get_contents(PATH_HOME . "public/entity/-entity.json"), true);
foreach (Helper::listFolder(PATH_HOME . VENDOR) as $lib) {
... | [
"public",
"static",
"function",
"getEntityNotAllow",
"(",
")",
":",
"array",
"{",
"$",
"file",
"=",
"[",
"]",
";",
"if",
"(",
"file_exists",
"(",
"PATH_HOME",
".",
"\"public/entity/-entity.json\"",
")",
")",
"$",
"file",
"=",
"json_decode",
"(",
"file_get_co... | Retorna a lista de entidades bloqueadas por setor
@return array | [
"Retorna",
"a",
"lista",
"de",
"entidades",
"bloqueadas",
"por",
"setor"
] | d4331c657895f89b8f889db6bb121f195166c330 | https://github.com/edineibauer/config/blob/d4331c657895f89b8f889db6bb121f195166c330/public/src/Config/Config.php#L186-L216 |
225,036 | n2n/n2n-l10n | src/app/n2n/l10n/N2nLocale.php | N2nLocale.toWebId | public function toWebId(bool $ignoreAliases = false) {
if (!$ignoreAliases && null !== ($alias = self::getWebAliasForN2nLocale($this))) {
return $alias;
}
return mb_strtolower(str_replace('_', '-', $this->getId()));
} | php | public function toWebId(bool $ignoreAliases = false) {
if (!$ignoreAliases && null !== ($alias = self::getWebAliasForN2nLocale($this))) {
return $alias;
}
return mb_strtolower(str_replace('_', '-', $this->getId()));
} | [
"public",
"function",
"toWebId",
"(",
"bool",
"$",
"ignoreAliases",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"ignoreAliases",
"&&",
"null",
"!==",
"(",
"$",
"alias",
"=",
"self",
"::",
"getWebAliasForN2nLocale",
"(",
"$",
"this",
")",
")",
")",
"{"... | ISO 639-1 - ISO 3166-1 Alpha 2
@param bool $ignoreAliases
@return string | [
"ISO",
"639",
"-",
"1",
"-",
"ISO",
"3166",
"-",
"1",
"Alpha",
"2"
] | f617ec59e63cd56ecedf44e79fcab0a2019c9772 | https://github.com/n2n/n2n-l10n/blob/f617ec59e63cd56ecedf44e79fcab0a2019c9772/src/app/n2n/l10n/N2nLocale.php#L113-L119 |
225,037 | Finesse/MiniDB | src/Query.php | Query.update | public function update(array $values): int
{
try {
$query = (clone $this)->addUpdate($values)->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileUpdate($query);
return $this->database->update($compiled->getSQL(), $compiled->getB... | php | public function update(array $values): int
{
try {
$query = (clone $this)->addUpdate($values)->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileUpdate($query);
return $this->database->update($compiled->getSQL(), $compiled->getB... | [
"public",
"function",
"update",
"(",
"array",
"$",
"values",
")",
":",
"int",
"{",
"try",
"{",
"$",
"query",
"=",
"(",
"clone",
"$",
"this",
")",
"->",
"addUpdate",
"(",
"$",
"values",
")",
"->",
"apply",
"(",
"$",
"this",
"->",
"database",
"->",
... | Updates the query target rows. Doesn't modify itself.
@param mixed[]|\Closure[]|self[]|StatementInterface[] $values Fields to update. The indexes are the columns
names, the values are the values.
@return int The number of updated rows
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentExc... | [
"Updates",
"the",
"query",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Query.php#L53-L62 |
225,038 | Finesse/MiniDB | src/Query.php | Query.delete | public function delete(): int
{
try {
$query = (clone $this)->setDelete()->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileDelete($query);
return $this->database->delete($compiled->getSQL(), $compiled->getBindings());
... | php | public function delete(): int
{
try {
$query = (clone $this)->setDelete()->apply($this->database->getTablePrefixer());
$compiled = $this->database->getGrammar()->compileDelete($query);
return $this->database->delete($compiled->getSQL(), $compiled->getBindings());
... | [
"public",
"function",
"delete",
"(",
")",
":",
"int",
"{",
"try",
"{",
"$",
"query",
"=",
"(",
"clone",
"$",
"this",
")",
"->",
"setDelete",
"(",
")",
"->",
"apply",
"(",
"$",
"this",
"->",
"database",
"->",
"getTablePrefixer",
"(",
")",
")",
";",
... | Deletes the query target rows. Doesn't modify itself.
@return int The number of deleted rows
@throws DatabaseException
@throws IncorrectQueryException
@throws InvalidArgumentException
@throws InvalidReturnValueException | [
"Deletes",
"the",
"query",
"target",
"rows",
".",
"Doesn",
"t",
"modify",
"itself",
"."
] | d70e27cae91f975e9f5bfd506a6e5d6fee0ada65 | https://github.com/Finesse/MiniDB/blob/d70e27cae91f975e9f5bfd506a6e5d6fee0ada65/src/Query.php#L73-L82 |
225,039 | cmsgears/module-cart | common/models/resources/CartItem.php | CartItem.getTotalPrice | public function getTotalPrice( $precision = 2 ) {
$price = ( $this->price - $this->discount ) * $this->purchase;
return round( $price, $precision );
} | php | public function getTotalPrice( $precision = 2 ) {
$price = ( $this->price - $this->discount ) * $this->purchase;
return round( $price, $precision );
} | [
"public",
"function",
"getTotalPrice",
"(",
"$",
"precision",
"=",
"2",
")",
"{",
"$",
"price",
"=",
"(",
"$",
"this",
"->",
"price",
"-",
"$",
"this",
"->",
"discount",
")",
"*",
"$",
"this",
"->",
"purchase",
";",
"return",
"round",
"(",
"$",
"pr... | Returns the total price of the item.
Total Price = ( Unit Price - Unit Discount ) * Purchasing Quantity
@param type $precision
@return type | [
"Returns",
"the",
"total",
"price",
"of",
"the",
"item",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/CartItem.php#L282-L287 |
225,040 | cmsgears/module-cart | common/models/resources/CartItem.php | CartItem.findByParentCartId | public static function findByParentCartId( $parentId, $parentType, $cartId ) {
return self::find()->where( 'parentId=:pid AND parentType=:ptype AND cartId=:cid', [ ':pid' => $parentId, ':ptype' => $parentType, ':cid' => $cartId ] )->one();
} | php | public static function findByParentCartId( $parentId, $parentType, $cartId ) {
return self::find()->where( 'parentId=:pid AND parentType=:ptype AND cartId=:cid', [ ':pid' => $parentId, ':ptype' => $parentType, ':cid' => $cartId ] )->one();
} | [
"public",
"static",
"function",
"findByParentCartId",
"(",
"$",
"parentId",
",",
"$",
"parentType",
",",
"$",
"cartId",
")",
"{",
"return",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"'parentId=:pid AND parentType=:ptype AND cartId=:cid'",
",",
"[",
"':... | Return the cart item associated with given parent id, parent type and cart id.
@param integer $parentId
@param string $parentType
@param integer $cartId
@return CartItem | [
"Return",
"the",
"cart",
"item",
"associated",
"with",
"given",
"parent",
"id",
"parent",
"type",
"and",
"cart",
"id",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/CartItem.php#L352-L355 |
225,041 | stubbles/stubbles-input | src/main/php/broker/param/OneOfParamBroker.php | OneOfParamBroker.allowedValues | private function allowedValues(Annotation $annotation): array
{
if ($annotation->hasValueByName('allowed')) {
return array_map('trim', explode('|', $annotation->getAllowed()));
} elseif ($annotation->hasValueByName('allowedSource')) {
return call_user_func(array_map('trim', e... | php | private function allowedValues(Annotation $annotation): array
{
if ($annotation->hasValueByName('allowed')) {
return array_map('trim', explode('|', $annotation->getAllowed()));
} elseif ($annotation->hasValueByName('allowedSource')) {
return call_user_func(array_map('trim', e... | [
"private",
"function",
"allowedValues",
"(",
"Annotation",
"$",
"annotation",
")",
":",
"array",
"{",
"if",
"(",
"$",
"annotation",
"->",
"hasValueByName",
"(",
"'allowed'",
")",
")",
"{",
"return",
"array_map",
"(",
"'trim'",
",",
"explode",
"(",
"'|'",
"... | reads default value
@param \stubbles\reflect\annotation\Annotation $annotation
@return string[]
@throws \RuntimeException | [
"reads",
"default",
"value"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/broker/param/OneOfParamBroker.php#L38-L53 |
225,042 | charlesportwoodii/rpq-client | src/Queue.php | Queue.pop | public function pop() :? Job
{
$key = $this->generateListKey();
$element = $this->getFirstElementFromQueue($key);
if ($element === null) {
return null;
}
// Atomic ZPOP
$this->getClient()->getRedis()->watch($key);
while (!$this->getClient()->getR... | php | public function pop() :? Job
{
$key = $this->generateListKey();
$element = $this->getFirstElementFromQueue($key);
if ($element === null) {
return null;
}
// Atomic ZPOP
$this->getClient()->getRedis()->watch($key);
while (!$this->getClient()->getR... | [
"public",
"function",
"pop",
"(",
")",
":",
"?",
"Job",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"generateListKey",
"(",
")",
";",
"$",
"element",
"=",
"$",
"this",
"->",
"getFirstElementFromQueue",
"(",
"$",
"key",
")",
";",
"if",
"(",
"$",
"eleme... | Pops the highest priority item off of the priority queue
@return Job | [
"Pops",
"the",
"highest",
"priority",
"item",
"off",
"of",
"the",
"priority",
"queue"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Queue.php#L115-L135 |
225,043 | charlesportwoodii/rpq-client | src/Queue.php | Queue.getFirstElementFromQueue | private function getFirstElementFromQueue($key) :? string
{
$result = $this->getClient()->getRedis()->zrevrange($key, 0, 0);
if (empty($result)) {
return null;
}
return $result[0];
} | php | private function getFirstElementFromQueue($key) :? string
{
$result = $this->getClient()->getRedis()->zrevrange($key, 0, 0);
if (empty($result)) {
return null;
}
return $result[0];
} | [
"private",
"function",
"getFirstElementFromQueue",
"(",
"$",
"key",
")",
":",
"?",
"string",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"getRedis",
"(",
")",
"->",
"zrevrange",
"(",
"$",
"key",
",",
"0",
",",
"0",
")",
... | Gets the head element off of the list
@param string $key
@return array | [
"Gets",
"the",
"head",
"element",
"off",
"of",
"the",
"list"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Queue.php#L176-L184 |
225,044 | charlesportwoodii/rpq-client | src/Queue.php | Queue.generateListKey | public function generateListKey() : string
{
$filter = [
$this->getClient()->getNamespace(),
'queue',
\str_replace(':', '.', $this->getName())
];
$parts = \array_filter($filter, 'strlen');
return \implode(':', $parts);
} | php | public function generateListKey() : string
{
$filter = [
$this->getClient()->getNamespace(),
'queue',
\str_replace(':', '.', $this->getName())
];
$parts = \array_filter($filter, 'strlen');
return \implode(':', $parts);
} | [
"public",
"function",
"generateListKey",
"(",
")",
":",
"string",
"{",
"$",
"filter",
"=",
"[",
"$",
"this",
"->",
"getClient",
"(",
")",
"->",
"getNamespace",
"(",
")",
",",
"'queue'",
",",
"\\",
"str_replace",
"(",
"':'",
",",
"'.'",
",",
"$",
"thi... | Generates a unique key for the job
@return string | [
"Generates",
"a",
"unique",
"key",
"for",
"the",
"job"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Queue.php#L191-L200 |
225,045 | charlesportwoodii/rpq-client | src/Queue.php | Queue.getStatsByType | public function getStatsByType(string $date, string $type) :? array
{
if ($this->isValidDate($date)) {
$results = $this->getClient()->getRedis()->hgetall($date . '_' . $type);
\ksort($results);
return $results;
}
return null;
} | php | public function getStatsByType(string $date, string $type) :? array
{
if ($this->isValidDate($date)) {
$results = $this->getClient()->getRedis()->hgetall($date . '_' . $type);
\ksort($results);
return $results;
}
return null;
} | [
"public",
"function",
"getStatsByType",
"(",
"string",
"$",
"date",
",",
"string",
"$",
"type",
")",
":",
"?",
"array",
"{",
"if",
"(",
"$",
"this",
"->",
"isValidDate",
"(",
"$",
"date",
")",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"getC... | Returns stats by a given type
@param string $date
@param string $type
@return array | [
"Returns",
"stats",
"by",
"a",
"given",
"type"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Queue.php#L209-L218 |
225,046 | charlesportwoodii/rpq-client | src/Queue.php | Queue.isValidDate | private function isValidDate(string $date, string $format = 'Y-m-d') : bool
{
$d = DateTime::createFromFormat($format, $date);
// The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue.
return $d && $d->format(... | php | private function isValidDate(string $date, string $format = 'Y-m-d') : bool
{
$d = DateTime::createFromFormat($format, $date);
// The Y ( 4 digits year ) returns TRUE for any integer with any number of digits so changing the comparison from == to === fixes the issue.
return $d && $d->format(... | [
"private",
"function",
"isValidDate",
"(",
"string",
"$",
"date",
",",
"string",
"$",
"format",
"=",
"'Y-m-d'",
")",
":",
"bool",
"{",
"$",
"d",
"=",
"DateTime",
"::",
"createFromFormat",
"(",
"$",
"format",
",",
"$",
"date",
")",
";",
"// The Y ( 4 digi... | Returns true if the date is valid
@param string $date
@param string $format
@return boolean | [
"Returns",
"true",
"if",
"the",
"date",
"is",
"valid"
] | 9419cfe5c30d35ea54ce8faba7545daea2312e0f | https://github.com/charlesportwoodii/rpq-client/blob/9419cfe5c30d35ea54ce8faba7545daea2312e0f/src/Queue.php#L227-L232 |
225,047 | DrNixx/yii2-onix | src/widgets/InputWidget.php | InputWidget.initInputWidget | protected function initInputWidget()
{
$this->initI18N(__DIR__, 'onix-core');
if (!isset($this->language)) {
$this->language = Yii::$app->language;
}
$this->_lang = Env::getLang($this->language);
if ($this->pluginLoading) {
$this->_loadIndicator = st... | php | protected function initInputWidget()
{
$this->initI18N(__DIR__, 'onix-core');
if (!isset($this->language)) {
$this->language = Yii::$app->language;
}
$this->_lang = Env::getLang($this->language);
if ($this->pluginLoading) {
$this->_loadIndicator = st... | [
"protected",
"function",
"initInputWidget",
"(",
")",
"{",
"$",
"this",
"->",
"initI18N",
"(",
"__DIR__",
",",
"'onix-core'",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"language",
")",
")",
"{",
"$",
"this",
"->",
"language",
"=",
"Y... | Initializes the input widget. | [
"Initializes",
"the",
"input",
"widget",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/InputWidget.php#L185-L204 |
225,048 | DrNixx/yii2-onix | src/widgets/InputWidget.php | InputWidget.initDisability | protected function initDisability(&$options)
{
if ($this->disabled && !isset($options['disabled'])) {
$options['disabled'] = true;
}
if ($this->readonly && !isset($options['readonly'])) {
$options['readonly'] = true;
}
} | php | protected function initDisability(&$options)
{
if ($this->disabled && !isset($options['disabled'])) {
$options['disabled'] = true;
}
if ($this->readonly && !isset($options['readonly'])) {
$options['readonly'] = true;
}
} | [
"protected",
"function",
"initDisability",
"(",
"&",
"$",
"options",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"disabled",
"&&",
"!",
"isset",
"(",
"$",
"options",
"[",
"'disabled'",
"]",
")",
")",
"{",
"$",
"options",
"[",
"'disabled'",
"]",
"=",
"tru... | Validates and sets disabled or readonly inputs.
@param array $options the HTML attributes for the input | [
"Validates",
"and",
"sets",
"disabled",
"or",
"readonly",
"inputs",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/InputWidget.php#L216-L224 |
225,049 | DrNixx/yii2-onix | src/widgets/InputWidget.php | InputWidget.initLanguage | protected function initLanguage($property = 'language', $full = false)
{
if (empty($this->pluginOptions[$property])) {
$this->pluginOptions[$property] = $full ? $this->language : $this->_lang;
}
} | php | protected function initLanguage($property = 'language', $full = false)
{
if (empty($this->pluginOptions[$property])) {
$this->pluginOptions[$property] = $full ? $this->language : $this->_lang;
}
} | [
"protected",
"function",
"initLanguage",
"(",
"$",
"property",
"=",
"'language'",
",",
"$",
"full",
"=",
"false",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"pluginOptions",
"[",
"$",
"property",
"]",
")",
")",
"{",
"$",
"this",
"->",
"plu... | Initialize the plugin language.
@param string $property the name of language property in [[pluginOptions]].
@param boolean $full whether to use the full language string. Defaults to `false`
which is the 2 (or 3) digit ISO-639 format.
Defaults to 'language'. | [
"Initialize",
"the",
"plugin",
"language",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/InputWidget.php#L234-L239 |
225,050 | DrNixx/yii2-onix | src/widgets/InputWidget.php | InputWidget.setLanguage | protected function setLanguage($prefix, $assetPath = null, $filePath = null, $suffix = '.js')
{
$pwd = Env::getCurrentDir($this);
$s = DIRECTORY_SEPARATOR;
if ($assetPath === null) {
$assetPath = "{$pwd}{$s}assets{$s}";
} elseif (substr($assetPath, -1) != $s) {
... | php | protected function setLanguage($prefix, $assetPath = null, $filePath = null, $suffix = '.js')
{
$pwd = Env::getCurrentDir($this);
$s = DIRECTORY_SEPARATOR;
if ($assetPath === null) {
$assetPath = "{$pwd}{$s}assets{$s}";
} elseif (substr($assetPath, -1) != $s) {
... | [
"protected",
"function",
"setLanguage",
"(",
"$",
"prefix",
",",
"$",
"assetPath",
"=",
"null",
",",
"$",
"filePath",
"=",
"null",
",",
"$",
"suffix",
"=",
"'.js'",
")",
"{",
"$",
"pwd",
"=",
"Env",
"::",
"getCurrentDir",
"(",
"$",
"this",
")",
";",
... | Sets the language JS file if it exists.
@param string $prefix the language filename prefix
@param string $assetPath the path to the assets
@param string $filePath the path to the JS file with the file name prefix
@param string $suffix the file name suffix - defaults to '.js' | [
"Sets",
"the",
"language",
"JS",
"file",
"if",
"it",
"exists",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/InputWidget.php#L249-L282 |
225,051 | DrNixx/yii2-onix | src/widgets/InputWidget.php | InputWidget.getInput | protected function getInput($type, $list = false)
{
if ($this->hasModel()) {
$input = 'active' . ucfirst($type);
return $list ?
Html::$input($this->model, $this->attribute, $this->data, $this->options) :
Html::$input($this->model, $this->attribute, $th... | php | protected function getInput($type, $list = false)
{
if ($this->hasModel()) {
$input = 'active' . ucfirst($type);
return $list ?
Html::$input($this->model, $this->attribute, $this->data, $this->options) :
Html::$input($this->model, $this->attribute, $th... | [
"protected",
"function",
"getInput",
"(",
"$",
"type",
",",
"$",
"list",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasModel",
"(",
")",
")",
"{",
"$",
"input",
"=",
"'active'",
".",
"ucfirst",
"(",
"$",
"type",
")",
";",
"return",
"$... | Generates an input.
@param string $type the input type
@param boolean $list whether the input is of dropdown list type
@return string the rendered input markup | [
"Generates",
"an",
"input",
"."
] | 0a621ed301dc94971ff71af062b24d6bc0858dd7 | https://github.com/DrNixx/yii2-onix/blob/0a621ed301dc94971ff71af062b24d6bc0858dd7/src/widgets/InputWidget.php#L292-L317 |
225,052 | RevisionTen/cqrs | Handler/Handler.php | Handler.executeHandler | public function executeHandler(CommandInterface $command, AggregateInterface $aggregate): AggregateInterface
{
/* Execute method is implemented in final class */
return $this->execute($command, $aggregate);
} | php | public function executeHandler(CommandInterface $command, AggregateInterface $aggregate): AggregateInterface
{
/* Execute method is implemented in final class */
return $this->execute($command, $aggregate);
} | [
"public",
"function",
"executeHandler",
"(",
"CommandInterface",
"$",
"command",
",",
"AggregateInterface",
"$",
"aggregate",
")",
":",
"AggregateInterface",
"{",
"/* Execute method is implemented in final class */",
"return",
"$",
"this",
"->",
"execute",
"(",
"$",
"co... | A wrapper for the execute function.
@param CommandInterface $command
@param AggregateInterface $aggregate
@return AggregateInterface | [
"A",
"wrapper",
"for",
"the",
"execute",
"function",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Handler/Handler.php#L79-L83 |
225,053 | RevisionTen/cqrs | Handler/Handler.php | Handler.getAggregate | public function getAggregate(string $uuid, string $aggregateClass, int $user): AggregateInterface
{
return $this->aggregateFactory->build($uuid, $aggregateClass, null, $user);
} | php | public function getAggregate(string $uuid, string $aggregateClass, int $user): AggregateInterface
{
return $this->aggregateFactory->build($uuid, $aggregateClass, null, $user);
} | [
"public",
"function",
"getAggregate",
"(",
"string",
"$",
"uuid",
",",
"string",
"$",
"aggregateClass",
",",
"int",
"$",
"user",
")",
":",
"AggregateInterface",
"{",
"return",
"$",
"this",
"->",
"aggregateFactory",
"->",
"build",
"(",
"$",
"uuid",
",",
"$"... | Returns an Aggregate based on the provided uuid.
@param string $uuid
@param string $aggregateClass
@param int $user
@return AggregateInterface | [
"Returns",
"an",
"Aggregate",
"based",
"on",
"the",
"provided",
"uuid",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Handler/Handler.php#L94-L97 |
225,054 | chEbba/LogStock | src/Che/LogStock/LoggerFactoryBuilder.php | LoggerFactoryBuilder.createDefaultFactory | protected function createDefaultFactory()
{
$loader = $this->loader ? : $this->createDefaultLoader();
if ($this->hierarchy) {
$loader = new HierarchicalNameLoader($loader);
}
$rootAdapter = $this->fallbackAdapter ? : $this->createDefaultFallbackAdapter();
return ... | php | protected function createDefaultFactory()
{
$loader = $this->loader ? : $this->createDefaultLoader();
if ($this->hierarchy) {
$loader = new HierarchicalNameLoader($loader);
}
$rootAdapter = $this->fallbackAdapter ? : $this->createDefaultFallbackAdapter();
return ... | [
"protected",
"function",
"createDefaultFactory",
"(",
")",
"{",
"$",
"loader",
"=",
"$",
"this",
"->",
"loader",
"?",
":",
"$",
"this",
"->",
"createDefaultLoader",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hierarchy",
")",
"{",
"$",
"loader",
"=",... | Create default adapter loader with optional hierarchy wrapper
@return LoggerFactory
@see disableHierarchy()
@see loader()
@see fallbackAdapter() | [
"Create",
"default",
"adapter",
"loader",
"with",
"optional",
"hierarchy",
"wrapper"
] | 206ee26ed937b0f8857b63a527dd1a6020f52168 | https://github.com/chEbba/LogStock/blob/206ee26ed937b0f8857b63a527dd1a6020f52168/src/Che/LogStock/LoggerFactoryBuilder.php#L172-L181 |
225,055 | n2n/n2n-log4php | src/app/n2n/log4php/reflection/ReflectionUtils.php | ReflectionUtils.setProperty | public function setProperty($name, $value) {
if($value === null) {
return;
}
$method = "set" . ucfirst($name);
if(!method_exists($this->obj, $method)) {
throw new \Exception("Error setting log4php property $name to $value: no method $method in class ".get_class($this->obj)."!");
} else {
... | php | public function setProperty($name, $value) {
if($value === null) {
return;
}
$method = "set" . ucfirst($name);
if(!method_exists($this->obj, $method)) {
throw new \Exception("Error setting log4php property $name to $value: no method $method in class ".get_class($this->obj)."!");
} else {
... | [
"public",
"function",
"setProperty",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"method",
"=",
"\"set\"",
".",
"ucfirst",
"(",
"$",
"name",
")",
";",
"if",
"(",
"!",
... | Set a property on this PropertySetter's Object. If successful, this
method will invoke a setter method on the underlying Object. The
setter is the one for the specified property name and the value is
determined partly from the setter argument type and partly from the
value specified in the call to this method.
<p>If t... | [
"Set",
"a",
"property",
"on",
"this",
"PropertySetter",
"s",
"Object",
".",
"If",
"successful",
"this",
"method",
"will",
"invoke",
"a",
"setter",
"method",
"on",
"the",
"underlying",
"Object",
".",
"The",
"setter",
"is",
"the",
"one",
"for",
"the",
"speci... | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/reflection/ReflectionUtils.php#L103-L115 |
225,056 | n2n/n2n-l10n | src/app/n2n/l10n/MessageContainer.php | MessageContainer.add | public function add(Message $message, $groupName = null) {
if (!isset($this->messages[$groupName])) {
$this->messages[$groupName] = array();
}
$this->messages[$groupName][] = $message;
} | php | public function add(Message $message, $groupName = null) {
if (!isset($this->messages[$groupName])) {
$this->messages[$groupName] = array();
}
$this->messages[$groupName][] = $message;
} | [
"public",
"function",
"add",
"(",
"Message",
"$",
"message",
",",
"$",
"groupName",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"messages",
"[",
"$",
"groupName",
"]",
")",
")",
"{",
"$",
"this",
"->",
"messages",
"[",
... | adds a Messsage object
@param Message $message the Message object.
@param string $groupName the name of the group, which helps to categorize messages. | [
"adds",
"a",
"Messsage",
"object"
] | f617ec59e63cd56ecedf44e79fcab0a2019c9772 | https://github.com/n2n/n2n-l10n/blob/f617ec59e63cd56ecedf44e79fcab0a2019c9772/src/app/n2n/l10n/MessageContainer.php#L70-L76 |
225,057 | n2n/n2n-l10n | src/app/n2n/l10n/MessageContainer.php | MessageContainer.addAll | public function addAll(array $messages, $groupName = null) {
foreach ($messages as $message) {
$this->add($message, $groupName);
}
} | php | public function addAll(array $messages, $groupName = null) {
foreach ($messages as $message) {
$this->add($message, $groupName);
}
} | [
"public",
"function",
"addAll",
"(",
"array",
"$",
"messages",
",",
"$",
"groupName",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"messages",
"as",
"$",
"message",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"message",
",",
"$",
"groupName",
")",
... | Adds a collection of message objects.
@param array $messages
@param string $groupName | [
"Adds",
"a",
"collection",
"of",
"message",
"objects",
"."
] | f617ec59e63cd56ecedf44e79fcab0a2019c9772 | https://github.com/n2n/n2n-l10n/blob/f617ec59e63cd56ecedf44e79fcab0a2019c9772/src/app/n2n/l10n/MessageContainer.php#L84-L88 |
225,058 | czogori/Dami | src/Dami/Migration/Api/MigrationApi.php | MigrationApi.createTable | public function createTable($name, array $options = [])
{
$schema = isset($options['schema']) ? new Schema($options['schema']) : null;
$table = new TableApi($name, $schema, $this->manipulation, $this->actions);
$primaryKey = isset($options['primary_key'])
? new PrimaryKey($opti... | php | public function createTable($name, array $options = [])
{
$schema = isset($options['schema']) ? new Schema($options['schema']) : null;
$table = new TableApi($name, $schema, $this->manipulation, $this->actions);
$primaryKey = isset($options['primary_key'])
? new PrimaryKey($opti... | [
"public",
"function",
"createTable",
"(",
"$",
"name",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"schema",
"=",
"isset",
"(",
"$",
"options",
"[",
"'schema'",
"]",
")",
"?",
"new",
"Schema",
"(",
"$",
"options",
"[",
"'schema'",
"... | Create new table.
@param string $name Table name.
@param array $options Optional options.
@return CreationTableApi CreationTableApi instance. | [
"Create",
"new",
"table",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/MigrationApi.php#L38-L60 |
225,059 | czogori/Dami | src/Dami/Migration/Api/MigrationApi.php | MigrationApi.createSchema | public function createSchema($name)
{
$schema = new Schema($name);
$this->actions[] = function () use ($schema) {
return $this->manipulation->create($schema);
};
} | php | public function createSchema($name)
{
$schema = new Schema($name);
$this->actions[] = function () use ($schema) {
return $this->manipulation->create($schema);
};
} | [
"public",
"function",
"createSchema",
"(",
"$",
"name",
")",
"{",
"$",
"schema",
"=",
"new",
"Schema",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"schema",
")",
"{",
"return",
"... | Create new schema.
@param string $name Schema name.
@return void | [
"Create",
"new",
"schema",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/MigrationApi.php#L104-L110 |
225,060 | czogori/Dami | src/Dami/Migration/Api/MigrationApi.php | MigrationApi.dropSchema | public function dropSchema($name)
{
$schema = new Schema($name);
$this->actions[] = function () use ($schema) {
return $this->manipulation->drop($schema);
};
} | php | public function dropSchema($name)
{
$schema = new Schema($name);
$this->actions[] = function () use ($schema) {
return $this->manipulation->drop($schema);
};
} | [
"public",
"function",
"dropSchema",
"(",
"$",
"name",
")",
"{",
"$",
"schema",
"=",
"new",
"Schema",
"(",
"$",
"name",
")",
";",
"$",
"this",
"->",
"actions",
"[",
"]",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"schema",
")",
"{",
"return",
"$"... | Drop schema.
@param string $name Schema name.
@return void | [
"Drop",
"schema",
"."
] | 19612e643f8bea76706cc667c3f2c12a42d4cd19 | https://github.com/czogori/Dami/blob/19612e643f8bea76706cc667c3f2c12a42d4cd19/src/Dami/Migration/Api/MigrationApi.php#L119-L125 |
225,061 | SetBased/php-abc-form | src/Validator/DateValidator.php | DateValidator.validate | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value===null || $value===false || $value==='') return true;
// Objects and arrays are not valid dates.
if (!is_scalar($value)) throw new LogicException('%s is not a valid d... | php | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
// An empty value is valid.
if ($value===null || $value===false || $value==='') return true;
// Objects and arrays are not valid dates.
if (!is_scalar($value)) throw new LogicException('%s is not a valid d... | [
"public",
"function",
"validate",
"(",
"Control",
"$",
"control",
")",
":",
"bool",
"{",
"$",
"value",
"=",
"$",
"control",
"->",
"getSubmittedValue",
"(",
")",
";",
"// An empty value is valid.",
"if",
"(",
"$",
"value",
"===",
"null",
"||",
"$",
"value",... | Returns true if the value of the form control is a valid date. Otherwise returns false.
Note:
* Empty values are considered valid.
@param Control $control The DateControl.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"the",
"value",
"of",
"the",
"form",
"control",
"is",
"a",
"valid",
"date",
".",
"Otherwise",
"returns",
"false",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/DateValidator.php#L27-L48 |
225,062 | stubbles/stubbles-input | src/main/php/filter/range/StringLength.php | StringLength.truncate | public static function truncate(int $minLength = null, int $maxLength = null)
{
if (0 >= $maxLength) {
throw new \InvalidArgumentException(
'Max length must be greater than 0, otherwise truncation doesn\'t make sense'
);
}
$self = new self($minLen... | php | public static function truncate(int $minLength = null, int $maxLength = null)
{
if (0 >= $maxLength) {
throw new \InvalidArgumentException(
'Max length must be greater than 0, otherwise truncation doesn\'t make sense'
);
}
$self = new self($minLen... | [
"public",
"static",
"function",
"truncate",
"(",
"int",
"$",
"minLength",
"=",
"null",
",",
"int",
"$",
"maxLength",
"=",
"null",
")",
"{",
"if",
"(",
"0",
">=",
"$",
"maxLength",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Max len... | create instance which treats above max border not as error, but will lead
to a truncated value only
@param int $minLength
@param int $maxLength
@return StringLength
@throws \InvalidArgumentException
@since 2.3.1 | [
"create",
"instance",
"which",
"treats",
"above",
"max",
"border",
"not",
"as",
"error",
"but",
"will",
"lead",
"to",
"a",
"truncated",
"value",
"only"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/range/StringLength.php#L62-L73 |
225,063 | stubbles/stubbles-input | src/main/php/filter/range/StringLength.php | StringLength.truncateToMaxBorder | public function truncateToMaxBorder($value)
{
if ($this->allowsTruncate($value)) {
if ($value instanceof Secret) {
return $value->substring(0, $this->maxLength);
}
return substr($value, 0, $this->maxLength);
}
throw new \LogicException('T... | php | public function truncateToMaxBorder($value)
{
if ($this->allowsTruncate($value)) {
if ($value instanceof Secret) {
return $value->substring(0, $this->maxLength);
}
return substr($value, 0, $this->maxLength);
}
throw new \LogicException('T... | [
"public",
"function",
"truncateToMaxBorder",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"allowsTruncate",
"(",
"$",
"value",
")",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Secret",
")",
"{",
"return",
"$",
"value",
"->",
"substr... | truncates given value to max length
@param string $value
@return string|Secret
@throws \LogicException
@since 2.3.1 | [
"truncates",
"given",
"value",
"to",
"max",
"length"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/filter/range/StringLength.php#L140-L151 |
225,064 | SetBased/php-abc-form | src/Cleaner/MaxLengthCleaner.php | MaxLengthCleaner.clean | public function clean($value)
{
if ($value==='' || $value===null || $value===false)
{
return null;
}
$tmp = PruneWhitespaceCleaner::get()->clean($value);
if ($tmp==='' || $tmp===null)
{
return null;
}
return mb_substr($tmp, 0, $this->maxLength);
} | php | public function clean($value)
{
if ($value==='' || $value===null || $value===false)
{
return null;
}
$tmp = PruneWhitespaceCleaner::get()->clean($value);
if ($tmp==='' || $tmp===null)
{
return null;
}
return mb_substr($tmp, 0, $this->maxLength);
} | [
"public",
"function",
"clean",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"===",
"false",
")",
"{",
"return",
"null",
";",
"}",
"$",
"tmp",
"=",
"PruneWhitespaceCleaner",
... | Returns a submitted value with leading and training whitespace removed.
@param string|null $value The submitted value.
@return string|null
@since 1.0.0
@api | [
"Returns",
"a",
"submitted",
"value",
"with",
"leading",
"and",
"training",
"whitespace",
"removed",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Cleaner/MaxLengthCleaner.php#L44-L58 |
225,065 | matteosister/CompassElephant | src/CompassElephant/CompassProject.php | CompassProject.compile | public function compile($force = false)
{
$this->commandCaller->compile($this->configFile, $force, $this->target);
} | php | public function compile($force = false)
{
$this->commandCaller->compile($this->configFile, $force, $this->target);
} | [
"public",
"function",
"compile",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"commandCaller",
"->",
"compile",
"(",
"$",
"this",
"->",
"configFile",
",",
"$",
"force",
",",
"$",
"this",
"->",
"target",
")",
";",
"}"
] | Compile the project
@param bool $force | [
"Compile",
"the",
"project"
] | 5d2dacca5e33405872219ea5b6297e8aed964cf3 | https://github.com/matteosister/CompassElephant/blob/5d2dacca5e33405872219ea5b6297e8aed964cf3/src/CompassElephant/CompassProject.php#L131-L134 |
225,066 | AeonDigital/PHP-Stream | src/Stream.php | Stream.close | public function close() : void
{
if ($this->stream !== null) {
if ($this->isPipe === true) {
// @codeCoverageIgnoreStart
pclose($this->stream);
// @codeCoverageIgnoreEnd
} else {
fclose($this->stream);
}
... | php | public function close() : void
{
if ($this->stream !== null) {
if ($this->isPipe === true) {
// @codeCoverageIgnoreStart
pclose($this->stream);
// @codeCoverageIgnoreEnd
} else {
fclose($this->stream);
}
... | [
"public",
"function",
"close",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"stream",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isPipe",
"===",
"true",
")",
"{",
"// @codeCoverageIgnoreStart",
"pclose",
"(",
"$",
"this",
"-... | Encerra o "Stream".
@return void | [
"Encerra",
"o",
"Stream",
"."
] | 2dc446bba1d0fa1c5552f6e44e4a7d17e443cee5 | https://github.com/AeonDigital/PHP-Stream/blob/2dc446bba1d0fa1c5552f6e44e4a7d17e443cee5/src/Stream.php#L538-L551 |
225,067 | Innmind/Filesystem | src/Directory/Directory.php | Directory.loadDirectory | private function loadDirectory()
{
if ($this->generator === null) {
return;
}
foreach ($this->generator as $file) {
$this->files = $this->files->put(
(string) $file->name(),
$file
);
}
$this->generator = nu... | php | private function loadDirectory()
{
if ($this->generator === null) {
return;
}
foreach ($this->generator as $file) {
$this->files = $this->files->put(
(string) $file->name(),
$file
);
}
$this->generator = nu... | [
"private",
"function",
"loadDirectory",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"generator",
"===",
"null",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"generator",
"as",
"$",
"file",
")",
"{",
"$",
"this",
"->",
"files",
... | Load all files of the directory
@return void | [
"Load",
"all",
"files",
"of",
"the",
"directory"
] | 21700d8424bc88e99fd5c612c5316613e4c45a3b | https://github.com/Innmind/Filesystem/blob/21700d8424bc88e99fd5c612c5316613e4c45a3b/src/Directory/Directory.php#L227-L241 |
225,068 | jeffreyguo/SS-Behat-quicksetup | src/SilverStripe/BehatExtension/Context/ClassGuesser/ModuleContextClassGuesser.php | ModuleContextClassGuesser.guess | public function guess()
{
// Try fully qualified namespace
if (class_exists($class = $this->namespaceBase.'\\'.$this->namespaceSuffix.'\\'.$this->contextClass)) {
return $class;
}
// Fall back to namespace with SilverStripe prefix
// TODO Remove once core has nam... | php | public function guess()
{
// Try fully qualified namespace
if (class_exists($class = $this->namespaceBase.'\\'.$this->namespaceSuffix.'\\'.$this->contextClass)) {
return $class;
}
// Fall back to namespace with SilverStripe prefix
// TODO Remove once core has nam... | [
"public",
"function",
"guess",
"(",
")",
"{",
"// Try fully qualified namespace",
"if",
"(",
"class_exists",
"(",
"$",
"class",
"=",
"$",
"this",
"->",
"namespaceBase",
".",
"'\\\\'",
".",
"$",
"this",
"->",
"namespaceSuffix",
".",
"'\\\\'",
".",
"$",
"this"... | Tries to guess context classname.
@return string | [
"Tries",
"to",
"guess",
"context",
"classname",
"."
] | a5172f3a94dc2b364df5c2758a8a1df4f026168e | https://github.com/jeffreyguo/SS-Behat-quicksetup/blob/a5172f3a94dc2b364df5c2758a8a1df4f026168e/src/SilverStripe/BehatExtension/Context/ClassGuesser/ModuleContextClassGuesser.php#L44-L55 |
225,069 | SetBased/php-abc-form | src/Validator/MandatoryValidator.php | MandatoryValidator.validate | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
if ($value==='' || $value===null || $value===false)
{
return false;
}
if (is_array($value))
{
return $this->validateArray($value);
}
return true;
} | php | public function validate(Control $control): bool
{
$value = $control->getSubmittedValue();
if ($value==='' || $value===null || $value===false)
{
return false;
}
if (is_array($value))
{
return $this->validateArray($value);
}
return true;
} | [
"public",
"function",
"validate",
"(",
"Control",
"$",
"control",
")",
":",
"bool",
"{",
"$",
"value",
"=",
"$",
"control",
"->",
"getSubmittedValue",
"(",
")",
";",
"if",
"(",
"$",
"value",
"===",
"''",
"||",
"$",
"value",
"===",
"null",
"||",
"$",
... | Returns true if the form control has a value.
Note:
* Empty values are considered invalid.
* If the form control is a complex form control all child form control must have a value.
@param Control $control The form control.
@return bool
@since 1.0.0
@api | [
"Returns",
"true",
"if",
"the",
"form",
"control",
"has",
"a",
"value",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/MandatoryValidator.php#L28-L43 |
225,070 | SetBased/php-abc-form | src/Validator/MandatoryValidator.php | MandatoryValidator.validateArray | private function validateArray(array $array): bool
{
foreach ($array as $element)
{
if (is_array($element))
{
$tmp = $this->validateArray($element);
if ($tmp===true)
{
return true;
}
}
else
{
if ($element!==null && $element!==fals... | php | private function validateArray(array $array): bool
{
foreach ($array as $element)
{
if (is_array($element))
{
$tmp = $this->validateArray($element);
if ($tmp===true)
{
return true;
}
}
else
{
if ($element!==null && $element!==fals... | [
"private",
"function",
"validateArray",
"(",
"array",
"$",
"array",
")",
":",
"bool",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"element",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"element",
")",
")",
"{",
"$",
"tmp",
"=",
"$",
"this",
"->",
... | Validates recursively if one of the leaves has a value.
@param array $array
@return bool | [
"Validates",
"recursively",
"if",
"one",
"of",
"the",
"leaves",
"has",
"a",
"value",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Validator/MandatoryValidator.php#L53-L75 |
225,071 | stubbles/stubbles-input | src/main/php/errors/ParamErrors.php | ParamErrors.append | public function append(string $paramName, $error, array $details = []): ParamError
{
$error = ParamError::fromData($error, $details);
if (!isset($this->errors[$paramName])) {
$this->errors[$paramName] = [$error->id() => $error];
} else {
$this->errors[$paramName... | php | public function append(string $paramName, $error, array $details = []): ParamError
{
$error = ParamError::fromData($error, $details);
if (!isset($this->errors[$paramName])) {
$this->errors[$paramName] = [$error->id() => $error];
} else {
$this->errors[$paramName... | [
"public",
"function",
"append",
"(",
"string",
"$",
"paramName",
",",
"$",
"error",
",",
"array",
"$",
"details",
"=",
"[",
"]",
")",
":",
"ParamError",
"{",
"$",
"error",
"=",
"ParamError",
"::",
"fromData",
"(",
"$",
"error",
",",
"$",
"details",
"... | appends an error to the list of errors for given param name
@param string $paramName name of parameter to add error for
@param \stubbles\input\errors\ParamError|string $error id of error or an instance of ParamError
@param array $detai... | [
"appends",
"an",
"error",
"to",
"the",
"list",
"of",
"errors",
"for",
"given",
"param",
"name"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamErrors.php#L35-L45 |
225,072 | stubbles/stubbles-input | src/main/php/errors/ParamErrors.php | ParamErrors.existForWithId | public function existForWithId(string $paramName, string $errorId): bool
{
return (isset($this->errors[$paramName]) && isset($this->errors[$paramName][$errorId]));
} | php | public function existForWithId(string $paramName, string $errorId): bool
{
return (isset($this->errors[$paramName]) && isset($this->errors[$paramName][$errorId]));
} | [
"public",
"function",
"existForWithId",
"(",
"string",
"$",
"paramName",
",",
"string",
"$",
"errorId",
")",
":",
"bool",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"errors",
"[",
"$",
"paramName",
"]",
")",
"&&",
"isset",
"(",
"$",
"this",
... | checks whether a param has a specific error
@api
@param string $paramName name of parameter
@param string $errorId id of error
@return bool | [
"checks",
"whether",
"a",
"param",
"has",
"a",
"specific",
"error"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamErrors.php#L88-L91 |
225,073 | stubbles/stubbles-input | src/main/php/errors/ParamErrors.php | ParamErrors.getFor | public function getFor(string $paramName): array
{
if (isset($this->errors[$paramName])) {
return $this->errors[$paramName];
}
return [];
} | php | public function getFor(string $paramName): array
{
if (isset($this->errors[$paramName])) {
return $this->errors[$paramName];
}
return [];
} | [
"public",
"function",
"getFor",
"(",
"string",
"$",
"paramName",
")",
":",
"array",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"errors",
"[",
"$",
"paramName",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"errors",
"[",
"$",
"paramName",
... | returns a list of errors for given param
@param string $paramName
@return \stubbles\input\errors\ParamError[] | [
"returns",
"a",
"list",
"of",
"errors",
"for",
"given",
"param"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamErrors.php#L99-L106 |
225,074 | stubbles/stubbles-input | src/main/php/errors/ParamErrors.php | ParamErrors.getForWithId | public function getForWithId(string $paramName, string $errorId)
{
if (isset($this->errors[$paramName]) && isset($this->errors[$paramName][$errorId])) {
return $this->errors[$paramName][$errorId];
}
return null;
} | php | public function getForWithId(string $paramName, string $errorId)
{
if (isset($this->errors[$paramName]) && isset($this->errors[$paramName][$errorId])) {
return $this->errors[$paramName][$errorId];
}
return null;
} | [
"public",
"function",
"getForWithId",
"(",
"string",
"$",
"paramName",
",",
"string",
"$",
"errorId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"errors",
"[",
"$",
"paramName",
"]",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"errors",
"[... | returns the error for given param and error id
@param string $paramName name of param
@param string $errorId id of error
@return \stubbles\input\errors\ParamError|null | [
"returns",
"the",
"error",
"for",
"given",
"param",
"and",
"error",
"id"
] | 1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e | https://github.com/stubbles/stubbles-input/blob/1ce0ebe5ba392faf3cc369a95e3fe0fa38912b1e/src/main/php/errors/ParamErrors.php#L115-L122 |
225,075 | Erebot/API | src/Module/Base.php | Base.normalizeInterface | private static function normalizeInterface($iface)
{
if (!is_string($iface)) {
throw new \Erebot\InvalidValueException('Not an interface name');
}
$ifaceName = str_replace('!', '\\Erebot\\Interfaces\\', $iface);
if (interface_exists($ifaceName, true)) {
retur... | php | private static function normalizeInterface($iface)
{
if (!is_string($iface)) {
throw new \Erebot\InvalidValueException('Not an interface name');
}
$ifaceName = str_replace('!', '\\Erebot\\Interfaces\\', $iface);
if (interface_exists($ifaceName, true)) {
retur... | [
"private",
"static",
"function",
"normalizeInterface",
"(",
"$",
"iface",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"iface",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"InvalidValueException",
"(",
"'Not an interface name'",
")",
";",
"}",
... | Normalize the name of a tentative interface.
\param string $iface
Name of the interface to normalize.
\retval string
Normalized name for the interface. | [
"Normalize",
"the",
"name",
"of",
"a",
"tentative",
"interface",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L229-L245 |
225,076 | Erebot/API | src/Module/Base.php | Base.setFactory | public function setFactory($iface, $cls)
{
$ifaceName = self::normalizeInterface($iface);
if (!class_exists($cls, true)) {
throw new \Erebot\InvalidValueException('No such class ('.$cls.')');
}
$reflector = new \ReflectionClass($cls);
if (!$reflector->isSubclass... | php | public function setFactory($iface, $cls)
{
$ifaceName = self::normalizeInterface($iface);
if (!class_exists($cls, true)) {
throw new \Erebot\InvalidValueException('No such class ('.$cls.')');
}
$reflector = new \ReflectionClass($cls);
if (!$reflector->isSubclass... | [
"public",
"function",
"setFactory",
"(",
"$",
"iface",
",",
"$",
"cls",
")",
"{",
"$",
"ifaceName",
"=",
"self",
"::",
"normalizeInterface",
"(",
"$",
"iface",
")",
";",
"if",
"(",
"!",
"class_exists",
"(",
"$",
"cls",
",",
"true",
")",
")",
"{",
"... | Set the factory for the given interface.
\param string $iface
Name of the interface to act upon.
\param string $cls
Name of the class that acts as
a factory for that interface.
If must implement that interface.
\note
As a special shortcut, an exclamation
point (!) in the interface's name will
automatically be replac... | [
"Set",
"the",
"factory",
"for",
"the",
"given",
"interface",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L264-L279 |
225,077 | Erebot/API | src/Module/Base.php | Base.getFactory | public function getFactory($iface)
{
$ifaceName = self::normalizeInterface($iface);
if (!isset($this->factories[$ifaceName])) {
throw new \Erebot\InvalidValueException('No such interface ('.$iface.')');
}
return $this->factories[$ifaceName];
} | php | public function getFactory($iface)
{
$ifaceName = self::normalizeInterface($iface);
if (!isset($this->factories[$ifaceName])) {
throw new \Erebot\InvalidValueException('No such interface ('.$iface.')');
}
return $this->factories[$ifaceName];
} | [
"public",
"function",
"getFactory",
"(",
"$",
"iface",
")",
"{",
"$",
"ifaceName",
"=",
"self",
"::",
"normalizeInterface",
"(",
"$",
"iface",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"factories",
"[",
"$",
"ifaceName",
"]",
")",
")... | Return the name of the class to use
to create instances with the given
interface.
\param string $iface
Name of the interface for which
the factory must be returned.
\retval string
Name of the class that acts as
a factory for that interface.
\note
As a special shortcut, an exclamation
point (!) in the interface's nam... | [
"Return",
"the",
"name",
"of",
"the",
"class",
"to",
"use",
"to",
"create",
"instances",
"with",
"the",
"given",
"interface",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L300-L307 |
225,078 | Erebot/API | src/Module/Base.php | Base.ctcpQuote | protected static function ctcpQuote($message)
{
// First comes low-level quoting.
$quoting = array(
"\000" => "\0200",
"\n" => "\020n",
"\r" => "\020r",
"\020" => "\020\020",
);
$message = strtr($message, $quoting);
// ... | php | protected static function ctcpQuote($message)
{
// First comes low-level quoting.
$quoting = array(
"\000" => "\0200",
"\n" => "\020n",
"\r" => "\020r",
"\020" => "\020\020",
);
$message = strtr($message, $quoting);
// ... | [
"protected",
"static",
"function",
"ctcpQuote",
"(",
"$",
"message",
")",
"{",
"// First comes low-level quoting.",
"$",
"quoting",
"=",
"array",
"(",
"\"\\000\"",
"=>",
"\"\\0200\"",
",",
"\"\\n\"",
"=>",
"\"\\020n\"",
",",
"\"\\r\"",
"=>",
"\"\\020r\"",
",",
"... | Quotes a CTCP message.
\param string $message
Message to quote.
\retval string
Quoted version of the message.
\see
http://www.irchelp.org/irchelp/rfc/ctcpspec.html
describes the quoting algorithm used. | [
"Quotes",
"a",
"CTCP",
"message",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L426-L444 |
225,079 | Erebot/API | src/Module/Base.php | Base.sendCommand | protected function sendCommand($command)
{
if (!\Erebot\Utils::stringifiable($command)) {
throw new \Exception('Invalid command (not a string)');
}
$this->connection->getIO()->push((string) $command);
} | php | protected function sendCommand($command)
{
if (!\Erebot\Utils::stringifiable($command)) {
throw new \Exception('Invalid command (not a string)');
}
$this->connection->getIO()->push((string) $command);
} | [
"protected",
"function",
"sendCommand",
"(",
"$",
"command",
")",
"{",
"if",
"(",
"!",
"\\",
"Erebot",
"\\",
"Utils",
"::",
"stringifiable",
"(",
"$",
"command",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'Invalid command (not a string)'",
")",
... | Send a raw command to the IRC server.
\param string $command
The command to send. | [
"Send",
"a",
"raw",
"command",
"to",
"the",
"IRC",
"server",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L452-L458 |
225,080 | Erebot/API | src/Module/Base.php | Base.addTimer | protected function addTimer(\Erebot\TimerInterface $timer)
{
$bot = $this->connection->getBot();
return $bot->addTimer($timer);
} | php | protected function addTimer(\Erebot\TimerInterface $timer)
{
$bot = $this->connection->getBot();
return $bot->addTimer($timer);
} | [
"protected",
"function",
"addTimer",
"(",
"\\",
"Erebot",
"\\",
"TimerInterface",
"$",
"timer",
")",
"{",
"$",
"bot",
"=",
"$",
"this",
"->",
"connection",
"->",
"getBot",
"(",
")",
";",
"return",
"$",
"bot",
"->",
"addTimer",
"(",
"$",
"timer",
")",
... | Register a timer.
\param Erebot::TimerInterface $timer
The timer to register.
\note
This method is only a shortcut for
Erebot::Interfaces::Core::addTimer(). | [
"Register",
"a",
"timer",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L470-L474 |
225,081 | Erebot/API | src/Module/Base.php | Base.removeTimer | protected function removeTimer(\Erebot\TimerInterface $timer)
{
$bot = $this->connection->getBot();
return $bot->removeTimer($timer);
} | php | protected function removeTimer(\Erebot\TimerInterface $timer)
{
$bot = $this->connection->getBot();
return $bot->removeTimer($timer);
} | [
"protected",
"function",
"removeTimer",
"(",
"\\",
"Erebot",
"\\",
"TimerInterface",
"$",
"timer",
")",
"{",
"$",
"bot",
"=",
"$",
"this",
"->",
"connection",
"->",
"getBot",
"(",
")",
";",
"return",
"$",
"bot",
"->",
"removeTimer",
"(",
"$",
"timer",
... | Unregister a timer.
\param Erebot::TimerInterface $timer
The timer to unregister.
\note
This method is only a shortcut for
Erebot::Interfaces::Core::removeTimer(). | [
"Unregister",
"a",
"timer",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L486-L490 |
225,082 | Erebot/API | src/Module/Base.php | Base.parseSomething | private function parseSomething($something, $param, $default)
{
$function = 'parse'.$something;
$bot = $this->connection->getBot();
if ($this->channel !== null) {
try {
$config = $this->connection->getConfig($this->channel);
return $config... | php | private function parseSomething($something, $param, $default)
{
$function = 'parse'.$something;
$bot = $this->connection->getBot();
if ($this->channel !== null) {
try {
$config = $this->connection->getConfig($this->channel);
return $config... | [
"private",
"function",
"parseSomething",
"(",
"$",
"something",
",",
"$",
"param",
",",
"$",
"default",
")",
"{",
"$",
"function",
"=",
"'parse'",
".",
"$",
"something",
";",
"$",
"bot",
"=",
"$",
"this",
"->",
"connection",
"->",
"getBot",
"(",
")",
... | \internal
Retrieves a parameter from the module's configuration
by recursively traversing the configuration hierarchy
and parses it using the appropriate function.
\param string $something
The type of parsing to apply to the parameter.
This is used to determine the correct parsing
method to call.
\param string $param... | [
"\\",
"internal",
"Retrieves",
"a",
"parameter",
"from",
"the",
"module",
"s",
"configuration",
"by",
"recursively",
"traversing",
"the",
"configuration",
"hierarchy",
"and",
"parses",
"it",
"using",
"the",
"appropriate",
"function",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L516-L530 |
225,083 | Erebot/API | src/Module/Base.php | Base.getFormatter | protected function getFormatter($chan)
{
$cls = $this->getFactory('!Styling');
if ($chan === false) {
return new $cls($this->translator);
} elseif ($chan !== null) {
$config = $this->connection->getConfig($chan);
try {
return new $cls($conf... | php | protected function getFormatter($chan)
{
$cls = $this->getFactory('!Styling');
if ($chan === false) {
return new $cls($this->translator);
} elseif ($chan !== null) {
$config = $this->connection->getConfig($chan);
try {
return new $cls($conf... | [
"protected",
"function",
"getFormatter",
"(",
"$",
"chan",
")",
"{",
"$",
"cls",
"=",
"$",
"this",
"->",
"getFactory",
"(",
"'!Styling'",
")",
";",
"if",
"(",
"$",
"chan",
"===",
"false",
")",
"{",
"return",
"new",
"$",
"cls",
"(",
"$",
"this",
"->... | Returns the appropriate formatter for the given channel.
\param null|false|string $chan
The channel for which a formatter must be returned.
If $chan is \b null, the hierarchy of configurations
is traversed to find the most appropriate formatter.
If $chan is \b false, a formatter is built using the
bot's main translato... | [
"Returns",
"the",
"appropriate",
"formatter",
"for",
"the",
"given",
"channel",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Module/Base.php#L665-L690 |
225,084 | SetBased/php-abc-form | src/Control/DateControl.php | DateControl.setOpenDate | public function setOpenDate(string $openDate): void
{
$this->cleaner->setOpenDate($openDate);
$this->formatter->setOpenDate($openDate);
} | php | public function setOpenDate(string $openDate): void
{
$this->cleaner->setOpenDate($openDate);
$this->formatter->setOpenDate($openDate);
} | [
"public",
"function",
"setOpenDate",
"(",
"string",
"$",
"openDate",
")",
":",
"void",
"{",
"$",
"this",
"->",
"cleaner",
"->",
"setOpenDate",
"(",
"$",
"openDate",
")",
";",
"$",
"this",
"->",
"formatter",
"->",
"setOpenDate",
"(",
"$",
"openDate",
")",... | Sets the open date. An empty submitted value will be replaced with the open date and an open date will be shown as
an empty field.
@param string $openDate The open date in YYYY-MM-DD format.
@since 1.0.0
@api | [
"Sets",
"the",
"open",
"date",
".",
"An",
"empty",
"submitted",
"value",
"will",
"be",
"replaced",
"with",
"the",
"open",
"date",
"and",
"an",
"open",
"date",
"will",
"be",
"shown",
"as",
"an",
"empty",
"field",
"."
] | a7343e2b7dda411f5f0fc7d64324bc9d021aa73e | https://github.com/SetBased/php-abc-form/blob/a7343e2b7dda411f5f0fc7d64324bc9d021aa73e/src/Control/DateControl.php#L60-L64 |
225,085 | spiral/translator | src/Catalogue/CatalogueManager.php | CatalogueManager.reset | public function reset()
{
$this->cache->setLocales(null);
foreach ($this->getLocales() as $locale) {
$this->cache->saveLocale($locale, null);
}
$this->locales = [];
$this->catalogues = [];
} | php | public function reset()
{
$this->cache->setLocales(null);
foreach ($this->getLocales() as $locale) {
$this->cache->saveLocale($locale, null);
}
$this->locales = [];
$this->catalogues = [];
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"setLocales",
"(",
"null",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getLocales",
"(",
")",
"as",
"$",
"locale",
")",
"{",
"$",
"this",
"->",
"cache",
"->",
"saveLo... | Reset all cached data and loaded locates. | [
"Reset",
"all",
"cached",
"data",
"and",
"loaded",
"locates",
"."
] | dde0f3d3db7960c22a36b9e781fe30ab51656424 | https://github.com/spiral/translator/blob/dde0f3d3db7960c22a36b9e781fe30ab51656424/src/Catalogue/CatalogueManager.php#L116-L125 |
225,086 | RevisionTen/cqrs | Services/EventBus.php | EventBus.publish | public function publish(array $events, CommandBus $commandBus, bool $qeueEvents = false): void
{
$eventStreamObjects = [];
/**
* @var EventInterface $event
*/
foreach ($events as $event) {
// Save the event to the event stream.
$eventStreamObject = n... | php | public function publish(array $events, CommandBus $commandBus, bool $qeueEvents = false): void
{
$eventStreamObjects = [];
/**
* @var EventInterface $event
*/
foreach ($events as $event) {
// Save the event to the event stream.
$eventStreamObject = n... | [
"public",
"function",
"publish",
"(",
"array",
"$",
"events",
",",
"CommandBus",
"$",
"commandBus",
",",
"bool",
"$",
"qeueEvents",
"=",
"false",
")",
":",
"void",
"{",
"$",
"eventStreamObjects",
"=",
"[",
"]",
";",
"/**\n * @var EventInterface $event\n ... | Dispatch all events to observing event handlers and save them to the Event Store.
@param array $events
@param CommandBus $commandBus
@param bool $qeueEvents | [
"Dispatch",
"all",
"events",
"to",
"observing",
"event",
"handlers",
"and",
"save",
"them",
"to",
"the",
"Event",
"Store",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/EventBus.php#L63-L128 |
225,087 | RevisionTen/cqrs | Services/EventBus.php | EventBus.publishQeued | public function publishQeued(array $eventQeueObjects): bool
{
$eventStreamObjects = array_map(function ($eventQeueObject) {
/* @var EventQeueObject $eventQeueObject */
return $eventQeueObject->getEventStreamObject();
}, $eventQeueObjects);
/**
* Add EventStr... | php | public function publishQeued(array $eventQeueObjects): bool
{
$eventStreamObjects = array_map(function ($eventQeueObject) {
/* @var EventQeueObject $eventQeueObject */
return $eventQeueObject->getEventStreamObject();
}, $eventQeueObjects);
/**
* Add EventStr... | [
"public",
"function",
"publishQeued",
"(",
"array",
"$",
"eventQeueObjects",
")",
":",
"bool",
"{",
"$",
"eventStreamObjects",
"=",
"array_map",
"(",
"function",
"(",
"$",
"eventQeueObject",
")",
"{",
"/* @var EventQeueObject $eventQeueObject */",
"return",
"$",
"ev... | Save qeued Events to the Event Stream.
@param EventQeueObject[] $eventQeueObjects
@return bool | [
"Save",
"qeued",
"Events",
"to",
"the",
"Event",
"Stream",
"."
] | d94fdd86855a994c4662e24a6c3c08ef586e64f9 | https://github.com/RevisionTen/cqrs/blob/d94fdd86855a994c4662e24a6c3c08ef586e64f9/Services/EventBus.php#L137-L196 |
225,088 | SetBased/php-abc-http-header | src/HttpHeader.php | HttpHeader.clearOutput | public static function clearOutput(): void
{
// Return immediately if skipClearOutput is set.
if (self::$skipClearOutput) return;
$level = ob_get_level();
// The following manual level counting is to deal with zlib.output_compression set to On.
for ($i = $level; $i>0; --$i)
{
if (!@ob_... | php | public static function clearOutput(): void
{
// Return immediately if skipClearOutput is set.
if (self::$skipClearOutput) return;
$level = ob_get_level();
// The following manual level counting is to deal with zlib.output_compression set to On.
for ($i = $level; $i>0; --$i)
{
if (!@ob_... | [
"public",
"static",
"function",
"clearOutput",
"(",
")",
":",
"void",
"{",
"// Return immediately if skipClearOutput is set.",
"if",
"(",
"self",
"::",
"$",
"skipClearOutput",
")",
"return",
";",
"$",
"level",
"=",
"ob_get_level",
"(",
")",
";",
"// The following ... | Removes all output echoed before calling this method.
@since 1.0.0
@api | [
"Removes",
"all",
"output",
"echoed",
"before",
"calling",
"this",
"method",
"."
] | da56077a27c7e06ea2c8301f7722610f814bc340 | https://github.com/SetBased/php-abc-http-header/blob/da56077a27c7e06ea2c8301f7722610f814bc340/src/HttpHeader.php#L151-L172 |
225,089 | SetBased/php-abc-http-header | src/HttpHeader.php | HttpHeader.error | private static function error(int $statusCode): void
{
self::clearOutput();
self::$status = $statusCode;
header('HTTP/1.1 '.$statusCode.' '.self::$httpStatuses[$statusCode]);
} | php | private static function error(int $statusCode): void
{
self::clearOutput();
self::$status = $statusCode;
header('HTTP/1.1 '.$statusCode.' '.self::$httpStatuses[$statusCode]);
} | [
"private",
"static",
"function",
"error",
"(",
"int",
"$",
"statusCode",
")",
":",
"void",
"{",
"self",
"::",
"clearOutput",
"(",
")",
";",
"self",
"::",
"$",
"status",
"=",
"$",
"statusCode",
";",
"header",
"(",
"'HTTP/1.1 '",
".",
"$",
"statusCode",
... | Sets the status code for the HTTP request to a client or server error.
The output buffer will be erased, see [ob_clean](http://php.net/manual/function.ob-clean.php).
@param int $statusCode The HTTP status code, must be a 4xx (client error) or 5xx (server error) status code. See
<http://www.w3.org/Protocols/rfc2616/rf... | [
"Sets",
"the",
"status",
"code",
"for",
"the",
"HTTP",
"request",
"to",
"a",
"client",
"or",
"server",
"error",
"."
] | da56077a27c7e06ea2c8301f7722610f814bc340 | https://github.com/SetBased/php-abc-http-header/blob/da56077a27c7e06ea2c8301f7722610f814bc340/src/HttpHeader.php#L268-L274 |
225,090 | SetBased/php-abc-http-header | src/HttpHeader.php | HttpHeader.redirect | private static function redirect(string $url, bool $forceRelative, int $statusCode): void
{
if ($forceRelative && !Url::isRelative($url))
{
$url = '/';
}
self::clearOutput();
self::$status = $statusCode;
header('HTTP/1.1 '.$statusCode.' '.self::$httpStatuses[$statusCode]);
header('... | php | private static function redirect(string $url, bool $forceRelative, int $statusCode): void
{
if ($forceRelative && !Url::isRelative($url))
{
$url = '/';
}
self::clearOutput();
self::$status = $statusCode;
header('HTTP/1.1 '.$statusCode.' '.self::$httpStatuses[$statusCode]);
header('... | [
"private",
"static",
"function",
"redirect",
"(",
"string",
"$",
"url",
",",
"bool",
"$",
"forceRelative",
",",
"int",
"$",
"statusCode",
")",
":",
"void",
"{",
"if",
"(",
"$",
"forceRelative",
"&&",
"!",
"Url",
"::",
"isRelative",
"(",
"$",
"url",
")"... | Redirects the user agent to a specified URL.
The output buffer will be erased, see [ob_clean](http://php.net/manual/function.ob-clean.php).
This method will protect against unvalidated redirects, see
<https://www.owasp.org/index.php/Unvalidated_Redirects_and_Forwards_Cheat_Sheet>.
@param string $url The UR... | [
"Redirects",
"the",
"user",
"agent",
"to",
"a",
"specified",
"URL",
"."
] | da56077a27c7e06ea2c8301f7722610f814bc340 | https://github.com/SetBased/php-abc-http-header/blob/da56077a27c7e06ea2c8301f7722610f814bc340/src/HttpHeader.php#L292-L304 |
225,091 | bytic/Common | src/Records/Media/Files/Model.php | Model.upload | public function upload($uploadedFile)
{
if ($uploadedFile->isValid()) {
$this->getFilesystem()->putFileAs(
dirname($this->getPath()),
$uploadedFile,
$this->getName()
);
return true;
} else {
$this->error... | php | public function upload($uploadedFile)
{
if ($uploadedFile->isValid()) {
$this->getFilesystem()->putFileAs(
dirname($this->getPath()),
$uploadedFile,
$this->getName()
);
return true;
} else {
$this->error... | [
"public",
"function",
"upload",
"(",
"$",
"uploadedFile",
")",
"{",
"if",
"(",
"$",
"uploadedFile",
"->",
"isValid",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getFilesystem",
"(",
")",
"->",
"putFileAs",
"(",
"dirname",
"(",
"$",
"this",
"->",
"getPath",... | Upload file from http
@param UploadedFile $uploadedFile
@return bool | [
"Upload",
"file",
"from",
"http"
] | 5d17043e03a2274a758fba1f6dedb7d85195bcfb | https://github.com/bytic/Common/blob/5d17043e03a2274a758fba1f6dedb7d85195bcfb/src/Records/Media/Files/Model.php#L45-L60 |
225,092 | n2n/n2n-log4php | src/app/n2n/log4php/configuration/adapter/AdapterXML.php | AdapterXML.loadXML | private function loadXML($url) {
if (!file_exists($url)) {
throw new \n2n\log4php\LoggerException("File [$url] does not exist.");
}
libxml_clear_errors();
$oldValue = libxml_use_internal_errors(true);
// Load XML
$xml = @simplexml_load_file($url);
if ($xml === false) {
$errorStr ... | php | private function loadXML($url) {
if (!file_exists($url)) {
throw new \n2n\log4php\LoggerException("File [$url] does not exist.");
}
libxml_clear_errors();
$oldValue = libxml_use_internal_errors(true);
// Load XML
$xml = @simplexml_load_file($url);
if ($xml === false) {
$errorStr ... | [
"private",
"function",
"loadXML",
"(",
"$",
"url",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"url",
")",
")",
"{",
"throw",
"new",
"\\",
"n2n",
"\\",
"log4php",
"\\",
"LoggerException",
"(",
"\"File [$url] does not exist.\"",
")",
";",
"}",
"lib... | Loads and validates the XML.
@param string $url Input XML. | [
"Loads",
"and",
"validates",
"the",
"XML",
"."
] | 1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2 | https://github.com/n2n/n2n-log4php/blob/1e6fff4c2785acdb8c2e0c3d5451cbb7e1b51fc2/src/app/n2n/log4php/configuration/adapter/AdapterXML.php#L79-L103 |
225,093 | WyriHaximus/reactphp-inspector-event-loop | src/LoopDecorator.php | LoopDecorator.removeReadStream | public function removeReadStream($stream)
{
$key = (int) $stream;
if (isset($this->streamsRead[$key])) {
unset($this->streamsRead[$key]);
}
if (isset($this->streamsDuplex[$key]) && !isset($this->streamsWrite[$key])) {
unset($this->streamsDuplex[$key]);
... | php | public function removeReadStream($stream)
{
$key = (int) $stream;
if (isset($this->streamsRead[$key])) {
unset($this->streamsRead[$key]);
}
if (isset($this->streamsDuplex[$key]) && !isset($this->streamsWrite[$key])) {
unset($this->streamsDuplex[$key]);
... | [
"public",
"function",
"removeReadStream",
"(",
"$",
"stream",
")",
"{",
"$",
"key",
"=",
"(",
"int",
")",
"$",
"stream",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"streamsRead",
"[",
"$",
"key",
"]",
")",
")",
"{",
"unset",
"(",
"$",
"this... | Remove the read event listener for the given stream.
@param stream $stream The PHP stream resource. | [
"Remove",
"the",
"read",
"event",
"listener",
"for",
"the",
"given",
"stream",
"."
] | e826a11ef787e71af68f0da0e660f8a07c0f49d5 | https://github.com/WyriHaximus/reactphp-inspector-event-loop/blob/e826a11ef787e71af68f0da0e660f8a07c0f49d5/src/LoopDecorator.php#L116-L131 |
225,094 | cmsgears/module-cart | common/models/resources/OrderItem.php | OrderItem.findByParentCartId | public static function findByParentCartId( $parentId, $parentType, $orderId ) {
return self::find()->where( 'parentId=:pid AND parentType=:ptype AND orderId=:oid', [ ':pid' => $parentId, ':ptype' => $parentType, ':oid' => $orderId ] )->one();
} | php | public static function findByParentCartId( $parentId, $parentType, $orderId ) {
return self::find()->where( 'parentId=:pid AND parentType=:ptype AND orderId=:oid', [ ':pid' => $parentId, ':ptype' => $parentType, ':oid' => $orderId ] )->one();
} | [
"public",
"static",
"function",
"findByParentCartId",
"(",
"$",
"parentId",
",",
"$",
"parentType",
",",
"$",
"orderId",
")",
"{",
"return",
"self",
"::",
"find",
"(",
")",
"->",
"where",
"(",
"'parentId=:pid AND parentType=:ptype AND orderId=:oid'",
",",
"[",
"... | Return the order item associated with given parent id, parent type and order id.
@param integer $parentId
@param string $parentType
@param integer $orderId
@return OrderItem | [
"Return",
"the",
"order",
"item",
"associated",
"with",
"given",
"parent",
"id",
"parent",
"type",
"and",
"order",
"id",
"."
] | 7c44fe1f652783e3baa58b07f2eb840f53dc5d95 | https://github.com/cmsgears/module-cart/blob/7c44fe1f652783e3baa58b07f2eb840f53dc5d95/common/models/resources/OrderItem.php#L363-L366 |
225,095 | korchasa/telegram-php | src/Unstructured.php | Unstructured.get | protected function get($object_or_array, $key, $default = null)
{
if (is_array($object_or_array)) {
if (is_null($key)) {
return $object_or_array;
}
if (isset($object_or_array[$key])) {
return $object_or_array[$key];
}
... | php | protected function get($object_or_array, $key, $default = null)
{
if (is_array($object_or_array)) {
if (is_null($key)) {
return $object_or_array;
}
if (isset($object_or_array[$key])) {
return $object_or_array[$key];
}
... | [
"protected",
"function",
"get",
"(",
"$",
"object_or_array",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"object_or_array",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"retu... | Get an item from an object or array using "dot" notation.
@param object|array $object_or_array
@param string $key
@param mixed $default
@return mixed | [
"Get",
"an",
"item",
"from",
"an",
"object",
"or",
"array",
"using",
"dot",
"notation",
"."
] | 96df8089c4a68a35a7e82da79f087e6c2ca92316 | https://github.com/korchasa/telegram-php/blob/96df8089c4a68a35a7e82da79f087e6c2ca92316/src/Unstructured.php#L33-L68 |
225,096 | SetBased/php-abc-table-detail | src/TableRow/Ipv4TableRow.php | Ipv4TableRow.addRow | public static function addRow(DetailTable $table, $header, ?string $ip4Address): void
{
if ($ip4Address!==null && $ip4Address!=='')
{
$table->addRow($header, ['class' => 'ipv4'], $ip4Address);
}
else
{
$table->addRow($header);
}
} | php | public static function addRow(DetailTable $table, $header, ?string $ip4Address): void
{
if ($ip4Address!==null && $ip4Address!=='')
{
$table->addRow($header, ['class' => 'ipv4'], $ip4Address);
}
else
{
$table->addRow($header);
}
} | [
"public",
"static",
"function",
"addRow",
"(",
"DetailTable",
"$",
"table",
",",
"$",
"header",
",",
"?",
"string",
"$",
"ip4Address",
")",
":",
"void",
"{",
"if",
"(",
"$",
"ip4Address",
"!==",
"null",
"&&",
"$",
"ip4Address",
"!==",
"''",
")",
"{",
... | Adds a row with a IPv4 value to a detail table.
@param DetailTable $table The detail table.
@param string|int|null $header The header text of this table row.
@param string|null $ip4Address The IPv4 address. | [
"Adds",
"a",
"row",
"with",
"a",
"IPv4",
"value",
"to",
"a",
"detail",
"table",
"."
] | 1f786174ccb10800f9c07bfd497b0ab35940a8ea | https://github.com/SetBased/php-abc-table-detail/blob/1f786174ccb10800f9c07bfd497b0ab35940a8ea/src/TableRow/Ipv4TableRow.php#L20-L30 |
225,097 | 975L/PaymentBundle | Twig/PaymentLink.php | PaymentLink.paymentLink | public function paymentLink(Environment $environment, $text = null, $amount = null, $currency = null)
{
return $environment->render('@c975LPayment/fragments/paymentLink.html.twig', array(
'text' => $text,
'amount' => $amount,
'currency' => strtolower($currency... | php | public function paymentLink(Environment $environment, $text = null, $amount = null, $currency = null)
{
return $environment->render('@c975LPayment/fragments/paymentLink.html.twig', array(
'text' => $text,
'amount' => $amount,
'currency' => strtolower($currency... | [
"public",
"function",
"paymentLink",
"(",
"Environment",
"$",
"environment",
",",
"$",
"text",
"=",
"null",
",",
"$",
"amount",
"=",
"null",
",",
"$",
"currency",
"=",
"null",
")",
"{",
"return",
"$",
"environment",
"->",
"render",
"(",
"'@c975LPayment/fra... | Returns xhtml code for Payment link
@return string | [
"Returns",
"xhtml",
"code",
"for",
"Payment",
"link"
] | da3beb13842aea6a3dc278eeb565f519040995b7 | https://github.com/975L/PaymentBundle/blob/da3beb13842aea6a3dc278eeb565f519040995b7/Twig/PaymentLink.php#L41-L48 |
225,098 | SlayerBirden/dataflow | src/Pipe/Copy.php | Copy.pass | public function pass(DataBagInterface $dataBag): DataBagInterface
{
$from = $dataBag[$this->from] ?? null;
$dataBag[$this->to] = $from;
return $dataBag;
} | php | public function pass(DataBagInterface $dataBag): DataBagInterface
{
$from = $dataBag[$this->from] ?? null;
$dataBag[$this->to] = $from;
return $dataBag;
} | [
"public",
"function",
"pass",
"(",
"DataBagInterface",
"$",
"dataBag",
")",
":",
"DataBagInterface",
"{",
"$",
"from",
"=",
"$",
"dataBag",
"[",
"$",
"this",
"->",
"from",
"]",
"??",
"null",
";",
"$",
"dataBag",
"[",
"$",
"this",
"->",
"to",
"]",
"="... | Copy data from one key to another. Create if doesn't exist.
@param DataBagInterface $dataBag
@return DataBagInterface | [
"Copy",
"data",
"from",
"one",
"key",
"to",
"another",
".",
"Create",
"if",
"doesn",
"t",
"exist",
"."
] | a9cb826b106e882e43523d39fea319adc4893e00 | https://github.com/SlayerBirden/dataflow/blob/a9cb826b106e882e43523d39fea319adc4893e00/src/Pipe/Copy.php#L39-L45 |
225,099 | Erebot/API | src/Event/Match/TextAbstract.php | TextAbstract.setPattern | public function setPattern($pattern)
{
if (!\Erebot\Utils::stringifiable($pattern)) {
throw new \Erebot\InvalidValueException('Pattern must be a string');
}
$this->pattern = $pattern;
} | php | public function setPattern($pattern)
{
if (!\Erebot\Utils::stringifiable($pattern)) {
throw new \Erebot\InvalidValueException('Pattern must be a string');
}
$this->pattern = $pattern;
} | [
"public",
"function",
"setPattern",
"(",
"$",
"pattern",
")",
"{",
"if",
"(",
"!",
"\\",
"Erebot",
"\\",
"Utils",
"::",
"stringifiable",
"(",
"$",
"pattern",
")",
")",
"{",
"throw",
"new",
"\\",
"Erebot",
"\\",
"InvalidValueException",
"(",
"'Pattern must ... | Sets the pattern associated with this filter.
\param string $pattern
Pattern to use in text comparisons.
\throw Erebot::InvalidValueException
The given value for $pattern is invalid. | [
"Sets",
"the",
"pattern",
"associated",
"with",
"this",
"filter",
"."
] | 0bff8d2048ace141aca0a536b931cf9a0186e1e3 | https://github.com/Erebot/API/blob/0bff8d2048ace141aca0a536b931cf9a0186e1e3/src/Event/Match/TextAbstract.php#L78-L85 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.