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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
240,100 | manacode/php-helpers | src/DateTime.php | DateTime.mdate | function mdate($date_format = '', $time = '') {
if ($date_format == '') {
$date_format = $this->dateFormat;
}
if ($time == '') {
$time = $this->now();
}
return date($date_format, $time);
} | php | function mdate($date_format = '', $time = '') {
if ($date_format == '') {
$date_format = $this->dateFormat;
}
if ($time == '') {
$time = $this->now();
}
return date($date_format, $time);
} | [
"function",
"mdate",
"(",
"$",
"date_format",
"=",
"''",
",",
"$",
"time",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"date_format",
"==",
"''",
")",
"{",
"$",
"date_format",
"=",
"$",
"this",
"->",
"dateFormat",
";",
"}",
"if",
"(",
"$",
"time",
"==",... | Return date based on the date format | [
"Return",
"date",
"based",
"on",
"the",
"date",
"format"
] | 1e408e0935298753c0803ae0a8f9b12809652d6f | https://github.com/manacode/php-helpers/blob/1e408e0935298753c0803ae0a8f9b12809652d6f/src/DateTime.php#L93-L101 |
240,101 | manacode/php-helpers | src/DateTime.php | DateTime.mdatetime | function mdatetime($time = '', $timezone = '', $datetime_format = '') {
if ($datetime_format == '') {
$datetime_format = $this->dateFormat . ' ' . $this->timeFormat;
}
if ($time == '') {
$time = 'now';
}
if ($timezone == '') {
$timezone = $this->timeZone;
}
$utc = new \DateTimeZone($timezone);
... | php | function mdatetime($time = '', $timezone = '', $datetime_format = '') {
if ($datetime_format == '') {
$datetime_format = $this->dateFormat . ' ' . $this->timeFormat;
}
if ($time == '') {
$time = 'now';
}
if ($timezone == '') {
$timezone = $this->timeZone;
}
$utc = new \DateTimeZone($timezone);
... | [
"function",
"mdatetime",
"(",
"$",
"time",
"=",
"''",
",",
"$",
"timezone",
"=",
"''",
",",
"$",
"datetime_format",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"datetime_format",
"==",
"''",
")",
"{",
"$",
"datetime_format",
"=",
"$",
"this",
"->",
"dateFor... | Return date and time based on the datetime format | [
"Return",
"date",
"and",
"time",
"based",
"on",
"the",
"datetime",
"format"
] | 1e408e0935298753c0803ae0a8f9b12809652d6f | https://github.com/manacode/php-helpers/blob/1e408e0935298753c0803ae0a8f9b12809652d6f/src/DateTime.php#L104-L117 |
240,102 | manacode/php-helpers | src/DateTime.php | DateTime.get_first_date_last_month | function get_first_date_last_month($m=1) {
return $this->mdate($this->dateFormat, mktime(0, 0, 0, $this->mdate("m")-$m, 1, $this->mdate("Y")));
} | php | function get_first_date_last_month($m=1) {
return $this->mdate($this->dateFormat, mktime(0, 0, 0, $this->mdate("m")-$m, 1, $this->mdate("Y")));
} | [
"function",
"get_first_date_last_month",
"(",
"$",
"m",
"=",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"mdate",
"(",
"$",
"this",
"->",
"dateFormat",
",",
"mktime",
"(",
"0",
",",
"0",
",",
"0",
",",
"$",
"this",
"->",
"mdate",
"(",
"\"m\"",
")",... | Return first date of last month | [
"Return",
"first",
"date",
"of",
"last",
"month"
] | 1e408e0935298753c0803ae0a8f9b12809652d6f | https://github.com/manacode/php-helpers/blob/1e408e0935298753c0803ae0a8f9b12809652d6f/src/DateTime.php#L204-L206 |
240,103 | manacode/php-helpers | src/DateTime.php | DateTime.get_last_date_last_month | function get_last_date_last_month($m=1) {
return $this->mdate($this->dateFormat, mktime(24, 0, 0, $this->mdate("m")-($m-1), -1, $this->mdate("Y")));
} | php | function get_last_date_last_month($m=1) {
return $this->mdate($this->dateFormat, mktime(24, 0, 0, $this->mdate("m")-($m-1), -1, $this->mdate("Y")));
} | [
"function",
"get_last_date_last_month",
"(",
"$",
"m",
"=",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"mdate",
"(",
"$",
"this",
"->",
"dateFormat",
",",
"mktime",
"(",
"24",
",",
"0",
",",
"0",
",",
"$",
"this",
"->",
"mdate",
"(",
"\"m\"",
")",... | Return last date of last month | [
"Return",
"last",
"date",
"of",
"last",
"month"
] | 1e408e0935298753c0803ae0a8f9b12809652d6f | https://github.com/manacode/php-helpers/blob/1e408e0935298753c0803ae0a8f9b12809652d6f/src/DateTime.php#L209-L211 |
240,104 | manacode/php-helpers | src/DateTime.php | DateTime.get_first_date_last_year | function get_first_date_last_year($y=1) {
return $this->mdate($this->dateFormat, mktime(0, 0, 0, 1, 1, $this->mdate("Y")-$y));
} | php | function get_first_date_last_year($y=1) {
return $this->mdate($this->dateFormat, mktime(0, 0, 0, 1, 1, $this->mdate("Y")-$y));
} | [
"function",
"get_first_date_last_year",
"(",
"$",
"y",
"=",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"mdate",
"(",
"$",
"this",
"->",
"dateFormat",
",",
"mktime",
"(",
"0",
",",
"0",
",",
"0",
",",
"1",
",",
"1",
",",
"$",
"this",
"->",
"mdate... | Return first date of last year | [
"Return",
"first",
"date",
"of",
"last",
"year"
] | 1e408e0935298753c0803ae0a8f9b12809652d6f | https://github.com/manacode/php-helpers/blob/1e408e0935298753c0803ae0a8f9b12809652d6f/src/DateTime.php#L228-L230 |
240,105 | manacode/php-helpers | src/DateTime.php | DateTime.get_last_date_last_year | function get_last_date_last_year($y=1) {
return $this->mdate($this->dateFormat, mktime(24, 0, 0, 1, -1, $this->mdate("Y")-($y-1)));
} | php | function get_last_date_last_year($y=1) {
return $this->mdate($this->dateFormat, mktime(24, 0, 0, 1, -1, $this->mdate("Y")-($y-1)));
} | [
"function",
"get_last_date_last_year",
"(",
"$",
"y",
"=",
"1",
")",
"{",
"return",
"$",
"this",
"->",
"mdate",
"(",
"$",
"this",
"->",
"dateFormat",
",",
"mktime",
"(",
"24",
",",
"0",
",",
"0",
",",
"1",
",",
"-",
"1",
",",
"$",
"this",
"->",
... | Return last date of last year | [
"Return",
"last",
"date",
"of",
"last",
"year"
] | 1e408e0935298753c0803ae0a8f9b12809652d6f | https://github.com/manacode/php-helpers/blob/1e408e0935298753c0803ae0a8f9b12809652d6f/src/DateTime.php#L233-L235 |
240,106 | veridu/idos-sdk-php | src/idOS/Endpoint/Profile/Sources.php | Sources.createNew | public function createNew(
string $name,
array $tags
) : array {
$array = [
'name' => $name,
'tags' => $tags
];
return $this->sendPost(
sprintf('/profiles/%s/sources', $this->userName),
[],
$array
);
} | php | public function createNew(
string $name,
array $tags
) : array {
$array = [
'name' => $name,
'tags' => $tags
];
return $this->sendPost(
sprintf('/profiles/%s/sources', $this->userName),
[],
$array
);
} | [
"public",
"function",
"createNew",
"(",
"string",
"$",
"name",
",",
"array",
"$",
"tags",
")",
":",
"array",
"{",
"$",
"array",
"=",
"[",
"'name'",
"=>",
"$",
"name",
",",
"'tags'",
"=>",
"$",
"tags",
"]",
";",
"return",
"$",
"this",
"->",
"sendPos... | Creates a new source for the given username.
@param string $name
@param string $ipaddr
@param array $tags
@return array Response | [
"Creates",
"a",
"new",
"source",
"for",
"the",
"given",
"username",
"."
] | e56757bed10404756f2f0485a4b7f55794192008 | https://github.com/veridu/idos-sdk-php/blob/e56757bed10404756f2f0485a4b7f55794192008/src/idOS/Endpoint/Profile/Sources.php#L20-L34 |
240,107 | veridu/idos-sdk-php | src/idOS/Endpoint/Profile/Sources.php | Sources.updateOne | public function updateOne(int $sourceId, array $tags, int $otpCode = null, string $ipaddr = '') : array {
$array = [
'tags' => $tags
];
if ($otpCode !== null) {
$array['otpCode'] = $otpCode;
}
return $this->sendPatch(
sprintf('/profiles/%s/so... | php | public function updateOne(int $sourceId, array $tags, int $otpCode = null, string $ipaddr = '') : array {
$array = [
'tags' => $tags
];
if ($otpCode !== null) {
$array['otpCode'] = $otpCode;
}
return $this->sendPatch(
sprintf('/profiles/%s/so... | [
"public",
"function",
"updateOne",
"(",
"int",
"$",
"sourceId",
",",
"array",
"$",
"tags",
",",
"int",
"$",
"otpCode",
"=",
"null",
",",
"string",
"$",
"ipaddr",
"=",
"''",
")",
":",
"array",
"{",
"$",
"array",
"=",
"[",
"'tags'",
"=>",
"$",
"tags"... | Updates a source in the given profile.
@param int $sourceId
@param string $ipaddr
@param string $tags
@return array Response | [
"Updates",
"a",
"source",
"in",
"the",
"given",
"profile",
"."
] | e56757bed10404756f2f0485a4b7f55794192008 | https://github.com/veridu/idos-sdk-php/blob/e56757bed10404756f2f0485a4b7f55794192008/src/idOS/Endpoint/Profile/Sources.php#L72-L86 |
240,108 | monolyth-php/formulaic | src/Datetime.php | Datetime.setMin | public function setMin(string $min) : Datetime
{
$min = date($this->format, strtotime($min));
$this->attributes['min'] = $min;
return $this->addTest('min', function ($value) use ($min) {
return $value >= $min;
});
} | php | public function setMin(string $min) : Datetime
{
$min = date($this->format, strtotime($min));
$this->attributes['min'] = $min;
return $this->addTest('min', function ($value) use ($min) {
return $value >= $min;
});
} | [
"public",
"function",
"setMin",
"(",
"string",
"$",
"min",
")",
":",
"Datetime",
"{",
"$",
"min",
"=",
"date",
"(",
"$",
"this",
"->",
"format",
",",
"strtotime",
"(",
"$",
"min",
")",
")",
";",
"$",
"this",
"->",
"attributes",
"[",
"'min'",
"]",
... | Set the minimum datetime.
@param string $min Minimum timestamp. This can be any string parsable by
PHP's `strtotime`.
@return Monolyth\Formulaic\Datetime Self | [
"Set",
"the",
"minimum",
"datetime",
"."
] | 4bf7853a0c29cc17957f1b26c79f633867742c14 | https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Datetime.php#L77-L84 |
240,109 | monolyth-php/formulaic | src/Datetime.php | Datetime.setMax | public function setMax(string $max) : Datetime
{
$max = date($this->format, strtotime($max));
$this->attributes['max'] = $max;
return $this->addTest('max', function ($value) use ($max) {
return $value <= $max;
});
} | php | public function setMax(string $max) : Datetime
{
$max = date($this->format, strtotime($max));
$this->attributes['max'] = $max;
return $this->addTest('max', function ($value) use ($max) {
return $value <= $max;
});
} | [
"public",
"function",
"setMax",
"(",
"string",
"$",
"max",
")",
":",
"Datetime",
"{",
"$",
"max",
"=",
"date",
"(",
"$",
"this",
"->",
"format",
",",
"strtotime",
"(",
"$",
"max",
")",
")",
";",
"$",
"this",
"->",
"attributes",
"[",
"'max'",
"]",
... | Set the maximum datetime.
@param string $max Maximum timestamp. This can be any string parsable by
PHP's `strtotime`.
@return Monolyth\Formulaic\Datetime Self | [
"Set",
"the",
"maximum",
"datetime",
"."
] | 4bf7853a0c29cc17957f1b26c79f633867742c14 | https://github.com/monolyth-php/formulaic/blob/4bf7853a0c29cc17957f1b26c79f633867742c14/src/Datetime.php#L93-L100 |
240,110 | drustack/composer-generate-metadata | src/Plugin.php | Plugin.generateInfoMetadata | public function generateInfoMetadata(PackageEvent $event)
{
$op = $event->getOperation();
$package = $op->getJobType() == 'update'
? $op->getTargetPackage()
: $op->getPackage();
$installPath = $this->installationManager->getInstallPath($package);
if (preg_mat... | php | public function generateInfoMetadata(PackageEvent $event)
{
$op = $event->getOperation();
$package = $op->getJobType() == 'update'
? $op->getTargetPackage()
: $op->getPackage();
$installPath = $this->installationManager->getInstallPath($package);
if (preg_mat... | [
"public",
"function",
"generateInfoMetadata",
"(",
"PackageEvent",
"$",
"event",
")",
"{",
"$",
"op",
"=",
"$",
"event",
"->",
"getOperation",
"(",
")",
";",
"$",
"package",
"=",
"$",
"op",
"->",
"getJobType",
"(",
")",
"==",
"'update'",
"?",
"$",
"op"... | Inject metadata into all .info files for a given project.
@see drush_pm_inject_info_file_metadata() | [
"Inject",
"metadata",
"into",
"all",
".",
"info",
"files",
"for",
"a",
"given",
"project",
"."
] | bf3d2aaa8ed7127cab885f87ffc71ff8753433a5 | https://github.com/drustack/composer-generate-metadata/blob/bf3d2aaa8ed7127cab885f87ffc71ff8753433a5/src/Plugin.php#L84-L138 |
240,111 | drustack/composer-generate-metadata | src/Plugin.php | Plugin.computeRebuildVersion | protected function computeRebuildVersion($installPath, $branch)
{
$version = '';
$branchPreg = preg_quote($branch);
$process = new Process("cd $installPath; git describe --tags");
$process->run();
if ($process->isSuccessful()) {
$lastTag = strtok($process->getOut... | php | protected function computeRebuildVersion($installPath, $branch)
{
$version = '';
$branchPreg = preg_quote($branch);
$process = new Process("cd $installPath; git describe --tags");
$process->run();
if ($process->isSuccessful()) {
$lastTag = strtok($process->getOut... | [
"protected",
"function",
"computeRebuildVersion",
"(",
"$",
"installPath",
",",
"$",
"branch",
")",
"{",
"$",
"version",
"=",
"''",
";",
"$",
"branchPreg",
"=",
"preg_quote",
"(",
"$",
"branch",
")",
";",
"$",
"process",
"=",
"new",
"Process",
"(",
"\"cd... | Helper function to compute the rebulid version string for a project.
This does some magic in Git to find the latest release tag along
the branch we're packaging from, count the number of commits since
then, and use that to construct this fancy alternate version string
which is useful for the version-specific dependenc... | [
"Helper",
"function",
"to",
"compute",
"the",
"rebulid",
"version",
"string",
"for",
"a",
"project",
"."
] | bf3d2aaa8ed7127cab885f87ffc71ff8753433a5 | https://github.com/drustack/composer-generate-metadata/blob/bf3d2aaa8ed7127cab885f87ffc71ff8753433a5/src/Plugin.php#L156-L183 |
240,112 | drustack/composer-generate-metadata | src/Plugin.php | Plugin.generateInfoIniMetadata | protected function generateInfoIniMetadata($version, $project, $datestamp)
{
$core = preg_replace('/^([0-9]).*$/', '$1.x', $version);
$date = date('Y-m-d', $datestamp);
$info = <<<METADATA
; Information add by drustack/composer-generate-metadata on {$date}
core = "{$core}"
project = "{$proj... | php | protected function generateInfoIniMetadata($version, $project, $datestamp)
{
$core = preg_replace('/^([0-9]).*$/', '$1.x', $version);
$date = date('Y-m-d', $datestamp);
$info = <<<METADATA
; Information add by drustack/composer-generate-metadata on {$date}
core = "{$core}"
project = "{$proj... | [
"protected",
"function",
"generateInfoIniMetadata",
"(",
"$",
"version",
",",
"$",
"project",
",",
"$",
"datestamp",
")",
"{",
"$",
"core",
"=",
"preg_replace",
"(",
"'/^([0-9]).*$/'",
",",
"'$1.x'",
",",
"$",
"version",
")",
";",
"$",
"date",
"=",
"date",... | Generate version information for `.info` files in ini format.
@see _drush_pm_generate_info_ini_metadata() | [
"Generate",
"version",
"information",
"for",
".",
"info",
"files",
"in",
"ini",
"format",
"."
] | bf3d2aaa8ed7127cab885f87ffc71ff8753433a5 | https://github.com/drustack/composer-generate-metadata/blob/bf3d2aaa8ed7127cab885f87ffc71ff8753433a5/src/Plugin.php#L190-L204 |
240,113 | drustack/composer-generate-metadata | src/Plugin.php | Plugin.generateInfoYamlMetadata | protected function generateInfoYamlMetadata($version, $project, $datestamp)
{
$core = preg_replace('/^([0-9]).*$/', '$1.x', $version);
$date = date('Y-m-d', $datestamp);
$info = <<<METADATA
# Information add by drustack/composer-generate-metadata on {$date}
core: "{$core}"
project: "{$proje... | php | protected function generateInfoYamlMetadata($version, $project, $datestamp)
{
$core = preg_replace('/^([0-9]).*$/', '$1.x', $version);
$date = date('Y-m-d', $datestamp);
$info = <<<METADATA
# Information add by drustack/composer-generate-metadata on {$date}
core: "{$core}"
project: "{$proje... | [
"protected",
"function",
"generateInfoYamlMetadata",
"(",
"$",
"version",
",",
"$",
"project",
",",
"$",
"datestamp",
")",
"{",
"$",
"core",
"=",
"preg_replace",
"(",
"'/^([0-9]).*$/'",
",",
"'$1.x'",
",",
"$",
"version",
")",
";",
"$",
"date",
"=",
"date"... | Generate version information for `.info.yml` files in YAML format.
@see _drush_pm_generate_info_yaml_metadata() | [
"Generate",
"version",
"information",
"for",
".",
"info",
".",
"yml",
"files",
"in",
"YAML",
"format",
"."
] | bf3d2aaa8ed7127cab885f87ffc71ff8753433a5 | https://github.com/drustack/composer-generate-metadata/blob/bf3d2aaa8ed7127cab885f87ffc71ff8753433a5/src/Plugin.php#L211-L225 |
240,114 | themichaelhall/datatypes | src/FilePath.php | FilePath.equals | public function equals(FilePathInterface $filePath): bool
{
return $this->getDrive() === $filePath->getDrive() && $this->isAbsolute() === $filePath->isAbsolute() && $this->getDirectoryParts() === $filePath->getDirectoryParts() && $this->getFilename() === $filePath->getFilename();
} | php | public function equals(FilePathInterface $filePath): bool
{
return $this->getDrive() === $filePath->getDrive() && $this->isAbsolute() === $filePath->isAbsolute() && $this->getDirectoryParts() === $filePath->getDirectoryParts() && $this->getFilename() === $filePath->getFilename();
} | [
"public",
"function",
"equals",
"(",
"FilePathInterface",
"$",
"filePath",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"getDrive",
"(",
")",
"===",
"$",
"filePath",
"->",
"getDrive",
"(",
")",
"&&",
"$",
"this",
"->",
"isAbsolute",
"(",
")",
"=... | Returns true if the file path equals other file path, false otherwise.
@since 1.2.0
@param FilePathInterface $filePath The other file path.
@return bool True if the file path equals other file path, false otherwise. | [
"Returns",
"true",
"if",
"the",
"file",
"path",
"equals",
"other",
"file",
"path",
"false",
"otherwise",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L34-L37 |
240,115 | themichaelhall/datatypes | src/FilePath.php | FilePath.getDirectory | public function getDirectory(): FilePathInterface
{
return new self($this->myIsAbsolute, $this->myAboveBaseLevel, $this->myDrive, $this->myDirectoryParts, null);
} | php | public function getDirectory(): FilePathInterface
{
return new self($this->myIsAbsolute, $this->myAboveBaseLevel, $this->myDrive, $this->myDirectoryParts, null);
} | [
"public",
"function",
"getDirectory",
"(",
")",
":",
"FilePathInterface",
"{",
"return",
"new",
"self",
"(",
"$",
"this",
"->",
"myIsAbsolute",
",",
"$",
"this",
"->",
"myAboveBaseLevel",
",",
"$",
"this",
"->",
"myDrive",
",",
"$",
"this",
"->",
"myDirect... | Returns the directory of the file path.
@since 1.0.0
@return FilePathInterface The directory of the file path. | [
"Returns",
"the",
"directory",
"of",
"the",
"file",
"path",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L46-L49 |
240,116 | themichaelhall/datatypes | src/FilePath.php | FilePath.getParentDirectory | public function getParentDirectory(): ?FilePathInterface
{
if ($this->myParentDirectory($aboveBaseLevel, $directoryParts)) {
return new self($this->myIsAbsolute, $aboveBaseLevel, $this->myDrive, $directoryParts, null);
}
return null;
} | php | public function getParentDirectory(): ?FilePathInterface
{
if ($this->myParentDirectory($aboveBaseLevel, $directoryParts)) {
return new self($this->myIsAbsolute, $aboveBaseLevel, $this->myDrive, $directoryParts, null);
}
return null;
} | [
"public",
"function",
"getParentDirectory",
"(",
")",
":",
"?",
"FilePathInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"myParentDirectory",
"(",
"$",
"aboveBaseLevel",
",",
"$",
"directoryParts",
")",
")",
"{",
"return",
"new",
"self",
"(",
"$",
"this",
"... | Returns the parent directory of the file path or null if file path does not have a parent directory.
@since 1.0.0
@return FilePathInterface|null The parent directory of the file path or null if file path does not have a parent directory. | [
"Returns",
"the",
"parent",
"directory",
"of",
"the",
"file",
"path",
"or",
"null",
"if",
"file",
"path",
"does",
"not",
"have",
"a",
"parent",
"directory",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L70-L77 |
240,117 | themichaelhall/datatypes | src/FilePath.php | FilePath.toAbsolute | public function toAbsolute(): FilePathInterface
{
if ($this->myAboveBaseLevel > 0) {
throw new FilePathLogicException('File path "' . $this->__toString() . '" can not be made absolute: Relative path is above base level.');
}
return new self(true, $this->myAboveBaseLevel, $this->... | php | public function toAbsolute(): FilePathInterface
{
if ($this->myAboveBaseLevel > 0) {
throw new FilePathLogicException('File path "' . $this->__toString() . '" can not be made absolute: Relative path is above base level.');
}
return new self(true, $this->myAboveBaseLevel, $this->... | [
"public",
"function",
"toAbsolute",
"(",
")",
":",
"FilePathInterface",
"{",
"if",
"(",
"$",
"this",
"->",
"myAboveBaseLevel",
">",
"0",
")",
"{",
"throw",
"new",
"FilePathLogicException",
"(",
"'File path \"'",
".",
"$",
"this",
"->",
"__toString",
"(",
")"... | Returns the file path as an absolute path.
@since 1.0.0
@throws FilePathLogicException if the file path could not be made absolute.
@return FilePathInterface The file path as an absolute path. | [
"Returns",
"the",
"file",
"path",
"as",
"an",
"absolute",
"path",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L88-L95 |
240,118 | themichaelhall/datatypes | src/FilePath.php | FilePath.toRelative | public function toRelative(): FilePathInterface
{
return new self(false, $this->myAboveBaseLevel, null, $this->myDirectoryParts, $this->myFilename);
} | php | public function toRelative(): FilePathInterface
{
return new self(false, $this->myAboveBaseLevel, null, $this->myDirectoryParts, $this->myFilename);
} | [
"public",
"function",
"toRelative",
"(",
")",
":",
"FilePathInterface",
"{",
"return",
"new",
"self",
"(",
"false",
",",
"$",
"this",
"->",
"myAboveBaseLevel",
",",
"null",
",",
"$",
"this",
"->",
"myDirectoryParts",
",",
"$",
"this",
"->",
"myFilename",
"... | Returns the file path as a relative path.
@since 1.0.0
@return FilePathInterface The file path as a relative path. | [
"Returns",
"the",
"file",
"path",
"as",
"a",
"relative",
"path",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L104-L107 |
240,119 | themichaelhall/datatypes | src/FilePath.php | FilePath.withFilePath | public function withFilePath(FilePathInterface $filePath): FilePathInterface
{
if (!$this->myCombine($filePath, $isAbsolute, $aboveBaseLevel, $directoryParts, $filename, $error)) {
throw new FilePathLogicException('File path "' . $this->__toString() . '" can not be combined with file path "' . $... | php | public function withFilePath(FilePathInterface $filePath): FilePathInterface
{
if (!$this->myCombine($filePath, $isAbsolute, $aboveBaseLevel, $directoryParts, $filename, $error)) {
throw new FilePathLogicException('File path "' . $this->__toString() . '" can not be combined with file path "' . $... | [
"public",
"function",
"withFilePath",
"(",
"FilePathInterface",
"$",
"filePath",
")",
":",
"FilePathInterface",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"myCombine",
"(",
"$",
"filePath",
",",
"$",
"isAbsolute",
",",
"$",
"aboveBaseLevel",
",",
"$",
"director... | Returns a copy of the file path combined with another file path.
@since 1.0.0
@param FilePathInterface $filePath The other file path.
@throws FilePathLogicException if the file paths could not be combined.
@return FilePathInterface The combined file path. | [
"Returns",
"a",
"copy",
"of",
"the",
"file",
"path",
"combined",
"with",
"another",
"file",
"path",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L120-L127 |
240,120 | themichaelhall/datatypes | src/FilePath.php | FilePath.isValid | public static function isValid(string $filePath): bool
{
return self::myFilePathParse(
DIRECTORY_SEPARATOR,
$filePath,
function ($p, $d, &$e) {
return self::myPartValidator($p, $d, $e);
});
} | php | public static function isValid(string $filePath): bool
{
return self::myFilePathParse(
DIRECTORY_SEPARATOR,
$filePath,
function ($p, $d, &$e) {
return self::myPartValidator($p, $d, $e);
});
} | [
"public",
"static",
"function",
"isValid",
"(",
"string",
"$",
"filePath",
")",
":",
"bool",
"{",
"return",
"self",
"::",
"myFilePathParse",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"filePath",
",",
"function",
"(",
"$",
"p",
",",
"$",
"d",
",",
"&",
"$",
... | Checks if a file path is valid.
@since 1.0.0
@param string $filePath The file path.
@return bool True if the $filePath parameter is a valid file path, false otherwise. | [
"Checks",
"if",
"a",
"file",
"path",
"is",
"valid",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L150-L158 |
240,121 | themichaelhall/datatypes | src/FilePath.php | FilePath.parse | public static function parse(string $filePath): FilePathInterface
{
if (!self::myFilePathParse(
DIRECTORY_SEPARATOR,
$filePath,
function ($p, $d, &$e) {
return self::myPartValidator($p, $d, $e);
},
null,
$isAbsolute,
... | php | public static function parse(string $filePath): FilePathInterface
{
if (!self::myFilePathParse(
DIRECTORY_SEPARATOR,
$filePath,
function ($p, $d, &$e) {
return self::myPartValidator($p, $d, $e);
},
null,
$isAbsolute,
... | [
"public",
"static",
"function",
"parse",
"(",
"string",
"$",
"filePath",
")",
":",
"FilePathInterface",
"{",
"if",
"(",
"!",
"self",
"::",
"myFilePathParse",
"(",
"DIRECTORY_SEPARATOR",
",",
"$",
"filePath",
",",
"function",
"(",
"$",
"p",
",",
"$",
"d",
... | Parses a file path.
@since 1.0.0
@param string $filePath The file path.
@throws FilePathInvalidArgumentException If the $filePath parameter is not a valid file path.
@return FilePathInterface The file path instance. | [
"Parses",
"a",
"file",
"path",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L171-L191 |
240,122 | themichaelhall/datatypes | src/FilePath.php | FilePath.myFilePathParse | private static function myFilePathParse(string $directorySeparator, string $path, callable $partValidator, callable $stringDecoder = null, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?string &$drive = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool
{
... | php | private static function myFilePathParse(string $directorySeparator, string $path, callable $partValidator, callable $stringDecoder = null, ?bool &$isAbsolute = null, ?int &$aboveBaseLevel = null, ?string &$drive = null, ?array &$directoryParts = null, ?string &$filename = null, ?string &$error = null): bool
{
... | [
"private",
"static",
"function",
"myFilePathParse",
"(",
"string",
"$",
"directorySeparator",
",",
"string",
"$",
"path",
",",
"callable",
"$",
"partValidator",
",",
"callable",
"$",
"stringDecoder",
"=",
"null",
",",
"?",
"bool",
"&",
"$",
"isAbsolute",
"=",
... | Tries to parse a file path and returns the result or error text.
@param string $directorySeparator The directory separator.
@param string $path The path.
@param callable $partValidator The part validator.
@param callable $stringDecoder The string decoding function or nul... | [
"Tries",
"to",
"parse",
"a",
"file",
"path",
"and",
"returns",
"the",
"result",
"or",
"error",
"text",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L259-L298 |
240,123 | themichaelhall/datatypes | src/FilePath.php | FilePath.myPartValidator | private static function myPartValidator(string $part, bool $isDirectory, ?string &$error): bool
{
if (preg_match(self::myIsWindows() ? '/[\0<>:*?"|]+/' : '/[\0]+/', $part, $matches)) {
$error = ($isDirectory ? 'Part of directory' : 'Filename') . ' "' . $part . '" contains invalid character "' . ... | php | private static function myPartValidator(string $part, bool $isDirectory, ?string &$error): bool
{
if (preg_match(self::myIsWindows() ? '/[\0<>:*?"|]+/' : '/[\0]+/', $part, $matches)) {
$error = ($isDirectory ? 'Part of directory' : 'Filename') . ' "' . $part . '" contains invalid character "' . ... | [
"private",
"static",
"function",
"myPartValidator",
"(",
"string",
"$",
"part",
",",
"bool",
"$",
"isDirectory",
",",
"?",
"string",
"&",
"$",
"error",
")",
":",
"bool",
"{",
"if",
"(",
"preg_match",
"(",
"self",
"::",
"myIsWindows",
"(",
")",
"?",
"'/... | Validates a directory part name or a file name.
@param string $part The part to validate.
@param bool $isDirectory If true part is a directory part name, if false part is a file name.
@param string|null $error The error text if validation was not successful, undefined otherwise.
@return bool ... | [
"Validates",
"a",
"directory",
"part",
"name",
"or",
"a",
"file",
"name",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L309-L318 |
240,124 | themichaelhall/datatypes | src/FilePath.php | FilePath.myDriveValidator | private static function myDriveValidator(string $drive, ?string &$error): bool
{
if (!preg_match('/^[a-zA-Z]$/', $drive)) {
$error = 'Drive "' . $drive . '" is invalid.';
return false;
}
return true;
} | php | private static function myDriveValidator(string $drive, ?string &$error): bool
{
if (!preg_match('/^[a-zA-Z]$/', $drive)) {
$error = 'Drive "' . $drive . '" is invalid.';
return false;
}
return true;
} | [
"private",
"static",
"function",
"myDriveValidator",
"(",
"string",
"$",
"drive",
",",
"?",
"string",
"&",
"$",
"error",
")",
":",
"bool",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^[a-zA-Z]$/'",
",",
"$",
"drive",
")",
")",
"{",
"$",
"error",
"=",
... | Validates a drive.
@param string $drive The drive to validate.
@param string|null $error The error text if validation was not successful, undefined otherwise.
@return bool True if validation was successful, false otherwise. | [
"Validates",
"a",
"drive",
"."
] | c738fdf4ffca2e613badcb3011dbd5268e4309d8 | https://github.com/themichaelhall/datatypes/blob/c738fdf4ffca2e613badcb3011dbd5268e4309d8/src/FilePath.php#L328-L337 |
240,125 | joefallon/phpautoloader | src/JoeFallon/AutoLoader.php | AutoLoader.load | public function load($className)
{
$this->_classFilename = $className . '.php';
$this->_includePaths = explode(PATH_SEPARATOR, get_include_path());
$classFound = null;
if(strpos($this->_classFilename, '\\') !== false)
{
$classFound = $this->searchForBa... | php | public function load($className)
{
$this->_classFilename = $className . '.php';
$this->_includePaths = explode(PATH_SEPARATOR, get_include_path());
$classFound = null;
if(strpos($this->_classFilename, '\\') !== false)
{
$classFound = $this->searchForBa... | [
"public",
"function",
"load",
"(",
"$",
"className",
")",
"{",
"$",
"this",
"->",
"_classFilename",
"=",
"$",
"className",
".",
"'.php'",
";",
"$",
"this",
"->",
"_includePaths",
"=",
"explode",
"(",
"PATH_SEPARATOR",
",",
"get_include_path",
"(",
")",
")"... | This function is called by the PHP runtime to find and load a class for use.
Users of this class should not call this function.
@param string $className
@return bool | [
"This",
"function",
"is",
"called",
"by",
"the",
"PHP",
"runtime",
"to",
"find",
"and",
"load",
"a",
"class",
"for",
"use",
".",
"Users",
"of",
"this",
"class",
"should",
"not",
"call",
"this",
"function",
"."
] | 2df9a6f4bbe4881515e4c4f0e833f0696ffb3543 | https://github.com/joefallon/phpautoloader/blob/2df9a6f4bbe4881515e4c4f0e833f0696ffb3543/src/JoeFallon/AutoLoader.php#L30-L50 |
240,126 | joefallon/phpautoloader | src/JoeFallon/AutoLoader.php | AutoLoader.searchForBackslashNamespacedClass | protected function searchForBackslashNamespacedClass()
{
$filename = $this->_classFilename;
foreach($this->_includePaths as $includePath)
{
$className = str_replace('\\', '/', $filename);
$filePath = $includePath . DIRECTORY_SEPARATOR . $className;
if(f... | php | protected function searchForBackslashNamespacedClass()
{
$filename = $this->_classFilename;
foreach($this->_includePaths as $includePath)
{
$className = str_replace('\\', '/', $filename);
$filePath = $includePath . DIRECTORY_SEPARATOR . $className;
if(f... | [
"protected",
"function",
"searchForBackslashNamespacedClass",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"_classFilename",
";",
"foreach",
"(",
"$",
"this",
"->",
"_includePaths",
"as",
"$",
"includePath",
")",
"{",
"$",
"className",
"=",
"str_rep... | This function searches for classes that are namespaced using the modern
standard method of class namespacing.
@example Zend\Exception
@return bool Returns true if the class is found, otherwise false. | [
"This",
"function",
"searches",
"for",
"classes",
"that",
"are",
"namespaced",
"using",
"the",
"modern",
"standard",
"method",
"of",
"class",
"namespacing",
"."
] | 2df9a6f4bbe4881515e4c4f0e833f0696ffb3543 | https://github.com/joefallon/phpautoloader/blob/2df9a6f4bbe4881515e4c4f0e833f0696ffb3543/src/JoeFallon/AutoLoader.php#L64-L82 |
240,127 | joefallon/phpautoloader | src/JoeFallon/AutoLoader.php | AutoLoader.searchForNonNamespacedClass | protected function searchForNonNamespacedClass()
{
$filename = $this->_classFilename;
foreach($this->_includePaths as $includePath)
{
$filePath = $includePath . DIRECTORY_SEPARATOR . $filename;
if(file_exists($filePath) == true)
{
require... | php | protected function searchForNonNamespacedClass()
{
$filename = $this->_classFilename;
foreach($this->_includePaths as $includePath)
{
$filePath = $includePath . DIRECTORY_SEPARATOR . $filename;
if(file_exists($filePath) == true)
{
require... | [
"protected",
"function",
"searchForNonNamespacedClass",
"(",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"_classFilename",
";",
"foreach",
"(",
"$",
"this",
"->",
"_includePaths",
"as",
"$",
"includePath",
")",
"{",
"$",
"filePath",
"=",
"$",
"include... | This function searches for classes that are not namespaced at all.
@example ZendException
@return bool Returns true if the class is found, otherwise false. | [
"This",
"function",
"searches",
"for",
"classes",
"that",
"are",
"not",
"namespaced",
"at",
"all",
"."
] | 2df9a6f4bbe4881515e4c4f0e833f0696ffb3543 | https://github.com/joefallon/phpautoloader/blob/2df9a6f4bbe4881515e4c4f0e833f0696ffb3543/src/JoeFallon/AutoLoader.php#L119-L136 |
240,128 | slickframework/mvc | src/Controller/CrudCommonMethods.php | CrudCommonMethods.getEntityNamePlural | protected function getEntityNamePlural()
{
$name = $this->getEntityNameSingular();
$nameParts = Text::camelCaseToSeparator($name, '#');
$nameParts = explode('#', $nameParts);
$lastPart = array_pop($nameParts);
$lastPart = ucfirst(Text::plural(strtolower($lastPart)));
... | php | protected function getEntityNamePlural()
{
$name = $this->getEntityNameSingular();
$nameParts = Text::camelCaseToSeparator($name, '#');
$nameParts = explode('#', $nameParts);
$lastPart = array_pop($nameParts);
$lastPart = ucfirst(Text::plural(strtolower($lastPart)));
... | [
"protected",
"function",
"getEntityNamePlural",
"(",
")",
"{",
"$",
"name",
"=",
"$",
"this",
"->",
"getEntityNameSingular",
"(",
")",
";",
"$",
"nameParts",
"=",
"Text",
"::",
"camelCaseToSeparator",
"(",
"$",
"name",
",",
"'#'",
")",
";",
"$",
"nameParts... | Get the plural name of the entity
@return string | [
"Get",
"the",
"plural",
"name",
"of",
"the",
"entity"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller/CrudCommonMethods.php#L31-L40 |
240,129 | slickframework/mvc | src/Controller/CrudCommonMethods.php | CrudCommonMethods.getEntityNameSingular | protected function getEntityNameSingular()
{
$names = explode('\\', $this->getEntityClassName());
$name = end($names);
return lcfirst($name);
} | php | protected function getEntityNameSingular()
{
$names = explode('\\', $this->getEntityClassName());
$name = end($names);
return lcfirst($name);
} | [
"protected",
"function",
"getEntityNameSingular",
"(",
")",
"{",
"$",
"names",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"this",
"->",
"getEntityClassName",
"(",
")",
")",
";",
"$",
"name",
"=",
"end",
"(",
"$",
"names",
")",
";",
"return",
"lcfirst",
"... | Get entity singular name used on controller actions
@return string | [
"Get",
"entity",
"singular",
"name",
"used",
"on",
"controller",
"actions"
] | 91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab | https://github.com/slickframework/mvc/blob/91a6c512f8aaa5a7fb9c1a96f8012d2274dc30ab/src/Controller/CrudCommonMethods.php#L47-L52 |
240,130 | phplegends/thumb | src/Thumb/Thumb.php | Thumb.generateBasename | protected function generateBasename()
{
$filename = md5($this->image . $this->height . $this->width);
if (isset(static::$config['default_extension'])) {
$extension = static::$config['default_extension'];
} else {
$extension = pathinfo($this->image, PATHINFO_EXTENS... | php | protected function generateBasename()
{
$filename = md5($this->image . $this->height . $this->width);
if (isset(static::$config['default_extension'])) {
$extension = static::$config['default_extension'];
} else {
$extension = pathinfo($this->image, PATHINFO_EXTENS... | [
"protected",
"function",
"generateBasename",
"(",
")",
"{",
"$",
"filename",
"=",
"md5",
"(",
"$",
"this",
"->",
"image",
".",
"$",
"this",
"->",
"height",
".",
"$",
"this",
"->",
"width",
")",
";",
"if",
"(",
"isset",
"(",
"static",
"::",
"$",
"co... | Generate basename from the destiny file
@return string | [
"Generate",
"basename",
"from",
"the",
"destiny",
"file"
] | 962679265f7bf34893c23a82c34d73508cb84d29 | https://github.com/phplegends/thumb/blob/962679265f7bf34893c23a82c34d73508cb84d29/src/Thumb/Thumb.php#L142-L157 |
240,131 | phplegends/thumb | src/Thumb/Thumb.php | Thumb.isCacheExpired | protected function isCacheExpired($destiny)
{
$cacheModified = filemtime($destiny);
if ($this->expiration !== null) {
return $this->expiration > $cacheModified;
}
return filemtime($this->image) > $cacheModified;
} | php | protected function isCacheExpired($destiny)
{
$cacheModified = filemtime($destiny);
if ($this->expiration !== null) {
return $this->expiration > $cacheModified;
}
return filemtime($this->image) > $cacheModified;
} | [
"protected",
"function",
"isCacheExpired",
"(",
"$",
"destiny",
")",
"{",
"$",
"cacheModified",
"=",
"filemtime",
"(",
"$",
"destiny",
")",
";",
"if",
"(",
"$",
"this",
"->",
"expiration",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"expiration... | Is Expired cache of image?
@param string $destiny
@return boolean | [
"Is",
"Expired",
"cache",
"of",
"image?"
] | 962679265f7bf34893c23a82c34d73508cb84d29 | https://github.com/phplegends/thumb/blob/962679265f7bf34893c23a82c34d73508cb84d29/src/Thumb/Thumb.php#L164-L175 |
240,132 | phplegends/thumb | src/Thumb/Thumb.php | Thumb.fromFile | public static function fromFile($filename, $width, $height = 0)
{
$urlizer = new Urlizer($filename);
static::configureUrlizer($urlizer);
// If the filename is not initialized by '/', this is a fullpath
if (strpos($filename, '/') !== 0) {
$filename = $... | php | public static function fromFile($filename, $width, $height = 0)
{
$urlizer = new Urlizer($filename);
static::configureUrlizer($urlizer);
// If the filename is not initialized by '/', this is a fullpath
if (strpos($filename, '/') !== 0) {
$filename = $... | [
"public",
"static",
"function",
"fromFile",
"(",
"$",
"filename",
",",
"$",
"width",
",",
"$",
"height",
"=",
"0",
")",
"{",
"$",
"urlizer",
"=",
"new",
"Urlizer",
"(",
"$",
"filename",
")",
";",
"static",
"::",
"configureUrlizer",
"(",
"$",
"urlizer",... | Returns the url from thumb based on filename
@param string $filename
@param float $width
@param float $height
@return string | [
"Returns",
"the",
"url",
"from",
"thumb",
"based",
"on",
"filename"
] | 962679265f7bf34893c23a82c34d73508cb84d29 | https://github.com/phplegends/thumb/blob/962679265f7bf34893c23a82c34d73508cb84d29/src/Thumb/Thumb.php#L223-L258 |
240,133 | phplegends/thumb | src/Thumb/Thumb.php | Thumb.fromUrl | public static function fromUrl($url, $width, $height = 0)
{
$extension = pathinfo(strtok($url, '?'), PATHINFO_EXTENSION);
$filename = sprintf('%s/thumb_%s.%s', sys_get_temp_dir(), md5($url), $extension);
if (! file_exists($filename) && ! @copy($url, $filename, static::getStreamContextOpti... | php | public static function fromUrl($url, $width, $height = 0)
{
$extension = pathinfo(strtok($url, '?'), PATHINFO_EXTENSION);
$filename = sprintf('%s/thumb_%s.%s', sys_get_temp_dir(), md5($url), $extension);
if (! file_exists($filename) && ! @copy($url, $filename, static::getStreamContextOpti... | [
"public",
"static",
"function",
"fromUrl",
"(",
"$",
"url",
",",
"$",
"width",
",",
"$",
"height",
"=",
"0",
")",
"{",
"$",
"extension",
"=",
"pathinfo",
"(",
"strtok",
"(",
"$",
"url",
",",
"'?'",
")",
",",
"PATHINFO_EXTENSION",
")",
";",
"$",
"fi... | Get copy from external file url for make thumb
@param string $url
@param float $width
@param float $height | [
"Get",
"copy",
"from",
"external",
"file",
"url",
"for",
"make",
"thumb"
] | 962679265f7bf34893c23a82c34d73508cb84d29 | https://github.com/phplegends/thumb/blob/962679265f7bf34893c23a82c34d73508cb84d29/src/Thumb/Thumb.php#L266-L291 |
240,134 | phplegends/thumb | src/Thumb/Thumb.php | Thumb.image | public static function image($relative, array $attributes = [])
{
$attributes += ['alt' => null];
$height = isset($attributes['height']) ? $attributes['height'] : 0;
$width = isset($attributes['width']) ? $attributes['width'] : 0;
$url = static::url($relative, $width, $height);
... | php | public static function image($relative, array $attributes = [])
{
$attributes += ['alt' => null];
$height = isset($attributes['height']) ? $attributes['height'] : 0;
$width = isset($attributes['width']) ? $attributes['width'] : 0;
$url = static::url($relative, $width, $height);
... | [
"public",
"static",
"function",
"image",
"(",
"$",
"relative",
",",
"array",
"$",
"attributes",
"=",
"[",
"]",
")",
"{",
"$",
"attributes",
"+=",
"[",
"'alt'",
"=>",
"null",
"]",
";",
"$",
"height",
"=",
"isset",
"(",
"$",
"attributes",
"[",
"'height... | Returns the image tag with thumb, based on attributes "height" and "width"
@param string $relative
@param array $attributes
@return string | [
"Returns",
"the",
"image",
"tag",
"with",
"thumb",
"based",
"on",
"attributes",
"height",
"and",
"width"
] | 962679265f7bf34893c23a82c34d73508cb84d29 | https://github.com/phplegends/thumb/blob/962679265f7bf34893c23a82c34d73508cb84d29/src/Thumb/Thumb.php#L323-L346 |
240,135 | phplegends/thumb | src/Thumb/Thumb.php | Thumb.configureUrlizer | protected static function configureUrlizer(Urlizer $urlizer)
{
$path = isset(static::$config['public_path']) ? static::$config['public_path'] : $_SERVER['DOCUMENT_ROOT'];
$urlizer->setPublicPath($path);
if (isset(static::$config['base_uri'])) {
$urlizer->setBaseUrl(static:... | php | protected static function configureUrlizer(Urlizer $urlizer)
{
$path = isset(static::$config['public_path']) ? static::$config['public_path'] : $_SERVER['DOCUMENT_ROOT'];
$urlizer->setPublicPath($path);
if (isset(static::$config['base_uri'])) {
$urlizer->setBaseUrl(static:... | [
"protected",
"static",
"function",
"configureUrlizer",
"(",
"Urlizer",
"$",
"urlizer",
")",
"{",
"$",
"path",
"=",
"isset",
"(",
"static",
"::",
"$",
"config",
"[",
"'public_path'",
"]",
")",
"?",
"static",
"::",
"$",
"config",
"[",
"'public_path'",
"]",
... | Configure the \PHPLegends\Thumb\Urlizer from global config
@param \PHPLegends\Thumb\Urlizer $urlizer
@return void | [
"Configure",
"the",
"\\",
"PHPLegends",
"\\",
"Thumb",
"\\",
"Urlizer",
"from",
"global",
"config"
] | 962679265f7bf34893c23a82c34d73508cb84d29 | https://github.com/phplegends/thumb/blob/962679265f7bf34893c23a82c34d73508cb84d29/src/Thumb/Thumb.php#L363-L375 |
240,136 | GustavSoftware/Cache | src/ACacheManager.php | ACacheManager._createData | protected function _createData(callable $func): array
{
$data = \call_user_func($func);
if(!\is_array($data) && !$data instanceof \Traversable) {
return []; //ignore invalid results
}
$return = [];
foreach($data as $key => $value) {
$return[$key] = [
... | php | protected function _createData(callable $func): array
{
$data = \call_user_func($func);
if(!\is_array($data) && !$data instanceof \Traversable) {
return []; //ignore invalid results
}
$return = [];
foreach($data as $key => $value) {
$return[$key] = [
... | [
"protected",
"function",
"_createData",
"(",
"callable",
"$",
"func",
")",
":",
"array",
"{",
"$",
"data",
"=",
"\\",
"call_user_func",
"(",
"$",
"func",
")",
";",
"if",
"(",
"!",
"\\",
"is_array",
"(",
"$",
"data",
")",
"&&",
"!",
"$",
"data",
"in... | Calls the creator function of the items of new cache pools and transforms
it into our internal used structure.
@param callable $func
The creator function
@return array
The data | [
"Calls",
"the",
"creator",
"function",
"of",
"the",
"items",
"of",
"new",
"cache",
"pools",
"and",
"transforms",
"it",
"into",
"our",
"internal",
"used",
"structure",
"."
] | 2a70db567aa13499487c24b399f7c9d46937df0d | https://github.com/GustavSoftware/Cache/blob/2a70db567aa13499487c24b399f7c9d46937df0d/src/ACacheManager.php#L86-L100 |
240,137 | GrupaZero/core | src/Gzero/Core/Http/Controllers/Api/UserController.php | UserController.index | public function index(UrlParamsProcessor $processor)
{
$this->authorize('readList', User::class);
$processor
->addFilter(new ArrayParser('id'))
->addFilter(new StringParser('email'), 'email')
->addFilter(new StringParser('name'))
->addFilter(new Strin... | php | public function index(UrlParamsProcessor $processor)
{
$this->authorize('readList', User::class);
$processor
->addFilter(new ArrayParser('id'))
->addFilter(new StringParser('email'), 'email')
->addFilter(new StringParser('name'))
->addFilter(new Strin... | [
"public",
"function",
"index",
"(",
"UrlParamsProcessor",
"$",
"processor",
")",
"{",
"$",
"this",
"->",
"authorize",
"(",
"'readList'",
",",
"User",
"::",
"class",
")",
";",
"$",
"processor",
"->",
"addFilter",
"(",
"new",
"ArrayParser",
"(",
"'id'",
")",... | Display list of all users
@SWG\Get(
path="/users",
tags={"user"},
summary="List of all users",
description="List of all available users, <b>'admin-access'</b> policy is required.",
produces={"application/json"},
security={{"AdminAccess": {}}},
@SWG\Parameter(
name="in",
in="query",
description="Ids to filter by",
requ... | [
"Display",
"list",
"of",
"all",
"users"
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Http/Controllers/Api/UserController.php#L120-L138 |
240,138 | GrupaZero/core | src/Gzero/Core/Http/Controllers/Api/UserController.php | UserController.update | public function update($id)
{
$user = $this->repository->getById($id);
if (!$user) {
return $this->errorNotFound();
}
$this->authorize('update', $user);
$input = $this->validator
->bind('name', ['user_id' => $user->id])
->bind('email', ['... | php | public function update($id)
{
$user = $this->repository->getById($id);
if (!$user) {
return $this->errorNotFound();
}
$this->authorize('update', $user);
$input = $this->validator
->bind('name', ['user_id' => $user->id])
->bind('email', ['... | [
"public",
"function",
"update",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"repository",
"->",
"getById",
"(",
"$",
"id",
")",
";",
"if",
"(",
"!",
"$",
"user",
")",
"{",
"return",
"$",
"this",
"->",
"errorNotFound",
"(",
")",... | Updates the specified resource.
@SWG\Patch(path="/users/{id}",
tags={"user"},
summary="Updated specific user",
description="Updates specified user, <b>'admin-access'</b> policy is required.",
produces={"application/json"},
security={{"AdminAccess": {}}},
@SWG\Parameter(
name="id",
in="path",
description="ID of user th... | [
"Updates",
"the",
"specified",
"resource",
"."
] | 093e515234fa0385b259ba4d8bc7832174a44eab | https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Http/Controllers/Api/UserController.php#L233-L248 |
240,139 | rseyferth/activerecord | lib/Reflections.php | Reflections.get | public function get($class=null)
{
$class = $this->get_class($class);
if (isset($this->reflections[$class]))
return $this->reflections[$class];
throw new ActiveRecordException("Class not found: $class");
} | php | public function get($class=null)
{
$class = $this->get_class($class);
if (isset($this->reflections[$class]))
return $this->reflections[$class];
throw new ActiveRecordException("Class not found: $class");
} | [
"public",
"function",
"get",
"(",
"$",
"class",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"get_class",
"(",
"$",
"class",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"reflections",
"[",
"$",
"class",
"]",
")",
")",
... | Get a cached ReflectionClass.
@param string $class Optional name of a class
@return mixed null or a ReflectionClass instance
@throws ActiveRecordException if class was not found | [
"Get",
"a",
"cached",
"ReflectionClass",
"."
] | 0e7b1cbddd6f967c3a09adf38753babd5f698e39 | https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Reflections.php#L59-L67 |
240,140 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Preferences.php | Preferences.setWebHook | public function setWebHook($url)
{
$this->data->notification = new stdClass;
$this->data->notification->webhook = new stdClass;
$this->data->notification->webhook->url = $url;
return $this;
} | php | public function setWebHook($url)
{
$this->data->notification = new stdClass;
$this->data->notification->webhook = new stdClass;
$this->data->notification->webhook->url = $url;
return $this;
} | [
"public",
"function",
"setWebHook",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"notification",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",
"notification",
"->",
"webhook",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->... | Set Web Hook URL
@param string $url
@return $this | [
"Set",
"Web",
"Hook",
"URL"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Preferences.php#L58-L65 |
240,141 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Preferences.php | Preferences.enableMerchantEmail | public function enableMerchantEmail()
{
$this->data->email = new stdClass;
$this->data->email->merchant = new stdClass;
$this->data->email->merchant->enabled = true;
return $this;
} | php | public function enableMerchantEmail()
{
$this->data->email = new stdClass;
$this->data->email->merchant = new stdClass;
$this->data->email->merchant->enabled = true;
return $this;
} | [
"public",
"function",
"enableMerchantEmail",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"email",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",
"email",
"->",
"merchant",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",... | Enable merchant by email
@return $this | [
"Enable",
"merchant",
"by",
"email"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Preferences.php#L72-L79 |
240,142 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Preferences.php | Preferences.disableMerchantEmail | public function disableMerchantEmail()
{
$this->data->email = new stdClass;
$this->data->email->merchant = new stdClass;
$this->data->email->merchant->enabled = false;
return $this;
} | php | public function disableMerchantEmail()
{
$this->data->email = new stdClass;
$this->data->email->merchant = new stdClass;
$this->data->email->merchant->enabled = false;
return $this;
} | [
"public",
"function",
"disableMerchantEmail",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"email",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",
"email",
"->",
"merchant",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->"... | Disable merchant by email
@return $this | [
"Disable",
"merchant",
"by",
"email"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Preferences.php#L86-L94 |
240,143 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Preferences.php | Preferences.enableCustomerEmail | public function enableCustomerEmail()
{
$this->data->email = new stdClass;
$this->data->email->customer = new stdClass;
$this->data->email->customer->enabled = true;
return $this;
} | php | public function enableCustomerEmail()
{
$this->data->email = new stdClass;
$this->data->email->customer = new stdClass;
$this->data->email->customer->enabled = true;
return $this;
} | [
"public",
"function",
"enableCustomerEmail",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"email",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",
"email",
"->",
"customer",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",... | Enable customer receive payments emails
@return $this | [
"Enable",
"customer",
"receive",
"payments",
"emails"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Preferences.php#L101-L109 |
240,144 | Softpampa/moip-sdk-php | src/Subscriptions/Resources/Preferences.php | Preferences.disableCustomerEmail | public function disableCustomerEmail()
{
$this->data->email = new stdClass;
$this->data->email->customer = new stdClass;
$this->data->email->customer->enabled = false;
return $this;
} | php | public function disableCustomerEmail()
{
$this->data->email = new stdClass;
$this->data->email->customer = new stdClass;
$this->data->email->customer->enabled = false;
return $this;
} | [
"public",
"function",
"disableCustomerEmail",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"->",
"email",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->",
"email",
"->",
"customer",
"=",
"new",
"stdClass",
";",
"$",
"this",
"->",
"data",
"->"... | Disable customer receive payments emails
@return $this | [
"Disable",
"customer",
"receive",
"payments",
"emails"
] | 621a71bd2ef1f9b690cd3431507af608152f6ad2 | https://github.com/Softpampa/moip-sdk-php/blob/621a71bd2ef1f9b690cd3431507af608152f6ad2/src/Subscriptions/Resources/Preferences.php#L116-L124 |
240,145 | dms-org/package.content | src/Cms/ContentPackage.php | ContentPackage.boot | public static function boot(ICms $cms)
{
$iocContainer = $cms->getIocContainer();
$iocContainer->bind(IIocContainer::SCOPE_SINGLETON, IContentGroupRepository::class, DbContentGroupRepository::class);
$iocContainer->bind(IIocContainer::SCOPE_SINGLETON, ContentLoaderService::class, ContentLoa... | php | public static function boot(ICms $cms)
{
$iocContainer = $cms->getIocContainer();
$iocContainer->bind(IIocContainer::SCOPE_SINGLETON, IContentGroupRepository::class, DbContentGroupRepository::class);
$iocContainer->bind(IIocContainer::SCOPE_SINGLETON, ContentLoaderService::class, ContentLoa... | [
"public",
"static",
"function",
"boot",
"(",
"ICms",
"$",
"cms",
")",
"{",
"$",
"iocContainer",
"=",
"$",
"cms",
"->",
"getIocContainer",
"(",
")",
";",
"$",
"iocContainer",
"->",
"bind",
"(",
"IIocContainer",
"::",
"SCOPE_SINGLETON",
",",
"IContentGroupRepo... | Boots and configures the package resources and services.
@param ICms $cms
@return void | [
"Boots",
"and",
"configures",
"the",
"package",
"resources",
"and",
"services",
"."
] | 6511e805c5be586c1f3740e095b49adabd621f80 | https://github.com/dms-org/package.content/blob/6511e805c5be586c1f3740e095b49adabd621f80/src/Cms/ContentPackage.php#L86-L104 |
240,146 | monomelodies/ornament | src/Adapter/Defaults.php | Defaults.flattenValues | protected function flattenValues(&$values)
{
array_walk($values, function (&$value) {
if ($this->isOrnamentModel($value)) {
$value = $value->getPrimaryKey();
if (is_array($value)) {
$value = '('.implode(', ', $value).')';
}
... | php | protected function flattenValues(&$values)
{
array_walk($values, function (&$value) {
if ($this->isOrnamentModel($value)) {
$value = $value->getPrimaryKey();
if (is_array($value)) {
$value = '('.implode(', ', $value).')';
}
... | [
"protected",
"function",
"flattenValues",
"(",
"&",
"$",
"values",
")",
"{",
"array_walk",
"(",
"$",
"values",
",",
"function",
"(",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isOrnamentModel",
"(",
"$",
"value",
")",
")",
"{",
"$",
... | Internal helper to "flatten" all values associated with an operation.
This is mainly useful for being able to store models on foreign keys and
automatically "flatten" them to the associated key during saving.
@param array &$values The array of values to flatten. | [
"Internal",
"helper",
"to",
"flatten",
"all",
"values",
"associated",
"with",
"an",
"operation",
".",
"This",
"is",
"mainly",
"useful",
"for",
"being",
"able",
"to",
"store",
"models",
"on",
"foreign",
"keys",
"and",
"automatically",
"flatten",
"them",
"to",
... | d7d070ad11f5731be141cf55c2756accaaf51402 | https://github.com/monomelodies/ornament/blob/d7d070ad11f5731be141cf55c2756accaaf51402/src/Adapter/Defaults.php#L95-L105 |
240,147 | dlcrush/laravel-dbug | src/dlcrush/DBug/DBug.php | DBug.DBug | function DBug($var='',$die=false,$forceType='',$bCollapsed=false) {
if ($var === '') {
return;
}
//include js and css scripts
if(!defined('BDBUGINIT')) {
define("BDBUGINIT", TRUE);
$this->initJSandCSS();
}
$arrAccept=array("array","object","xml"); //array of variable types that can be "forced"
$... | php | function DBug($var='',$die=false,$forceType='',$bCollapsed=false) {
if ($var === '') {
return;
}
//include js and css scripts
if(!defined('BDBUGINIT')) {
define("BDBUGINIT", TRUE);
$this->initJSandCSS();
}
$arrAccept=array("array","object","xml"); //array of variable types that can be "forced"
$... | [
"function",
"DBug",
"(",
"$",
"var",
"=",
"''",
",",
"$",
"die",
"=",
"false",
",",
"$",
"forceType",
"=",
"''",
",",
"$",
"bCollapsed",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"var",
"===",
"''",
")",
"{",
"return",
";",
"}",
"//include js and c... | Dumps out variable in a nice format
Dumps out variable in a nice format
@param string $var the variable to dump out
@param boolean $die whether or not to die after dumping
@param string $forceType the type to force the variable as
@param boolean $bCollapsed
@return HTML the HTML output of the var... | [
"Dumps",
"out",
"variable",
"in",
"a",
"nice",
"format"
] | 4a9a22beed48f670e0146950d1e646ec0b170491 | https://github.com/dlcrush/laravel-dbug/blob/4a9a22beed48f670e0146950d1e646ec0b170491/src/dlcrush/DBug/DBug.php#L35-L55 |
240,148 | dlcrush/laravel-dbug | src/dlcrush/DBug/DBug.php | DBug.varIsXmlResource | private function varIsXmlResource($var) {
$xml_parser=xml_parser_create();
xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
xml_set_element_handler($xml_parser,array(&$this,"xmlStartElement"),array(&$this,"xmlEndElement"));
xml_set_character_data_handler($xml_parser,array(&$this,"xmlCharacterDa... | php | private function varIsXmlResource($var) {
$xml_parser=xml_parser_create();
xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,0);
xml_set_element_handler($xml_parser,array(&$this,"xmlStartElement"),array(&$this,"xmlEndElement"));
xml_set_character_data_handler($xml_parser,array(&$this,"xmlCharacterDa... | [
"private",
"function",
"varIsXmlResource",
"(",
"$",
"var",
")",
"{",
"$",
"xml_parser",
"=",
"xml_parser_create",
"(",
")",
";",
"xml_parser_set_option",
"(",
"$",
"xml_parser",
",",
"XML_OPTION_CASE_FOLDING",
",",
"0",
")",
";",
"xml_set_element_handler",
"(",
... | if variable is an xml resource type | [
"if",
"variable",
"is",
"an",
"xml",
"resource",
"type"
] | 4a9a22beed48f670e0146950d1e646ec0b170491 | https://github.com/dlcrush/laravel-dbug/blob/4a9a22beed48f670e0146950d1e646ec0b170491/src/dlcrush/DBug/DBug.php#L332-L362 |
240,149 | unyx/utils | math/vectors/Vector3D.php | Vector3D.scalarTripleProduct | public function scalarTripleProduct(Vector3D $second, Vector3D $third) : float
{
return $this->dotProduct($second->crossProduct($third));
} | php | public function scalarTripleProduct(Vector3D $second, Vector3D $third) : float
{
return $this->dotProduct($second->crossProduct($third));
} | [
"public",
"function",
"scalarTripleProduct",
"(",
"Vector3D",
"$",
"second",
",",
"Vector3D",
"$",
"third",
")",
":",
"float",
"{",
"return",
"$",
"this",
"->",
"dotProduct",
"(",
"$",
"second",
"->",
"crossProduct",
"(",
"$",
"third",
")",
")",
";",
"}"... | Computes the scalar triple product of this and two other Vectors.
@param Vector3D $second The second Vector of the triple product.
@param Vector3D $third The third Vector of the triple product.
@return float The scalar triple product of the three Vectors. | [
"Computes",
"the",
"scalar",
"triple",
"product",
"of",
"this",
"and",
"two",
"other",
"Vectors",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/math/vectors/Vector3D.php#L72-L75 |
240,150 | unyx/utils | math/vectors/Vector3D.php | Vector3D.vectorTripleProduct | public function vectorTripleProduct(Vector3D $second, Vector3D $third) : Vector3D
{
return $this->crossProduct($second->crossProduct($third));
} | php | public function vectorTripleProduct(Vector3D $second, Vector3D $third) : Vector3D
{
return $this->crossProduct($second->crossProduct($third));
} | [
"public",
"function",
"vectorTripleProduct",
"(",
"Vector3D",
"$",
"second",
",",
"Vector3D",
"$",
"third",
")",
":",
"Vector3D",
"{",
"return",
"$",
"this",
"->",
"crossProduct",
"(",
"$",
"second",
"->",
"crossProduct",
"(",
"$",
"third",
")",
")",
";",
... | Computes the vector triple product of this and two other Vectors.
@param Vector3D $second The second Vector of the triple product.
@param Vector3D $third The third Vector of the triple product.
@return Vector3D The vector triple product of the three Vectors as a new Vector3 instance. | [
"Computes",
"the",
"vector",
"triple",
"product",
"of",
"this",
"and",
"two",
"other",
"Vectors",
"."
] | 503a3dd46fd2216024ab771b6e830be16d36b358 | https://github.com/unyx/utils/blob/503a3dd46fd2216024ab771b6e830be16d36b358/math/vectors/Vector3D.php#L84-L87 |
240,151 | bariew/phptools | FileModel.php | FileModel.readData | private function readData()
{
switch ($this->fileType) {
case self::TYPE_JSON :
$data = json_decode(file_get_contents($this->readPath), true);
break;
default : $data = require $this->readPath;
}
return $data;
} | php | private function readData()
{
switch ($this->fileType) {
case self::TYPE_JSON :
$data = json_decode(file_get_contents($this->readPath), true);
break;
default : $data = require $this->readPath;
}
return $data;
} | [
"private",
"function",
"readData",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"fileType",
")",
"{",
"case",
"self",
"::",
"TYPE_JSON",
":",
"$",
"data",
"=",
"json_decode",
"(",
"file_get_contents",
"(",
"$",
"this",
"->",
"readPath",
")",
",",
"... | Reading file data.
@return mixed | [
"Reading",
"file",
"data",
"."
] | e7d3aed02be11fadd24c18915a36ad5a2be899b4 | https://github.com/bariew/phptools/blob/e7d3aed02be11fadd24c18915a36ad5a2be899b4/FileModel.php#L59-L68 |
240,152 | bariew/phptools | FileModel.php | FileModel.get | public function get($key)
{
$key = is_array($key) ? $key : [$key];
$config = $this->data;
while ($key) {
$k = array_shift($key);
$config = isset($config[$k]) ? $config[$k] : [];
}
return $config;
} | php | public function get($key)
{
$key = is_array($key) ? $key : [$key];
$config = $this->data;
while ($key) {
$k = array_shift($key);
$config = isset($config[$k]) ? $config[$k] : [];
}
return $config;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"is_array",
"(",
"$",
"key",
")",
"?",
"$",
"key",
":",
"[",
"$",
"key",
"]",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"data",
";",
"while",
"(",
"$",
"key",
")",
"... | Gets data sub value.
@see \self::set() For multidimensional
@param $key
@return array|mixed | [
"Gets",
"data",
"sub",
"value",
"."
] | e7d3aed02be11fadd24c18915a36ad5a2be899b4 | https://github.com/bariew/phptools/blob/e7d3aed02be11fadd24c18915a36ad5a2be899b4/FileModel.php#L108-L117 |
240,153 | bariew/phptools | FileModel.php | FileModel.remove | public function remove($key)
{
$key = is_array($key) ? $key : [$key];
$config = $this->data;
$data = &$config;
while ($key) {
$k = array_shift($key);
if (!$key) {
unset($config[$k]);
break;
}
$config[$k] ... | php | public function remove($key)
{
$key = is_array($key) ? $key : [$key];
$config = $this->data;
$data = &$config;
while ($key) {
$k = array_shift($key);
if (!$key) {
unset($config[$k]);
break;
}
$config[$k] ... | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"key",
"=",
"is_array",
"(",
"$",
"key",
")",
"?",
"$",
"key",
":",
"[",
"$",
"key",
"]",
";",
"$",
"config",
"=",
"$",
"this",
"->",
"data",
";",
"$",
"data",
"=",
"&",
"$",
"... | Removes key from data.
@see \self::set() For multidimensional
@param $key
@return int | [
"Removes",
"key",
"from",
"data",
"."
] | e7d3aed02be11fadd24c18915a36ad5a2be899b4 | https://github.com/bariew/phptools/blob/e7d3aed02be11fadd24c18915a36ad5a2be899b4/FileModel.php#L125-L141 |
240,154 | bariew/phptools | FileModel.php | FileModel.put | public function put($data)
{
$this->data = array_merge($this->data, $data);
return $this->save();
} | php | public function put($data)
{
$this->data = array_merge($this->data, $data);
return $this->save();
} | [
"public",
"function",
"put",
"(",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"data",
",",
"$",
"data",
")",
";",
"return",
"$",
"this",
"->",
"save",
"(",
")",
";",
"}"
] | Puts complete data into file.
@param $data
@return int
@throws \Exception | [
"Puts",
"complete",
"data",
"into",
"file",
"."
] | e7d3aed02be11fadd24c18915a36ad5a2be899b4 | https://github.com/bariew/phptools/blob/e7d3aed02be11fadd24c18915a36ad5a2be899b4/FileModel.php#L149-L153 |
240,155 | bishopb/vanilla | library/core/class.proxyrequest.php | ProxyRequest.ResponseClass | public function ResponseClass($Class) {
$Code = (string)$this->ResponseStatus;
if (is_null($Code)) return FALSE;
if (strlen($Code) != strlen($Class)) return FALSE;
for ($i = 0; $i < strlen($Class); $i++)
if ($Class{$i} != 'x' && $Class{$i} != $Code{$i}) return FALSE;
... | php | public function ResponseClass($Class) {
$Code = (string)$this->ResponseStatus;
if (is_null($Code)) return FALSE;
if (strlen($Code) != strlen($Class)) return FALSE;
for ($i = 0; $i < strlen($Class); $i++)
if ($Class{$i} != 'x' && $Class{$i} != $Code{$i}) return FALSE;
... | [
"public",
"function",
"ResponseClass",
"(",
"$",
"Class",
")",
"{",
"$",
"Code",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"ResponseStatus",
";",
"if",
"(",
"is_null",
"(",
"$",
"Code",
")",
")",
"return",
"FALSE",
";",
"if",
"(",
"strlen",
"(",
... | Check if the provided response matches the provided response type
Class is a string representation of the HTTP status code, with 'x' used
as a wildcard.
Class '2xx' = All 200-level responses
Class '30x' = All 300-level responses up to 309
@param string $Class
@return boolean Whether the response matches or not | [
"Check",
"if",
"the",
"provided",
"response",
"matches",
"the",
"provided",
"response",
"type"
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.proxyrequest.php#L511-L520 |
240,156 | bishopb/vanilla | applications/vanilla/controllers/class.moderationcontroller.php | ModerationController.CheckedComments | public function CheckedComments() {
$this->DeliveryType(DELIVERY_TYPE_BOOL);
$this->DeliveryMethod(DELIVERY_METHOD_JSON);
ModerationController::InformCheckedComments($this);
$this->Render();
} | php | public function CheckedComments() {
$this->DeliveryType(DELIVERY_TYPE_BOOL);
$this->DeliveryMethod(DELIVERY_METHOD_JSON);
ModerationController::InformCheckedComments($this);
$this->Render();
} | [
"public",
"function",
"CheckedComments",
"(",
")",
"{",
"$",
"this",
"->",
"DeliveryType",
"(",
"DELIVERY_TYPE_BOOL",
")",
";",
"$",
"this",
"->",
"DeliveryMethod",
"(",
"DELIVERY_METHOD_JSON",
")",
";",
"ModerationController",
"::",
"InformCheckedComments",
"(",
... | Looks at the user's attributes and form postback to see if any comments
have been checked for administration, and if so, puts an inform message on
the screen to take action. | [
"Looks",
"at",
"the",
"user",
"s",
"attributes",
"and",
"form",
"postback",
"to",
"see",
"if",
"any",
"comments",
"have",
"been",
"checked",
"for",
"administration",
"and",
"if",
"so",
"puts",
"an",
"inform",
"message",
"on",
"the",
"screen",
"to",
"take",... | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.moderationcontroller.php#L19-L24 |
240,157 | bishopb/vanilla | applications/vanilla/controllers/class.moderationcontroller.php | ModerationController.CheckedDiscussions | public function CheckedDiscussions() {
$this->DeliveryType(DELIVERY_TYPE_BOOL);
$this->DeliveryMethod(DELIVERY_METHOD_JSON);
ModerationController::InformCheckedDiscussions($this);
$this->Render();
} | php | public function CheckedDiscussions() {
$this->DeliveryType(DELIVERY_TYPE_BOOL);
$this->DeliveryMethod(DELIVERY_METHOD_JSON);
ModerationController::InformCheckedDiscussions($this);
$this->Render();
} | [
"public",
"function",
"CheckedDiscussions",
"(",
")",
"{",
"$",
"this",
"->",
"DeliveryType",
"(",
"DELIVERY_TYPE_BOOL",
")",
";",
"$",
"this",
"->",
"DeliveryMethod",
"(",
"DELIVERY_METHOD_JSON",
")",
";",
"ModerationController",
"::",
"InformCheckedDiscussions",
"... | Looks at the user's attributes and form postback to see if any discussions
have been checked for administration, and if so, puts an inform message on
the screen to take action. | [
"Looks",
"at",
"the",
"user",
"s",
"attributes",
"and",
"form",
"postback",
"to",
"see",
"if",
"any",
"discussions",
"have",
"been",
"checked",
"for",
"administration",
"and",
"if",
"so",
"puts",
"an",
"inform",
"message",
"on",
"the",
"screen",
"to",
"tak... | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.moderationcontroller.php#L31-L36 |
240,158 | bishopb/vanilla | applications/vanilla/controllers/class.moderationcontroller.php | ModerationController.ClearCommentSelections | public function ClearCommentSelections($DiscussionID = '', $TransientKey = '') {
$Session = Gdn::Session();
if ($Session->ValidateTransientKey($TransientKey)) {
$CheckedComments = Gdn::UserModel()->GetAttribute($Session->User->UserID, 'CheckedComments', array());
unset($CheckedComments[$Di... | php | public function ClearCommentSelections($DiscussionID = '', $TransientKey = '') {
$Session = Gdn::Session();
if ($Session->ValidateTransientKey($TransientKey)) {
$CheckedComments = Gdn::UserModel()->GetAttribute($Session->User->UserID, 'CheckedComments', array());
unset($CheckedComments[$Di... | [
"public",
"function",
"ClearCommentSelections",
"(",
"$",
"DiscussionID",
"=",
"''",
",",
"$",
"TransientKey",
"=",
"''",
")",
"{",
"$",
"Session",
"=",
"Gdn",
"::",
"Session",
"(",
")",
";",
"if",
"(",
"$",
"Session",
"->",
"ValidateTransientKey",
"(",
... | Remove all comments checked for administration from the user's attributes. | [
"Remove",
"all",
"comments",
"checked",
"for",
"administration",
"from",
"the",
"user",
"s",
"attributes",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.moderationcontroller.php#L202-L211 |
240,159 | bishopb/vanilla | applications/vanilla/controllers/class.moderationcontroller.php | ModerationController.ClearDiscussionSelections | public function ClearDiscussionSelections($TransientKey = '') {
$Session = Gdn::Session();
if ($Session->ValidateTransientKey($TransientKey))
Gdn::UserModel()->SaveAttribute($Session->UserID, 'CheckedDiscussions', FALSE);
Redirect(GetIncomingValue('Target', '/discussions'));
} | php | public function ClearDiscussionSelections($TransientKey = '') {
$Session = Gdn::Session();
if ($Session->ValidateTransientKey($TransientKey))
Gdn::UserModel()->SaveAttribute($Session->UserID, 'CheckedDiscussions', FALSE);
Redirect(GetIncomingValue('Target', '/discussions'));
} | [
"public",
"function",
"ClearDiscussionSelections",
"(",
"$",
"TransientKey",
"=",
"''",
")",
"{",
"$",
"Session",
"=",
"Gdn",
"::",
"Session",
"(",
")",
";",
"if",
"(",
"$",
"Session",
"->",
"ValidateTransientKey",
"(",
"$",
"TransientKey",
")",
")",
"Gdn"... | Remove all discussions checked for administration from the user's attributes. | [
"Remove",
"all",
"discussions",
"checked",
"for",
"administration",
"from",
"the",
"user",
"s",
"attributes",
"."
] | 8494eb4a4ad61603479015a8054d23ff488364e8 | https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/applications/vanilla/controllers/class.moderationcontroller.php#L216-L222 |
240,160 | arvici/framework | src/Arvici/Heart/Router/Route.php | Route.getCompiled | public function getCompiled()
{
if ($this->compiled === null) {
$regexp = "/^";
// Method(s)
$methodIdx = 0;
foreach($this->methods as $method) {
$regexp .= "(?:" . strtoupper($method) . ")";
if (($methodIdx + 1) < count($this-... | php | public function getCompiled()
{
if ($this->compiled === null) {
$regexp = "/^";
// Method(s)
$methodIdx = 0;
foreach($this->methods as $method) {
$regexp .= "(?:" . strtoupper($method) . ")";
if (($methodIdx + 1) < count($this-... | [
"public",
"function",
"getCompiled",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"compiled",
"===",
"null",
")",
"{",
"$",
"regexp",
"=",
"\"/^\"",
";",
"// Method(s)",
"$",
"methodIdx",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"methods",
"... | Get Compiled Reg Expression key.
@return string | [
"Get",
"Compiled",
"Reg",
"Expression",
"key",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Router/Route.php#L96-L122 |
240,161 | arvici/framework | src/Arvici/Heart/Router/Route.php | Route.getValue | public function getValue($key, $default = null)
{
if (is_array($this->kwargs) && isset($this->kwargs[$key])) {
return $this->kwargs[$key];
}
return $default; // @codeCoverageIgnore
} | php | public function getValue($key, $default = null)
{
if (is_array($this->kwargs) && isset($this->kwargs[$key])) {
return $this->kwargs[$key];
}
return $default; // @codeCoverageIgnore
} | [
"public",
"function",
"getValue",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"kwargs",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"kwargs",
"[",
"$",
"key",
"]",
")",
")",
"{",
"... | Get kwargs value by key, return default if not found.
@param string $key Key string
@param mixed $default
@return mixed|null | [
"Get",
"kwargs",
"value",
"by",
"key",
"return",
"default",
"if",
"not",
"found",
"."
] | 4d0933912fef8f9edc756ef1ace009e96d9fc4b1 | https://github.com/arvici/framework/blob/4d0933912fef8f9edc756ef1ace009e96d9fc4b1/src/Arvici/Heart/Router/Route.php#L152-L158 |
240,162 | bytic/helpers | src/View/Tooltips.php | Tooltips.addItem | public function addItem($id, $content, $title = false)
{
$this->tooltips[$id] = $this->newItem($id, $content, $title);
} | php | public function addItem($id, $content, $title = false)
{
$this->tooltips[$id] = $this->newItem($id, $content, $title);
} | [
"public",
"function",
"addItem",
"(",
"$",
"id",
",",
"$",
"content",
",",
"$",
"title",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"tooltips",
"[",
"$",
"id",
"]",
"=",
"$",
"this",
"->",
"newItem",
"(",
"$",
"id",
",",
"$",
"content",
",",
"$... | Adds a tooltip item to the queue
@param string $id
@param string $content
@param string|bool $title | [
"Adds",
"a",
"tooltip",
"item",
"to",
"the",
"queue"
] | 6a4f0388ba8653d65058ce63cf7627e38b9df041 | https://github.com/bytic/helpers/blob/6a4f0388ba8653d65058ce63cf7627e38b9df041/src/View/Tooltips.php#L27-L30 |
240,163 | remote-office/libx | src/Json/Api/JsonApiClient.php | JsonApiClient.call | protected function call(\LibX\Net\Rest\Request $request, \LibX\Net\Rest\Response $response)
{
// Make the call!
$this->client->execute($request, $response);
//print_r($request);
//print_r($response);
// Get info
$info = $response->getInfo();
// Get JSON response
$j... | php | protected function call(\LibX\Net\Rest\Request $request, \LibX\Net\Rest\Response $response)
{
// Make the call!
$this->client->execute($request, $response);
//print_r($request);
//print_r($response);
// Get info
$info = $response->getInfo();
// Get JSON response
$j... | [
"protected",
"function",
"call",
"(",
"\\",
"LibX",
"\\",
"Net",
"\\",
"Rest",
"\\",
"Request",
"$",
"request",
",",
"\\",
"LibX",
"\\",
"Net",
"\\",
"Rest",
"\\",
"Response",
"$",
"response",
")",
"{",
"// Make the call!",
"$",
"this",
"->",
"client",
... | Make a REST call
@param \LibX\Net\Rest\Request $request
@param \LibX\Net\Rest\Response $response
@return StdClass | [
"Make",
"a",
"REST",
"call"
] | 8baeaae99a6110e7c588bc0388df89a0dc0768b5 | https://github.com/remote-office/libx/blob/8baeaae99a6110e7c588bc0388df89a0dc0768b5/src/Json/Api/JsonApiClient.php#L35-L53 |
240,164 | joaogl/comments | src/Controllers/CommentsController.php | CommentsController.getDelete | public function getDelete($id = null)
{
// Get comment information
$comment = Comments::getCommentsRepository()->find($id);
if ($comment == null)
{
// Prepare the error message
$error = Lang::get('comments.comment.not_found');
// Redirect to the ... | php | public function getDelete($id = null)
{
// Get comment information
$comment = Comments::getCommentsRepository()->find($id);
if ($comment == null)
{
// Prepare the error message
$error = Lang::get('comments.comment.not_found');
// Redirect to the ... | [
"public",
"function",
"getDelete",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"// Get comment information",
"$",
"comment",
"=",
"Comments",
"::",
"getCommentsRepository",
"(",
")",
"->",
"find",
"(",
"$",
"id",
")",
";",
"if",
"(",
"$",
"comment",
"==",
"nu... | Delete the given comment.
@param int $id
@return Redirect | [
"Delete",
"the",
"given",
"comment",
"."
] | 66fabe1ad4a8977a0933f8310ee6dcb38a72cbc3 | https://github.com/joaogl/comments/blob/66fabe1ad4a8977a0933f8310ee6dcb38a72cbc3/src/Controllers/CommentsController.php#L50-L74 |
240,165 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.temporal_property | public static function temporal_property($key, $default = null)
{
$class = get_called_class();
// If already determined
if (!array_key_exists($class, static::$_temporal_cached))
{
static::temporal_properties();
}
return \Arr::get(static::$_temporal_cached[$class], $key, $default);
} | php | public static function temporal_property($key, $default = null)
{
$class = get_called_class();
// If already determined
if (!array_key_exists($class, static::$_temporal_cached))
{
static::temporal_properties();
}
return \Arr::get(static::$_temporal_cached[$class], $key, $default);
} | [
"public",
"static",
"function",
"temporal_property",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"// If already determined",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"class",
",",
... | Fetches temporal property description array, or specific data from
it.
Stolen from parent class.
@param string property or property.key
@param mixed return value when key not present
@return mixed | [
"Fetches",
"temporal",
"property",
"description",
"array",
"or",
"specific",
"data",
"from",
"it",
".",
"Stolen",
"from",
"parent",
"class",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L117-L128 |
240,166 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.find_revision | public static function find_revision($id, $timestamp = null, $relations = array())
{
if ($timestamp == null)
{
return parent::find($id);
}
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
// Select the next latest revisio... | php | public static function find_revision($id, $timestamp = null, $relations = array())
{
if ($timestamp == null)
{
return parent::find($id);
}
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
// Select the next latest revisio... | [
"public",
"static",
"function",
"find_revision",
"(",
"$",
"id",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"relations",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"$",
"timestamp",
"==",
"null",
")",
"{",
"return",
"parent",
"::",
"find",
"(",
... | Finds a specific revision for the given ID. If a timestamp is specified
the revision returned will reflect the entity's state at that given time.
This will also load relations when requested.
@param type $id
@param int $timestamp Null to get the latest revision (Same as find($id))
@param array $relations Names of the ... | [
"Finds",
"a",
"specific",
"revision",
"for",
"the",
"given",
"ID",
".",
"If",
"a",
"timestamp",
"is",
"specified",
"the",
"revision",
"returned",
"will",
"reflect",
"the",
"entity",
"s",
"state",
"at",
"that",
"given",
"time",
".",
"This",
"will",
"also",
... | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L140-L177 |
240,167 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.find_revisions_between | public static function find_revisions_between($id, $earliestTime = null, $latestTime = null)
{
$timestamp_start_name = static::temporal_property('start_column');
$max_timestamp = static::temporal_property('max_timestamp');
if ($earliestTime == null)
{
$earliestTime = 0;
}
if($latestTime == null)
{
... | php | public static function find_revisions_between($id, $earliestTime = null, $latestTime = null)
{
$timestamp_start_name = static::temporal_property('start_column');
$max_timestamp = static::temporal_property('max_timestamp');
if ($earliestTime == null)
{
$earliestTime = 0;
}
if($latestTime == null)
{
... | [
"public",
"static",
"function",
"find_revisions_between",
"(",
"$",
"id",
",",
"$",
"earliestTime",
"=",
"null",
",",
"$",
"latestTime",
"=",
"null",
")",
"{",
"$",
"timestamp_start_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'start_column'",
")",
"... | Returns a list of revisions between the given times with the most recent
first. This does not load relations.
@param int|string $id
@param timestamp $earliestTime
@param timestamp $latestTime | [
"Returns",
"a",
"list",
"of",
"revisions",
"between",
"the",
"given",
"times",
"with",
"the",
"most",
"recent",
"first",
".",
"This",
"does",
"not",
"load",
"relations",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L264-L289 |
240,168 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.find | public static function find($id = null, array $options = array())
{
$timestamp_end_name = static::temporal_property('end_column');
$max_timestamp = static::temporal_property('max_timestamp');
switch ($id)
{
case 'all':
case 'first':
case 'last':
break;
default:
$id = (array) $id;
$coun... | php | public static function find($id = null, array $options = array())
{
$timestamp_end_name = static::temporal_property('end_column');
$max_timestamp = static::temporal_property('max_timestamp');
switch ($id)
{
case 'all':
case 'first':
case 'last':
break;
default:
$id = (array) $id;
$coun... | [
"public",
"static",
"function",
"find",
"(",
"$",
"id",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"$",
"timestamp_end_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'end_column'",
")",
";",
"$",
"max_timestamp",
... | Overrides the default find method to allow the latest revision to be found
by default.
If any new options to find are added the switch statement will have to be
updated too.
@param type $id
@param array $options
@return type | [
"Overrides",
"the",
"default",
"find",
"method",
"to",
"allow",
"the",
"latest",
"revision",
"to",
"be",
"found",
"by",
"default",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L302-L332 |
240,169 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.getNonTimestampPks | public static function getNonTimestampPks()
{
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
$pks = array();
foreach(parent::primary_key() as $key)
{
if ($key != $timestamp_start_name && $key != $timestamp_end_name)
{
... | php | public static function getNonTimestampPks()
{
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
$pks = array();
foreach(parent::primary_key() as $key)
{
if ($key != $timestamp_start_name && $key != $timestamp_end_name)
{
... | [
"public",
"static",
"function",
"getNonTimestampPks",
"(",
")",
"{",
"$",
"timestamp_start_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'start_column'",
")",
";",
"$",
"timestamp_end_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'end_column'",
")"... | Returns an array of the primary keys that are not related to temporal
timestamp information. | [
"Returns",
"an",
"array",
"of",
"the",
"primary",
"keys",
"that",
"are",
"not",
"related",
"to",
"temporal",
"timestamp",
"information",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L338-L353 |
240,170 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.save | public function save($cascade = null, $use_transaction = false)
{
// Load temporal properties.
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
$mysql_timestamp = static::temporal_property('mysql_timestamp');
$max_timestamp = s... | php | public function save($cascade = null, $use_transaction = false)
{
// Load temporal properties.
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
$mysql_timestamp = static::temporal_property('mysql_timestamp');
$max_timestamp = s... | [
"public",
"function",
"save",
"(",
"$",
"cascade",
"=",
"null",
",",
"$",
"use_transaction",
"=",
"false",
")",
"{",
"// Load temporal properties.",
"$",
"timestamp_start_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'start_column'",
")",
";",
"$",
"tim... | Overrides the save method to allow temporal models to be
@param boolean $cascade
@param boolean $use_transaction
@param boolean $skip_temporal Skips temporal filtering on initial inserts. Should not be used!
@return boolean | [
"Overrides",
"the",
"save",
"method",
"to",
"allow",
"temporal",
"models",
"to",
"be"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L362-L444 |
240,171 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.restore | public function restore()
{
$timestamp_end_name = static::temporal_property('end_column');
$max_timestamp = static::temporal_property('max_timestamp');
// check to see if there is a currently active row, if so then don't
// restore anything.
$activeRow = static::find('first', array(
'where' => array(
... | php | public function restore()
{
$timestamp_end_name = static::temporal_property('end_column');
$max_timestamp = static::temporal_property('max_timestamp');
// check to see if there is a currently active row, if so then don't
// restore anything.
$activeRow = static::find('first', array(
'where' => array(
... | [
"public",
"function",
"restore",
"(",
")",
"{",
"$",
"timestamp_end_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'end_column'",
")",
";",
"$",
"max_timestamp",
"=",
"static",
"::",
"temporal_property",
"(",
"'max_timestamp'",
")",
";",
"// check to see i... | Restores the entity to this state.
@return boolean | [
"Restores",
"the",
"entity",
"to",
"this",
"state",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L462-L504 |
240,172 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.add_primary_keys_to_where | protected function add_primary_keys_to_where($query)
{
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
$primary_key = array(
'id',
$timestamp_start_name,
$timestamp_end_name,
);
foreach ($primary_key as $pk)
{
$... | php | protected function add_primary_keys_to_where($query)
{
$timestamp_start_name = static::temporal_property('start_column');
$timestamp_end_name = static::temporal_property('end_column');
$primary_key = array(
'id',
$timestamp_start_name,
$timestamp_end_name,
);
foreach ($primary_key as $pk)
{
$... | [
"protected",
"function",
"add_primary_keys_to_where",
"(",
"$",
"query",
")",
"{",
"$",
"timestamp_start_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'start_column'",
")",
";",
"$",
"timestamp_end_name",
"=",
"static",
"::",
"temporal_property",
"(",
"'end... | Allows correct PKs to be added when performing updates
@param Query $query | [
"Allows",
"correct",
"PKs",
"to",
"be",
"added",
"when",
"performing",
"updates"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L535-L550 |
240,173 | indigophp-archive/codeception-fuel-module | fuel/fuel/packages/orm/classes/model/temporal.php | Model_Temporal.primary_key | public static function primary_key()
{
$id_only = static::get_primary_key_id_only_status();
$pk_status = static::get_primary_key_status();
if ($id_only)
{
return static::getNonTimestampPks();
}
if ($pk_status && ! $id_only)
{
return static::$_primary_key;
}
return array();
} | php | public static function primary_key()
{
$id_only = static::get_primary_key_id_only_status();
$pk_status = static::get_primary_key_status();
if ($id_only)
{
return static::getNonTimestampPks();
}
if ($pk_status && ! $id_only)
{
return static::$_primary_key;
}
return array();
} | [
"public",
"static",
"function",
"primary_key",
"(",
")",
"{",
"$",
"id_only",
"=",
"static",
"::",
"get_primary_key_id_only_status",
"(",
")",
";",
"$",
"pk_status",
"=",
"static",
"::",
"get_primary_key_status",
"(",
")",
";",
"if",
"(",
"$",
"id_only",
")"... | Overrides the parent primary_key method to allow primaray key enforcement
to be turned off when updating a temporal model. | [
"Overrides",
"the",
"parent",
"primary_key",
"method",
"to",
"allow",
"primaray",
"key",
"enforcement",
"to",
"be",
"turned",
"off",
"when",
"updating",
"a",
"temporal",
"model",
"."
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/packages/orm/classes/model/temporal.php#L556-L572 |
240,174 | emilianobovetti/php-option | src/Option.php | Option.create | public static function create($value, $empty = null)
{
// Option is a callable class!
$value = ( ! $value instanceof self) && is_callable($value) ? $value() : $value;
if (is_callable($empty)) {
$option = $empty($value) ? self::$none : new Some($value);
} else if ($value ... | php | public static function create($value, $empty = null)
{
// Option is a callable class!
$value = ( ! $value instanceof self) && is_callable($value) ? $value() : $value;
if (is_callable($empty)) {
$option = $empty($value) ? self::$none : new Some($value);
} else if ($value ... | [
"public",
"static",
"function",
"create",
"(",
"$",
"value",
",",
"$",
"empty",
"=",
"null",
")",
"{",
"// Option is a callable class!",
"$",
"value",
"=",
"(",
"!",
"$",
"value",
"instanceof",
"self",
")",
"&&",
"is_callable",
"(",
"$",
"value",
")",
"?... | Create new Option object.
By default it creates a None if $value is null,
Some($value) otherwise.
$value can be:
1. another Option
2. a callback
3. any other PHP value
$empty parameter is used to determine if $value
is empty or not and it can be:
1. a callback - which is called with $value
as parameter: if it return... | [
"Create",
"new",
"Option",
"object",
"."
] | b4acdf5d649f06541c21880962531b542a5f614f | https://github.com/emilianobovetti/php-option/blob/b4acdf5d649f06541c21880962531b542a5f614f/src/Option.php#L72-L88 |
240,175 | canis-io/yii2-canis-lib | lib/db/behaviors/PrimaryRelation.php | PrimaryRelation.getSiblings | public function getSiblings($role, $primaryOnly = false)
{
$primaryField = $this->getPrimaryField($role);
$parentObject = $this->owner->parentObject;
$childObject = $this->owner->childObject;
if (empty($childObject)) {
return [];
}
$relationFields = [];
... | php | public function getSiblings($role, $primaryOnly = false)
{
$primaryField = $this->getPrimaryField($role);
$parentObject = $this->owner->parentObject;
$childObject = $this->owner->childObject;
if (empty($childObject)) {
return [];
}
$relationFields = [];
... | [
"public",
"function",
"getSiblings",
"(",
"$",
"role",
",",
"$",
"primaryOnly",
"=",
"false",
")",
"{",
"$",
"primaryField",
"=",
"$",
"this",
"->",
"getPrimaryField",
"(",
"$",
"role",
")",
";",
"$",
"parentObject",
"=",
"$",
"this",
"->",
"owner",
"-... | Get siblings.
@param [[@doctodo param_type:role]] $role [[@doctodo param_description:role]]
@param boolean $primaryOnly [[@doctodo param_description:primaryOnly]] [optional]
@return [[@doctodo return_type:getSiblings]] [[@doctodo return_description:getSiblings]] | [
"Get",
"siblings",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/db/behaviors/PrimaryRelation.php#L82-L96 |
240,176 | canis-io/yii2-canis-lib | lib/db/behaviors/PrimaryRelation.php | PrimaryRelation.setPrimary | public function setPrimary($role)
{
if (!$this->handlePrimary($role)) {
return false;
}
$primaryField = $this->getPrimaryField($role);
$primarySiblings = $this->getSiblings($role, true);
foreach ($primarySiblings as $sibling) {
$sibling->{$primaryField... | php | public function setPrimary($role)
{
if (!$this->handlePrimary($role)) {
return false;
}
$primaryField = $this->getPrimaryField($role);
$primarySiblings = $this->getSiblings($role, true);
foreach ($primarySiblings as $sibling) {
$sibling->{$primaryField... | [
"public",
"function",
"setPrimary",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"handlePrimary",
"(",
"$",
"role",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"primaryField",
"=",
"$",
"this",
"->",
"getPrimaryField",
"(",
"$"... | Set primary.
@param [[@doctodo param_type:role]] $role [[@doctodo param_description:role]]
@return [[@doctodo return_type:setPrimary]] [[@doctodo return_description:setPrimary]] | [
"Set",
"primary",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/db/behaviors/PrimaryRelation.php#L202-L218 |
240,177 | canis-io/yii2-canis-lib | lib/db/behaviors/PrimaryRelation.php | PrimaryRelation.isPrimary | public function isPrimary($role)
{
if (!$this->handlePrimary($role)) {
return false;
}
$primaryField = $this->getPrimaryField($role);
return !empty($this->owner->{$primaryField});
} | php | public function isPrimary($role)
{
if (!$this->handlePrimary($role)) {
return false;
}
$primaryField = $this->getPrimaryField($role);
return !empty($this->owner->{$primaryField});
} | [
"public",
"function",
"isPrimary",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"handlePrimary",
"(",
"$",
"role",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"primaryField",
"=",
"$",
"this",
"->",
"getPrimaryField",
"(",
"$",... | Get is primary.
@param [[@doctodo param_type:role]] $role [[@doctodo param_description:role]]
@return [[@doctodo return_type:isPrimary]] [[@doctodo return_description:isPrimary]] | [
"Get",
"is",
"primary",
"."
] | 97d533521f65b084dc805c5f312c364b469142d2 | https://github.com/canis-io/yii2-canis-lib/blob/97d533521f65b084dc805c5f312c364b469142d2/lib/db/behaviors/PrimaryRelation.php#L227-L235 |
240,178 | encorephp/console | src/ServiceProvider.php | ServiceProvider.register | public function register()
{
$container = $this->container;
$console = new Console('EncorePHP', $container::VERSION);
$this->container->bind('console', $console);
if ($this->container->bound('error')) {
$this->container['error']->setDisplayer(new ConsoleDisplayer($conso... | php | public function register()
{
$container = $this->container;
$console = new Console('EncorePHP', $container::VERSION);
$this->container->bind('console', $console);
if ($this->container->bound('error')) {
$this->container['error']->setDisplayer(new ConsoleDisplayer($conso... | [
"public",
"function",
"register",
"(",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"container",
";",
"$",
"console",
"=",
"new",
"Console",
"(",
"'EncorePHP'",
",",
"$",
"container",
"::",
"VERSION",
")",
";",
"$",
"this",
"->",
"container",
"-... | Register the console into the container.
@return void | [
"Register",
"the",
"console",
"into",
"the",
"container",
"."
] | 16dc0f8f6d303ec8bafef3fd388b0a0928155797 | https://github.com/encorephp/console/blob/16dc0f8f6d303ec8bafef3fd388b0a0928155797/src/ServiceProvider.php#L17-L27 |
240,179 | encorephp/console | src/ServiceProvider.php | ServiceProvider.boot | public function boot()
{
// Loop the providers and register commands
$providers = $this->container->providers(false);
foreach ($providers as $provider) {
if (method_exists($provider, 'commands')) {
$this->registerCommands($provider->commands());
}
... | php | public function boot()
{
// Loop the providers and register commands
$providers = $this->container->providers(false);
foreach ($providers as $provider) {
if (method_exists($provider, 'commands')) {
$this->registerCommands($provider->commands());
}
... | [
"public",
"function",
"boot",
"(",
")",
"{",
"// Loop the providers and register commands",
"$",
"providers",
"=",
"$",
"this",
"->",
"container",
"->",
"providers",
"(",
"false",
")",
";",
"foreach",
"(",
"$",
"providers",
"as",
"$",
"provider",
")",
"{",
"... | Register service provider commands on boot.
@return void | [
"Register",
"service",
"provider",
"commands",
"on",
"boot",
"."
] | 16dc0f8f6d303ec8bafef3fd388b0a0928155797 | https://github.com/encorephp/console/blob/16dc0f8f6d303ec8bafef3fd388b0a0928155797/src/ServiceProvider.php#L34-L44 |
240,180 | encorephp/console | src/ServiceProvider.php | ServiceProvider.registerCommands | protected function registerCommands(array $commands)
{
foreach ($commands as $command) {
if ( ! $command instanceof SymfonyCommand) {
$command = $this->container[$command];
}
$this->container['console']->add($command);
}
} | php | protected function registerCommands(array $commands)
{
foreach ($commands as $command) {
if ( ! $command instanceof SymfonyCommand) {
$command = $this->container[$command];
}
$this->container['console']->add($command);
}
} | [
"protected",
"function",
"registerCommands",
"(",
"array",
"$",
"commands",
")",
"{",
"foreach",
"(",
"$",
"commands",
"as",
"$",
"command",
")",
"{",
"if",
"(",
"!",
"$",
"command",
"instanceof",
"SymfonyCommand",
")",
"{",
"$",
"command",
"=",
"$",
"th... | Register an array of commands into the console.
@return void | [
"Register",
"an",
"array",
"of",
"commands",
"into",
"the",
"console",
"."
] | 16dc0f8f6d303ec8bafef3fd388b0a0928155797 | https://github.com/encorephp/console/blob/16dc0f8f6d303ec8bafef3fd388b0a0928155797/src/ServiceProvider.php#L51-L60 |
240,181 | vpg/titon.common | src/Titon/Common/Traits/Mutable.php | Mutable.add | public function add(array $params) {
foreach ($params as $key => $value) {
$this->set($key, $value);
}
return $this;
} | php | public function add(array $params) {
foreach ($params as $key => $value) {
$this->set($key, $value);
}
return $this;
} | [
"public",
"function",
"add",
"(",
"array",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"set",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"return",
"$",
"this... | Add multiple parameters.
@param array $params
@return $this | [
"Add",
"multiple",
"parameters",
"."
] | 41fe62bd5134bf76db3ff9caa16f280d9d534ef9 | https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Traits/Mutable.php#L74-L80 |
240,182 | vpg/titon.common | src/Titon/Common/Traits/Mutable.php | Mutable.get | public function get($key, $default = null) {
if (strpos($key, '.') === false) {
$value = isset($this->_data[$key]) ? $this->_data[$key] : null;
} else {
$value = Hash::get($this->_data, $key);
}
if ($value === null) {
return $default;
}
... | php | public function get($key, $default = null) {
if (strpos($key, '.') === false) {
$value = isset($this->_data[$key]) ? $this->_data[$key] : null;
} else {
$value = Hash::get($this->_data, $key);
}
if ($value === null) {
return $default;
}
... | [
"public",
"function",
"get",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'.'",
")",
"===",
"false",
")",
"{",
"$",
"value",
"=",
"isset",
"(",
"$",
"this",
"->",
"_data",
"[",
"$",
... | Return a parameter by key.
@uses Titon\Utility\Hash
@param string $key
@param mixed $default
@return mixed | [
"Return",
"a",
"parameter",
"by",
"key",
"."
] | 41fe62bd5134bf76db3ff9caa16f280d9d534ef9 | https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Traits/Mutable.php#L111-L123 |
240,183 | vpg/titon.common | src/Titon/Common/Traits/Mutable.php | Mutable.remove | public function remove($key) {
$this->_data = Hash::remove($this->_data, $key);
return $this;
} | php | public function remove($key) {
$this->_data = Hash::remove($this->_data, $key);
return $this;
} | [
"public",
"function",
"remove",
"(",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"_data",
"=",
"Hash",
"::",
"remove",
"(",
"$",
"this",
"->",
"_data",
",",
"$",
"key",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Remove a parameter by key.
@uses Titon\Utility\Hash
@param string $key
@return $this | [
"Remove",
"a",
"parameter",
"by",
"key",
"."
] | 41fe62bd5134bf76db3ff9caa16f280d9d534ef9 | https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Traits/Mutable.php#L163-L167 |
240,184 | vpg/titon.common | src/Titon/Common/Traits/Mutable.php | Mutable.set | public function set($key, $value = null) {
if (strpos($key, '.') === false) {
$this->_data[$key] = $value;
} else {
$this->_data = Hash::set($this->_data, $key, $value);
}
return $this;
} | php | public function set($key, $value = null) {
if (strpos($key, '.') === false) {
$this->_data[$key] = $value;
} else {
$this->_data = Hash::set($this->_data, $key, $value);
}
return $this;
} | [
"public",
"function",
"set",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"strpos",
"(",
"$",
"key",
",",
"'.'",
")",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"_data",
"[",
"$",
"key",
"]",
"=",
"$",
"value",
";",... | Set a parameter value by key.
@uses Titon\Utility\Hash
@param string $key
@param mixed $value
@return $this | [
"Set",
"a",
"parameter",
"value",
"by",
"key",
"."
] | 41fe62bd5134bf76db3ff9caa16f280d9d534ef9 | https://github.com/vpg/titon.common/blob/41fe62bd5134bf76db3ff9caa16f280d9d534ef9/src/Titon/Common/Traits/Mutable.php#L178-L186 |
240,185 | JoshuaEstes/Daedalus | src/Daedalus/Kernel.php | Kernel.boot | public function boot(Application $application, InputInterface $input, $output)
{
if (true === $this->booted) {
return;
}
$this->application = $application;
$this->input = $input;
$this->output = $output;
$this->initializeContainer();
$... | php | public function boot(Application $application, InputInterface $input, $output)
{
if (true === $this->booted) {
return;
}
$this->application = $application;
$this->input = $input;
$this->output = $output;
$this->initializeContainer();
$... | [
"public",
"function",
"boot",
"(",
"Application",
"$",
"application",
",",
"InputInterface",
"$",
"input",
",",
"$",
"output",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"booted",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"applicatio... | Boots kernel by setting up the container | [
"Boots",
"kernel",
"by",
"setting",
"up",
"the",
"container"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Kernel.php#L37-L49 |
240,186 | JoshuaEstes/Daedalus | src/Daedalus/Kernel.php | Kernel.initializeContainer | protected function initializeContainer()
{
$this->container = $this->buildContainer();
// Load all the default services
$this->getContainerLoader($this->container)->load('services.xml');
$this->container->compile();
} | php | protected function initializeContainer()
{
$this->container = $this->buildContainer();
// Load all the default services
$this->getContainerLoader($this->container)->load('services.xml');
$this->container->compile();
} | [
"protected",
"function",
"initializeContainer",
"(",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"$",
"this",
"->",
"buildContainer",
"(",
")",
";",
"// Load all the default services",
"$",
"this",
"->",
"getContainerLoader",
"(",
"$",
"this",
"->",
"containe... | Initialize the container and compile | [
"Initialize",
"the",
"container",
"and",
"compile"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Kernel.php#L62-L70 |
240,187 | JoshuaEstes/Daedalus | src/Daedalus/Kernel.php | Kernel.buildContainer | protected function buildContainer()
{
$container = new ContainerBuilder(new ParameterBag($this->getContainerParameters()));
$container->setResourceTracking(true);
$container->set('kernel', $this);
$container->set('application', $this->application);
// Load the build file
... | php | protected function buildContainer()
{
$container = new ContainerBuilder(new ParameterBag($this->getContainerParameters()));
$container->setResourceTracking(true);
$container->set('kernel', $this);
$container->set('application', $this->application);
// Load the build file
... | [
"protected",
"function",
"buildContainer",
"(",
")",
"{",
"$",
"container",
"=",
"new",
"ContainerBuilder",
"(",
"new",
"ParameterBag",
"(",
"$",
"this",
"->",
"getContainerParameters",
"(",
")",
")",
")",
";",
"$",
"container",
"->",
"setResourceTracking",
"(... | Build the container and get it setup in a basic state
@return ContainerBuilder | [
"Build",
"the",
"container",
"and",
"get",
"it",
"setup",
"in",
"a",
"basic",
"state"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Kernel.php#L77-L94 |
240,188 | JoshuaEstes/Daedalus | src/Daedalus/Kernel.php | Kernel.getEnvironmentVariables | protected function getEnvironmentVariables()
{
$env = array();
foreach ($_SERVER as $name => $val) {
if (is_array($val) || !in_array(strtolower($name), $this->getEnvironmentVariablesThatICareAbout())) {
// In the future, this could be supported
continue;
... | php | protected function getEnvironmentVariables()
{
$env = array();
foreach ($_SERVER as $name => $val) {
if (is_array($val) || !in_array(strtolower($name), $this->getEnvironmentVariablesThatICareAbout())) {
// In the future, this could be supported
continue;
... | [
"protected",
"function",
"getEnvironmentVariables",
"(",
")",
"{",
"$",
"env",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"_SERVER",
"as",
"$",
"name",
"=>",
"$",
"val",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"val",
")",
"||",
"!",
"in_a... | Returns an array of various environmental variables
@return array | [
"Returns",
"an",
"array",
"of",
"various",
"environmental",
"variables"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Kernel.php#L143-L157 |
240,189 | JoshuaEstes/Daedalus | src/Daedalus/Kernel.php | Kernel.getBuildFile | protected function getBuildFile()
{
$buildfile = getcwd().'/build.yml';
if (true === $this->input->hasParameterOption('--buildfile')) {
$buildfile = realpath($this->input->getParameterOption('--buildfile'));
}
if (is_file($buildfile) && is_readable($buildfile)) {
... | php | protected function getBuildFile()
{
$buildfile = getcwd().'/build.yml';
if (true === $this->input->hasParameterOption('--buildfile')) {
$buildfile = realpath($this->input->getParameterOption('--buildfile'));
}
if (is_file($buildfile) && is_readable($buildfile)) {
... | [
"protected",
"function",
"getBuildFile",
"(",
")",
"{",
"$",
"buildfile",
"=",
"getcwd",
"(",
")",
".",
"'/build.yml'",
";",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"input",
"->",
"hasParameterOption",
"(",
"'--buildfile'",
")",
")",
"{",
"$",
"buil... | Used to return the location of the build file
@return string
@throw Exception | [
"Used",
"to",
"return",
"the",
"location",
"of",
"the",
"build",
"file"
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Kernel.php#L183-L198 |
240,190 | JoshuaEstes/Daedalus | src/Daedalus/Kernel.php | Kernel.getPropertiesFile | protected function getPropertiesFile()
{
$propertyfile = getcwd().'/build.properties';
if (true === $this->input->hasParameterOption('--propertyfile')) {
$propertyfile = realpath($this->input->getParameterOption('--propertyfile'));
}
if (is_file($propertyfile) && is_rea... | php | protected function getPropertiesFile()
{
$propertyfile = getcwd().'/build.properties';
if (true === $this->input->hasParameterOption('--propertyfile')) {
$propertyfile = realpath($this->input->getParameterOption('--propertyfile'));
}
if (is_file($propertyfile) && is_rea... | [
"protected",
"function",
"getPropertiesFile",
"(",
")",
"{",
"$",
"propertyfile",
"=",
"getcwd",
"(",
")",
".",
"'/build.properties'",
";",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"input",
"->",
"hasParameterOption",
"(",
"'--propertyfile'",
")",
")",
"... | Finds and returns the file set as the build.properties file.
@return string|false | [
"Finds",
"and",
"returns",
"the",
"file",
"set",
"as",
"the",
"build",
".",
"properties",
"file",
"."
] | 4c898c41433242e46b30d45ebe03fdc91512b444 | https://github.com/JoshuaEstes/Daedalus/blob/4c898c41433242e46b30d45ebe03fdc91512b444/src/Daedalus/Kernel.php#L205-L227 |
240,191 | web-operational-kit/stream | src/Stream.php | Stream.getMetaDataValue | public function getMetaDataValue($key) {
return (isset($this->meta[$key]) ? $this->meta[$key] : null);
} | php | public function getMetaDataValue($key) {
return (isset($this->meta[$key]) ? $this->meta[$key] : null);
} | [
"public",
"function",
"getMetaDataValue",
"(",
"$",
"key",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"meta",
"[",
"$",
"key",
"]",
")",
"?",
"$",
"this",
"->",
"meta",
"[",
"$",
"key",
"]",
":",
"null",
")",
";",
"}"
] | Get the stream meta data value
@param string $key Meta key
@return array|string|null Returns the meta data list, value or null | [
"Get",
"the",
"stream",
"meta",
"data",
"value"
] | 6c08c787454745938de7adc3bfd64871604ac80b | https://github.com/web-operational-kit/stream/blob/6c08c787454745938de7adc3bfd64871604ac80b/src/Stream.php#L141-L145 |
240,192 | web-operational-kit/stream | src/Stream.php | Stream.getContent | public function getContent() {
if($this->isSeekable())
$this->rewind();
if (!$this->isReadable() || ($contents = stream_get_contents($this->stream)) === false) {
throw new \RuntimeException('Could not get contents of not readable stream');
}
... | php | public function getContent() {
if($this->isSeekable())
$this->rewind();
if (!$this->isReadable() || ($contents = stream_get_contents($this->stream)) === false) {
throw new \RuntimeException('Could not get contents of not readable stream');
}
... | [
"public",
"function",
"getContent",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isSeekable",
"(",
")",
")",
"$",
"this",
"->",
"rewind",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isReadable",
"(",
")",
"||",
"(",
"$",
"contents",
"=",
... | Get the stream content
@note The cursor will be reset to the start of the file if possible.
@return string | [
"Get",
"the",
"stream",
"content"
] | 6c08c787454745938de7adc3bfd64871604ac80b | https://github.com/web-operational-kit/stream/blob/6c08c787454745938de7adc3bfd64871604ac80b/src/Stream.php#L162-L173 |
240,193 | web-operational-kit/stream | src/Stream.php | Stream.read | public function read($length = null) {
if(is_null($length))
$length = $this->getSize(0);
if (!$this->isReadable() || ($data = fread($this->stream, $length)) === false) {
throw new \RuntimeException('Could not read from not readable stream');
}
... | php | public function read($length = null) {
if(is_null($length))
$length = $this->getSize(0);
if (!$this->isReadable() || ($data = fread($this->stream, $length)) === false) {
throw new \RuntimeException('Could not read from not readable stream');
}
... | [
"public",
"function",
"read",
"(",
"$",
"length",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"length",
")",
")",
"$",
"length",
"=",
"$",
"this",
"->",
"getSize",
"(",
"0",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"isReadable",
... | Read the stream from the current offset
@param integer $length Reading length bytes
@return string Returns the stream content | [
"Read",
"the",
"stream",
"from",
"the",
"current",
"offset"
] | 6c08c787454745938de7adc3bfd64871604ac80b | https://github.com/web-operational-kit/stream/blob/6c08c787454745938de7adc3bfd64871604ac80b/src/Stream.php#L233-L244 |
240,194 | web-operational-kit/stream | src/Stream.php | Stream.write | public function write($string) {
if (!$this->isWritable() || ($written = fwrite($this->stream, $string)) === false) {
throw new \RuntimeException('Could not write in a not writable stream');
}
return $written;
} | php | public function write($string) {
if (!$this->isWritable() || ($written = fwrite($this->stream, $string)) === false) {
throw new \RuntimeException('Could not write in a not writable stream');
}
return $written;
} | [
"public",
"function",
"write",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWritable",
"(",
")",
"||",
"(",
"$",
"written",
"=",
"fwrite",
"(",
"$",
"this",
"->",
"stream",
",",
"$",
"string",
")",
")",
"===",
"false",
")",... | Write within the stream
@param string $string String to write
@return string Returns the written string | [
"Write",
"within",
"the",
"stream"
] | 6c08c787454745938de7adc3bfd64871604ac80b | https://github.com/web-operational-kit/stream/blob/6c08c787454745938de7adc3bfd64871604ac80b/src/Stream.php#L252-L260 |
240,195 | halimonalexander/registry | src/Registry.php | Registry.getByClassname | public function getByClassname(string $classname)
{
foreach ($this->container as $value) {
if (is_object($value) && $value instanceof $classname) {
return $value;
}
}
return null;
} | php | public function getByClassname(string $classname)
{
foreach ($this->container as $value) {
if (is_object($value) && $value instanceof $classname) {
return $value;
}
}
return null;
} | [
"public",
"function",
"getByClassname",
"(",
"string",
"$",
"classname",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"container",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"&&",
"$",
"value",
"instanceof",
"$",
"cla... | Get registered value by class name. If not found, will return null.
@param string $classname
@return mixed|null | [
"Get",
"registered",
"value",
"by",
"class",
"name",
".",
"If",
"not",
"found",
"will",
"return",
"null",
"."
] | 970d4c7cfb95d66b3deefdb6eeed5c55b4fbd0a5 | https://github.com/halimonalexander/registry/blob/970d4c7cfb95d66b3deefdb6eeed5c55b4fbd0a5/src/Registry.php#L68-L77 |
240,196 | alxmsl/Connection | source/Postgresql/Connection.php | Connection.connect | public function connect() {
$count = 0;
do {
$count += 1;
$this->Resource = pg_connect($this->getConnectionString());
if ($this->Resource !== false) {
return true;
}
} while ($count < $this->getConnectTries());
throw new Tr... | php | public function connect() {
$count = 0;
do {
$count += 1;
$this->Resource = pg_connect($this->getConnectionString());
if ($this->Resource !== false) {
return true;
}
} while ($count < $this->getConnectTries());
throw new Tr... | [
"public",
"function",
"connect",
"(",
")",
"{",
"$",
"count",
"=",
"0",
";",
"do",
"{",
"$",
"count",
"+=",
"1",
";",
"$",
"this",
"->",
"Resource",
"=",
"pg_connect",
"(",
"$",
"this",
"->",
"getConnectionString",
"(",
")",
")",
";",
"if",
"(",
... | Connect to postgres instance
@return bool connection result
@throws TriesOverConnectException when connection tries was over | [
"Connect",
"to",
"postgres",
"instance"
] | f686efeb795a5450112a04792876b2198829fd32 | https://github.com/alxmsl/Connection/blob/f686efeb795a5450112a04792876b2198829fd32/source/Postgresql/Connection.php#L66-L77 |
240,197 | alxmsl/Connection | source/Postgresql/Connection.php | Connection.getConnectionString | private function getConnectionString() {
$parameters = array(
'host=' . $this->getHost(),
'connect_timeout=' . $this->getConnectTimeout(),
'user=' . $this->getUserName(),
);
$this->hasPort() && $parameters[] = 'port=' . $th... | php | private function getConnectionString() {
$parameters = array(
'host=' . $this->getHost(),
'connect_timeout=' . $this->getConnectTimeout(),
'user=' . $this->getUserName(),
);
$this->hasPort() && $parameters[] = 'port=' . $th... | [
"private",
"function",
"getConnectionString",
"(",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
"'host='",
".",
"$",
"this",
"->",
"getHost",
"(",
")",
",",
"'connect_timeout='",
".",
"$",
"this",
"->",
"getConnectTimeout",
"(",
")",
",",
"'user='",
"."... | Build postgres connection string
@return string connection string | [
"Build",
"postgres",
"connection",
"string"
] | f686efeb795a5450112a04792876b2198829fd32 | https://github.com/alxmsl/Connection/blob/f686efeb795a5450112a04792876b2198829fd32/source/Postgresql/Connection.php#L119-L130 |
240,198 | webforge-labs/webforge-utils | src/php/Webforge/Common/Preg.php | Preg.replace_callback | public static function replace_callback ($subject, $pattern, $callback, $limit = -1) {
return preg_replace_callback(self::set_u_modifier($pattern, TRUE), $callback, $subject, $limit);
} | php | public static function replace_callback ($subject, $pattern, $callback, $limit = -1) {
return preg_replace_callback(self::set_u_modifier($pattern, TRUE), $callback, $subject, $limit);
} | [
"public",
"static",
"function",
"replace_callback",
"(",
"$",
"subject",
",",
"$",
"pattern",
",",
"$",
"callback",
",",
"$",
"limit",
"=",
"-",
"1",
")",
"{",
"return",
"preg_replace_callback",
"(",
"self",
"::",
"set_u_modifier",
"(",
"$",
"pattern",
","... | So wie replace allerdings mit einer Callback Funktion mit einem Parameter
Callback bekommt als Parameter1 den Array des Matches von $pattern welches ersetzt werden soll
Der Rückgabestring wird dann in $subject ersetzt.
<code>
function callback(Array $matches) {
// as usual: $matches[0] is the complete match
// $matche... | [
"So",
"wie",
"replace",
"allerdings",
"mit",
"einer",
"Callback",
"Funktion",
"mit",
"einem",
"Parameter"
] | a476eeec046c22ad91794b0ab9fe15a1d3f92bfc | https://github.com/webforge-labs/webforge-utils/blob/a476eeec046c22ad91794b0ab9fe15a1d3f92bfc/src/php/Webforge/Common/Preg.php#L110-L112 |
240,199 | gossi/trixionary | src/model/Base/SkillPartQuery.php | SkillPartQuery.filterByPartId | public function filterByPartId($partId = null, $comparison = null)
{
if (is_array($partId)) {
$useMinMax = false;
if (isset($partId['min'])) {
$this->addUsingAlias(SkillPartTableMap::COL_PART_ID, $partId['min'], Criteria::GREATER_EQUAL);
$useMinMax = t... | php | public function filterByPartId($partId = null, $comparison = null)
{
if (is_array($partId)) {
$useMinMax = false;
if (isset($partId['min'])) {
$this->addUsingAlias(SkillPartTableMap::COL_PART_ID, $partId['min'], Criteria::GREATER_EQUAL);
$useMinMax = t... | [
"public",
"function",
"filterByPartId",
"(",
"$",
"partId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"partId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"pa... | Filter the query on the part_id column
Example usage:
<code>
$query->filterByPartId(1234); // WHERE part_id = 1234
$query->filterByPartId(array(12, 34)); // WHERE part_id IN (12, 34)
$query->filterByPartId(array('min' => 12)); // WHERE part_id > 12
</code>
@see filterBySkillRelatedByPartId()
@param mixed $... | [
"Filter",
"the",
"query",
"on",
"the",
"part_id",
"column"
] | 221a6c5322473d7d7f8e322958a3ee46d87da150 | https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/SkillPartQuery.php#L272-L293 |
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.