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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
9,100 | RhubarbPHP/Module.Patterns | src/Mvp/BoilerPlates/Login/LoginPresenter.php | LoginPresenter.beforeRenderView | protected function beforeRenderView()
{
$login = $this->getLoginProvider();
if (isset($_GET["logout"])) {
$login->logOut();
}
if ( $login->isLoggedIn() ){
$this->onSuccess();
}
} | php | protected function beforeRenderView()
{
$login = $this->getLoginProvider();
if (isset($_GET["logout"])) {
$login->logOut();
}
if ( $login->isLoggedIn() ){
$this->onSuccess();
}
} | [
"protected",
"function",
"beforeRenderView",
"(",
")",
"{",
"$",
"login",
"=",
"$",
"this",
"->",
"getLoginProvider",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"_GET",
"[",
"\"logout\"",
"]",
")",
")",
"{",
"$",
"login",
"->",
"logOut",
"(",
")",
... | Called just before the view is rendered.
Guaranteed to only be called once during a normal page execution. | [
"Called",
"just",
"before",
"the",
"view",
"is",
"rendered",
"."
] | 118b13b44bce7d35cb8aaa09135c47836098831f | https://github.com/RhubarbPHP/Module.Patterns/blob/118b13b44bce7d35cb8aaa09135c47836098831f/src/Mvp/BoilerPlates/Login/LoginPresenter.php#L106-L117 |
9,101 | Ara95/user | src/Admin/HTMLForm/DeleteAdminForm.php | DeleteAdminForm.getUserDetails | public function getUserDetails($id)
{
$user = new User();
$user->setDb($this->di->get("db"));
$user->find("id", $id);
return $user;
} | php | public function getUserDetails($id)
{
$user = new User();
$user->setDb($this->di->get("db"));
$user->find("id", $id);
return $user;
} | [
"public",
"function",
"getUserDetails",
"(",
"$",
"id",
")",
"{",
"$",
"user",
"=",
"new",
"User",
"(",
")",
";",
"$",
"user",
"->",
"setDb",
"(",
"$",
"this",
"->",
"di",
"->",
"get",
"(",
"\"db\"",
")",
")",
";",
"$",
"user",
"->",
"find",
"(... | Get user details to load form with.
@param string $id get details on item with id.
@return object User details. | [
"Get",
"user",
"details",
"to",
"load",
"form",
"with",
"."
] | 96e15a19906562a689abedf6bcf4818ad8437a3b | https://github.com/Ara95/user/blob/96e15a19906562a689abedf6bcf4818ad8437a3b/src/Admin/HTMLForm/DeleteAdminForm.php#L66-L72 |
9,102 | deasilworks/cms | src/CEF/Domain/Manager/ContentDomainManager.php | ContentDomainManager.getWelcome | public function getWelcome()
{
$stub = $this->getCfgValue('demo.pages.welcome', 'welcome');
$this->getLogger()->addInfo('Got stub: '.$stub);
/** @var PageDataManager $pageMgr */
$pageMgr = $this->getDataManager(PageDataManager::class);
return $pageMgr->getPage($stub)->getTi... | php | public function getWelcome()
{
$stub = $this->getCfgValue('demo.pages.welcome', 'welcome');
$this->getLogger()->addInfo('Got stub: '.$stub);
/** @var PageDataManager $pageMgr */
$pageMgr = $this->getDataManager(PageDataManager::class);
return $pageMgr->getPage($stub)->getTi... | [
"public",
"function",
"getWelcome",
"(",
")",
"{",
"$",
"stub",
"=",
"$",
"this",
"->",
"getCfgValue",
"(",
"'demo.pages.welcome'",
",",
"'welcome'",
")",
";",
"$",
"this",
"->",
"getLogger",
"(",
")",
"->",
"addInfo",
"(",
"'Got stub: '",
".",
"$",
"stu... | Get Welcome.
@ApiAction()
@return string | [
"Get",
"Welcome",
"."
] | 759d05a4e79656b62ff26ea55834f64c61fd1fd4 | https://github.com/deasilworks/cms/blob/759d05a4e79656b62ff26ea55834f64c61fd1fd4/src/CEF/Domain/Manager/ContentDomainManager.php#L47-L56 |
9,103 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.flash | public static function flash( $name = '', $message = '', $class = 'success fadeout-message' )
{
//We can only do something if the name isn't empty
if( !empty( $name ) )
{
//No message, create it
if( !empty( $message ) && empty( $_SESSION[$name] ) )
... | php | public static function flash( $name = '', $message = '', $class = 'success fadeout-message' )
{
//We can only do something if the name isn't empty
if( !empty( $name ) )
{
//No message, create it
if( !empty( $message ) && empty( $_SESSION[$name] ) )
... | [
"public",
"static",
"function",
"flash",
"(",
"$",
"name",
"=",
"''",
",",
"$",
"message",
"=",
"''",
",",
"$",
"class",
"=",
"'success fadeout-message'",
")",
"{",
"//We can only do something if the name isn't empty\r",
"if",
"(",
"!",
"empty",
"(",
"$",
"nam... | Function to create and display error and success messages
@access public
@param string session name
@param string message
@param string display class
@return string message | [
"Function",
"to",
"create",
"and",
"display",
"error",
"and",
"success",
"messages"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L52-L82 |
9,104 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.decimalToAlphanumeric | public static function decimalToAlphanumeric($number, $base = 64, $index = false)
{
if (!$base) {
$base = strlen($index);
} elseif (!$index) {
$index = substr("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, $base);
}
$out = "";
... | php | public static function decimalToAlphanumeric($number, $base = 64, $index = false)
{
if (!$base) {
$base = strlen($index);
} elseif (!$index) {
$index = substr("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, $base);
}
$out = "";
... | [
"public",
"static",
"function",
"decimalToAlphanumeric",
"(",
"$",
"number",
",",
"$",
"base",
"=",
"64",
",",
"$",
"index",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"base",
")",
"{",
"$",
"base",
"=",
"strlen",
"(",
"$",
"index",
")",
";",
"... | Decimal To Alphanumeric
@param Integer
@param Integer
@param Boolean
@return String | [
"Decimal",
"To",
"Alphanumeric"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L256-L272 |
9,105 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.dateRangeArray | public static function dateRangeArray($strDateFrom, $strDateTo, $dateFormat = 'Y-m-d')
{
//Mengambil nilai tanggal dari dua tanggal dengan format YYYY-MM-DD
$arrayRange = array();
$t1 = $this->splitDate($strDateFrom, 'int');
$t2 = $this->splitDate($strDateTo, 'i... | php | public static function dateRangeArray($strDateFrom, $strDateTo, $dateFormat = 'Y-m-d')
{
//Mengambil nilai tanggal dari dua tanggal dengan format YYYY-MM-DD
$arrayRange = array();
$t1 = $this->splitDate($strDateFrom, 'int');
$t2 = $this->splitDate($strDateTo, 'i... | [
"public",
"static",
"function",
"dateRangeArray",
"(",
"$",
"strDateFrom",
",",
"$",
"strDateTo",
",",
"$",
"dateFormat",
"=",
"'Y-m-d'",
")",
"{",
"//Mengambil nilai tanggal dari dua tanggal dengan format YYYY-MM-DD\r",
"$",
"arrayRange",
"=",
"array",
"(",
")",
";",... | Date Range Array
@param Date
@param Date
@param string
@return Array | [
"Date",
"Range",
"Array"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L579-L599 |
9,106 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.dateToSQL | public static function dateToSQL($tahun, $bulan, $tanggal, $minTahun = "", $maxTahun = "")
{
$tahun = (int)$tahun;
$bulan = (int)$bulan;
$tanggal = (int)$tanggal;
if ($tanggal <= 0 || $tanggal > 31) {
$tanggalX = "01";
} else if ($tanggal < 10) {
... | php | public static function dateToSQL($tahun, $bulan, $tanggal, $minTahun = "", $maxTahun = "")
{
$tahun = (int)$tahun;
$bulan = (int)$bulan;
$tanggal = (int)$tanggal;
if ($tanggal <= 0 || $tanggal > 31) {
$tanggalX = "01";
} else if ($tanggal < 10) {
... | [
"public",
"static",
"function",
"dateToSQL",
"(",
"$",
"tahun",
",",
"$",
"bulan",
",",
"$",
"tanggal",
",",
"$",
"minTahun",
"=",
"\"\"",
",",
"$",
"maxTahun",
"=",
"\"\"",
")",
"{",
"$",
"tahun",
"=",
"(",
"int",
")",
"$",
"tahun",
";",
"$",
"b... | Date To SQL
@param Date - Year
@param Date - Month
@param Date - Day
@param Date - Year
@param Date - Year
@return DateSQL | [
"Date",
"To",
"SQL"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L630-L673 |
9,107 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.displayDateTime | public static function displayDateTime($date)
{
$namaBulan = $this->monthList();
$dateInt = $this->splitDate($date);
$dateString = $this->splitDate($date, 'string');
return $namaBulan[$dateInt['month']] . ' ' . $dateInt['date'] . ', ' . $dateInt['year'] . ' ' . $dateString... | php | public static function displayDateTime($date)
{
$namaBulan = $this->monthList();
$dateInt = $this->splitDate($date);
$dateString = $this->splitDate($date, 'string');
return $namaBulan[$dateInt['month']] . ' ' . $dateInt['date'] . ', ' . $dateInt['year'] . ' ' . $dateString... | [
"public",
"static",
"function",
"displayDateTime",
"(",
"$",
"date",
")",
"{",
"$",
"namaBulan",
"=",
"$",
"this",
"->",
"monthList",
"(",
")",
";",
"$",
"dateInt",
"=",
"$",
"this",
"->",
"splitDate",
"(",
"$",
"date",
")",
";",
"$",
"dateString",
"... | Display Date Time
@param Date
@return String | [
"Display",
"Date",
"Time"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L693-L700 |
9,108 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.validDateForm | public static function validDateForm($date)
{
$isOK = true;
if (preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $date)) {
list($d, $m, $y) = explode("/", $date);
$month = (int)$m;
$day = (int)$d;
$year = (int)$y;
if (!ch... | php | public static function validDateForm($date)
{
$isOK = true;
if (preg_match("/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/", $date)) {
list($d, $m, $y) = explode("/", $date);
$month = (int)$m;
$day = (int)$d;
$year = (int)$y;
if (!ch... | [
"public",
"static",
"function",
"validDateForm",
"(",
"$",
"date",
")",
"{",
"$",
"isOK",
"=",
"true",
";",
"if",
"(",
"preg_match",
"(",
"\"/([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{2,4})/\"",
",",
"$",
"date",
")",
")",
"{",
"list",
"(",
"$",
"d",
",",
"$",
... | Validate Date Form
@param Date
@return Date | [
"Validate",
"Date",
"Form"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L833-L852 |
9,109 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.dateFormToSQL | public static function dateFormToSQL($date)
{
list($d, $m, $y) = @explode("/", $date);
$month = (int)$m;
$day = (int)$d;
$year = (int)$y;
if (checkdate($month, $day, $year)) {
if ($day < 10) {
$day = '0' . $day;
}
... | php | public static function dateFormToSQL($date)
{
list($d, $m, $y) = @explode("/", $date);
$month = (int)$m;
$day = (int)$d;
$year = (int)$y;
if (checkdate($month, $day, $year)) {
if ($day < 10) {
$day = '0' . $day;
}
... | [
"public",
"static",
"function",
"dateFormToSQL",
"(",
"$",
"date",
")",
"{",
"list",
"(",
"$",
"d",
",",
"$",
"m",
",",
"$",
"y",
")",
"=",
"@",
"explode",
"(",
"\"/\"",
",",
"$",
"date",
")",
";",
"$",
"month",
"=",
"(",
"int",
")",
"$",
"m"... | Date Form To SQL
@param Date
@return DateSQL | [
"Date",
"Form",
"To",
"SQL"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L881-L899 |
9,110 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.dateSQLToForm | public static function dateSQLToForm($date)
{
//if (!empty($date) && $date != "0000-00-00" && $date != "0000-00-00 00:00:00"){
if ($this->isDateSQL($date)) {
$arr = explode('-', $date);
$thn = (int)$arr[0];
$bln = (int)$arr[1];
$tgl = (int)$arr[... | php | public static function dateSQLToForm($date)
{
//if (!empty($date) && $date != "0000-00-00" && $date != "0000-00-00 00:00:00"){
if ($this->isDateSQL($date)) {
$arr = explode('-', $date);
$thn = (int)$arr[0];
$bln = (int)$arr[1];
$tgl = (int)$arr[... | [
"public",
"static",
"function",
"dateSQLToForm",
"(",
"$",
"date",
")",
"{",
"//if (!empty($date) && $date != \"0000-00-00\" && $date != \"0000-00-00 00:00:00\"){\r",
"if",
"(",
"$",
"this",
"->",
"isDateSQL",
"(",
"$",
"date",
")",
")",
"{",
"$",
"arr",
"=",
"explo... | SQL Date To Date Form
@param Date
@return Date | [
"SQL",
"Date",
"To",
"Date",
"Form"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L906-L925 |
9,111 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.dateRangeInWeek | public static function dateRangeInWeek($week = 0, $year = 0)
{
/*
Fungsi ini untuk mendapatkan nilai tanggal berapa saja dalam minggu tertentu
Tanggal dimulai pada hari senin pada minggu tersebut.
returned type: array
*/
$year = (int)$year;
$wee... | php | public static function dateRangeInWeek($week = 0, $year = 0)
{
/*
Fungsi ini untuk mendapatkan nilai tanggal berapa saja dalam minggu tertentu
Tanggal dimulai pada hari senin pada minggu tersebut.
returned type: array
*/
$year = (int)$year;
$wee... | [
"public",
"static",
"function",
"dateRangeInWeek",
"(",
"$",
"week",
"=",
"0",
",",
"$",
"year",
"=",
"0",
")",
"{",
"/*\r\n Fungsi ini untuk mendapatkan nilai tanggal berapa saja dalam minggu tertentu\r\n Tanggal dimulai pada hari senin pada minggu tersebut.\r\n ... | Date Range In Week
@param integer
@param integer
@return Array | [
"Date",
"Range",
"In",
"Week"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L987-L1027 |
9,112 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.weekRangeInMonth | public static function weekRangeInMonth($month, $year)
{
$year = (int)$year;
$month = (int)$month;
if ($year < 1970) { // minimal unix time year 1970
$month = date("n");
$year = date("Y");
}
if ($month <= 0 || $month > 12) {
$mon... | php | public static function weekRangeInMonth($month, $year)
{
$year = (int)$year;
$month = (int)$month;
if ($year < 1970) { // minimal unix time year 1970
$month = date("n");
$year = date("Y");
}
if ($month <= 0 || $month > 12) {
$mon... | [
"public",
"static",
"function",
"weekRangeInMonth",
"(",
"$",
"month",
",",
"$",
"year",
")",
"{",
"$",
"year",
"=",
"(",
"int",
")",
"$",
"year",
";",
"$",
"month",
"=",
"(",
"int",
")",
"$",
"month",
";",
"if",
"(",
"$",
"year",
"<",
"1970",
... | Week Range In Month
@param Date - Month
@param Date - Year
@return Array | [
"Week",
"Range",
"In",
"Month"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1035-L1074 |
9,113 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.getDateSQLToForm | public static function getDateSQLToForm($datetime)
{
//YYYY-mm-dd
$t = $this->splitDate($datetime, false);
return $t['date'] . '/' . $t['month'] . '/' . $t['year'];
} | php | public static function getDateSQLToForm($datetime)
{
//YYYY-mm-dd
$t = $this->splitDate($datetime, false);
return $t['date'] . '/' . $t['month'] . '/' . $t['year'];
} | [
"public",
"static",
"function",
"getDateSQLToForm",
"(",
"$",
"datetime",
")",
"{",
"//YYYY-mm-dd\r",
"$",
"t",
"=",
"$",
"this",
"->",
"splitDate",
"(",
"$",
"datetime",
",",
"false",
")",
";",
"return",
"$",
"t",
"[",
"'date'",
"]",
".",
"'/'",
".",
... | Date SQL to Form
@param DateTime
@return String | [
"Date",
"SQL",
"to",
"Form"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1176-L1182 |
9,114 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.timeToSec | public static function timeToSec($time)
{
// hh:mm:ss
$split_time = explode(':', $time);
$hour = $split_time[0] * 3600;
$minutes = $split_time[1] * 60;
$second = $split_time[2] * 1;
$timetosec = (int)($hour + $minutes + $second);
retur... | php | public static function timeToSec($time)
{
// hh:mm:ss
$split_time = explode(':', $time);
$hour = $split_time[0] * 3600;
$minutes = $split_time[1] * 60;
$second = $split_time[2] * 1;
$timetosec = (int)($hour + $minutes + $second);
retur... | [
"public",
"static",
"function",
"timeToSec",
"(",
"$",
"time",
")",
"{",
"// hh:mm:ss\r",
"$",
"split_time",
"=",
"explode",
"(",
"':'",
",",
"$",
"time",
")",
";",
"$",
"hour",
"=",
"$",
"split_time",
"[",
"0",
"]",
"*",
"3600",
";",
"$",
"minutes",... | Time To Sec
@param Time
@return String | [
"Time",
"To",
"Sec"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1189-L1200 |
9,115 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.secToTime | public static function secToTime($sec)
{
// int sec
$hour = (int)floor($sec / 3600);
$minutes = (int)floor(($sec % 3600) / 60);
$second = (int)$sec - (($hour * 3600) + ($minutes * 60));
if ($hour <= 9) {
$hour = '0' . $hour;
}
if ($m... | php | public static function secToTime($sec)
{
// int sec
$hour = (int)floor($sec / 3600);
$minutes = (int)floor(($sec % 3600) / 60);
$second = (int)$sec - (($hour * 3600) + ($minutes * 60));
if ($hour <= 9) {
$hour = '0' . $hour;
}
if ($m... | [
"public",
"static",
"function",
"secToTime",
"(",
"$",
"sec",
")",
"{",
"// int sec\r",
"$",
"hour",
"=",
"(",
"int",
")",
"floor",
"(",
"$",
"sec",
"/",
"3600",
")",
";",
"$",
"minutes",
"=",
"(",
"int",
")",
"floor",
"(",
"(",
"$",
"sec",
"%",
... | Sec to Time
@param Sec
@return Time | [
"Sec",
"to",
"Time"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1207-L1225 |
9,116 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.timeToInt | public static function timeToInt($time)
{
$timeHour = substr($time, 0, 2);
if (substr($time, 0, 1) == '0') {
$timeHour = substr($time, 1, 1);
}
$timeMin = substr($time, 3, 5);
$timeHourMin = ((int)$timeHour * 60) + ((int)$timeMin / 1);
$values ... | php | public static function timeToInt($time)
{
$timeHour = substr($time, 0, 2);
if (substr($time, 0, 1) == '0') {
$timeHour = substr($time, 1, 1);
}
$timeMin = substr($time, 3, 5);
$timeHourMin = ((int)$timeHour * 60) + ((int)$timeMin / 1);
$values ... | [
"public",
"static",
"function",
"timeToInt",
"(",
"$",
"time",
")",
"{",
"$",
"timeHour",
"=",
"substr",
"(",
"$",
"time",
",",
"0",
",",
"2",
")",
";",
"if",
"(",
"substr",
"(",
"$",
"time",
",",
"0",
",",
"1",
")",
"==",
"'0'",
")",
"{",
"$... | Time to Integer
@param Time
@return Integer | [
"Time",
"to",
"Integer"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1232-L1243 |
9,117 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.timeToText | public static function timeToText($time)
{
$timeHour = ceil($time * 60);
$modMinutes = $timeHour % 60;
$hour = floor($time);
return $hour . ' h ' . $modMinutes . ' m';
} | php | public static function timeToText($time)
{
$timeHour = ceil($time * 60);
$modMinutes = $timeHour % 60;
$hour = floor($time);
return $hour . ' h ' . $modMinutes . ' m';
} | [
"public",
"static",
"function",
"timeToText",
"(",
"$",
"time",
")",
"{",
"$",
"timeHour",
"=",
"ceil",
"(",
"$",
"time",
"*",
"60",
")",
";",
"$",
"modMinutes",
"=",
"$",
"timeHour",
"%",
"60",
";",
"$",
"hour",
"=",
"floor",
"(",
"$",
"time",
"... | Time To Text
@param Time
@return String | [
"Time",
"To",
"Text"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1250-L1257 |
9,118 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.countMonthBetweenDate | public static function countMonthBetweenDate($startDate, $endDate)
{
$d1 = strtotime($startDate);
$d2 = strtotime($endDate);
$min_date = min($d1, $d2);
$max_date = max($d1, $d2);
$i = 0;
while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
$i++;
}
echo $i;
... | php | public static function countMonthBetweenDate($startDate, $endDate)
{
$d1 = strtotime($startDate);
$d2 = strtotime($endDate);
$min_date = min($d1, $d2);
$max_date = max($d1, $d2);
$i = 0;
while (($min_date = strtotime("+1 MONTH", $min_date)) <= $max_date) {
$i++;
}
echo $i;
... | [
"public",
"static",
"function",
"countMonthBetweenDate",
"(",
"$",
"startDate",
",",
"$",
"endDate",
")",
"{",
"$",
"d1",
"=",
"strtotime",
"(",
"$",
"startDate",
")",
";",
"$",
"d2",
"=",
"strtotime",
"(",
"$",
"endDate",
")",
";",
"$",
"min_date",
"=... | Count Month Between Date
@param Date
@param Date
@return Integer | [
"Count",
"Month",
"Between",
"Date"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1397-L1409 |
9,119 | prastowoagungwidodo/utility | src/Transformatika/Utility/Fn.php | Fn.monthListBetweenDate | public static function monthListBetweenDate($startDate, $endDate)
{
$output = [];
$time = strtotime($startDate);
$last = date('m-Y', strtotime($endDate));
do {
$month = date('m-Y', $time);
$total = date('t', $time);
$output[] = [
'month' => $month,
'to... | php | public static function monthListBetweenDate($startDate, $endDate)
{
$output = [];
$time = strtotime($startDate);
$last = date('m-Y', strtotime($endDate));
do {
$month = date('m-Y', $time);
$total = date('t', $time);
$output[] = [
'month' => $month,
'to... | [
"public",
"static",
"function",
"monthListBetweenDate",
"(",
"$",
"startDate",
",",
"$",
"endDate",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"time",
"=",
"strtotime",
"(",
"$",
"startDate",
")",
";",
"$",
"last",
"=",
"date",
"(",
"'m-Y'",
"... | Get Month List And Month Total
@param Date
@param Date
@return Array | [
"Get",
"Month",
"List",
"And",
"Month",
"Total"
] | bbacc1a8ec15befae83c6a29b60e568fd02d66b7 | https://github.com/prastowoagungwidodo/utility/blob/bbacc1a8ec15befae83c6a29b60e568fd02d66b7/src/Transformatika/Utility/Fn.php#L1417-L1434 |
9,120 | FuturaSoft/Pabana | src/Mvc/Model.php | Model.get | public function get($modelName)
{
$modelNamespace = Configuration::read('mvc.model.namespace');
$modelNamespace = $modelNamespace . '\\' . ucFirst($modelName);
if (!class_exists($modelNamespace)) {
trigger_error('Model "' . $modelNamespace . '" doesn\'t exist.', E_USER_ERROR);
... | php | public function get($modelName)
{
$modelNamespace = Configuration::read('mvc.model.namespace');
$modelNamespace = $modelNamespace . '\\' . ucFirst($modelName);
if (!class_exists($modelNamespace)) {
trigger_error('Model "' . $modelNamespace . '" doesn\'t exist.', E_USER_ERROR);
... | [
"public",
"function",
"get",
"(",
"$",
"modelName",
")",
"{",
"$",
"modelNamespace",
"=",
"Configuration",
"::",
"read",
"(",
"'mvc.model.namespace'",
")",
";",
"$",
"modelNamespace",
"=",
"$",
"modelNamespace",
".",
"'\\\\'",
".",
"ucFirst",
"(",
"$",
"mode... | Call a model class
@since 1.0
@param string $modelName Model class name
@return object|bool Return model defined in $modelName or false if error | [
"Call",
"a",
"model",
"class"
] | b3a95eeb976042ac2a393cc10755a7adbc164c24 | https://github.com/FuturaSoft/Pabana/blob/b3a95eeb976042ac2a393cc10755a7adbc164c24/src/Mvc/Model.php#L64-L73 |
9,121 | docit/core | src/Project.php | Project.path | public function path($path = null)
{
return is_null($path) ? Path::join($this->path, $this->ref) : Path::join($this->path, $this->ref, $path);
} | php | public function path($path = null)
{
return is_null($path) ? Path::join($this->path, $this->ref) : Path::join($this->path, $this->ref, $path);
} | [
"public",
"function",
"path",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"return",
"is_null",
"(",
"$",
"path",
")",
"?",
"Path",
"::",
"join",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"this",
"->",
"ref",
")",
":",
"Path",
"::",
"join",
"(",
"$... | Get the absolute path to a file in the project using the current ref
@param null|string $path
@return string | [
"Get",
"the",
"absolute",
"path",
"to",
"a",
"file",
"in",
"the",
"project",
"using",
"the",
"current",
"ref"
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Project.php#L191-L194 |
9,122 | docit/core | src/Project.php | Project.getDocumentsMenu | public function getDocumentsMenu()
{
$yaml = $this->files->get(Path::join($this->path, $this->ref, 'menu.yml'));
$array = Yaml::parse($yaml);
$this->factory->getMenus()->forget('project_sidebar_menu');
$menu = $this->resolveDocumentsMenu($array[ 'menu' ]);
$menu->setView('... | php | public function getDocumentsMenu()
{
$yaml = $this->files->get(Path::join($this->path, $this->ref, 'menu.yml'));
$array = Yaml::parse($yaml);
$this->factory->getMenus()->forget('project_sidebar_menu');
$menu = $this->resolveDocumentsMenu($array[ 'menu' ]);
$menu->setView('... | [
"public",
"function",
"getDocumentsMenu",
"(",
")",
"{",
"$",
"yaml",
"=",
"$",
"this",
"->",
"files",
"->",
"get",
"(",
"Path",
"::",
"join",
"(",
"$",
"this",
"->",
"path",
",",
"$",
"this",
"->",
"ref",
",",
"'menu.yml'",
")",
")",
";",
"$",
"... | Returns the menu for this project
@return \Docit\Core\Menus\Menu | [
"Returns",
"the",
"menu",
"for",
"this",
"project"
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Project.php#L246-L258 |
9,123 | docit/core | src/Project.php | Project.resolveDocumentsMenu | protected function resolveDocumentsMenu($items, $parentId = 'root')
{
/**
* @var Menus\Menu $menu
*/
$menu = $this->factory->getMenus()->add('project_sidebar_menu');
foreach ($items as $item) {
$link = '#';
if (array_key_exists('document', $item)) {... | php | protected function resolveDocumentsMenu($items, $parentId = 'root')
{
/**
* @var Menus\Menu $menu
*/
$menu = $this->factory->getMenus()->add('project_sidebar_menu');
foreach ($items as $item) {
$link = '#';
if (array_key_exists('document', $item)) {... | [
"protected",
"function",
"resolveDocumentsMenu",
"(",
"$",
"items",
",",
"$",
"parentId",
"=",
"'root'",
")",
"{",
"/**\n * @var Menus\\Menu $menu\n */",
"$",
"menu",
"=",
"$",
"this",
"->",
"factory",
"->",
"getMenus",
"(",
")",
"->",
"add",
"("... | Resolves and creates the documents menu from the parsed menu.yml
@param array $items The array converted from yaml
@param string $parentId
@return \Docit\Core\Menus\Menu | [
"Resolves",
"and",
"creates",
"the",
"documents",
"menu",
"from",
"the",
"parsed",
"menu",
".",
"yml"
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Project.php#L267-L300 |
9,124 | docit/core | src/Project.php | Project.getSortedRefs | public function getSortedRefs()
{
$versions = $this->versions;
usort($versions, function (version $v1, version $v2) {
return version::gt($v1, $v2) ? -1 : 1;
});
$versions = array_map(function (version $v) {
return $v->getVersion();
}, $versions);... | php | public function getSortedRefs()
{
$versions = $this->versions;
usort($versions, function (version $v1, version $v2) {
return version::gt($v1, $v2) ? -1 : 1;
});
$versions = array_map(function (version $v) {
return $v->getVersion();
}, $versions);... | [
"public",
"function",
"getSortedRefs",
"(",
")",
"{",
"$",
"versions",
"=",
"$",
"this",
"->",
"versions",
";",
"usort",
"(",
"$",
"versions",
",",
"function",
"(",
"version",
"$",
"v1",
",",
"version",
"$",
"v2",
")",
"{",
"return",
"version",
"::",
... | Get refs sorted by the configured order.
@return array | [
"Get",
"refs",
"sorted",
"by",
"the",
"configured",
"order",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Project.php#L383-L400 |
9,125 | studyportals/Utils | src/Sanitize.php | Sanitize.url | public static function url($url){
$url = static::_nullValue($url);
if(!$url){
return $url;
}
$query = parse_url($url, PHP_URL_QUERY);
if(!$query){
return $url;
}
parse_str($query, $query_parts);
// First urldecode to be sure that we do not re-encode the query parts.
$query_parts = array_ma... | php | public static function url($url){
$url = static::_nullValue($url);
if(!$url){
return $url;
}
$query = parse_url($url, PHP_URL_QUERY);
if(!$query){
return $url;
}
parse_str($query, $query_parts);
// First urldecode to be sure that we do not re-encode the query parts.
$query_parts = array_ma... | [
"public",
"static",
"function",
"url",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"static",
"::",
"_nullValue",
"(",
"$",
"url",
")",
";",
"if",
"(",
"!",
"$",
"url",
")",
"{",
"return",
"$",
"url",
";",
"}",
"$",
"query",
"=",
"parse_url",
"(... | This will rebuild the url with all the query-parts url_encoded.
@param {string} $url
@return string|null | [
"This",
"will",
"rebuild",
"the",
"url",
"with",
"all",
"the",
"query",
"-",
"parts",
"url_encoded",
"."
] | eab69ca10ce3261480164cf8108ae7020459c847 | https://github.com/studyportals/Utils/blob/eab69ca10ce3261480164cf8108ae7020459c847/src/Sanitize.php#L174-L195 |
9,126 | studyportals/Utils | src/Sanitize.php | Sanitize.replaceHttpsUrls | public static function replaceHttpsUrls($value){
// CDN resources
$value = str_ireplace('http://cdn.prtl.eu', '//cdn.prtl.eu', $value);
$value = str_ireplace('http://cdn2.prtl.eu', '//cdn2.prtl.eu', $value);
$value = str_ireplace('http://studyportals-cdn2.imgix.net', '//studyportals-cdn2.imgix.net', $value);
... | php | public static function replaceHttpsUrls($value){
// CDN resources
$value = str_ireplace('http://cdn.prtl.eu', '//cdn.prtl.eu', $value);
$value = str_ireplace('http://cdn2.prtl.eu', '//cdn2.prtl.eu', $value);
$value = str_ireplace('http://studyportals-cdn2.imgix.net', '//studyportals-cdn2.imgix.net', $value);
... | [
"public",
"static",
"function",
"replaceHttpsUrls",
"(",
"$",
"value",
")",
"{",
"// CDN resources",
"$",
"value",
"=",
"str_ireplace",
"(",
"'http://cdn.prtl.eu'",
",",
"'//cdn.prtl.eu'",
",",
"$",
"value",
")",
";",
"$",
"value",
"=",
"str_ireplace",
"(",
"'... | Find en replaces all http urls which should be https.
@param {string} $value
@return string | [
"Find",
"en",
"replaces",
"all",
"http",
"urls",
"which",
"should",
"be",
"https",
"."
] | eab69ca10ce3261480164cf8108ae7020459c847 | https://github.com/studyportals/Utils/blob/eab69ca10ce3261480164cf8108ae7020459c847/src/Sanitize.php#L204-L216 |
9,127 | docit/core | src/Factory.php | Factory.url | public function url($project = null, $ref = null, $doc = null)
{
$uri = $this->config('base_route');
if ( ! is_null($project) )
{
if ( ! $project instanceof Project )
{
$project = $this->getProject($project);
}
$uri .= '/' . $p... | php | public function url($project = null, $ref = null, $doc = null)
{
$uri = $this->config('base_route');
if ( ! is_null($project) )
{
if ( ! $project instanceof Project )
{
$project = $this->getProject($project);
}
$uri .= '/' . $p... | [
"public",
"function",
"url",
"(",
"$",
"project",
"=",
"null",
",",
"$",
"ref",
"=",
"null",
",",
"$",
"doc",
"=",
"null",
")",
"{",
"$",
"uri",
"=",
"$",
"this",
"->",
"config",
"(",
"'base_route'",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$... | Generate a URL to a project's default page and version.
@param Project|string $project A Project instance or projectName, will auto-resolve
@param null|string $ref
@param null|string $doc
@return string | [
"Generate",
"a",
"URL",
"to",
"a",
"project",
"s",
"default",
"page",
"and",
"version",
"."
] | 448e1cdca18a8ffb6c08430cad8d22162171ac35 | https://github.com/docit/core/blob/448e1cdca18a8ffb6c08430cad8d22162171ac35/src/Factory.php#L239-L269 |
9,128 | bytic/helpers | src/Arrays.php | Nip_Helper_Arrays.without | public function without($array)
{
$values = func_get_args();
unset($values[0]);
if ($values) {
foreach ($values as $value) {
unset($array[array_search($value, $array)]);
}
}
return $array;
} | php | public function without($array)
{
$values = func_get_args();
unset($values[0]);
if ($values) {
foreach ($values as $value) {
unset($array[array_search($value, $array)]);
}
}
return $array;
} | [
"public",
"function",
"without",
"(",
"$",
"array",
")",
"{",
"$",
"values",
"=",
"func_get_args",
"(",
")",
";",
"unset",
"(",
"$",
"values",
"[",
"0",
"]",
")",
";",
"if",
"(",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
... | Produces a new version of the array that does not contain any of the specified values
@param array $array
@return array | [
"Produces",
"a",
"new",
"version",
"of",
"the",
"array",
"that",
"does",
"not",
"contain",
"any",
"of",
"the",
"specified",
"values"
] | 6a4f0388ba8653d65058ce63cf7627e38b9df041 | https://github.com/bytic/helpers/blob/6a4f0388ba8653d65058ce63cf7627e38b9df041/src/Arrays.php#L133-L145 |
9,129 | bytic/helpers | src/Arrays.php | Nip_Helper_Arrays.pluck | public function pluck($array, $property, &$return = false)
{
$return = [];
if (count($array) > 0) {
foreach ($array as $item) {
if (is_array($item)) {
$this->pluck($array, $property, $return);
}
$return[] = $item->$pro... | php | public function pluck($array, $property, &$return = false)
{
$return = [];
if (count($array) > 0) {
foreach ($array as $item) {
if (is_array($item)) {
$this->pluck($array, $property, $return);
}
$return[] = $item->$pro... | [
"public",
"function",
"pluck",
"(",
"$",
"array",
",",
"$",
"property",
",",
"&",
"$",
"return",
"=",
"false",
")",
"{",
"$",
"return",
"=",
"[",
"]",
";",
"if",
"(",
"count",
"(",
"$",
"array",
")",
">",
"0",
")",
"{",
"foreach",
"(",
"$",
"... | Fetch the same property for all the elements.
@param Nip\Records\Collections\Collection $array
@param string $property
@param bool|string $return
@return array The property values | [
"Fetch",
"the",
"same",
"property",
"for",
"all",
"the",
"elements",
"."
] | 6a4f0388ba8653d65058ce63cf7627e38b9df041 | https://github.com/bytic/helpers/blob/6a4f0388ba8653d65058ce63cf7627e38b9df041/src/Arrays.php#L195-L210 |
9,130 | bytic/helpers | src/Arrays.php | Nip_Helper_Arrays.toXML | public function toXML($data, $rootNodeName = 'ResultSet', &$xml = null)
{
// turn off compatibility mode as simple xml throws a wobbly if you don't.
if (ini_get('zend.ze1_compatibility_mode') == 1) {
ini_set('zend.ze1_compatibility_mode', 0);
}
if (is_null($xml)) {
... | php | public function toXML($data, $rootNodeName = 'ResultSet', &$xml = null)
{
// turn off compatibility mode as simple xml throws a wobbly if you don't.
if (ini_get('zend.ze1_compatibility_mode') == 1) {
ini_set('zend.ze1_compatibility_mode', 0);
}
if (is_null($xml)) {
... | [
"public",
"function",
"toXML",
"(",
"$",
"data",
",",
"$",
"rootNodeName",
"=",
"'ResultSet'",
",",
"&",
"$",
"xml",
"=",
"null",
")",
"{",
"// turn off compatibility mode as simple xml throws a wobbly if you don't.",
"if",
"(",
"ini_get",
"(",
"'zend.ze1_compatibilit... | Pass in a multi dimensional array and this recrusively loops through and builds up an XML document.
@param array $data
@param string $rootNodeName - what you want the root node to be - defaults to data
@param SimpleXMLElement $xml - should only be used recursively
@return string XML | [
"Pass",
"in",
"a",
"multi",
"dimensional",
"array",
"and",
"this",
"recrusively",
"loops",
"through",
"and",
"builds",
"up",
"an",
"XML",
"document",
"."
] | 6a4f0388ba8653d65058ce63cf7627e38b9df041 | https://github.com/bytic/helpers/blob/6a4f0388ba8653d65058ce63cf7627e38b9df041/src/Arrays.php#L316-L363 |
9,131 | fkooman/php-lib-io | src/fkooman/IO/IO.php | IO.getRandom | public function getRandom($byteLength = 16, $rawBytes = false)
{
$randomBytes = random_bytes($byteLength);
if ($rawBytes) {
return $randomBytes;
}
return bin2hex($randomBytes);
} | php | public function getRandom($byteLength = 16, $rawBytes = false)
{
$randomBytes = random_bytes($byteLength);
if ($rawBytes) {
return $randomBytes;
}
return bin2hex($randomBytes);
} | [
"public",
"function",
"getRandom",
"(",
"$",
"byteLength",
"=",
"16",
",",
"$",
"rawBytes",
"=",
"false",
")",
"{",
"$",
"randomBytes",
"=",
"random_bytes",
"(",
"$",
"byteLength",
")",
";",
"if",
"(",
"$",
"rawBytes",
")",
"{",
"return",
"$",
"randomB... | Get a random byte string.
@param int $byteLength the length of the random string in bytes
@param bool $rawBytes return the raw random string if true or hex
encoded when false (default)
@return string the random string of specified length | [
"Get",
"a",
"random",
"byte",
"string",
"."
] | e478f37798af631ad49c3154420c24c6bbe0484c | https://github.com/fkooman/php-lib-io/blob/e478f37798af631ad49c3154420c24c6bbe0484c/src/fkooman/IO/IO.php#L44-L53 |
9,132 | fkooman/php-lib-io | src/fkooman/IO/IO.php | IO.readFile | public function readFile($filePath)
{
if (false === $fileContent = @file_get_contents($filePath)) {
throw new RuntimeException(
sprintf('unable to read file "%s"', $filePath)
);
}
return $fileContent;
} | php | public function readFile($filePath)
{
if (false === $fileContent = @file_get_contents($filePath)) {
throw new RuntimeException(
sprintf('unable to read file "%s"', $filePath)
);
}
return $fileContent;
} | [
"public",
"function",
"readFile",
"(",
"$",
"filePath",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"fileContent",
"=",
"@",
"file_get_contents",
"(",
"$",
"filePath",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"sprintf",
"(",
"'unable to read fil... | Read a file from the file system.
@param string $filePath the path of the file to read
@return string the file contents
@throws RuntimeException if the file could not be read | [
"Read",
"a",
"file",
"from",
"the",
"file",
"system",
"."
] | e478f37798af631ad49c3154420c24c6bbe0484c | https://github.com/fkooman/php-lib-io/blob/e478f37798af631ad49c3154420c24c6bbe0484c/src/fkooman/IO/IO.php#L69-L78 |
9,133 | fkooman/php-lib-io | src/fkooman/IO/IO.php | IO.readFolder | public function readFolder($folderPath, $fileFilter = '*')
{
// make sure folderPath ends with '/'
if ('/' !== substr($folderPath, -1)) {
$folderPath .= '/';
}
$searchPattern = $folderPath.$fileFilter;
$fileList = @glob($searchPattern, GLOB_MARK | GLOB_ERR);
... | php | public function readFolder($folderPath, $fileFilter = '*')
{
// make sure folderPath ends with '/'
if ('/' !== substr($folderPath, -1)) {
$folderPath .= '/';
}
$searchPattern = $folderPath.$fileFilter;
$fileList = @glob($searchPattern, GLOB_MARK | GLOB_ERR);
... | [
"public",
"function",
"readFolder",
"(",
"$",
"folderPath",
",",
"$",
"fileFilter",
"=",
"'*'",
")",
"{",
"// make sure folderPath ends with '/'",
"if",
"(",
"'/'",
"!==",
"substr",
"(",
"$",
"folderPath",
",",
"-",
"1",
")",
")",
"{",
"$",
"folderPath",
"... | Read a folder and return a list of files in that folder.
@param string $folderPath the path to the folder
@param string $fileFilter the filter to apply, defaults to '*'
@return array an array of files and directories in the folder requested,
entries ending in a '/' are folders. If a directory does not exist, is
empty... | [
"Read",
"a",
"folder",
"and",
"return",
"a",
"list",
"of",
"files",
"in",
"that",
"folder",
"."
] | e478f37798af631ad49c3154420c24c6bbe0484c | https://github.com/fkooman/php-lib-io/blob/e478f37798af631ad49c3154420c24c6bbe0484c/src/fkooman/IO/IO.php#L90-L103 |
9,134 | fkooman/php-lib-io | src/fkooman/IO/IO.php | IO.writeFile | public function writeFile($filePath, $fileContent, $createParentDir = false, $dirMask = 0750)
{
if ($createParentDir) {
$parentDir = dirname($filePath);
if (false === @file_exists($parentDir)) {
if (false === @mkdir($parentDir, $dirMask, true)) {
t... | php | public function writeFile($filePath, $fileContent, $createParentDir = false, $dirMask = 0750)
{
if ($createParentDir) {
$parentDir = dirname($filePath);
if (false === @file_exists($parentDir)) {
if (false === @mkdir($parentDir, $dirMask, true)) {
t... | [
"public",
"function",
"writeFile",
"(",
"$",
"filePath",
",",
"$",
"fileContent",
",",
"$",
"createParentDir",
"=",
"false",
",",
"$",
"dirMask",
"=",
"0750",
")",
"{",
"if",
"(",
"$",
"createParentDir",
")",
"{",
"$",
"parentDir",
"=",
"dirname",
"(",
... | Write a file to the file system.
@param string $filePath the path of the file to write
@param string $fileContent the content to be written to the file
@param bool $createParentDir create the parent directory if it does not exist, defaults to false
@param int $dirMask the mask to use for creati... | [
"Write",
"a",
"file",
"to",
"the",
"file",
"system",
"."
] | e478f37798af631ad49c3154420c24c6bbe0484c | https://github.com/fkooman/php-lib-io/blob/e478f37798af631ad49c3154420c24c6bbe0484c/src/fkooman/IO/IO.php#L115-L131 |
9,135 | ItinerisLtd/preflight-command | src/ConfigCollectionFactory.php | ConfigCollectionFactory.makeFromFiles | public static function makeFromFiles(string ...$paths): ConfigCollection
{
$definitions = array_map(function (string $path): array {
try {
// Toml::parseFile might return void / null.
$definitions = (array) Toml::parseFile($path);
// See: Automatt... | php | public static function makeFromFiles(string ...$paths): ConfigCollection
{
$definitions = array_map(function (string $path): array {
try {
// Toml::parseFile might return void / null.
$definitions = (array) Toml::parseFile($path);
// See: Automatt... | [
"public",
"static",
"function",
"makeFromFiles",
"(",
"string",
"...",
"$",
"paths",
")",
":",
"ConfigCollection",
"{",
"$",
"definitions",
"=",
"array_map",
"(",
"function",
"(",
"string",
"$",
"path",
")",
":",
"array",
"{",
"try",
"{",
"// Toml::parseFile... | Parses the TOML and returns a config instance.
@param string|string[] ...$paths Paths to TOML files.
@return ConfigCollection | [
"Parses",
"the",
"TOML",
"and",
"returns",
"a",
"config",
"instance",
"."
] | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/ConfigCollectionFactory.php#L18-L40 |
9,136 | ItinerisLtd/preflight-command | src/ConfigCollectionFactory.php | ConfigCollectionFactory.arrayMergeRecursiveDistinct | private static function arrayMergeRecursiveDistinct(array $merged, array $other): array
{
foreach ($other as $key => $value) {
if (is_array($value) && is_array($merged[$key] ?? [])) {
$merged[$key] = self::arrayMergeRecursiveDistinct($merged[$key] ?? [], $value);
} el... | php | private static function arrayMergeRecursiveDistinct(array $merged, array $other): array
{
foreach ($other as $key => $value) {
if (is_array($value) && is_array($merged[$key] ?? [])) {
$merged[$key] = self::arrayMergeRecursiveDistinct($merged[$key] ?? [], $value);
} el... | [
"private",
"static",
"function",
"arrayMergeRecursiveDistinct",
"(",
"array",
"$",
"merged",
",",
"array",
"$",
"other",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"other",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"... | This does not change the data types of the values in the arrays. Matching keys' values in the second array
overwrite those in the first array, as is the case with array_merge.
This is modified from an example on php.net.
@see https://secure.php.net/manual/en/function.array-merge-recursive.php#92195
@param array $mer... | [
"This",
"does",
"not",
"change",
"the",
"data",
"types",
"of",
"the",
"values",
"in",
"the",
"arrays",
".",
"Matching",
"keys",
"values",
"in",
"the",
"second",
"array",
"overwrite",
"those",
"in",
"the",
"first",
"array",
"as",
"is",
"the",
"case",
"wit... | d1c1360ea8d7de0312b5c0c09c9c486949594049 | https://github.com/ItinerisLtd/preflight-command/blob/d1c1360ea8d7de0312b5c0c09c9c486949594049/src/ConfigCollectionFactory.php#L55-L71 |
9,137 | 0x20h/phloppy | src/Stream/DefaultStream.php | DefaultStream.connect | public function connect()
{
$connectTimeout = 1;
$errstr = '';
$errno = 0;
$stream = @stream_socket_client($this->nodeUrl, $errno, $errstr, $connectTimeout);
if (!$stream) {
$this->log->warning('unable to connect to '.$this->nodeUrl.': '.$errstr);
thr... | php | public function connect()
{
$connectTimeout = 1;
$errstr = '';
$errno = 0;
$stream = @stream_socket_client($this->nodeUrl, $errno, $errstr, $connectTimeout);
if (!$stream) {
$this->log->warning('unable to connect to '.$this->nodeUrl.': '.$errstr);
thr... | [
"public",
"function",
"connect",
"(",
")",
"{",
"$",
"connectTimeout",
"=",
"1",
";",
"$",
"errstr",
"=",
"''",
";",
"$",
"errno",
"=",
"0",
";",
"$",
"stream",
"=",
"@",
"stream_socket_client",
"(",
"$",
"this",
"->",
"nodeUrl",
",",
"$",
"errno",
... | Connect the stream.
@return boolean True if connection could be established.
@throws ConnectException | [
"Connect",
"the",
"stream",
"."
] | d917f0578360395899bd583724046d36ac459535 | https://github.com/0x20h/phloppy/blob/d917f0578360395899bd583724046d36ac459535/src/Stream/DefaultStream.php#L48-L64 |
9,138 | 0x20h/phloppy | src/Stream/DefaultStream.php | DefaultStream.readLine | public function readLine()
{
$this->log->debug('going to read a line from the stream');
$line = $this->streamReadLine($this->stream);
if (false === $line) {
$meta = $this->streamMeta($this->stream);
$this->log->warning('fgets returned false', $meta);
thro... | php | public function readLine()
{
$this->log->debug('going to read a line from the stream');
$line = $this->streamReadLine($this->stream);
if (false === $line) {
$meta = $this->streamMeta($this->stream);
$this->log->warning('fgets returned false', $meta);
thro... | [
"public",
"function",
"readLine",
"(",
")",
"{",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"'going to read a line from the stream'",
")",
";",
"$",
"line",
"=",
"$",
"this",
"->",
"streamReadLine",
"(",
"$",
"this",
"->",
"stream",
")",
";",
"if",
"(... | Read a line from the stream.
@return string
@throws StreamException If an error occurs while reading from the stream. | [
"Read",
"a",
"line",
"from",
"the",
"stream",
"."
] | d917f0578360395899bd583724046d36ac459535 | https://github.com/0x20h/phloppy/blob/d917f0578360395899bd583724046d36ac459535/src/Stream/DefaultStream.php#L84-L98 |
9,139 | 0x20h/phloppy | src/Stream/DefaultStream.php | DefaultStream.readBytes | public function readBytes($maxlen = null)
{
$this->log->debug('calling readbytes()', array('maxlen' => $maxlen));
$out = $this->streamReadBytes($this->stream, $maxlen);
$this->log->debug('readBytes()', [$maxlen, $out]);
if (false === $out) {
$meta = $this->streamMeta($th... | php | public function readBytes($maxlen = null)
{
$this->log->debug('calling readbytes()', array('maxlen' => $maxlen));
$out = $this->streamReadBytes($this->stream, $maxlen);
$this->log->debug('readBytes()', [$maxlen, $out]);
if (false === $out) {
$meta = $this->streamMeta($th... | [
"public",
"function",
"readBytes",
"(",
"$",
"maxlen",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"log",
"->",
"debug",
"(",
"'calling readbytes()'",
",",
"array",
"(",
"'maxlen'",
"=>",
"$",
"maxlen",
")",
")",
";",
"$",
"out",
"=",
"$",
"this",
"->"... | Read bytes off from the stream.
@param int|null $maxlen
@return string
@throws StreamException If an error occurs while reading from the stream. | [
"Read",
"bytes",
"off",
"from",
"the",
"stream",
"."
] | d917f0578360395899bd583724046d36ac459535 | https://github.com/0x20h/phloppy/blob/d917f0578360395899bd583724046d36ac459535/src/Stream/DefaultStream.php#L109-L122 |
9,140 | senhungwong/php-loader | src/Loader.php | Loader.load | public static function load(string $dir, int $depth = 6, array $priority = [], array $extensions = ['php'])
{
/* Stop when search to maximum depth */
if ($depth == 0) {
return;
}
/* Load Priority Files */
foreach ($priority as $file) {
self::load($fil... | php | public static function load(string $dir, int $depth = 6, array $priority = [], array $extensions = ['php'])
{
/* Stop when search to maximum depth */
if ($depth == 0) {
return;
}
/* Load Priority Files */
foreach ($priority as $file) {
self::load($fil... | [
"public",
"static",
"function",
"load",
"(",
"string",
"$",
"dir",
",",
"int",
"$",
"depth",
"=",
"6",
",",
"array",
"$",
"priority",
"=",
"[",
"]",
",",
"array",
"$",
"extensions",
"=",
"[",
"'php'",
"]",
")",
"{",
"/* Stop when search to maximum depth ... | Load files in the given directory and the files under its folders with maximum depth
@param string $dir initial directory to be included
@param int $depth depth of the maximum search
@param array $priority priority files needs to be loaded
@param array $extensions array of file extensions that should be included | [
"Load",
"files",
"in",
"the",
"given",
"directory",
"and",
"the",
"files",
"under",
"its",
"folders",
"with",
"maximum",
"depth"
] | 326a7785ea5771d0e478bd1f898edeafac52f48f | https://github.com/senhungwong/php-loader/blob/326a7785ea5771d0e478bd1f898edeafac52f48f/src/Loader.php#L15-L42 |
9,141 | senhungwong/php-loader | src/Loader.php | Loader.getAllChildClasses | public static function getAllChildClasses($class): array
{
$type = gettype($class);
$className = '';
/* If input an object */
if ($type == 'object') {
$className = get_class($class);
}
/* If input a string */
elseif ($type == 'string') {
... | php | public static function getAllChildClasses($class): array
{
$type = gettype($class);
$className = '';
/* If input an object */
if ($type == 'object') {
$className = get_class($class);
}
/* If input a string */
elseif ($type == 'string') {
... | [
"public",
"static",
"function",
"getAllChildClasses",
"(",
"$",
"class",
")",
":",
"array",
"{",
"$",
"type",
"=",
"gettype",
"(",
"$",
"class",
")",
";",
"$",
"className",
"=",
"''",
";",
"/* If input an object */",
"if",
"(",
"$",
"type",
"==",
"'objec... | Get all child classes of a class
@param string|object $class
@return array | [
"Get",
"all",
"child",
"classes",
"of",
"a",
"class"
] | 326a7785ea5771d0e478bd1f898edeafac52f48f | https://github.com/senhungwong/php-loader/blob/326a7785ea5771d0e478bd1f898edeafac52f48f/src/Loader.php#L50-L75 |
9,142 | digitas/digex-core | src/Digex/YamlConfigLoader.php | YamlConfigLoader.load | public function load($dir, $env = null, $basename = 'config', $extension = 'yml')
{
$filepath = $dir . '/' . $basename . '.' . $extension;
if (!file_exists($filepath)) {
throw new \Exception(sprintf("Config file \"%s\" does not exist", $filepath));
}
$parameters = Yaml:... | php | public function load($dir, $env = null, $basename = 'config', $extension = 'yml')
{
$filepath = $dir . '/' . $basename . '.' . $extension;
if (!file_exists($filepath)) {
throw new \Exception(sprintf("Config file \"%s\" does not exist", $filepath));
}
$parameters = Yaml:... | [
"public",
"function",
"load",
"(",
"$",
"dir",
",",
"$",
"env",
"=",
"null",
",",
"$",
"basename",
"=",
"'config'",
",",
"$",
"extension",
"=",
"'yml'",
")",
"{",
"$",
"filepath",
"=",
"$",
"dir",
".",
"'/'",
".",
"$",
"basename",
".",
"'.'",
"."... | Load the config
@param string $dir
@param string $basename
@param string $extension
@return array | [
"Load",
"the",
"config"
] | 59339a4ad34c1856a5db1bd12097a01de673d2e9 | https://github.com/digitas/digex-core/blob/59339a4ad34c1856a5db1bd12097a01de673d2e9/src/Digex/YamlConfigLoader.php#L22-L44 |
9,143 | digitas/digex-core | src/Digex/YamlConfigLoader.php | YamlConfigLoader.deepMerge | protected function deepMerge($leftSide, $rightSide)
{
if (!is_array($rightSide)) {
return $rightSide;
}
foreach ($rightSide as $k => $v) {
// no conflict
if (!array_key_exists($k, $leftSide)) {
$leftSide[$k] = $v;
... | php | protected function deepMerge($leftSide, $rightSide)
{
if (!is_array($rightSide)) {
return $rightSide;
}
foreach ($rightSide as $k => $v) {
// no conflict
if (!array_key_exists($k, $leftSide)) {
$leftSide[$k] = $v;
... | [
"protected",
"function",
"deepMerge",
"(",
"$",
"leftSide",
",",
"$",
"rightSide",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"rightSide",
")",
")",
"{",
"return",
"$",
"rightSide",
";",
"}",
"foreach",
"(",
"$",
"rightSide",
"as",
"$",
"k",
"=>... | Do a deep merge of two arrays
@param array $leftSide
@param array $rightSide
@return array | [
"Do",
"a",
"deep",
"merge",
"of",
"two",
"arrays"
] | 59339a4ad34c1856a5db1bd12097a01de673d2e9 | https://github.com/digitas/digex-core/blob/59339a4ad34c1856a5db1bd12097a01de673d2e9/src/Digex/YamlConfigLoader.php#L53-L72 |
9,144 | mizmoz/container | src/Resolver.php | Resolver.resolveParameters | private function resolveParameters(string $id, array $parameters, ContainerInterface $container): array
{
$resolved = [];
foreach ($parameters as $parameter) {
$resolved[] = $this->getParameterValue($id, $parameter, $container);
}
return $resolved;
} | php | private function resolveParameters(string $id, array $parameters, ContainerInterface $container): array
{
$resolved = [];
foreach ($parameters as $parameter) {
$resolved[] = $this->getParameterValue($id, $parameter, $container);
}
return $resolved;
} | [
"private",
"function",
"resolveParameters",
"(",
"string",
"$",
"id",
",",
"array",
"$",
"parameters",
",",
"ContainerInterface",
"$",
"container",
")",
":",
"array",
"{",
"$",
"resolved",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
... | Resolve the parameters
@param string $id
@param ReflectionParameter[] $parameters
@param ContainerInterface $container
@return array | [
"Resolve",
"the",
"parameters"
] | 7ae194189595fbcd392445bb41ac8ddb118b5b7c | https://github.com/mizmoz/container/blob/7ae194189595fbcd392445bb41ac8ddb118b5b7c/src/Resolver.php#L55-L62 |
9,145 | mizmoz/container | src/Resolver.php | Resolver.getParameterValue | private function getParameterValue(string $id, ReflectionParameter $parameter, ContainerInterface $container)
{
if (! ($class = $parameter->getClass())) {
if ($parameter->isDefaultValueAvailable()) {
// a default value is available so use that
return $parameter->g... | php | private function getParameterValue(string $id, ReflectionParameter $parameter, ContainerInterface $container)
{
if (! ($class = $parameter->getClass())) {
if ($parameter->isDefaultValueAvailable()) {
// a default value is available so use that
return $parameter->g... | [
"private",
"function",
"getParameterValue",
"(",
"string",
"$",
"id",
",",
"ReflectionParameter",
"$",
"parameter",
",",
"ContainerInterface",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"class",
"=",
"$",
"parameter",
"->",
"getClass",
"(",
")",
... | Get the parameter value
@param string $id
@param ReflectionParameter $parameter
@param ContainerInterface $container
@return mixed | [
"Get",
"the",
"parameter",
"value"
] | 7ae194189595fbcd392445bb41ac8ddb118b5b7c | https://github.com/mizmoz/container/blob/7ae194189595fbcd392445bb41ac8ddb118b5b7c/src/Resolver.php#L72-L94 |
9,146 | samurai-fw/samurai | src/Samurai/Component/Response/HttpBody.php | HttpBody.render | public function render($with_headers = false)
{
$contents = array();
// headers
$headers = $this->getHeaders();
if ($with_headers && $headers) {
foreach ($headers as $key => $value) {
$key = join('-', array_map('ucfirst', explode('-', $key)));
... | php | public function render($with_headers = false)
{
$contents = array();
// headers
$headers = $this->getHeaders();
if ($with_headers && $headers) {
foreach ($headers as $key => $value) {
$key = join('-', array_map('ucfirst', explode('-', $key)));
... | [
"public",
"function",
"render",
"(",
"$",
"with_headers",
"=",
"false",
")",
"{",
"$",
"contents",
"=",
"array",
"(",
")",
";",
"// headers",
"$",
"headers",
"=",
"$",
"this",
"->",
"getHeaders",
"(",
")",
";",
"if",
"(",
"$",
"with_headers",
"&&",
"... | build and return content string.
@access public
@return string | [
"build",
"and",
"return",
"content",
"string",
"."
] | 7ca3847b13f86e2847a17ab5e8e4e20893021d5a | https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Response/HttpBody.php#L150-L168 |
9,147 | avoo/FrameworkGeneratorBundle | Generator/Template/Model.php | Model.getEntityGenerator | protected function getEntityGenerator()
{
$entityGenerator = new EntityGenerator();
$entityGenerator->setFieldVisibility(EntityGenerator::FIELD_VISIBLE_PROTECTED);
$entityGenerator->setGenerateAnnotations(false);
$entityGenerator->setGenerateStubMethods(true);
$entityGenerato... | php | protected function getEntityGenerator()
{
$entityGenerator = new EntityGenerator();
$entityGenerator->setFieldVisibility(EntityGenerator::FIELD_VISIBLE_PROTECTED);
$entityGenerator->setGenerateAnnotations(false);
$entityGenerator->setGenerateStubMethods(true);
$entityGenerato... | [
"protected",
"function",
"getEntityGenerator",
"(",
")",
"{",
"$",
"entityGenerator",
"=",
"new",
"EntityGenerator",
"(",
")",
";",
"$",
"entityGenerator",
"->",
"setFieldVisibility",
"(",
"EntityGenerator",
"::",
"FIELD_VISIBLE_PROTECTED",
")",
";",
"$",
"entityGen... | get entity generator
@return EntityGenerator | [
"get",
"entity",
"generator"
] | 3178268b9e58e6c60c27e0b9ea976944c1f61a48 | https://github.com/avoo/FrameworkGeneratorBundle/blob/3178268b9e58e6c60c27e0b9ea976944c1f61a48/Generator/Template/Model.php#L137-L153 |
9,148 | kore/CTXParser | src/php/CTXParser/Visitor/Simplified.php | Simplified.visit | public function visit(AccountInfoList $accountList)
{
$list = new Simplified\AccountList();
foreach ($accountList->accountInfo as $accountInfo) {
$list->accounts[] = $this->visitAccount($accountInfo);
}
return $list;
} | php | public function visit(AccountInfoList $accountList)
{
$list = new Simplified\AccountList();
foreach ($accountList->accountInfo as $accountInfo) {
$list->accounts[] = $this->visitAccount($accountInfo);
}
return $list;
} | [
"public",
"function",
"visit",
"(",
"AccountInfoList",
"$",
"accountList",
")",
"{",
"$",
"list",
"=",
"new",
"Simplified",
"\\",
"AccountList",
"(",
")",
";",
"foreach",
"(",
"$",
"accountList",
"->",
"accountInfo",
"as",
"$",
"accountInfo",
")",
"{",
"$"... | Visit account info list
@param AccountInfoList $account
@return mixed | [
"Visit",
"account",
"info",
"list"
] | 9b11c2311a9de61baee7edafe46d1671dd5833c4 | https://github.com/kore/CTXParser/blob/9b11c2311a9de61baee7edafe46d1671dd5833c4/src/php/CTXParser/Visitor/Simplified.php#L40-L48 |
9,149 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.set_options | public function set_options(array $options)
{
foreach ($options as $key => $val)
{
$this->options[$key] = $val;
}
return $this;
} | php | public function set_options(array $options)
{
foreach ($options as $key => $val)
{
$this->options[$key] = $val;
}
return $this;
} | [
"public",
"function",
"set_options",
"(",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"val",
")",
"{",
"$",
"this",
"->",
"options",
"[",
"$",
"key",
"]",
"=",
"$",
"val",
";",
"}",
"return",
"$... | Sets options on the driver
@param array $options
@return Request_Driver | [
"Sets",
"options",
"on",
"the",
"driver"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L154-L162 |
9,150 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.set_header | public function set_header($header, $content = null)
{
if (is_null($content))
{
$this->headers[] = $header;
}
else
{
$this->headers[$header] = $content;
}
return $this;
} | php | public function set_header($header, $content = null)
{
if (is_null($content))
{
$this->headers[] = $header;
}
else
{
$this->headers[$header] = $content;
}
return $this;
} | [
"public",
"function",
"set_header",
"(",
"$",
"header",
",",
"$",
"content",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"content",
")",
")",
"{",
"$",
"this",
"->",
"headers",
"[",
"]",
"=",
"$",
"header",
";",
"}",
"else",
"{",
"$",
... | set a request http header
@param string $header
@param string $header
@return Request_Driver | [
"set",
"a",
"request",
"http",
"header"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L204-L216 |
9,151 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.get_headers | public function get_headers()
{
$headers = array();
foreach ($this->headers as $key => $value)
{
$headers[] = is_int($key) ? $value : $key.': '.$value;
}
return $headers;
} | php | public function get_headers()
{
$headers = array();
foreach ($this->headers as $key => $value)
{
$headers[] = is_int($key) ? $value : $key.': '.$value;
}
return $headers;
} | [
"public",
"function",
"get_headers",
"(",
")",
"{",
"$",
"headers",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"headers",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"headers",
"[",
"]",
"=",
"is_int",
"(",
"$",
"key... | Collect all headers and parse into consistent string
@return array | [
"Collect",
"all",
"headers",
"and",
"parse",
"into",
"consistent",
"string"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L223-L232 |
9,152 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.set_mime_type | public function set_mime_type($mime)
{
if (array_key_exists($mime, static::$supported_formats))
{
$mime = static::$supported_formats[$mime];
}
$this->set_header('Accept', $mime);
return $this;
} | php | public function set_mime_type($mime)
{
if (array_key_exists($mime, static::$supported_formats))
{
$mime = static::$supported_formats[$mime];
}
$this->set_header('Accept', $mime);
return $this;
} | [
"public",
"function",
"set_mime_type",
"(",
"$",
"mime",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"mime",
",",
"static",
"::",
"$",
"supported_formats",
")",
")",
"{",
"$",
"mime",
"=",
"static",
"::",
"$",
"supported_formats",
"[",
"$",
"mime"... | Set mime-type accept header
@param string $mime
@return string Request_Driver | [
"Set",
"mime",
"-",
"type",
"accept",
"header"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L240-L249 |
9,153 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.set_defaults | protected function set_defaults()
{
$this->options = $this->default_options;
$this->params = $this->default_params;
return $this;
} | php | protected function set_defaults()
{
$this->options = $this->default_options;
$this->params = $this->default_params;
return $this;
} | [
"protected",
"function",
"set_defaults",
"(",
")",
"{",
"$",
"this",
"->",
"options",
"=",
"$",
"this",
"->",
"default_options",
";",
"$",
"this",
"->",
"params",
"=",
"$",
"this",
"->",
"default_params",
";",
"return",
"$",
"this",
";",
"}"
] | Reset before doing another request
@return Request_Driver | [
"Reset",
"before",
"doing",
"another",
"request"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L277-L282 |
9,154 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.mime_in_header | protected function mime_in_header($mime, $accept_header)
{
// make sure we have input
if (empty($mime) or empty($accept_header))
{
// no header or no mime to check
return true;
}
// process the accept header and get a list of accepted mimes
$accept_mimes = array();
$accept_header = explode(',', $a... | php | protected function mime_in_header($mime, $accept_header)
{
// make sure we have input
if (empty($mime) or empty($accept_header))
{
// no header or no mime to check
return true;
}
// process the accept header and get a list of accepted mimes
$accept_mimes = array();
$accept_header = explode(',', $a... | [
"protected",
"function",
"mime_in_header",
"(",
"$",
"mime",
",",
"$",
"accept_header",
")",
"{",
"// make sure we have input",
"if",
"(",
"empty",
"(",
"$",
"mime",
")",
"or",
"empty",
"(",
"$",
"accept_header",
")",
")",
"{",
"// no header or no mime to check"... | Validate if a given mime type is accepted according to an accept header
@param string $mime
@param string $accept_header
@return bool | [
"Validate",
"if",
"a",
"given",
"mime",
"type",
"is",
"accepted",
"according",
"to",
"an",
"accept",
"header"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L291-L334 |
9,155 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.set_response | public function set_response($body, $status, $mime = null, $headers = array(), $accept_header = null)
{
// did we use an accept header? If so, validate the returned mimetype
if ( ! $this->mime_in_header($mime, $accept_header))
{
throw new \OutOfRangeException('The mimetype "'.$mime.'" of the returned response... | php | public function set_response($body, $status, $mime = null, $headers = array(), $accept_header = null)
{
// did we use an accept header? If so, validate the returned mimetype
if ( ! $this->mime_in_header($mime, $accept_header))
{
throw new \OutOfRangeException('The mimetype "'.$mime.'" of the returned response... | [
"public",
"function",
"set_response",
"(",
"$",
"body",
",",
"$",
"status",
",",
"$",
"mime",
"=",
"null",
",",
"$",
"headers",
"=",
"array",
"(",
")",
",",
"$",
"accept_header",
"=",
"null",
")",
"{",
"// did we use an accept header? If so, validate the retur... | Creates the Response and optionally attempts to auto-format the output
@param string $body
@param int $status
@param string $mime
@param array $headers
@param string $accept_header
@return Response
@throws OutOfRangeException if an accept header was specified, but the mime type isn't in it | [
"Creates",
"the",
"Response",
"and",
"optionally",
"attempts",
"to",
"auto",
"-",
"format",
"the",
"output"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L349-L366 |
9,156 | indigophp-archive/codeception-fuel-module | fuel/fuel/core/classes/request/driver.php | Request_Driver.response_info | public function response_info($key = null, $default = null)
{
if (func_num_args() == 0)
{
return $this->response_info;
}
return \Arr::get($this->response_info, $key, $default);
} | php | public function response_info($key = null, $default = null)
{
if (func_num_args() == 0)
{
return $this->response_info;
}
return \Arr::get($this->response_info, $key, $default);
} | [
"public",
"function",
"response_info",
"(",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"==",
"0",
")",
"{",
"return",
"$",
"this",
"->",
"response_info",
";",
"}",
"return",
"\\",
"Arr",... | Fetch the response info or a key from it
@param string $key
@param string $default
@return mixed | [
"Fetch",
"the",
"response",
"info",
"or",
"a",
"key",
"from",
"it"
] | 0973b7cbd540a0e89cc5bb7af94627f77f09bf49 | https://github.com/indigophp-archive/codeception-fuel-module/blob/0973b7cbd540a0e89cc5bb7af94627f77f09bf49/fuel/fuel/core/classes/request/driver.php#L385-L393 |
9,157 | osflab/bean | BeanHelper.php | BeanHelper.filterMarkdownContent | public static function filterMarkdownContent(?string $content, bool $compute, bool $fullMarkdown = false): ?string
{
return $compute
? ($fullMarkdown
? self::escapeAndMarkdown($content)
: self::escapeAndMarkdownLight($content)
)
... | php | public static function filterMarkdownContent(?string $content, bool $compute, bool $fullMarkdown = false): ?string
{
return $compute
? ($fullMarkdown
? self::escapeAndMarkdown($content)
: self::escapeAndMarkdownLight($content)
)
... | [
"public",
"static",
"function",
"filterMarkdownContent",
"(",
"?",
"string",
"$",
"content",
",",
"bool",
"$",
"compute",
",",
"bool",
"$",
"fullMarkdown",
"=",
"false",
")",
":",
"?",
"string",
"{",
"return",
"$",
"compute",
"?",
"(",
"$",
"fullMarkdown",... | Common filter for markdown content for getters
@param string|null $content
@param bool $compute
@param bool $fullMarkdown
@return string|null | [
"Common",
"filter",
"for",
"markdown",
"content",
"for",
"getters"
] | 1d3e575aaedb6c8bb281dce9c66e8eec5e89a1d7 | https://github.com/osflab/bean/blob/1d3e575aaedb6c8bb281dce9c66e8eec5e89a1d7/BeanHelper.php#L53-L61 |
9,158 | osflab/bean | BeanHelper.php | BeanHelper.filterContent | public static function filterContent(?string $content, bool $escape, bool $nl2br = false): ?string
{
return $escape ? Html::escape($content, $nl2br) : $content;
} | php | public static function filterContent(?string $content, bool $escape, bool $nl2br = false): ?string
{
return $escape ? Html::escape($content, $nl2br) : $content;
} | [
"public",
"static",
"function",
"filterContent",
"(",
"?",
"string",
"$",
"content",
",",
"bool",
"$",
"escape",
",",
"bool",
"$",
"nl2br",
"=",
"false",
")",
":",
"?",
"string",
"{",
"return",
"$",
"escape",
"?",
"Html",
"::",
"escape",
"(",
"$",
"c... | Common filter for general content for getters
@param string|null $content
@param bool $escape
@return string|null | [
"Common",
"filter",
"for",
"general",
"content",
"for",
"getters"
] | 1d3e575aaedb6c8bb281dce9c66e8eec5e89a1d7 | https://github.com/osflab/bean/blob/1d3e575aaedb6c8bb281dce9c66e8eec5e89a1d7/BeanHelper.php#L69-L72 |
9,159 | matudelatower/ubicacion-bundle | Controller/LocalidadController.php | LocalidadController.showAction | public function showAction(Localidad $localidad)
{
$deleteForm = $this->createDeleteForm($localidad);
return $this->render('UbicacionBundle:localidad:show.html.twig', array(
'localidad' => $localidad,
'delete_form' => $deleteForm->createView(),
));
} | php | public function showAction(Localidad $localidad)
{
$deleteForm = $this->createDeleteForm($localidad);
return $this->render('UbicacionBundle:localidad:show.html.twig', array(
'localidad' => $localidad,
'delete_form' => $deleteForm->createView(),
));
} | [
"public",
"function",
"showAction",
"(",
"Localidad",
"$",
"localidad",
")",
"{",
"$",
"deleteForm",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"localidad",
")",
";",
"return",
"$",
"this",
"->",
"render",
"(",
"'UbicacionBundle:localidad:show.html.tw... | Finds and displays a Localidad entity. | [
"Finds",
"and",
"displays",
"a",
"Localidad",
"entity",
"."
] | f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df | https://github.com/matudelatower/ubicacion-bundle/blob/f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df/Controller/LocalidadController.php#L59-L67 |
9,160 | matudelatower/ubicacion-bundle | Controller/LocalidadController.php | LocalidadController.editAction | public function editAction(Request $request, Localidad $localidad)
{
$deleteForm = $this->createDeleteForm($localidad);
$editForm = $this->createForm('Matudelatower\UbicacionBundle\Form\Type\LocalidadType', $localidad);
$editForm->handleRequest($request);
if ($editForm->isSubmitted(... | php | public function editAction(Request $request, Localidad $localidad)
{
$deleteForm = $this->createDeleteForm($localidad);
$editForm = $this->createForm('Matudelatower\UbicacionBundle\Form\Type\LocalidadType', $localidad);
$editForm->handleRequest($request);
if ($editForm->isSubmitted(... | [
"public",
"function",
"editAction",
"(",
"Request",
"$",
"request",
",",
"Localidad",
"$",
"localidad",
")",
"{",
"$",
"deleteForm",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"localidad",
")",
";",
"$",
"editForm",
"=",
"$",
"this",
"->",
"cr... | Displays a form to edit an existing Localidad entity. | [
"Displays",
"a",
"form",
"to",
"edit",
"an",
"existing",
"Localidad",
"entity",
"."
] | f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df | https://github.com/matudelatower/ubicacion-bundle/blob/f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df/Controller/LocalidadController.php#L73-L92 |
9,161 | matudelatower/ubicacion-bundle | Controller/LocalidadController.php | LocalidadController.deleteAction | public function deleteAction(Request $request, Localidad $localidad)
{
$form = $this->createDeleteForm($localidad);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->remove($localidad);
... | php | public function deleteAction(Request $request, Localidad $localidad)
{
$form = $this->createDeleteForm($localidad);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->remove($localidad);
... | [
"public",
"function",
"deleteAction",
"(",
"Request",
"$",
"request",
",",
"Localidad",
"$",
"localidad",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createDeleteForm",
"(",
"$",
"localidad",
")",
";",
"$",
"form",
"->",
"handleRequest",
"(",
"$",
"r... | Deletes a Localidad entity. | [
"Deletes",
"a",
"Localidad",
"entity",
"."
] | f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df | https://github.com/matudelatower/ubicacion-bundle/blob/f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df/Controller/LocalidadController.php#L98-L110 |
9,162 | matudelatower/ubicacion-bundle | Controller/LocalidadController.php | LocalidadController.createDeleteForm | private function createDeleteForm(Localidad $localidad)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('localidad_delete', array('id' => $localidad->getId())))
->setMethod('DELETE')
->getForm()
;
} | php | private function createDeleteForm(Localidad $localidad)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('localidad_delete', array('id' => $localidad->getId())))
->setMethod('DELETE')
->getForm()
;
} | [
"private",
"function",
"createDeleteForm",
"(",
"Localidad",
"$",
"localidad",
")",
"{",
"return",
"$",
"this",
"->",
"createFormBuilder",
"(",
")",
"->",
"setAction",
"(",
"$",
"this",
"->",
"generateUrl",
"(",
"'localidad_delete'",
",",
"array",
"(",
"'id'",... | Creates a form to delete a Localidad entity.
@param Localidad $localidad The Localidad entity
@return \Symfony\Component\Form\Form The form | [
"Creates",
"a",
"form",
"to",
"delete",
"a",
"Localidad",
"entity",
"."
] | f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df | https://github.com/matudelatower/ubicacion-bundle/blob/f2daef3f72ae3120386cb9fb8d67fc5fcbb5b5df/Controller/LocalidadController.php#L119-L126 |
9,163 | vutran/wpmvc-core | src/Models/View.php | View.setVars | public function setVars($vars)
{
// If vars is an array
if (is_array($vars) && count($vars)) {
// Iterate and set the var
foreach ($vars as $key => $value) {
$this->setVar($key, $value);
}
}
return $this;
} | php | public function setVars($vars)
{
// If vars is an array
if (is_array($vars) && count($vars)) {
// Iterate and set the var
foreach ($vars as $key => $value) {
$this->setVar($key, $value);
}
}
return $this;
} | [
"public",
"function",
"setVars",
"(",
"$",
"vars",
")",
"{",
"// If vars is an array",
"if",
"(",
"is_array",
"(",
"$",
"vars",
")",
"&&",
"count",
"(",
"$",
"vars",
")",
")",
"{",
"// Iterate and set the var",
"foreach",
"(",
"$",
"vars",
"as",
"$",
"ke... | Sets a variable for the view
@access public
@param array $vars
@return self | [
"Sets",
"a",
"variable",
"for",
"the",
"view"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/View.php#L116-L126 |
9,164 | vutran/wpmvc-core | src/Models/View.php | View.getVar | public function getVar($key)
{
return (array_key_exists($key, $this->vars)) ? $this->vars[$key] : null;
} | php | public function getVar($key)
{
return (array_key_exists($key, $this->vars)) ? $this->vars[$key] : null;
} | [
"public",
"function",
"getVar",
"(",
"$",
"key",
")",
"{",
"return",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"vars",
")",
")",
"?",
"$",
"this",
"->",
"vars",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Retrieves a stored variable
@access public
@param string $key The name of the variable
@return mixed | [
"Retrieves",
"a",
"stored",
"variable"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/View.php#L161-L164 |
9,165 | vutran/wpmvc-core | src/Models/View.php | View.get | public function get($key)
{
return array_key_exists($key, $this->vars) ? $this->vars[$key] : null;
} | php | public function get($key)
{
return array_key_exists($key, $this->vars) ? $this->vars[$key] : null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"return",
"array_key_exists",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"vars",
")",
"?",
"$",
"this",
"->",
"vars",
"[",
"$",
"key",
"]",
":",
"null",
";",
"}"
] | Retrieve a view variable
@access public
@param string $key
@return mixed | [
"Retrieve",
"a",
"view",
"variable"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/View.php#L194-L197 |
9,166 | vutran/wpmvc-core | src/Models/View.php | View.output | public function output()
{
// If the view file exists
if ($this->hasFile()) {
// Extract all view variables
extract($this->getVars());
ob_start();
include($this->getPath() . '/' . $this->getFile(true));
$html = ob_get_contents();
... | php | public function output()
{
// If the view file exists
if ($this->hasFile()) {
// Extract all view variables
extract($this->getVars());
ob_start();
include($this->getPath() . '/' . $this->getFile(true));
$html = ob_get_contents();
... | [
"public",
"function",
"output",
"(",
")",
"{",
"// If the view file exists",
"if",
"(",
"$",
"this",
"->",
"hasFile",
"(",
")",
")",
"{",
"// Extract all view variables",
"extract",
"(",
"$",
"this",
"->",
"getVars",
"(",
")",
")",
";",
"ob_start",
"(",
")... | Retrieve's the view output
@access public
@return string | [
"Retrieve",
"s",
"the",
"view",
"output"
] | 4081be36116ae8e79abfd182d783d28d0fb42219 | https://github.com/vutran/wpmvc-core/blob/4081be36116ae8e79abfd182d783d28d0fb42219/src/Models/View.php#L205-L219 |
9,167 | zepi/turbo-base | Zepi/Core/Language/src/Manager/TranslationManager.php | TranslationManager.translate | public function translate($string, $namespace, $arguments = array())
{
// Load the language file for the given namespace if the language file isn't loaded
if (!isset($this->translatedStrings[$namespace]) || !is_array($this->translatedStrings[$namespace])) {
$this->loadLanguageFileForName... | php | public function translate($string, $namespace, $arguments = array())
{
// Load the language file for the given namespace if the language file isn't loaded
if (!isset($this->translatedStrings[$namespace]) || !is_array($this->translatedStrings[$namespace])) {
$this->loadLanguageFileForName... | [
"public",
"function",
"translate",
"(",
"$",
"string",
",",
"$",
"namespace",
",",
"$",
"arguments",
"=",
"array",
"(",
")",
")",
"{",
"// Load the language file for the given namespace if the language file isn't loaded",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
... | Returns the translated version of the given string. If no
translation is available, the function will return the given
string back.
@access public
@param string $string
@param string $namespace
@param array $arguments
@return string | [
"Returns",
"the",
"translated",
"version",
"of",
"the",
"given",
"string",
".",
"If",
"no",
"translation",
"is",
"available",
"the",
"function",
"will",
"return",
"the",
"given",
"string",
"back",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Core/Language/src/Manager/TranslationManager.php#L96-L110 |
9,168 | zepi/turbo-base | Zepi/Core/Language/src/Manager/TranslationManager.php | TranslationManager.replacePlaceholders | protected function replacePlaceholders($string, $arguments)
{
if (count($arguments) == 0) {
return $string;
}
foreach ($arguments as $key => $value) {
$string = str_replace('%' . $key . '%', $value, $string);
}
return $string;
} | php | protected function replacePlaceholders($string, $arguments)
{
if (count($arguments) == 0) {
return $string;
}
foreach ($arguments as $key => $value) {
$string = str_replace('%' . $key . '%', $value, $string);
}
return $string;
} | [
"protected",
"function",
"replacePlaceholders",
"(",
"$",
"string",
",",
"$",
"arguments",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"arguments",
")",
"==",
"0",
")",
"{",
"return",
"$",
"string",
";",
"}",
"foreach",
"(",
"$",
"arguments",
"as",
"$",
... | Replaces the placeholders in the string with the correct values
@access protected
@param string $string
@param array $arguments
@return string | [
"Replaces",
"the",
"placeholders",
"in",
"the",
"string",
"with",
"the",
"correct",
"values"
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Core/Language/src/Manager/TranslationManager.php#L120-L131 |
9,169 | zepi/turbo-base | Zepi/Core/Language/src/Manager/TranslationManager.php | TranslationManager.loadLanguageFileForNamespace | protected function loadLanguageFileForNamespace($namespace)
{
$loadedLocale = $this->request->getLocale();
$content = $this->languageFileManager->loadTranslationFileContent($namespace, $loadedLocale);
// If the received content is empty return false
if ($content === false) {... | php | protected function loadLanguageFileForNamespace($namespace)
{
$loadedLocale = $this->request->getLocale();
$content = $this->languageFileManager->loadTranslationFileContent($namespace, $loadedLocale);
// If the received content is empty return false
if ($content === false) {... | [
"protected",
"function",
"loadLanguageFileForNamespace",
"(",
"$",
"namespace",
")",
"{",
"$",
"loadedLocale",
"=",
"$",
"this",
"->",
"request",
"->",
"getLocale",
"(",
")",
";",
"$",
"content",
"=",
"$",
"this",
"->",
"languageFileManager",
"->",
"loadTransl... | Searches all language files which should be loaded for the
requested locale.
@access protected
@param string $namespace | [
"Searches",
"all",
"language",
"files",
"which",
"should",
"be",
"loaded",
"for",
"the",
"requested",
"locale",
"."
] | 9a36d8c7649317f55f91b2adf386bd1f04ec02a3 | https://github.com/zepi/turbo-base/blob/9a36d8c7649317f55f91b2adf386bd1f04ec02a3/Zepi/Core/Language/src/Manager/TranslationManager.php#L140-L167 |
9,170 | JumpGateio/Database | src/JumpGate/Database/Traits/Collection/Helpers.php | Helpers.explode | public static function explode($delimiter, $string, $limit = null)
{
$array = explode($delimiter, $string);
if (! is_null($limit)) {
$array = explode($delimiter, $string, $limit);
}
return new static($array);
} | php | public static function explode($delimiter, $string, $limit = null)
{
$array = explode($delimiter, $string);
if (! is_null($limit)) {
$array = explode($delimiter, $string, $limit);
}
return new static($array);
} | [
"public",
"static",
"function",
"explode",
"(",
"$",
"delimiter",
",",
"$",
"string",
",",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"array",
"=",
"explode",
"(",
"$",
"delimiter",
",",
"$",
"string",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
... | Explode a string and return a collection.
@param string $delimiter
@param string $string
@param int $limit
@return $this | [
"Explode",
"a",
"string",
"and",
"return",
"a",
"collection",
"."
] | 0d857a1fa85a66dfe380ab153feaa3b167339822 | https://github.com/JumpGateio/Database/blob/0d857a1fa85a66dfe380ab153feaa3b167339822/src/JumpGate/Database/Traits/Collection/Helpers.php#L36-L45 |
9,171 | JumpGateio/Database | src/JumpGate/Database/Traits/Collection/Helpers.php | Helpers.parseMixed | public static function parseMixed($items, $delimiter = ',')
{
// Convert delimiter separated item strings
// @example: foo,bar,baz => [foo, bar, baz]
if (is_string($items)) {
if (is_string($delimiter)) {
$delimiters = str_split($delimiter);
}
... | php | public static function parseMixed($items, $delimiter = ',')
{
// Convert delimiter separated item strings
// @example: foo,bar,baz => [foo, bar, baz]
if (is_string($items)) {
if (is_string($delimiter)) {
$delimiters = str_split($delimiter);
}
... | [
"public",
"static",
"function",
"parseMixed",
"(",
"$",
"items",
",",
"$",
"delimiter",
"=",
"','",
")",
"{",
"// Convert delimiter separated item strings",
"// @example: foo,bar,baz => [foo, bar, baz]",
"if",
"(",
"is_string",
"(",
"$",
"items",
")",
")",
"{",
"if"... | Creates a new Collection from a mixed variable.
Strings are assumed to be delimiter separated and are converted to arrays.
@param mixed $items The values to include as items in the collection
@param string|array $delimiter (optional) for array parsing
@return $this | [
"Creates",
"a",
"new",
"Collection",
"from",
"a",
"mixed",
"variable",
".",
"Strings",
"are",
"assumed",
"to",
"be",
"delimiter",
"separated",
"and",
"are",
"converted",
"to",
"arrays",
"."
] | 0d857a1fa85a66dfe380ab153feaa3b167339822 | https://github.com/JumpGateio/Database/blob/0d857a1fa85a66dfe380ab153feaa3b167339822/src/JumpGate/Database/Traits/Collection/Helpers.php#L56-L89 |
9,172 | BR0kEN-/environment-loader | src/EnvironmentLoader.php | EnvironmentLoader.addEnvironmentReader | public function addEnvironmentReader(array $arguments = [])
{
// Full namespace: <EXTENSION_NAMESPACE>\Environment\<EXTENSION_CONFIG_KEY>EnvironmentReader.
// For example we have registered extension at namespace: "Behat\TqExtension". Class, which
// implements extension interface, located a... | php | public function addEnvironmentReader(array $arguments = [])
{
// Full namespace: <EXTENSION_NAMESPACE>\Environment\<EXTENSION_CONFIG_KEY>EnvironmentReader.
// For example we have registered extension at namespace: "Behat\TqExtension". Class, which
// implements extension interface, located a... | [
"public",
"function",
"addEnvironmentReader",
"(",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"// Full namespace: <EXTENSION_NAMESPACE>\\Environment\\<EXTENSION_CONFIG_KEY>EnvironmentReader.",
"// For example we have registered extension at namespace: \"Behat\\TqExtension\". Class... | Implement extension's own environment reader.
@param array $arguments | [
"Implement",
"extension",
"s",
"own",
"environment",
"reader",
"."
] | 420b282b34ee4cb4281abb6ac347e6c2ac2ff778 | https://github.com/BR0kEN-/environment-loader/blob/420b282b34ee4cb4281abb6ac347e6c2ac2ff778/src/EnvironmentLoader.php#L112-L127 |
9,173 | BR0kEN-/environment-loader | src/EnvironmentLoader.php | EnvironmentLoader.load | public function load()
{
foreach ($this->definitions as $tag => $definition) {
$this->extendContainer($tag, $definition);
}
} | php | public function load()
{
foreach ($this->definitions as $tag => $definition) {
$this->extendContainer($tag, $definition);
}
} | [
"public",
"function",
"load",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"definitions",
"as",
"$",
"tag",
"=>",
"$",
"definition",
")",
"{",
"$",
"this",
"->",
"extendContainer",
"(",
"$",
"tag",
",",
"$",
"definition",
")",
";",
"}",
"}"
] | Extend DI container by dependencies. | [
"Extend",
"DI",
"container",
"by",
"dependencies",
"."
] | 420b282b34ee4cb4281abb6ac347e6c2ac2ff778 | https://github.com/BR0kEN-/environment-loader/blob/420b282b34ee4cb4281abb6ac347e6c2ac2ff778/src/EnvironmentLoader.php#L132-L137 |
9,174 | BR0kEN-/environment-loader | src/EnvironmentLoader.php | EnvironmentLoader.addDefinition | private function addDefinition($subNamespace, $objectType, $interface, $tag, array $arguments = [])
{
$class = sprintf($this->classPath, $subNamespace) . $subNamespace . $objectType;
if (!class_exists($class)) {
throw new \RuntimeException(sprintf('Class "%s" does not exists!', $class))... | php | private function addDefinition($subNamespace, $objectType, $interface, $tag, array $arguments = [])
{
$class = sprintf($this->classPath, $subNamespace) . $subNamespace . $objectType;
if (!class_exists($class)) {
throw new \RuntimeException(sprintf('Class "%s" does not exists!', $class))... | [
"private",
"function",
"addDefinition",
"(",
"$",
"subNamespace",
",",
"$",
"objectType",
",",
"$",
"interface",
",",
"$",
"tag",
",",
"array",
"$",
"arguments",
"=",
"[",
"]",
")",
"{",
"$",
"class",
"=",
"sprintf",
"(",
"$",
"this",
"->",
"classPath"... | Add dependency definition for DI container.
@param string $subNamespace
@param string $objectType
@param string $interface
@param string $tag
@param array $arguments | [
"Add",
"dependency",
"definition",
"for",
"DI",
"container",
"."
] | 420b282b34ee4cb4281abb6ac347e6c2ac2ff778 | https://github.com/BR0kEN-/environment-loader/blob/420b282b34ee4cb4281abb6ac347e6c2ac2ff778/src/EnvironmentLoader.php#L148-L161 |
9,175 | BR0kEN-/environment-loader | src/EnvironmentLoader.php | EnvironmentLoader.extendContainer | private function extendContainer($tag, Definition $definition, $identifier = '')
{
if ('' !== $identifier) {
$identifier .= '.';
}
$this->container
->setDefinition("$this->configKey.$identifier$tag", $definition)
->addTag($tag);
} | php | private function extendContainer($tag, Definition $definition, $identifier = '')
{
if ('' !== $identifier) {
$identifier .= '.';
}
$this->container
->setDefinition("$this->configKey.$identifier$tag", $definition)
->addTag($tag);
} | [
"private",
"function",
"extendContainer",
"(",
"$",
"tag",
",",
"Definition",
"$",
"definition",
",",
"$",
"identifier",
"=",
"''",
")",
"{",
"if",
"(",
"''",
"!==",
"$",
"identifier",
")",
"{",
"$",
"identifier",
".=",
"'.'",
";",
"}",
"$",
"this",
... | Add dependency to DI container.
@param string $tag
@param Definition $definition
@param string $identifier | [
"Add",
"dependency",
"to",
"DI",
"container",
"."
] | 420b282b34ee4cb4281abb6ac347e6c2ac2ff778 | https://github.com/BR0kEN-/environment-loader/blob/420b282b34ee4cb4281abb6ac347e6c2ac2ff778/src/EnvironmentLoader.php#L170-L179 |
9,176 | studyportals/SQL | src/PostGres.php | PostGres.unserialize | public function unserialize($data)
{
list(
$this->_server,
$this->_username,
$this->_password,
$this->_database,
$this->_port,
) = unserialize($data);
$this->_connect();
} | php | public function unserialize($data)
{
list(
$this->_server,
$this->_username,
$this->_password,
$this->_database,
$this->_port,
) = unserialize($data);
$this->_connect();
} | [
"public",
"function",
"unserialize",
"(",
"$",
"data",
")",
"{",
"list",
"(",
"$",
"this",
"->",
"_server",
",",
"$",
"this",
"->",
"_username",
",",
"$",
"this",
"->",
"_password",
",",
"$",
"this",
"->",
"_database",
",",
"$",
"this",
"->",
"_port"... | Function unserialize.
@param string $data
@throws ConnectionException
@return void | [
"Function",
"unserialize",
"."
] | 4f038ced9a3738c1d4ad562f93547812931d9ed4 | https://github.com/studyportals/SQL/blob/4f038ced9a3738c1d4ad562f93547812931d9ed4/src/PostGres.php#L85-L97 |
9,177 | studyportals/SQL | src/PostGres.php | PostGres.query | public function query($query, $return_set = false, $buffered = true)
{
$this->_result = null;
$query = trim($query);
$this->_result = @pg_query($this->_connection, $query);
// Invalid Query
if (!$this->_result) {
$error_message = @\pg_last_error($this->_conne... | php | public function query($query, $return_set = false, $buffered = true)
{
$this->_result = null;
$query = trim($query);
$this->_result = @pg_query($this->_connection, $query);
// Invalid Query
if (!$this->_result) {
$error_message = @\pg_last_error($this->_conne... | [
"public",
"function",
"query",
"(",
"$",
"query",
",",
"$",
"return_set",
"=",
"false",
",",
"$",
"buffered",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"_result",
"=",
"null",
";",
"$",
"query",
"=",
"trim",
"(",
"$",
"query",
")",
";",
"$",
"thi... | Send a query to the PostGres server.
<p>For <strong>SELECT</strong>-queries: If the query has a result, this
method returns either {@link SQLResultRow} or {@link SQLResultSet}
instance, depending on the number of results. If no results are available
the method returns <em>false</em>.</p>
<p>For all other queries: If ... | [
"Send",
"a",
"query",
"to",
"the",
"PostGres",
"server",
"."
] | 4f038ced9a3738c1d4ad562f93547812931d9ed4 | https://github.com/studyportals/SQL/blob/4f038ced9a3738c1d4ad562f93547812931d9ed4/src/PostGres.php#L160-L237 |
9,178 | webriq/core | module/Paragraph/src/Grid/Paragraph/View/Helper/MetaContent.php | MetaContent.renderMetaContent | public function renderMetaContent( $name, $content = '' )
{
$view = $this->getView();
$middle = $this->getMiddleLayoutModel();
$paragraph = $middle->getParagraphModel();
$renderList = $paragraph->findRenderList( $name );
if ( empty( $renderList ) )
{
... | php | public function renderMetaContent( $name, $content = '' )
{
$view = $this->getView();
$middle = $this->getMiddleLayoutModel();
$paragraph = $middle->getParagraphModel();
$renderList = $paragraph->findRenderList( $name );
if ( empty( $renderList ) )
{
... | [
"public",
"function",
"renderMetaContent",
"(",
"$",
"name",
",",
"$",
"content",
"=",
"''",
")",
"{",
"$",
"view",
"=",
"$",
"this",
"->",
"getView",
"(",
")",
";",
"$",
"middle",
"=",
"$",
"this",
"->",
"getMiddleLayoutModel",
"(",
")",
";",
"$",
... | Set meta-content
@param string $name
@param string $content
@return string | [
"Set",
"meta",
"-",
"content"
] | cfeb6e8a4732561c2215ec94e736c07f9b8bc990 | https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/View/Helper/MetaContent.php#L78-L127 |
9,179 | novuso/common | src/Domain/EventSourcing/EventSourcedAggregateRoot.php | EventSourcedAggregateRoot.reconstitute | public static function reconstitute(iterable $eventRecords)
{
$reflection = new ReflectionClass(static::class);
/** @var EventSourcedAggregateRoot $aggregate */
$aggregate = $reflection->newInstanceWithoutConstructor();
$lastSequence = null;
/** @var EventRecord $eventRecor... | php | public static function reconstitute(iterable $eventRecords)
{
$reflection = new ReflectionClass(static::class);
/** @var EventSourcedAggregateRoot $aggregate */
$aggregate = $reflection->newInstanceWithoutConstructor();
$lastSequence = null;
/** @var EventRecord $eventRecor... | [
"public",
"static",
"function",
"reconstitute",
"(",
"iterable",
"$",
"eventRecords",
")",
"{",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"static",
"::",
"class",
")",
";",
"/** @var EventSourcedAggregateRoot $aggregate */",
"$",
"aggregate",
"=",
"$",
... | Creates instance from an event stream history
Override to customize instantiation without using reflection.
@param iterable $eventRecords The event records
@return EventSourcedAggregateRoot | [
"Creates",
"instance",
"from",
"an",
"event",
"stream",
"history"
] | 7d0e5a4f4c79c9622e068efc8b7c70815c460863 | https://github.com/novuso/common/blob/7d0e5a4f4c79c9622e068efc8b7c70815c460863/src/Domain/EventSourcing/EventSourcedAggregateRoot.php#L30-L49 |
9,180 | gibboncms/config | src/ConfigRepository.php | ConfigRepository.build | public function build()
{
$files = $this->filesystem->listFiles($this->directory);
$this->cache->clear();
foreach ($files as $file) {
if ($file['extension'] == 'yml' || $file['extension'] == 'yaml') {
$this->cache->put($file['filename'], $this->yaml->parse($this... | php | public function build()
{
$files = $this->filesystem->listFiles($this->directory);
$this->cache->clear();
foreach ($files as $file) {
if ($file['extension'] == 'yml' || $file['extension'] == 'yaml') {
$this->cache->put($file['filename'], $this->yaml->parse($this... | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"filesystem",
"->",
"listFiles",
"(",
"$",
"this",
"->",
"directory",
")",
";",
"$",
"this",
"->",
"cache",
"->",
"clear",
"(",
")",
";",
"foreach",
"(",
"$",
"file... | Parse the config files and save the values in the cache and in memory
@return void | [
"Parse",
"the",
"config",
"files",
"and",
"save",
"the",
"values",
"in",
"the",
"cache",
"and",
"in",
"memory"
] | 05e9a830173004770a1d26e3429b82adf0a52a11 | https://github.com/gibboncms/config/blob/05e9a830173004770a1d26e3429b82adf0a52a11/src/ConfigRepository.php#L106-L120 |
9,181 | superdweebie/exception-module | src/Sds/ExceptionModule/JsonExceptionStrategy.php | JsonExceptionStrategy.prepareExceptionViewModel | public function prepareExceptionViewModel(MvcEvent $e)
{
// Do nothing if no error in the event
if ( ! ($error = $e->getError())) {
return;
}
// Do nothing if the result is a response object
$result = $e->getResult();
if ($result instanceof Response) {
... | php | public function prepareExceptionViewModel(MvcEvent $e)
{
// Do nothing if no error in the event
if ( ! ($error = $e->getError())) {
return;
}
// Do nothing if the result is a response object
$result = $e->getResult();
if ($result instanceof Response) {
... | [
"public",
"function",
"prepareExceptionViewModel",
"(",
"MvcEvent",
"$",
"e",
")",
"{",
"// Do nothing if no error in the event",
"if",
"(",
"!",
"(",
"$",
"error",
"=",
"$",
"e",
"->",
"getError",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"// Do nothing ... | Create an exception json view model, and set the HTTP status code
@todo dispatch.error does not halt dispatch unless a response is
returned. As such, we likely need to trigger rendering as a low
priority dispatch.error event (or goto a render event) to ensure
rendering occurs, and that munging of view models occurs ... | [
"Create",
"an",
"exception",
"json",
"view",
"model",
"and",
"set",
"the",
"HTTP",
"status",
"code"
] | 49a6197a9c34920b84954c8cf04f48b69dd584cd | https://github.com/superdweebie/exception-module/blob/49a6197a9c34920b84954c8cf04f48b69dd584cd/src/Sds/ExceptionModule/JsonExceptionStrategy.php#L64-L110 |
9,182 | SagePHP/Configuration | src/SagePHP/Configuration/HostsFile.php | HostsFile.removeHost | public function removeHost($host)
{
$ips = $this->getIp($host);
unset($this->hosts[$host]);
foreach ($ips as $ip) {
unset($this->ips[$ip][$host]);
}
} | php | public function removeHost($host)
{
$ips = $this->getIp($host);
unset($this->hosts[$host]);
foreach ($ips as $ip) {
unset($this->ips[$ip][$host]);
}
} | [
"public",
"function",
"removeHost",
"(",
"$",
"host",
")",
"{",
"$",
"ips",
"=",
"$",
"this",
"->",
"getIp",
"(",
"$",
"host",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"hosts",
"[",
"$",
"host",
"]",
")",
";",
"foreach",
"(",
"$",
"ips",
"as"... | removes an host.
@param string $host | [
"removes",
"an",
"host",
"."
] | d85eaca679df50a424e2ab10ec8234930cb8e4c1 | https://github.com/SagePHP/Configuration/blob/d85eaca679df50a424e2ab10ec8234930cb8e4c1/src/SagePHP/Configuration/HostsFile.php#L173-L180 |
9,183 | SagePHP/Configuration | src/SagePHP/Configuration/HostsFile.php | HostsFile.removeIp | public function removeIp($ip)
{
$hosts = $this->getHosts($ip);
unset($this->ips[$ip]);
foreach ($hosts as $host) {
unset($this->hosts[$host]);
}
} | php | public function removeIp($ip)
{
$hosts = $this->getHosts($ip);
unset($this->ips[$ip]);
foreach ($hosts as $host) {
unset($this->hosts[$host]);
}
} | [
"public",
"function",
"removeIp",
"(",
"$",
"ip",
")",
"{",
"$",
"hosts",
"=",
"$",
"this",
"->",
"getHosts",
"(",
"$",
"ip",
")",
";",
"unset",
"(",
"$",
"this",
"->",
"ips",
"[",
"$",
"ip",
"]",
")",
";",
"foreach",
"(",
"$",
"hosts",
"as",
... | removes an ip and all associated hosts
@param [type] $ip [description]
@return [type] [description] | [
"removes",
"an",
"ip",
"and",
"all",
"associated",
"hosts"
] | d85eaca679df50a424e2ab10ec8234930cb8e4c1 | https://github.com/SagePHP/Configuration/blob/d85eaca679df50a424e2ab10ec8234930cb8e4c1/src/SagePHP/Configuration/HostsFile.php#L187-L195 |
9,184 | SagePHP/Configuration | src/SagePHP/Configuration/HostsFile.php | HostsFile.getContent | public function getContent()
{
$this->processFile($this->getFile());
$buffer = array(
'#',
'# Generated by SagePHP HostsFile Component',
'# see https://github.com/SagePHP/',
'#',
'',
);
foreach ($this->ips as $ip => $hosts... | php | public function getContent()
{
$this->processFile($this->getFile());
$buffer = array(
'#',
'# Generated by SagePHP HostsFile Component',
'# see https://github.com/SagePHP/',
'#',
'',
);
foreach ($this->ips as $ip => $hosts... | [
"public",
"function",
"getContent",
"(",
")",
"{",
"$",
"this",
"->",
"processFile",
"(",
"$",
"this",
"->",
"getFile",
"(",
")",
")",
";",
"$",
"buffer",
"=",
"array",
"(",
"'#'",
",",
"'# Generated by SagePHP HostsFile Component'",
",",
"'# see https://githu... | Returns the formatted filr contend
@return string | [
"Returns",
"the",
"formatted",
"filr",
"contend"
] | d85eaca679df50a424e2ab10ec8234930cb8e4c1 | https://github.com/SagePHP/Configuration/blob/d85eaca679df50a424e2ab10ec8234930cb8e4c1/src/SagePHP/Configuration/HostsFile.php#L227-L244 |
9,185 | nodes-php/core | src/AbstractServiceProvider.php | AbstractServiceProvider.install | final public function install()
{
// Initiate Flysystem
$this->files = new Filesystem();
// Make sure we have the Console Output style
// before continuing with the install sequence
if (empty($this->getCommand())) {
throw new InstallPackageException('Could not ru... | php | final public function install()
{
// Initiate Flysystem
$this->files = new Filesystem();
// Make sure we have the Console Output style
// before continuing with the install sequence
if (empty($this->getCommand())) {
throw new InstallPackageException('Could not ru... | [
"final",
"public",
"function",
"install",
"(",
")",
"{",
"// Initiate Flysystem",
"$",
"this",
"->",
"files",
"=",
"new",
"Filesystem",
"(",
")",
";",
"// Make sure we have the Console Output style",
"// before continuing with the install sequence",
"if",
"(",
"empty",
... | Install service provider.
@author Morten Rugaard <moru@nodes.dk>
@final
@throws \Nodes\Exceptions\InstallPackageException
@return void | [
"Install",
"service",
"provider",
"."
] | fc788bb3e9668872573838099f868ab162eb8a96 | https://github.com/nodes-php/core/blob/fc788bb3e9668872573838099f868ab162eb8a96/src/AbstractServiceProvider.php#L145-L166 |
9,186 | nodes-php/core | src/AbstractServiceProvider.php | AbstractServiceProvider.runDatabaseMigrationsAndSeeders | final protected function runDatabaseMigrationsAndSeeders()
{
// Ask to migrate the database,
// if we've copied any migration files to the application.
if (!empty($this->migrations) && $this->getCommand()->confirm('Do you wish to migrate your database?', true)) {
try {
... | php | final protected function runDatabaseMigrationsAndSeeders()
{
// Ask to migrate the database,
// if we've copied any migration files to the application.
if (!empty($this->migrations) && $this->getCommand()->confirm('Do you wish to migrate your database?', true)) {
try {
... | [
"final",
"protected",
"function",
"runDatabaseMigrationsAndSeeders",
"(",
")",
"{",
"// Ask to migrate the database,",
"// if we've copied any migration files to the application.",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"migrations",
")",
"&&",
"$",
"this",
"->"... | Run database migrations and seeders.
@author Morten Rugaard <moru@nodes.dk>
@return void | [
"Run",
"database",
"migrations",
"and",
"seeders",
"."
] | fc788bb3e9668872573838099f868ab162eb8a96 | https://github.com/nodes-php/core/blob/fc788bb3e9668872573838099f868ab162eb8a96/src/AbstractServiceProvider.php#L339-L380 |
9,187 | nodes-php/core | src/AbstractServiceProvider.php | AbstractServiceProvider.publishFile | final protected function publishFile($from, $to)
{
// If destination directory doesn't exist,
// we'll create before copying the config files
$directoryDestination = dirname($to);
if (!$this->files->isDirectory($directoryDestination)) {
$this->files->makeDirectory($direct... | php | final protected function publishFile($from, $to)
{
// If destination directory doesn't exist,
// we'll create before copying the config files
$directoryDestination = dirname($to);
if (!$this->files->isDirectory($directoryDestination)) {
$this->files->makeDirectory($direct... | [
"final",
"protected",
"function",
"publishFile",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"// If destination directory doesn't exist,",
"// we'll create before copying the config files",
"$",
"directoryDestination",
"=",
"dirname",
"(",
"$",
"to",
")",
";",
"if",
"... | Publish file to application.
@author Morten Rugaard <moru@nodes.dk>
@param string $from
@param string $to
@return void | [
"Publish",
"file",
"to",
"application",
"."
] | fc788bb3e9668872573838099f868ab162eb8a96 | https://github.com/nodes-php/core/blob/fc788bb3e9668872573838099f868ab162eb8a96/src/AbstractServiceProvider.php#L419-L436 |
9,188 | nodes-php/core | src/AbstractServiceProvider.php | AbstractServiceProvider.publishDirectory | final protected function publishDirectory($from, $to)
{
// Load mount manager
$manager = new MountManager([
'from' => new Flysystem(new LocalAdapter($from)),
'to' => new Flysystem(new LocalAdapter($to)),
]);
// Copy directory to application
foreach ... | php | final protected function publishDirectory($from, $to)
{
// Load mount manager
$manager = new MountManager([
'from' => new Flysystem(new LocalAdapter($from)),
'to' => new Flysystem(new LocalAdapter($to)),
]);
// Copy directory to application
foreach ... | [
"final",
"protected",
"function",
"publishDirectory",
"(",
"$",
"from",
",",
"$",
"to",
")",
"{",
"// Load mount manager",
"$",
"manager",
"=",
"new",
"MountManager",
"(",
"[",
"'from'",
"=>",
"new",
"Flysystem",
"(",
"new",
"LocalAdapter",
"(",
"$",
"from",... | Publish directory to application.
@author Morten Rugaard <moru@nodes.dk>
@param string $from
@param string $to
@return void | [
"Publish",
"directory",
"to",
"application",
"."
] | fc788bb3e9668872573838099f868ab162eb8a96 | https://github.com/nodes-php/core/blob/fc788bb3e9668872573838099f868ab162eb8a96/src/AbstractServiceProvider.php#L448-L469 |
9,189 | vinala/kernel | src/MVC/Relations/BelongsTo.php | BelongsTo.ini | public function ini($related, $model, $local = null, $remote = null)
{
$this->setCurrent($model);
$this->checkModels($related);
//
if ($this->isOneToOne($related, $model, $local, $remote)) {
return $this->prepare($this->OneToOne($related, $model, $local, $remote));
... | php | public function ini($related, $model, $local = null, $remote = null)
{
$this->setCurrent($model);
$this->checkModels($related);
//
if ($this->isOneToOne($related, $model, $local, $remote)) {
return $this->prepare($this->OneToOne($related, $model, $local, $remote));
... | [
"public",
"function",
"ini",
"(",
"$",
"related",
",",
"$",
"model",
",",
"$",
"local",
"=",
"null",
",",
"$",
"remote",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setCurrent",
"(",
"$",
"model",
")",
";",
"$",
"this",
"->",
"checkModels",
"(",
"... | The belongs to relation.
@param $model : the model wanted to be related to the
current model
@param $local : if not null would be the local column
of the relation
@param $remote : if not null would be the $remote column
of the relation | [
"The",
"belongs",
"to",
"relation",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Relations/BelongsTo.php#L42-L52 |
9,190 | vinala/kernel | src/MVC/Relations/BelongsTo.php | BelongsTo.setCurrent | protected function setCurrent($model)
{
$this->currentModel = get_class($model);
$this->currentTable = $this->getTable($model);
} | php | protected function setCurrent($model)
{
$this->currentModel = get_class($model);
$this->currentTable = $this->getTable($model);
} | [
"protected",
"function",
"setCurrent",
"(",
"$",
"model",
")",
"{",
"$",
"this",
"->",
"currentModel",
"=",
"get_class",
"(",
"$",
"model",
")",
";",
"$",
"this",
"->",
"currentTable",
"=",
"$",
"this",
"->",
"getTable",
"(",
"$",
"model",
")",
";",
... | set current model name and data table name.
@param $model object | [
"set",
"current",
"model",
"name",
"and",
"data",
"table",
"name",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Relations/BelongsTo.php#L111-L115 |
9,191 | vinala/kernel | src/MVC/Relations/BelongsTo.php | BelongsTo.oneRelationValue | protected function oneRelationValue($related, $model, $column = null)
{
$table = $this->checkModelType($model);
//
return $model->{!is_null($column) ? $column : $this->idKey($table)};
} | php | protected function oneRelationValue($related, $model, $column = null)
{
$table = $this->checkModelType($model);
//
return $model->{!is_null($column) ? $column : $this->idKey($table)};
} | [
"protected",
"function",
"oneRelationValue",
"(",
"$",
"related",
",",
"$",
"model",
",",
"$",
"column",
"=",
"null",
")",
"{",
"$",
"table",
"=",
"$",
"this",
"->",
"checkModelType",
"(",
"$",
"model",
")",
";",
"//",
"return",
"$",
"model",
"->",
"... | get the value of column of the relation.
@param $column : name of the column
@param $model : name of the model | [
"get",
"the",
"value",
"of",
"column",
"of",
"the",
"relation",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Relations/BelongsTo.php#L150-L155 |
9,192 | vinala/kernel | src/MVC/Relations/BelongsTo.php | BelongsTo.checkModelType | protected function checkModelType($model)
{
if (is_string($model)) {
return $this->getTable($model);
} elseif (is_object($model)) {
return $this->getTable(get_class($model));
}
} | php | protected function checkModelType($model)
{
if (is_string($model)) {
return $this->getTable($model);
} elseif (is_object($model)) {
return $this->getTable(get_class($model));
}
} | [
"protected",
"function",
"checkModelType",
"(",
"$",
"model",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"model",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getTable",
"(",
"$",
"model",
")",
";",
"}",
"elseif",
"(",
"is_object",
"(",
"$",
"model"... | get database table.
@param $model : mixed | [
"get",
"database",
"table",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Relations/BelongsTo.php#L243-L250 |
9,193 | vinala/kernel | src/MVC/Relations/BelongsTo.php | BelongsTo.getType | protected function getType($model, $related, $local, $remote)
{
$modelObject = new $model();
$remoteObject = new $related();
//
$tablemodel = $this->getTable($modelObject);
$tableremote = $this->getTable($remoteObject);
//
if (is_null($local) && is_null($remot... | php | protected function getType($model, $related, $local, $remote)
{
$modelObject = new $model();
$remoteObject = new $related();
//
$tablemodel = $this->getTable($modelObject);
$tableremote = $this->getTable($remoteObject);
//
if (is_null($local) && is_null($remot... | [
"protected",
"function",
"getType",
"(",
"$",
"model",
",",
"$",
"related",
",",
"$",
"local",
",",
"$",
"remote",
")",
"{",
"$",
"modelObject",
"=",
"new",
"$",
"model",
"(",
")",
";",
"$",
"remoteObject",
"=",
"new",
"$",
"related",
"(",
")",
";"... | get the type of relation.
@param $model string | [
"get",
"the",
"type",
"of",
"relation",
"."
] | 346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a | https://github.com/vinala/kernel/blob/346c8a4dca48fd1ab88fdc9f7004ecb7bce6a67a/src/MVC/Relations/BelongsTo.php#L267-L290 |
9,194 | cyberspectrum/i18n | src/Configuration/DefinitionBuilder/CopyJobDefinitionBuilder.php | CopyJobDefinitionBuilder.getDictionaryOverrides | private function getDictionaryOverrides(array &$data): array
{
$overrides = [];
foreach (['source_language', 'target_language'] as $key) {
if (array_key_exists($key, $data)) {
$overrides[$key] = $data[$key];
unset($data[$key]);
}
}
... | php | private function getDictionaryOverrides(array &$data): array
{
$overrides = [];
foreach (['source_language', 'target_language'] as $key) {
if (array_key_exists($key, $data)) {
$overrides[$key] = $data[$key];
unset($data[$key]);
}
}
... | [
"private",
"function",
"getDictionaryOverrides",
"(",
"array",
"&",
"$",
"data",
")",
":",
"array",
"{",
"$",
"overrides",
"=",
"[",
"]",
";",
"foreach",
"(",
"[",
"'source_language'",
",",
"'target_language'",
"]",
"as",
"$",
"key",
")",
"{",
"if",
"(",... | Obtain the overrides for a dictionary.
@param array $data The job configuration data.
@return array | [
"Obtain",
"the",
"overrides",
"for",
"a",
"dictionary",
"."
] | 138e81d7119db82c2420bd33967a566e02b1d2f5 | https://github.com/cyberspectrum/i18n/blob/138e81d7119db82c2420bd33967a566e02b1d2f5/src/Configuration/DefinitionBuilder/CopyJobDefinitionBuilder.php#L67-L78 |
9,195 | cyberspectrum/i18n | src/Configuration/DefinitionBuilder/CopyJobDefinitionBuilder.php | CopyJobDefinitionBuilder.makeDictionary | private function makeDictionary(
Configuration $configuration,
$dictionary,
array $overrides,
string $path
): ExtendedDictionaryDefinition {
$name = $dictionary;
if (is_array($dictionary)) {
if (!isset($dictionary['name'])) {
throw new \Inv... | php | private function makeDictionary(
Configuration $configuration,
$dictionary,
array $overrides,
string $path
): ExtendedDictionaryDefinition {
$name = $dictionary;
if (is_array($dictionary)) {
if (!isset($dictionary['name'])) {
throw new \Inv... | [
"private",
"function",
"makeDictionary",
"(",
"Configuration",
"$",
"configuration",
",",
"$",
"dictionary",
",",
"array",
"$",
"overrides",
",",
"string",
"$",
"path",
")",
":",
"ExtendedDictionaryDefinition",
"{",
"$",
"name",
"=",
"$",
"dictionary",
";",
"i... | Make the passed value a valid dictionary.
@param Configuration $configuration The configuration.
@param string|array $dictionary The dictionary.
@param array $overrides The values to be overridden.
@param string $path The path for exceptions.
@return ExtendedDictionaryDefinition
@thro... | [
"Make",
"the",
"passed",
"value",
"a",
"valid",
"dictionary",
"."
] | 138e81d7119db82c2420bd33967a566e02b1d2f5 | https://github.com/cyberspectrum/i18n/blob/138e81d7119db82c2420bd33967a566e02b1d2f5/src/Configuration/DefinitionBuilder/CopyJobDefinitionBuilder.php#L92-L109 |
9,196 | vspvt/kohana-helpers | classes/Kohana/Helpers/File.php | Kohana_Helpers_File.rmdir | static function rmdir($dir, $deleteRoot = TRUE, $stopOnError = TRUE, &$debug = NULL)
{
if (is_dir($dir)) {
if (NULL === $debug) $debug = [];
try {
foreach (glob($dir . '/*') as $file) {
if (is_dir($file)) {
self::rmdir($file, TRUE, $stopOnError, $debug);
} else {
$debug[] = printf("Fi... | php | static function rmdir($dir, $deleteRoot = TRUE, $stopOnError = TRUE, &$debug = NULL)
{
if (is_dir($dir)) {
if (NULL === $debug) $debug = [];
try {
foreach (glob($dir . '/*') as $file) {
if (is_dir($file)) {
self::rmdir($file, TRUE, $stopOnError, $debug);
} else {
$debug[] = printf("Fi... | [
"static",
"function",
"rmdir",
"(",
"$",
"dir",
",",
"$",
"deleteRoot",
"=",
"TRUE",
",",
"$",
"stopOnError",
"=",
"TRUE",
",",
"&",
"$",
"debug",
"=",
"NULL",
")",
"{",
"if",
"(",
"is_dir",
"(",
"$",
"dir",
")",
")",
"{",
"if",
"(",
"NULL",
"=... | Recursive directory delete
@param $dir
@param bool $deleteRoot
@param bool $stopOnError
@param $debug
@return bool | [
"Recursive",
"directory",
"delete"
] | 891c8f4e4efa09c97230162a2842d8ebf3105932 | https://github.com/vspvt/kohana-helpers/blob/891c8f4e4efa09c97230162a2842d8ebf3105932/classes/Kohana/Helpers/File.php#L18-L46 |
9,197 | projek-xyz/ci-common | src/Utils/ErrorHandlerTrait.php | ErrorHandlerTrait.set_error | public function set_error($message, $halt = false)
{
if ($message instanceof Exception) {
$message = $message->getMessage();
}
$this->_errors[] = $message;
log_message('error', $message);
if ($halt) {
show_error($message);
}
} | php | public function set_error($message, $halt = false)
{
if ($message instanceof Exception) {
$message = $message->getMessage();
}
$this->_errors[] = $message;
log_message('error', $message);
if ($halt) {
show_error($message);
}
} | [
"public",
"function",
"set_error",
"(",
"$",
"message",
",",
"$",
"halt",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"message",
"instanceof",
"Exception",
")",
"{",
"$",
"message",
"=",
"$",
"message",
"->",
"getMessage",
"(",
")",
";",
"}",
"$",
"this"... | Setup error message
@param string $message Error message | [
"Setup",
"error",
"message"
] | 2cd3f507f378e6a871fcaa87efa88c63ce1282c0 | https://github.com/projek-xyz/ci-common/blob/2cd3f507f378e6a871fcaa87efa88c63ce1282c0/src/Utils/ErrorHandlerTrait.php#L18-L30 |
9,198 | eghojansu/nutrition | src/Utils/GroupChecker.php | GroupChecker.getNext | public function getNext()
{
reset($this->groups);
while ($key = key($this->groups)) {
$nextGroup = next($this->groups);
if ($this->groups[$key] === $this->group && $nextGroup) {
return $nextGroup;
}
}
return $this->group;
} | php | public function getNext()
{
reset($this->groups);
while ($key = key($this->groups)) {
$nextGroup = next($this->groups);
if ($this->groups[$key] === $this->group && $nextGroup) {
return $nextGroup;
}
}
return $this->group;
} | [
"public",
"function",
"getNext",
"(",
")",
"{",
"reset",
"(",
"$",
"this",
"->",
"groups",
")",
";",
"while",
"(",
"$",
"key",
"=",
"key",
"(",
"$",
"this",
"->",
"groups",
")",
")",
"{",
"$",
"nextGroup",
"=",
"next",
"(",
"$",
"this",
"->",
"... | Get next group
@return string | [
"Get",
"next",
"group"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/GroupChecker.php#L87-L99 |
9,199 | eghojansu/nutrition | src/Utils/GroupChecker.php | GroupChecker.getPrev | public function getPrev()
{
end($this->groups);
while ($key = key($this->groups)) {
$prevGroup = prev($this->groups);
if ($this->groups[$key] === $this->group && $prevGroup) {
return $prevGroup;
}
}
return $this->group;
} | php | public function getPrev()
{
end($this->groups);
while ($key = key($this->groups)) {
$prevGroup = prev($this->groups);
if ($this->groups[$key] === $this->group && $prevGroup) {
return $prevGroup;
}
}
return $this->group;
} | [
"public",
"function",
"getPrev",
"(",
")",
"{",
"end",
"(",
"$",
"this",
"->",
"groups",
")",
";",
"while",
"(",
"$",
"key",
"=",
"key",
"(",
"$",
"this",
"->",
"groups",
")",
")",
"{",
"$",
"prevGroup",
"=",
"prev",
"(",
"$",
"this",
"->",
"gr... | Get prev group
@return string | [
"Get",
"prev",
"group"
] | 3941c62aeb6dafda55349a38dd4107d521f8964a | https://github.com/eghojansu/nutrition/blob/3941c62aeb6dafda55349a38dd4107d521f8964a/src/Utils/GroupChecker.php#L105-L117 |
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.