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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
196,100 | Kris-Kuiper/sFire-Framework | src/Form/Types/Token.php | Token.generate | public function generate() {
$session = new Session();
if(false === $session -> has('_token')) {
$session -> add('_token', []);
}
$name = TokenHash :: create(20, true, true, true);
$value = TokenHash :: create(40, true, true, true);
$se... | php | public function generate() {
$session = new Session();
if(false === $session -> has('_token')) {
$session -> add('_token', []);
}
$name = TokenHash :: create(20, true, true, true);
$value = TokenHash :: create(40, true, true, true);
$se... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"session",
"=",
"new",
"Session",
"(",
")",
";",
"if",
"(",
"false",
"===",
"$",
"session",
"->",
"has",
"(",
"'_token'",
")",
")",
"{",
"$",
"session",
"->",
"add",
"(",
"'_token'",
",",
"[",
... | Generates a new token and saves it into the session
@return object | [
"Generates",
"a",
"new",
"token",
"and",
"saves",
"it",
"into",
"the",
"session"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/Form/Types/Token.php#L40-L60 |
196,101 | SagittariusX/Beluga.Date | src/Beluga/Date/Time.php | Time.Parse | public static function Parse( $timeDefinition )
{
if ( $timeDefinition instanceof Time )
{
// No converting needed! Return as it.
return $timeDefinition;
}
if ( $timeDefinition instanceof DateTime )
{
return $timeDefinition->getTime();
}
if ( $t... | php | public static function Parse( $timeDefinition )
{
if ( $timeDefinition instanceof Time )
{
// No converting needed! Return as it.
return $timeDefinition;
}
if ( $timeDefinition instanceof DateTime )
{
return $timeDefinition->getTime();
}
if ( $t... | [
"public",
"static",
"function",
"Parse",
"(",
"$",
"timeDefinition",
")",
"{",
"if",
"(",
"$",
"timeDefinition",
"instanceof",
"Time",
")",
"{",
"// No converting needed! Return as it.",
"return",
"$",
"timeDefinition",
";",
"}",
"if",
"(",
"$",
"timeDefinition",
... | Parses a time definition to a \Beluga\Date\Time instance.
@param mixed $timeDefinition The value to parse as Time. It can be a (date) time string, a unix timestamp, a
object of type \Beluga\DateTime or \DateTime or something that can be converted, by
a string cast, to a valid time string.
@return \Beluga\Date\Time|bo... | [
"Parses",
"a",
"time",
"definition",
"to",
"a",
"\\",
"Beluga",
"\\",
"Date",
"\\",
"Time",
"instance",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/Time.php#L752-L778 |
196,102 | SagittariusX/Beluga.Date | src/Beluga/Date/Time.php | Time.TryParse | public static function TryParse( $timeDefinition, Time &$refTime )
: bool
{
if ( $timeDefinition instanceof Time )
{
// No converting needed! Return as it.
$refTime = $timeDefinition;
return true;
}
if ( $timeDefinition instanceof DateTime )
{
... | php | public static function TryParse( $timeDefinition, Time &$refTime )
: bool
{
if ( $timeDefinition instanceof Time )
{
// No converting needed! Return as it.
$refTime = $timeDefinition;
return true;
}
if ( $timeDefinition instanceof DateTime )
{
... | [
"public",
"static",
"function",
"TryParse",
"(",
"$",
"timeDefinition",
",",
"Time",
"&",
"$",
"refTime",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"timeDefinition",
"instanceof",
"Time",
")",
"{",
"// No converting needed! Return as it.",
"$",
"refTime",
"=",
"$... | Tries to parse a time definition to a \Beluga\Time instance.
@param mixed $timeDefinition The value to parse as Time. It can be a (date) time string, a unix timestamp, a
object of type \Beluga\DateTime or \DateTime or something that can be converted, by
a string cast, to a valid time string.
@param Time $refTime ... | [
"Tries",
"to",
"parse",
"a",
"time",
"definition",
"to",
"a",
"\\",
"Beluga",
"\\",
"Time",
"instance",
"."
] | 1bd28500e81eb5db8502e58506ebeb9268154884 | https://github.com/SagittariusX/Beluga.Date/blob/1bd28500e81eb5db8502e58506ebeb9268154884/src/Beluga/Date/Time.php#L789-L820 |
196,103 | MARCspec/php-marc-spec | src/PositionOrRange.php | PositionOrRange.getLength | private function getLength($type = true)
{
if ($type) {
$start = $this->getCharStart();
$end = $this->getCharEnd();
} else {
$start = $this->getIndexStart();
$end = $this->getIndexEnd();
}
if (is_null($start) && is_null($end)) {
... | php | private function getLength($type = true)
{
if ($type) {
$start = $this->getCharStart();
$end = $this->getCharEnd();
} else {
$start = $this->getIndexStart();
$end = $this->getIndexEnd();
}
if (is_null($start) && is_null($end)) {
... | [
"private",
"function",
"getLength",
"(",
"$",
"type",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"type",
")",
"{",
"$",
"start",
"=",
"$",
"this",
"->",
"getCharStart",
"(",
")",
";",
"$",
"end",
"=",
"$",
"this",
"->",
"getCharEnd",
"(",
")",
";",
... | Calculate the length of charrange or index range.
@param bool $type True for charrange and false for indexrange
@throws CK\MARCspec\Exception\InvalidMARCspecException
@return int $length | [
"Calculate",
"the",
"length",
"of",
"charrange",
"or",
"index",
"range",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/PositionOrRange.php#L113-L153 |
196,104 | MARCspec/php-marc-spec | src/PositionOrRange.php | PositionOrRange.validateStartEnd | private function validateStartEnd($start, $end)
{
$_startEnd = [];
if (preg_match('/[0-9]/', $start)) {
$_startEnd[0] = (int) $start;
} elseif ('#' === $start) {
$_startEnd[0] = '#';
} else {
throw new InvalidMARCspecException(
Inv... | php | private function validateStartEnd($start, $end)
{
$_startEnd = [];
if (preg_match('/[0-9]/', $start)) {
$_startEnd[0] = (int) $start;
} elseif ('#' === $start) {
$_startEnd[0] = '#';
} else {
throw new InvalidMARCspecException(
Inv... | [
"private",
"function",
"validateStartEnd",
"(",
"$",
"start",
",",
"$",
"end",
")",
"{",
"$",
"_startEnd",
"=",
"[",
"]",
";",
"if",
"(",
"preg_match",
"(",
"'/[0-9]/'",
",",
"$",
"start",
")",
")",
"{",
"$",
"_startEnd",
"[",
"0",
"]",
"=",
"(",
... | Validate starting and ending position.
@internal
@param int|string $start The starting position
@param int|string $end The ending position
@throws CK\MARCspec\Exception\InvalidMARCspecException
@return null|array $_startEnd index 0 => start, index 1 => end | [
"Validate",
"starting",
"and",
"ending",
"position",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/PositionOrRange.php#L167-L208 |
196,105 | MARCspec/php-marc-spec | src/PositionOrRange.php | PositionOrRange.validateStartLength | private function validateStartLength($start, $length)
{
$_startEnd = [];
if (preg_match('/[0-9]/', $start)) {
$_startEnd[0] = (int) $start;
} elseif ('#' === $start) {
$_startEnd[0] = '#';
} else {
throw new \UnexpectedValueException(
... | php | private function validateStartLength($start, $length)
{
$_startEnd = [];
if (preg_match('/[0-9]/', $start)) {
$_startEnd[0] = (int) $start;
} elseif ('#' === $start) {
$_startEnd[0] = '#';
} else {
throw new \UnexpectedValueException(
... | [
"private",
"function",
"validateStartLength",
"(",
"$",
"start",
",",
"$",
"length",
")",
"{",
"$",
"_startEnd",
"=",
"[",
"]",
";",
"if",
"(",
"preg_match",
"(",
"'/[0-9]/'",
",",
"$",
"start",
")",
")",
"{",
"$",
"_startEnd",
"[",
"0",
"]",
"=",
... | Validate starting position and length.
@internal
@param string $start The starting position
@param string $length $length The length count
@throws \UnexpectedValueException
@return array $_startEnd index 0 => start, index 1 => end | [
"Validate",
"starting",
"position",
"and",
"length",
"."
] | 853d77ad3d510ce05c33535bfa3f1068dccdeef6 | https://github.com/MARCspec/php-marc-spec/blob/853d77ad3d510ce05c33535bfa3f1068dccdeef6/src/PositionOrRange.php#L222-L246 |
196,106 | Ydle/HubBundle | Manager/RoomManager.php | RoomManager.changeState | public function changeState($id, $newState = 0)
{
if (!$object = $this->find($id)) {
return false;
}
$object->setIsActive($newState);
$this->save($object);
return true;
} | php | public function changeState($id, $newState = 0)
{
if (!$object = $this->find($id)) {
return false;
}
$object->setIsActive($newState);
$this->save($object);
return true;
} | [
"public",
"function",
"changeState",
"(",
"$",
"id",
",",
"$",
"newState",
"=",
"0",
")",
"{",
"if",
"(",
"!",
"$",
"object",
"=",
"$",
"this",
"->",
"find",
"(",
"$",
"id",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"object",
"->",
"setI... | Change the state of a room type
@param integer $id
@param boolean $newState
@return boolean | [
"Change",
"the",
"state",
"of",
"a",
"room",
"type"
] | 7fa423241246bcfd115f2ed3ad3997b4b63adb01 | https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Manager/RoomManager.php#L67-L76 |
196,107 | ContaoBlackForest/contao-doctrine-orm-timestampable | src/Driver/ContaoDca.php | ContaoDca.readExtendedMetadata | public function readExtendedMetadata($meta, array &$config)
{
$tableName = $meta->getTableName();
if (!isset($GLOBALS['TL_DCA'][$tableName])) {
$this->loadDataContainer($tableName);
}
$dca = (array) $GLOBALS['TL_DCA'][$tableName];
$fields = (array) $dca['field... | php | public function readExtendedMetadata($meta, array &$config)
{
$tableName = $meta->getTableName();
if (!isset($GLOBALS['TL_DCA'][$tableName])) {
$this->loadDataContainer($tableName);
}
$dca = (array) $GLOBALS['TL_DCA'][$tableName];
$fields = (array) $dca['field... | [
"public",
"function",
"readExtendedMetadata",
"(",
"$",
"meta",
",",
"array",
"&",
"$",
"config",
")",
"{",
"$",
"tableName",
"=",
"$",
"meta",
"->",
"getTableName",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"GLOBALS",
"[",
"'TL_DCA'",
"]",
"... | Read extended metadata configuration for
a single mapped class
@param object $meta The meta information.
@param array $config The configuration.
@return void
@SuppressWarnings(PHPMD.Superglobals) | [
"Read",
"extended",
"metadata",
"configuration",
"for",
"a",
"single",
"mapped",
"class"
] | 5322a2a4325dfbc4091c9a8ead010f882da13007 | https://github.com/ContaoBlackForest/contao-doctrine-orm-timestampable/blob/5322a2a4325dfbc4091c9a8ead010f882da13007/src/Driver/ContaoDca.php#L51-L65 |
196,108 | jabernardo/lollipop-php | Library/HTTP/URL.php | URL.base | static function base($url = '', $cacheBuster = false) {
$cacheb = $cacheBuster ? ('?' . (Config::get('app.version', '1.0.0'))) : '';
$servern = $_SERVER['SERVER_NAME'];
$serverp = $_SERVER['SERVER_PORT'];
$server = $serverp == '8080' || $serverp == '80' || $serverp == '443' ? $serv... | php | static function base($url = '', $cacheBuster = false) {
$cacheb = $cacheBuster ? ('?' . (Config::get('app.version', '1.0.0'))) : '';
$servern = $_SERVER['SERVER_NAME'];
$serverp = $_SERVER['SERVER_PORT'];
$server = $serverp == '8080' || $serverp == '80' || $serverp == '443' ? $serv... | [
"static",
"function",
"base",
"(",
"$",
"url",
"=",
"''",
",",
"$",
"cacheBuster",
"=",
"false",
")",
"{",
"$",
"cacheb",
"=",
"$",
"cacheBuster",
"?",
"(",
"'?'",
".",
"(",
"Config",
"::",
"get",
"(",
"'app.version'",
",",
"'1.0.0'",
")",
")",
")"... | Get base url
@access public
@param string File or url to access
@param bool Enable cache buster
@return string Base url | [
"Get",
"base",
"url"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/URL.php#L29-L38 |
196,109 | jabernardo/lollipop-php | Library/HTTP/URL.php | URL.redirect | static function redirect($uri) {
// Check first if given string is a valid URL
if (!filter_var($uri, FILTER_VALIDATE_URL)) {
throw new \Lollipop\Exception\Argument('URL is invalid', true);
}
header('location: ' . $uri);
exit();
} | php | static function redirect($uri) {
// Check first if given string is a valid URL
if (!filter_var($uri, FILTER_VALIDATE_URL)) {
throw new \Lollipop\Exception\Argument('URL is invalid', true);
}
header('location: ' . $uri);
exit();
} | [
"static",
"function",
"redirect",
"(",
"$",
"uri",
")",
"{",
"// Check first if given string is a valid URL \r",
"if",
"(",
"!",
"filter_var",
"(",
"$",
"uri",
",",
"FILTER_VALIDATE_URL",
")",
")",
"{",
"throw",
"new",
"\\",
"Lollipop",
"\\",
"Exception",
"\\",
... | Redirect page to another urldecode
@access public
@param string $uri Web address
@throws \Lollipop\Exception\Argument
@return void | [
"Redirect",
"page",
"to",
"another",
"urldecode"
] | 004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5 | https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/HTTP/URL.php#L84-L92 |
196,110 | Ydle/HubBundle | Controller/RoomController.php | RoomController.roomFormAction | public function roomFormAction(Request $request)
{
$room = new Room();
// Manage edition mode
$this->currentRoom = $request->get('room');
if ($this->currentRoom) {
$room = $this->get("ydle.room.manager")->find($request->get('room'));
}
$action = $this->get... | php | public function roomFormAction(Request $request)
{
$room = new Room();
// Manage edition mode
$this->currentRoom = $request->get('room');
if ($this->currentRoom) {
$room = $this->get("ydle.room.manager")->find($request->get('room'));
}
$action = $this->get... | [
"public",
"function",
"roomFormAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"room",
"=",
"new",
"Room",
"(",
")",
";",
"// Manage edition mode",
"$",
"this",
"->",
"currentRoom",
"=",
"$",
"request",
"->",
"get",
"(",
"'room'",
")",
";",
"if",... | Display a form to create or edit a room
@param Request $request | [
"Display",
"a",
"form",
"to",
"create",
"or",
"edit",
"a",
"room"
] | 7fa423241246bcfd115f2ed3ad3997b4b63adb01 | https://github.com/Ydle/HubBundle/blob/7fa423241246bcfd115f2ed3ad3997b4b63adb01/Controller/RoomController.php#L47-L64 |
196,111 | Subscribo/omnipay-subscribo-shared | src/Shared/Helpers/AddressParser.php | AddressParser.splitFirstLine | protected static function splitFirstLine($firstLine)
{
$parts = preg_split('/\\s/', $firstLine, null, PREG_SPLIT_NO_EMPTY);
if (count($parts) > 1) {
return $parts;
}
$parts = explode(',', $firstLine);
if (count($parts) > 1) {
return $parts;
}
... | php | protected static function splitFirstLine($firstLine)
{
$parts = preg_split('/\\s/', $firstLine, null, PREG_SPLIT_NO_EMPTY);
if (count($parts) > 1) {
return $parts;
}
$parts = explode(',', $firstLine);
if (count($parts) > 1) {
return $parts;
}
... | [
"protected",
"static",
"function",
"splitFirstLine",
"(",
"$",
"firstLine",
")",
"{",
"$",
"parts",
"=",
"preg_split",
"(",
"'/\\\\s/'",
",",
"$",
"firstLine",
",",
"null",
",",
"PREG_SPLIT_NO_EMPTY",
")",
";",
"if",
"(",
"count",
"(",
"$",
"parts",
")",
... | Tries to split first line into parts
@param string $firstLine
@return array | [
"Tries",
"to",
"split",
"first",
"line",
"into",
"parts"
] | aa9fa115ef8324b50fe5c91d3593d5632f53b669 | https://github.com/Subscribo/omnipay-subscribo-shared/blob/aa9fa115ef8324b50fe5c91d3593d5632f53b669/src/Shared/Helpers/AddressParser.php#L55-L67 |
196,112 | Kris-Kuiper/sFire-Framework | src/MVC/ViewContainer.php | ViewContainer.unload | public static function unload(ViewModel $viewmodel) {
if(true === isset(static :: $views[$viewmodel -> getIdentifier()])) {
unset(static :: $views[$viewmodel -> getIdentifier()]);
}
} | php | public static function unload(ViewModel $viewmodel) {
if(true === isset(static :: $views[$viewmodel -> getIdentifier()])) {
unset(static :: $views[$viewmodel -> getIdentifier()]);
}
} | [
"public",
"static",
"function",
"unload",
"(",
"ViewModel",
"$",
"viewmodel",
")",
"{",
"if",
"(",
"true",
"===",
"isset",
"(",
"static",
"::",
"$",
"views",
"[",
"$",
"viewmodel",
"->",
"getIdentifier",
"(",
")",
"]",
")",
")",
"{",
"unset",
"(",
"s... | Unregister existing viewmodel
@param sFire\MVC\ViewModel $viewmodel | [
"Unregister",
"existing",
"viewmodel"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/ViewContainer.php#L45-L50 |
196,113 | Kris-Kuiper/sFire-Framework | src/MVC/ViewContainer.php | ViewContainer.output | public static function output(ViewModel $viewmodel) {
$viewmodel -> assign(static :: getVariables());
$template = new Template($viewmodel);
$template -> setDirectory(Path :: get('cache-template'));
$template -> render();
$file = $template -> getFile() -> entity() -> getBasepath();
echo $... | php | public static function output(ViewModel $viewmodel) {
$viewmodel -> assign(static :: getVariables());
$template = new Template($viewmodel);
$template -> setDirectory(Path :: get('cache-template'));
$template -> render();
$file = $template -> getFile() -> entity() -> getBasepath();
echo $... | [
"public",
"static",
"function",
"output",
"(",
"ViewModel",
"$",
"viewmodel",
")",
"{",
"$",
"viewmodel",
"->",
"assign",
"(",
"static",
"::",
"getVariables",
"(",
")",
")",
";",
"$",
"template",
"=",
"new",
"Template",
"(",
"$",
"viewmodel",
")",
";",
... | Outputs parsed code
@param sFire\MVC\ViewModel $viewmodel | [
"Outputs",
"parsed",
"code"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/ViewContainer.php#L66-L78 |
196,114 | Kris-Kuiper/sFire-Framework | src/MVC/ViewContainer.php | ViewContainer.assign | public static function assign($key, $value = null) {
if(true === is_array($key)) {
static :: $variables = array_merge(static :: $variables, $key);
}
else {
static :: $variables[$key] = $value;
}
} | php | public static function assign($key, $value = null) {
if(true === is_array($key)) {
static :: $variables = array_merge(static :: $variables, $key);
}
else {
static :: $variables[$key] = $value;
}
} | [
"public",
"static",
"function",
"assign",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"true",
"===",
"is_array",
"(",
"$",
"key",
")",
")",
"{",
"static",
"::",
"$",
"variables",
"=",
"array_merge",
"(",
"static",
"::",
"$... | Assign variables to the current view
@param string|array $key
@param string $value | [
"Assign",
"variables",
"to",
"the",
"current",
"view"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/MVC/ViewContainer.php#L86-L94 |
196,115 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Subscriber/HttpError.php | HttpError.onComplete | public function onComplete(CompleteEvent $event)
{
$code = (string) $event->getResponse()->getStatusCode();
// Throw an exception for an unsuccessful response
if ($code[0] === '4' || $code[0] === '5') {
throw RequestException::create($event->getRequest(), $event->getResponse());
... | php | public function onComplete(CompleteEvent $event)
{
$code = (string) $event->getResponse()->getStatusCode();
// Throw an exception for an unsuccessful response
if ($code[0] === '4' || $code[0] === '5') {
throw RequestException::create($event->getRequest(), $event->getResponse());
... | [
"public",
"function",
"onComplete",
"(",
"CompleteEvent",
"$",
"event",
")",
"{",
"$",
"code",
"=",
"(",
"string",
")",
"$",
"event",
"->",
"getResponse",
"(",
")",
"->",
"getStatusCode",
"(",
")",
";",
"// Throw an exception for an unsuccessful response",
"if",... | Throw a RequestException on an HTTP protocol error
@param CompleteEvent $event Emitted event
@throws RequestException | [
"Throw",
"a",
"RequestException",
"on",
"an",
"HTTP",
"protocol",
"error"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Subscriber/HttpError.php#L26-L33 |
196,116 | anime-db/catalog-bundle | src/Entity/Item.php | Item.isPathValid | public function isPathValid(ExecutionContextInterface $context)
{
if ($this->getStorage() instanceof Storage && $this->getStorage()->isPathRequired() && !$this->getPath()) {
$context->addViolationAt('path', 'Path is required to fill for current type of storage');
}
} | php | public function isPathValid(ExecutionContextInterface $context)
{
if ($this->getStorage() instanceof Storage && $this->getStorage()->isPathRequired() && !$this->getPath()) {
$context->addViolationAt('path', 'Path is required to fill for current type of storage');
}
} | [
"public",
"function",
"isPathValid",
"(",
"ExecutionContextInterface",
"$",
"context",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getStorage",
"(",
")",
"instanceof",
"Storage",
"&&",
"$",
"this",
"->",
"getStorage",
"(",
")",
"->",
"isPathRequired",
"(",
")",... | Is valid path for current type.
@param ExecutionContextInterface $context | [
"Is",
"valid",
"path",
"for",
"current",
"type",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Entity/Item.php#L908-L913 |
196,117 | anime-db/catalog-bundle | src/Entity/Item.php | Item.freez | public function freez(Registry $doctrine)
{
$em = $doctrine->getManager();
// create reference to existing entity
if ($this->country) {
$this->country = $em->getReference(get_class($this->country), $this->country->getId());
}
if ($this->storage) {
$thi... | php | public function freez(Registry $doctrine)
{
$em = $doctrine->getManager();
// create reference to existing entity
if ($this->country) {
$this->country = $em->getReference(get_class($this->country), $this->country->getId());
}
if ($this->storage) {
$thi... | [
"public",
"function",
"freez",
"(",
"Registry",
"$",
"doctrine",
")",
"{",
"$",
"em",
"=",
"$",
"doctrine",
"->",
"getManager",
"(",
")",
";",
"// create reference to existing entity",
"if",
"(",
"$",
"this",
"->",
"country",
")",
"{",
"$",
"this",
"->",
... | Freeze item.
@param Registry $doctrine
@return Item | [
"Freeze",
"item",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Entity/Item.php#L922-L938 |
196,118 | anime-db/catalog-bundle | src/Entity/Item.php | Item.doClearPath | public function doClearPath()
{
if (
$this->not_cleared_path &&
$this->getStorage() instanceof Storage &&
$this->getStorage()->getPath() &&
strpos($this->not_cleared_path, $this->getStorage()->getPath()) === 0
) {
$this->path = substr($this... | php | public function doClearPath()
{
if (
$this->not_cleared_path &&
$this->getStorage() instanceof Storage &&
$this->getStorage()->getPath() &&
strpos($this->not_cleared_path, $this->getStorage()->getPath()) === 0
) {
$this->path = substr($this... | [
"public",
"function",
"doClearPath",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"not_cleared_path",
"&&",
"$",
"this",
"->",
"getStorage",
"(",
")",
"instanceof",
"Storage",
"&&",
"$",
"this",
"->",
"getStorage",
"(",
")",
"->",
"getPath",
"(",
")",
... | Remove storage path in item path.
@ORM\PrePersist
@ORM\PreUpdate | [
"Remove",
"storage",
"path",
"in",
"item",
"path",
"."
] | 631b6f92a654e91bee84f46218c52cf42bdb8606 | https://github.com/anime-db/catalog-bundle/blob/631b6f92a654e91bee84f46218c52cf42bdb8606/src/Entity/Item.php#L946-L957 |
196,119 | Talesoft/tale-framework | src/Tale/Debug/Benchmark.php | Benchmark.process | public function process( $withOutput = false ) {
$it = $this->_iterationCount;
if( !$withOutput )
ob_start();
$start = Snapshot::create();
while( $it-- ) {
call_user_func_array( $this->_operation, $this->_args );
}
$end = Snapshot::create();
if( !$withOutput )
ob_get_clean();
... | php | public function process( $withOutput = false ) {
$it = $this->_iterationCount;
if( !$withOutput )
ob_start();
$start = Snapshot::create();
while( $it-- ) {
call_user_func_array( $this->_operation, $this->_args );
}
$end = Snapshot::create();
if( !$withOutput )
ob_get_clean();
... | [
"public",
"function",
"process",
"(",
"$",
"withOutput",
"=",
"false",
")",
"{",
"$",
"it",
"=",
"$",
"this",
"->",
"_iterationCount",
";",
"if",
"(",
"!",
"$",
"withOutput",
")",
"ob_start",
"(",
")",
";",
"$",
"start",
"=",
"Snapshot",
"::",
"creat... | Performs the benchmark.
At the start and at the end of the procedure call loop, it takes a snapshot
of PHP background data and returns the difference of both
@param bool $withOutput If set to false, output is suppressed (var_dump, echo etc.) (Default: false)
@return Snapshot | [
"Performs",
"the",
"benchmark",
".",
"At",
"the",
"start",
"and",
"at",
"the",
"end",
"of",
"the",
"procedure",
"call",
"loop",
"it",
"takes",
"a",
"snapshot",
"of",
"PHP",
"background",
"data",
"and",
"returns",
"the",
"difference",
"of",
"both"
] | 739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49 | https://github.com/Talesoft/tale-framework/blob/739a7011c6dad409a51c4bcfbcf4b4ffbc8cba49/src/Tale/Debug/Benchmark.php#L104-L122 |
196,120 | vukbgit/PHPCraft.Subject | src/Traits/Database.php | Database.setDBParameters | protected function setDBParameters($driver, $host, $username, $password, $database, $schema = false, $charset = 'utf8', $collation = 'utf8_unicode_ci', $options = array())
{
$this->DBParameters = [
'driver' => $driver,
'host' => $host,
'username' => $username,
... | php | protected function setDBParameters($driver, $host, $username, $password, $database, $schema = false, $charset = 'utf8', $collation = 'utf8_unicode_ci', $options = array())
{
$this->DBParameters = [
'driver' => $driver,
'host' => $host,
'username' => $username,
... | [
"protected",
"function",
"setDBParameters",
"(",
"$",
"driver",
",",
"$",
"host",
",",
"$",
"username",
",",
"$",
"password",
",",
"$",
"database",
",",
"$",
"schema",
"=",
"false",
",",
"$",
"charset",
"=",
"'utf8'",
",",
"$",
"collation",
"=",
"'utf8... | sets database parameters
@param string $driver
@param string $host
@param string $username
@param string $password
@param string $database
@param string $schema
@param string $charset
@param string $collation
@param array $options | [
"sets",
"database",
"parameters"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Database.php#L75-L88 |
196,121 | vukbgit/PHPCraft.Subject | src/Traits/Database.php | Database.connectToDB | public function connectToDB(){
//if querybuilder is already connected there is no nedd to connect again
if($this->queryBuilder->isConnected()) {
return;
}
//check for database parameters
if(empty($this->DBParameters)) {
throw new \Exception('missing databa... | php | public function connectToDB(){
//if querybuilder is already connected there is no nedd to connect again
if($this->queryBuilder->isConnected()) {
return;
}
//check for database parameters
if(empty($this->DBParameters)) {
throw new \Exception('missing databa... | [
"public",
"function",
"connectToDB",
"(",
")",
"{",
"//if querybuilder is already connected there is no nedd to connect again",
"if",
"(",
"$",
"this",
"->",
"queryBuilder",
"->",
"isConnected",
"(",
")",
")",
"{",
"return",
";",
"}",
"//check for database parameters",
... | Connects to database | [
"Connects",
"to",
"database"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Database.php#L93-L112 |
196,122 | vukbgit/PHPCraft.Subject | src/Traits/Database.php | Database.handleError | protected function handleError($exception){
$error = $this->queryBuilder->handleQueryException($exception);
if($error[0] && isset($this->translations[$this->name][$error[0].'_'.$error[1]])) {
$message = $this->translations[$this->name][$error[0].'_'.$error[1]];
} else {
$... | php | protected function handleError($exception){
$error = $this->queryBuilder->handleQueryException($exception);
if($error[0] && isset($this->translations[$this->name][$error[0].'_'.$error[1]])) {
$message = $this->translations[$this->name][$error[0].'_'.$error[1]];
} else {
$... | [
"protected",
"function",
"handleError",
"(",
"$",
"exception",
")",
"{",
"$",
"error",
"=",
"$",
"this",
"->",
"queryBuilder",
"->",
"handleQueryException",
"(",
"$",
"exception",
")",
";",
"if",
"(",
"$",
"error",
"[",
"0",
"]",
"&&",
"isset",
"(",
"$... | Handles a database error
@param Exception $exception
@retun string $message | [
"Handles",
"a",
"database",
"error"
] | a43ad7868098ff1e7bda6819547ea64f9a853732 | https://github.com/vukbgit/PHPCraft.Subject/blob/a43ad7868098ff1e7bda6819547ea64f9a853732/src/Traits/Database.php#L139-L147 |
196,123 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Yaml/Yaml.php | Yaml.walk | protected function walk(array $array, $path = '') {
foreach ($array as $k => $v)
if (!is_array($v) || !(bool)count(array_filter(array_keys($v), 'is_string')))
$this->data[$path . $k] = $v;
else
$this->walk($v, $path . $k . '.');
} | php | protected function walk(array $array, $path = '') {
foreach ($array as $k => $v)
if (!is_array($v) || !(bool)count(array_filter(array_keys($v), 'is_string')))
$this->data[$path . $k] = $v;
else
$this->walk($v, $path . $k . '.');
} | [
"protected",
"function",
"walk",
"(",
"array",
"$",
"array",
",",
"$",
"path",
"=",
"''",
")",
"{",
"foreach",
"(",
"$",
"array",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"if",
"(",
"!",
"is_array",
"(",
"$",
"v",
")",
"||",
"!",
"(",
"bool",
")"... | Recursively walks over an array to flatten it's keys for faster look up.
@param array $array the array to walk over
@param string $path optional; the current path we're walking | [
"Recursively",
"walks",
"over",
"an",
"array",
"to",
"flatten",
"it",
"s",
"keys",
"for",
"faster",
"look",
"up",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Yaml/Yaml.php#L29-L35 |
196,124 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Yaml/Yaml.php | Yaml.get | public function get($path, $def = null) {
if ($this->has($path))
return $this->data[$path];
return $def;
} | php | public function get($path, $def = null) {
if ($this->has($path))
return $this->data[$path];
return $def;
} | [
"public",
"function",
"get",
"(",
"$",
"path",
",",
"$",
"def",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"path",
")",
")",
"return",
"$",
"this",
"->",
"data",
"[",
"$",
"path",
"]",
";",
"return",
"$",
"def",
";"... | Returns the value stored at the given path.
@param string $path the path to retrieve
@param mixed $def optional; the default value if no mapping is found
@return mixed the value, or the given default if no value is found | [
"Returns",
"the",
"value",
"stored",
"at",
"the",
"given",
"path",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Yaml/Yaml.php#L44-L49 |
196,125 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Yaml/Yaml.php | Yaml.save | public function save($file) {
if (!is_writable(dirname($file)))
return false;
$f = fopen($file, 'w+');
if ($f === false)
$check = false;
else
$check = fwrite($f, $this->stringify());
fclose($f);
return $check;
} | php | public function save($file) {
if (!is_writable(dirname($file)))
return false;
$f = fopen($file, 'w+');
if ($f === false)
$check = false;
else
$check = fwrite($f, $this->stringify());
fclose($f);
return $check;
} | [
"public",
"function",
"save",
"(",
"$",
"file",
")",
"{",
"if",
"(",
"!",
"is_writable",
"(",
"dirname",
"(",
"$",
"file",
")",
")",
")",
"return",
"false",
";",
"$",
"f",
"=",
"fopen",
"(",
"$",
"file",
",",
"'w+'",
")",
";",
"if",
"(",
"$",
... | Attempts to save the loaded mapping in the given file.
@param string $file the path to the file to write to
@return boolean true if the operation was successful, false if the file could not be written to | [
"Attempts",
"to",
"save",
"the",
"loaded",
"mapping",
"in",
"the",
"given",
"file",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Yaml/Yaml.php#L79-L93 |
196,126 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Yaml/Yaml.php | Yaml.toArray | public function toArray() {
$array = array();
foreach ($this->data as $k => $v) {
$nodes = explode('.', $k);
$loc = &$array;
foreach ($nodes as $i => $node)
if ($i === sizeof($nodes) - 1)
$loc[$node] = $v;
else if (!isset($array[$node])) {
$loc[$node] = array();
$loc = &... | php | public function toArray() {
$array = array();
foreach ($this->data as $k => $v) {
$nodes = explode('.', $k);
$loc = &$array;
foreach ($nodes as $i => $node)
if ($i === sizeof($nodes) - 1)
$loc[$node] = $v;
else if (!isset($array[$node])) {
$loc[$node] = array();
$loc = &... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"data",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"nodes",
"=",
"explode",
"(",
"'.'",
",",
"$",
"k",
")",
";",... | Returns an array contaning the data held by a Yaml instance.
@return array a plain array representation of the stored YAML data | [
"Returns",
"an",
"array",
"contaning",
"the",
"data",
"held",
"by",
"a",
"Yaml",
"instance",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Yaml/Yaml.php#L100-L118 |
196,127 | LartTyler/PHP-DaybreakCommons | src/DaybreakStudios/Common/Yaml/Yaml.php | Yaml.parse | public static function parse($input, $typeCheck = false, $objectSupport = false) {
return new Yaml(parent::parse($input, $typeCheck, $objectSupport, $objectForMap));
} | php | public static function parse($input, $typeCheck = false, $objectSupport = false) {
return new Yaml(parent::parse($input, $typeCheck, $objectSupport, $objectForMap));
} | [
"public",
"static",
"function",
"parse",
"(",
"$",
"input",
",",
"$",
"typeCheck",
"=",
"false",
",",
"$",
"objectSupport",
"=",
"false",
")",
"{",
"return",
"new",
"Yaml",
"(",
"parent",
"::",
"parse",
"(",
"$",
"input",
",",
"$",
"typeCheck",
",",
... | Parses YAML into a Yaml object.
@see http://api.symfony.com/2.7/Symfony/Component/Yaml/Yaml.html#method_parse
@throws ParseException if the YAML is not valid
@param string $input the YAML to parse
@param boolean $typeCheck whether or not to throw exceptions on invalid types
@param boolean $objectSupp... | [
"Parses",
"YAML",
"into",
"a",
"Yaml",
"object",
"."
] | db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d | https://github.com/LartTyler/PHP-DaybreakCommons/blob/db25b5d6cea9b5a1d5afc4c5548a2cbc3018bc0d/src/DaybreakStudios/Common/Yaml/Yaml.php#L142-L144 |
196,128 | sndsgd/form | src/form/detail/DetailAbstract.php | DetailAbstract.getRulesFromField | protected function getRulesFromField(FieldInterface $field): array
{
$ret = [];
foreach ($field->getRules() as $rule) {
$ret[] = [
"description" => $rule->getDescription(),
"errorMessage" => $rule->getErrorMessage(),
];
}
return... | php | protected function getRulesFromField(FieldInterface $field): array
{
$ret = [];
foreach ($field->getRules() as $rule) {
$ret[] = [
"description" => $rule->getDescription(),
"errorMessage" => $rule->getErrorMessage(),
];
}
return... | [
"protected",
"function",
"getRulesFromField",
"(",
"FieldInterface",
"$",
"field",
")",
":",
"array",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"field",
"->",
"getRules",
"(",
")",
"as",
"$",
"rule",
")",
"{",
"$",
"ret",
"[",
"]",
... | Retreive a rules from a field
@param \sndsgd\form\field\FieldInterface $field
@return array<string,string> | [
"Retreive",
"a",
"rules",
"from",
"a",
"field"
] | 56b5b9572a8942aea34c97c7c838b871e198e34f | https://github.com/sndsgd/form/blob/56b5b9572a8942aea34c97c7c838b871e198e34f/src/form/detail/DetailAbstract.php#L30-L40 |
196,129 | odom/ripcord | ripcord_server.php | Ripcord_Server.run | public function run()
{
if ($this->documentor) {
$this->documentor->setMethodData( $this->methods );
}
$request_xml = file_get_contents( 'php://input' );
if ( !$request_xml )
{
if ( ( $query = $_SERVER['QUERY_STRING'] )
&& isset($this->wsdl[$query]) && $this->wsdl[$query] )
{
header('Cont... | php | public function run()
{
if ($this->documentor) {
$this->documentor->setMethodData( $this->methods );
}
$request_xml = file_get_contents( 'php://input' );
if ( !$request_xml )
{
if ( ( $query = $_SERVER['QUERY_STRING'] )
&& isset($this->wsdl[$query]) && $this->wsdl[$query] )
{
header('Cont... | [
"public",
"function",
"run",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"documentor",
")",
"{",
"$",
"this",
"->",
"documentor",
"->",
"setMethodData",
"(",
"$",
"this",
"->",
"methods",
")",
";",
"}",
"$",
"request_xml",
"=",
"file_get_contents",
"(... | Runs the rpc server. Automatically handles an incoming request. | [
"Runs",
"the",
"rpc",
"server",
".",
"Automatically",
"handles",
"an",
"incoming",
"request",
"."
] | 3891dc752f15043f38bc3a30a35a4a872b964048 | https://github.com/odom/ripcord/blob/3891dc752f15043f38bc3a30a35a4a872b964048/ripcord_server.php#L206-L245 |
196,130 | odom/ripcord | ripcord_server.php | Ripcord_Server.call | public function call( $method, $args = null )
{
if ( $this->methods[$method] )
{
$call = $this->methods[$method]['call'];
return call_user_func_array( $call, $args);
} else {
if ( substr( $method, 0, 7 ) == 'system.' )
{
if ( $method == 'system.multiCall' ) {
throw new Ripcord_InvalidArgu... | php | public function call( $method, $args = null )
{
if ( $this->methods[$method] )
{
$call = $this->methods[$method]['call'];
return call_user_func_array( $call, $args);
} else {
if ( substr( $method, 0, 7 ) == 'system.' )
{
if ( $method == 'system.multiCall' ) {
throw new Ripcord_InvalidArgu... | [
"public",
"function",
"call",
"(",
"$",
"method",
",",
"$",
"args",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"methods",
"[",
"$",
"method",
"]",
")",
"{",
"$",
"call",
"=",
"$",
"this",
"->",
"methods",
"[",
"$",
"method",
"]",
"[",... | Calls a method by its rpc name.
@param string $method The rpc name of the method
@param array $args The arguments to this method
@return mixed
@throws Ripcord_InvalidArgumentException (ripcord::cannotRecurse) when passed a recursive multiCall
@throws Ripcord_BadMethodCallException (ripcord::methodNotFound) when the req... | [
"Calls",
"a",
"method",
"by",
"its",
"rpc",
"name",
"."
] | 3891dc752f15043f38bc3a30a35a4a872b964048 | https://github.com/odom/ripcord/blob/3891dc752f15043f38bc3a30a35a4a872b964048/ripcord_server.php#L356-L380 |
196,131 | sndsgd/http | src/http/Request.php | Request.readHeaders | protected function readHeaders()
{
$ret = [];
foreach ($this->environment as $key => $value) {
# Note: the content-type and content-length headers always come
# after the `CONTENT_TYPE` and `CONTENT_LENGTH` values in the
# $_SERVER superglobal; if you use the valu... | php | protected function readHeaders()
{
$ret = [];
foreach ($this->environment as $key => $value) {
# Note: the content-type and content-length headers always come
# after the `CONTENT_TYPE` and `CONTENT_LENGTH` values in the
# $_SERVER superglobal; if you use the valu... | [
"protected",
"function",
"readHeaders",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"environment",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"# Note: the content-type and content-length headers always come",
"# after t... | Create an array of all headers in the
@return array<string,string> | [
"Create",
"an",
"array",
"of",
"all",
"headers",
"in",
"the"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/Request.php#L228-L244 |
196,132 | sndsgd/http | src/http/Request.php | Request.parseCookies | protected function parseCookies(): array
{
# cookies are encoded in the `cookie` header
$header = $this->getHeader("cookie");
if (empty($header)) {
return [];
}
# create a data collection to gracefully handle arrays
$options = $this->getDecoderOptions();
... | php | protected function parseCookies(): array
{
# cookies are encoded in the `cookie` header
$header = $this->getHeader("cookie");
if (empty($header)) {
return [];
}
# create a data collection to gracefully handle arrays
$options = $this->getDecoderOptions();
... | [
"protected",
"function",
"parseCookies",
"(",
")",
":",
"array",
"{",
"# cookies are encoded in the `cookie` header",
"$",
"header",
"=",
"$",
"this",
"->",
"getHeader",
"(",
"\"cookie\"",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"header",
")",
")",
"{",
"ret... | Parse cookies from the `cookie` header
@return array<string,mixed> | [
"Parse",
"cookies",
"from",
"the",
"cookie",
"header"
] | e7f82010a66c6d3241a24ea82baf4593130c723b | https://github.com/sndsgd/http/blob/e7f82010a66c6d3241a24ea82baf4593130c723b/src/http/Request.php#L327-L358 |
196,133 | SysCodeSoft/Sofi-Router | src/Route.php | Route.route | function route($path = '/', array $actions = [], $method = Router::ANY_METHOD, $name = '')
{
$this->path($path);
$this->actions[$method] = $actions;
$this->name = $name;
return $this;
} | php | function route($path = '/', array $actions = [], $method = Router::ANY_METHOD, $name = '')
{
$this->path($path);
$this->actions[$method] = $actions;
$this->name = $name;
return $this;
} | [
"function",
"route",
"(",
"$",
"path",
"=",
"'/'",
",",
"array",
"$",
"actions",
"=",
"[",
"]",
",",
"$",
"method",
"=",
"Router",
"::",
"ANY_METHOD",
",",
"$",
"name",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"path",
"(",
"$",
"path",
")",
";",... | Set route params
@param string $path Path for parse
@param array $actions Array actions for route
@param int|string $method Request method
@param string $name Alias for route | [
"Set",
"route",
"params"
] | a2fc580d2561a0b18f6ac74e9e0b2a8c68e6559c | https://github.com/SysCodeSoft/Sofi-Router/blob/a2fc580d2561a0b18f6ac74e9e0b2a8c68e6559c/src/Route.php#L46-L53 |
196,134 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.connect | public function connect() {
if(false === $this -> connection instanceof \mysqli) {
$this -> connection = new \mysqli($this -> data -> host, $this -> data -> username, $this -> data -> password, $this -> data -> db, $this -> data -> port);
if($this -> data -> charset) {
$this -> conn... | php | public function connect() {
if(false === $this -> connection instanceof \mysqli) {
$this -> connection = new \mysqli($this -> data -> host, $this -> data -> username, $this -> data -> password, $this -> data -> db, $this -> data -> port);
if($this -> data -> charset) {
$this -> conn... | [
"public",
"function",
"connect",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"connection",
"instanceof",
"\\",
"mysqli",
")",
"{",
"$",
"this",
"->",
"connection",
"=",
"new",
"\\",
"mysqli",
"(",
"$",
"this",
"->",
"data",
"->",
"ho... | Connect to Mysql server and set charset | [
"Connect",
"to",
"Mysql",
"server",
"and",
"set",
"charset"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L119-L129 |
196,135 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.fetch | public function fetch($type = null) {
if(null !== $type && false === is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
}
$results = new ResultSet([], $type);
//Returns a copy of a value
... | php | public function fetch($type = null) {
if(null !== $type && false === is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
}
$results = new ResultSet([], $type);
//Returns a copy of a value
... | [
"public",
"function",
"fetch",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"type",
"&&",
"false",
"===",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s()... | Returns results from statement as an result set
@param string $type
@return sFire\Adapter\ResultSet | [
"Returns",
"results",
"from",
"statement",
"as",
"an",
"result",
"set"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L227-L269 |
196,136 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.query | public function query($query, $params = []) {
if(false === is_string($query)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
}
if(null !== $params && false === is_array($params)) {
return trigger_erro... | php | public function query($query, $params = []) {
if(false === is_string($query)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($query)), E_USER_ERROR);
}
if(null !== $params && false === is_array($params)) {
return trigger_erro... | [
"public",
"function",
"query",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"query",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of ... | Prepare a raw query
@param string $query
@param array $params
@return $this | [
"Prepare",
"a",
"raw",
"query"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L278-L319 |
196,137 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.multiquery | public function multiquery($query, $params = []) {
if(true === is_array($query)) {
$query = implode(";\n", $query);
}
if(false === is_string($query)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($query)), E_USER_ERRO... | php | public function multiquery($query, $params = []) {
if(true === is_array($query)) {
$query = implode(";\n", $query);
}
if(false === is_string($query)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or array, "%s" given', __METHOD__, gettype($query)), E_USER_ERRO... | [
"public",
"function",
"multiquery",
"(",
"$",
"query",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"true",
"===",
"is_array",
"(",
"$",
"query",
")",
")",
"{",
"$",
"query",
"=",
"implode",
"(",
"\";\\n\"",
",",
"$",
"query",
")",
";"... | Execute a multiquery
@param string $query
@param array $params
@return sFire\Adapter\ResultSet | [
"Execute",
"a",
"multiquery"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L328-L369 |
196,138 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.escape | public function escape($data) {
if(null === $data) {
return $data;
}
if(false === is_string($data) && false === is_numeric($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, float or int, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
i... | php | public function escape($data) {
if(null === $data) {
return $data;
}
if(false === is_string($data) && false === is_numeric($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, float or int, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
i... | [
"public",
"function",
"escape",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"data",
")",
"{",
"return",
"$",
"data",
";",
"}",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"data",
")",
"&&",
"false",
"===",
"is_numeric",
"(",
... | Escapes string for statement usage
@param string $data
@return string | [
"Escapes",
"string",
"for",
"statement",
"usage"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L397-L412 |
196,139 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.close | public function close() {
if(false === $this -> connection instanceof \mysqli) {
return trigger_error('Connection already closed');
}
$this -> connection -> close();
return $this;
} | php | public function close() {
if(false === $this -> connection instanceof \mysqli) {
return trigger_error('Connection already closed');
}
$this -> connection -> close();
return $this;
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"connection",
"instanceof",
"\\",
"mysqli",
")",
"{",
"return",
"trigger_error",
"(",
"'Connection already closed'",
")",
";",
"}",
"$",
"this",
"->",
"connection",
... | Closes the database connection
@return $this | [
"Closes",
"the",
"database",
"connection"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L470-L479 |
196,140 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.getLastErrno | public function getLastErrno() {
if(true === $this -> connection instanceof \mysqli) {
$this -> connect();
}
return $this -> connection -> errno;
} | php | public function getLastErrno() {
if(true === $this -> connection instanceof \mysqli) {
$this -> connect();
}
return $this -> connection -> errno;
} | [
"public",
"function",
"getLastErrno",
"(",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"connection",
"instanceof",
"\\",
"mysqli",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"connection",
"->",
... | Returns the last error number
@return int | [
"Returns",
"the",
"last",
"error",
"number"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L486-L493 |
196,141 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.getLastError | public function getLastError() {
if(true === $this -> connection instanceof \mysqli) {
$this -> connect();
}
return $this -> connection -> error;
} | php | public function getLastError() {
if(true === $this -> connection instanceof \mysqli) {
$this -> connect();
}
return $this -> connection -> error;
} | [
"public",
"function",
"getLastError",
"(",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"connection",
"instanceof",
"\\",
"mysqli",
")",
"{",
"$",
"this",
"->",
"connect",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"connection",
"->",
... | Returns the last error message
@return string | [
"Returns",
"the",
"last",
"error",
"message"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L500-L507 |
196,142 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.escapeSemicolon | private function escapeSemicolon($query, $params) {
preg_match_all('#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#', $query, $variables);
if(true === isset($variables[0])) {
foreach($variables[0] as $index => $variable) {
if(false === array_key_exists($variables[1][$index], $params)) {
return tr... | php | private function escapeSemicolon($query, $params) {
preg_match_all('#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#', $query, $variables);
if(true === isset($variables[0])) {
foreach($variables[0] as $index => $variable) {
if(false === array_key_exists($variables[1][$index], $params)) {
return tr... | [
"private",
"function",
"escapeSemicolon",
"(",
"$",
"query",
",",
"$",
"params",
")",
"{",
"preg_match_all",
"(",
"'#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#'",
",",
"$",
"query",
",",
"$",
"variables",
")",
";",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"var... | Escape variables bind with a semicolon
@param string $query
@param array $params
@return string | [
"Escape",
"variables",
"bind",
"with",
"a",
"semicolon"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L563-L589 |
196,143 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.escapeQuestionmark | private function escapeQuestionmark($query, $params) {
preg_match_all('#([\\\]{0,})(\?)#', $query, $variables);
if(true === isset($variables[0])) {
foreach($variables[0] as $index => $variable) {
//Check if ? sign is escaped or not
if(strlen($variables[1][$index]) % 2 !== 0) {
con... | php | private function escapeQuestionmark($query, $params) {
preg_match_all('#([\\\]{0,})(\?)#', $query, $variables);
if(true === isset($variables[0])) {
foreach($variables[0] as $index => $variable) {
//Check if ? sign is escaped or not
if(strlen($variables[1][$index]) % 2 !== 0) {
con... | [
"private",
"function",
"escapeQuestionmark",
"(",
"$",
"query",
",",
"$",
"params",
")",
"{",
"preg_match_all",
"(",
"'#([\\\\\\]{0,})(\\?)#'",
",",
"$",
"query",
",",
"$",
"variables",
")",
";",
"if",
"(",
"true",
"===",
"isset",
"(",
"$",
"variables",
"[... | Escape variables bind with a question mark
@param string $query
@param array $params
@return string | [
"Escape",
"variables",
"bind",
"with",
"a",
"question",
"mark"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L598-L629 |
196,144 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.executeStatement | private function executeStatement($stmt) {
if(true !== $stmt -> execute()) {
if($this -> getLastErrno() > 0) {
return trigger_error(sprintf('A database error occured with error number "%s" and message: "%s"', $this -> getLastErrno(), $this -> getLastError()), E_USER_ERROR);
}
return false;
... | php | private function executeStatement($stmt) {
if(true !== $stmt -> execute()) {
if($this -> getLastErrno() > 0) {
return trigger_error(sprintf('A database error occured with error number "%s" and message: "%s"', $this -> getLastErrno(), $this -> getLastError()), E_USER_ERROR);
}
return false;
... | [
"private",
"function",
"executeStatement",
"(",
"$",
"stmt",
")",
"{",
"if",
"(",
"true",
"!==",
"$",
"stmt",
"->",
"execute",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getLastErrno",
"(",
")",
">",
"0",
")",
"{",
"return",
"trigger_error",
... | Executes one statement
@param mysqli_stmt
@return mysqli_stmt | [
"Executes",
"one",
"statement"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L637-L651 |
196,145 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.parse | private function parse(&$params, &$query) {
//Check the type of param binding ("?" = all keys are numeric or ":" = all keys are strings)
if(0 !== count(array_filter(array_keys($params), 'is_string'))) {
preg_match_all('#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#', $query, $variables);
if(true === isse... | php | private function parse(&$params, &$query) {
//Check the type of param binding ("?" = all keys are numeric or ":" = all keys are strings)
if(0 !== count(array_filter(array_keys($params), 'is_string'))) {
preg_match_all('#:((?:[a-zA-Z_])(?:[a-zA-Z0-9-_]+)?)#', $query, $variables);
if(true === isse... | [
"private",
"function",
"parse",
"(",
"&",
"$",
"params",
",",
"&",
"$",
"query",
")",
"{",
"//Check the type of param binding (\"?\" = all keys are numeric or \":\" = all keys are strings)\r",
"if",
"(",
"0",
"!==",
"count",
"(",
"array_filter",
"(",
"array_keys",
"(",
... | Parse parameters and return it with types
@param array $params
@param string $query
@return array | [
"Parse",
"parameters",
"and",
"return",
"it",
"with",
"types"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L660-L715 |
196,146 | Kris-Kuiper/sFire-Framework | src/DB/Driver/MySQLi/Database.php | Database.bind | private function bind($stmt) {
$meta = $stmt -> result_metadata();
$double = [];
$vars = [];
if($stmt -> field_count > 0) {
while($field = $meta -> fetch_field()) {
$columnname = $field -> name;
${$columnname} = null;
if(true === array_key_exists($columnname, $vars)) {
... | php | private function bind($stmt) {
$meta = $stmt -> result_metadata();
$double = [];
$vars = [];
if($stmt -> field_count > 0) {
while($field = $meta -> fetch_field()) {
$columnname = $field -> name;
${$columnname} = null;
if(true === array_key_exists($columnname, $vars)) {
... | [
"private",
"function",
"bind",
"(",
"$",
"stmt",
")",
"{",
"$",
"meta",
"=",
"$",
"stmt",
"->",
"result_metadata",
"(",
")",
";",
"$",
"double",
"=",
"[",
"]",
";",
"$",
"vars",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"stmt",
"->",
"field_count",
"... | Bind the result to the variables and returns it
@return array | [
"Bind",
"the",
"result",
"to",
"the",
"variables",
"and",
"returns",
"it"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/DB/Driver/MySQLi/Database.php#L722-L751 |
196,147 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Loader/Bridge/InMemory/InMemoryLoaderTrait.php | InMemoryLoaderTrait.registerData | public function registerData(array $entityData)
{
foreach ($entityData as $data) {
$this->registerEntity($this->normalizer->denormalize(
$data,
$this->entityCollection->getEntityClass()
));
}
} | php | public function registerData(array $entityData)
{
foreach ($entityData as $data) {
$this->registerEntity($this->normalizer->denormalize(
$data,
$this->entityCollection->getEntityClass()
));
}
} | [
"public",
"function",
"registerData",
"(",
"array",
"$",
"entityData",
")",
"{",
"foreach",
"(",
"$",
"entityData",
"as",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"registerEntity",
"(",
"$",
"this",
"->",
"normalizer",
"->",
"denormalize",
"(",
"$",
"da... | Register given set of data into datastore.
@param array $entityData | [
"Register",
"given",
"set",
"of",
"data",
"into",
"datastore",
"."
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/InMemory/InMemoryLoaderTrait.php#L68-L76 |
196,148 | Linkvalue-Interne/MajoraFrameworkExtraBundle | src/Majora/Framework/Loader/Bridge/InMemory/InMemoryLoaderTrait.php | InMemoryLoaderTrait.registerEntity | public function registerEntity(CollectionableInterface $entity)
{
if (!is_a($entity, $this->entityCollection->getEntityClass())) {
throw new \InvalidArgumentException(sprintf('Only "%s" object allowed into "%s" store, "%s" given.',
$this->entityCollection->getEntityClass(),
... | php | public function registerEntity(CollectionableInterface $entity)
{
if (!is_a($entity, $this->entityCollection->getEntityClass())) {
throw new \InvalidArgumentException(sprintf('Only "%s" object allowed into "%s" store, "%s" given.',
$this->entityCollection->getEntityClass(),
... | [
"public",
"function",
"registerEntity",
"(",
"CollectionableInterface",
"$",
"entity",
")",
"{",
"if",
"(",
"!",
"is_a",
"(",
"$",
"entity",
",",
"$",
"this",
"->",
"entityCollection",
"->",
"getEntityClass",
"(",
")",
")",
")",
"{",
"throw",
"new",
"\\",
... | Register a new Collectionable entity into datastore.
@param CollectionableInterface $entity
@throws \InvalidArgumentException If given object is not a supported type | [
"Register",
"a",
"new",
"Collectionable",
"entity",
"into",
"datastore",
"."
] | 6f368380cfc39d27fafb0844e9a53b4d86d7c034 | https://github.com/Linkvalue-Interne/MajoraFrameworkExtraBundle/blob/6f368380cfc39d27fafb0844e9a53b4d86d7c034/src/Majora/Framework/Loader/Bridge/InMemory/InMemoryLoaderTrait.php#L85-L99 |
196,149 | kitpages/KitpagesStepBundle | Proxy/CacheWarmer/ProxyCacheWarmer.php | ProxyCacheWarmer.warmUp | public function warmUp($cacheDir)
{
$stepList = $this->stepManager->getStepList();
if (null === $stepList) {
return;
}
foreach ($stepList as $stepName => $step) {
$stepFinalConfig = $this->stepManager->getResultingConfig($stepName);
$stepFinalCon... | php | public function warmUp($cacheDir)
{
$stepList = $this->stepManager->getStepList();
if (null === $stepList) {
return;
}
foreach ($stepList as $stepName => $step) {
$stepFinalConfig = $this->stepManager->getResultingConfig($stepName);
$stepFinalCon... | [
"public",
"function",
"warmUp",
"(",
"$",
"cacheDir",
")",
"{",
"$",
"stepList",
"=",
"$",
"this",
"->",
"stepManager",
"->",
"getStepList",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"stepList",
")",
"{",
"return",
";",
"}",
"foreach",
"(",
"$",
... | Writes the workflow proxy cache file.
@param string $cacheDir The cache directory | [
"Writes",
"the",
"workflow",
"proxy",
"cache",
"file",
"."
] | 2ac421c8364d41b87b515a91a94513f3d1ab20c1 | https://github.com/kitpages/KitpagesStepBundle/blob/2ac421c8364d41b87b515a91a94513f3d1ab20c1/Proxy/CacheWarmer/ProxyCacheWarmer.php#L47-L72 |
196,150 | lasallecms/lasallecms-l5-lasallecmsemail-pkg | src/Repositories/Email_messageRepository.php | Email_messageRepository.markEmailAsRead | public function markEmailAsRead($id) {
$emailMessage = $this->model->find($id);
$emailMessage->read = 1;
return $emailMessage->save();
} | php | public function markEmailAsRead($id) {
$emailMessage = $this->model->find($id);
$emailMessage->read = 1;
return $emailMessage->save();
} | [
"public",
"function",
"markEmailAsRead",
"(",
"$",
"id",
")",
"{",
"$",
"emailMessage",
"=",
"$",
"this",
"->",
"model",
"->",
"find",
"(",
"$",
"id",
")",
";",
"$",
"emailMessage",
"->",
"read",
"=",
"1",
";",
"return",
"$",
"emailMessage",
"->",
"s... | Mark an email as read by setting the "read" field to true
@param int $id The "email_messages" table's ID field
@return void | [
"Mark",
"an",
"email",
"as",
"read",
"by",
"setting",
"the",
"read",
"field",
"to",
"true"
] | 95db5a59ab322105b9d3681cf9ab1f829c9fdb9f | https://github.com/lasallecms/lasallecms-l5-lasallecmsemail-pkg/blob/95db5a59ab322105b9d3681cf9ab1f829c9fdb9f/src/Repositories/Email_messageRepository.php#L81-L88 |
196,151 | lasallecms/lasallecms-l5-lasallecmsemail-pkg | src/Repositories/Email_messageRepository.php | Email_messageRepository.markEmailAsSent | public function markEmailAsSent($id) {
$emailMessage = $this->model->find($id);
$emailMessage->sent = 1;
return $emailMessage->save();
} | php | public function markEmailAsSent($id) {
$emailMessage = $this->model->find($id);
$emailMessage->sent = 1;
return $emailMessage->save();
} | [
"public",
"function",
"markEmailAsSent",
"(",
"$",
"id",
")",
"{",
"$",
"emailMessage",
"=",
"$",
"this",
"->",
"model",
"->",
"find",
"(",
"$",
"id",
")",
";",
"$",
"emailMessage",
"->",
"sent",
"=",
"1",
";",
"return",
"$",
"emailMessage",
"->",
"s... | Mark an email as sent by setting the "sent" field to true
@param int $id The "email_messages" table's ID field
@return void | [
"Mark",
"an",
"email",
"as",
"sent",
"by",
"setting",
"the",
"sent",
"field",
"to",
"true"
] | 95db5a59ab322105b9d3681cf9ab1f829c9fdb9f | https://github.com/lasallecms/lasallecms-l5-lasallecmsemail-pkg/blob/95db5a59ab322105b9d3681cf9ab1f829c9fdb9f/src/Repositories/Email_messageRepository.php#L96-L103 |
196,152 | modulusphp/support | File.php | File.disc | public function disc(string $storage)
{
if (isset($this->storage[$storage])) {
$this->disc = strtolower($storage);
return $this;
}
throw new UnknownStorageException;
} | php | public function disc(string $storage)
{
if (isset($this->storage[$storage])) {
$this->disc = strtolower($storage);
return $this;
}
throw new UnknownStorageException;
} | [
"public",
"function",
"disc",
"(",
"string",
"$",
"storage",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"storage",
"[",
"$",
"storage",
"]",
")",
")",
"{",
"$",
"this",
"->",
"disc",
"=",
"strtolower",
"(",
"$",
"storage",
")",
";",
"r... | Set default disc storage
@param string $storage
@return void | [
"Set",
"default",
"disc",
"storage"
] | b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab | https://github.com/modulusphp/support/blob/b5c5b48dcbeb379e6cd1f29159dc8cdacef3adab/File.php#L106-L114 |
196,153 | Dhii/iterator-abstract | src/RecursiveIteratorTrait.php | RecursiveIteratorTrait._loop | protected function _loop()
{
// Ensure that there are items on the stack
if (!$this->_hasParents()) {
return $this->_createIteration(null, null);
}
// Get current top item on the stack and its current iteration entry
$parent = &$this->_getCurrentIterable();
... | php | protected function _loop()
{
// Ensure that there are items on the stack
if (!$this->_hasParents()) {
return $this->_createIteration(null, null);
}
// Get current top item on the stack and its current iteration entry
$parent = &$this->_getCurrentIterable();
... | [
"protected",
"function",
"_loop",
"(",
")",
"{",
"// Ensure that there are items on the stack",
"if",
"(",
"!",
"$",
"this",
"->",
"_hasParents",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_createIteration",
"(",
"null",
",",
"null",
")",
";",
"}",
... | Advances the iterator and computes the new state.
@since [*next-version*]
@return IterationInterface The iteration that represents the new state. | [
"Advances",
"the",
"iterator",
"and",
"computes",
"the",
"new",
"state",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/RecursiveIteratorTrait.php#L57-L89 |
196,154 | Dhii/iterator-abstract | src/RecursiveIteratorTrait.php | RecursiveIteratorTrait._backtrackLoop | protected function _backtrackLoop()
{
$this->_popParent();
if (!$this->_hasParents()) {
return $this->_createIteration(null, null);
}
$parent = &$this->_getCurrentIterable();
$current = $this->_createCurrentIteration($parent);
next($parent);
if... | php | protected function _backtrackLoop()
{
$this->_popParent();
if (!$this->_hasParents()) {
return $this->_createIteration(null, null);
}
$parent = &$this->_getCurrentIterable();
$current = $this->_createCurrentIteration($parent);
next($parent);
if... | [
"protected",
"function",
"_backtrackLoop",
"(",
")",
"{",
"$",
"this",
"->",
"_popParent",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"_hasParents",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_createIteration",
"(",
"null",
",",
"null",
... | Backtracks up one parent, yielding the parent or resuming the loop, whichever is appropriate.
@since [*next-version*]
@return IterationInterface | [
"Backtracks",
"up",
"one",
"parent",
"yielding",
"the",
"parent",
"or",
"resuming",
"the",
"loop",
"whichever",
"is",
"appropriate",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/RecursiveIteratorTrait.php#L98-L115 |
196,155 | Dhii/iterator-abstract | src/RecursiveIteratorTrait.php | RecursiveIteratorTrait._pushParent | protected function _pushParent(&$parent)
{
$children = &$this->_getElementChildren($parent);
$pathSegment = $this->_getElementPathSegment(null, $parent);
$this->_pushPathSegment($pathSegment);
reset($children);
array_unshift($this->parents, $children);
} | php | protected function _pushParent(&$parent)
{
$children = &$this->_getElementChildren($parent);
$pathSegment = $this->_getElementPathSegment(null, $parent);
$this->_pushPathSegment($pathSegment);
reset($children);
array_unshift($this->parents, $children);
} | [
"protected",
"function",
"_pushParent",
"(",
"&",
"$",
"parent",
")",
"{",
"$",
"children",
"=",
"&",
"$",
"this",
"->",
"_getElementChildren",
"(",
"$",
"parent",
")",
";",
"$",
"pathSegment",
"=",
"$",
"this",
"->",
"_getElementPathSegment",
"(",
"null",... | Adds an iterable parent onto the stack.
The stack is there to maintain a trace of hierarchy.
@since [*next-version*]
@param Iterator|array $parent The parent. | [
"Adds",
"an",
"iterable",
"parent",
"onto",
"the",
"stack",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/RecursiveIteratorTrait.php#L139-L148 |
196,156 | Dhii/iterator-abstract | src/RecursiveIteratorTrait.php | RecursiveIteratorTrait._createCurrentIteration | protected function _createCurrentIteration(&$iterable)
{
$key = $this->_getCurrentIterableKey($iterable);
$val = $this->_getCurrentIterableValue($iterable);
$path = $this->_getCurrentPath($key, $val);
return $this->_createIteration($key, $val, $path);
} | php | protected function _createCurrentIteration(&$iterable)
{
$key = $this->_getCurrentIterableKey($iterable);
$val = $this->_getCurrentIterableValue($iterable);
$path = $this->_getCurrentPath($key, $val);
return $this->_createIteration($key, $val, $path);
} | [
"protected",
"function",
"_createCurrentIteration",
"(",
"&",
"$",
"iterable",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"_getCurrentIterableKey",
"(",
"$",
"iterable",
")",
";",
"$",
"val",
"=",
"$",
"this",
"->",
"_getCurrentIterableValue",
"(",
"$",
... | Creates an iteration instance for the current state of a given iterable.
@since [*next-version*]
@param array|Traversable $iterable The iterable.
@return IterationInterface | [
"Creates",
"an",
"iteration",
"instance",
"for",
"the",
"current",
"state",
"of",
"a",
"given",
"iterable",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/RecursiveIteratorTrait.php#L267-L274 |
196,157 | Dhii/iterator-abstract | src/RecursiveIteratorTrait.php | RecursiveIteratorTrait._getCurrentPath | protected function _getCurrentPath($key, $value)
{
$path = $this->_getPathSegments();
$path[] = $this->_getElementPathSegment($key, $value);
return array_filter($path);
} | php | protected function _getCurrentPath($key, $value)
{
$path = $this->_getPathSegments();
$path[] = $this->_getElementPathSegment($key, $value);
return array_filter($path);
} | [
"protected",
"function",
"_getCurrentPath",
"(",
"$",
"key",
",",
"$",
"value",
")",
"{",
"$",
"path",
"=",
"$",
"this",
"->",
"_getPathSegments",
"(",
")",
";",
"$",
"path",
"[",
"]",
"=",
"$",
"this",
"->",
"_getElementPathSegment",
"(",
"$",
"key",
... | Retrieves the current path.
@since [*next-version*]
@param string|int $key The current element key.
@param mixed $value The current element value.
@return array | [
"Retrieves",
"the",
"current",
"path",
"."
] | 576484183865575ffc2a0d586132741329626fb8 | https://github.com/Dhii/iterator-abstract/blob/576484183865575ffc2a0d586132741329626fb8/src/RecursiveIteratorTrait.php#L286-L292 |
196,158 | fiiSoft/fiisoft-logger | src/Logger/Reader/LogConsumer/InMemoryLogsCollector.php | InMemoryLogsCollector.sendLogsTo | public function sendLogsTo(LogConsumer $logConsumer)
{
if ($logConsumer === $this) {
throw new LogicException('Operation not allowed');
}
while (!empty($this->collectedLogs)) {
$log = array_shift($this->collectedLogs);
$logConsumer->consumeLog($lo... | php | public function sendLogsTo(LogConsumer $logConsumer)
{
if ($logConsumer === $this) {
throw new LogicException('Operation not allowed');
}
while (!empty($this->collectedLogs)) {
$log = array_shift($this->collectedLogs);
$logConsumer->consumeLog($lo... | [
"public",
"function",
"sendLogsTo",
"(",
"LogConsumer",
"$",
"logConsumer",
")",
"{",
"if",
"(",
"$",
"logConsumer",
"===",
"$",
"this",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Operation not allowed'",
")",
";",
"}",
"while",
"(",
"!",
"empty",
... | Send all logs to other LogConsumer.
Be aware that logs are removed during this process.
@param LogConsumer $logConsumer
@throws LogicException
@return void | [
"Send",
"all",
"logs",
"to",
"other",
"LogConsumer",
".",
"Be",
"aware",
"that",
"logs",
"are",
"removed",
"during",
"this",
"process",
"."
] | 3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5 | https://github.com/fiiSoft/fiisoft-logger/blob/3d2eb9d18a785ec119d2fbeb9d34b74265e7dcf5/src/Logger/Reader/LogConsumer/InMemoryLogsCollector.php#L71-L81 |
196,159 | romm/configuration_object | Classes/Legacy/Reflection/DocCommentParser.php | DocCommentParser.parseTag | protected function parseTag($line)
{
$tagAndValue = preg_split('/\\s/', $line, 2);
$tag = substr($tagAndValue[0], 1);
if (count($tagAndValue) > 1) {
$this->tags[$tag][] = trim($tagAndValue[1]);
} else {
$this->tags[$tag] = [];
}
} | php | protected function parseTag($line)
{
$tagAndValue = preg_split('/\\s/', $line, 2);
$tag = substr($tagAndValue[0], 1);
if (count($tagAndValue) > 1) {
$this->tags[$tag][] = trim($tagAndValue[1]);
} else {
$this->tags[$tag] = [];
}
} | [
"protected",
"function",
"parseTag",
"(",
"$",
"line",
")",
"{",
"$",
"tagAndValue",
"=",
"preg_split",
"(",
"'/\\\\s/'",
",",
"$",
"line",
",",
"2",
")",
";",
"$",
"tag",
"=",
"substr",
"(",
"$",
"tagAndValue",
"[",
"0",
"]",
",",
"1",
")",
";",
... | Parses a line of a doc comment for a tag and its value.
The result is stored in the interal tags array.
@param string $line A line of a doc comment which starts with an @-sign | [
"Parses",
"a",
"line",
"of",
"a",
"doc",
"comment",
"for",
"a",
"tag",
"and",
"its",
"value",
".",
"The",
"result",
"is",
"stored",
"in",
"the",
"interal",
"tags",
"array",
"."
] | d3a40903386c2e0766bd8279337fe6da45cf5ce3 | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Legacy/Reflection/DocCommentParser.php#L108-L117 |
196,160 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/MessageParser.php | MessageParser.parseRequest | public function parseRequest($message)
{
if (!($parts = $this->parseMessage($message))) {
return false;
}
// Parse the protocol and protocol version
if (isset($parts['start_line'][2])) {
$startParts = explode('/', $parts['start_line'][2]);
$protoc... | php | public function parseRequest($message)
{
if (!($parts = $this->parseMessage($message))) {
return false;
}
// Parse the protocol and protocol version
if (isset($parts['start_line'][2])) {
$startParts = explode('/', $parts['start_line'][2]);
$protoc... | [
"public",
"function",
"parseRequest",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"parts",
"=",
"$",
"this",
"->",
"parseMessage",
"(",
"$",
"message",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"// Parse the protocol and protocol versio... | Parse an HTTP request message into an associative array of parts.
@param string $message HTTP request to parse
@return array|bool Returns false if the message is invalid | [
"Parse",
"an",
"HTTP",
"request",
"message",
"into",
"an",
"associative",
"array",
"of",
"parts",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/MessageParser.php#L17-L45 |
196,161 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/MessageParser.php | MessageParser.parseResponse | public function parseResponse($message)
{
if (!($parts = $this->parseMessage($message))) {
return false;
}
list($protocol, $version) = explode('/', trim($parts['start_line'][0]));
return [
'protocol' => $protocol,
'protocol_version' => $v... | php | public function parseResponse($message)
{
if (!($parts = $this->parseMessage($message))) {
return false;
}
list($protocol, $version) = explode('/', trim($parts['start_line'][0]));
return [
'protocol' => $protocol,
'protocol_version' => $v... | [
"public",
"function",
"parseResponse",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"parts",
"=",
"$",
"this",
"->",
"parseMessage",
"(",
"$",
"message",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"list",
"(",
"$",
"protocol",
","... | Parse an HTTP response message into an associative array of parts.
@param string $message HTTP response to parse
@return array|bool Returns false if the message is invalid | [
"Parse",
"an",
"HTTP",
"response",
"message",
"into",
"an",
"associative",
"array",
"of",
"parts",
"."
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/MessageParser.php#L54-L70 |
196,162 | horntell/php-sdk | lib/guzzle/GuzzleHttp/Message/MessageParser.php | MessageParser.parseMessage | private function parseMessage($message)
{
if (!$message) {
return false;
}
$startLine = null;
$headers = [];
$body = '';
// Iterate over each line in the message, accounting for line endings
$lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_S... | php | private function parseMessage($message)
{
if (!$message) {
return false;
}
$startLine = null;
$headers = [];
$body = '';
// Iterate over each line in the message, accounting for line endings
$lines = preg_split('/(\\r?\\n)/', $message, -1, PREG_S... | [
"private",
"function",
"parseMessage",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"$",
"message",
")",
"{",
"return",
"false",
";",
"}",
"$",
"startLine",
"=",
"null",
";",
"$",
"headers",
"=",
"[",
"]",
";",
"$",
"body",
"=",
"''",
";",
"// ... | Parse a message into parts
@param string $message Message to parse
@return array|bool | [
"Parse",
"a",
"message",
"into",
"parts"
] | e5205e9396a21b754d5651a8aa5898da5922a1b7 | https://github.com/horntell/php-sdk/blob/e5205e9396a21b754d5651a8aa5898da5922a1b7/lib/guzzle/GuzzleHttp/Message/MessageParser.php#L79-L125 |
196,163 | infusephp/cron | src/Libs/CronDate.php | CronDate.calculate | private function calculate()
{
$this->second = 0;
$iters = 0;
$maxIters = 100;
while ($iters < $maxIters && !$this->satisfied()) {
if ($this->params->minute !== '*' && ($this->minute != $this->params->minute)) {
if ($this->minute > $this->params->minute) ... | php | private function calculate()
{
$this->second = 0;
$iters = 0;
$maxIters = 100;
while ($iters < $maxIters && !$this->satisfied()) {
if ($this->params->minute !== '*' && ($this->minute != $this->params->minute)) {
if ($this->minute > $this->params->minute) ... | [
"private",
"function",
"calculate",
"(",
")",
"{",
"$",
"this",
"->",
"second",
"=",
"0",
";",
"$",
"iters",
"=",
"0",
";",
"$",
"maxIters",
"=",
"100",
";",
"while",
"(",
"$",
"iters",
"<",
"$",
"maxIters",
"&&",
"!",
"$",
"this",
"->",
"satisfi... | Calculates the next run timestamp. | [
"Calculates",
"the",
"next",
"run",
"timestamp",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/CronDate.php#L103-L156 |
196,164 | infusephp/cron | src/Libs/CronDate.php | CronDate.satisfied | private function satisfied()
{
return ($this->params->minute === '*' || $this->params->minute == $this->minute) &&
($this->params->hour === '*' || $this->params->hour == $this->hour) &&
($this->params->day === '*' || $this->params->day == $this->day) &&
($this->p... | php | private function satisfied()
{
return ($this->params->minute === '*' || $this->params->minute == $this->minute) &&
($this->params->hour === '*' || $this->params->hour == $this->hour) &&
($this->params->day === '*' || $this->params->day == $this->day) &&
($this->p... | [
"private",
"function",
"satisfied",
"(",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"params",
"->",
"minute",
"===",
"'*'",
"||",
"$",
"this",
"->",
"params",
"->",
"minute",
"==",
"$",
"this",
"->",
"minute",
")",
"&&",
"(",
"$",
"this",
"->",
"p... | Checks if the calculated next run timestamp
satisfies the date parameters.
@return bool | [
"Checks",
"if",
"the",
"calculated",
"next",
"run",
"timestamp",
"satisfies",
"the",
"date",
"parameters",
"."
] | 783f6078b455a48415efeba0a6ee97ab17a3a903 | https://github.com/infusephp/cron/blob/783f6078b455a48415efeba0a6ee97ab17a3a903/src/Libs/CronDate.php#L164-L171 |
196,165 | codeblanche/Web | src/Web/Route/Abstraction/AbstractRule.php | AbstractRule.matchFilters | protected function matchFilters($params)
{
foreach ($this->filters as $key => $expression) {
if (!isset($params[$key])) {
return false;
}
if (!preg_match($expression, $params[$key])) {
return false;
}
}
return ... | php | protected function matchFilters($params)
{
foreach ($this->filters as $key => $expression) {
if (!isset($params[$key])) {
return false;
}
if (!preg_match($expression, $params[$key])) {
return false;
}
}
return ... | [
"protected",
"function",
"matchFilters",
"(",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"filters",
"as",
"$",
"key",
"=>",
"$",
"expression",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"$",
"key",
"]",
")",
")",
... | Validate params against given expressions.
@param $params
@return bool | [
"Validate",
"params",
"against",
"given",
"expressions",
"."
] | 3e9ebf1943d3ea468f619ba99f7cc10714cb16e9 | https://github.com/codeblanche/Web/blob/3e9ebf1943d3ea468f619ba99f7cc10714cb16e9/src/Web/Route/Abstraction/AbstractRule.php#L133-L146 |
196,166 | freialib/ran.tools | src/Field/Select.php | SelectField.liefhierarchy_parse_options | protected function liefhierarchy_parse_options(array $options) {
foreach ($options as $key => $label) {
if (is_array($label)) {
$option = \ran\HTMLTag::i($this->confs, 'option', $key)
->set('disabled', '');
$this->appendtagbody($option->render());
$this->liefhierarchy_parse_options($label);
}
... | php | protected function liefhierarchy_parse_options(array $options) {
foreach ($options as $key => $label) {
if (is_array($label)) {
$option = \ran\HTMLTag::i($this->confs, 'option', $key)
->set('disabled', '');
$this->appendtagbody($option->render());
$this->liefhierarchy_parse_options($label);
}
... | [
"protected",
"function",
"liefhierarchy_parse_options",
"(",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"label",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"label",
")",
")",
"{",
"$",
"option",
"=",... | Parses hierarchy input array. | [
"Parses",
"hierarchy",
"input",
"array",
"."
] | f4cbb926ef54da357b102cbfa4b6ce273be6ce63 | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Field/Select.php#L169-L189 |
196,167 | freialib/ran.tools | src/Field/Select.php | SelectField.options_table | function options_table(array $table, $valuekey = null, $labelkey = null, $groupkey = null) {
$optgroups = [];
$options = [];
if ($groupkey === null) {
$options = static::associativeFrom($table, $valuekey, $labelkey);
}
else { # got group key
foreach ($table as $row) {
if ($row[$groupkey] !== null) ... | php | function options_table(array $table, $valuekey = null, $labelkey = null, $groupkey = null) {
$optgroups = [];
$options = [];
if ($groupkey === null) {
$options = static::associativeFrom($table, $valuekey, $labelkey);
}
else { # got group key
foreach ($table as $row) {
if ($row[$groupkey] !== null) ... | [
"function",
"options_table",
"(",
"array",
"$",
"table",
",",
"$",
"valuekey",
"=",
"null",
",",
"$",
"labelkey",
"=",
"null",
",",
"$",
"groupkey",
"=",
"null",
")",
"{",
"$",
"optgroups",
"=",
"[",
"]",
";",
"$",
"options",
"=",
"[",
"]",
";",
... | Inserts values by interpreting tablular array as is typically the result
of a SQL call. If the table is nonstandard you can provide an idkey and
titlekey to help the function retrieve the correct values.
Typically defaults for idkey and title key are "id" and "title."
If groupkey is provided the method will insert op... | [
"Inserts",
"values",
"by",
"interpreting",
"tablular",
"array",
"as",
"is",
"typically",
"the",
"result",
"of",
"a",
"SQL",
"call",
".",
"If",
"the",
"table",
"is",
"nonstandard",
"you",
"can",
"provide",
"an",
"idkey",
"and",
"titlekey",
"to",
"help",
"th... | f4cbb926ef54da357b102cbfa4b6ce273be6ce63 | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Field/Select.php#L208-L231 |
196,168 | freialib/ran.tools | src/Field/Select.php | SelectField.associativeFrom | protected static function associativeFrom(array &$table, $key_ref = 'id', $value_ref = 'title') {
$assoc = [];
foreach ($table as $row) {
$assoc[$row[$key_ref]] = $row[$value_ref];
}
return $assoc;
} | php | protected static function associativeFrom(array &$table, $key_ref = 'id', $value_ref = 'title') {
$assoc = [];
foreach ($table as $row) {
$assoc[$row[$key_ref]] = $row[$value_ref];
}
return $assoc;
} | [
"protected",
"static",
"function",
"associativeFrom",
"(",
"array",
"&",
"$",
"table",
",",
"$",
"key_ref",
"=",
"'id'",
",",
"$",
"value_ref",
"=",
"'title'",
")",
"{",
"$",
"assoc",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"table",
"as",
"$",
"row"... | Given an array converts it to an associative array based on the key
and value reference provided.
@param array array
@param string key reference
@param string value reference
@return array | [
"Given",
"an",
"array",
"converts",
"it",
"to",
"an",
"associative",
"array",
"based",
"on",
"the",
"key",
"and",
"value",
"reference",
"provided",
"."
] | f4cbb926ef54da357b102cbfa4b6ce273be6ce63 | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Field/Select.php#L271-L277 |
196,169 | SlaxWeb/Router | src/Container.php | Container.add | public function add(Route $route): self
{
if ($route->uri === ""
|| $route->method === 0b0
|| $route->action === null) {
$this->logger->error("Route incomplete. Unable to add");
$this->logger->debug("Incomplete Route", [$route]);
throw new Exceptio... | php | public function add(Route $route): self
{
if ($route->uri === ""
|| $route->method === 0b0
|| $route->action === null) {
$this->logger->error("Route incomplete. Unable to add");
$this->logger->debug("Incomplete Route", [$route]);
throw new Exceptio... | [
"public",
"function",
"add",
"(",
"Route",
"$",
"route",
")",
":",
"self",
"{",
"if",
"(",
"$",
"route",
"->",
"uri",
"===",
"\"\"",
"||",
"$",
"route",
"->",
"method",
"===",
"0b0",
"||",
"$",
"route",
"->",
"action",
"===",
"null",
")",
"{",
"$... | Add Route definition
Add the retrieved Route to the internal Routes container array. If the
retrieved Route is not complete, throw the 'RouteIncompleteException'.
@param \SlaxWeb\Router\Route $route Route definition object
@return self | [
"Add",
"Route",
"definition"
] | b4a25655710638c71787a8498d267a663ef2e819 | https://github.com/SlaxWeb/Router/blob/b4a25655710638c71787a8498d267a663ef2e819/src/Container.php#L78-L126 |
196,170 | SlaxWeb/Router | src/Container.php | Container.iterateRoutes | protected function iterateRoutes(string $function)
{
if (($route = $function($this->routes)) !== false) {
$this->currentRoute = $route;
return $this->currentRoute;
}
return false;
} | php | protected function iterateRoutes(string $function)
{
if (($route = $function($this->routes)) !== false) {
$this->currentRoute = $route;
return $this->currentRoute;
}
return false;
} | [
"protected",
"function",
"iterateRoutes",
"(",
"string",
"$",
"function",
")",
"{",
"if",
"(",
"(",
"$",
"route",
"=",
"$",
"function",
"(",
"$",
"this",
"->",
"routes",
")",
")",
"!==",
"false",
")",
"{",
"$",
"this",
"->",
"currentRoute",
"=",
"$",... | Iterate internal Routes array
Provides a unified method for iterating the Routes array with PHP
functions, 'next', 'prev', 'current', and 'end'. Returns the Route on the
position that is desired, if no Route is found, false is returned.
@param string $function Function name for array iteration
@return \SlaxWeb\Router... | [
"Iterate",
"internal",
"Routes",
"array"
] | b4a25655710638c71787a8498d267a663ef2e819 | https://github.com/SlaxWeb/Router/blob/b4a25655710638c71787a8498d267a663ef2e819/src/Container.php#L210-L217 |
196,171 | ManifestWebDesign/dabl-orm | src/Model.php | Model.getColumnNames | static function getColumnNames() {
$class = get_called_class();
if (!isset(self::$_columnNames[$class])) {
self::$_columnNames[$class] = array_keys(static::$_columns);
}
return self::$_columnNames[$class];
} | php | static function getColumnNames() {
$class = get_called_class();
if (!isset(self::$_columnNames[$class])) {
self::$_columnNames[$class] = array_keys(static::$_columns);
}
return self::$_columnNames[$class];
} | [
"static",
"function",
"getColumnNames",
"(",
")",
"{",
"$",
"class",
"=",
"get_called_class",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"_columnNames",
"[",
"$",
"class",
"]",
")",
")",
"{",
"self",
"::",
"$",
"_columnNames",
"[... | Access to array of column names
@return array | [
"Access",
"to",
"array",
"of",
"column",
"names"
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L291-L298 |
196,172 | ManifestWebDesign/dabl-orm | src/Model.php | Model.getQuery | static function getQuery(array $params = array(), Query $q = null) {
$model_class = get_called_class();
$query_class = class_exists($model_class . 'Query') ? $model_class . 'Query' : 'Dabl\\Query\\Query';
$q = $q ? clone $q : new $query_class;
$tablename = $q->getTable();
if (!$tablename) {
$tablename = ... | php | static function getQuery(array $params = array(), Query $q = null) {
$model_class = get_called_class();
$query_class = class_exists($model_class . 'Query') ? $model_class . 'Query' : 'Dabl\\Query\\Query';
$q = $q ? clone $q : new $query_class;
$tablename = $q->getTable();
if (!$tablename) {
$tablename = ... | [
"static",
"function",
"getQuery",
"(",
"array",
"$",
"params",
"=",
"array",
"(",
")",
",",
"Query",
"$",
"q",
"=",
"null",
")",
"{",
"$",
"model_class",
"=",
"get_called_class",
"(",
")",
";",
"$",
"query_class",
"=",
"class_exists",
"(",
"$",
"model_... | Given an array of params, construct a query where the keys are used as column names
and values as query parameters. Will try to do fully-qualified names.
@return Query | [
"Given",
"an",
"array",
"of",
"params",
"construct",
"a",
"query",
"where",
"the",
"keys",
"are",
"used",
"as",
"column",
"names",
"and",
"values",
"as",
"query",
"parameters",
".",
"Will",
"try",
"to",
"do",
"fully",
"-",
"qualified",
"names",
"."
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L479-L521 |
196,173 | ManifestWebDesign/dabl-orm | src/Model.php | Model.retrieveFromPool | static function retrieveFromPool($pk_value) {
if (!static::$_poolEnabled || null === $pk_value) {
return null;
}
$pk_value = (string) $pk_value;
if (isset(static::$_instancePool[$pk_value])) {
return static::$_instancePool[$pk_value];
}
return null;
} | php | static function retrieveFromPool($pk_value) {
if (!static::$_poolEnabled || null === $pk_value) {
return null;
}
$pk_value = (string) $pk_value;
if (isset(static::$_instancePool[$pk_value])) {
return static::$_instancePool[$pk_value];
}
return null;
} | [
"static",
"function",
"retrieveFromPool",
"(",
"$",
"pk_value",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"$",
"_poolEnabled",
"||",
"null",
"===",
"$",
"pk_value",
")",
"{",
"return",
"null",
";",
"}",
"$",
"pk_value",
"=",
"(",
"string",
")",
"$",
... | Return the cached instance from the pool.
@param mixed $pk_value Primary Key
@return static | [
"Return",
"the",
"cached",
"instance",
"from",
"the",
"pool",
"."
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L555-L566 |
196,174 | ManifestWebDesign/dabl-orm | src/Model.php | Model.removeFromPool | static function removeFromPool($object_or_pk) {
$pool_key = $object_or_pk instanceof Model ? implode('-', $object_or_pk->getPrimaryKeyValues()) : $object_or_pk;
if (isset(static::$_instancePool[$pool_key])) {
unset(static::$_instancePool[$pool_key]);
--static::$_instancePoolCount;
}
} | php | static function removeFromPool($object_or_pk) {
$pool_key = $object_or_pk instanceof Model ? implode('-', $object_or_pk->getPrimaryKeyValues()) : $object_or_pk;
if (isset(static::$_instancePool[$pool_key])) {
unset(static::$_instancePool[$pool_key]);
--static::$_instancePoolCount;
}
} | [
"static",
"function",
"removeFromPool",
"(",
"$",
"object_or_pk",
")",
"{",
"$",
"pool_key",
"=",
"$",
"object_or_pk",
"instanceof",
"Model",
"?",
"implode",
"(",
"'-'",
",",
"$",
"object_or_pk",
"->",
"getPrimaryKeyValues",
"(",
")",
")",
":",
"$",
"object_... | Remove the object from the instance pool.
@param mixed $object_or_pk Object or PK to remove
@return void | [
"Remove",
"the",
"object",
"from",
"the",
"instance",
"pool",
"."
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L574-L581 |
196,175 | ManifestWebDesign/dabl-orm | src/Model.php | Model.doSelectRS | static function doSelectRS(Query $q = null) {
$q = $q ? clone $q : static::getQuery();
if (!$q->getTable()) {
$q->setTable(static::getTableName());
}
return $q->doSelect(static::getConnection());
} | php | static function doSelectRS(Query $q = null) {
$q = $q ? clone $q : static::getQuery();
if (!$q->getTable()) {
$q->setTable(static::getTableName());
}
return $q->doSelect(static::getConnection());
} | [
"static",
"function",
"doSelectRS",
"(",
"Query",
"$",
"q",
"=",
"null",
")",
"{",
"$",
"q",
"=",
"$",
"q",
"?",
"clone",
"$",
"q",
":",
"static",
"::",
"getQuery",
"(",
")",
";",
"if",
"(",
"!",
"$",
"q",
"->",
"getTable",
"(",
")",
")",
"{"... | Executes a select query and returns the PDO result
@return PDOStatement | [
"Executes",
"a",
"select",
"query",
"and",
"returns",
"the",
"PDO",
"result"
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L662-L670 |
196,176 | ManifestWebDesign/dabl-orm | src/Model.php | Model.doSelectIterator | static function doSelectIterator(Query $q = null) {
$q = $q ? clone $q : static::getQuery();
if (!$q->getTable()) {
$q->setTable(static::getTableName());
}
return new QueryModelIterator($q, get_called_class());
} | php | static function doSelectIterator(Query $q = null) {
$q = $q ? clone $q : static::getQuery();
if (!$q->getTable()) {
$q->setTable(static::getTableName());
}
return new QueryModelIterator($q, get_called_class());
} | [
"static",
"function",
"doSelectIterator",
"(",
"Query",
"$",
"q",
"=",
"null",
")",
"{",
"$",
"q",
"=",
"$",
"q",
"?",
"clone",
"$",
"q",
":",
"static",
"::",
"getQuery",
"(",
")",
";",
"if",
"(",
"!",
"$",
"q",
"->",
"getTable",
"(",
")",
")",... | Returns a simple Iterator that wraps PDOStatement for lightweight foreach
@param Query $q
@return QueryModelIterator | [
"Returns",
"a",
"simple",
"Iterator",
"that",
"wraps",
"PDOStatement",
"for",
"lightweight",
"foreach"
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L678-L686 |
196,177 | ManifestWebDesign/dabl-orm | src/Model.php | Model.hasPrimaryKeyValues | function hasPrimaryKeyValues() {
$pks = static::$_primaryKeys;
if (!$pks)
return false;
foreach ($pks as &$pk)
if ($this->$pk === null)
return false;
return true;
} | php | function hasPrimaryKeyValues() {
$pks = static::$_primaryKeys;
if (!$pks)
return false;
foreach ($pks as &$pk)
if ($this->$pk === null)
return false;
return true;
} | [
"function",
"hasPrimaryKeyValues",
"(",
")",
"{",
"$",
"pks",
"=",
"static",
"::",
"$",
"_primaryKeys",
";",
"if",
"(",
"!",
"$",
"pks",
")",
"return",
"false",
";",
"foreach",
"(",
"$",
"pks",
"as",
"&",
"$",
"pk",
")",
"if",
"(",
"$",
"this",
"... | Returns true if this table has primary keys and if all of the primary values are not null
@return bool | [
"Returns",
"true",
"if",
"this",
"table",
"has",
"primary",
"keys",
"and",
"if",
"all",
"of",
"the",
"primary",
"values",
"are",
"not",
"null"
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L1169-L1178 |
196,178 | ManifestWebDesign/dabl-orm | src/Model.php | Model.getPrimaryKeyValues | function getPrimaryKeyValues() {
$arr = array();
$pks = static::$_primaryKeys;
foreach ($pks as &$pk) {
$arr[] = $this->{"get$pk"}();
}
return $arr;
} | php | function getPrimaryKeyValues() {
$arr = array();
$pks = static::$_primaryKeys;
foreach ($pks as &$pk) {
$arr[] = $this->{"get$pk"}();
}
return $arr;
} | [
"function",
"getPrimaryKeyValues",
"(",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
")",
";",
"$",
"pks",
"=",
"static",
"::",
"$",
"_primaryKeys",
";",
"foreach",
"(",
"$",
"pks",
"as",
"&",
"$",
"pk",
")",
"{",
"$",
"arr",
"[",
"]",
"=",
"$",
"t... | Returns an array of all primary key values.
@return mixed[] | [
"Returns",
"an",
"array",
"of",
"all",
"primary",
"key",
"values",
"."
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L1185-L1194 |
196,179 | ManifestWebDesign/dabl-orm | src/Model.php | Model.castInts | function castInts() {
foreach (static::$_columns as $column_name => &$type) {
if ($this->{$column_name} === null || !static::isIntegerType($type)) {
continue;
}
if ('' === $this->{$column_name}) {
$this->{$column_name} = null;
continue;
}
$this->{$column_name} = (int) $this->{$column_name};... | php | function castInts() {
foreach (static::$_columns as $column_name => &$type) {
if ($this->{$column_name} === null || !static::isIntegerType($type)) {
continue;
}
if ('' === $this->{$column_name}) {
$this->{$column_name} = null;
continue;
}
$this->{$column_name} = (int) $this->{$column_name};... | [
"function",
"castInts",
"(",
")",
"{",
"foreach",
"(",
"static",
"::",
"$",
"_columns",
"as",
"$",
"column_name",
"=>",
"&",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"{",
"$",
"column_name",
"}",
"===",
"null",
"||",
"!",
"static",
"::"... | Cast returned values from the database into integers where appropriate.
@return static | [
"Cast",
"returned",
"values",
"from",
"the",
"database",
"into",
"integers",
"where",
"appropriate",
"."
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L1337-L1349 |
196,180 | ManifestWebDesign/dabl-orm | src/Model.php | Model.insert | protected function insert() {
$conn = static::getConnection();
$pk = static::getPrimaryKey();
$fields = array();
$values = array();
$placeholders = array();
foreach (static::$_columns as $column_name => &$type) {
$value = $this->$column_name;
if ($value === null && !$this->isColumnModified($column_na... | php | protected function insert() {
$conn = static::getConnection();
$pk = static::getPrimaryKey();
$fields = array();
$values = array();
$placeholders = array();
foreach (static::$_columns as $column_name => &$type) {
$value = $this->$column_name;
if ($value === null && !$this->isColumnModified($column_na... | [
"protected",
"function",
"insert",
"(",
")",
"{",
"$",
"conn",
"=",
"static",
"::",
"getConnection",
"(",
")",
";",
"$",
"pk",
"=",
"static",
"::",
"getPrimaryKey",
"(",
")",
";",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"values",
"=",
"arr... | Creates and executes INSERT query string for this object
@return int | [
"Creates",
"and",
"executes",
"INSERT",
"query",
"string",
"for",
"this",
"object"
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L1355-L1412 |
196,181 | ManifestWebDesign/dabl-orm | src/Model.php | Model.update | protected function update() {
if (!static::$_primaryKeys) {
throw new RuntimeException('This table has no primary keys');
}
$column_values = array();
foreach ($this->getModifiedColumns() as $column) {
$column_values[$column] = $this->$column;
}
// If array is empty there is nothing to update
if (e... | php | protected function update() {
if (!static::$_primaryKeys) {
throw new RuntimeException('This table has no primary keys');
}
$column_values = array();
foreach ($this->getModifiedColumns() as $column) {
$column_values[$column] = $this->$column;
}
// If array is empty there is nothing to update
if (e... | [
"protected",
"function",
"update",
"(",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"$",
"_primaryKeys",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"'This table has no primary keys'",
")",
";",
"}",
"$",
"column_values",
"=",
"array",
"(",
")",
";",
... | Creates and executes UPDATE query string for this object. Returns
the number of affected rows.
@return Int | [
"Creates",
"and",
"executes",
"UPDATE",
"query",
"string",
"for",
"this",
"object",
".",
"Returns",
"the",
"number",
"of",
"affected",
"rows",
"."
] | f216513e4b16251db7901c1773d00e13e3a49421 | https://github.com/ManifestWebDesign/dabl-orm/blob/f216513e4b16251db7901c1773d00e13e3a49421/src/Model.php#L1419-L1446 |
196,182 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.move | public function move($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s... | php | public function move($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s... | [
"public",
"function",
"move",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"directory",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
... | Moves the current file to given directory
@param string $directory
@return sFire\System\File | [
"Moves",
"the",
"current",
"file",
"to",
"given",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L100-L129 |
196,183 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.delete | public function delete() {
if(false !== $this -> file -> getExists()) {
if(unlink($this -> file -> getBasepath())) {
$this -> refresh();
}
}
return $this;
} | php | public function delete() {
if(false !== $this -> file -> getExists()) {
if(unlink($this -> file -> getBasepath())) {
$this -> refresh();
}
}
return $this;
} | [
"public",
"function",
"delete",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"if",
"(",
"unlink",
"(",
"$",
"this",
"->",
"file",
"->",
"getBasepath",
"(",
")",
")",
")",
"{",
"$",
... | Deletes current file
@return sFire\System\File | [
"Deletes",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L136-L146 |
196,184 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.touch | public function touch($time = null, $accesstime = null) {
if(null !== $time && false === ('-' . intval($time) == '-' . $time)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($time)), E_USER_ERROR);
}
if(null !== $accesstime && fal... | php | public function touch($time = null, $accesstime = null) {
if(null !== $time && false === ('-' . intval($time) == '-' . $time)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($time)), E_USER_ERROR);
}
if(null !== $accesstime && fal... | [
"public",
"function",
"touch",
"(",
"$",
"time",
"=",
"null",
",",
"$",
"accesstime",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"time",
"&&",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"time",
")",
"==",
"'-'",
".",
"$",
"... | Sets access and modification time of file. If the file does not exist, it will be created
@param int $time
@param accesstime $time
@return sFire\System\File | [
"Sets",
"access",
"and",
"modification",
"time",
"of",
"file",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"it",
"will",
"be",
"created"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L155-L170 |
196,185 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.copy | public function copy($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s... | php | public function copy($directory) {
if(false === is_string($directory)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($directory)), E_USER_ERROR);
}
if(false === is_dir($directory)) {
return trigger_error(sprintf('Directory "%s... | [
"public",
"function",
"copy",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"directory",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
... | Makes a copy of the file to the destination directory
@param string $directory
@return sFire\System\File | [
"Makes",
"a",
"copy",
"of",
"the",
"file",
"to",
"the",
"destination",
"directory"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L195-L218 |
196,186 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.rename | public function rename($name) {
if(false === is_string($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
if(rename($this -> file -> getBasepath(),... | php | public function rename($name) {
if(false === is_string($name)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
if(rename($this -> file -> getBasepath(),... | [
"public",
"function",
"rename",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"name",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__MET... | Attempts to rename oldname to newname. If newname exists, it will be overwritten
@param string $name
@return sFire\System\File | [
"Attempts",
"to",
"rename",
"oldname",
"to",
"newname",
".",
"If",
"newname",
"exists",
"it",
"will",
"be",
"overwritten"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L226-L251 |
196,187 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.getContent | public function getContent() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
if(false === $this -> file -> getReadable()) {
trigger_error(sprintf('File "%s" is not readable', $this -> file -> getBasepath()), E_USER_ERROR);
}
return file_get_contents($this -> file ->... | php | public function getContent() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
if(false === $this -> file -> getReadable()) {
trigger_error(sprintf('File "%s" is not readable', $this -> file -> getBasepath()), E_USER_ERROR);
}
return file_get_contents($this -> file ->... | [
"public",
"function",
"getContent",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"file",
"->... | Returns the content of current file
@return string | [
"Returns",
"the",
"content",
"of",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L258-L270 |
196,188 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.append | public function append($data) {
if(false === is_string($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
if(false === is_writable($this -> file ->... | php | public function append($data) {
if(false === is_string($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
if(false === is_writable($this -> file ->... | [
"public",
"function",
"append",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"data",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__MET... | Appends data to current file
@param string $data
@return sFire\System\File | [
"Appends",
"data",
"to",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L278-L297 |
196,189 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.prepend | public function prepend($data) {
if(false === is_string($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
$this -> refresh();
if(false === $... | php | public function prepend($data) {
if(false === is_string($data)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
$this -> refresh();
if(false === $... | [
"public",
"function",
"prepend",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"false",
"===",
"is_string",
"(",
"$",
"data",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'",
",",
"__ME... | Prepends data to current file
@param string $data
@return sFire\System\File | [
"Prepends",
"data",
"to",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L305-L342 |
196,190 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.flush | public function flush() {
if(false !== $this -> file -> getExists()) {
if(false === is_writable($this -> file -> getBasepath())) {
return trigger_error(sprintf('File "%s" passed to %s() is not writable', $this -> file -> getBasepath(), __METHOD__), E_USER_ERROR);
}
$fh = fopen($this -> file... | php | public function flush() {
if(false !== $this -> file -> getExists()) {
if(false === is_writable($this -> file -> getBasepath())) {
return trigger_error(sprintf('File "%s" passed to %s() is not writable', $this -> file -> getBasepath(), __METHOD__), E_USER_ERROR);
}
$fh = fopen($this -> file... | [
"public",
"function",
"flush",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"if",
"(",
"false",
"===",
"is_writable",
"(",
"$",
"this",
"->",
"file",
"->",
"getBasepath",
"(",
")",
")",... | Empty the current file content
@return sFire\System\File | [
"Empty",
"the",
"current",
"file",
"content"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L360-L383 |
196,191 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.chmod | public function chmod($type) {
if(null !== $type && false === ('-' . intval($type) == '-' . $type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
return... | php | public function chmod($type) {
if(null !== $type && false === ('-' . intval($type) == '-' . $type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
if(false !== $this -> file -> getExists()) {
return... | [
"public",
"function",
"chmod",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"type",
"&&",
"false",
"===",
"(",
"'-'",
".",
"intval",
"(",
"$",
"type",
")",
"==",
"'-'",
".",
"$",
"type",
")",
")",
"{",
"return",
"trigger_error",
"("... | Changes current file mode
@param int $type
@return boolean | [
"Changes",
"current",
"file",
"mode"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L391-L402 |
196,192 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.getAccessTime | public function getAccessTime() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getAccessTime();
}
} | php | public function getAccessTime() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getAccessTime();
}
} | [
"public",
"function",
"getAccessTime",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"file",
"->",
"getAccessTime"... | Returns the access time of current file
@return int | [
"Returns",
"the",
"access",
"time",
"of",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L424-L432 |
196,193 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.getGroup | public function getGroup() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getGroup();
}
} | php | public function getGroup() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getGroup();
}
} | [
"public",
"function",
"getGroup",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"file",
"->",
"getGroup",
"(",
... | Returns group name of current file
@return string | [
"Returns",
"group",
"name",
"of",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L439-L447 |
196,194 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.getModificationTime | public function getModificationTime() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getModificationTime();
}
} | php | public function getModificationTime() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getModificationTime();
}
} | [
"public",
"function",
"getModificationTime",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"file",
"->",
"getModif... | Returns the modification time of current file
@return int | [
"Returns",
"the",
"modification",
"time",
"of",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L454-L462 |
196,195 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.getOwner | public function getOwner() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getOwner();
}
} | php | public function getOwner() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getOwner();
}
} | [
"public",
"function",
"getOwner",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"file",
"->",
"getOwner",
"(",
... | Returns the owner of current file
@return string | [
"Returns",
"the",
"owner",
"of",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L469-L477 |
196,196 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.isReadable | public function isReadable() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getReadable();
}
return false;
} | php | public function isReadable() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getReadable();
}
return false;
} | [
"public",
"function",
"isReadable",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"file",
"->",
"getReadable",
"... | Returns if the current file is readable
@return boolean | [
"Returns",
"if",
"the",
"current",
"file",
"is",
"readable"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L508-L518 |
196,197 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.isWritable | public function isWritable() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getWritable();
}
return false;
} | php | public function isWritable() {
if(false !== $this -> file -> getExists()) {
$this -> refresh();
return $this -> file -> getWritable();
}
return false;
} | [
"public",
"function",
"isWritable",
"(",
")",
"{",
"if",
"(",
"false",
"!==",
"$",
"this",
"->",
"file",
"->",
"getExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"refresh",
"(",
")",
";",
"return",
"$",
"this",
"->",
"file",
"->",
"getWritable",
"... | Returns if the current file is writable
@return boolean | [
"Returns",
"if",
"the",
"current",
"file",
"is",
"writable"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L525-L535 |
196,198 | Kris-Kuiper/sFire-Framework | src/System/File.php | File.getMime | public function getMime() {
if(null === $this -> mime) {
$this -> mime = new Mime();
}
return Mime :: get($this -> file -> getExtension());
} | php | public function getMime() {
if(null === $this -> mime) {
$this -> mime = new Mime();
}
return Mime :: get($this -> file -> getExtension());
} | [
"public",
"function",
"getMime",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"mime",
")",
"{",
"$",
"this",
"->",
"mime",
"=",
"new",
"Mime",
"(",
")",
";",
"}",
"return",
"Mime",
"::",
"get",
"(",
"$",
"this",
"->",
"file",
"->... | Returns mime type of current file
@return string | [
"Returns",
"mime",
"type",
"of",
"current",
"file"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/System/File.php#L542-L549 |
196,199 | modulusphp/request | Headers.php | Headers.has | public function has(string $name) : bool
{
if (isset($this->all[$name])) return true;
return false;
} | php | public function has(string $name) : bool
{
if (isset($this->all[$name])) return true;
return false;
} | [
"public",
"function",
"has",
"(",
"string",
"$",
"name",
")",
":",
"bool",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"all",
"[",
"$",
"name",
"]",
")",
")",
"return",
"true",
";",
"return",
"false",
";",
"}"
] | Check if header is present
@param string $name
@return bool | [
"Check",
"if",
"header",
"is",
"present"
] | 9328d81e71994e2944636ad5aed70f7a32f3fb87 | https://github.com/modulusphp/request/blob/9328d81e71994e2944636ad5aed70f7a32f3fb87/Headers.php#L19-L23 |
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.