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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
232,700 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getNewVsReturningSessions | public function getNewVsReturningSessions($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:userType',
]);
return $this->execute($parameters, $parseResult);
} | php | public function getNewVsReturningSessions($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:userType',
]);
return $this->execute($parameters, $parseResult);
} | [
"public",
"function",
"getNewVsReturningSessions",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions'",
",",
"'dimensions'",
"=>",
"'ga:userType'",
... | New vs Returning Sessions.
This query returns the number of new sessions vs returning sessions.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"New",
"vs",
"Returning",
"Sessions",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L95-L103 |
232,701 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getSessionsByCountry | public function getSessionsByCountry($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:country',
'sort' => '-ga:sessions',
]);
return $this->execute($parameters, $parseResult);
} | php | public function getSessionsByCountry($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:country',
'sort' => '-ga:sessions',
]);
return $this->execute($parameters, $parseResult);
} | [
"public",
"function",
"getSessionsByCountry",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions'",
",",
"'dimensions'",
"=>",
"'ga:country'",
",",... | Sessions by Country.
This query returns a breakdown of your sessions by country, sorted by number of sessions.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Sessions",
"by",
"Country",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L114-L123 |
232,702 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getBrowserAndOperatingSystem | public function getBrowserAndOperatingSystem($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:operatingSystem,ga:operatingSystemVersion,ga:browser,ga:browserVersion',
]);
return $this->execute($parameters,... | php | public function getBrowserAndOperatingSystem($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:operatingSystem,ga:operatingSystemVersion,ga:browser,ga:browserVersion',
]);
return $this->execute($parameters,... | [
"public",
"function",
"getBrowserAndOperatingSystem",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions'",
",",
"'dimensions'",
"=>",
"'ga:operating... | Browser and Operating System.
This query returns a breakdown of sessions by the Operating System, web browser, and browser version used.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Browser",
"and",
"Operating",
"System",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L134-L142 |
232,703 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getTimeOnSite | public function getTimeOnSite($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:operatingSystem,ga:operatingSystemVersion,ga:browser,ga:browserVersion',
]);
return $this->execute($parameters, $parseResult);... | php | public function getTimeOnSite($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions',
'dimensions' => 'ga:operatingSystem,ga:operatingSystemVersion,ga:browser,ga:browserVersion',
]);
return $this->execute($parameters, $parseResult);... | [
"public",
"function",
"getTimeOnSite",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions'",
",",
"'dimensions'",
"=>",
"'ga:operatingSystem,ga:opera... | Time on Site.
This query returns the number of sessions and total time on site, which can be used to calculate average time on site.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Time",
"on",
"Site",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L153-L161 |
232,704 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getAllTrafficSources_Usage | public function getAllTrafficSources_Usage($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions,ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source,ga:medium',
'sort' => '-ga:sessions',
]);
retur... | php | public function getAllTrafficSources_Usage($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions,ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source,ga:medium',
'sort' => '-ga:sessions',
]);
retur... | [
"public",
"function",
"getAllTrafficSources_Usage",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions,ga:pageviews,ga:sessionDuration,ga:exits'",
",",
"... | All Traffic Sources - Usage.
This query returns the site usage data broken down by source and medium, sorted by sessions in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"All",
"Traffic",
"Sources",
"-",
"Usage",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L178-L187 |
232,705 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getAllTrafficSources_Goals | public function getAllTrafficSources_Goals($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions,ga:goal1Starts,ga:goal1Completions,ga:goal1Value,ga:goalStartsAll,ga:goalCompletionsAll,ga:goalValueAll',
'dimensions' => 'ga:source,ga:medium',
... | php | public function getAllTrafficSources_Goals($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions,ga:goal1Starts,ga:goal1Completions,ga:goal1Value,ga:goalStartsAll,ga:goalCompletionsAll,ga:goalValueAll',
'dimensions' => 'ga:source,ga:medium',
... | [
"public",
"function",
"getAllTrafficSources_Goals",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions,ga:goal1Starts,ga:goal1Completions,ga:goal1Value,ga:go... | All Traffic Sources - Goals.
This query returns data for the first and all goals defined, sorted by total goal completions in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"All",
"Traffic",
"Sources",
"-",
"Goals",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L198-L207 |
232,706 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getAllTrafficSources_ECommerce | public function getAllTrafficSources_ECommerce($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePurchases',
'dimensions' => 'ga:source,ga:medium',
'sort' => '-ga:sessions',
... | php | public function getAllTrafficSources_ECommerce($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePurchases',
'dimensions' => 'ga:source,ga:medium',
'sort' => '-ga:sessions',
... | [
"public",
"function",
"getAllTrafficSources_ECommerce",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:sessions,ga:transactionRevenue,ga:transactions,ga:uniquePur... | All Traffic Sources - E-Commerce.
This query returns information on revenue generated through the site for the given time span, sorted by sessions in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"All",
"Traffic",
"Sources",
"-",
"E",
"-",
"Commerce",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L218-L227 |
232,707 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getReferringSites | public function getReferringSites($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==referral',
'sort' => '-ga:pageviews',
... | php | public function getReferringSites($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==referral',
'sort' => '-ga:pageviews',
... | [
"public",
"function",
"getReferringSites",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:pageviews,ga:sessionDuration,ga:exits'",
",",
"'dimensions'",
"=>"... | Referring Sites.
This query returns a list of domains and how many sessions each referred to your site, sorted by pageviews in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Referring",
"Sites",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L238-L248 |
232,708 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getSearchEngines | public function getSearchEngines($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga:medium==cp... | php | public function getSearchEngines($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga:medium==cp... | [
"public",
"function",
"getSearchEngines",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:pageviews,ga:sessionDuration,ga:exits'",
",",
"'dimensions'",
"=>",... | Search Engines.
This query returns site usage data for all traffic by search engine, sorted by pageviews in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Search",
"Engines",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L259-L269 |
232,709 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getSearchEngines_OrganicSearch | public function getSearchEngines_OrganicSearch($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==organic',
'sort' => '-ga:pagev... | php | public function getSearchEngines_OrganicSearch($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==organic',
'sort' => '-ga:pagev... | [
"public",
"function",
"getSearchEngines_OrganicSearch",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:pageviews,ga:sessionDuration,ga:exits'",
",",
"'dimensi... | Search Engines - Organic Search.
This query returns site usage data for organic traffic by search engine, sorted by pageviews in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Search",
"Engines",
"-",
"Organic",
"Search",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L280-L290 |
232,710 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getSearchEngines_PaidSearch | public function getSearchEngines_PaidSearch($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga... | php | public function getSearchEngines_PaidSearch($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:sessionDuration,ga:exits',
'dimensions' => 'ga:source',
'filters' => 'ga:medium==cpa,ga:medium==cpc,ga:medium==cpm,ga:medium==cpp,ga... | [
"public",
"function",
"getSearchEngines_PaidSearch",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:pageviews,ga:sessionDuration,ga:exits'",
",",
"'dimensions... | Search Engines - Paid Search.
This query returns site usage data for paid traffic by search engine, sorted by pageviews in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Search",
"Engines",
"-",
"Paid",
"Search",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L301-L311 |
232,711 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getTopContent | public function getTopContent($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:uniquePageviews,ga:timeOnPage,ga:bounces,ga:entrances,ga:exits',
'dimensions' => 'ga:pagePath',
'sort' => '-ga:pageviews',
]);
... | php | public function getTopContent($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:pageviews,ga:uniquePageviews,ga:timeOnPage,ga:bounces,ga:entrances,ga:exits',
'dimensions' => 'ga:pagePath',
'sort' => '-ga:pageviews',
]);
... | [
"public",
"function",
"getTopContent",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:pageviews,ga:uniquePageviews,ga:timeOnPage,ga:bounces,ga:entrances,ga:exits'... | Top Content.
This query returns your most popular content, sorted by most pageviews.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Top",
"Content",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L348-L357 |
232,712 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getTopLandingPages | public function getTopLandingPages($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:entrances,ga:bounces',
'dimensions' => 'ga:landingPagePath',
'sort' => '-ga:entrances',
]);
return $this->execute($parameters, $parseR... | php | public function getTopLandingPages($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:entrances,ga:bounces',
'dimensions' => 'ga:landingPagePath',
'sort' => '-ga:entrances',
]);
return $this->execute($parameters, $parseR... | [
"public",
"function",
"getTopLandingPages",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:entrances,ga:bounces'",
",",
"'dimensions'",
"=>",
"'ga:landing... | Top Landing Pages.
This query returns your most popular landing pages, sorted by entrances in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Top",
"Landing",
"Pages",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L368-L377 |
232,713 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getTopExitPages | public function getTopExitPages($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:exits,ga:pageviews',
'dimensions' => 'ga:exitPagePath',
'sort' => '-ga:exits',
]);
return $this->execute($parameters, $parseResult);
... | php | public function getTopExitPages($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:exits,ga:pageviews',
'dimensions' => 'ga:exitPagePath',
'sort' => '-ga:exits',
]);
return $this->execute($parameters, $parseResult);
... | [
"public",
"function",
"getTopExitPages",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:exits,ga:pageviews'",
",",
"'dimensions'",
"=>",
"'ga:exitPagePath... | Top Exit Pages.
This query returns your most common exit pages, sorted by exits in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Top",
"Exit",
"Pages",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L388-L397 |
232,714 | OzanKurt/google-analytics | src/Traits/Filters/GoogleCommonFilters.php | GoogleCommonFilters.getSiteSearch_SearchTerms | public function getSiteSearch_SearchTerms($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:searchUniques',
'dimensions' => 'ga:searchKeyword',
'sort' => '-ga:searchUniques',
]);
return $this->execute($parameters, $pars... | php | public function getSiteSearch_SearchTerms($parameters = [], $parseResult = true)
{
$this->setParams([
'metrics' => 'ga:searchUniques',
'dimensions' => 'ga:searchKeyword',
'sort' => '-ga:searchUniques',
]);
return $this->execute($parameters, $pars... | [
"public",
"function",
"getSiteSearch_SearchTerms",
"(",
"$",
"parameters",
"=",
"[",
"]",
",",
"$",
"parseResult",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"setParams",
"(",
"[",
"'metrics'",
"=>",
"'ga:searchUniques'",
",",
"'dimensions'",
"=>",
"'ga:searchK... | Site Search - Search Terms.
This query returns the number of sessions broken down by internal site search, sorted by number of unique searches for a keyword in descending order.
@param array $parameters Parameters you may want to overwrite.
@return array | [
"Site",
"Search",
"-",
"Search",
"Terms",
"."
] | da5fecb6d9267f2fc5015a918c3aebda2c2f70a5 | https://github.com/OzanKurt/google-analytics/blob/da5fecb6d9267f2fc5015a918c3aebda2c2f70a5/src/Traits/Filters/GoogleCommonFilters.php#L408-L417 |
232,715 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.renderSection | protected function renderSection($title, $contentArray)
{
//title
echo Html::tag($this->sectionTitleTag, $title);
//table
echo Html::beginTag('table', $this->sectionTableOptions);
echo Html::beginTag('tbody');
foreach ($contentArray as $key=>$value) {
$value = $value instanceof \Closure ? call_user_fun... | php | protected function renderSection($title, $contentArray)
{
//title
echo Html::tag($this->sectionTitleTag, $title);
//table
echo Html::beginTag('table', $this->sectionTableOptions);
echo Html::beginTag('tbody');
foreach ($contentArray as $key=>$value) {
$value = $value instanceof \Closure ? call_user_fun... | [
"protected",
"function",
"renderSection",
"(",
"$",
"title",
",",
"$",
"contentArray",
")",
"{",
"//title",
"echo",
"Html",
"::",
"tag",
"(",
"$",
"this",
"->",
"sectionTitleTag",
",",
"$",
"title",
")",
";",
"//table",
"echo",
"Html",
"::",
"beginTag",
... | Renders an actual section
@param string $title the title of the section
@param array $contentArray key/value pairs representing titles and values of entries
@return string the rendered html code | [
"Renders",
"an",
"actual",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L176-L194 |
232,716 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionServer | protected function sectionServer()
{
$extCheck = [
'Zend OPcache','memcache','apc','xcache','redis','wincache','Zend Data Cache','curl',
'odbc','intl','gd','imagick','openssl','xdebug',
];
$extensions = [];
foreach ($extCheck as $ext) {
$hasExt = extension_loaded($ext);
$extensions[] = Html::tag('s... | php | protected function sectionServer()
{
$extCheck = [
'Zend OPcache','memcache','apc','xcache','redis','wincache','Zend Data Cache','curl',
'odbc','intl','gd','imagick','openssl','xdebug',
];
$extensions = [];
foreach ($extCheck as $ext) {
$hasExt = extension_loaded($ext);
$extensions[] = Html::tag('s... | [
"protected",
"function",
"sectionServer",
"(",
")",
"{",
"$",
"extCheck",
"=",
"[",
"'Zend OPcache'",
",",
"'memcache'",
",",
"'apc'",
",",
"'xcache'",
",",
"'redis'",
",",
"'wincache'",
",",
"'Zend Data Cache'",
",",
"'curl'",
",",
"'odbc'",
",",
"'intl'",
... | Prepares the server section
@return array the configuration of the section | [
"Prepares",
"the",
"server",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L201-L225 |
232,717 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionYii | protected function sectionYii()
{
return [
'Version'=>Yii::getVersion(),
'YII_DEBUG'=>$this->valueBool(YII_DEBUG),
'YII_ENV'=>Html::tag('code', YII_ENV),
'YII_ENV_DEV'=>$this->valueBool(YII_ENV_DEV),
'YII_ENV_PROD'=>$this->valueBool(YII_ENV_PROD),
];
} | php | protected function sectionYii()
{
return [
'Version'=>Yii::getVersion(),
'YII_DEBUG'=>$this->valueBool(YII_DEBUG),
'YII_ENV'=>Html::tag('code', YII_ENV),
'YII_ENV_DEV'=>$this->valueBool(YII_ENV_DEV),
'YII_ENV_PROD'=>$this->valueBool(YII_ENV_PROD),
];
} | [
"protected",
"function",
"sectionYii",
"(",
")",
"{",
"return",
"[",
"'Version'",
"=>",
"Yii",
"::",
"getVersion",
"(",
")",
",",
"'YII_DEBUG'",
"=>",
"$",
"this",
"->",
"valueBool",
"(",
"YII_DEBUG",
")",
",",
"'YII_ENV'",
"=>",
"Html",
"::",
"tag",
"("... | Prepares the yii section
@return array the configuration of the section | [
"Prepares",
"the",
"yii",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L232-L241 |
232,718 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionDb | protected function sectionDb()
{
if (Yii::$app->db === null) return ['Status'=>'not configured'];
$db = Yii::$app->db;
return [
'Active'=>$this->valueBool($db->isActive),
'Driver name'=>$this->valueCode($db->driverName),
'DSN'=>$this->valueCode($db->dsn),
'Username'=>$this->valueCode($db->username)... | php | protected function sectionDb()
{
if (Yii::$app->db === null) return ['Status'=>'not configured'];
$db = Yii::$app->db;
return [
'Active'=>$this->valueBool($db->isActive),
'Driver name'=>$this->valueCode($db->driverName),
'DSN'=>$this->valueCode($db->dsn),
'Username'=>$this->valueCode($db->username)... | [
"protected",
"function",
"sectionDb",
"(",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"db",
"===",
"null",
")",
"return",
"[",
"'Status'",
"=>",
"'not configured'",
"]",
";",
"$",
"db",
"=",
"Yii",
"::",
"$",
"app",
"->",
"db",
";",
"retur... | Prepares the db section
@return array the configuration of the section | [
"Prepares",
"the",
"db",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L248-L268 |
232,719 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionLocalization | protected function sectionLocalization()
{
$f = Yii::$app->formatter;
return [
'Locale'=>$f->locale,
'Language'=>Yii::$app->language,
'Source lang'=>Yii::$app->sourceLanguage,
'Timezone'=>Yii::$app->timeZone,
'Local time ' . Yii::$app->timeZone=>function() {
$dtCur = new \DateTime('now', new \D... | php | protected function sectionLocalization()
{
$f = Yii::$app->formatter;
return [
'Locale'=>$f->locale,
'Language'=>Yii::$app->language,
'Source lang'=>Yii::$app->sourceLanguage,
'Timezone'=>Yii::$app->timeZone,
'Local time ' . Yii::$app->timeZone=>function() {
$dtCur = new \DateTime('now', new \D... | [
"protected",
"function",
"sectionLocalization",
"(",
")",
"{",
"$",
"f",
"=",
"Yii",
"::",
"$",
"app",
"->",
"formatter",
";",
"return",
"[",
"'Locale'",
"=>",
"$",
"f",
"->",
"locale",
",",
"'Language'",
"=>",
"Yii",
"::",
"$",
"app",
"->",
"language"... | Prepares the localization section
@return array the configuration of the section | [
"Prepares",
"the",
"localization",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L275-L297 |
232,720 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionCaching | protected function sectionCaching()
{
$ret = [];
foreach (Yii::$app->components as $id=>$component) {
$instance = Yii::$app->{$id};
if (!($instance instanceof Cache)) continue;
$title = $this->valueCode($id);
ob_start();
ActiveForm::begin();
echo $this->valueCode($instance->className());
ech... | php | protected function sectionCaching()
{
$ret = [];
foreach (Yii::$app->components as $id=>$component) {
$instance = Yii::$app->{$id};
if (!($instance instanceof Cache)) continue;
$title = $this->valueCode($id);
ob_start();
ActiveForm::begin();
echo $this->valueCode($instance->className());
ech... | [
"protected",
"function",
"sectionCaching",
"(",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"foreach",
"(",
"Yii",
"::",
"$",
"app",
"->",
"components",
"as",
"$",
"id",
"=>",
"$",
"component",
")",
"{",
"$",
"instance",
"=",
"Yii",
"::",
"$",
"app",... | Prepares the caching section
@return array the configuration of the section | [
"Prepares",
"the",
"caching",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L304-L328 |
232,721 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionRbac | protected function sectionRbac()
{
if (Yii::$app->authManager === null) return ['Status'=>'not configured'];
$am = Yii::$app->authManager;
//get roles and permission
$roles = [];
$perms = [];
foreach ($am->roles as $role) $roles[] = $this->valueCode($role->name);
foreach ($am->permissions as $perm) $per... | php | protected function sectionRbac()
{
if (Yii::$app->authManager === null) return ['Status'=>'not configured'];
$am = Yii::$app->authManager;
//get roles and permission
$roles = [];
$perms = [];
foreach ($am->roles as $role) $roles[] = $this->valueCode($role->name);
foreach ($am->permissions as $perm) $per... | [
"protected",
"function",
"sectionRbac",
"(",
")",
"{",
"if",
"(",
"Yii",
"::",
"$",
"app",
"->",
"authManager",
"===",
"null",
")",
"return",
"[",
"'Status'",
"=>",
"'not configured'",
"]",
";",
"$",
"am",
"=",
"Yii",
"::",
"$",
"app",
"->",
"authManag... | Prepares the rbac section
@return array the configuration of the section | [
"Prepares",
"the",
"rbac",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L335-L360 |
232,722 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.sectionCurrentUser | protected function sectionCurrentUser()
{
$u = Yii::$app->user;
if ($u->isGuest) return ['Is guest'=>$this->valueBool(true)];
//basics
$identity = Yii::$app->user->identity;
$ret = [
'Is guest'=>$this->valueBool($u->isGuest),
'ID'=>$this->valueBool($u->id),
'Identity'=>$this->valueModal('Identity',... | php | protected function sectionCurrentUser()
{
$u = Yii::$app->user;
if ($u->isGuest) return ['Is guest'=>$this->valueBool(true)];
//basics
$identity = Yii::$app->user->identity;
$ret = [
'Is guest'=>$this->valueBool($u->isGuest),
'ID'=>$this->valueBool($u->id),
'Identity'=>$this->valueModal('Identity',... | [
"protected",
"function",
"sectionCurrentUser",
"(",
")",
"{",
"$",
"u",
"=",
"Yii",
"::",
"$",
"app",
"->",
"user",
";",
"if",
"(",
"$",
"u",
"->",
"isGuest",
")",
"return",
"[",
"'Is guest'",
"=>",
"$",
"this",
"->",
"valueBool",
"(",
"true",
")",
... | Prepares the current user section
@return array the configuration of the section | [
"Prepares",
"the",
"current",
"user",
"section"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L367-L403 |
232,723 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.valueBool | protected function valueBool($value)
{
if ($value !== false && empty($value)) return Yii::$app->formatter->nullDisplay;
return Yii::$app->formatter->asBoolean($value);
} | php | protected function valueBool($value)
{
if ($value !== false && empty($value)) return Yii::$app->formatter->nullDisplay;
return Yii::$app->formatter->asBoolean($value);
} | [
"protected",
"function",
"valueBool",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"!==",
"false",
"&&",
"empty",
"(",
"$",
"value",
")",
")",
"return",
"Yii",
"::",
"$",
"app",
"->",
"formatter",
"->",
"nullDisplay",
";",
"return",
"Yii",
"... | Renders a boolean value
@param string $value the value to render
@return string the resulting html code | [
"Renders",
"a",
"boolean",
"value"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L422-L426 |
232,724 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.valueCode | protected function valueCode($value)
{
if (empty($value)) return Yii::$app->formatter->nullDisplay;
return html::tag('code', $value);
} | php | protected function valueCode($value)
{
if (empty($value)) return Yii::$app->formatter->nullDisplay;
return html::tag('code', $value);
} | [
"protected",
"function",
"valueCode",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"value",
")",
")",
"return",
"Yii",
"::",
"$",
"app",
"->",
"formatter",
"->",
"nullDisplay",
";",
"return",
"html",
"::",
"tag",
"(",
"'code'",
",",
"$"... | Renders the value in a code tag
@param string $value the value to render
@return string the resulting html code | [
"Renders",
"the",
"value",
"in",
"a",
"code",
"tag"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L434-L438 |
232,725 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.valueModal | protected function valueModal($title, $content, $buttonLabel=null)
{
$randomId = Yii::$app->security->generateRandomString();
return Button::widget([
'label'=>$buttonLabel !== null ? $buttonLabel : Yii::t('app', 'Show'),
'options'=>[
'class'=>'btn btn-xs btn-primary',
'onclick'=>new JsExpression("$('... | php | protected function valueModal($title, $content, $buttonLabel=null)
{
$randomId = Yii::$app->security->generateRandomString();
return Button::widget([
'label'=>$buttonLabel !== null ? $buttonLabel : Yii::t('app', 'Show'),
'options'=>[
'class'=>'btn btn-xs btn-primary',
'onclick'=>new JsExpression("$('... | [
"protected",
"function",
"valueModal",
"(",
"$",
"title",
",",
"$",
"content",
",",
"$",
"buttonLabel",
"=",
"null",
")",
"{",
"$",
"randomId",
"=",
"Yii",
"::",
"$",
"app",
"->",
"security",
"->",
"generateRandomString",
"(",
")",
";",
"return",
"Button... | Renders the value in a modal window
@param string $title the title of the modal
@param string $content the content of the modal
@param string $buttonLabel optional button label
@return string the resulting html code | [
"Renders",
"the",
"value",
"in",
"a",
"modal",
"window"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L448-L461 |
232,726 | asinfotrack/yii2-toolbox | actions/DebugAction.php | DebugAction.loadPhpInfo | protected function loadPhpInfo()
{
ob_start();
phpinfo();
$domDoc = new \DOMDocument();
$domDoc->loadHTML(ob_get_clean());
/* @var $node \DOMNode */
/* @var $childNode \DOMNode */
foreach ($domDoc->getElementsByTagName('table') as $node) {
$node->setAttribute('class', 'table table-condensed table-st... | php | protected function loadPhpInfo()
{
ob_start();
phpinfo();
$domDoc = new \DOMDocument();
$domDoc->loadHTML(ob_get_clean());
/* @var $node \DOMNode */
/* @var $childNode \DOMNode */
foreach ($domDoc->getElementsByTagName('table') as $node) {
$node->setAttribute('class', 'table table-condensed table-st... | [
"protected",
"function",
"loadPhpInfo",
"(",
")",
"{",
"ob_start",
"(",
")",
";",
"phpinfo",
"(",
")",
";",
"$",
"domDoc",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"$",
"domDoc",
"->",
"loadHTML",
"(",
"ob_get_clean",
"(",
")",
")",
";",
"/* @... | Loads and cleans the php info data | [
"Loads",
"and",
"cleans",
"the",
"php",
"info",
"data"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/actions/DebugAction.php#L466-L492 |
232,727 | mcustiel/php-simple-request | src/RequestBuilder.php | RequestBuilder.parseRequest | public function parseRequest(
$request,
$className,
$behavior = self::THROW_EXCEPTION_ON_FIRST_ERROR
) {
$isArray = is_array($className);
$className = $this->getClassName($className, $isArray);
$parserObject = $this->generateRequestParserObject($className, new $behavi... | php | public function parseRequest(
$request,
$className,
$behavior = self::THROW_EXCEPTION_ON_FIRST_ERROR
) {
$isArray = is_array($className);
$className = $this->getClassName($className, $isArray);
$parserObject = $this->generateRequestParserObject($className, new $behavi... | [
"public",
"function",
"parseRequest",
"(",
"$",
"request",
",",
"$",
"className",
",",
"$",
"behavior",
"=",
"self",
"::",
"THROW_EXCEPTION_ON_FIRST_ERROR",
")",
"{",
"$",
"isArray",
"=",
"is_array",
"(",
"$",
"className",
")",
";",
"$",
"className",
"=",
... | Main method of this class. Used to convert a request to an object of a given class by
using a requestParser.
@param array|\stdClass $request The request to convert to an object.
@param string|array $className The class of the object to which the request must be converted.
@param string $behavior The beh... | [
"Main",
"method",
"of",
"this",
"class",
".",
"Used",
"to",
"convert",
"a",
"request",
"to",
"an",
"object",
"of",
"a",
"given",
"class",
"by",
"using",
"a",
"requestParser",
"."
] | 4d0fc06092ccdff3ea488c67b394225c7243428f | https://github.com/mcustiel/php-simple-request/blob/4d0fc06092ccdff3ea488c67b394225c7243428f/src/RequestBuilder.php#L64-L78 |
232,728 | mpratt/RelativeTime | Lib/RelativeTime/Translation.php | Translation.translate | public function translate(array $units = array(), $direction = 0)
{
$lang = $this->loadLanguage();
if (empty($units)) {
return $lang['now'];
}
$translation = array();
foreach ($units as $unit => $v) {
if ($v == 1) {
$translation[] = sp... | php | public function translate(array $units = array(), $direction = 0)
{
$lang = $this->loadLanguage();
if (empty($units)) {
return $lang['now'];
}
$translation = array();
foreach ($units as $unit => $v) {
if ($v == 1) {
$translation[] = sp... | [
"public",
"function",
"translate",
"(",
"array",
"$",
"units",
"=",
"array",
"(",
")",
",",
"$",
"direction",
"=",
"0",
")",
"{",
"$",
"lang",
"=",
"$",
"this",
"->",
"loadLanguage",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"units",
")",
")",... | Actually translates the units into words
@param array $units
@param int $direction
@return string | [
"Actually",
"translates",
"the",
"units",
"into",
"words"
] | cee7b9b8bdbf05a0b96e9bda58501e5ca6e1dfa5 | https://github.com/mpratt/RelativeTime/blob/cee7b9b8bdbf05a0b96e9bda58501e5ca6e1dfa5/Lib/RelativeTime/Translation.php#L53-L79 |
232,729 | mpratt/RelativeTime | Lib/RelativeTime/Translation.php | Translation.LoadLanguage | protected function LoadLanguage()
{
if (is_object($this->config['language'])) {
$l = $this->config['language'];
} else {
$languages = array(
$this->config['language'],
'\RelativeTime\Languages\\' . $this->config['language'],
);
... | php | protected function LoadLanguage()
{
if (is_object($this->config['language'])) {
$l = $this->config['language'];
} else {
$languages = array(
$this->config['language'],
'\RelativeTime\Languages\\' . $this->config['language'],
);
... | [
"protected",
"function",
"LoadLanguage",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"config",
"[",
"'language'",
"]",
")",
")",
"{",
"$",
"l",
"=",
"$",
"this",
"->",
"config",
"[",
"'language'",
"]",
";",
"}",
"else",
"{",
"$",... | Loads the language definitions
@return ArrayAccess | [
"Loads",
"the",
"language",
"definitions"
] | cee7b9b8bdbf05a0b96e9bda58501e5ca6e1dfa5 | https://github.com/mpratt/RelativeTime/blob/cee7b9b8bdbf05a0b96e9bda58501e5ca6e1dfa5/Lib/RelativeTime/Translation.php#L86-L110 |
232,730 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.getUsedQuotaMB | public function getUsedQuotaMB($round = 2) {
$size = 0;
foreach($this->Environments() as $environment) {
foreach($environment->DataArchives()->filter('IsBackup', 0) as $archive) {
$size += $archive->ArchiveFile()->getAbsoluteSize();
}
}
// convert bytes to megabytes and round
return round(($size /... | php | public function getUsedQuotaMB($round = 2) {
$size = 0;
foreach($this->Environments() as $environment) {
foreach($environment->DataArchives()->filter('IsBackup', 0) as $archive) {
$size += $archive->ArchiveFile()->getAbsoluteSize();
}
}
// convert bytes to megabytes and round
return round(($size /... | [
"public",
"function",
"getUsedQuotaMB",
"(",
"$",
"round",
"=",
"2",
")",
"{",
"$",
"size",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"Environments",
"(",
")",
"as",
"$",
"environment",
")",
"{",
"foreach",
"(",
"$",
"environment",
"->",
"Dat... | Return the used quota in MB.
@param mixed $round Number of decimal places to round to
@return string|int The used quota size in MB | [
"Return",
"the",
"used",
"quota",
"in",
"MB",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L103-L114 |
232,731 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.getDiskQuotaMB | public function getDiskQuotaMB() {
$size = $this->getField('DiskQuotaMB');
if(empty($size)) {
$defaults = $this->config()->get('defaults');
$size = (isset($defaults['DiskQuotaMB'])) ? $defaults['DiskQuotaMB'] : 0;
}
return $size;
} | php | public function getDiskQuotaMB() {
$size = $this->getField('DiskQuotaMB');
if(empty($size)) {
$defaults = $this->config()->get('defaults');
$size = (isset($defaults['DiskQuotaMB'])) ? $defaults['DiskQuotaMB'] : 0;
}
return $size;
} | [
"public",
"function",
"getDiskQuotaMB",
"(",
")",
"{",
"$",
"size",
"=",
"$",
"this",
"->",
"getField",
"(",
"'DiskQuotaMB'",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"size",
")",
")",
"{",
"$",
"defaults",
"=",
"$",
"this",
"->",
"config",
"(",
")"... | Getter for DiskQuotaMB field to provide a default for existing
records that have no quota field set, as it will need to default
to a globally set size.
@return string|int The quota size in MB | [
"Getter",
"for",
"DiskQuotaMB",
"field",
"to",
"provide",
"a",
"default",
"for",
"existing",
"records",
"that",
"have",
"no",
"quota",
"field",
"set",
"as",
"it",
"will",
"need",
"to",
"default",
"to",
"a",
"globally",
"set",
"size",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L123-L132 |
232,732 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.Menu | public function Menu() {
$list = new ArrayList();
$list->push(new ArrayData(array(
'Link' => sprintf('naut/project/%s', $this->Name),
'Title' => 'Deploy',
'IsActive' => Controller::curr()->getAction() == 'project'
)));
if(DNRoot::FlagSnapshotsEnabled()) {
$list->push(new ArrayData(array(
'Link... | php | public function Menu() {
$list = new ArrayList();
$list->push(new ArrayData(array(
'Link' => sprintf('naut/project/%s', $this->Name),
'Title' => 'Deploy',
'IsActive' => Controller::curr()->getAction() == 'project'
)));
if(DNRoot::FlagSnapshotsEnabled()) {
$list->push(new ArrayData(array(
'Link... | [
"public",
"function",
"Menu",
"(",
")",
"{",
"$",
"list",
"=",
"new",
"ArrayList",
"(",
")",
";",
"$",
"list",
"->",
"push",
"(",
"new",
"ArrayData",
"(",
"array",
"(",
"'Link'",
"=>",
"sprintf",
"(",
"'naut/project/%s'",
",",
"$",
"this",
"->",
"Nam... | Get the menu to be shown on projects
@return ArrayList | [
"Get",
"the",
"menu",
"to",
"be",
"shown",
"on",
"projects"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L155-L175 |
232,733 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.canView | public function canView($member = null) {
if(!$member) $member = Member::currentUser();
if(Permission::checkMember($member, 'ADMIN')) return true;
return $member->inGroups($this->Viewers());
} | php | public function canView($member = null) {
if(!$member) $member = Member::currentUser();
if(Permission::checkMember($member, 'ADMIN')) return true;
return $member->inGroups($this->Viewers());
} | [
"public",
"function",
"canView",
"(",
"$",
"member",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"member",
")",
"$",
"member",
"=",
"Member",
"::",
"currentUser",
"(",
")",
";",
"if",
"(",
"Permission",
"::",
"checkMember",
"(",
"$",
"member",
",",
... | Restrict access to viewing this project
@param Member $member
@return boolean | [
"Restrict",
"access",
"to",
"viewing",
"this",
"project"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L183-L189 |
232,734 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.getProcessEnv | public function getProcessEnv() {
if (file_exists($this->getPrivateKeyPath())) {
// Key-pair is available, use it.
$processEnv = array(
'IDENT_KEY' => $this->getPrivateKeyPath(),
'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh"
);
} else {
$processEnv = array();
}
$this->extend('updatePr... | php | public function getProcessEnv() {
if (file_exists($this->getPrivateKeyPath())) {
// Key-pair is available, use it.
$processEnv = array(
'IDENT_KEY' => $this->getPrivateKeyPath(),
'GIT_SSH' => BASE_PATH . "/deploynaut/git-deploy.sh"
);
} else {
$processEnv = array();
}
$this->extend('updatePr... | [
"public",
"function",
"getProcessEnv",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"getPrivateKeyPath",
"(",
")",
")",
")",
"{",
"// Key-pair is available, use it.",
"$",
"processEnv",
"=",
"array",
"(",
"'IDENT_KEY'",
"=>",
"$",
"this",
... | Build an environment variable array to be used with this project.
This is relevant if every project needs to use an individual SSH pubkey.
Include this with all Gitonomy\Git\Repository, and
\Symfony\Component\Process\Processes.
@return array | [
"Build",
"an",
"environment",
"variable",
"array",
"to",
"be",
"used",
"with",
"this",
"project",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L240-L252 |
232,735 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.DNBranchList | public function DNBranchList() {
if($this->CVSPath && !$this->repoExists()) {
$this->cloneRepo();
}
return DNBranchList::create($this, $this->DNData());
} | php | public function DNBranchList() {
if($this->CVSPath && !$this->repoExists()) {
$this->cloneRepo();
}
return DNBranchList::create($this, $this->DNData());
} | [
"public",
"function",
"DNBranchList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"CVSPath",
"&&",
"!",
"$",
"this",
"->",
"repoExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"cloneRepo",
"(",
")",
";",
"}",
"return",
"DNBranchList",
"::",
"create"... | Provides a list of the branches in this project. | [
"Provides",
"a",
"list",
"of",
"the",
"branches",
"in",
"this",
"project",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L282-L287 |
232,736 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.DNTagList | public function DNTagList() {
if($this->CVSPath && !$this->repoExists()) {
$this->cloneRepo();
}
return DNReferenceList::create($this, $this->DNData(), null, null, true);
} | php | public function DNTagList() {
if($this->CVSPath && !$this->repoExists()) {
$this->cloneRepo();
}
return DNReferenceList::create($this, $this->DNData(), null, null, true);
} | [
"public",
"function",
"DNTagList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"CVSPath",
"&&",
"!",
"$",
"this",
"->",
"repoExists",
"(",
")",
")",
"{",
"$",
"this",
"->",
"cloneRepo",
"(",
")",
";",
"}",
"return",
"DNReferenceList",
"::",
"create"... | Provides a list of the tags in this project. | [
"Provides",
"a",
"list",
"of",
"the",
"tags",
"in",
"this",
"project",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L292-L297 |
232,737 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.currentBuilds | public function currentBuilds() {
if(!isset(self::$relation_cache['currentBuilds.'.$this->ID])) {
$currentBuilds = array();
foreach($this->Environments() as $env) {
$currentBuilds[$env->Name] = $env->CurrentBuild();
}
self::$relation_cache['currentBuilds.'.$this->ID] = $currentBuilds;
}
return sel... | php | public function currentBuilds() {
if(!isset(self::$relation_cache['currentBuilds.'.$this->ID])) {
$currentBuilds = array();
foreach($this->Environments() as $env) {
$currentBuilds[$env->Name] = $env->CurrentBuild();
}
self::$relation_cache['currentBuilds.'.$this->ID] = $currentBuilds;
}
return sel... | [
"public",
"function",
"currentBuilds",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"relation_cache",
"[",
"'currentBuilds.'",
".",
"$",
"this",
"->",
"ID",
"]",
")",
")",
"{",
"$",
"currentBuilds",
"=",
"array",
"(",
")",
";",
"fo... | Returns a map of envrionment name to build name | [
"Returns",
"a",
"map",
"of",
"envrionment",
"name",
"to",
"build",
"name"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L326-L335 |
232,738 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.setCreateProjectFolderField | public function setCreateProjectFolderField(&$fields) {
// Check if the capistrano project folder exists
if(!$this->Name) {
return;
}
if($this->projectFolderExists()) {
return;
}
$createFolderNotice = new LabelField('CreateEnvFolderNotice', 'Warning: No Capistrano project folder exists');
$createF... | php | public function setCreateProjectFolderField(&$fields) {
// Check if the capistrano project folder exists
if(!$this->Name) {
return;
}
if($this->projectFolderExists()) {
return;
}
$createFolderNotice = new LabelField('CreateEnvFolderNotice', 'Warning: No Capistrano project folder exists');
$createF... | [
"public",
"function",
"setCreateProjectFolderField",
"(",
"&",
"$",
"fields",
")",
"{",
"// Check if the capistrano project folder exists",
"if",
"(",
"!",
"$",
"this",
"->",
"Name",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"projectFolderExist... | If there isn't a capistrano env project folder, show options to create one
@param FieldList $fields | [
"If",
"there",
"isn",
"t",
"a",
"capistrano",
"env",
"project",
"folder",
"show",
"options",
"to",
"create",
"one"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L397-L413 |
232,739 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.checkProjectPath | protected function checkProjectPath() {
// Create the project capistrano folder
if($this->CreateEnvFolder && !file_exists($this->getProjectFolderPath())) {
mkdir($this->DNData()->getEnvironmentDir().'/'.$this->Name);
}
} | php | protected function checkProjectPath() {
// Create the project capistrano folder
if($this->CreateEnvFolder && !file_exists($this->getProjectFolderPath())) {
mkdir($this->DNData()->getEnvironmentDir().'/'.$this->Name);
}
} | [
"protected",
"function",
"checkProjectPath",
"(",
")",
"{",
"// Create the project capistrano folder",
"if",
"(",
"$",
"this",
"->",
"CreateEnvFolder",
"&&",
"!",
"file_exists",
"(",
"$",
"this",
"->",
"getProjectFolderPath",
"(",
")",
")",
")",
"{",
"mkdir",
"(... | Ensure the path for this project has been created | [
"Ensure",
"the",
"path",
"for",
"this",
"project",
"has",
"been",
"created"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L468-L473 |
232,740 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.checkCVSPath | protected function checkCVSPath() {
$changedFields = $this->getChangedFields(true, 2);
if (!$this->CVSPath) {
return;
}
if (isset($changedFields['CVSPath']) || isset($changedFields['Name'])) {
$this->cloneRepo();
}
} | php | protected function checkCVSPath() {
$changedFields = $this->getChangedFields(true, 2);
if (!$this->CVSPath) {
return;
}
if (isset($changedFields['CVSPath']) || isset($changedFields['Name'])) {
$this->cloneRepo();
}
} | [
"protected",
"function",
"checkCVSPath",
"(",
")",
"{",
"$",
"changedFields",
"=",
"$",
"this",
"->",
"getChangedFields",
"(",
"true",
",",
"2",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"CVSPath",
")",
"{",
"return",
";",
"}",
"if",
"(",
"isset",... | Check if the CVSPath has been changed, and if so, ensure the repository has been updated | [
"Check",
"if",
"the",
"CVSPath",
"has",
"been",
"changed",
"and",
"if",
"so",
"ensure",
"the",
"repository",
"has",
"been",
"updated"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L478-L486 |
232,741 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.onAfterDelete | public function onAfterDelete() {
parent::onAfterDelete();
// Delete related environments
foreach($this->Environments() as $env) {
$env->delete();
}
if(!file_exists($this->getProjectFolderPath())) {
return;
}
// Create a basic new environment config from a template
if(Config::inst()->get('DNEnvi... | php | public function onAfterDelete() {
parent::onAfterDelete();
// Delete related environments
foreach($this->Environments() as $env) {
$env->delete();
}
if(!file_exists($this->getProjectFolderPath())) {
return;
}
// Create a basic new environment config from a template
if(Config::inst()->get('DNEnvi... | [
"public",
"function",
"onAfterDelete",
"(",
")",
"{",
"parent",
"::",
"onAfterDelete",
"(",
")",
";",
"// Delete related environments",
"foreach",
"(",
"$",
"this",
"->",
"Environments",
"(",
")",
"as",
"$",
"env",
")",
"{",
"$",
"env",
"->",
"delete",
"("... | Delete related environments and folders | [
"Delete",
"related",
"environments",
"and",
"folders"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L491-L506 |
232,742 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.getPrivateKeyPath | public function getPrivateKeyPath() {
if($keyDir = $this->getKeyDir()) {
$filter = FileNameFilter::create();
$name = $filter->filter($this->Name);
return $this->getKeyDir() . '/' . $name;
}
return null;
} | php | public function getPrivateKeyPath() {
if($keyDir = $this->getKeyDir()) {
$filter = FileNameFilter::create();
$name = $filter->filter($this->Name);
return $this->getKeyDir() . '/' . $name;
}
return null;
} | [
"public",
"function",
"getPrivateKeyPath",
"(",
")",
"{",
"if",
"(",
"$",
"keyDir",
"=",
"$",
"this",
"->",
"getKeyDir",
"(",
")",
")",
"{",
"$",
"filter",
"=",
"FileNameFilter",
"::",
"create",
"(",
")",
";",
"$",
"name",
"=",
"$",
"filter",
"->",
... | This returns that path of the private key if a key directory is set. It doesn't check whether the file exists.
@return string|null | [
"This",
"returns",
"that",
"path",
"of",
"the",
"private",
"key",
"if",
"a",
"key",
"directory",
"is",
"set",
".",
"It",
"doesn",
"t",
"check",
"whether",
"the",
"file",
"exists",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L538-L546 |
232,743 | silverstripe-archive/deploynaut | code/model/DNProject.php | DNProject.setEnvironmentFields | protected function setEnvironmentFields(&$fields, $environments) {
if(!$environments) {
return;
}
$environments->getConfig()->addComponent(new GridFieldAddNewMultiClass());
$environments->getConfig()->removeComponentsByType('GridFieldAddNewButton');
$environments->getConfig()->removeComponentsByType('Grid... | php | protected function setEnvironmentFields(&$fields, $environments) {
if(!$environments) {
return;
}
$environments->getConfig()->addComponent(new GridFieldAddNewMultiClass());
$environments->getConfig()->removeComponentsByType('GridFieldAddNewButton');
$environments->getConfig()->removeComponentsByType('Grid... | [
"protected",
"function",
"setEnvironmentFields",
"(",
"&",
"$",
"fields",
",",
"$",
"environments",
")",
"{",
"if",
"(",
"!",
"$",
"environments",
")",
"{",
"return",
";",
"}",
"$",
"environments",
"->",
"getConfig",
"(",
")",
"->",
"addComponent",
"(",
... | Setup a gridfield for the environment configs
@param FieldList $fields
@param $environments
@return void | [
"Setup",
"a",
"gridfield",
"for",
"the",
"environment",
"configs"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNProject.php#L571-L588 |
232,744 | bav-php/bav | classes/dataBackend/pdo/PDODataBackend.php | PDODataBackend.isInstalled | public function isInstalled()
{
try {
switch ($this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
case "sqlite":
$query =
"SELECT count(*) FROM sqlite_master
WHERE type='table' AND name = '{$this->prefix}meta... | php | public function isInstalled()
{
try {
switch ($this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME)) {
case "sqlite":
$query =
"SELECT count(*) FROM sqlite_master
WHERE type='table' AND name = '{$this->prefix}meta... | [
"public",
"function",
"isInstalled",
"(",
")",
"{",
"try",
"{",
"switch",
"(",
"$",
"this",
"->",
"pdo",
"->",
"getAttribute",
"(",
"\\",
"PDO",
"::",
"ATTR_DRIVER_NAME",
")",
")",
"{",
"case",
"\"sqlite\"",
":",
"$",
"query",
"=",
"\"SELECT count(*) FROM ... | Returns true if the backend was installed.
@return bool
@throws DataBackendException | [
"Returns",
"true",
"if",
"the",
"backend",
"was",
"installed",
"."
] | 2ad288cfc065d5c1ce31184de05aa0693e94bdb9 | https://github.com/bav-php/bav/blob/2ad288cfc065d5c1ce31184de05aa0693e94bdb9/classes/dataBackend/pdo/PDODataBackend.php#L538-L573 |
232,745 | bav-php/bav | classes/dataBackend/pdo/PDODataBackend.php | PDODataBackend.isValidBIC | public function isValidBIC($bic)
{
try {
$stmt = $this->statementContainer->prepare(
"SELECT bic FROM {$this->prefix}agency WHERE bic = :bic GROUP BY (bic)"
);
$stmt->execute(array(":bic" => $bic));
$rows = $stmt->fetchAll();
... | php | public function isValidBIC($bic)
{
try {
$stmt = $this->statementContainer->prepare(
"SELECT bic FROM {$this->prefix}agency WHERE bic = :bic GROUP BY (bic)"
);
$stmt->execute(array(":bic" => $bic));
$rows = $stmt->fetchAll();
... | [
"public",
"function",
"isValidBIC",
"(",
"$",
"bic",
")",
"{",
"try",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"statementContainer",
"->",
"prepare",
"(",
"\"SELECT bic FROM {$this->prefix}agency WHERE bic = :bic GROUP BY (bic)\"",
")",
";",
"$",
"stmt",
"->",
"e... | Returns if a bic is valid.
@param string $bic BIC
@return bool | [
"Returns",
"if",
"a",
"bic",
"is",
"valid",
"."
] | 2ad288cfc065d5c1ce31184de05aa0693e94bdb9 | https://github.com/bav-php/bav/blob/2ad288cfc065d5c1ce31184de05aa0693e94bdb9/classes/dataBackend/pdo/PDODataBackend.php#L581-L597 |
232,746 | networkteam/Networkteam.SentryClient | Classes/Context/PartyUserContext.php | PartyUserContext.getUserContext | public function getUserContext(Context $securityContext)
{
$account = $securityContext->getAccount();
if ($account) {
$party = $this->partyRepository->findOneHavingAccount($account);
$userContext = [];
if ($party instanceof Person && $party->getPrimaryElectronicAd... | php | public function getUserContext(Context $securityContext)
{
$account = $securityContext->getAccount();
if ($account) {
$party = $this->partyRepository->findOneHavingAccount($account);
$userContext = [];
if ($party instanceof Person && $party->getPrimaryElectronicAd... | [
"public",
"function",
"getUserContext",
"(",
"Context",
"$",
"securityContext",
")",
"{",
"$",
"account",
"=",
"$",
"securityContext",
"->",
"getAccount",
"(",
")",
";",
"if",
"(",
"$",
"account",
")",
"{",
"$",
"party",
"=",
"$",
"this",
"->",
"partyRep... | Returns ContextData to be added to the sentry entry
@param Context $securityContext
@return array | [
"Returns",
"ContextData",
"to",
"be",
"added",
"to",
"the",
"sentry",
"entry"
] | ad5f7e0e32b0fd11da21b3e37a1ae8dc5e6c2cbc | https://github.com/networkteam/Networkteam.SentryClient/blob/ad5f7e0e32b0fd11da21b3e37a1ae8dc5e6c2cbc/Classes/Context/PartyUserContext.php#L25-L41 |
232,747 | tedslittlerobot/html-table-builder | src/Elements/Cells/ContentCell.php | ContentCell.wrapContent | public function wrapContent(string $opening, string $content, string $closing) : ContentCell
{
$this->content = $opening . helpers\e($content) . $closing;
return $this->raw();
} | php | public function wrapContent(string $opening, string $content, string $closing) : ContentCell
{
$this->content = $opening . helpers\e($content) . $closing;
return $this->raw();
} | [
"public",
"function",
"wrapContent",
"(",
"string",
"$",
"opening",
",",
"string",
"$",
"content",
",",
"string",
"$",
"closing",
")",
":",
"ContentCell",
"{",
"$",
"this",
"->",
"content",
"=",
"$",
"opening",
".",
"helpers",
"\\",
"e",
"(",
"$",
"con... | Set the cell's content, wrapping it in some html
@param string $opening
@param string $content
@param string $closing
@return \Tlr\Tables\Elements\ContentCell | [
"Set",
"the",
"cell",
"s",
"content",
"wrapping",
"it",
"in",
"some",
"html"
] | 12597f8c44dde9f002c74b0aeadefec2bdb2eafa | https://github.com/tedslittlerobot/html-table-builder/blob/12597f8c44dde9f002c74b0aeadefec2bdb2eafa/src/Elements/Cells/ContentCell.php#L46-L51 |
232,748 | tedslittlerobot/html-table-builder | src/Elements/Cells/ContentCell.php | ContentCell.getContent | public function getContent() : string
{
return $this->escape ? helpers\e($this->content) : $this->content;
} | php | public function getContent() : string
{
return $this->escape ? helpers\e($this->content) : $this->content;
} | [
"public",
"function",
"getContent",
"(",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"escape",
"?",
"helpers",
"\\",
"e",
"(",
"$",
"this",
"->",
"content",
")",
":",
"$",
"this",
"->",
"content",
";",
"}"
] | Get the cell content
@return string | [
"Get",
"the",
"cell",
"content"
] | 12597f8c44dde9f002c74b0aeadefec2bdb2eafa | https://github.com/tedslittlerobot/html-table-builder/blob/12597f8c44dde9f002c74b0aeadefec2bdb2eafa/src/Elements/Cells/ContentCell.php#L93-L96 |
232,749 | asinfotrack/yii2-toolbox | console/ConsoleTarget.php | ConsoleTarget.formatLine | public function formatLine($text, $level, $category, $timestamp)
{
return sprintf(
"%-19s [%-7s] [%s]\n %s",
Yii::$app->formatter->asDatetime($timestamp, 'php:d.m.Y H:i:s'),
strtoupper(Logger::getLevelName($level)),
$category,
$text
);
} | php | public function formatLine($text, $level, $category, $timestamp)
{
return sprintf(
"%-19s [%-7s] [%s]\n %s",
Yii::$app->formatter->asDatetime($timestamp, 'php:d.m.Y H:i:s'),
strtoupper(Logger::getLevelName($level)),
$category,
$text
);
} | [
"public",
"function",
"formatLine",
"(",
"$",
"text",
",",
"$",
"level",
",",
"$",
"category",
",",
"$",
"timestamp",
")",
"{",
"return",
"sprintf",
"(",
"\"%-19s [%-7s] [%s]\\n %s\"",
",",
"Yii",
"::",
"$",
"app",
"->",
"formatter",
"->",
... | Default line formatting
@param string $text the actual log-text
@param integer $level the log level
@param string $category the log category
@param integer $timestamp the events timestamp
@return string the formatted line | [
"Default",
"line",
"formatting"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/console/ConsoleTarget.php#L71-L80 |
232,750 | Zeindelf/badwords | src/Badwords.php | Badwords.verify | public static function verify($string, array $extra = null)
{
require_once __DIR__ . '/Config/Filter.php';
$string = static::doubleChars($string);
$getFilter = Config::get('filter');
if ( !is_null($extra) ) {
if ( array_key_exists('badwords', $extra) ) {
$getFilter = array_merge($extra['badwords'], $g... | php | public static function verify($string, array $extra = null)
{
require_once __DIR__ . '/Config/Filter.php';
$string = static::doubleChars($string);
$getFilter = Config::get('filter');
if ( !is_null($extra) ) {
if ( array_key_exists('badwords', $extra) ) {
$getFilter = array_merge($extra['badwords'], $g... | [
"public",
"static",
"function",
"verify",
"(",
"$",
"string",
",",
"array",
"$",
"extra",
"=",
"null",
")",
"{",
"require_once",
"__DIR__",
".",
"'/Config/Filter.php'",
";",
"$",
"string",
"=",
"static",
"::",
"doubleChars",
"(",
"$",
"string",
")",
";",
... | Verifica se a palavra informada existe no filtro
No parâmetro $extra, informe um array com as chaves
'badwords' e/ou 'ignored'. Como valor das chaves, informe-os
em um array, como:
$extra = [
'badwords' => ['palavraUm', 'palavraDois', ...],
'ignored' => ['palavraTres', 'palavraQuatro', ...],
];
'badwords' são palav... | [
"Verifica",
"se",
"a",
"palavra",
"informada",
"existe",
"no",
"filtro"
] | 95f785b4678e34d8cf451e7db41189ede47f2ba4 | https://github.com/Zeindelf/badwords/blob/95f785b4678e34d8cf451e7db41189ede47f2ba4/src/Badwords.php#L39-L79 |
232,751 | fondbot/drivers-vk | src/VkCommunityDriver.php | VkCommunityDriver.verifyRequest | public function verifyRequest(): void
{
$type = $this->request->getParameter('type');
$object = $this->request->getParameter('object');
if ($type === null || $type !== 'message_new') {
throw new InvalidRequest('Invalid type');
}
if ($object === null) {
... | php | public function verifyRequest(): void
{
$type = $this->request->getParameter('type');
$object = $this->request->getParameter('object');
if ($type === null || $type !== 'message_new') {
throw new InvalidRequest('Invalid type');
}
if ($object === null) {
... | [
"public",
"function",
"verifyRequest",
"(",
")",
":",
"void",
"{",
"$",
"type",
"=",
"$",
"this",
"->",
"request",
"->",
"getParameter",
"(",
"'type'",
")",
";",
"$",
"object",
"=",
"$",
"this",
"->",
"request",
"->",
"getParameter",
"(",
"'object'",
"... | Verify incoming request data.
@throws InvalidRequest | [
"Verify",
"incoming",
"request",
"data",
"."
] | b4da296d19f0c58dacb7bae486b43d59b82da4c3 | https://github.com/fondbot/drivers-vk/blob/b4da296d19f0c58dacb7bae486b43d59b82da4c3/src/VkCommunityDriver.php#L69-L89 |
232,752 | fondbot/drivers-vk | src/VkCommunityDriver.php | VkCommunityDriver.getUser | public function getUser(): User
{
if ($this->sender !== null) {
return $this->sender;
}
$userId = (string) $this->request->getParameter('object.user_id');
$request = $this->http->get(self::API_URL.'users.get', [
'query' => [
'user_ids' => $use... | php | public function getUser(): User
{
if ($this->sender !== null) {
return $this->sender;
}
$userId = (string) $this->request->getParameter('object.user_id');
$request = $this->http->get(self::API_URL.'users.get', [
'query' => [
'user_ids' => $use... | [
"public",
"function",
"getUser",
"(",
")",
":",
"User",
"{",
"if",
"(",
"$",
"this",
"->",
"sender",
"!==",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"sender",
";",
"}",
"$",
"userId",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"request",
"... | Get message sender.
@return User
@throws InvalidRequest | [
"Get",
"message",
"sender",
"."
] | b4da296d19f0c58dacb7bae486b43d59b82da4c3 | https://github.com/fondbot/drivers-vk/blob/b4da296d19f0c58dacb7bae486b43d59b82da4c3/src/VkCommunityDriver.php#L110-L130 |
232,753 | dmitriybelyy/yii2-cassandra-cql | phpcassa/Batch/Mutator.php | Mutator.insert | public function insert($column_family, $key, $columns, $timestamp=null, $ttl=null) {
return $this->insert_cf($column_family, $key, $columns, $timestamp, $ttl);
} | php | public function insert($column_family, $key, $columns, $timestamp=null, $ttl=null) {
return $this->insert_cf($column_family, $key, $columns, $timestamp, $ttl);
} | [
"public",
"function",
"insert",
"(",
"$",
"column_family",
",",
"$",
"key",
",",
"$",
"columns",
",",
"$",
"timestamp",
"=",
"null",
",",
"$",
"ttl",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"insert_cf",
"(",
"$",
"column_family",
",",
"$"... | Add an insertion to the buffer.
@param phpcassa\ColumnFamily $column_family an initialized
ColumnFamily instance
@param mixed $key the row key
@param mixed[] $columns an array of columns to insert, whose format
should match $column_family->insert_format
@param int $timestamp an optional timestamp (default is "now", wh... | [
"Add",
"an",
"insertion",
"to",
"the",
"buffer",
"."
] | fa0fd4914444f64baba20848c7d4146c1b430346 | https://github.com/dmitriybelyy/yii2-cassandra-cql/blob/fa0fd4914444f64baba20848c7d4146c1b430346/phpcassa/Batch/Mutator.php#L42-L44 |
232,754 | dmitriybelyy/yii2-cassandra-cql | phpcassa/Batch/Mutator.php | Mutator.remove | public function remove($column_family, $key, $columns=null, $super_column=null, $timestamp=null) {
return $this->remove_cf($column_family, $key, $columns, $super_column, $timestamp);
} | php | public function remove($column_family, $key, $columns=null, $super_column=null, $timestamp=null) {
return $this->remove_cf($column_family, $key, $columns, $super_column, $timestamp);
} | [
"public",
"function",
"remove",
"(",
"$",
"column_family",
",",
"$",
"key",
",",
"$",
"columns",
"=",
"null",
",",
"$",
"super_column",
"=",
"null",
",",
"$",
"timestamp",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"remove_cf",
"(",
"$",
"co... | Add a deletion to the buffer.
@param phpcassa\ColumnFamily $column_family an initialized
ColumnFamily instance
@param mixed $key the row key
@param mixed[] $columns a list of columns or super columns to delete
@param mixed $supercolumn if you want to delete only some subcolumns from
a single super column, set this to ... | [
"Add",
"a",
"deletion",
"to",
"the",
"buffer",
"."
] | fa0fd4914444f64baba20848c7d4146c1b430346 | https://github.com/dmitriybelyy/yii2-cassandra-cql/blob/fa0fd4914444f64baba20848c7d4146c1b430346/phpcassa/Batch/Mutator.php#L58-L60 |
232,755 | asinfotrack/yii2-toolbox | behaviors/StateQueryBehavior.php | StateQueryBehavior.lowerThanState | public function lowerThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_LOWER)]);
return $this->owner;
} | php | public function lowerThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_LOWER)]);
return $this->owner;
} | [
"public",
"function",
"lowerThanState",
"(",
"$",
"stateValue",
")",
"{",
"//validate state",
"$",
"this",
"->",
"modelInstance",
"->",
"stateExists",
"(",
"$",
"stateValue",
",",
"true",
")",
";",
"//apply to query",
"$",
"this",
"->",
"owner",
"->",
"andWher... | Named scope to fetch all models having a state lower than the one provided
@param integer|string $stateValue the value of the state to check
@return \asinfotrack\yii2\toolbox\behaviors\StateQueryBehavior | [
"Named",
"scope",
"to",
"fetch",
"all",
"models",
"having",
"a",
"state",
"lower",
"than",
"the",
"one",
"provided"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/behaviors/StateQueryBehavior.php#L63-L70 |
232,756 | asinfotrack/yii2-toolbox | behaviors/StateQueryBehavior.php | StateQueryBehavior.lowerOrEqualThanState | public function lowerOrEqualThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_LOWER_OR_EQUAL)]);
return $this->owner;
} | php | public function lowerOrEqualThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_LOWER_OR_EQUAL)]);
return $this->owner;
} | [
"public",
"function",
"lowerOrEqualThanState",
"(",
"$",
"stateValue",
")",
"{",
"//validate state",
"$",
"this",
"->",
"modelInstance",
"->",
"stateExists",
"(",
"$",
"stateValue",
",",
"true",
")",
";",
"//apply to query",
"$",
"this",
"->",
"owner",
"->",
"... | Named scope to fetch all models having a state lower or equal than the one provided
@param integer|string $stateValue the value of the state to check
@return \asinfotrack\yii2\toolbox\behaviors\StateQueryBehavior | [
"Named",
"scope",
"to",
"fetch",
"all",
"models",
"having",
"a",
"state",
"lower",
"or",
"equal",
"than",
"the",
"one",
"provided"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/behaviors/StateQueryBehavior.php#L78-L85 |
232,757 | asinfotrack/yii2-toolbox | behaviors/StateQueryBehavior.php | StateQueryBehavior.inState | public function inState($stateValue)
{
if (is_array($stateValue)) {
//validate states
foreach ($stateValue as $sv) {
$this->modelInstance->stateExists($sv, true);
}
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $stateValue]);
} else {
//validate state
$this->modelIn... | php | public function inState($stateValue)
{
if (is_array($stateValue)) {
//validate states
foreach ($stateValue as $sv) {
$this->modelInstance->stateExists($sv, true);
}
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $stateValue]);
} else {
//validate state
$this->modelIn... | [
"public",
"function",
"inState",
"(",
"$",
"stateValue",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"stateValue",
")",
")",
"{",
"//validate states",
"foreach",
"(",
"$",
"stateValue",
"as",
"$",
"sv",
")",
"{",
"$",
"this",
"->",
"modelInstance",
"->",
... | Named scope to filter models exactly in the provided state. Its also possible
to provide an array of states. In this case all models with any of those states
will be returned
@param integer|string|integer[]|string[] $stateValue the value(s) of the state to check
@return \asinfotrack\yii2\toolbox\behaviors\StateQueryBe... | [
"Named",
"scope",
"to",
"filter",
"models",
"exactly",
"in",
"the",
"provided",
"state",
".",
"Its",
"also",
"possible",
"to",
"provide",
"an",
"array",
"of",
"states",
".",
"In",
"this",
"case",
"all",
"models",
"with",
"any",
"of",
"those",
"states",
"... | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/behaviors/StateQueryBehavior.php#L95-L112 |
232,758 | asinfotrack/yii2-toolbox | behaviors/StateQueryBehavior.php | StateQueryBehavior.equalOrHigherThanState | public function equalOrHigherThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_EQUAL_OR_HIGHER)]);
return $this->owner;
} | php | public function equalOrHigherThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_EQUAL_OR_HIGHER)]);
return $this->owner;
} | [
"public",
"function",
"equalOrHigherThanState",
"(",
"$",
"stateValue",
")",
"{",
"//validate state",
"$",
"this",
"->",
"modelInstance",
"->",
"stateExists",
"(",
"$",
"stateValue",
",",
"true",
")",
";",
"//apply to query",
"$",
"this",
"->",
"owner",
"->",
... | Named scope to fetch all models having a state higher or equal than the one provided
@param integer|string $stateValue the value of the state to check
@return \asinfotrack\yii2\toolbox\behaviors\StateQueryBehavior | [
"Named",
"scope",
"to",
"fetch",
"all",
"models",
"having",
"a",
"state",
"higher",
"or",
"equal",
"than",
"the",
"one",
"provided"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/behaviors/StateQueryBehavior.php#L120-L127 |
232,759 | asinfotrack/yii2-toolbox | behaviors/StateQueryBehavior.php | StateQueryBehavior.higherThanState | public function higherThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_HIGHER)]);
return $this->owner;
} | php | public function higherThanState($stateValue)
{
//validate state
$this->modelInstance->stateExists($stateValue, true);
//apply to query
$this->owner->andWhere(['IN', $this->stateAttribute, $this->getStateSelection($stateValue, static::STATES_HIGHER)]);
return $this->owner;
} | [
"public",
"function",
"higherThanState",
"(",
"$",
"stateValue",
")",
"{",
"//validate state",
"$",
"this",
"->",
"modelInstance",
"->",
"stateExists",
"(",
"$",
"stateValue",
",",
"true",
")",
";",
"//apply to query",
"$",
"this",
"->",
"owner",
"->",
"andWhe... | Named scope to fetch all models having a state higher than the one provided
@param integer|string $stateValue the value of the state to check
@return \asinfotrack\yii2\toolbox\behaviors\StateQueryBehavior | [
"Named",
"scope",
"to",
"fetch",
"all",
"models",
"having",
"a",
"state",
"higher",
"than",
"the",
"one",
"provided"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/behaviors/StateQueryBehavior.php#L135-L142 |
232,760 | asinfotrack/yii2-toolbox | behaviors/StateQueryBehavior.php | StateQueryBehavior.getStateSelection | protected function getStateSelection($stateValue, $which)
{
$ret = [];
$foundCurrent = false;
foreach (ArrayHelper::getColumn($this->stateConfig, 'value') as $val) {
if ($stateValue == $val) {
$foundCurrent = true;
if ($which == static::STATES_LOWER) {
break;
} else if ($which == static::STA... | php | protected function getStateSelection($stateValue, $which)
{
$ret = [];
$foundCurrent = false;
foreach (ArrayHelper::getColumn($this->stateConfig, 'value') as $val) {
if ($stateValue == $val) {
$foundCurrent = true;
if ($which == static::STATES_LOWER) {
break;
} else if ($which == static::STA... | [
"protected",
"function",
"getStateSelection",
"(",
"$",
"stateValue",
",",
"$",
"which",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"$",
"foundCurrent",
"=",
"false",
";",
"foreach",
"(",
"ArrayHelper",
"::",
"getColumn",
"(",
"$",
"this",
"->",
"stateCon... | Gets a selection of states from the current state config
@param integer|string $stateValue the value of the state to check
@param integer $which selection constant of this class
@return integer[]|string[] array the desired states | [
"Gets",
"a",
"selection",
"of",
"states",
"from",
"the",
"current",
"state",
"config"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/behaviors/StateQueryBehavior.php#L151-L180 |
232,761 | kuria/error | src/Screen/WebErrorScreen.php | WebErrorScreen.renderLayout | protected function renderLayout(bool $debug, string $title, string $content): void
{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="<?= $this->escape(strtolower($this->htmlCharset)) ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php if ($debug) : ?>
<link rel="icon" type="image... | php | protected function renderLayout(bool $debug, string $title, string $content): void
{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="<?= $this->escape(strtolower($this->htmlCharset)) ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php if ($debug) : ?>
<link rel="icon" type="image... | [
"protected",
"function",
"renderLayout",
"(",
"bool",
"$",
"debug",
",",
"string",
"$",
"title",
",",
"string",
"$",
"content",
")",
":",
"void",
"{",
"?>\n<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"<?=",
"$",
"this",
"->",
"escape",
"(",
"strtolower",
"(",
... | Render the HTML layout | [
"Render",
"the",
"HTML",
"layout"
] | e1426256569e9e9253a940a3cec854d550b257eb | https://github.com/kuria/error/blob/e1426256569e9e9253a940a3cec854d550b257eb/src/Screen/WebErrorScreen.php#L160-L194 |
232,762 | kuria/error | src/Screen/WebErrorScreen.php | WebErrorScreen.escape | protected function escape(string $string): string
{
return htmlspecialchars($string, ENT_QUOTES | ENT_IGNORE, $this->encoding);
} | php | protected function escape(string $string): string
{
return htmlspecialchars($string, ENT_QUOTES | ENT_IGNORE, $this->encoding);
} | [
"protected",
"function",
"escape",
"(",
"string",
"$",
"string",
")",
":",
"string",
"{",
"return",
"htmlspecialchars",
"(",
"$",
"string",
",",
"ENT_QUOTES",
"|",
"ENT_IGNORE",
",",
"$",
"this",
"->",
"encoding",
")",
";",
"}"
] | Escape the given string string for HTML | [
"Escape",
"the",
"given",
"string",
"string",
"for",
"HTML"
] | e1426256569e9e9253a940a3cec854d550b257eb | https://github.com/kuria/error/blob/e1426256569e9e9253a940a3cec854d550b257eb/src/Screen/WebErrorScreen.php#L219-L222 |
232,763 | ncaneldiee/rajaongkir | src/Domestic.php | Domestic.courier | public function courier($courier = null)
{
if ($courier) {
$courier = mb_strtolower($courier);
return array_key_exists($courier, $this->courier) ? $this->courier[$courier] : $this->courier;
}
return (object) $this->courier;
} | php | public function courier($courier = null)
{
if ($courier) {
$courier = mb_strtolower($courier);
return array_key_exists($courier, $this->courier) ? $this->courier[$courier] : $this->courier;
}
return (object) $this->courier;
} | [
"public",
"function",
"courier",
"(",
"$",
"courier",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"courier",
")",
"{",
"$",
"courier",
"=",
"mb_strtolower",
"(",
"$",
"courier",
")",
";",
"return",
"array_key_exists",
"(",
"$",
"courier",
",",
"$",
"this",
... | Get a list or detail of the courier.
@param string|null $courier
@return object | [
"Get",
"a",
"list",
"or",
"detail",
"of",
"the",
"courier",
"."
] | 98e5c40a1b359953dcc913dd5070b8e8560a86a5 | https://github.com/ncaneldiee/rajaongkir/blob/98e5c40a1b359953dcc913dd5070b8e8560a86a5/src/Domestic.php#L207-L216 |
232,764 | ncaneldiee/rajaongkir | src/Domestic.php | Domestic.waybill | public function waybill($id, $courier)
{
$courier = mb_strtolower($courier);
return $this->request('waybill', [
'waybill' => $id,
'courier' => $courier,
], 'POST');
} | php | public function waybill($id, $courier)
{
$courier = mb_strtolower($courier);
return $this->request('waybill', [
'waybill' => $id,
'courier' => $courier,
], 'POST');
} | [
"public",
"function",
"waybill",
"(",
"$",
"id",
",",
"$",
"courier",
")",
"{",
"$",
"courier",
"=",
"mb_strtolower",
"(",
"$",
"courier",
")",
";",
"return",
"$",
"this",
"->",
"request",
"(",
"'waybill'",
",",
"[",
"'waybill'",
"=>",
"$",
"id",
","... | Track or find out delivery status.
@param string $id
@param string $courier
@return object | [
"Track",
"or",
"find",
"out",
"delivery",
"status",
"."
] | 98e5c40a1b359953dcc913dd5070b8e8560a86a5 | https://github.com/ncaneldiee/rajaongkir/blob/98e5c40a1b359953dcc913dd5070b8e8560a86a5/src/Domestic.php#L263-L271 |
232,765 | ncaneldiee/rajaongkir | src/Domestic.php | Domestic.shipment | protected function shipment($shipment)
{
$data = [];
if (is_array($shipment)) {
if (isset($shipment['length']) && isset($shipment['width']) && isset($shipment['height'])) {
$volumetric = (($shipment['length'] * $shipment['width'] * $shipment['height']) / 6000) * 1000;
... | php | protected function shipment($shipment)
{
$data = [];
if (is_array($shipment)) {
if (isset($shipment['length']) && isset($shipment['width']) && isset($shipment['height'])) {
$volumetric = (($shipment['length'] * $shipment['width'] * $shipment['height']) / 6000) * 1000;
... | [
"protected",
"function",
"shipment",
"(",
"$",
"shipment",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"is_array",
"(",
"$",
"shipment",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"shipment",
"[",
"'length'",
"]",
")",
"&&",
"isset",
... | Shipment detail.
@param string|array $shipment
@return array | [
"Shipment",
"detail",
"."
] | 98e5c40a1b359953dcc913dd5070b8e8560a86a5 | https://github.com/ncaneldiee/rajaongkir/blob/98e5c40a1b359953dcc913dd5070b8e8560a86a5/src/Domestic.php#L343-L362 |
232,766 | phillies2k/ratchet-bundle | WebSocket/Server/Bridge.php | Bridge.handle | protected function handle(ConnectionInterface $connection, Payload $payload)
{
switch ($payload->getEvent()) {
case ConnectionEvent::SOCKET_AUTH_REQUEST:
$this->handleAuthentication($connection, $payload);
break;
default:
$this->eventDi... | php | protected function handle(ConnectionInterface $connection, Payload $payload)
{
switch ($payload->getEvent()) {
case ConnectionEvent::SOCKET_AUTH_REQUEST:
$this->handleAuthentication($connection, $payload);
break;
default:
$this->eventDi... | [
"protected",
"function",
"handle",
"(",
"ConnectionInterface",
"$",
"connection",
",",
"Payload",
"$",
"payload",
")",
"{",
"switch",
"(",
"$",
"payload",
"->",
"getEvent",
"(",
")",
")",
"{",
"case",
"ConnectionEvent",
"::",
"SOCKET_AUTH_REQUEST",
":",
"$",
... | Handles the the given payload received by the given connection.
@param ConnectionInterface $connection
@param Payload $payload | [
"Handles",
"the",
"the",
"given",
"payload",
"received",
"by",
"the",
"given",
"connection",
"."
] | 1ea60f42d04c6e5e2c63c7f8c53262d382b0b5f3 | https://github.com/phillies2k/ratchet-bundle/blob/1ea60f42d04c6e5e2c63c7f8c53262d382b0b5f3/WebSocket/Server/Bridge.php#L153-L163 |
232,767 | phillies2k/ratchet-bundle | WebSocket/Server/Bridge.php | Bridge.handleAuthentication | protected function handleAuthentication(ConnectionInterface $connection, Payload $payload)
{
if (! $this->connectionManager->authenticate($connection, $payload->getData())) {
$connection->emit(new Payload(ConnectionEvent::SOCKET_AUTH_FAILURE, 'Invalid access token.'));
$this->eventD... | php | protected function handleAuthentication(ConnectionInterface $connection, Payload $payload)
{
if (! $this->connectionManager->authenticate($connection, $payload->getData())) {
$connection->emit(new Payload(ConnectionEvent::SOCKET_AUTH_FAILURE, 'Invalid access token.'));
$this->eventD... | [
"protected",
"function",
"handleAuthentication",
"(",
"ConnectionInterface",
"$",
"connection",
",",
"Payload",
"$",
"payload",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"connectionManager",
"->",
"authenticate",
"(",
"$",
"connection",
",",
"$",
"payload",
... | Handles the connection authentication.
@param ConnectionInterface $connection
@param Payload $payload | [
"Handles",
"the",
"connection",
"authentication",
"."
] | 1ea60f42d04c6e5e2c63c7f8c53262d382b0b5f3 | https://github.com/phillies2k/ratchet-bundle/blob/1ea60f42d04c6e5e2c63c7f8c53262d382b0b5f3/WebSocket/Server/Bridge.php#L171-L201 |
232,768 | juanmf/PdfManager | Fpdi/Traits/FpdiPdfManagerMergeTrait.php | FpdiPdfManagerMergeTrait.merge | public function merge(array $pdfs = array())
{
$outPdf = $this->getPdfInstance(array_shift($pdfs));
foreach ($pdfs as $pdf) {
$outPdf->importPdf($pdf, ($pdf instanceof Pdf));
}
return $outPdf;
} | php | public function merge(array $pdfs = array())
{
$outPdf = $this->getPdfInstance(array_shift($pdfs));
foreach ($pdfs as $pdf) {
$outPdf->importPdf($pdf, ($pdf instanceof Pdf));
}
return $outPdf;
} | [
"public",
"function",
"merge",
"(",
"array",
"$",
"pdfs",
"=",
"array",
"(",
")",
")",
"{",
"$",
"outPdf",
"=",
"$",
"this",
"->",
"getPdfInstance",
"(",
"array_shift",
"(",
"$",
"pdfs",
")",
")",
";",
"foreach",
"(",
"$",
"pdfs",
"as",
"$",
"pdf",... | Merges all pdfs in the given array into One. Enlarging the first Pdf in Array.
@param string[]|Pdf[] $pdfs Each element could be PDF path or Pdf Object.
@return Pdf the PDF | [
"Merges",
"all",
"pdfs",
"in",
"the",
"given",
"array",
"into",
"One",
".",
"Enlarging",
"the",
"first",
"Pdf",
"in",
"Array",
"."
] | 0b2a199981486a08206d015e7f1e5e26397301f0 | https://github.com/juanmf/PdfManager/blob/0b2a199981486a08206d015e7f1e5e26397301f0/Fpdi/Traits/FpdiPdfManagerMergeTrait.php#L21-L29 |
232,769 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.server | public function server(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getServerParams();
}
return $this->getServerParams()[$key] ?? $default;
} | php | public function server(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getServerParams();
}
return $this->getServerParams()[$key] ?? $default;
} | [
"public",
"function",
"server",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getServerParams",
"(",
")",
";",
"}",
"return",
... | Retrieve a server variable from the request
@param null|string $key
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"a",
"server",
"variable",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L26-L32 |
232,770 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.header | public function header(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getHeaders();
}
return $this->getHeader($key) ?? $default;
} | php | public function header(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getHeaders();
}
return $this->getHeader($key) ?? $default;
} | [
"public",
"function",
"header",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getHeaders",
"(",
")",
";",
"}",
"return",
"$"... | Retrieve a header from the request
@param null|string $key
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"a",
"header",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L41-L47 |
232,771 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.query | public function query(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getQueryParams();
}
return $this->getQueryParams()[$key] ?? $default;
} | php | public function query(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getQueryParams();
}
return $this->getQueryParams()[$key] ?? $default;
} | [
"public",
"function",
"query",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getQueryParams",
"(",
")",
";",
"}",
"return",
... | Retrieve a query string from the request
@param null|string $key
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"a",
"query",
"string",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L56-L62 |
232,772 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.post | public function post(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getParsedBody();
}
return $this->getParsedBody()[$key] ?? $default;
} | php | public function post(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getParsedBody();
}
return $this->getParsedBody()[$key] ?? $default;
} | [
"public",
"function",
"post",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getParsedBody",
"(",
")",
";",
"}",
"return",
"$... | Retrieve a post item from the request
@param null|string $key
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"a",
"post",
"item",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L71-L77 |
232,773 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.input | public function input(string $key = null, $default = null)
{
$inputs = $this->getQueryParams() + $this->getParsedBody();
if (is_null($key)) {
return $inputs;
}
return $inputs[$key] ?? $default;
} | php | public function input(string $key = null, $default = null)
{
$inputs = $this->getQueryParams() + $this->getParsedBody();
if (is_null($key)) {
return $inputs;
}
return $inputs[$key] ?? $default;
} | [
"public",
"function",
"input",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"inputs",
"=",
"$",
"this",
"->",
"getQueryParams",
"(",
")",
"+",
"$",
"this",
"->",
"getParsedBody",
"(",
")",
";",
"if",
"(",... | Retrieve a input item from the request
@param null|string $key
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"a",
"input",
"item",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L86-L93 |
232,774 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.cookie | public function cookie(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getCookieParams();
}
return $this->getCookieParams()[$key] ?? $default;
} | php | public function cookie(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getCookieParams();
}
return $this->getCookieParams()[$key] ?? $default;
} | [
"public",
"function",
"cookie",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getCookieParams",
"(",
")",
";",
"}",
"return",
... | Retrieve a cookie from the request
@param null|string $key
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"a",
"cookie",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L102-L108 |
232,775 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.raw | public function raw($default = null)
{
$body = $this->getBody();
$raw = $default;
if ($body instanceof SwooleStream) {
$raw = $body->getContents();
}
return $raw;
} | php | public function raw($default = null)
{
$body = $this->getBody();
$raw = $default;
if ($body instanceof SwooleStream) {
$raw = $body->getContents();
}
return $raw;
} | [
"public",
"function",
"raw",
"(",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"body",
"=",
"$",
"this",
"->",
"getBody",
"(",
")",
";",
"$",
"raw",
"=",
"$",
"default",
";",
"if",
"(",
"$",
"body",
"instanceof",
"SwooleStream",
")",
"{",
"$",
"ra... | Retrieve raw body from the request
@param null|mixed $default
@return array|string|mixed | [
"Retrieve",
"raw",
"body",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L116-L124 |
232,776 | swoft-cloud/swoft-http-message | src/Server/Concerns/InteractsWithInput.php | InteractsWithInput.file | public function file(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getUploadedFiles();
}
return $this->getUploadedFiles()[$key] ?? $default;
} | php | public function file(string $key = null, $default = null)
{
if (is_null($key)) {
return $this->getUploadedFiles();
}
return $this->getUploadedFiles()[$key] ?? $default;
} | [
"public",
"function",
"file",
"(",
"string",
"$",
"key",
"=",
"null",
",",
"$",
"default",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"key",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getUploadedFiles",
"(",
")",
";",
"}",
"return",
... | Retrieve a upload item from the request
@param string|null $key
@param null $default
@return array|\Swoft\Web\UploadedFile|null | [
"Retrieve",
"a",
"upload",
"item",
"from",
"the",
"request"
] | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Server/Concerns/InteractsWithInput.php#L165-L171 |
232,777 | asinfotrack/yii2-toolbox | console/Migration.php | Migration.isTableEmpty | public function isTableEmpty($tableName)
{
$tableNameQuoted = $this->getDb()->quoteTableName($tableName);
$cmd = sprintf('SELECT COUNT(*) FROM %s', $tableNameQuoted);
return $this->getDb()->createCommand($cmd)->queryScalar() === 0;
} | php | public function isTableEmpty($tableName)
{
$tableNameQuoted = $this->getDb()->quoteTableName($tableName);
$cmd = sprintf('SELECT COUNT(*) FROM %s', $tableNameQuoted);
return $this->getDb()->createCommand($cmd)->queryScalar() === 0;
} | [
"public",
"function",
"isTableEmpty",
"(",
"$",
"tableName",
")",
"{",
"$",
"tableNameQuoted",
"=",
"$",
"this",
"->",
"getDb",
"(",
")",
"->",
"quoteTableName",
"(",
"$",
"tableName",
")",
";",
"$",
"cmd",
"=",
"sprintf",
"(",
"'SELECT COUNT(*) FROM %s'",
... | Returns whether or not a table is empty
@param string $tableName name of the table
@return bool true if empty | [
"Returns",
"whether",
"or",
"not",
"a",
"table",
"is",
"empty"
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/console/Migration.php#L23-L29 |
232,778 | asinfotrack/yii2-toolbox | console/Migration.php | Migration.createAuditedTable | public function createAuditedTable($table, $columns, $options=null,
$createdField='created', $createdByField='created_by',
$updatedField='updated', $updatedByField='updated_by',
$userTableName='{{%user}}', $userIdField='id',
$createdOnDelete='SET NULL', $updatedOnDelete='SET NULL')
{
//first create the table... | php | public function createAuditedTable($table, $columns, $options=null,
$createdField='created', $createdByField='created_by',
$updatedField='updated', $updatedByField='updated_by',
$userTableName='{{%user}}', $userIdField='id',
$createdOnDelete='SET NULL', $updatedOnDelete='SET NULL')
{
//first create the table... | [
"public",
"function",
"createAuditedTable",
"(",
"$",
"table",
",",
"$",
"columns",
",",
"$",
"options",
"=",
"null",
",",
"$",
"createdField",
"=",
"'created'",
",",
"$",
"createdByField",
"=",
"'created_by'",
",",
"$",
"updatedField",
"=",
"'updated'",
","... | Builds and executes a SQL statement for creating a new DB table. This method also
creates the fields and relations needed for audit trail functionality.
The columns in the new table should be specified as name-definition pairs (e.g. 'name' => 'string'),
where name stands for a column name which will be properly quote... | [
"Builds",
"and",
"executes",
"a",
"SQL",
"statement",
"for",
"creating",
"a",
"new",
"DB",
"table",
".",
"This",
"method",
"also",
"creates",
"the",
"fields",
"and",
"relations",
"needed",
"for",
"audit",
"trail",
"functionality",
"."
] | 236f41e4b6e30117b3d7f9b1a5598633c5aed376 | https://github.com/asinfotrack/yii2-toolbox/blob/236f41e4b6e30117b3d7f9b1a5598633c5aed376/console/Migration.php#L56-L83 |
232,779 | silverstripe-archive/deploynaut | code/model/DNBranchList.php | DNBranchList.byName | public function byName($name) {
if($this->loaded == false) {
$this->getIterator();
}
if(isset($this->items[$name])) return $this->items[$name];
} | php | public function byName($name) {
if($this->loaded == false) {
$this->getIterator();
}
if(isset($this->items[$name])) return $this->items[$name];
} | [
"public",
"function",
"byName",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"loaded",
"==",
"false",
")",
"{",
"$",
"this",
"->",
"getIterator",
"(",
")",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"items",
"[",
"$",
"n... | Find a branch in this set by branch name. | [
"Find",
"a",
"branch",
"in",
"this",
"set",
"by",
"branch",
"name",
"."
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/model/DNBranchList.php#L55-L61 |
232,780 | CottaCush/phalcon-user-auth | src/Models/UserType.php | UserType.validation | public function validation()
{
$validator = new Validation();
$validator->add('name', new PresenceOf([
'message' => 'User type name must be supplied'
]));
$validator->add('name', new Uniqueness([
'message' => 'Sorry, the user type already exists'
])... | php | public function validation()
{
$validator = new Validation();
$validator->add('name', new PresenceOf([
'message' => 'User type name must be supplied'
]));
$validator->add('name', new Uniqueness([
'message' => 'Sorry, the user type already exists'
])... | [
"public",
"function",
"validation",
"(",
")",
"{",
"$",
"validator",
"=",
"new",
"Validation",
"(",
")",
";",
"$",
"validator",
"->",
"add",
"(",
"'name'",
",",
"new",
"PresenceOf",
"(",
"[",
"'message'",
"=>",
"'User type name must be supplied'",
"]",
")",
... | Validate user type entered
@return bool | [
"Validate",
"user",
"type",
"entered"
] | 89c8a1ae5e6f712591ba66bc2dd5e8a9f73b9d54 | https://github.com/CottaCush/phalcon-user-auth/blob/89c8a1ae5e6f712591ba66bc2dd5e8a9f73b9d54/src/Models/UserType.php#L112-L126 |
232,781 | ameliaikeda/backblaze | src/BackblazeServiceProvider.php | BackblazeServiceProvider.boot | public function boot()
{
Storage::extend('b2', function ($app, $config) {
$client = new Client($config['account'], $config['key']);
$adapter = new Adapter($client, $config['bucket'], $config['host']);
return new Filesystem($adapter);
});
} | php | public function boot()
{
Storage::extend('b2', function ($app, $config) {
$client = new Client($config['account'], $config['key']);
$adapter = new Adapter($client, $config['bucket'], $config['host']);
return new Filesystem($adapter);
});
} | [
"public",
"function",
"boot",
"(",
")",
"{",
"Storage",
"::",
"extend",
"(",
"'b2'",
",",
"function",
"(",
"$",
"app",
",",
"$",
"config",
")",
"{",
"$",
"client",
"=",
"new",
"Client",
"(",
"$",
"config",
"[",
"'account'",
"]",
",",
"$",
"config",... | Boot this service provider.
@return void | [
"Boot",
"this",
"service",
"provider",
"."
] | 72dd26a55549e3bfd7a551e019b9eefad7e50f5e | https://github.com/ameliaikeda/backblaze/blob/72dd26a55549e3bfd7a551e019b9eefad7e50f5e/src/BackblazeServiceProvider.php#L16-L25 |
232,782 | bav-php/bav | classes/validator/validators/ValidatorD5.php | ValidatorD5.validate | protected function validate()
{
$this->validator
= substr($this->account, 2, 2) == 99
? $this->validator1
: $this->validatorChain;
} | php | protected function validate()
{
$this->validator
= substr($this->account, 2, 2) == 99
? $this->validator1
: $this->validatorChain;
} | [
"protected",
"function",
"validate",
"(",
")",
"{",
"$",
"this",
"->",
"validator",
"=",
"substr",
"(",
"$",
"this",
"->",
"account",
",",
"2",
",",
"2",
")",
"==",
"99",
"?",
"$",
"this",
"->",
"validator1",
":",
"$",
"this",
"->",
"validatorChain",... | decide which validators are used
@return void | [
"decide",
"which",
"validators",
"are",
"used"
] | 2ad288cfc065d5c1ce31184de05aa0693e94bdb9 | https://github.com/bav-php/bav/blob/2ad288cfc065d5c1ce31184de05aa0693e94bdb9/classes/validator/validators/ValidatorD5.php#L88-L94 |
232,783 | swoft-cloud/swoft-http-message | src/Base/Request.php | Request.withMethod | public function withMethod($method)
{
$method = strtoupper($method);
$methods = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'HEAD'];
if (! in_array($method, $methods)) {
throw new \InvalidArgumentException('Invalid Method');
}
$new = clone $this;
$new->metho... | php | public function withMethod($method)
{
$method = strtoupper($method);
$methods = ['GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'HEAD'];
if (! in_array($method, $methods)) {
throw new \InvalidArgumentException('Invalid Method');
}
$new = clone $this;
$new->metho... | [
"public",
"function",
"withMethod",
"(",
"$",
"method",
")",
"{",
"$",
"method",
"=",
"strtoupper",
"(",
"$",
"method",
")",
";",
"$",
"methods",
"=",
"[",
"'GET'",
",",
"'POST'",
",",
"'PATCH'",
",",
"'PUT'",
",",
"'DELETE'",
",",
"'HEAD'",
"]",
";"... | Return an instance with the provided HTTP method.
While HTTP method names are typically all uppercase characters, HTTP
method names are case-sensitive and thus implementations SHOULD NOT
modify the given string.
This method MUST be implemented in such a way as to retain the
immutability of the message, and MUST return ... | [
"Return",
"an",
"instance",
"with",
"the",
"provided",
"HTTP",
"method",
".",
"While",
"HTTP",
"method",
"names",
"are",
"typically",
"all",
"uppercase",
"characters",
"HTTP",
"method",
"names",
"are",
"case",
"-",
"sensitive",
"and",
"thus",
"implementations",
... | 5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a | https://github.com/swoft-cloud/swoft-http-message/blob/5cc36c68b24d8ff9bc75cd0f6c8492bcc452f73a/src/Base/Request.php#L155-L165 |
232,784 | bav-php/bav | classes/validator/Validator.php | Validator.isValid | public function isValid($account)
{
try {
if ($account == null) {
return false;
}
$this->checkType($account);
$this->init($account);
$this->validate();
return ltrim($account, "0") != "" && $this->getResu... | php | public function isValid($account)
{
try {
if ($account == null) {
return false;
}
$this->checkType($account);
$this->init($account);
$this->validate();
return ltrim($account, "0") != "" && $this->getResu... | [
"public",
"function",
"isValid",
"(",
"$",
"account",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"account",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"$",
"this",
"->",
"checkType",
"(",
"$",
"account",
")",
";",
"$",
"this",
"->",
"init",
... | Validates a bank account.
Null is considered invalid.
Note: The parameter $account should be a string. If it's not a string
an E_USER_WARNING will be raised. Bank accounts may start with leading
zeros, wich lead to unexpected results if not treated as a string (
e.g. (int) 0020012357 evaluates to (string) '4199663').... | [
"Validates",
"a",
"bank",
"account",
"."
] | 2ad288cfc065d5c1ce31184de05aa0693e94bdb9 | https://github.com/bav-php/bav/blob/2ad288cfc065d5c1ce31184de05aa0693e94bdb9/classes/validator/Validator.php#L99-L115 |
232,785 | bav-php/bav | classes/validator/Validator.php | Validator.getNormalizedPosition | protected function getNormalizedPosition($pos)
{
if ($pos >= strlen($this->account) || $pos < -strlen($this->account)) {
throw new ValidatorOutOfBoundsException("Cannot access offset $pos in String $this->account");
}
if ($pos >= 0) {
return $pos;
}
... | php | protected function getNormalizedPosition($pos)
{
if ($pos >= strlen($this->account) || $pos < -strlen($this->account)) {
throw new ValidatorOutOfBoundsException("Cannot access offset $pos in String $this->account");
}
if ($pos >= 0) {
return $pos;
}
... | [
"protected",
"function",
"getNormalizedPosition",
"(",
"$",
"pos",
")",
"{",
"if",
"(",
"$",
"pos",
">=",
"strlen",
"(",
"$",
"this",
"->",
"account",
")",
"||",
"$",
"pos",
"<",
"-",
"strlen",
"(",
"$",
"this",
"->",
"account",
")",
")",
"{",
"thr... | converts negative positions.
@param int $pos
@return int
@throws ValidatorOutOfBoundsException | [
"converts",
"negative",
"positions",
"."
] | 2ad288cfc065d5c1ce31184de05aa0693e94bdb9 | https://github.com/bav-php/bav/blob/2ad288cfc065d5c1ce31184de05aa0693e94bdb9/classes/validator/Validator.php#L161-L173 |
232,786 | bav-php/bav | classes/validator/Validator.php | Validator.crossSum | protected function crossSum($int)
{
$sum = 0;
$str_int = (string) $int;
for ($i = 0; $i < strlen($str_int); $i++) {
//$sum = bcadd($str_int{$i}, $sum);
$sum += $str_int{$i};
}
return $sum;
} | php | protected function crossSum($int)
{
$sum = 0;
$str_int = (string) $int;
for ($i = 0; $i < strlen($str_int); $i++) {
//$sum = bcadd($str_int{$i}, $sum);
$sum += $str_int{$i};
}
return $sum;
} | [
"protected",
"function",
"crossSum",
"(",
"$",
"int",
")",
"{",
"$",
"sum",
"=",
"0",
";",
"$",
"str_int",
"=",
"(",
"string",
")",
"$",
"int",
";",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"strlen",
"(",
"$",
"str_int",
")",
";",
... | Some validators need this
@param int $int
@return int | [
"Some",
"validators",
"need",
"this"
] | 2ad288cfc065d5c1ce31184de05aa0693e94bdb9 | https://github.com/bav-php/bav/blob/2ad288cfc065d5c1ce31184de05aa0693e94bdb9/classes/validator/Validator.php#L181-L191 |
232,787 | laraplug/product-module | Traits/FeaturedImageTrait.php | FeaturedImageTrait.getMediumThumbAttribute | public function getMediumThumbAttribute()
{
if ($image = $this->images->first()) {
return app(Imagy::class)->getThumbnail($image->path, 'mediumThumb');
}
return Module::asset('product:images/placeholder_mediumThumb.jpg');
} | php | public function getMediumThumbAttribute()
{
if ($image = $this->images->first()) {
return app(Imagy::class)->getThumbnail($image->path, 'mediumThumb');
}
return Module::asset('product:images/placeholder_mediumThumb.jpg');
} | [
"public",
"function",
"getMediumThumbAttribute",
"(",
")",
"{",
"if",
"(",
"$",
"image",
"=",
"$",
"this",
"->",
"images",
"->",
"first",
"(",
")",
")",
"{",
"return",
"app",
"(",
"Imagy",
"::",
"class",
")",
"->",
"getThumbnail",
"(",
"$",
"image",
... | Returns thumnail url | [
"Returns",
"thumnail",
"url"
] | 0a835482d2888a05bfe145e1b453926832185ae0 | https://github.com/laraplug/product-module/blob/0a835482d2888a05bfe145e1b453926832185ae0/Traits/FeaturedImageTrait.php#L64-L71 |
232,788 | dmitriybelyy/yii2-cassandra-cql | phpcassa/UUID.php | UUID.mint | public static function mint($ver = 1, $node = NULL, $ns = NULL, $time = NULL, $sequence = NULL ) {
switch((int) $ver) {
case 1:
return new self(self::mintTime($node, $time, $sequence));
case 2:
// Version 2 is not supported
throw new UUIDException("Version 2 is unsupported.");
case 3:
return... | php | public static function mint($ver = 1, $node = NULL, $ns = NULL, $time = NULL, $sequence = NULL ) {
switch((int) $ver) {
case 1:
return new self(self::mintTime($node, $time, $sequence));
case 2:
// Version 2 is not supported
throw new UUIDException("Version 2 is unsupported.");
case 3:
return... | [
"public",
"static",
"function",
"mint",
"(",
"$",
"ver",
"=",
"1",
",",
"$",
"node",
"=",
"NULL",
",",
"$",
"ns",
"=",
"NULL",
",",
"$",
"time",
"=",
"NULL",
",",
"$",
"sequence",
"=",
"NULL",
")",
"{",
"switch",
"(",
"(",
"int",
")",
"$",
"v... | Create a new UUID based on provided data.
@param int $ver the UUID version to generate.
@param string|null $node MAC address, bin or hex
@param string|null $ns UUID namespace
@param int|null $time Unix time, NB: microseconds = time() * 1000000
@param string|null $sequence Do not use unless need fully deterministic UUI... | [
"Create",
"a",
"new",
"UUID",
"based",
"on",
"provided",
"data",
"."
] | fa0fd4914444f64baba20848c7d4146c1b430346 | https://github.com/dmitriybelyy/yii2-cassandra-cql/blob/fa0fd4914444f64baba20848c7d4146c1b430346/phpcassa/UUID.php#L142-L158 |
232,789 | dmitriybelyy/yii2-cassandra-cql | phpcassa/UUID.php | UUID.compare | public static function compare($a, $b) {
if (self::makeBin($a, 16)==self::makeBin($b, 16))
return TRUE;
else
return FALSE;
} | php | public static function compare($a, $b) {
if (self::makeBin($a, 16)==self::makeBin($b, 16))
return TRUE;
else
return FALSE;
} | [
"public",
"static",
"function",
"compare",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"if",
"(",
"self",
"::",
"makeBin",
"(",
"$",
"a",
",",
"16",
")",
"==",
"self",
"::",
"makeBin",
"(",
"$",
"b",
",",
"16",
")",
")",
"return",
"TRUE",
";",
"e... | Compare the binary representations of two UUIDs.
The comparison will return true if they are bit-exact,
or if neither is valid. | [
"Compare",
"the",
"binary",
"representations",
"of",
"two",
"UUIDs",
".",
"The",
"comparison",
"will",
"return",
"true",
"if",
"they",
"are",
"bit",
"-",
"exact",
"or",
"if",
"neither",
"is",
"valid",
"."
] | fa0fd4914444f64baba20848c7d4146c1b430346 | https://github.com/dmitriybelyy/yii2-cassandra-cql/blob/fa0fd4914444f64baba20848c7d4146c1b430346/phpcassa/UUID.php#L165-L170 |
232,790 | silverstripe-archive/deploynaut | code/control/DeployForm.php | DeployForm_ValidatorBase.validateCommit | protected function validateCommit($sha, $field) {
// Check selected commit
if(empty($sha)) {
$this->validationError(
$field,
"No valid release selected",
"required"
);
return false;
}
// Check validity of commit
if (!preg_match('/^[a-f0-9]{40}$/', $sha)) {
$this->validationError(
... | php | protected function validateCommit($sha, $field) {
// Check selected commit
if(empty($sha)) {
$this->validationError(
$field,
"No valid release selected",
"required"
);
return false;
}
// Check validity of commit
if (!preg_match('/^[a-f0-9]{40}$/', $sha)) {
$this->validationError(
... | [
"protected",
"function",
"validateCommit",
"(",
"$",
"sha",
",",
"$",
"field",
")",
"{",
"// Check selected commit",
"if",
"(",
"empty",
"(",
"$",
"sha",
")",
")",
"{",
"$",
"this",
"->",
"validationError",
"(",
"$",
"field",
",",
"\"No valid release selecte... | Validate a commit sha
@param string $sha
@return boolean | [
"Validate",
"a",
"commit",
"sha"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/control/DeployForm.php#L23-L45 |
232,791 | silverstripe-archive/deploynaut | code/control/DeployForm.php | DeployForm.buildPipelineField | protected function buildPipelineField($commits) {
// Get filtered commits
$filteredCommits = array();
foreach ($commits as $commit) {
$title = sprintf(
"%s (%s, %s old)",
$commit->Message,
substr($commit->SHA,0,8),
$commit->dbObject('Created')->TimeDiff()
);
$filteredCommits[$commit->SHA]... | php | protected function buildPipelineField($commits) {
// Get filtered commits
$filteredCommits = array();
foreach ($commits as $commit) {
$title = sprintf(
"%s (%s, %s old)",
$commit->Message,
substr($commit->SHA,0,8),
$commit->dbObject('Created')->TimeDiff()
);
$filteredCommits[$commit->SHA]... | [
"protected",
"function",
"buildPipelineField",
"(",
"$",
"commits",
")",
"{",
"// Get filtered commits",
"$",
"filteredCommits",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"commits",
"as",
"$",
"commit",
")",
"{",
"$",
"title",
"=",
"sprintf",
"(",
... | Generate fields necessary to select from a filtered commit list
@param DNEnvironment $environment
@param DataList $commits List of commits
@return FormField | [
"Generate",
"fields",
"necessary",
"to",
"select",
"from",
"a",
"filtered",
"commit",
"list"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/control/DeployForm.php#L280-L299 |
232,792 | silverstripe-archive/deploynaut | code/control/DeployForm.php | DeployForm.getSelectedBuild | public function getSelectedBuild($data) {
if(isset($data['SelectRelease']) && !empty($data[$data['SelectRelease']])) {
// Filter out the tag/branch name if required
$array = explode('-', $data[$data['SelectRelease']]);
return reset($array);
}
if(isset($data['FilteredCommits']) && !empty($data['FilteredCo... | php | public function getSelectedBuild($data) {
if(isset($data['SelectRelease']) && !empty($data[$data['SelectRelease']])) {
// Filter out the tag/branch name if required
$array = explode('-', $data[$data['SelectRelease']]);
return reset($array);
}
if(isset($data['FilteredCommits']) && !empty($data['FilteredCo... | [
"public",
"function",
"getSelectedBuild",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'SelectRelease'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"data",
"[",
"$",
"data",
"[",
"'SelectRelease'",
"]",
"]",
")",
")",
"{",
"... | Get the build selected from the given data
@param array $data
@return string SHA of selected build | [
"Get",
"the",
"build",
"selected",
"from",
"the",
"given",
"data"
] | 0b04dadcd089f606d99728f7ee57f374a06211c9 | https://github.com/silverstripe-archive/deploynaut/blob/0b04dadcd089f606d99728f7ee57f374a06211c9/code/control/DeployForm.php#L307-L316 |
232,793 | irishdan/PDFTronBundle | Services/PDFJoiner.php | PDFJoiner.joinPDFs | public function joinPDFs(array $PDFPaths, $outputDestination = null)
{
foreach ($PDFPaths as $key => $PDFPath) {
if ($key > 0) {
$this->joinTwoPDFs($PDFPaths[$key - 1], $PDFPath, $outputDestination);
}
}
} | php | public function joinPDFs(array $PDFPaths, $outputDestination = null)
{
foreach ($PDFPaths as $key => $PDFPath) {
if ($key > 0) {
$this->joinTwoPDFs($PDFPaths[$key - 1], $PDFPath, $outputDestination);
}
}
} | [
"public",
"function",
"joinPDFs",
"(",
"array",
"$",
"PDFPaths",
",",
"$",
"outputDestination",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"PDFPaths",
"as",
"$",
"key",
"=>",
"$",
"PDFPath",
")",
"{",
"if",
"(",
"$",
"key",
">",
"0",
")",
"{",
"$"... | Merge PDFs sequentially.
@param array $PDFPaths
@param null $outputDestination | [
"Merge",
"PDFs",
"sequentially",
"."
] | 72926bf9a39256a8438b320f61ec071be3c5a655 | https://github.com/irishdan/PDFTronBundle/blob/72926bf9a39256a8438b320f61ec071be3c5a655/Services/PDFJoiner.php#L33-L40 |
232,794 | irishdan/PDFTronBundle | Services/PDFJoiner.php | PDFJoiner.joinTwoPDFs | public function joinTwoPDFs($firstPDFPath, $secondPDFPath, $outputDestination = null)
{
$firstPDF = new \PDFDoc($firstPDFPath);
$firstPDF->InitSecurityHandler();
$secondPDF = new \PDFDoc($secondPDFPath);
$firstPDF->InsertPages(1, $secondPDF, 1, $secondPDF->GetPageCount(), \PDFDoc::e... | php | public function joinTwoPDFs($firstPDFPath, $secondPDFPath, $outputDestination = null)
{
$firstPDF = new \PDFDoc($firstPDFPath);
$firstPDF->InitSecurityHandler();
$secondPDF = new \PDFDoc($secondPDFPath);
$firstPDF->InsertPages(1, $secondPDF, 1, $secondPDF->GetPageCount(), \PDFDoc::e... | [
"public",
"function",
"joinTwoPDFs",
"(",
"$",
"firstPDFPath",
",",
"$",
"secondPDFPath",
",",
"$",
"outputDestination",
"=",
"null",
")",
"{",
"$",
"firstPDF",
"=",
"new",
"\\",
"PDFDoc",
"(",
"$",
"firstPDFPath",
")",
";",
"$",
"firstPDF",
"->",
"InitSec... | Merge two PDFs one after the other.
@param $firstPDFPath
@param $secondPDFPath
@param null $outputDestination | [
"Merge",
"two",
"PDFs",
"one",
"after",
"the",
"other",
"."
] | 72926bf9a39256a8438b320f61ec071be3c5a655 | https://github.com/irishdan/PDFTronBundle/blob/72926bf9a39256a8438b320f61ec071be3c5a655/Services/PDFJoiner.php#L49-L64 |
232,795 | laravel-notification-channels/hipchat | src/Card.php | Card.text | public function text($content = '')
{
$this->format = 'text';
if (! str_empty($content)) {
$this->content($content);
}
return $this;
} | php | public function text($content = '')
{
$this->format = 'text';
if (! str_empty($content)) {
$this->content($content);
}
return $this;
} | [
"public",
"function",
"text",
"(",
"$",
"content",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"format",
"=",
"'text'",
";",
"if",
"(",
"!",
"str_empty",
"(",
"$",
"content",
")",
")",
"{",
"$",
"this",
"->",
"content",
"(",
"$",
"content",
")",
";",... | Sets the format to plain text and optionally the content.
@param string $content
@return $this | [
"Sets",
"the",
"format",
"to",
"plain",
"text",
"and",
"optionally",
"the",
"content",
"."
] | c24bca85f7cf9f6804635aa206c961783e22e888 | https://github.com/laravel-notification-channels/hipchat/blob/c24bca85f7cf9f6804635aa206c961783e22e888/src/Card.php#L214-L223 |
232,796 | laravel-notification-channels/hipchat | src/Card.php | Card.html | public function html($content = '')
{
$this->format = 'html';
if (! str_empty($content)) {
$this->content($content);
}
return $this;
} | php | public function html($content = '')
{
$this->format = 'html';
if (! str_empty($content)) {
$this->content($content);
}
return $this;
} | [
"public",
"function",
"html",
"(",
"$",
"content",
"=",
"''",
")",
"{",
"$",
"this",
"->",
"format",
"=",
"'html'",
";",
"if",
"(",
"!",
"str_empty",
"(",
"$",
"content",
")",
")",
"{",
"$",
"this",
"->",
"content",
"(",
"$",
"content",
")",
";",... | Sets the format to html and optionally the content.
@param string $content
@return $this | [
"Sets",
"the",
"format",
"to",
"html",
"and",
"optionally",
"the",
"content",
"."
] | c24bca85f7cf9f6804635aa206c961783e22e888 | https://github.com/laravel-notification-channels/hipchat/blob/c24bca85f7cf9f6804635aa206c961783e22e888/src/Card.php#L231-L240 |
232,797 | laravel-notification-channels/hipchat | src/Card.php | Card.thumbnail | public function thumbnail($icon, $icon2 = null, $width = null, $height = null)
{
$this->thumbnail = trim($icon);
if (! str_empty($icon2)) {
$this->thumbnail2 = trim($icon2);
}
if (! is_null($width)) {
$this->thumbnailWidth = $width;
}
if (! ... | php | public function thumbnail($icon, $icon2 = null, $width = null, $height = null)
{
$this->thumbnail = trim($icon);
if (! str_empty($icon2)) {
$this->thumbnail2 = trim($icon2);
}
if (! is_null($width)) {
$this->thumbnailWidth = $width;
}
if (! ... | [
"public",
"function",
"thumbnail",
"(",
"$",
"icon",
",",
"$",
"icon2",
"=",
"null",
",",
"$",
"width",
"=",
"null",
",",
"$",
"height",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"thumbnail",
"=",
"trim",
"(",
"$",
"icon",
")",
";",
"if",
"(",
... | Sets the thumbnail of the card.
@param string $icon
@param string|null $icon2
@param int|null $width
@param int|null $height
@return $this | [
"Sets",
"the",
"thumbnail",
"of",
"the",
"card",
"."
] | c24bca85f7cf9f6804635aa206c961783e22e888 | https://github.com/laravel-notification-channels/hipchat/blob/c24bca85f7cf9f6804635aa206c961783e22e888/src/Card.php#L277-L294 |
232,798 | laravel-notification-channels/hipchat | src/Card.php | Card.activity | public function activity($html, $icon = null, $icon2 = null)
{
$this->activity = trim($html);
if (! str_empty($icon)) {
$this->activityIcon = trim($icon);
}
if (! str_empty($icon2)) {
$this->activityIcon2 = trim($icon2);
}
return $this;
... | php | public function activity($html, $icon = null, $icon2 = null)
{
$this->activity = trim($html);
if (! str_empty($icon)) {
$this->activityIcon = trim($icon);
}
if (! str_empty($icon2)) {
$this->activityIcon2 = trim($icon2);
}
return $this;
... | [
"public",
"function",
"activity",
"(",
"$",
"html",
",",
"$",
"icon",
"=",
"null",
",",
"$",
"icon2",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"activity",
"=",
"trim",
"(",
"$",
"html",
")",
";",
"if",
"(",
"!",
"str_empty",
"(",
"$",
"icon",
... | Sets the activity of the card.
@param string $html
@param string|null $icon
@param string|null $icon2
@return $this | [
"Sets",
"the",
"activity",
"of",
"the",
"card",
"."
] | c24bca85f7cf9f6804635aa206c961783e22e888 | https://github.com/laravel-notification-channels/hipchat/blob/c24bca85f7cf9f6804635aa206c961783e22e888/src/Card.php#L304-L317 |
232,799 | laravel-notification-channels/hipchat | src/Card.php | Card.addAttribute | public function addAttribute($attribute)
{
if ($attribute instanceof CardAttribute) {
$this->attributes[] = $attribute;
return $this;
}
if ($attribute instanceof Closure) {
$attribute($new = new CardAttribute());
$this->attributes[] = $new;
... | php | public function addAttribute($attribute)
{
if ($attribute instanceof CardAttribute) {
$this->attributes[] = $attribute;
return $this;
}
if ($attribute instanceof Closure) {
$attribute($new = new CardAttribute());
$this->attributes[] = $new;
... | [
"public",
"function",
"addAttribute",
"(",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"attribute",
"instanceof",
"CardAttribute",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"]",
"=",
"$",
"attribute",
";",
"return",
"$",
"this",
";",
"}",
"if",
"... | Adds a CardAttribute to the card.
@param CardAttribute|Closure $attribute
@return $this | [
"Adds",
"a",
"CardAttribute",
"to",
"the",
"card",
"."
] | c24bca85f7cf9f6804635aa206c961783e22e888 | https://github.com/laravel-notification-channels/hipchat/blob/c24bca85f7cf9f6804635aa206c961783e22e888/src/Card.php#L343-L361 |
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.