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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
239,700 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.checkLessonsMigrationState | protected function checkLessonsMigrationState()
{
$this->output->info('# Checkin lessons migration state... #');
switch ($this->checkLessonMigrationStats()) {
case 0:
return true;
case 1:
$this->output->error(' Migration stats does not match!'... | php | protected function checkLessonsMigrationState()
{
$this->output->info('# Checkin lessons migration state... #');
switch ($this->checkLessonMigrationStats()) {
case 0:
return true;
case 1:
$this->output->error(' Migration stats does not match!'... | [
"protected",
"function",
"checkLessonsMigrationState",
"(",
")",
"{",
"$",
"this",
"->",
"output",
"->",
"info",
"(",
"'# Checkin lessons migration state... #'",
")",
";",
"switch",
"(",
"$",
"this",
"->",
"checkLessonMigrationStats",
"(",
")",
")",
"{",
"case",
... | Check state of lessons migration.
@return bool | [
"Check",
"state",
"of",
"lessons",
"migration",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L911-L939 |
239,701 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.checkLessonMigrationStats | protected function checkLessonMigrationStats()
{
$numberOfOriginalLessons = Lesson::activeOn($this->period)->count();
$numberOfTrackedLessons = LessonMigration::all()->count();
$numberOfMigratedLessons = ScoolLesson::all()->count();
$this->output->info(' Original lessons: ' . $number... | php | protected function checkLessonMigrationStats()
{
$numberOfOriginalLessons = Lesson::activeOn($this->period)->count();
$numberOfTrackedLessons = LessonMigration::all()->count();
$numberOfMigratedLessons = ScoolLesson::all()->count();
$this->output->info(' Original lessons: ' . $number... | [
"protected",
"function",
"checkLessonMigrationStats",
"(",
")",
"{",
"$",
"numberOfOriginalLessons",
"=",
"Lesson",
"::",
"activeOn",
"(",
"$",
"this",
"->",
"period",
")",
"->",
"count",
"(",
")",
";",
"$",
"numberOfTrackedLessons",
"=",
"LessonMigration",
"::"... | Check lesson migrations stats.
@return bool | [
"Check",
"lesson",
"migrations",
"stats",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L946-L959 |
239,702 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.enrollments | private function enrollments()
{
return $this->validateCollection(
Enrollment::activeOn(
AcademicPeriod::findOrFail($this->period)->shortname)
)->orderBy(
'enrollment_study_id',
'enrollment_course_id',
'enrollment_group_... | php | private function enrollments()
{
return $this->validateCollection(
Enrollment::activeOn(
AcademicPeriod::findOrFail($this->period)->shortname)
)->orderBy(
'enrollment_study_id',
'enrollment_course_id',
'enrollment_group_... | [
"private",
"function",
"enrollments",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"validateCollection",
"(",
"Enrollment",
"::",
"activeOn",
"(",
"AcademicPeriod",
"::",
"findOrFail",
"(",
"$",
"this",
"->",
"period",
")",
"->",
"shortname",
")",
")",
"->",
... | Obtain all ebre_escool_enrollments | [
"Obtain",
"all",
"ebre_escool_enrollments"
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L986-L995 |
239,703 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.migrateModule | public function migrateModule(StudyModuleAcademicPeriod $module)
{
try {
$this->setScoolModule(
$this->createModule($module)
);
} catch (\LogicException $le) {
$this->output->error($le->getMessage());
}
} | php | public function migrateModule(StudyModuleAcademicPeriod $module)
{
try {
$this->setScoolModule(
$this->createModule($module)
);
} catch (\LogicException $le) {
$this->output->error($le->getMessage());
}
} | [
"public",
"function",
"migrateModule",
"(",
"StudyModuleAcademicPeriod",
"$",
"module",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"setScoolModule",
"(",
"$",
"this",
"->",
"createModule",
"(",
"$",
"module",
")",
")",
";",
"}",
"catch",
"(",
"\\",
"LogicExc... | Migrate module.
@param StudyModuleAcademicPeriod $module | [
"Migrate",
"module",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1078-L1088 |
239,704 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.createCourse | protected function createCourse(Course $srcCourse)
{
$course = ScoolCourse::firstOrNew([
'name' => $srcCourse->name,
]);
$course->save();
$course->shortname = $srcCourse->shortname;
$course->description = $srcCourse->description;
return $course;
... | php | protected function createCourse(Course $srcCourse)
{
$course = ScoolCourse::firstOrNew([
'name' => $srcCourse->name,
]);
$course->save();
$course->shortname = $srcCourse->shortname;
$course->description = $srcCourse->description;
return $course;
... | [
"protected",
"function",
"createCourse",
"(",
"Course",
"$",
"srcCourse",
")",
"{",
"$",
"course",
"=",
"ScoolCourse",
"::",
"firstOrNew",
"(",
"[",
"'name'",
"=>",
"$",
"srcCourse",
"->",
"name",
",",
"]",
")",
";",
"$",
"course",
"->",
"save",
"(",
"... | Create scool course using ebre-escool course.
@param Course $srcCourse
@return mixed | [
"Create",
"scool",
"course",
"using",
"ebre",
"-",
"escool",
"course",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1147-L1157 |
239,705 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.createModule | protected function createModule(StudyModuleAcademicPeriod $studyModule)
{
$module = ScoolModule::firstOrNew([
'name' => $studyModule->name,
'study_id' => $this->getScoolStudy()->id
]);
if($studyModule->study_shortname != $this->getScoolStudy()->shortname) ... | php | protected function createModule(StudyModuleAcademicPeriod $studyModule)
{
$module = ScoolModule::firstOrNew([
'name' => $studyModule->name,
'study_id' => $this->getScoolStudy()->id
]);
if($studyModule->study_shortname != $this->getScoolStudy()->shortname) ... | [
"protected",
"function",
"createModule",
"(",
"StudyModuleAcademicPeriod",
"$",
"studyModule",
")",
"{",
"$",
"module",
"=",
"ScoolModule",
"::",
"firstOrNew",
"(",
"[",
"'name'",
"=>",
"$",
"studyModule",
"->",
"name",
",",
"'study_id'",
"=>",
"$",
"this",
"-... | Create scool study module using ebre-escool study module.
@param StudyModuleAcademicPeriod $studyModule
@return mixed
@throws \Exception | [
"Create",
"scool",
"study",
"module",
"using",
"ebre",
"-",
"escool",
"study",
"module",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1166-L1182 |
239,706 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.createSubmodule | protected function createSubmodule(StudySubModule $srcSubmodule)
{
//First Or new
$id = $this->SubModuleAlreadyExists($srcSubmodule);
if ($id != null) {
$submodule = Submodule::findOrFail($id);
} else {
$submodule = new Submodule();
}
$submodu... | php | protected function createSubmodule(StudySubModule $srcSubmodule)
{
//First Or new
$id = $this->SubModuleAlreadyExists($srcSubmodule);
if ($id != null) {
$submodule = Submodule::findOrFail($id);
} else {
$submodule = new Submodule();
}
$submodu... | [
"protected",
"function",
"createSubmodule",
"(",
"StudySubModule",
"$",
"srcSubmodule",
")",
"{",
"//First Or new",
"$",
"id",
"=",
"$",
"this",
"->",
"SubModuleAlreadyExists",
"(",
"$",
"srcSubmodule",
")",
";",
"if",
"(",
"$",
"id",
"!=",
"null",
")",
"{",... | Create scool study submodule using ebre-escool study submodule.
@param StudySubModule $srcSubmodule
@return ScoolSubmodule | [
"Create",
"scool",
"study",
"submodule",
"using",
"ebre",
"-",
"escool",
"study",
"submodule",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1190-L1211 |
239,707 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.showMigratingInfo | protected function showMigratingInfo($model, $level = 0) {
$suffix = '';
if ($model instanceof Study) {
$suffix = $model->multiple() ? ". <bg=yellow;options=bold>Study is multiple!</>" : "";
}
if ($this->verbose && $model->periods != null) $suffix .= ' ' . $model->periods->pl... | php | protected function showMigratingInfo($model, $level = 0) {
$suffix = '';
if ($model instanceof Study) {
$suffix = $model->multiple() ? ". <bg=yellow;options=bold>Study is multiple!</>" : "";
}
if ($this->verbose && $model->periods != null) $suffix .= ' ' . $model->periods->pl... | [
"protected",
"function",
"showMigratingInfo",
"(",
"$",
"model",
",",
"$",
"level",
"=",
"0",
")",
"{",
"$",
"suffix",
"=",
"''",
";",
"if",
"(",
"$",
"model",
"instanceof",
"Study",
")",
"{",
"$",
"suffix",
"=",
"$",
"model",
"->",
"multiple",
"(",
... | Show migrating info.
@param $model
@param int $level
TODO https://github.com/acacha/ebre_escool_migration/issues/4 | [
"Show",
"migrating",
"info",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1245-L1256 |
239,708 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.academicPeriods | protected function academicPeriods()
{
if ( ! $this->filtersAppliedToPeriods()) return AcademicPeriod::all();
if (str_contains($this->filters[0], '-')) {
try {
return collect([AcademicPeriod::where(['academic_periods_name' => $this->filters[0]])->firstOrFail()]);
... | php | protected function academicPeriods()
{
if ( ! $this->filtersAppliedToPeriods()) return AcademicPeriod::all();
if (str_contains($this->filters[0], '-')) {
try {
return collect([AcademicPeriod::where(['academic_periods_name' => $this->filters[0]])->firstOrFail()]);
... | [
"protected",
"function",
"academicPeriods",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"filtersAppliedToPeriods",
"(",
")",
")",
"return",
"AcademicPeriod",
"::",
"all",
"(",
")",
";",
"if",
"(",
"str_contains",
"(",
"$",
"this",
"->",
"filters",
... | Get academic periods.
@return \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|static[] | [
"Get",
"academic",
"periods",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1301-L1313 |
239,709 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.departments | protected function departments()
{
//Avoid using FOL because is a transversal department
if ( ! $this->filtersAppliedToDepartments()) return $this->validateCollection(Department::whereNotIn('department_id', [3])->get());
if ( ! is_numeric($this->filters[1]) ) throw new \InvalidArgumentExcep... | php | protected function departments()
{
//Avoid using FOL because is a transversal department
if ( ! $this->filtersAppliedToDepartments()) return $this->validateCollection(Department::whereNotIn('department_id', [3])->get());
if ( ! is_numeric($this->filters[1]) ) throw new \InvalidArgumentExcep... | [
"protected",
"function",
"departments",
"(",
")",
"{",
"//Avoid using FOL because is a transversal department",
"if",
"(",
"!",
"$",
"this",
"->",
"filtersAppliedToDepartments",
"(",
")",
")",
"return",
"$",
"this",
"->",
"validateCollection",
"(",
"Department",
"::",... | Get the departments to migrate.
@return \Illuminate\Support\Collection|mixed | [
"Get",
"the",
"departments",
"to",
"migrate",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1350-L1356 |
239,710 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.studies | protected function studies(Department $department) {
return $this->validateCollection($department->studiesActiveOn($this->period)->get());
} | php | protected function studies(Department $department) {
return $this->validateCollection($department->studiesActiveOn($this->period)->get());
} | [
"protected",
"function",
"studies",
"(",
"Department",
"$",
"department",
")",
"{",
"return",
"$",
"this",
"->",
"validateCollection",
"(",
"$",
"department",
"->",
"studiesActiveOn",
"(",
"$",
"this",
"->",
"period",
")",
"->",
"get",
"(",
")",
")",
";",
... | Get the studies to migrate.
@param Department $department
@return mixed | [
"Get",
"the",
"studies",
"to",
"migrate",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1364-L1366 |
239,711 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.modules | protected function modules(Course $course) {
$modules = $course->modules()->active()->get();
$sortedModules = $modules->sortBy(
function ($module, $key) {
return $module->order;
}
);
return $this->validateCollection($sortedModules);
} | php | protected function modules(Course $course) {
$modules = $course->modules()->active()->get();
$sortedModules = $modules->sortBy(
function ($module, $key) {
return $module->order;
}
);
return $this->validateCollection($sortedModules);
} | [
"protected",
"function",
"modules",
"(",
"Course",
"$",
"course",
")",
"{",
"$",
"modules",
"=",
"$",
"course",
"->",
"modules",
"(",
")",
"->",
"active",
"(",
")",
"->",
"get",
"(",
")",
";",
"$",
"sortedModules",
"=",
"$",
"modules",
"->",
"sortBy"... | Get the modules to migrate.
@param Course $course
@return \Illuminate\Database\Eloquent\Collection|static[] | [
"Get",
"the",
"modules",
"to",
"migrate",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1384-L1392 |
239,712 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.submodules | protected function submodules(StudyModuleAcademicPeriod $module) {
return $this->validateCollection($module->module()->first()->submodules()->active()->get());
} | php | protected function submodules(StudyModuleAcademicPeriod $module) {
return $this->validateCollection($module->module()->first()->submodules()->active()->get());
} | [
"protected",
"function",
"submodules",
"(",
"StudyModuleAcademicPeriod",
"$",
"module",
")",
"{",
"return",
"$",
"this",
"->",
"validateCollection",
"(",
"$",
"module",
"->",
"module",
"(",
")",
"->",
"first",
"(",
")",
"->",
"submodules",
"(",
")",
"->",
... | Get the submodules to migrate.
@param StudyModuleAcademicPeriod $module
@return mixed | [
"Get",
"the",
"submodules",
"to",
"migrate",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1400-L1402 |
239,713 | acacha/ebre_escool_model | src/Services/EbreEscoolMigrator.php | EbreEscoolMigrator.switchToDestinationConnection | protected function switchToDestinationConnection()
{ $env = env(
$this->composeDestinationConnectionEnvVarByCurrentPeriodInProcess(),
$this->composeDestinationConnectionNameByCurrentPeriodInProcess()
);
$this->switchConnection($env,$this->getDestinationConnection());
} | php | protected function switchToDestinationConnection()
{ $env = env(
$this->composeDestinationConnectionEnvVarByCurrentPeriodInProcess(),
$this->composeDestinationConnectionNameByCurrentPeriodInProcess()
);
$this->switchConnection($env,$this->getDestinationConnection());
} | [
"protected",
"function",
"switchToDestinationConnection",
"(",
")",
"{",
"$",
"env",
"=",
"env",
"(",
"$",
"this",
"->",
"composeDestinationConnectionEnvVarByCurrentPeriodInProcess",
"(",
")",
",",
"$",
"this",
"->",
"composeDestinationConnectionNameByCurrentPeriodInProcess... | Switch to current destination connection in process. | [
"Switch",
"to",
"current",
"destination",
"connection",
"in",
"process",
"."
] | 91c0b870714490baa9500215a6dc07935e525a75 | https://github.com/acacha/ebre_escool_model/blob/91c0b870714490baa9500215a6dc07935e525a75/src/Services/EbreEscoolMigrator.php#L1601-L1607 |
239,714 | kevindierkx/elicit | src/Query/Grammars/Grammar.php | Grammar.compileComponents | protected function compileComponents(Builder $query)
{
$request = [];
foreach ($this->requestComponents as $component) {
// To compile the query, we'll spin through each component of the query and
// see if that component exists. If it does we'll just call the compiler
... | php | protected function compileComponents(Builder $query)
{
$request = [];
foreach ($this->requestComponents as $component) {
// To compile the query, we'll spin through each component of the query and
// see if that component exists. If it does we'll just call the compiler
... | [
"protected",
"function",
"compileComponents",
"(",
"Builder",
"$",
"query",
")",
"{",
"$",
"request",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"requestComponents",
"as",
"$",
"component",
")",
"{",
"// To compile the query, we'll spin through each co... | Compile the components necessary for the request.
@param \Kevindierkx\Elicit\Query\Builder
@return array | [
"Compile",
"the",
"components",
"necessary",
"for",
"the",
"request",
"."
] | c277942f5f5f63b175bc37e9d392faa946888f65 | https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Query/Grammars/Grammar.php#L36-L52 |
239,715 | kevindierkx/elicit | src/Query/Grammars/Grammar.php | Grammar.compileBody | protected function compileBody(Builder $query)
{
$body = [];
$hasBody = !is_null($query->body);
if ($hasBody) {
foreach ($query->body as $postField) {
$body[$postField['column']] = $postField['value'];
}
if (count($body) > 0) {
... | php | protected function compileBody(Builder $query)
{
$body = [];
$hasBody = !is_null($query->body);
if ($hasBody) {
foreach ($query->body as $postField) {
$body[$postField['column']] = $postField['value'];
}
if (count($body) > 0) {
... | [
"protected",
"function",
"compileBody",
"(",
"Builder",
"$",
"query",
")",
"{",
"$",
"body",
"=",
"[",
"]",
";",
"$",
"hasBody",
"=",
"!",
"is_null",
"(",
"$",
"query",
"->",
"body",
")",
";",
"if",
"(",
"$",
"hasBody",
")",
"{",
"foreach",
"(",
... | Compile the "body" portions of the query.
@param \Kevindierkx\Elicit\Query\Builder $query
@return string | [
"Compile",
"the",
"body",
"portions",
"of",
"the",
"query",
"."
] | c277942f5f5f63b175bc37e9d392faa946888f65 | https://github.com/kevindierkx/elicit/blob/c277942f5f5f63b175bc37e9d392faa946888f65/src/Query/Grammars/Grammar.php#L130-L147 |
239,716 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setHeader | public function setHeader(array $data): PdfInterface
{
$string_right = str_replace("{{date(\"n/d/Y g:i A\")}}", Carbon::now()->format('n/d/Y g:i A'), $data['right']);
$string_left = str_replace("|", '<br>', $data['left']);
$html = "<table border='0' cellspacing='0' cellpadding='0' width='1... | php | public function setHeader(array $data): PdfInterface
{
$string_right = str_replace("{{date(\"n/d/Y g:i A\")}}", Carbon::now()->format('n/d/Y g:i A'), $data['right']);
$string_left = str_replace("|", '<br>', $data['left']);
$html = "<table border='0' cellspacing='0' cellpadding='0' width='1... | [
"public",
"function",
"setHeader",
"(",
"array",
"$",
"data",
")",
":",
"PdfInterface",
"{",
"$",
"string_right",
"=",
"str_replace",
"(",
"\"{{date(\\\"n/d/Y g:i A\\\")}}\"",
",",
"Carbon",
"::",
"now",
"(",
")",
"->",
"format",
"(",
"'n/d/Y g:i A'",
")",
","... | Set the page header.
@param array $data The list of header items ('left','right')
@return PdfInterface The current instance
@api | [
"Set",
"the",
"page",
"header",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L179-L193 |
239,717 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setFooter | public function setFooter(array $data, string $side = 'both'): PdfInterface
{
$data = array_change_key_case($data, CASE_LOWER);
$footer = ('<table width="100%" style="vertical-align: bottom; font-family: arial; font-size: 9pt; color: #000000; font-weight: bold; font-style: italic;"><tr>'.
... | php | public function setFooter(array $data, string $side = 'both'): PdfInterface
{
$data = array_change_key_case($data, CASE_LOWER);
$footer = ('<table width="100%" style="vertical-align: bottom; font-family: arial; font-size: 9pt; color: #000000; font-weight: bold; font-style: italic;"><tr>'.
... | [
"public",
"function",
"setFooter",
"(",
"array",
"$",
"data",
",",
"string",
"$",
"side",
"=",
"'both'",
")",
":",
"PdfInterface",
"{",
"$",
"data",
"=",
"array_change_key_case",
"(",
"$",
"data",
",",
"CASE_LOWER",
")",
";",
"$",
"footer",
"=",
"(",
"... | Set the page footer.
{@note: printing even/odd pages is not available yet.}
@param array $data The list of footer items ('left','center','right')
@param string $side The option for unique even/odd page printing ('both','even','odd')
@return PdfInterface The current instance
@api | [
"Set",
"the",
"page",
"footer",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L209-L224 |
239,718 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setFontType | public function setFontType(string $fontname = null): PdfInterface
{
/**
* Font sets to be used for PDF documents:
*
* - Arial - Times - Tahoma
* - Georgia - Trebuchet - Courier
* - Lucida - Lucida-Bright -... | php | public function setFontType(string $fontname = null): PdfInterface
{
/**
* Font sets to be used for PDF documents:
*
* - Arial - Times - Tahoma
* - Georgia - Trebuchet - Courier
* - Lucida - Lucida-Bright -... | [
"public",
"function",
"setFontType",
"(",
"string",
"$",
"fontname",
"=",
"null",
")",
":",
"PdfInterface",
"{",
"/**\n * Font sets to be used for PDF documents:\n *\n * - Arial - Times - Tahoma\n * - Georgia - Trebuchet ... | Set the default document font.
@param string $fontname The font name ('Times','Helvetica','Courier')
@return PdfInterface The current instance
@api | [
"Set",
"the",
"default",
"document",
"font",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L257-L273 |
239,719 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.getFontFamily | protected function getFontFamily(string $fontname = null): string
{
/**
* Font sets to be used for PDF documents:
*
* - Arial - Times - Tahoma
* - Georgia - Trebuchet - Courier
* - Lucida - Lucida-Bright - ... | php | protected function getFontFamily(string $fontname = null): string
{
/**
* Font sets to be used for PDF documents:
*
* - Arial - Times - Tahoma
* - Georgia - Trebuchet - Courier
* - Lucida - Lucida-Bright - ... | [
"protected",
"function",
"getFontFamily",
"(",
"string",
"$",
"fontname",
"=",
"null",
")",
":",
"string",
"{",
"/**\n * Font sets to be used for PDF documents:\n *\n * - Arial - Times - Tahoma\n * - Georgia - Trebuchet ... | Return a specific font-family.
@param string $fontname The font name type
@return string
@api | [
"Return",
"a",
"specific",
"font",
"-",
"family",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L286-L301 |
239,720 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.appendPageContent | public function appendPageContent(string $str): PdfInterface
{
$this->setProperty('pageContent', $str);
$this->mpdf->WriteHTML($this->pageContent);
return $this;
} | php | public function appendPageContent(string $str): PdfInterface
{
$this->setProperty('pageContent', $str);
$this->mpdf->WriteHTML($this->pageContent);
return $this;
} | [
"public",
"function",
"appendPageContent",
"(",
"string",
"$",
"str",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'pageContent'",
",",
"$",
"str",
")",
";",
"$",
"this",
"->",
"mpdf",
"->",
"WriteHTML",
"(",
"$",
"this",
"->",
... | Append the HTML content.
@param string $str The string data used for render
@return PdfInterface The current instance
@api | [
"Append",
"the",
"HTML",
"content",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L314-L320 |
239,721 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setMargins | public function setMargins(array $setting): PdfInterface
{
$this->setProperty('marginTop', (int) $setting['marginTop']);
$this->setProperty('marginRight', (int) $setting['marginRight']);
$this->setProperty('marginBottom', (int) $setting['marginBottom']);
$this->setProperty('marginLef... | php | public function setMargins(array $setting): PdfInterface
{
$this->setProperty('marginTop', (int) $setting['marginTop']);
$this->setProperty('marginRight', (int) $setting['marginRight']);
$this->setProperty('marginBottom', (int) $setting['marginBottom']);
$this->setProperty('marginLef... | [
"public",
"function",
"setMargins",
"(",
"array",
"$",
"setting",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'marginTop'",
",",
"(",
"int",
")",
"$",
"setting",
"[",
"'marginTop'",
"]",
")",
";",
"$",
"this",
"->",
"setPropert... | Set the page margins.
@param array $setting The margin configiration setting
@return PdfInterface The current instance
@api | [
"Set",
"the",
"page",
"margins",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L441-L451 |
239,722 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setPageSize | public function setPageSize(string $pageSize): PdfInterface
{
$this->setProperty('pageSize', $pageSize);
$this->registerPageFormat();
return $this;
} | php | public function setPageSize(string $pageSize): PdfInterface
{
$this->setProperty('pageSize', $pageSize);
$this->registerPageFormat();
return $this;
} | [
"public",
"function",
"setPageSize",
"(",
"string",
"$",
"pageSize",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'pageSize'",
",",
"$",
"pageSize",
")",
";",
"$",
"this",
"->",
"registerPageFormat",
"(",
")",
";",
"return",
"$",
... | Set the page size.
@param string $pageSize The page format/size type ['Letter','Legal', etc.]
@return PdfInterface The current instance
@api | [
"Set",
"the",
"page",
"size",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L464-L470 |
239,723 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.appendPageCSS | public function appendPageCSS(string $str): PdfInterface
{
$this->setProperty('pageCSS', $str);
$this->mpdf->WriteHTML($this->pageCSS, 1);
return $this;
} | php | public function appendPageCSS(string $str): PdfInterface
{
$this->setProperty('pageCSS', $str);
$this->mpdf->WriteHTML($this->pageCSS, 1);
return $this;
} | [
"public",
"function",
"appendPageCSS",
"(",
"string",
"$",
"str",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'pageCSS'",
",",
"$",
"str",
")",
";",
"$",
"this",
"->",
"mpdf",
"->",
"WriteHTML",
"(",
"$",
"this",
"->",
"pageC... | Append a CSS style.
@param string $str The string data used for render
@return PdfInterface The current instance
@api | [
"Append",
"a",
"CSS",
"style",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L483-L489 |
239,724 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.registerPageFormat | protected function registerPageFormat(string $pageSize = null, string $orientation = null): PdfInterface
{
in_array($pageSize, $this->pageTypes)
? $this->setProperty('pageSize', $pageSize)
: $this->setProperty('pageSize', static::DEFAULT_PAGE_SIZE);
$this->setPageOrientation... | php | protected function registerPageFormat(string $pageSize = null, string $orientation = null): PdfInterface
{
in_array($pageSize, $this->pageTypes)
? $this->setProperty('pageSize', $pageSize)
: $this->setProperty('pageSize', static::DEFAULT_PAGE_SIZE);
$this->setPageOrientation... | [
"protected",
"function",
"registerPageFormat",
"(",
"string",
"$",
"pageSize",
"=",
"null",
",",
"string",
"$",
"orientation",
"=",
"null",
")",
":",
"PdfInterface",
"{",
"in_array",
"(",
"$",
"pageSize",
",",
"$",
"this",
"->",
"pageTypes",
")",
"?",
"$",... | Generate and store a defined PDF page format.
@param string $pageSize The page format type ['Letter','Legal', etc.]
@param string $orientation The page orientation ['Portrait','Landscape']
@return PdfInterface The current instance | [
"Generate",
"and",
"store",
"a",
"defined",
"PDF",
"page",
"format",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L501-L510 |
239,725 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setPageOrientation | public function setPageOrientation(string $orientation): PdfInterface
{
$this->setProperty('pageOrientation', strtoupper($orientation[0]));
$this->pageOrientation === 'L'
? $this->setProperty('pageFormat', $this->pageSize . '-' . $this->pageOrientation)
: $this->setProperty(... | php | public function setPageOrientation(string $orientation): PdfInterface
{
$this->setProperty('pageOrientation', strtoupper($orientation[0]));
$this->pageOrientation === 'L'
? $this->setProperty('pageFormat', $this->pageSize . '-' . $this->pageOrientation)
: $this->setProperty(... | [
"public",
"function",
"setPageOrientation",
"(",
"string",
"$",
"orientation",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'pageOrientation'",
",",
"strtoupper",
"(",
"$",
"orientation",
"[",
"0",
"]",
")",
")",
";",
"$",
"this",
... | Set the page orientation.
@param string $orientation The page orientation ['Portrait','Landscape']
@return PdfInterface The current instance | [
"Set",
"the",
"page",
"orientation",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L521-L530 |
239,726 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setMetaTitle | public function setMetaTitle(string $str): PdfInterface
{
$this->setProperty('metaTitle', $str);
$this->mpdf->SetTitle($this->metaTitle);
return $this;
} | php | public function setMetaTitle(string $str): PdfInterface
{
$this->setProperty('metaTitle', $str);
$this->mpdf->SetTitle($this->metaTitle);
return $this;
} | [
"public",
"function",
"setMetaTitle",
"(",
"string",
"$",
"str",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'metaTitle'",
",",
"$",
"str",
")",
";",
"$",
"this",
"->",
"mpdf",
"->",
"SetTitle",
"(",
"$",
"this",
"->",
"metaT... | Set PDF Meta Title.
@param string $str The page title
@return PdfInterface The current instance | [
"Set",
"PDF",
"Meta",
"Title",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L541-L547 |
239,727 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setMetaAuthor | public function setMetaAuthor(string $str): PdfInterface
{
$this->setProperty('metaAuthor', $str);
$this->mpdf->SetAuthor($this->metaAuthor);
return $this;
} | php | public function setMetaAuthor(string $str): PdfInterface
{
$this->setProperty('metaAuthor', $str);
$this->mpdf->SetAuthor($this->metaAuthor);
return $this;
} | [
"public",
"function",
"setMetaAuthor",
"(",
"string",
"$",
"str",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'metaAuthor'",
",",
"$",
"str",
")",
";",
"$",
"this",
"->",
"mpdf",
"->",
"SetAuthor",
"(",
"$",
"this",
"->",
"me... | Set PDF Meta Author.
@param string $str The page author
@return PdfInterface The current instance | [
"Set",
"PDF",
"Meta",
"Author",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L558-L564 |
239,728 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setMetaCreator | public function setMetaCreator(string $str): PdfInterface
{
$this->setProperty('metaCreator', $str);
$this->mpdf->SetCreator($this->metaCreator);
return $this;
} | php | public function setMetaCreator(string $str): PdfInterface
{
$this->setProperty('metaCreator', $str);
$this->mpdf->SetCreator($this->metaCreator);
return $this;
} | [
"public",
"function",
"setMetaCreator",
"(",
"string",
"$",
"str",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'metaCreator'",
",",
"$",
"str",
")",
";",
"$",
"this",
"->",
"mpdf",
"->",
"SetCreator",
"(",
"$",
"this",
"->",
... | Set PDF Meta Creator.
@param string $str The page creator
@return PdfInterface The current instance | [
"Set",
"PDF",
"Meta",
"Creator",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L575-L581 |
239,729 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setMetaSubject | public function setMetaSubject(string $str): PdfInterface
{
$this->setProperty('metaSubject', $str);
$this->mpdf->SetSubject($this->metaSubject);
return $this;
} | php | public function setMetaSubject(string $str): PdfInterface
{
$this->setProperty('metaSubject', $str);
$this->mpdf->SetSubject($this->metaSubject);
return $this;
} | [
"public",
"function",
"setMetaSubject",
"(",
"string",
"$",
"str",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'metaSubject'",
",",
"$",
"str",
")",
";",
"$",
"this",
"->",
"mpdf",
"->",
"SetSubject",
"(",
"$",
"this",
"->",
... | Set PDF Meta Subject.
@param string $str The page subject
@return PdfInterface The current instance | [
"Set",
"PDF",
"Meta",
"Subject",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L592-L598 |
239,730 | vox-tecnologia/pdf | src/Pdf/AbstractPdfAdapter.php | AbstractPdfAdapter.setMetaKeywords | public function setMetaKeywords(array $words): PdfInterface
{
$this->setProperty('metaKeywords', array_merge($this->metaKeywords, $words));
$this->mpdf->SetKeywords(implode(', ', $this->metaKeywords));
return $this;
} | php | public function setMetaKeywords(array $words): PdfInterface
{
$this->setProperty('metaKeywords', array_merge($this->metaKeywords, $words));
$this->mpdf->SetKeywords(implode(', ', $this->metaKeywords));
return $this;
} | [
"public",
"function",
"setMetaKeywords",
"(",
"array",
"$",
"words",
")",
":",
"PdfInterface",
"{",
"$",
"this",
"->",
"setProperty",
"(",
"'metaKeywords'",
",",
"array_merge",
"(",
"$",
"this",
"->",
"metaKeywords",
",",
"$",
"words",
")",
")",
";",
"$",
... | Set PDF Meta Key Words.
@param array $words The page key words
@return PdfInterface The current instance | [
"Set",
"PDF",
"Meta",
"Key",
"Words",
"."
] | c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969 | https://github.com/vox-tecnologia/pdf/blob/c9ca4303beb57c93bb0f2884d12cc0a8bbe2a969/src/Pdf/AbstractPdfAdapter.php#L609-L615 |
239,731 | tomphp/TjoAnnotationRouter | src/TjoAnnotationRouter/Parser/ControllerParser.php | ControllerParser.parseReflectedController | public function parseReflectedController($name, ClassReflection $reflection, ArrayObject $config)
{
$annotations = $reflection->getAnnotations($this->annotationManager);
if ($annotations instanceof AnnotationCollection) {
$this->processor->processController($name, $annotations);
... | php | public function parseReflectedController($name, ClassReflection $reflection, ArrayObject $config)
{
$annotations = $reflection->getAnnotations($this->annotationManager);
if ($annotations instanceof AnnotationCollection) {
$this->processor->processController($name, $annotations);
... | [
"public",
"function",
"parseReflectedController",
"(",
"$",
"name",
",",
"ClassReflection",
"$",
"reflection",
",",
"ArrayObject",
"$",
"config",
")",
"{",
"$",
"annotations",
"=",
"$",
"reflection",
"->",
"getAnnotations",
"(",
"$",
"this",
"->",
"annotationMan... | Builds the config for a controller.
@param string $name
@param ClassReflection $reflection
@param ArrayObject $config
@return ArrayObject Returns the config array object. | [
"Builds",
"the",
"config",
"for",
"a",
"controller",
"."
] | ee323691e948d82449287eae5c1ecce80cc90971 | https://github.com/tomphp/TjoAnnotationRouter/blob/ee323691e948d82449287eae5c1ecce80cc90971/src/TjoAnnotationRouter/Parser/ControllerParser.php#L69-L88 |
239,732 | ironedgesoftware/graphs | src/Export/Utils.php | Utils.getSystemService | public function getSystemService(): SystemService
{
if ($this->_systemService === null) {
$this->_systemService = new SystemService();
}
return $this->_systemService;
} | php | public function getSystemService(): SystemService
{
if ($this->_systemService === null) {
$this->_systemService = new SystemService();
}
return $this->_systemService;
} | [
"public",
"function",
"getSystemService",
"(",
")",
":",
"SystemService",
"{",
"if",
"(",
"$",
"this",
"->",
"_systemService",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_systemService",
"=",
"new",
"SystemService",
"(",
")",
";",
"}",
"return",
"$",
"... | Returns the value of field _systemService.
@return SystemService | [
"Returns",
"the",
"value",
"of",
"field",
"_systemService",
"."
] | c1cc2347e7ba1935fe6b06356a74f0cf3101f5a0 | https://github.com/ironedgesoftware/graphs/blob/c1cc2347e7ba1935fe6b06356a74f0cf3101f5a0/src/Export/Utils.php#L45-L52 |
239,733 | noordawod/php-util | src/System.php | System.realPath | public static function realPath(/*string*/ $filePath = '') {
if('' === $filePath) {
$filePath = '.';
}
$filePath = @realpath($filePath);
if(false !== $filePath) {
$filePath = str_replace('\\', '/', $filePath);
if('/' !== $filePath) {
$filePath = rtrim($filePath, '/');
}
... | php | public static function realPath(/*string*/ $filePath = '') {
if('' === $filePath) {
$filePath = '.';
}
$filePath = @realpath($filePath);
if(false !== $filePath) {
$filePath = str_replace('\\', '/', $filePath);
if('/' !== $filePath) {
$filePath = rtrim($filePath, '/');
}
... | [
"public",
"static",
"function",
"realPath",
"(",
"/*string*/",
"$",
"filePath",
"=",
"''",
")",
"{",
"if",
"(",
"''",
"===",
"$",
"filePath",
")",
"{",
"$",
"filePath",
"=",
"'.'",
";",
"}",
"$",
"filePath",
"=",
"@",
"realpath",
"(",
"$",
"filePath"... | Returns an absolute path for the specified file path. The file must exist
on the file system for this call to yield something.
Three important notes:
1) The directory separator will always be a slash (/) character, even on
hosts with a different separator (ex.: Windows)
2) Except for the case of the root directory, ... | [
"Returns",
"an",
"absolute",
"path",
"for",
"the",
"specified",
"file",
"path",
".",
"The",
"file",
"must",
"exist",
"on",
"the",
"file",
"system",
"for",
"this",
"call",
"to",
"yield",
"something",
"."
] | 6458690cc2c8457914a2aa74b131451d4a8e5797 | https://github.com/noordawod/php-util/blob/6458690cc2c8457914a2aa74b131451d4a8e5797/src/System.php#L126-L138 |
239,734 | noordawod/php-util | src/System.php | System.containsPath | public static function containsPath(/*string*/ $top, /*string*/ $sub) {
$top = self::realPath($top);
$sub = self::realPath($sub);
return self::isDir($top) && self::isDir($sub) &&
0 === strpos($sub, $top . '/');
} | php | public static function containsPath(/*string*/ $top, /*string*/ $sub) {
$top = self::realPath($top);
$sub = self::realPath($sub);
return self::isDir($top) && self::isDir($sub) &&
0 === strpos($sub, $top . '/');
} | [
"public",
"static",
"function",
"containsPath",
"(",
"/*string*/",
"$",
"top",
",",
"/*string*/",
"$",
"sub",
")",
"{",
"$",
"top",
"=",
"self",
"::",
"realPath",
"(",
"$",
"top",
")",
";",
"$",
"sub",
"=",
"self",
"::",
"realPath",
"(",
"$",
"sub",
... | Checks whether a parent directory contains the specified sub-directory.
@param string $top parent (top) directory
@param string $sub directory
@return boolean TRUE if top directory contains the sub, FALSE otherwise | [
"Checks",
"whether",
"a",
"parent",
"directory",
"contains",
"the",
"specified",
"sub",
"-",
"directory",
"."
] | 6458690cc2c8457914a2aa74b131451d4a8e5797 | https://github.com/noordawod/php-util/blob/6458690cc2c8457914a2aa74b131451d4a8e5797/src/System.php#L147-L152 |
239,735 | noordawod/php-util | src/System.php | System.openFile | public static function openFile(/*string*/ $filePath, /*string*/ $mode) {
return self::isFile($filePath) ? fopen($filePath, $mode, false) : false;
} | php | public static function openFile(/*string*/ $filePath, /*string*/ $mode) {
return self::isFile($filePath) ? fopen($filePath, $mode, false) : false;
} | [
"public",
"static",
"function",
"openFile",
"(",
"/*string*/",
"$",
"filePath",
",",
"/*string*/",
"$",
"mode",
")",
"{",
"return",
"self",
"::",
"isFile",
"(",
"$",
"filePath",
")",
"?",
"fopen",
"(",
"$",
"filePath",
",",
"$",
"mode",
",",
"false",
"... | Opens the supplied file with the requested mode.
@param string $filePath to target file
@param string $mode for opening the file
@see \fopen()
@return resource|FALSE resource to the opened file, FALSE on error | [
"Opens",
"the",
"supplied",
"file",
"with",
"the",
"requested",
"mode",
"."
] | 6458690cc2c8457914a2aa74b131451d4a8e5797 | https://github.com/noordawod/php-util/blob/6458690cc2c8457914a2aa74b131451d4a8e5797/src/System.php#L162-L164 |
239,736 | noordawod/php-util | src/System.php | System.tempFile | public static function tempFile(/*string*/ $prefix = '') {
$prefix = @trim($prefix);
if('' === $prefix) {
$prefix = time() . '-' . rand(11111, 99999);
}
$prefix .= '.';
$tempPath = tempnam(sys_get_temp_dir(), $prefix);
return $tempPath;
} | php | public static function tempFile(/*string*/ $prefix = '') {
$prefix = @trim($prefix);
if('' === $prefix) {
$prefix = time() . '-' . rand(11111, 99999);
}
$prefix .= '.';
$tempPath = tempnam(sys_get_temp_dir(), $prefix);
return $tempPath;
} | [
"public",
"static",
"function",
"tempFile",
"(",
"/*string*/",
"$",
"prefix",
"=",
"''",
")",
"{",
"$",
"prefix",
"=",
"@",
"trim",
"(",
"$",
"prefix",
")",
";",
"if",
"(",
"''",
"===",
"$",
"prefix",
")",
"{",
"$",
"prefix",
"=",
"time",
"(",
")... | Creates a new temporary file in the system's default temporary directory.
@param string $prefix to append to the name (optional)
@see \tempnam()
@see \sys_get_temp_dir()
@return string|FALSE temporary file's location, FALSE on error | [
"Creates",
"a",
"new",
"temporary",
"file",
"in",
"the",
"system",
"s",
"default",
"temporary",
"directory",
"."
] | 6458690cc2c8457914a2aa74b131451d4a8e5797 | https://github.com/noordawod/php-util/blob/6458690cc2c8457914a2aa74b131451d4a8e5797/src/System.php#L196-L204 |
239,737 | veridu/idos-sdk-php | src/idOS/Facade/Profile/Raw.php | Raw.getInstance | private static function getInstance(
string $userName,
Auth $auth
) : RawEndpoint {
return new RawEndpoint(
$userName,
$auth,
new Client()
);
} | php | private static function getInstance(
string $userName,
Auth $auth
) : RawEndpoint {
return new RawEndpoint(
$userName,
$auth,
new Client()
);
} | [
"private",
"static",
"function",
"getInstance",
"(",
"string",
"$",
"userName",
",",
"Auth",
"$",
"auth",
")",
":",
"RawEndpoint",
"{",
"return",
"new",
"RawEndpoint",
"(",
"$",
"userName",
",",
"$",
"auth",
",",
"new",
"Client",
"(",
")",
")",
";",
"}... | Returns the raw instance or, creates a new one if it doesn't exists yet and returns it.
@param string $userName
@param Auth $auth
@return Raw instance | [
"Returns",
"the",
"raw",
"instance",
"or",
"creates",
"a",
"new",
"one",
"if",
"it",
"doesn",
"t",
"exists",
"yet",
"and",
"returns",
"it",
"."
] | e56757bed10404756f2f0485a4b7f55794192008 | https://github.com/veridu/idos-sdk-php/blob/e56757bed10404756f2f0485a4b7f55794192008/src/idOS/Facade/Profile/Raw.php#L20-L29 |
239,738 | veridu/idos-sdk-php | src/idOS/Facade/Profile/Raw.php | Raw.createNew | public static function createNew(
string $userName,
int $sourceId,
string $collectionName,
array $data,
Auth $auth
) {
return static::getInstance()
->createNew($sourceId, $collectionName, $data);
} | php | public static function createNew(
string $userName,
int $sourceId,
string $collectionName,
array $data,
Auth $auth
) {
return static::getInstance()
->createNew($sourceId, $collectionName, $data);
} | [
"public",
"static",
"function",
"createNew",
"(",
"string",
"$",
"userName",
",",
"int",
"$",
"sourceId",
",",
"string",
"$",
"collectionName",
",",
"array",
"$",
"data",
",",
"Auth",
"$",
"auth",
")",
"{",
"return",
"static",
"::",
"getInstance",
"(",
"... | Creates a new instance of Raw.
@param string $userName
@param int $sourceId
@param string $collectionName
@param array $data
@param Auth $auth
@return array response | [
"Creates",
"a",
"new",
"instance",
"of",
"Raw",
"."
] | e56757bed10404756f2f0485a4b7f55794192008 | https://github.com/veridu/idos-sdk-php/blob/e56757bed10404756f2f0485a4b7f55794192008/src/idOS/Facade/Profile/Raw.php#L42-L51 |
239,739 | pickles2/node-pickles2-module-editor | php/main.php | main.createPickles2ContentsEditor | public function createPickles2ContentsEditor(){
$px2ce = new \pickles2\libs\contentsEditor\main();
$px2ce->init(
array(
'page_path' => '/px2me-dummy.html', // <- 編集対象ページのパス
'appMode' => $this->getAppMode(), // 'web' or 'desktop'. default to 'web'
'entryScript' => $this->entryScript,
'customField... | php | public function createPickles2ContentsEditor(){
$px2ce = new \pickles2\libs\contentsEditor\main();
$px2ce->init(
array(
'page_path' => '/px2me-dummy.html', // <- 編集対象ページのパス
'appMode' => $this->getAppMode(), // 'web' or 'desktop'. default to 'web'
'entryScript' => $this->entryScript,
'customField... | [
"public",
"function",
"createPickles2ContentsEditor",
"(",
")",
"{",
"$",
"px2ce",
"=",
"new",
"\\",
"pickles2",
"\\",
"libs",
"\\",
"contentsEditor",
"\\",
"main",
"(",
")",
";",
"$",
"px2ce",
"->",
"init",
"(",
"array",
"(",
"'page_path'",
"=>",
"'/px2me... | create pickles2-contents-editor object | [
"create",
"pickles2",
"-",
"contents",
"-",
"editor",
"object"
] | a4270c09cb047b119ccb28eef654e223cc33f3c8 | https://github.com/pickles2/node-pickles2-module-editor/blob/a4270c09cb047b119ccb28eef654e223cc33f3c8/php/main.php#L307-L322 |
239,740 | axypro/creator | helpers/NameResolver.php | NameResolver.resolve | public static function resolve($classname, array $context)
{
if ($classname[0] === '\\') {
return substr($classname, 1);
}
$cn = explode(':', $classname, 2);
if (count($cn) === 1) {
if (!empty($context['namespace'])) {
$classname = $context['na... | php | public static function resolve($classname, array $context)
{
if ($classname[0] === '\\') {
return substr($classname, 1);
}
$cn = explode(':', $classname, 2);
if (count($cn) === 1) {
if (!empty($context['namespace'])) {
$classname = $context['na... | [
"public",
"static",
"function",
"resolve",
"(",
"$",
"classname",
",",
"array",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"classname",
"[",
"0",
"]",
"===",
"'\\\\'",
")",
"{",
"return",
"substr",
"(",
"$",
"classname",
",",
"1",
")",
";",
"}",
"$"... | Resolves a class name
@param string $classname
@param array $context
@return string
@throws \axy\creator\errors\InvalidPointer | [
"Resolves",
"a",
"class",
"name"
] | 3d74e2201cdb93912d32b1d80d1fdc44018f132a | https://github.com/axypro/creator/blob/3d74e2201cdb93912d32b1d80d1fdc44018f132a/helpers/NameResolver.php#L25-L52 |
239,741 | rozaverta/cmf | core/Support/Str.php | Str.cache | public static function cache( $value, $name, $delimiter = null )
{
if( $value === '' )
{
return $value;
}
$func = $name;
$arg2 = $name == "snake";
if( $arg2 )
{
if( is_null($delimiter) )
{
$delimiter = "_";
}
}
else if( ($arg2 = $arg2 == "ascii") )
{
if( is_null($delimiter) )
... | php | public static function cache( $value, $name, $delimiter = null )
{
if( $value === '' )
{
return $value;
}
$func = $name;
$arg2 = $name == "snake";
if( $arg2 )
{
if( is_null($delimiter) )
{
$delimiter = "_";
}
}
else if( ($arg2 = $arg2 == "ascii") )
{
if( is_null($delimiter) )
... | [
"public",
"static",
"function",
"cache",
"(",
"$",
"value",
",",
"$",
"name",
",",
"$",
"delimiter",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"''",
")",
"{",
"return",
"$",
"value",
";",
"}",
"$",
"func",
"=",
"$",
"name",
";",
"$... | Read the given string from cache or convert to needle case and save to cache.
@param string $value
@param string $name
@param string $delimiter used only snake case
@return string | [
"Read",
"the",
"given",
"string",
"from",
"cache",
"or",
"convert",
"to",
"needle",
"case",
"and",
"save",
"to",
"cache",
"."
] | 95ed38362e397d1c700ee255f7200234ef98d356 | https://github.com/rozaverta/cmf/blob/95ed38362e397d1c700ee255f7200234ef98d356/core/Support/Str.php#L132-L168 |
239,742 | northern/PHP-Common | src/Northern/Common/Util/UrlUtil.php | UrlUtil.getSlug | public static function getSlug($text, $separator = '-')
{
return strtolower(
trim(
preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(
preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(
... | php | public static function getSlug($text, $separator = '-')
{
return strtolower(
trim(
preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(
preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities(
... | [
"public",
"static",
"function",
"getSlug",
"(",
"$",
"text",
",",
"$",
"separator",
"=",
"'-'",
")",
"{",
"return",
"strtolower",
"(",
"trim",
"(",
"preg_replace",
"(",
"'~[^0-9a-z]+~i'",
",",
"'-'",
",",
"html_entity_decode",
"(",
"preg_replace",
"(",
"'~&(... | Transforms a given string into a URL safe "slug".
@param string $text
@param string $separator
@return string
Source: http://stackoverflow.com/questions/2103797/url-friendly-username-in-php | [
"Transforms",
"a",
"given",
"string",
"into",
"a",
"URL",
"safe",
"slug",
"."
] | 7c63ef19252fd540fb412a18af956b8563afaa55 | https://github.com/northern/PHP-Common/blob/7c63ef19252fd540fb412a18af956b8563afaa55/src/Northern/Common/Util/UrlUtil.php#L29-L40 |
239,743 | tux-rampage/rampage-php | library/rampage/core/resources/UrlLocator.php | UrlLocator.resolve | protected function resolve($filename, $scope)
{
$scopeIndex = ($scope === false)? '' : $scope;
$theme = $this->getCurrentTheme();
$url = false;
if (isset($this->locations[$theme][$scopeIndex][$filename])) {
return $this->locations[$theme][$scopeIndex][$filename];
... | php | protected function resolve($filename, $scope)
{
$scopeIndex = ($scope === false)? '' : $scope;
$theme = $this->getCurrentTheme();
$url = false;
if (isset($this->locations[$theme][$scopeIndex][$filename])) {
return $this->locations[$theme][$scopeIndex][$filename];
... | [
"protected",
"function",
"resolve",
"(",
"$",
"filename",
",",
"$",
"scope",
")",
"{",
"$",
"scopeIndex",
"=",
"(",
"$",
"scope",
"===",
"false",
")",
"?",
"''",
":",
"$",
"scope",
";",
"$",
"theme",
"=",
"$",
"this",
"->",
"getCurrentTheme",
"(",
... | Resolve relative path
@param string $filename
@param string $scope
@param $theme | [
"Resolve",
"relative",
"path"
] | 1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf | https://github.com/tux-rampage/rampage-php/blob/1c679b04a6d477e2f8fdb86135e1d9f0c128b1cf/library/rampage/core/resources/UrlLocator.php#L148-L186 |
239,744 | gourmet/common | Model/Behavior/ComputableBehavior.php | ComputableBehavior._findComputed | public function _findComputed(Model $Model, $func, $state, $query, $result = array()) {
if ('after' == $state) {
return $result;
}
$query['fields'] = array(sprintf(
'%s(%s) AS %s'
, strtoupper($this->_methods[strtolower($this->settings[$Model->alias]['method'])])
, $Model->alias . '.' . $this->settin... | php | public function _findComputed(Model $Model, $func, $state, $query, $result = array()) {
if ('after' == $state) {
return $result;
}
$query['fields'] = array(sprintf(
'%s(%s) AS %s'
, strtoupper($this->_methods[strtolower($this->settings[$Model->alias]['method'])])
, $Model->alias . '.' . $this->settin... | [
"public",
"function",
"_findComputed",
"(",
"Model",
"$",
"Model",
",",
"$",
"func",
",",
"$",
"state",
",",
"$",
"query",
",",
"$",
"result",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"'after'",
"==",
"$",
"state",
")",
"{",
"return",
"$",
"r... | Custom find method to compute resultset's computable field.
@param Model $model Model to query.
@param string $func
@param string $state Either "before" or "after"
@param array $query
@param array $result
@return array | [
"Custom",
"find",
"method",
"to",
"compute",
"resultset",
"s",
"computable",
"field",
"."
] | 53ad4e919c51606dc81f2c716267d01ee768ade5 | https://github.com/gourmet/common/blob/53ad4e919c51606dc81f2c716267d01ee768ade5/Model/Behavior/ComputableBehavior.php#L230-L243 |
239,745 | laravel-commode/bladed | src/LaravelCommode/Bladed/BladedServiceProvider.php | BladedServiceProvider.launching | public function launching()
{
/**
* registering default commands
*/
$this->with([self::PROVIDES_SERVICE], function (IBladedManager $manager) {
$manager->registerCommandNamespace('scope', Scope::class);
\phpQuery::newDocument();
$manager->register... | php | public function launching()
{
/**
* registering default commands
*/
$this->with([self::PROVIDES_SERVICE], function (IBladedManager $manager) {
$manager->registerCommandNamespace('scope', Scope::class);
\phpQuery::newDocument();
$manager->register... | [
"public",
"function",
"launching",
"(",
")",
"{",
"/**\n * registering default commands\n */",
"$",
"this",
"->",
"with",
"(",
"[",
"self",
"::",
"PROVIDES_SERVICE",
"]",
",",
"function",
"(",
"IBladedManager",
"$",
"manager",
")",
"{",
"$",
"manag... | Will be triggered when the app's 'booting' event is triggered | [
"Will",
"be",
"triggered",
"when",
"the",
"app",
"s",
"booting",
"event",
"is",
"triggered"
] | 3a81f354ecac3b284fde4dce461c90b1aa367c22 | https://github.com/laravel-commode/bladed/blob/3a81f354ecac3b284fde4dce461c90b1aa367c22/src/LaravelCommode/Bladed/BladedServiceProvider.php#L47-L58 |
239,746 | RowlandOti/ooglee-core | src/OoGlee/Application/CommandBus/CommandNameInflector.php | CommandNameInflector.inflect | public function inflect(ICommand $command)
{
$tmpClass = str_replace('Domain', 'Application', get_class($command));
$handlerClass = str_replace('Command', 'Handler', $tmpClass);
return $handlerClass;
} | php | public function inflect(ICommand $command)
{
$tmpClass = str_replace('Domain', 'Application', get_class($command));
$handlerClass = str_replace('Command', 'Handler', $tmpClass);
return $handlerClass;
} | [
"public",
"function",
"inflect",
"(",
"ICommand",
"$",
"command",
")",
"{",
"$",
"tmpClass",
"=",
"str_replace",
"(",
"'Domain'",
",",
"'Application'",
",",
"get_class",
"(",
"$",
"command",
")",
")",
";",
"$",
"handlerClass",
"=",
"str_replace",
"(",
"'Co... | Map a Handler Class for corresponding Command
@param Command $command
@return string | [
"Map",
"a",
"Handler",
"Class",
"for",
"corresponding",
"Command"
] | 6cd8a8e58e37749e1c58e99063ea72c9d37a98bc | https://github.com/RowlandOti/ooglee-core/blob/6cd8a8e58e37749e1c58e99063ea72c9d37a98bc/src/OoGlee/Application/CommandBus/CommandNameInflector.php#L20-L26 |
239,747 | MINISTRYGmbH/morrow-core | src/Input.php | Input.tidy | public function tidy($value) {
if (is_array($value)) {
$value = array_map([&$this, 'tidy'], $value);
} else {
$value = trim($value);
// unify line breaks
$value = preg_replace("=(\r\n|\r)=", "\n", $value);
// filter nullbyte
$value = str_replace("\0", '', $value);
}
return $value;
} | php | public function tidy($value) {
if (is_array($value)) {
$value = array_map([&$this, 'tidy'], $value);
} else {
$value = trim($value);
// unify line breaks
$value = preg_replace("=(\r\n|\r)=", "\n", $value);
// filter nullbyte
$value = str_replace("\0", '', $value);
}
return $value;
} | [
"public",
"function",
"tidy",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"array_map",
"(",
"[",
"&",
"$",
"this",
",",
"'tidy'",
"]",
",",
"$",
"value",
")",
";",
"}",
"else",
"{",
... | Trims a string, unifies line breaks and deletes null bytes.
@param mixed $value An array or scalar to clean up.
@return mixed The cleaned version of the input. | [
"Trims",
"a",
"string",
"unifies",
"line",
"breaks",
"and",
"deletes",
"null",
"bytes",
"."
] | bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e | https://github.com/MINISTRYGmbH/morrow-core/blob/bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e/src/Input.php#L89-L100 |
239,748 | MINISTRYGmbH/morrow-core | src/Input.php | Input._array_merge_recursive_distinct | protected function _array_merge_recursive_distinct ($array) {
$arrays = func_get_args();
$base = array_shift($arrays);
if (!is_array($base)) $base = empty($base) ? [] : [$base];
foreach ($arrays as $append) {
if (!is_array($append)) $append = [$append];
foreach ($append as $key => $value) {
if (!array... | php | protected function _array_merge_recursive_distinct ($array) {
$arrays = func_get_args();
$base = array_shift($arrays);
if (!is_array($base)) $base = empty($base) ? [] : [$base];
foreach ($arrays as $append) {
if (!is_array($append)) $append = [$append];
foreach ($append as $key => $value) {
if (!array... | [
"protected",
"function",
"_array_merge_recursive_distinct",
"(",
"$",
"array",
")",
"{",
"$",
"arrays",
"=",
"func_get_args",
"(",
")",
";",
"$",
"base",
"=",
"array_shift",
"(",
"$",
"arrays",
")",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"base",
")",... | Merges any number of arrays.
array_merge_recursive() does indeed merge arrays, but it converts values with duplicate keys to arrays rather than overwriting the value in the first array with the duplicate value in the second array, as array_merge does.
@param array $array Any number of arrays.
@return array | [
"Merges",
"any",
"number",
"of",
"arrays",
"."
] | bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e | https://github.com/MINISTRYGmbH/morrow-core/blob/bdc916eedb14b65b06dbc88efbd2b7779f4a9a9e/src/Input.php#L168-L187 |
239,749 | delboy1978uk/bone | src/Mvc/Router/Route.php | Route.checkRoute | public function checkRoute($uri)
{
foreach($this->strings as $expression)
{
// check if it matches the pattern
$this->regex->setPattern($expression);
if($this->regex->getMatches($uri))
{
$this->matchedUriParts = explode('/',$uri);
... | php | public function checkRoute($uri)
{
foreach($this->strings as $expression)
{
// check if it matches the pattern
$this->regex->setPattern($expression);
if($this->regex->getMatches($uri))
{
$this->matchedUriParts = explode('/',$uri);
... | [
"public",
"function",
"checkRoute",
"(",
"$",
"uri",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"strings",
"as",
"$",
"expression",
")",
"{",
"// check if it matches the pattern",
"$",
"this",
"->",
"regex",
"->",
"setPattern",
"(",
"$",
"expression",
")",... | checks t' see if th' uri matches the regex routes
@param $uri
@return bool | [
"checks",
"t",
"see",
"if",
"th",
"uri",
"matches",
"the",
"regex",
"routes"
] | dd6200e9ec9e33234a0cb363e6a4ab60cc3e0268 | https://github.com/delboy1978uk/bone/blob/dd6200e9ec9e33234a0cb363e6a4ab60cc3e0268/src/Mvc/Router/Route.php#L104-L117 |
239,750 | delboy1978uk/bone | src/Mvc/Router/Route.php | Route.setStrings | private function setStrings()
{
/*
* Sift through the wreckage
*/
foreach($this->parts as $part)
{
$this->checkPart($part);
}
/*
* if there's still nuthin', we must be on the feckin' home page
*/
$this->strings[0] = ($... | php | private function setStrings()
{
/*
* Sift through the wreckage
*/
foreach($this->parts as $part)
{
$this->checkPart($part);
}
/*
* if there's still nuthin', we must be on the feckin' home page
*/
$this->strings[0] = ($... | [
"private",
"function",
"setStrings",
"(",
")",
"{",
"/*\n * Sift through the wreckage\n */",
"foreach",
"(",
"$",
"this",
"->",
"parts",
"as",
"$",
"part",
")",
"{",
"$",
"this",
"->",
"checkPart",
"(",
"$",
"part",
")",
";",
"}",
"/*\n ... | break the url t' smithereens! garrr! | [
"break",
"the",
"url",
"t",
"smithereens!",
"garrr!"
] | dd6200e9ec9e33234a0cb363e6a4ab60cc3e0268 | https://github.com/delboy1978uk/bone/blob/dd6200e9ec9e33234a0cb363e6a4ab60cc3e0268/src/Mvc/Router/Route.php#L133-L148 |
239,751 | delboy1978uk/bone | src/Mvc/Router/Route.php | Route.setOptionalStrings | private function setOptionalStrings()
{
/*
* Make another string t' check fer
*/
if($this->optional)
{
$this->strings[1] = $this->strings[0].Url::SLASH_WORD;
//reverse the fecker, if the longer one matches first, good!
$this->strings = a... | php | private function setOptionalStrings()
{
/*
* Make another string t' check fer
*/
if($this->optional)
{
$this->strings[1] = $this->strings[0].Url::SLASH_WORD;
//reverse the fecker, if the longer one matches first, good!
$this->strings = a... | [
"private",
"function",
"setOptionalStrings",
"(",
")",
"{",
"/*\n * Make another string t' check fer\n */",
"if",
"(",
"$",
"this",
"->",
"optional",
")",
"{",
"$",
"this",
"->",
"strings",
"[",
"1",
"]",
"=",
"$",
"this",
"->",
"strings",
"[",
... | checks fer the optional stuff | [
"checks",
"fer",
"the",
"optional",
"stuff"
] | dd6200e9ec9e33234a0cb363e6a4ab60cc3e0268 | https://github.com/delboy1978uk/bone/blob/dd6200e9ec9e33234a0cb363e6a4ab60cc3e0268/src/Mvc/Router/Route.php#L177-L188 |
239,752 | phergie/phergie-irc-plugin-react-eventfilter | src/UserFilter.php | UserFilter.filter | public function filter(EventInterface $event)
{
if (!$event instanceof UserEventInterface) {
return null;
}
$nick = $event->getNick();
if ($nick === null) {
return null;
}
$userMask = sprintf('%s!%s@%s',
$nick,
$event-... | php | public function filter(EventInterface $event)
{
if (!$event instanceof UserEventInterface) {
return null;
}
$nick = $event->getNick();
if ($nick === null) {
return null;
}
$userMask = sprintf('%s!%s@%s',
$nick,
$event-... | [
"public",
"function",
"filter",
"(",
"EventInterface",
"$",
"event",
")",
"{",
"if",
"(",
"!",
"$",
"event",
"instanceof",
"UserEventInterface",
")",
"{",
"return",
"null",
";",
"}",
"$",
"nick",
"=",
"$",
"event",
"->",
"getNick",
"(",
")",
";",
"if",... | Filters events that are not user-specific or are from the specified users.
@param \Phergie\Irc\Event\EventInterface $event
@return boolean|null TRUE if the event originated from a user with a matching mask
associated with this filter, FALSE if it originated from a user without a
matching mask, or NULL if it did not or... | [
"Filters",
"events",
"that",
"are",
"not",
"user",
"-",
"specific",
"or",
"are",
"from",
"the",
"specified",
"users",
"."
] | 8fdde571a23ab1379d62a48e9de4570845c0e9dd | https://github.com/phergie/phergie-irc-plugin-react-eventfilter/blob/8fdde571a23ab1379d62a48e9de4570845c0e9dd/src/UserFilter.php#L62-L92 |
239,753 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.Advanced | public function Advanced() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Load up config options we'll be setting
$Validation = new Gdn_Validation();
$ConfigurationModel = new Gdn_ConfigurationModel($Validation);
$ConfigurationModel->SetField(array(
... | php | public function Advanced() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Load up config options we'll be setting
$Validation = new Gdn_Validation();
$ConfigurationModel = new Gdn_ConfigurationModel($Validation);
$ConfigurationModel->SetField(array(
... | [
"public",
"function",
"Advanced",
"(",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"// Load up config options we'll be setting",
"$",
"Validation",
"=",
"new",
"Gdn_Validation",
"(",
")",
";",
"$",
"Co... | Advanced settings.
Allows setting configuration values via form elements.
@since 2.0.0
@access public | [
"Advanced",
"settings",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L37-L98 |
239,754 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.Initialize | public function Initialize() {
// Set up head
$this->Head = new HeadModule($this);
$this->AddJsFile('jquery.js');
$this->AddJsFile('jquery.livequery.js');
$this->AddJsFile('jquery.form.js');
$this->AddJsFile('jquery.popup.js');
$this->AddJsFile('jquery.gardenhandleajaxform.js')... | php | public function Initialize() {
// Set up head
$this->Head = new HeadModule($this);
$this->AddJsFile('jquery.js');
$this->AddJsFile('jquery.livequery.js');
$this->AddJsFile('jquery.form.js');
$this->AddJsFile('jquery.popup.js');
$this->AddJsFile('jquery.gardenhandleajaxform.js')... | [
"public",
"function",
"Initialize",
"(",
")",
"{",
"// Set up head",
"$",
"this",
"->",
"Head",
"=",
"new",
"HeadModule",
"(",
"$",
"this",
")",
";",
"$",
"this",
"->",
"AddJsFile",
"(",
"'jquery.js'",
")",
";",
"$",
"this",
"->",
"AddJsFile",
"(",
"'j... | Switch MasterView. Include JS, CSS used by all methods.
Always called by dispatcher before controller's requested method.
@since 2.0.0
@access public | [
"Switch",
"MasterView",
".",
"Include",
"JS",
"CSS",
"used",
"by",
"all",
"methods",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L119-L139 |
239,755 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.AddSideMenu | public function AddSideMenu($CurrentUrl) {
// Only add to the assets if this is not a view-only request
if ($this->_DeliveryType == DELIVERY_TYPE_ALL) {
$SideMenu = new SideMenuModule($this);
$SideMenu->HtmlId = '';
$SideMenu->HighlightRoute($CurrentUrl);
$SideMenu->Sort ... | php | public function AddSideMenu($CurrentUrl) {
// Only add to the assets if this is not a view-only request
if ($this->_DeliveryType == DELIVERY_TYPE_ALL) {
$SideMenu = new SideMenuModule($this);
$SideMenu->HtmlId = '';
$SideMenu->HighlightRoute($CurrentUrl);
$SideMenu->Sort ... | [
"public",
"function",
"AddSideMenu",
"(",
"$",
"CurrentUrl",
")",
"{",
"// Only add to the assets if this is not a view-only request",
"if",
"(",
"$",
"this",
"->",
"_DeliveryType",
"==",
"DELIVERY_TYPE_ALL",
")",
"{",
"$",
"SideMenu",
"=",
"new",
"SideMenuModule",
"(... | Configures navigation sidebar in Dashboard.
@since 2.0.0
@access public
@param $CurrentUrl Path to current location in dashboard. | [
"Configures",
"navigation",
"sidebar",
"in",
"Dashboard",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L149-L160 |
239,756 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.FloodControl | public function FloodControl() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Display options
$this->Title(T('Flood Control'));
$this->AddSideMenu('vanilla/settings/floodcontrol');
// Load up config options we'll be setting
$Validation = new... | php | public function FloodControl() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Display options
$this->Title(T('Flood Control'));
$this->AddSideMenu('vanilla/settings/floodcontrol');
// Load up config options we'll be setting
$Validation = new... | [
"public",
"function",
"FloodControl",
"(",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"// Display options",
"$",
"this",
"->",
"Title",
"(",
"T",
"(",
"'Flood Control'",
")",
")",
";",
"$",
"thi... | Display flood control options.
@since 2.0.0
@access public | [
"Display",
"flood",
"control",
"options",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L168-L221 |
239,757 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.AddCategory | public function AddCategory() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set up head
$this->AddJsFile('jquery.alphanumeric.js');
$this->AddJsFile('categories.js');
$this->AddJsFile('jquery.gardencheckboxgrid.js');
$this->Title(T('Add Category')... | php | public function AddCategory() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set up head
$this->AddJsFile('jquery.alphanumeric.js');
$this->AddJsFile('categories.js');
$this->AddJsFile('jquery.gardencheckboxgrid.js');
$this->Title(T('Add Category')... | [
"public",
"function",
"AddCategory",
"(",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"// Set up head",
"$",
"this",
"->",
"AddJsFile",
"(",
"'jquery.alphanumeric.js'",
")",
";",
"$",
"this",
"->",
... | Adding a new category.
@since 2.0.0
@access public | [
"Adding",
"a",
"new",
"category",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L229-L278 |
239,758 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.DeleteCategory | public function DeleteCategory($CategoryID = FALSE) {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set up head
$this->AddJsFile('categories.js');
$this->Title(T('Delete Category'));
$this->AddSideMenu('vanilla/settings/managecategories');
// Get c... | php | public function DeleteCategory($CategoryID = FALSE) {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set up head
$this->AddJsFile('categories.js');
$this->Title(T('Delete Category'));
$this->AddSideMenu('vanilla/settings/managecategories');
// Get c... | [
"public",
"function",
"DeleteCategory",
"(",
"$",
"CategoryID",
"=",
"FALSE",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"// Set up head",
"$",
"this",
"->",
"AddJsFile",
"(",
"'categories.js'",
")"... | Deleting a category.
@since 2.0.0
@access public
@param int $CategoryID Unique ID of the category to be deleted. | [
"Deleting",
"a",
"category",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L288-L368 |
239,759 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.DeleteCategoryPhoto | public function DeleteCategoryPhoto($CategoryID = FALSE, $TransientKey = '') {
// Check permission
$this->Permission('Garden.Settings.Manage');
$RedirectUrl = 'vanilla/settings/editcategory/'.$CategoryID;
if (Gdn::Session()->ValidateTransientKey($TransientKey)) {
// Do rem... | php | public function DeleteCategoryPhoto($CategoryID = FALSE, $TransientKey = '') {
// Check permission
$this->Permission('Garden.Settings.Manage');
$RedirectUrl = 'vanilla/settings/editcategory/'.$CategoryID;
if (Gdn::Session()->ValidateTransientKey($TransientKey)) {
// Do rem... | [
"public",
"function",
"DeleteCategoryPhoto",
"(",
"$",
"CategoryID",
"=",
"FALSE",
",",
"$",
"TransientKey",
"=",
"''",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"$",
"RedirectUrl",
"=",
"'vanill... | Deleting a category photo.
@since 2.1
@access public
@param int $CategoryID Unique ID of the category to have its photo deleted. | [
"Deleting",
"a",
"category",
"photo",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L378-L398 |
239,760 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.EditCategory | public function EditCategory($CategoryID = '') {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set up models
$RoleModel = new RoleModel();
$PermissionModel = Gdn::PermissionModel();
$this->Form->SetModel($this->CategoryModel);
if (!$CategoryI... | php | public function EditCategory($CategoryID = '') {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set up models
$RoleModel = new RoleModel();
$PermissionModel = Gdn::PermissionModel();
$this->Form->SetModel($this->CategoryModel);
if (!$CategoryI... | [
"public",
"function",
"EditCategory",
"(",
"$",
"CategoryID",
"=",
"''",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"// Set up models",
"$",
"RoleModel",
"=",
"new",
"RoleModel",
"(",
")",
";",
... | Editing a category.
@since 2.0.0
@access public
@param int $CategoryID Unique ID of the category to be updated. | [
"Editing",
"a",
"category",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L408-L482 |
239,761 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.ManageCategories | public function ManageCategories() {
// Check permission
$this->Permission('Garden.Settings.Manage');
$this->AddSideMenu('vanilla/settings/managecategories');
// Nested sortable always breaks when we update jQuery so we give it it's own old version of jquery.
$this->RemoveJsF... | php | public function ManageCategories() {
// Check permission
$this->Permission('Garden.Settings.Manage');
$this->AddSideMenu('vanilla/settings/managecategories');
// Nested sortable always breaks when we update jQuery so we give it it's own old version of jquery.
$this->RemoveJsF... | [
"public",
"function",
"ManageCategories",
"(",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"$",
"this",
"->",
"AddSideMenu",
"(",
"'vanilla/settings/managecategories'",
")",
";",
"// Nested sortable always... | Enabling and disabling categories from list.
@since 2.0.0
@access public | [
"Enabling",
"and",
"disabling",
"categories",
"from",
"list",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L490-L551 |
239,762 | bishopb/vanilla | applications/vanilla/controllers/class.settingscontroller.php | SettingsController.SortCategories | public function SortCategories() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set delivery type to true/false
$TransientKey = GetIncomingValue('TransientKey');
if (Gdn::Request()->IsPostBack()) {
$TreeArray = GetValue('TreeArray', $_POST);
... | php | public function SortCategories() {
// Check permission
$this->Permission('Garden.Settings.Manage');
// Set delivery type to true/false
$TransientKey = GetIncomingValue('TransientKey');
if (Gdn::Request()->IsPostBack()) {
$TreeArray = GetValue('TreeArray', $_POST);
... | [
"public",
"function",
"SortCategories",
"(",
")",
"{",
"// Check permission",
"$",
"this",
"->",
"Permission",
"(",
"'Garden.Settings.Manage'",
")",
";",
"// Set delivery type to true/false",
"$",
"TransientKey",
"=",
"GetIncomingValue",
"(",
"'TransientKey'",
")",
";",... | Sorting display order of categories.
Accessed by ajax so its default is to only output true/false.
@since 2.0.0
@access public | [
"Sorting",
"display",
"order",
"of",
"categories",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.settingscontroller.php#L561-L576 |
239,763 | larriereguichet/DoctrineRepositoryBundle | Repository/RepositoryPool.php | RepositoryPool.get | public function get($className)
{
if (!$this->has($className)) {
throw new Exception('Repository ' . $className . ' not found');
}
return $this->pool[$className];
} | php | public function get($className)
{
if (!$this->has($className)) {
throw new Exception('Repository ' . $className . ' not found');
}
return $this->pool[$className];
} | [
"public",
"function",
"get",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"has",
"(",
"$",
"className",
")",
")",
"{",
"throw",
"new",
"Exception",
"(",
"'Repository '",
".",
"$",
"className",
".",
"' not found'",
")",
";",
"}"... | Return a doctrine repository according to its class name
@param $className
@return DoctrineRepository
@throws Exception | [
"Return",
"a",
"doctrine",
"repository",
"according",
"to",
"its",
"class",
"name"
] | d98e91d115a6c9f0fe9e9fb03de92f1268b51c10 | https://github.com/larriereguichet/DoctrineRepositoryBundle/blob/d98e91d115a6c9f0fe9e9fb03de92f1268b51c10/Repository/RepositoryPool.php#L31-L37 |
239,764 | AlcyZ/Alcys-ORM | src/Core/Db/Facade/SelectFacade.php | SelectFacade.table | public function table($tableName, $alias = null)
{
$table = $this->factory->references('Table', $tableName, $alias);
$this->select->table($table);
return $this;
} | php | public function table($tableName, $alias = null)
{
$table = $this->factory->references('Table', $tableName, $alias);
$this->select->table($table);
return $this;
} | [
"public",
"function",
"table",
"(",
"$",
"tableName",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"factory",
"->",
"references",
"(",
"'Table'",
",",
"$",
"tableName",
",",
"$",
"alias",
")",
";",
"$",
"this",
"-... | Add a table to the query.
@param string $tableName The name of the table.
@param string|null $alias (Optional) An alias name, if exists.
@return $this The same instance to concatenate methods. | [
"Add",
"a",
"table",
"to",
"the",
"query",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/Facade/SelectFacade.php#L119-L125 |
239,765 | AlcyZ/Alcys-ORM | src/Core/Db/Facade/SelectFacade.php | SelectFacade.limit | public function limit($beginAmount, $amount = null)
{
$beginObj = new Numeric((int)$beginAmount);
$amountObj = ($amount) ? new Numeric((int)$amount) : null;
$this->select->limit($beginObj, $amountObj);
return $this;
} | php | public function limit($beginAmount, $amount = null)
{
$beginObj = new Numeric((int)$beginAmount);
$amountObj = ($amount) ? new Numeric((int)$amount) : null;
$this->select->limit($beginObj, $amountObj);
return $this;
} | [
"public",
"function",
"limit",
"(",
"$",
"beginAmount",
",",
"$",
"amount",
"=",
"null",
")",
"{",
"$",
"beginObj",
"=",
"new",
"Numeric",
"(",
"(",
"int",
")",
"$",
"beginAmount",
")",
";",
"$",
"amountObj",
"=",
"(",
"$",
"amount",
")",
"?",
"new... | Add a limit expression to the query.
@param int $beginAmount Amount if only one arg isset, if two, the first entry which will used.
@param int|null $amount (Optional) Amount of entries which.
@return $this The same instance to concatenate methods. | [
"Add",
"a",
"limit",
"expression",
"to",
"the",
"query",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/Facade/SelectFacade.php#L172-L180 |
239,766 | AlcyZ/Alcys-ORM | src/Core/Db/Facade/SelectFacade.php | SelectFacade.groupBy | public function groupBy($column, $orderMode = null)
{
$columnObj = $this->factory->references('Column', $column);
$orderModeObj = ($orderMode) ? $this->factory->references('OrderModeEnum', $orderMode) : null;
$this->select->groupBy($columnObj, $orderModeObj);
return $this;
} | php | public function groupBy($column, $orderMode = null)
{
$columnObj = $this->factory->references('Column', $column);
$orderModeObj = ($orderMode) ? $this->factory->references('OrderModeEnum', $orderMode) : null;
$this->select->groupBy($columnObj, $orderModeObj);
return $this;
} | [
"public",
"function",
"groupBy",
"(",
"$",
"column",
",",
"$",
"orderMode",
"=",
"null",
")",
"{",
"$",
"columnObj",
"=",
"$",
"this",
"->",
"factory",
"->",
"references",
"(",
"'Column'",
",",
"$",
"column",
")",
";",
"$",
"orderModeObj",
"=",
"(",
... | Add a group by expression to the query.
@param string $column
@param string|null $orderMode
@return $this The same instance to concatenate methods | [
"Add",
"a",
"group",
"by",
"expression",
"to",
"the",
"query",
"."
] | dd30946ad35ab06cba2167cf6dfa02b733614720 | https://github.com/AlcyZ/Alcys-ORM/blob/dd30946ad35ab06cba2167cf6dfa02b733614720/src/Core/Db/Facade/SelectFacade.php#L191-L198 |
239,767 | TechPromux/TechPromuxDynamicQueryBundle | Manager/DataSourceManager.php | DataSourceManager.createDoctrineDBALConnection | public function createDoctrineDBALConnection($driver, $host, $port, $dbname, $user, $password)
{
// TODO caching for connection
$connectionFactory = $this->getDoctrineConnectionFactory();
$connection = $connectionFactory->createConnection(array(
'driver' => $driver,
... | php | public function createDoctrineDBALConnection($driver, $host, $port, $dbname, $user, $password)
{
// TODO caching for connection
$connectionFactory = $this->getDoctrineConnectionFactory();
$connection = $connectionFactory->createConnection(array(
'driver' => $driver,
... | [
"public",
"function",
"createDoctrineDBALConnection",
"(",
"$",
"driver",
",",
"$",
"host",
",",
"$",
"port",
",",
"$",
"dbname",
",",
"$",
"user",
",",
"$",
"password",
")",
"{",
"// TODO caching for connection",
"$",
"connectionFactory",
"=",
"$",
"this",
... | Creates a Doctrine DBAL Connection
@param string $driver
@param string $host
@param string $port
@param string $dbname
@param string $user
@param string $password
@return \Doctrine\DBAL\Connection | [
"Creates",
"a",
"Doctrine",
"DBAL",
"Connection"
] | aadee662ce88e37443f32b110126f835fc1a6fd8 | https://github.com/TechPromux/TechPromuxDynamicQueryBundle/blob/aadee662ce88e37443f32b110126f835fc1a6fd8/Manager/DataSourceManager.php#L120-L136 |
239,768 | TechPromux/TechPromuxDynamicQueryBundle | Manager/DataSourceManager.php | DataSourceManager.getSQLResultFromConnection | protected function getSQLResultFromConnection($connection, $sql, array $params = array())
{
$result = $connection->fetchAll($sql, $params);
return $result;
} | php | protected function getSQLResultFromConnection($connection, $sql, array $params = array())
{
$result = $connection->fetchAll($sql, $params);
return $result;
} | [
"protected",
"function",
"getSQLResultFromConnection",
"(",
"$",
"connection",
",",
"$",
"sql",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"$",
"connection",
"->",
"fetchAll",
"(",
"$",
"sql",
",",
"$",
"params",
... | Permite ejecutar una consulta de tipo SELECT
@param \Doctrine\DBAL\Connection $connection
@param string $sql
@return array | [
"Permite",
"ejecutar",
"una",
"consulta",
"de",
"tipo",
"SELECT"
] | aadee662ce88e37443f32b110126f835fc1a6fd8 | https://github.com/TechPromux/TechPromuxDynamicQueryBundle/blob/aadee662ce88e37443f32b110126f835fc1a6fd8/Manager/DataSourceManager.php#L206-L210 |
239,769 | razielsd/webdriverlib | WebDriver/WebDriver/Server/Appium.php | WebDriver_Server_Appium.findByXpath | public function findByXpath($locator)
{
$locator = \Normalizer::normalize($locator, \Normalizer::FORM_D);
return parent::find($locator);
} | php | public function findByXpath($locator)
{
$locator = \Normalizer::normalize($locator, \Normalizer::FORM_D);
return parent::find($locator);
} | [
"public",
"function",
"findByXpath",
"(",
"$",
"locator",
")",
"{",
"$",
"locator",
"=",
"\\",
"Normalizer",
"::",
"normalize",
"(",
"$",
"locator",
",",
"\\",
"Normalizer",
"::",
"FORM_D",
")",
";",
"return",
"parent",
"::",
"find",
"(",
"$",
"locator",... | Get page element using normalized locator for xpath UTF strings
@param $locator
@return WebDriver_Element | [
"Get",
"page",
"element",
"using",
"normalized",
"locator",
"for",
"xpath",
"UTF",
"strings"
] | e498afc36a8cdeab5b6ca95016420557baf32f36 | https://github.com/razielsd/webdriverlib/blob/e498afc36a8cdeab5b6ca95016420557baf32f36/WebDriver/WebDriver/Server/Appium.php#L13-L17 |
239,770 | movicon/movicon-http | src/http/HttpController.php | HttpController.on | public function on($method, $listener)
{
if (!array_key_exists($method, $this->_listeners)) {
$this->_listeners[$method] = [];
}
array_push($this->_listeners[$method], $listener);
} | php | public function on($method, $listener)
{
if (!array_key_exists($method, $this->_listeners)) {
$this->_listeners[$method] = [];
}
array_push($this->_listeners[$method], $listener);
} | [
"public",
"function",
"on",
"(",
"$",
"method",
",",
"$",
"listener",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"method",
",",
"$",
"this",
"->",
"_listeners",
")",
")",
"{",
"$",
"this",
"->",
"_listeners",
"[",
"$",
"method",
"]",
"... | Adds a request listener.
Example:
$c = new HttpController();
$c->on("PUT", function () {
echo "Processing PUT request\n";
});
$c->processRequest();
@param string $method Method name (GET, POST, PUT, etc...)
@param callable $listener Request listener
@return void | [
"Adds",
"a",
"request",
"listener",
"."
] | ae9e4aa763c52f272c628fef0ec4496478312355 | https://github.com/movicon/movicon-http/blob/ae9e4aa763c52f272c628fef0ec4496478312355/src/http/HttpController.php#L94-L101 |
239,771 | wasabi-cms/core | src/Enum/EnumTrait.php | EnumTrait.getConstants | public static function getConstants()
{
if (empty(self::$_constantsCache)) {
$reflectionClass = new \ReflectionClass(get_called_class());
self::$_constantsCache = $reflectionClass->getConstants();
}
return self::$_constantsCache;
} | php | public static function getConstants()
{
if (empty(self::$_constantsCache)) {
$reflectionClass = new \ReflectionClass(get_called_class());
self::$_constantsCache = $reflectionClass->getConstants();
}
return self::$_constantsCache;
} | [
"public",
"static",
"function",
"getConstants",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"self",
"::",
"$",
"_constantsCache",
")",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"get_called_class",
"(",
")",
")",
";",
"self",
... | Get and cache all constants of for this enum.
@return array | [
"Get",
"and",
"cache",
"all",
"constants",
"of",
"for",
"this",
"enum",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Enum/EnumTrait.php#L34-L41 |
239,772 | wasabi-cms/core | src/Enum/EnumTrait.php | EnumTrait.getConstantConfigByValue | public static function getConstantConfigByValue($value)
{
foreach (self::getConstants() as $constant) {
if ($constant['value'] === $value) {
return $constant;
}
}
return false;
} | php | public static function getConstantConfigByValue($value)
{
foreach (self::getConstants() as $constant) {
if ($constant['value'] === $value) {
return $constant;
}
}
return false;
} | [
"public",
"static",
"function",
"getConstantConfigByValue",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"self",
"::",
"getConstants",
"(",
")",
"as",
"$",
"constant",
")",
"{",
"if",
"(",
"$",
"constant",
"[",
"'value'",
"]",
"===",
"$",
"value",
")",
... | Get a single enum constant configuration for a specific value.
@param int|string $value The value to find a constant config for.
@return array|bool | [
"Get",
"a",
"single",
"enum",
"constant",
"configuration",
"for",
"a",
"specific",
"value",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Enum/EnumTrait.php#L69-L77 |
239,773 | wasabi-cms/core | src/Enum/EnumTrait.php | EnumTrait.getNameForValue | public static function getNameForValue($value)
{
foreach (self::getConstants() as $constant) {
if ($constant['value'] === $value) {
return $constant['name'];
}
}
return false;
} | php | public static function getNameForValue($value)
{
foreach (self::getConstants() as $constant) {
if ($constant['value'] === $value) {
return $constant['name'];
}
}
return false;
} | [
"public",
"static",
"function",
"getNameForValue",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"self",
"::",
"getConstants",
"(",
")",
"as",
"$",
"constant",
")",
"{",
"if",
"(",
"$",
"constant",
"[",
"'value'",
"]",
"===",
"$",
"value",
")",
"{",
"... | Get the descriptive name for the given value.
@param int|string $value The value to get the name of a constant for.
@return bool|string | [
"Get",
"the",
"descriptive",
"name",
"for",
"the",
"given",
"value",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Enum/EnumTrait.php#L85-L93 |
239,774 | wasabi-cms/core | src/Enum/EnumTrait.php | EnumTrait.getValueForName | public static function getValueForName($name)
{
foreach (self::getConstants() as $constant) {
if ($constant['name'] === $name) {
return $constant['value'];
}
}
return false;
} | php | public static function getValueForName($name)
{
foreach (self::getConstants() as $constant) {
if ($constant['name'] === $name) {
return $constant['value'];
}
}
return false;
} | [
"public",
"static",
"function",
"getValueForName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"self",
"::",
"getConstants",
"(",
")",
"as",
"$",
"constant",
")",
"{",
"if",
"(",
"$",
"constant",
"[",
"'name'",
"]",
"===",
"$",
"name",
")",
"{",
"ret... | Get the descriptive value for the given name.
@param int|string $name The name to get the value of a constant for.
@return bool|string | [
"Get",
"the",
"descriptive",
"value",
"for",
"the",
"given",
"name",
"."
] | 0eadbb64d2fc201bacc63c93814adeca70e08f90 | https://github.com/wasabi-cms/core/blob/0eadbb64d2fc201bacc63c93814adeca70e08f90/src/Enum/EnumTrait.php#L101-L109 |
239,775 | frankfoerster/cakephp-filter | src/View/Helper/FilterHelper.php | FilterHelper.pagination | public function pagination($maxPageNumbers = 10, $itemType = 'Items', $class = '', $element = 'Filter/pagination', $passParams = [])
{
if (empty($this->paginationParams)) {
return '';
}
$this->_passParams = array_merge($this->paginationParams['passParams'], $passParams);
... | php | public function pagination($maxPageNumbers = 10, $itemType = 'Items', $class = '', $element = 'Filter/pagination', $passParams = [])
{
if (empty($this->paginationParams)) {
return '';
}
$this->_passParams = array_merge($this->paginationParams['passParams'], $passParams);
... | [
"public",
"function",
"pagination",
"(",
"$",
"maxPageNumbers",
"=",
"10",
",",
"$",
"itemType",
"=",
"'Items'",
",",
"$",
"class",
"=",
"''",
",",
"$",
"element",
"=",
"'Filter/pagination'",
",",
"$",
"passParams",
"=",
"[",
"]",
")",
"{",
"if",
"(",
... | Render the pagination.
@param int $maxPageNumbers The maximum number of pages to show in the link list.
@param string $itemType The item type that is paginated.
@param string $class An optional css class for the pagination.
@param string $element The pagination element to render.
@param array $passParams Optional para... | [
"Render",
"the",
"pagination",
"."
] | 539ec2d5c01c9b00766a6db98b60f32832fa5dee | https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/View/Helper/FilterHelper.php#L142-L204 |
239,776 | frankfoerster/cakephp-filter | src/View/Helper/FilterHelper.php | FilterHelper._getFilterUrl | protected function _getFilterUrl($withLimit = true)
{
$url = [
'plugin' => $this->request->getParam('plugin'),
'controller' => $this->request->getParam('controller'),
'action' => $this->request->getParam('action'),
];
foreach($this->_passParams as $name =... | php | protected function _getFilterUrl($withLimit = true)
{
$url = [
'plugin' => $this->request->getParam('plugin'),
'controller' => $this->request->getParam('controller'),
'action' => $this->request->getParam('action'),
];
foreach($this->_passParams as $name =... | [
"protected",
"function",
"_getFilterUrl",
"(",
"$",
"withLimit",
"=",
"true",
")",
"{",
"$",
"url",
"=",
"[",
"'plugin'",
"=>",
"$",
"this",
"->",
"request",
"->",
"getParam",
"(",
"'plugin'",
")",
",",
"'controller'",
"=>",
"$",
"this",
"->",
"request",... | Get the filter url.
@param boolean $withLimit
@return array | [
"Get",
"the",
"filter",
"url",
"."
] | 539ec2d5c01c9b00766a6db98b60f32832fa5dee | https://github.com/frankfoerster/cakephp-filter/blob/539ec2d5c01c9b00766a6db98b60f32832fa5dee/src/View/Helper/FilterHelper.php#L296-L319 |
239,777 | fond-of/active-campaign | src/Service/Contact.php | Contact.getByEmail | public function getByEmail($email)
{
if (!is_string($email) || empty($email)) {
return null;
}
$parameters = array(
'api_action' => 'contact_view_email',
'email' => $email
);
$response = $this->request($parameters);
if ($respon... | php | public function getByEmail($email)
{
if (!is_string($email) || empty($email)) {
return null;
}
$parameters = array(
'api_action' => 'contact_view_email',
'email' => $email
);
$response = $this->request($parameters);
if ($respon... | [
"public",
"function",
"getByEmail",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"email",
")",
"||",
"empty",
"(",
"$",
"email",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"parameters",
"=",
"array",
"(",
"'api_action'",
... | Retrieve by email
@param $email
@return null|\FondOfPHP\ActiveCampaign\DataTransferObject\Contact | [
"Retrieve",
"by",
"email"
] | 389e6c3ca4e39f2f94f92a9673fe3207a9d15807 | https://github.com/fond-of/active-campaign/blob/389e6c3ca4e39f2f94f92a9673fe3207a9d15807/src/Service/Contact.php#L15-L41 |
239,778 | asbsoft/yii2-common_2_170212 | models/QueryTrait.php | QueryTrait.hasJoin | public function hasJoin($aliasOrTable)
{
if ($this->join) {
foreach ($this->join as $join) {
$secondJoinParam = $join[1];
if (is_array($secondJoinParam)) {
list($key, $val) = each($secondJoinParam);
if ($key == $alias... | php | public function hasJoin($aliasOrTable)
{
if ($this->join) {
foreach ($this->join as $join) {
$secondJoinParam = $join[1];
if (is_array($secondJoinParam)) {
list($key, $val) = each($secondJoinParam);
if ($key == $alias... | [
"public",
"function",
"hasJoin",
"(",
"$",
"aliasOrTable",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"join",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"join",
"as",
"$",
"join",
")",
"{",
"$",
"secondJoinParam",
"=",
"$",
"join",
"[",
"1",
"]",
... | Check if join already exists.
Useful to prevent double joins.
@param string $aliasOrTable for alias is string without quotes, for table - in format '{{%tablename}}'
@return bool | [
"Check",
"if",
"join",
"already",
"exists",
".",
"Useful",
"to",
"prevent",
"double",
"joins",
"."
] | 6c58012ff89225d7d4e42b200cf39e009e9d9dac | https://github.com/asbsoft/yii2-common_2_170212/blob/6c58012ff89225d7d4e42b200cf39e009e9d9dac/models/QueryTrait.php#L17-L48 |
239,779 | dan-har/presentit | src/Resource/Collection.php | Collection.transform | public function transform()
{
$presentation = [];
if( ! $this->transformer) {
return $presentation;
}
foreach ($this->resource as $key => $resource) {
$presentation[$key] = Item::create($resource)->setTransformer($this->transformer)->transform();
}
... | php | public function transform()
{
$presentation = [];
if( ! $this->transformer) {
return $presentation;
}
foreach ($this->resource as $key => $resource) {
$presentation[$key] = Item::create($resource)->setTransformer($this->transformer)->transform();
}
... | [
"public",
"function",
"transform",
"(",
")",
"{",
"$",
"presentation",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"transformer",
")",
"{",
"return",
"$",
"presentation",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"resource",
"as",
"$",
... | Present each item of the collection using a transformer.
@return array | [
"Present",
"each",
"item",
"of",
"the",
"collection",
"using",
"a",
"transformer",
"."
] | 283db977d5b6d91bc2c139ec377c05010935682d | https://github.com/dan-har/presentit/blob/283db977d5b6d91bc2c139ec377c05010935682d/src/Resource/Collection.php#L57-L70 |
239,780 | MichaelJ2324/OO-cURL | src/Request/File.php | File.configureHTTPMethod | protected function configureHTTPMethod($method) {
switch($method){
case self::HTTP_GET:
$this->removeHeader('Content-Type');
break;
case self::HTTP_POST:
case self::HTTP_PUT:
$this->addHeader("Content-Type", "multipart/form-data... | php | protected function configureHTTPMethod($method) {
switch($method){
case self::HTTP_GET:
$this->removeHeader('Content-Type');
break;
case self::HTTP_POST:
case self::HTTP_PUT:
$this->addHeader("Content-Type", "multipart/form-data... | [
"protected",
"function",
"configureHTTPMethod",
"(",
"$",
"method",
")",
"{",
"switch",
"(",
"$",
"method",
")",
"{",
"case",
"self",
"::",
"HTTP_GET",
":",
"$",
"this",
"->",
"removeHeader",
"(",
"'Content-Type'",
")",
";",
"break",
";",
"case",
"self",
... | Configure Headers for File Requests based on HTTP Method
@inheritdoc | [
"Configure",
"Headers",
"for",
"File",
"Requests",
"based",
"on",
"HTTP",
"Method"
] | 067a29f7e5fe1941d870819658952be6d4a1f9b4 | https://github.com/MichaelJ2324/OO-cURL/blob/067a29f7e5fe1941d870819658952be6d4a1f9b4/src/Request/File.php#L30-L40 |
239,781 | ridvanbaluyos/chikka | src/Ridvanbaluyos/Chikka/Chikka.php | Chikka._init | protected function _init()
{
$this->url = Config::get('chikka::url');
$this->client_id = Config::get('chikka::client_id');
$this->secret_key = Config::get('chikka::secret_key');
$this->short_code = Config::get('chikka::short_code');
} | php | protected function _init()
{
$this->url = Config::get('chikka::url');
$this->client_id = Config::get('chikka::client_id');
$this->secret_key = Config::get('chikka::secret_key');
$this->short_code = Config::get('chikka::short_code');
} | [
"protected",
"function",
"_init",
"(",
")",
"{",
"$",
"this",
"->",
"url",
"=",
"Config",
"::",
"get",
"(",
"'chikka::url'",
")",
";",
"$",
"this",
"->",
"client_id",
"=",
"Config",
"::",
"get",
"(",
"'chikka::client_id'",
")",
";",
"$",
"this",
"->",
... | Initialise chikka configuration
@return void | [
"Initialise",
"chikka",
"configuration"
] | a8d7e2cdbbb7d0beceb22330d68e979b8801d9af | https://github.com/ridvanbaluyos/chikka/blob/a8d7e2cdbbb7d0beceb22330d68e979b8801d9af/src/Ridvanbaluyos/Chikka/Chikka.php#L25-L31 |
239,782 | faithmade/churchthemes | includes/classes/widget.php | CTFW_Widget.ctc_sanitize | function ctc_sanitize( $instance ) { // prefix in case WP core adds method with same name
global $allowedposttags;
// Array to add sanitized values to
$sanitized_instance = array();
// Loop valid fields to sanitize
$fields = $this->ctc_prepared_fields();
foreach ( $fields as $id => $field ) {
// Get ... | php | function ctc_sanitize( $instance ) { // prefix in case WP core adds method with same name
global $allowedposttags;
// Array to add sanitized values to
$sanitized_instance = array();
// Loop valid fields to sanitize
$fields = $this->ctc_prepared_fields();
foreach ( $fields as $id => $field ) {
// Get ... | [
"function",
"ctc_sanitize",
"(",
"$",
"instance",
")",
"{",
"// prefix in case WP core adds method with same name",
"global",
"$",
"allowedposttags",
";",
"// Array to add sanitized values to",
"$",
"sanitized_instance",
"=",
"array",
"(",
")",
";",
"// Loop valid fields to s... | Sanitize field values
Used before saving and before providing instance to widget template.
@since 0.9
@param array $instance Widget instance
@return array Sanitized instance | [
"Sanitize",
"field",
"values"
] | b121e840edaec8fdb3189fc9324cc88d7a0db81c | https://github.com/faithmade/churchthemes/blob/b121e840edaec8fdb3189fc9324cc88d7a0db81c/includes/classes/widget.php#L363-L478 |
239,783 | faithmade/churchthemes | includes/classes/widget.php | CTFW_Widget.widget | function widget( $args, $instance ) {
global $post; // setup_postdata() needs this
// Available widgets
$widgets = ChurchThemeFrameworkWidgets::widgetList();
// Get template filename
$template_file = $widgets[$this->id_base]['template_file'];
// Check if template exists
$template_path = CTFW_WIDGETS_W... | php | function widget( $args, $instance ) {
global $post; // setup_postdata() needs this
// Available widgets
$widgets = ChurchThemeFrameworkWidgets::widgetList();
// Get template filename
$template_file = $widgets[$this->id_base]['template_file'];
// Check if template exists
$template_path = CTFW_WIDGETS_W... | [
"function",
"widget",
"(",
"$",
"args",
",",
"$",
"instance",
")",
"{",
"global",
"$",
"post",
";",
"// setup_postdata() needs this",
"// Available widgets",
"$",
"widgets",
"=",
"ChurchThemeFrameworkWidgets",
"::",
"widgetList",
"(",
")",
";",
"// Get template file... | Front-end display of widget
Load template from parent or child theme if exists.
@since 0.9
@param array $args Widget arguments
@param array $instance Widget instance | [
"Front",
"-",
"end",
"display",
"of",
"widget"
] | b121e840edaec8fdb3189fc9324cc88d7a0db81c | https://github.com/faithmade/churchthemes/blob/b121e840edaec8fdb3189fc9324cc88d7a0db81c/includes/classes/widget.php#L507-L531 |
239,784 | vworldat/MenuBundle | Menu/Menu.php | Menu.initialize | protected function initialize()
{
$itemData = $this->getItemData();
$itemsMerged = array();
foreach ($itemData as $key => $itemOptions)
{
$itemsMerged[$key] = array_merge($this->defaults, $itemOptions);
if (isset($itemsMerged[$key]['children']['.defaults']))... | php | protected function initialize()
{
$itemData = $this->getItemData();
$itemsMerged = array();
foreach ($itemData as $key => $itemOptions)
{
$itemsMerged[$key] = array_merge($this->defaults, $itemOptions);
if (isset($itemsMerged[$key]['children']['.defaults']))... | [
"protected",
"function",
"initialize",
"(",
")",
"{",
"$",
"itemData",
"=",
"$",
"this",
"->",
"getItemData",
"(",
")",
";",
"$",
"itemsMerged",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"itemData",
"as",
"$",
"key",
"=>",
"$",
"itemOptions",
... | Initialize base menu item and its children | [
"Initialize",
"base",
"menu",
"item",
"and",
"its",
"children"
] | 136e5ee859c3be95a199a7207fa5aacc5ccb26ec | https://github.com/vworldat/MenuBundle/blob/136e5ee859c3be95a199a7207fa5aacc5ccb26ec/Menu/Menu.php#L89-L113 |
239,785 | vworldat/MenuBundle | Menu/Menu.php | Menu.createItem | public function createItem($itemRouteName, array $itemOptions)
{
if (isset($itemOptions['item_class']))
{
$class = $itemOptions['item_class'];
}
else
{
$class = $this->getDefaultItemClass();
}
if (isset($this->itemClassAliases[$class])... | php | public function createItem($itemRouteName, array $itemOptions)
{
if (isset($itemOptions['item_class']))
{
$class = $itemOptions['item_class'];
}
else
{
$class = $this->getDefaultItemClass();
}
if (isset($this->itemClassAliases[$class])... | [
"public",
"function",
"createItem",
"(",
"$",
"itemRouteName",
",",
"array",
"$",
"itemOptions",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"itemOptions",
"[",
"'item_class'",
"]",
")",
")",
"{",
"$",
"class",
"=",
"$",
"itemOptions",
"[",
"'item_class'",
"... | MenuItem factory method.
@param string $itemRouteName
@param array $itemOptions
@throws NoMenuItemClassException
@return MenuItem | [
"MenuItem",
"factory",
"method",
"."
] | 136e5ee859c3be95a199a7207fa5aacc5ccb26ec | https://github.com/vworldat/MenuBundle/blob/136e5ee859c3be95a199a7207fa5aacc5ccb26ec/Menu/Menu.php#L124-L148 |
239,786 | vworldat/MenuBundle | Menu/Menu.php | Menu.getBreadcrumbItems | public function getBreadcrumbItems()
{
$item = $this->getBaseItem();
$items = array();
while ($current = $item->getCurrentChild())
{
$items[] = $current;
$item = $current;
}
return $items;
} | php | public function getBreadcrumbItems()
{
$item = $this->getBaseItem();
$items = array();
while ($current = $item->getCurrentChild())
{
$items[] = $current;
$item = $current;
}
return $items;
} | [
"public",
"function",
"getBreadcrumbItems",
"(",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"getBaseItem",
"(",
")",
";",
"$",
"items",
"=",
"array",
"(",
")",
";",
"while",
"(",
"$",
"current",
"=",
"$",
"item",
"->",
"getCurrentChild",
"(",
")"... | Get all items on the current item's path, starting with the lowest. Useful for breadcrumb rendering.
@return array | [
"Get",
"all",
"items",
"on",
"the",
"current",
"item",
"s",
"path",
"starting",
"with",
"the",
"lowest",
".",
"Useful",
"for",
"breadcrumb",
"rendering",
"."
] | 136e5ee859c3be95a199a7207fa5aacc5ccb26ec | https://github.com/vworldat/MenuBundle/blob/136e5ee859c3be95a199a7207fa5aacc5ccb26ec/Menu/Menu.php#L181-L194 |
239,787 | vworldat/MenuBundle | Menu/Menu.php | Menu.isValidMenuItemClass | protected function isValidMenuItemClass($className)
{
if (!isset($this->checkedClasses[$className]))
{
$this->checkedClasses[$className] = $this->hasParentClass($className, 'C33s\\MenuBundle\\Item\\MenuItem');
}
return $this->checkedClasses[$className];
} | php | protected function isValidMenuItemClass($className)
{
if (!isset($this->checkedClasses[$className]))
{
$this->checkedClasses[$className] = $this->hasParentClass($className, 'C33s\\MenuBundle\\Item\\MenuItem');
}
return $this->checkedClasses[$className];
} | [
"protected",
"function",
"isValidMenuItemClass",
"(",
"$",
"className",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"checkedClasses",
"[",
"$",
"className",
"]",
")",
")",
"{",
"$",
"this",
"->",
"checkedClasses",
"[",
"$",
"className",
"]... | Check if the given class is a valid MenuItem class.
@param string $className
@return boolean | [
"Check",
"if",
"the",
"given",
"class",
"is",
"a",
"valid",
"MenuItem",
"class",
"."
] | 136e5ee859c3be95a199a7207fa5aacc5ccb26ec | https://github.com/vworldat/MenuBundle/blob/136e5ee859c3be95a199a7207fa5aacc5ccb26ec/Menu/Menu.php#L228-L236 |
239,788 | teamelf/core | src/Application/Server.php | Server.boot | protected function boot(): void
{
// boot extensions
foreach ($this->extensionManager->getExtensions() as $extension) {
if ($extension->isActivated()) {
$extension->boot();
}
}
// boot app
$this->dispatch(new RoutesWillBeLoaded($this->... | php | protected function boot(): void
{
// boot extensions
foreach ($this->extensionManager->getExtensions() as $extension) {
if ($extension->isActivated()) {
$extension->boot();
}
}
// boot app
$this->dispatch(new RoutesWillBeLoaded($this->... | [
"protected",
"function",
"boot",
"(",
")",
":",
"void",
"{",
"// boot extensions",
"foreach",
"(",
"$",
"this",
"->",
"extensionManager",
"->",
"getExtensions",
"(",
")",
"as",
"$",
"extension",
")",
"{",
"if",
"(",
"$",
"extension",
"->",
"isActivated",
"... | boot all services
@throws HttpMethodNotAllowedException
@throws HttpNotFoundException | [
"boot",
"all",
"services"
] | 653fc6e27f42239c2a8998a5fea325480e9dd39e | https://github.com/teamelf/core/blob/653fc6e27f42239c2a8998a5fea325480e9dd39e/src/Application/Server.php#L66-L90 |
239,789 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Action.php | PHP_ParserGenerator_Action.actioncmp | static function actioncmp(PHP_ParserGenerator_Action $ap1, PHP_ParserGenerator_Action $ap2)
{
$rc = $ap1->sp->index - $ap2->sp->index;
if ($rc === 0) {
$rc = $ap1->type - $ap2->type;
}
if ($rc === 0) {
if ($ap1->type == self::SHIFT) {
if ($ap1-... | php | static function actioncmp(PHP_ParserGenerator_Action $ap1, PHP_ParserGenerator_Action $ap2)
{
$rc = $ap1->sp->index - $ap2->sp->index;
if ($rc === 0) {
$rc = $ap1->type - $ap2->type;
}
if ($rc === 0) {
if ($ap1->type == self::SHIFT) {
if ($ap1-... | [
"static",
"function",
"actioncmp",
"(",
"PHP_ParserGenerator_Action",
"$",
"ap1",
",",
"PHP_ParserGenerator_Action",
"$",
"ap2",
")",
"{",
"$",
"rc",
"=",
"$",
"ap1",
"->",
"sp",
"->",
"index",
"-",
"$",
"ap2",
"->",
"sp",
"->",
"index",
";",
"if",
"(",
... | Compare two actions
This is used by {@link Action_sort()} to compare actions | [
"Compare",
"two",
"actions"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Action.php#L122-L159 |
239,790 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Action.php | PHP_ParserGenerator_Action.Action_add | static function Action_add(&$app, $type, PHP_ParserGenerator_Symbol $sp, $arg)
{
$new = new PHP_ParserGenerator_Action;
$new->next = $app;
$app = $new;
$new->type = $type;
$new->sp = $sp;
$new->x = $arg;
echo ' Adding ';
$new->display();
} | php | static function Action_add(&$app, $type, PHP_ParserGenerator_Symbol $sp, $arg)
{
$new = new PHP_ParserGenerator_Action;
$new->next = $app;
$app = $new;
$new->type = $type;
$new->sp = $sp;
$new->x = $arg;
echo ' Adding ';
$new->display();
} | [
"static",
"function",
"Action_add",
"(",
"&",
"$",
"app",
",",
"$",
"type",
",",
"PHP_ParserGenerator_Symbol",
"$",
"sp",
",",
"$",
"arg",
")",
"{",
"$",
"new",
"=",
"new",
"PHP_ParserGenerator_Action",
";",
"$",
"new",
"->",
"next",
"=",
"$",
"app",
"... | create linked list of PHP_ParserGenerator_Actions
@param PHP_ParserGenerator_Action|null $app
@param int $type one of the class constants from PHP_ParserGenerator_Action
@param PHP_ParserGenerator_Symbol $sp
@param PHP_ParserGene... | [
"create",
"linked",
"list",
"of",
"PHP_ParserGenerator_Actions"
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Action.php#L187-L197 |
239,791 | rodchyn/elephant-lang | lib/ParserGenerator/PHP/ParserGenerator/Action.php | PHP_ParserGenerator_Action.PrintAction | function PrintAction($fp, $indent)
{
if (!$fp) {
$fp = STDOUT;
}
$result = 1;
switch ($this->type)
{
case self::SHIFT:
fprintf($fp, "%${indent}s shift %d", $this->sp->name, $this->x->statenum);
break;
case self::REDUCE:
... | php | function PrintAction($fp, $indent)
{
if (!$fp) {
$fp = STDOUT;
}
$result = 1;
switch ($this->type)
{
case self::SHIFT:
fprintf($fp, "%${indent}s shift %d", $this->sp->name, $this->x->statenum);
break;
case self::REDUCE:
... | [
"function",
"PrintAction",
"(",
"$",
"fp",
",",
"$",
"indent",
")",
"{",
"if",
"(",
"!",
"$",
"fp",
")",
"{",
"$",
"fp",
"=",
"STDOUT",
";",
"}",
"$",
"result",
"=",
"1",
";",
"switch",
"(",
"$",
"this",
"->",
"type",
")",
"{",
"case",
"self"... | Print an action to the given file descriptor. Return FALSE if
nothing was actually printed.
@param resource $fp File descriptor to print on
@param integer $indent Number of indents
@see PHP_ParserGenerator_Data::ReportOutput()
@return int|false | [
"Print",
"an",
"action",
"to",
"the",
"given",
"file",
"descriptor",
".",
"Return",
"FALSE",
"if",
"nothing",
"was",
"actually",
"printed",
"."
] | e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf | https://github.com/rodchyn/elephant-lang/blob/e0acc26eec1ab4dbfcc90ad79efc23318eaba5cf/lib/ParserGenerator/PHP/ParserGenerator/Action.php#L225-L255 |
239,792 | m-jch/ZagrosCore | src/models/Project.php | Project.removeElementFromArray | public static function removeElementFromArray($elements, $array)
{
if (is_array($elements) && is_array($array))
{
foreach ($elements as $element)
{
if (in_array($element, $array))
{
$key = array_search($element, $array);
... | php | public static function removeElementFromArray($elements, $array)
{
if (is_array($elements) && is_array($array))
{
foreach ($elements as $element)
{
if (in_array($element, $array))
{
$key = array_search($element, $array);
... | [
"public",
"static",
"function",
"removeElementFromArray",
"(",
"$",
"elements",
",",
"$",
"array",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"elements",
")",
"&&",
"is_array",
"(",
"$",
"array",
")",
")",
"{",
"foreach",
"(",
"$",
"elements",
"as",
"$... | For example remove admins from writers array
@param $elements array
@param $array array
@return array | [
"For",
"example",
"remove",
"admins",
"from",
"writers",
"array"
] | 06771fe13e77f7663ea5cc561c6078be08b0f557 | https://github.com/m-jch/ZagrosCore/blob/06771fe13e77f7663ea5cc561c6078be08b0f557/src/models/Project.php#L70-L84 |
239,793 | benkle-libs/feed-parser | src/Utilities/PriorityList.php | PriorityList.add | public function add($entry, $priority = self::DEFAULT_PRIORITY)
{
if (isset($this->entryClass) && !($entry instanceof $this->entryClass)) {
throw new InvalidObjectClassException($this->entryClass, get_class($entry));
}
$this->entries[] = ['data' => $entry, 'priority' => $priority... | php | public function add($entry, $priority = self::DEFAULT_PRIORITY)
{
if (isset($this->entryClass) && !($entry instanceof $this->entryClass)) {
throw new InvalidObjectClassException($this->entryClass, get_class($entry));
}
$this->entries[] = ['data' => $entry, 'priority' => $priority... | [
"public",
"function",
"add",
"(",
"$",
"entry",
",",
"$",
"priority",
"=",
"self",
"::",
"DEFAULT_PRIORITY",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"entryClass",
")",
"&&",
"!",
"(",
"$",
"entry",
"instanceof",
"$",
"this",
"->",
"entr... | Add an entry to the list.
@param mixed $entry
@param int $priority
@return $this
@throws InvalidObjectClassException | [
"Add",
"an",
"entry",
"to",
"the",
"list",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Utilities/PriorityList.php#L55-L63 |
239,794 | benkle-libs/feed-parser | src/Utilities/PriorityList.php | PriorityList.remove | public function remove($entry, $priority = false)
{
$unsetAnything = false;
foreach ($this->entries as $i => $entryData) {
if ($entry === $entryData['data'] && ($priority === false || $entryData['priority'] == $priority)) {
unset($this->entries[$i]);
$unse... | php | public function remove($entry, $priority = false)
{
$unsetAnything = false;
foreach ($this->entries as $i => $entryData) {
if ($entry === $entryData['data'] && ($priority === false || $entryData['priority'] == $priority)) {
unset($this->entries[$i]);
$unse... | [
"public",
"function",
"remove",
"(",
"$",
"entry",
",",
"$",
"priority",
"=",
"false",
")",
"{",
"$",
"unsetAnything",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"i",
"=>",
"$",
"entryData",
")",
"{",
"if",
"(",
"$"... | Removes an entry from the list.
@param mixed $entry
@param bool|int $priority When false, remove all instances of $entry from the list, otherwise only those with matching priority
@return $this | [
"Removes",
"an",
"entry",
"from",
"the",
"list",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Utilities/PriorityList.php#L71-L84 |
239,795 | benkle-libs/feed-parser | src/Utilities/PriorityList.php | PriorityList.reprioritise | public function reprioritise($entry, $newPriority, $oldPriority = false)
{
$changedAnything = false;
foreach ($this->entries as $i => &$entryData) {
if ($entry === $entryData['data'] && ($oldPriority === false || $entryData['priority'] == $oldPriority)) {
$entryData['prio... | php | public function reprioritise($entry, $newPriority, $oldPriority = false)
{
$changedAnything = false;
foreach ($this->entries as $i => &$entryData) {
if ($entry === $entryData['data'] && ($oldPriority === false || $entryData['priority'] == $oldPriority)) {
$entryData['prio... | [
"public",
"function",
"reprioritise",
"(",
"$",
"entry",
",",
"$",
"newPriority",
",",
"$",
"oldPriority",
"=",
"false",
")",
"{",
"$",
"changedAnything",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"i",
"=>",
"&",
"$",
... | change the priority for an entry.
@param mixed $entry
@param int $newPriority
@param bool|int $oldPriority If falsechange remove all instances of $entry from the list, otherwise only those with matching priority
@return $this | [
"change",
"the",
"priority",
"for",
"an",
"entry",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Utilities/PriorityList.php#L93-L106 |
239,796 | benkle-libs/feed-parser | src/Utilities/PriorityList.php | PriorityList.toArray | public function toArray()
{
if (!$this->sorted) {
$this->rewind();
}
return array_map(
function ($entry) {
return $entry['data'];
}, $this->entries
);
} | php | public function toArray()
{
if (!$this->sorted) {
$this->rewind();
}
return array_map(
function ($entry) {
return $entry['data'];
}, $this->entries
);
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"sorted",
")",
"{",
"$",
"this",
"->",
"rewind",
"(",
")",
";",
"}",
"return",
"array_map",
"(",
"function",
"(",
"$",
"entry",
")",
"{",
"return",
"$",
"entry",
"... | Returns all items, ordered by priority.
@return array | [
"Returns",
"all",
"items",
"ordered",
"by",
"priority",
"."
] | 8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f | https://github.com/benkle-libs/feed-parser/blob/8b86daf9dfe57e6e7ccae83dbc65ac7ce462144f/src/Utilities/PriorityList.php#L189-L199 |
239,797 | sellerlabs/nucleus | src/SellerLabs/Nucleus/Support/Arr.php | Arr.dotGet | public static function dotGet(array $array, $key, $default = null)
{
if (is_null($key)) {
return $array;
}
if (isset($array[$key])) {
return $array[$key];
}
foreach (explode('.', $key) as $segment) {
if (!is_array($array) || !array_key_ex... | php | public static function dotGet(array $array, $key, $default = null)
{
if (is_null($key)) {
return $array;
}
if (isset($array[$key])) {
return $array[$key];
}
foreach (explode('.', $key) as $segment) {
if (!is_array($array) || !array_key_ex... | [
"public",
"static",
"function",
"dotGet",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"array",
";",
"}",
"if",
"(",
"isset",
"(",
... | Get the resulting value of an attempt to traverse a key path.
Each key in the path is separated with a dot.
For example, the following snippet should return `true`:
```php
Arr::dotGet([
'hello' => [
'world' => true,
],
], 'hello.world');
```
Additionally, a default value may be provided, which will be returned if
th... | [
"Get",
"the",
"resulting",
"value",
"of",
"an",
"attempt",
"to",
"traverse",
"a",
"key",
"path",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Arr.php#L53-L72 |
239,798 | sellerlabs/nucleus | src/SellerLabs/Nucleus/Support/Arr.php | Arr.dotSet | public static function dotSet(array $array, $key, $value)
{
$path = explode('.', $key);
$total = count($path);
$current = &$array;
for ($ii = 0; $ii < $total; $ii++) {
if ($ii === $total - 1) {
$current[$path[$ii]] = $value;
} else {
... | php | public static function dotSet(array $array, $key, $value)
{
$path = explode('.', $key);
$total = count($path);
$current = &$array;
for ($ii = 0; $ii < $total; $ii++) {
if ($ii === $total - 1) {
$current[$path[$ii]] = $value;
} else {
... | [
"public",
"static",
"function",
"dotSet",
"(",
"array",
"$",
"array",
",",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"path",
"=",
"explode",
"(",
"'.'",
",",
"$",
"key",
")",
";",
"$",
"total",
"=",
"count",
"(",
"$",
"path",
")",
";",
"$",... | Set an array element using dot notation.
Same as `Arr::dotGet()`, but the value is replaced instead of fetched.
@param array $array
@param string $key
@param mixed $value
@throws LackOfCoffeeException | [
"Set",
"an",
"array",
"element",
"using",
"dot",
"notation",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Arr.php#L85-L109 |
239,799 | sellerlabs/nucleus | src/SellerLabs/Nucleus/Support/Arr.php | Arr.walk | public static function walk(
array &$array,
callable $callback,
$recurse = false,
$path = '',
$considerLeaves = true
) {
$path = trim($path, '.');
foreach ($array as $key => $value) {
if (is_array($value) && $recurse) {
if ($consid... | php | public static function walk(
array &$array,
callable $callback,
$recurse = false,
$path = '',
$considerLeaves = true
) {
$path = trim($path, '.');
foreach ($array as $key => $value) {
if (is_array($value) && $recurse) {
if ($consid... | [
"public",
"static",
"function",
"walk",
"(",
"array",
"&",
"$",
"array",
",",
"callable",
"$",
"callback",
",",
"$",
"recurse",
"=",
"false",
",",
"$",
"path",
"=",
"''",
",",
"$",
"considerLeaves",
"=",
"true",
")",
"{",
"$",
"path",
"=",
"trim",
... | A more complicated, but flexible, version of `array_walk`.
This modified version is useful for flattening arrays without losing
important structure data (how the array is arranged and nested).
Possible applications: flattening complex validation responses or a
configuration file.
Additional features:
- The current p... | [
"A",
"more",
"complicated",
"but",
"flexible",
"version",
"of",
"array_walk",
"."
] | c05d9c23d424a6bd5ab2e29140805cc6e37e4623 | https://github.com/sellerlabs/nucleus/blob/c05d9c23d424a6bd5ab2e29140805cc6e37e4623/src/SellerLabs/Nucleus/Support/Arr.php#L164-L200 |
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.