repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthUser | public function filterByApiAuthUser($apiAuthUser = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthUser)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthUser)) {
$apiAuthUser = str_replace('*', '%', ... | php | public function filterByApiAuthUser($apiAuthUser = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthUser)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthUser)) {
$apiAuthUser = str_replace('*', '%', ... | [
"public",
"function",
"filterByApiAuthUser",
"(",
"$",
"apiAuthUser",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthUser",
")",
")",
"{",
"$",... | Filter the query on the api_auth_user column
Example usage:
<code>
$query->filterByApiAuthUser('fooValue'); // WHERE api_auth_user = 'fooValue'
$query->filterByApiAuthUser('%fooValue%'); // WHERE api_auth_user LIKE '%fooValue%'
</code>
@param string $apiAuthUser The value to use as filter.
Accepts wildcards (* ... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_user",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L598-L610 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthPassword | public function filterByApiAuthPassword($apiAuthPassword = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthPassword)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthPassword)) {
$apiAuthPassword = st... | php | public function filterByApiAuthPassword($apiAuthPassword = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthPassword)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthPassword)) {
$apiAuthPassword = st... | [
"public",
"function",
"filterByApiAuthPassword",
"(",
"$",
"apiAuthPassword",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthPassword",
")",
")",
... | Filter the query on the api_auth_password column
Example usage:
<code>
$query->filterByApiAuthPassword('fooValue'); // WHERE api_auth_password = 'fooValue'
$query->filterByApiAuthPassword('%fooValue%'); // WHERE api_auth_password LIKE '%fooValue%'
</code>
@param string $apiAuthPassword The value to use as filte... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_password",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L627-L639 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthToken | public function filterByApiAuthToken($apiAuthToken = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthToken)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthToken)) {
$apiAuthToken = str_replace('*', ... | php | public function filterByApiAuthToken($apiAuthToken = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthToken)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthToken)) {
$apiAuthToken = str_replace('*', ... | [
"public",
"function",
"filterByApiAuthToken",
"(",
"$",
"apiAuthToken",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthToken",
")",
")",
"{",
"... | Filter the query on the api_auth_token column
Example usage:
<code>
$query->filterByApiAuthToken('fooValue'); // WHERE api_auth_token = 'fooValue'
$query->filterByApiAuthToken('%fooValue%'); // WHERE api_auth_token LIKE '%fooValue%'
</code>
@param string $apiAuthToken The value to use as filter.
Accepts wildcar... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_token",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L656-L668 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthUrlUserKey | public function filterByApiAuthUrlUserKey($apiAuthUrlUserKey = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthUrlUserKey)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthUrlUserKey)) {
$apiAuthUrlUs... | php | public function filterByApiAuthUrlUserKey($apiAuthUrlUserKey = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthUrlUserKey)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthUrlUserKey)) {
$apiAuthUrlUs... | [
"public",
"function",
"filterByApiAuthUrlUserKey",
"(",
"$",
"apiAuthUrlUserKey",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthUrlUserKey",
")",
... | Filter the query on the api_auth_url_user_key column
Example usage:
<code>
$query->filterByApiAuthUrlUserKey('fooValue'); // WHERE api_auth_url_user_key = 'fooValue'
$query->filterByApiAuthUrlUserKey('%fooValue%'); // WHERE api_auth_url_user_key LIKE '%fooValue%'
</code>
@param string $apiAuthUrlUserKey The val... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_url_user_key",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L685-L697 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiAuthUrlPwKey | public function filterByApiAuthUrlPwKey($apiAuthUrlPwKey = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthUrlPwKey)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthUrlPwKey)) {
$apiAuthUrlPwKey = st... | php | public function filterByApiAuthUrlPwKey($apiAuthUrlPwKey = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($apiAuthUrlPwKey)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $apiAuthUrlPwKey)) {
$apiAuthUrlPwKey = st... | [
"public",
"function",
"filterByApiAuthUrlPwKey",
"(",
"$",
"apiAuthUrlPwKey",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"apiAuthUrlPwKey",
")",
")",
... | Filter the query on the api_auth_url_pw_key column
Example usage:
<code>
$query->filterByApiAuthUrlPwKey('fooValue'); // WHERE api_auth_url_pw_key = 'fooValue'
$query->filterByApiAuthUrlPwKey('%fooValue%'); // WHERE api_auth_url_pw_key LIKE '%fooValue%'
</code>
@param string $apiAuthUrlPwKey The value to use as... | [
"Filter",
"the",
"query",
"on",
"the",
"api_auth_url_pw_key",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L714-L726 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByCron | public function filterByCron($cron = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($cron)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $cron)) {
$cron = str_replace('*', '%', $cron);
$comparison... | php | public function filterByCron($cron = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($cron)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $cron)) {
$cron = str_replace('*', '%', $cron);
$comparison... | [
"public",
"function",
"filterByCron",
"(",
"$",
"cron",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"cron",
")",
")",
"{",
"$",
"comparison",
"=... | Filter the query on the cron column
Example usage:
<code>
$query->filterByCron('fooValue'); // WHERE cron = 'fooValue'
$query->filterByCron('%fooValue%'); // WHERE cron LIKE '%fooValue%'
</code>
@param string $cron The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param string $compari... | [
"Filter",
"the",
"query",
"on",
"the",
"cron",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L743-L755 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByCustomerId | public function filterByCustomerId($customerId = null, $comparison = null)
{
if (is_array($customerId)) {
$useMinMax = false;
if (isset($customerId['min'])) {
$this->addUsingAlias(RemoteAppPeer::CUSTOMER_ID, $customerId['min'], Criteria::GREATER_EQUAL);
... | php | public function filterByCustomerId($customerId = null, $comparison = null)
{
if (is_array($customerId)) {
$useMinMax = false;
if (isset($customerId['min'])) {
$this->addUsingAlias(RemoteAppPeer::CUSTOMER_ID, $customerId['min'], Criteria::GREATER_EQUAL);
... | [
"public",
"function",
"filterByCustomerId",
"(",
"$",
"customerId",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"customerId",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
... | Filter the query on the customer_id column
Example usage:
<code>
$query->filterByCustomerId(1234); // WHERE customer_id = 1234
$query->filterByCustomerId(array(12, 34)); // WHERE customer_id IN (12, 34)
$query->filterByCustomerId(array('min' => 12)); // WHERE customer_id >= 12
$query->filterByCustomerId(array('max' =>... | [
"Filter",
"the",
"query",
"on",
"the",
"customer_id",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L778-L799 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByLastRun | public function filterByLastRun($lastRun = null, $comparison = null)
{
if (is_array($lastRun)) {
$useMinMax = false;
if (isset($lastRun['min'])) {
$this->addUsingAlias(RemoteAppPeer::LAST_RUN, $lastRun['min'], Criteria::GREATER_EQUAL);
$useMinMax = tru... | php | public function filterByLastRun($lastRun = null, $comparison = null)
{
if (is_array($lastRun)) {
$useMinMax = false;
if (isset($lastRun['min'])) {
$this->addUsingAlias(RemoteAppPeer::LAST_RUN, $lastRun['min'], Criteria::GREATER_EQUAL);
$useMinMax = tru... | [
"public",
"function",
"filterByLastRun",
"(",
"$",
"lastRun",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"lastRun",
")",
")",
"{",
"$",
"useMinMax",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
... | Filter the query on the last_run column
Example usage:
<code>
$query->filterByLastRun('2011-03-14'); // WHERE last_run = '2011-03-14'
$query->filterByLastRun('now'); // WHERE last_run = '2011-03-14'
$query->filterByLastRun(array('max' => 'yesterday')); // WHERE last_run < '2011-03-13'
</code>
@param mixed $lastRu... | [
"Filter",
"the",
"query",
"on",
"the",
"last_run",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L877-L898 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByIncludelog | public function filterByIncludelog($includelog = null, $comparison = null)
{
if (is_string($includelog)) {
$includelog = in_array(strtolower($includelog), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(RemoteAppPeer::INCLUDELOG, $in... | php | public function filterByIncludelog($includelog = null, $comparison = null)
{
if (is_string($includelog)) {
$includelog = in_array(strtolower($includelog), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingAlias(RemoteAppPeer::INCLUDELOG, $in... | [
"public",
"function",
"filterByIncludelog",
"(",
"$",
"includelog",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"includelog",
")",
")",
"{",
"$",
"includelog",
"=",
"in_array",
"(",
"strtolower",
"(",
"$"... | Filter the query on the includeLog column
Example usage:
<code>
$query->filterByIncludelog(true); // WHERE includeLog = true
$query->filterByIncludelog('yes'); // WHERE includeLog = true
</code>
@param boolean|string $includelog The value to use as filter.
Non-boolean arguments are converted using the following r... | [
"Filter",
"the",
"query",
"on",
"the",
"includeLog",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L918-L925 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByPublicKey | public function filterByPublicKey($publicKey = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($publicKey)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $publicKey)) {
$publicKey = str_replace('*', '%', $publicKey... | php | public function filterByPublicKey($publicKey = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($publicKey)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $publicKey)) {
$publicKey = str_replace('*', '%', $publicKey... | [
"public",
"function",
"filterByPublicKey",
"(",
"$",
"publicKey",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"publicKey",
")",
")",
"{",
"$",
"co... | Filter the query on the public_key column
Example usage:
<code>
$query->filterByPublicKey('fooValue'); // WHERE public_key = 'fooValue'
$query->filterByPublicKey('%fooValue%'); // WHERE public_key LIKE '%fooValue%'
</code>
@param string $publicKey The value to use as filter.
Accepts wildcards (* and % trigger a... | [
"Filter",
"the",
"query",
"on",
"the",
"public_key",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L942-L954 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByWebsiteHash | public function filterByWebsiteHash($websiteHash = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($websiteHash)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $websiteHash)) {
$websiteHash = str_replace('*', '%', ... | php | public function filterByWebsiteHash($websiteHash = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($websiteHash)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $websiteHash)) {
$websiteHash = str_replace('*', '%', ... | [
"public",
"function",
"filterByWebsiteHash",
"(",
"$",
"websiteHash",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"websiteHash",
")",
")",
"{",
"$",... | Filter the query on the website_hash column
Example usage:
<code>
$query->filterByWebsiteHash('fooValue'); // WHERE website_hash = 'fooValue'
$query->filterByWebsiteHash('%fooValue%'); // WHERE website_hash LIKE '%fooValue%'
</code>
@param string $websiteHash The value to use as filter.
Accepts wildcards (* and... | [
"Filter",
"the",
"query",
"on",
"the",
"website_hash",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L971-L983 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByNotificationRecipient | public function filterByNotificationRecipient($notificationRecipient = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($notificationRecipient)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $notificationRecipient)) {
... | php | public function filterByNotificationRecipient($notificationRecipient = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($notificationRecipient)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $notificationRecipient)) {
... | [
"public",
"function",
"filterByNotificationRecipient",
"(",
"$",
"notificationRecipient",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"notificationRecipient... | Filter the query on the notification_recipient column
Example usage:
<code>
$query->filterByNotificationRecipient('fooValue'); // WHERE notification_recipient = 'fooValue'
$query->filterByNotificationRecipient('%fooValue%'); // WHERE notification_recipient LIKE '%fooValue%'
</code>
@param string $notificationRe... | [
"Filter",
"the",
"query",
"on",
"the",
"notification_recipient",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1000-L1012 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByNotificationSender | public function filterByNotificationSender($notificationSender = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($notificationSender)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $notificationSender)) {
$notifica... | php | public function filterByNotificationSender($notificationSender = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($notificationSender)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $notificationSender)) {
$notifica... | [
"public",
"function",
"filterByNotificationSender",
"(",
"$",
"notificationSender",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"comparison",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"notificationSender",
")",... | Filter the query on the notification_sender column
Example usage:
<code>
$query->filterByNotificationSender('fooValue'); // WHERE notification_sender = 'fooValue'
$query->filterByNotificationSender('%fooValue%'); // WHERE notification_sender LIKE '%fooValue%'
</code>
@param string $notificationSender The value ... | [
"Filter",
"the",
"query",
"on",
"the",
"notification_sender",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1029-L1041 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByNotificationChange | public function filterByNotificationChange($notificationChange = null, $comparison = null)
{
if (is_string($notificationChange)) {
$notificationChange = in_array(strtolower($notificationChange), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addU... | php | public function filterByNotificationChange($notificationChange = null, $comparison = null)
{
if (is_string($notificationChange)) {
$notificationChange = in_array(strtolower($notificationChange), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addU... | [
"public",
"function",
"filterByNotificationChange",
"(",
"$",
"notificationChange",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"notificationChange",
")",
")",
"{",
"$",
"notificationChange",
"=",
"in_array",
"... | Filter the query on the notification_change column
Example usage:
<code>
$query->filterByNotificationChange(true); // WHERE notification_change = true
$query->filterByNotificationChange('yes'); // WHERE notification_change = true
</code>
@param boolean|string $notificationChange The value to use as filter.
Non-bo... | [
"Filter",
"the",
"query",
"on",
"the",
"notification_change",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1061-L1068 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByNotificationError | public function filterByNotificationError($notificationError = null, $comparison = null)
{
if (is_string($notificationError)) {
$notificationError = in_array(strtolower($notificationError), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingA... | php | public function filterByNotificationError($notificationError = null, $comparison = null)
{
if (is_string($notificationError)) {
$notificationError = in_array(strtolower($notificationError), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
}
return $this->addUsingA... | [
"public",
"function",
"filterByNotificationError",
"(",
"$",
"notificationError",
"=",
"null",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"notificationError",
")",
")",
"{",
"$",
"notificationError",
"=",
"in_array",
"(",
... | Filter the query on the notification_error column
Example usage:
<code>
$query->filterByNotificationError(true); // WHERE notification_error = true
$query->filterByNotificationError('yes'); // WHERE notification_error = true
</code>
@param boolean|string $notificationError The value to use as filter.
Non-boolean ... | [
"Filter",
"the",
"query",
"on",
"the",
"notification_error",
"column"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1088-L1095 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByApiLog | public function filterByApiLog($apiLog, $comparison = null)
{
if ($apiLog instanceof ApiLog) {
return $this
->addUsingAlias(RemoteAppPeer::ID, $apiLog->getRemoteAppId(), $comparison);
} elseif ($apiLog instanceof PropelObjectCollection) {
return $this
... | php | public function filterByApiLog($apiLog, $comparison = null)
{
if ($apiLog instanceof ApiLog) {
return $this
->addUsingAlias(RemoteAppPeer::ID, $apiLog->getRemoteAppId(), $comparison);
} elseif ($apiLog instanceof PropelObjectCollection) {
return $this
... | [
"public",
"function",
"filterByApiLog",
"(",
"$",
"apiLog",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"apiLog",
"instanceof",
"ApiLog",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
"(",
"RemoteAppPeer",
"::",
"ID",
",",
"$... | Filter the query by a related ApiLog object
@param ApiLog|PropelObjectCollection $apiLog the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return RemoteAppQuery The current query, for fluid interface
@throws Pro... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"ApiLog",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1182-L1195 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.useApiLogQuery | public function useApiLogQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinApiLog($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ApiLog', '\Slashworks\AppBundle\Model\ApiLogQuery');
} | php | public function useApiLogQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinApiLog($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'ApiLog', '\Slashworks\AppBundle\Model\ApiLogQuery');
} | [
"public",
"function",
"useApiLogQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinApiLog",
"(",
"$",
"relationAlias",
",",
"$",
"joinType",
")",
"->",
"use... | Use the ApiLog relation ApiLog object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Slashworks\AppBundle\Model\ApiLogQuery... | [
"Use",
"the",
"ApiLog",
"relation",
"ApiLog",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1240-L1245 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.filterByRemoteHistoryContao | public function filterByRemoteHistoryContao($remoteHistoryContao, $comparison = null)
{
if ($remoteHistoryContao instanceof RemoteHistoryContao) {
return $this
->addUsingAlias(RemoteAppPeer::ID, $remoteHistoryContao->getRemoteAppId(), $comparison);
} elseif ($remoteHistor... | php | public function filterByRemoteHistoryContao($remoteHistoryContao, $comparison = null)
{
if ($remoteHistoryContao instanceof RemoteHistoryContao) {
return $this
->addUsingAlias(RemoteAppPeer::ID, $remoteHistoryContao->getRemoteAppId(), $comparison);
} elseif ($remoteHistor... | [
"public",
"function",
"filterByRemoteHistoryContao",
"(",
"$",
"remoteHistoryContao",
",",
"$",
"comparison",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"remoteHistoryContao",
"instanceof",
"RemoteHistoryContao",
")",
"{",
"return",
"$",
"this",
"->",
"addUsingAlias",
... | Filter the query by a related RemoteHistoryContao object
@param RemoteHistoryContao|PropelObjectCollection $remoteHistoryContao the related object to use as filter
@param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
@return RemoteAppQuery The current... | [
"Filter",
"the",
"query",
"by",
"a",
"related",
"RemoteHistoryContao",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1256-L1269 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.useRemoteHistoryContaoQuery | public function useRemoteHistoryContaoQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinRemoteHistoryContao($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'RemoteHistoryContao', '\Slashworks\AppBundle\Model\RemoteHistoryConta... | php | public function useRemoteHistoryContaoQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinRemoteHistoryContao($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'RemoteHistoryContao', '\Slashworks\AppBundle\Model\RemoteHistoryConta... | [
"public",
"function",
"useRemoteHistoryContaoQuery",
"(",
"$",
"relationAlias",
"=",
"null",
",",
"$",
"joinType",
"=",
"Criteria",
"::",
"INNER_JOIN",
")",
"{",
"return",
"$",
"this",
"->",
"joinRemoteHistoryContao",
"(",
"$",
"relationAlias",
",",
"$",
"joinTy... | Use the RemoteHistoryContao relation RemoteHistoryContao object
@see useQuery()
@param string $relationAlias optional alias for the relation,
to be used as main alias in the secondary query
@param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
@return \Slashworks\A... | [
"Use",
"the",
"RemoteHistoryContao",
"relation",
"RemoteHistoryContao",
"object"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1314-L1319 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php | BaseRemoteAppQuery.prune | public function prune($remoteApp = null)
{
if ($remoteApp) {
$this->addUsingAlias(RemoteAppPeer::ID, $remoteApp->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | php | public function prune($remoteApp = null)
{
if ($remoteApp) {
$this->addUsingAlias(RemoteAppPeer::ID, $remoteApp->getId(), Criteria::NOT_EQUAL);
}
return $this;
} | [
"public",
"function",
"prune",
"(",
"$",
"remoteApp",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"remoteApp",
")",
"{",
"$",
"this",
"->",
"addUsingAlias",
"(",
"RemoteAppPeer",
"::",
"ID",
",",
"$",
"remoteApp",
"->",
"getId",
"(",
")",
",",
"Criteria",
... | Exclude object from result
@param RemoteApp $remoteApp Object to remove from the list of results
@return RemoteAppQuery The current query, for fluid interface | [
"Exclude",
"object",
"from",
"result"
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseRemoteAppQuery.php#L1328-L1335 |
praxisnetau/silverware-spam-guard | src/Guards/SimpleSpamGuard.php | SimpleSpamGuard.getFormField | public function getFormField($name = null, $title = null, $value = null)
{
return SimpleSpamGuardField::create($name, $title, $value)->setTimeLimit($this->timeLimit);
} | php | public function getFormField($name = null, $title = null, $value = null)
{
return SimpleSpamGuardField::create($name, $title, $value)->setTimeLimit($this->timeLimit);
} | [
"public",
"function",
"getFormField",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"title",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"SimpleSpamGuardField",
"::",
"create",
"(",
"$",
"name",
",",
"$",
"title",
",",
"$",
"value",
"... | Answers the form field used for implementing the spam guard.
@param string $name
@param string $title
@param mixed $value
@return SimpleSpamGuardField | [
"Answers",
"the",
"form",
"field",
"used",
"for",
"implementing",
"the",
"spam",
"guard",
"."
] | train | https://github.com/praxisnetau/silverware-spam-guard/blob/c5f8836a09141bd675173892a1e3d8c8cc8c1886/src/Guards/SimpleSpamGuard.php#L136-L139 |
nexusnetsoftgmbh/nexuscli | src/Nexus/Shell/Business/Model/Executor/ShellExec.php | ShellExec.execute | public function execute(string $command): string
{
$result = shell_exec($command);
if ($result === null) {
$result = '';
}
return $result;
} | php | public function execute(string $command): string
{
$result = shell_exec($command);
if ($result === null) {
$result = '';
}
return $result;
} | [
"public",
"function",
"execute",
"(",
"string",
"$",
"command",
")",
":",
"string",
"{",
"$",
"result",
"=",
"shell_exec",
"(",
"$",
"command",
")",
";",
"if",
"(",
"$",
"result",
"===",
"null",
")",
"{",
"$",
"result",
"=",
"''",
";",
"}",
"return... | @param string $command
@return string | [
"@param",
"string",
"$command"
] | train | https://github.com/nexusnetsoftgmbh/nexuscli/blob/8416b43d31ad56ea379ae2b0bf85d456e78ba67a/src/Nexus/Shell/Business/Model/Executor/ShellExec.php#L14-L21 |
PortaText/php-sdk | src/PortaText/Command/Api/Tariffs.php | Tariffs.getEndpoint | protected function getEndpoint($method)
{
$endpoint = "tariffs";
$countryIso = $this->getArgument("id");
if (!is_null($countryIso)) {
$endpoint .= "/$countryIso";
$this->delArgument("id");
}
return $endpoint;
} | php | protected function getEndpoint($method)
{
$endpoint = "tariffs";
$countryIso = $this->getArgument("id");
if (!is_null($countryIso)) {
$endpoint .= "/$countryIso";
$this->delArgument("id");
}
return $endpoint;
} | [
"protected",
"function",
"getEndpoint",
"(",
"$",
"method",
")",
"{",
"$",
"endpoint",
"=",
"\"tariffs\"",
";",
"$",
"countryIso",
"=",
"$",
"this",
"->",
"getArgument",
"(",
"\"id\"",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"countryIso",
")",
"... | Returns a string with the endpoint for the given command.
@param string $method Method for this command.
@return string | [
"Returns",
"a",
"string",
"with",
"the",
"endpoint",
"for",
"the",
"given",
"command",
"."
] | train | https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/Tariffs.php#L38-L47 |
phpmob/changmin | src/PhpMob/MediaBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('phpmob_media');
$this->addImageFiltersSection($rootNode);
$this->addImagineSection($rootNode);
$rootNode
->children()
->scalarNode('driver'... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('phpmob_media');
$this->addImageFiltersSection($rootNode);
$this->addImagineSection($rootNode);
$rootNode
->children()
->scalarNode('driver'... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'phpmob_media'",
")",
";",
"$",
"this",
"->",
"addImageFiltersSection",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/DependencyInjection/Configuration.php#L27-L42 |
wikimedia/CLDRPluralRuleParser | src/Converter.php | Converter.doConvert | protected function doConvert() {
$expectOperator = true;
// Iterate through all tokens, saving the operators and operands to a
// stack per Dijkstra's shunting yard algorithm.
/** @var Operator $token */
while ( false !== ( $token = $this->nextToken() ) ) {
// In this grammar, there are only binary operat... | php | protected function doConvert() {
$expectOperator = true;
// Iterate through all tokens, saving the operators and operands to a
// stack per Dijkstra's shunting yard algorithm.
/** @var Operator $token */
while ( false !== ( $token = $this->nextToken() ) ) {
// In this grammar, there are only binary operat... | [
"protected",
"function",
"doConvert",
"(",
")",
"{",
"$",
"expectOperator",
"=",
"true",
";",
"// Iterate through all tokens, saving the operators and operands to a",
"// stack per Dijkstra's shunting yard algorithm.",
"/** @var Operator $token */",
"while",
"(",
"false",
"!==",
... | Do the operation.
@return string The RPN representation of the rule (e.g. "5 3 mod n is") | [
"Do",
"the",
"operation",
"."
] | train | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Converter.php#L121-L174 |
wikimedia/CLDRPluralRuleParser | src/Converter.php | Converter.nextToken | protected function nextToken() {
if ( $this->pos >= $this->end ) {
return false;
}
// Whitespace
$length = strspn( $this->rule, self::WHITESPACE_CLASS, $this->pos );
$this->pos += $length;
if ( $this->pos >= $this->end ) {
return false;
}
// Number
$length = strspn( $this->rule, self::NUMBER_... | php | protected function nextToken() {
if ( $this->pos >= $this->end ) {
return false;
}
// Whitespace
$length = strspn( $this->rule, self::WHITESPACE_CLASS, $this->pos );
$this->pos += $length;
if ( $this->pos >= $this->end ) {
return false;
}
// Number
$length = strspn( $this->rule, self::NUMBER_... | [
"protected",
"function",
"nextToken",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pos",
">=",
"$",
"this",
"->",
"end",
")",
"{",
"return",
"false",
";",
"}",
"// Whitespace",
"$",
"length",
"=",
"strspn",
"(",
"$",
"this",
"->",
"rule",
",",
"se... | Fetch the next token from the input string.
@return Fragment The next token | [
"Fetch",
"the",
"next",
"token",
"from",
"the",
"input",
"string",
"."
] | train | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Converter.php#L181-L276 |
wikimedia/CLDRPluralRuleParser | src/Converter.php | Converter.doOperation | protected function doOperation( Operator $op ) {
if ( count( $this->operands ) < 2 ) {
$op->error( 'missing operand' );
}
$right = array_pop( $this->operands );
$left = array_pop( $this->operands );
$result = $op->operate( $left, $right );
$this->operands[] = $result;
} | php | protected function doOperation( Operator $op ) {
if ( count( $this->operands ) < 2 ) {
$op->error( 'missing operand' );
}
$right = array_pop( $this->operands );
$left = array_pop( $this->operands );
$result = $op->operate( $left, $right );
$this->operands[] = $result;
} | [
"protected",
"function",
"doOperation",
"(",
"Operator",
"$",
"op",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"operands",
")",
"<",
"2",
")",
"{",
"$",
"op",
"->",
"error",
"(",
"'missing operand'",
")",
";",
"}",
"$",
"right",
"=",
"ar... | For the binary operator $op, pop its operands off the stack and push
a fragment with rpn and type members describing the result of that
operation.
@param Operator $op | [
"For",
"the",
"binary",
"operator",
"$op",
"pop",
"its",
"operands",
"off",
"the",
"stack",
"and",
"push",
"a",
"fragment",
"with",
"rpn",
"and",
"type",
"members",
"describing",
"the",
"result",
"of",
"that",
"operation",
"."
] | train | https://github.com/wikimedia/CLDRPluralRuleParser/blob/4c5d71a3fd62a75871da8562310ca2258647ee6d/src/Converter.php#L285-L293 |
parsnick/steak | src/Build/Publishers/Compile.php | Compile.handle | public function handle(Source $source, Closure $next, ...$extensions)
{
if ($this->isPublishable($source, $extensions)) {
$view = new View(
$this->factory,
$this->factory->getEngineFromPath($source->getPathname()),
$this->files->get($source->getPa... | php | public function handle(Source $source, Closure $next, ...$extensions)
{
if ($this->isPublishable($source, $extensions)) {
$view = new View(
$this->factory,
$this->factory->getEngineFromPath($source->getPathname()),
$this->files->get($source->getPa... | [
"public",
"function",
"handle",
"(",
"Source",
"$",
"source",
",",
"Closure",
"$",
"next",
",",
"...",
"$",
"extensions",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isPublishable",
"(",
"$",
"source",
",",
"$",
"extensions",
")",
")",
"{",
"$",
"view",... | Publish a source file and/or pass to $next.
@param Source $source
@param Closure $next
@param array $extensions
@return mixed | [
"Publish",
"a",
"source",
"file",
"and",
"/",
"or",
"pass",
"to",
"$next",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Build/Publishers/Compile.php#L44-L66 |
parsnick/steak | src/Build/Publishers/Compile.php | Compile.write | protected function write($destination, $content)
{
$directory = dirname($destination);
if ( ! $this->files->exists($directory)) {
$this->files->makeDirectory($directory, 0755, true);
}
return (bool) $this->files->put($destination, $content);
} | php | protected function write($destination, $content)
{
$directory = dirname($destination);
if ( ! $this->files->exists($directory)) {
$this->files->makeDirectory($directory, 0755, true);
}
return (bool) $this->files->put($destination, $content);
} | [
"protected",
"function",
"write",
"(",
"$",
"destination",
",",
"$",
"content",
")",
"{",
"$",
"directory",
"=",
"dirname",
"(",
"$",
"destination",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"files",
"->",
"exists",
"(",
"$",
"directory",
")",
")"... | Write file contents, creating any necessary subdirectories.
@param string $destination
@param string $content
@return bool | [
"Write",
"file",
"contents",
"creating",
"any",
"necessary",
"subdirectories",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Build/Publishers/Compile.php#L87-L96 |
vorbind/influx-analytics | src/Mapper/ImportMysqlMapper.php | ImportMysqlMapper.getRows | public function getRows($query) {
try {
$stmt = $this->db->query($query);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (Exception $e) {
return [];
}
} | php | public function getRows($query) {
try {
$stmt = $this->db->query($query);
return $stmt->fetchAll(PDO::FETCH_ASSOC);
} catch (Exception $e) {
return [];
}
} | [
"public",
"function",
"getRows",
"(",
"$",
"query",
")",
"{",
"try",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"db",
"->",
"query",
"(",
"$",
"query",
")",
";",
"return",
"$",
"stmt",
"->",
"fetchAll",
"(",
"PDO",
"::",
"FETCH_ASSOC",
")",
";",
"... | Get rows of data by query
@param string $query | [
"Get",
"rows",
"of",
"data",
"by",
"query"
] | train | https://github.com/vorbind/influx-analytics/blob/8c0c150351f045ccd3d57063f2b3b50a2c926e3e/src/Mapper/ImportMysqlMapper.php#L46-L53 |
parsnick/steak | src/Console/DeployCommand.php | DeployCommand.execute | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setIo($input, $output);
$repo = $this->prepareRepository();
$this->rebuild();
$this->deployWithGit($repo);
} | php | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->setIo($input, $output);
$repo = $this->prepareRepository();
$this->rebuild();
$this->deployWithGit($repo);
} | [
"protected",
"function",
"execute",
"(",
"InputInterface",
"$",
"input",
",",
"OutputInterface",
"$",
"output",
")",
"{",
"$",
"this",
"->",
"setIo",
"(",
"$",
"input",
",",
"$",
"output",
")",
";",
"$",
"repo",
"=",
"$",
"this",
"->",
"prepareRepository... | Execute the command.
@param InputInterface $input
@param OutputInterface $output
@return void | [
"Execute",
"the",
"command",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/DeployCommand.php#L66-L75 |
parsnick/steak | src/Console/DeployCommand.php | DeployCommand.prepareRepository | protected function prepareRepository()
{
$config = $this->container['config'];
$this->builder->clean($config['build.directory']); // clear out everything, including .git metadata
$workingCopy = $this->git->workingCopy($config['build.directory']);
$this->doGitInit($workingCopy, $co... | php | protected function prepareRepository()
{
$config = $this->container['config'];
$this->builder->clean($config['build.directory']); // clear out everything, including .git metadata
$workingCopy = $this->git->workingCopy($config['build.directory']);
$this->doGitInit($workingCopy, $co... | [
"protected",
"function",
"prepareRepository",
"(",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"container",
"[",
"'config'",
"]",
";",
"$",
"this",
"->",
"builder",
"->",
"clean",
"(",
"$",
"config",
"[",
"'build.directory'",
"]",
")",
";",
"// clea... | Prepare the build directory as a git repository.
Maybe there's already a git repo in the build folder, but is it pointing to
the correct origin and is it on the correct branch? Instead of checking for
things that might be wrong, we'll just start from scratch.
@returns GitWorkingCopy
@throws RuntimeException | [
"Prepare",
"the",
"build",
"directory",
"as",
"a",
"git",
"repository",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/DeployCommand.php#L87-L100 |
parsnick/steak | src/Console/DeployCommand.php | DeployCommand.doGitInit | protected function doGitInit(GitWorkingCopy $workingCopy, $url, $branch)
{
$workingCopy->init();
$workingCopy->remote('add', 'origin', $url);
try {
$this->output->writeln("Attempting to fetch <path>origin/{$branch}</path>", OutputInterface::VERBOSITY_VERBOSE);
$wor... | php | protected function doGitInit(GitWorkingCopy $workingCopy, $url, $branch)
{
$workingCopy->init();
$workingCopy->remote('add', 'origin', $url);
try {
$this->output->writeln("Attempting to fetch <path>origin/{$branch}</path>", OutputInterface::VERBOSITY_VERBOSE);
$wor... | [
"protected",
"function",
"doGitInit",
"(",
"GitWorkingCopy",
"$",
"workingCopy",
",",
"$",
"url",
",",
"$",
"branch",
")",
"{",
"$",
"workingCopy",
"->",
"init",
"(",
")",
";",
"$",
"workingCopy",
"->",
"remote",
"(",
"'add'",
",",
"'origin'",
",",
"$",
... | Set up the git repository for our build.
@param GitWorkingCopy $workingCopy
@param string $url
@param string $branch
@return mixed | [
"Set",
"up",
"the",
"git",
"repository",
"for",
"our",
"build",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/DeployCommand.php#L110-L135 |
parsnick/steak | src/Console/DeployCommand.php | DeployCommand.rebuild | protected function rebuild()
{
$command = $this->getApplication()->find('build');
$input = new ArrayInput([
'--no-clean' => true,
]);
return $command->run($input, $this->output) === 0;
} | php | protected function rebuild()
{
$command = $this->getApplication()->find('build');
$input = new ArrayInput([
'--no-clean' => true,
]);
return $command->run($input, $this->output) === 0;
} | [
"protected",
"function",
"rebuild",
"(",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"find",
"(",
"'build'",
")",
";",
"$",
"input",
"=",
"new",
"ArrayInput",
"(",
"[",
"'--no-clean'",
"=>",
"true",
",",
"]",
"... | Delegate to the build command to rebuild the site.
@return bool | [
"Delegate",
"to",
"the",
"build",
"command",
"to",
"rebuild",
"the",
"site",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/DeployCommand.php#L142-L151 |
parsnick/steak | src/Console/DeployCommand.php | DeployCommand.deployWithGit | protected function deployWithGit(GitWorkingCopy $workingCopy)
{
if ( ! $workingCopy->hasChanges()) {
return $this->output->writeln('<comment>No changes to deploy!</comment>');
}
$this->output->writeln('<info>Ready to deploy changes:</info>');
$this->output->write($workin... | php | protected function deployWithGit(GitWorkingCopy $workingCopy)
{
if ( ! $workingCopy->hasChanges()) {
return $this->output->writeln('<comment>No changes to deploy!</comment>');
}
$this->output->writeln('<info>Ready to deploy changes:</info>');
$this->output->write($workin... | [
"protected",
"function",
"deployWithGit",
"(",
"GitWorkingCopy",
"$",
"workingCopy",
")",
"{",
"if",
"(",
"!",
"$",
"workingCopy",
"->",
"hasChanges",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"output",
"->",
"writeln",
"(",
"'<comment>No changes to dep... | Deploy the current contents of our working copy.
@param GitWorkingCopy $workingCopy | [
"Deploy",
"the",
"current",
"contents",
"of",
"our",
"working",
"copy",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/DeployCommand.php#L158-L179 |
parsnick/steak | src/Console/DeployCommand.php | DeployCommand.askForChangesConfirmation | protected function askForChangesConfirmation(GitWorkingCopy $workingCopy)
{
$deployTo = "{$this->container['config']['deploy.git.url']}#{$this->container['config']['deploy.git.branch']}";
$confirm = new ConfirmationQuestion("<comment>Commit all and push to <path>{$deployTo}</path>?</comment> [Yn] "... | php | protected function askForChangesConfirmation(GitWorkingCopy $workingCopy)
{
$deployTo = "{$this->container['config']['deploy.git.url']}#{$this->container['config']['deploy.git.branch']}";
$confirm = new ConfirmationQuestion("<comment>Commit all and push to <path>{$deployTo}</path>?</comment> [Yn] "... | [
"protected",
"function",
"askForChangesConfirmation",
"(",
"GitWorkingCopy",
"$",
"workingCopy",
")",
"{",
"$",
"deployTo",
"=",
"\"{$this->container['config']['deploy.git.url']}#{$this->container['config']['deploy.git.branch']}\"",
";",
"$",
"confirm",
"=",
"new",
"ConfirmationQ... | Ask user to confirm changes listed by git status.
@param GitWorkingCopy $workingCopy
@return bool | [
"Ask",
"user",
"to",
"confirm",
"changes",
"listed",
"by",
"git",
"status",
"."
] | train | https://github.com/parsnick/steak/blob/461869189a640938438187330f6c50aca97c5ccc/src/Console/DeployCommand.php#L187-L194 |
stanislav-web/phalcon-ulogin | src/ULogin/Auth.php | Auth.hasSession | private function hasSession() {
if(DI::getDefault()->has('session') === true) {
// get instance of session class
$this->session = DI::getDefault()->getSession();
if($this->session->getId() === '') {
$this->session->start();
}
return... | php | private function hasSession() {
if(DI::getDefault()->has('session') === true) {
// get instance of session class
$this->session = DI::getDefault()->getSession();
if($this->session->getId() === '') {
$this->session->start();
}
return... | [
"private",
"function",
"hasSession",
"(",
")",
"{",
"if",
"(",
"DI",
"::",
"getDefault",
"(",
")",
"->",
"has",
"(",
"'session'",
")",
"===",
"true",
")",
"{",
"// get instance of session class",
"$",
"this",
"->",
"session",
"=",
"DI",
"::",
"getDefault",... | Check if \Phalcon\Di has session service
@return bool | [
"Check",
"if",
"\\",
"Phalcon",
"\\",
"Di",
"has",
"session",
"service"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Auth.php#L63-L78 |
stanislav-web/phalcon-ulogin | src/ULogin/Auth.php | Auth.getUser | public function getUser() {
if($this->user === false) {
$this->session->remove(self::KEY);
$this->session->set(self::KEY, parent::getUser());
}
return $this->user;
} | php | public function getUser() {
if($this->user === false) {
$this->session->remove(self::KEY);
$this->session->set(self::KEY, parent::getUser());
}
return $this->user;
} | [
"public",
"function",
"getUser",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"user",
"===",
"false",
")",
"{",
"$",
"this",
"->",
"session",
"->",
"remove",
"(",
"self",
"::",
"KEY",
")",
";",
"$",
"this",
"->",
"session",
"->",
"set",
"(",
"sel... | Returns an associative array with the data about the user.
Fields array described in the method Init::setFields
@example <code>
$this->getUser();
</code>
@return boolean|array data provided by the ISP authentication | [
"Returns",
"an",
"associative",
"array",
"with",
"the",
"data",
"about",
"the",
"user",
".",
"Fields",
"array",
"described",
"in",
"the",
"method",
"Init",
"::",
"setFields"
] | train | https://github.com/stanislav-web/phalcon-ulogin/blob/0cea8510a244ebb9b1333085b325a283e4fb9f2f/src/ULogin/Auth.php#L90-L99 |
titon/db | src/Titon/Db/Driver/Dialect/Statement.php | Statement.render | public function render(array $params = []) {
return trim(String::insert($this->getStatement(), $params + $this->getParams(), ['escape' => false])) . ';';
} | php | public function render(array $params = []) {
return trim(String::insert($this->getStatement(), $params + $this->getParams(), ['escape' => false])) . ';';
} | [
"public",
"function",
"render",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"return",
"trim",
"(",
"String",
"::",
"insert",
"(",
"$",
"this",
"->",
"getStatement",
"(",
")",
",",
"$",
"params",
"+",
"$",
"this",
"->",
"getParams",
"(",
"... | Render the statement by injecting custom parameters.
Merge with the default parameters to fill in any missing keys.
@param array $params
@return string | [
"Render",
"the",
"statement",
"by",
"injecting",
"custom",
"parameters",
".",
"Merge",
"with",
"the",
"default",
"parameters",
"to",
"fill",
"in",
"any",
"missing",
"keys",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Driver/Dialect/Statement.php#L75-L77 |
webforge-labs/psc-cms | lib/Psc/SimpleObject.php | SimpleObject.invalidArgument | protected function invalidArgument($num, $actual, $expected, $function) {
$class = Code::getClass($this);
$namespace = Code::getNamespace($class);
$context = $class.'::'.$function.'()';
$expandType = function ($type) use ($class, $namespace) {
if (is_string($type)) {
$type = Type::cre... | php | protected function invalidArgument($num, $actual, $expected, $function) {
$class = Code::getClass($this);
$namespace = Code::getNamespace($class);
$context = $class.'::'.$function.'()';
$expandType = function ($type) use ($class, $namespace) {
if (is_string($type)) {
$type = Type::cre... | [
"protected",
"function",
"invalidArgument",
"(",
"$",
"num",
",",
"$",
"actual",
",",
"$",
"expected",
",",
"$",
"function",
")",
"{",
"$",
"class",
"=",
"Code",
"::",
"getClass",
"(",
"$",
"this",
")",
";",
"$",
"namespace",
"=",
"Code",
"::",
"getN... | $this->invalidArgument(1, $param1, 'PositiveInteger', __FUNCTION__);
@param string|Type $expected der Type oder ein String der den Typ beschreibt
@cc-ignore | [
"$this",
"-",
">",
"invalidArgument",
"(",
"1",
"$param1",
"PositiveInteger",
"__FUNCTION__",
")",
";"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/SimpleObject.php#L21-L47 |
javiacei/IdeupSimplePaginatorBundle | Paginator/Paginator.php | Paginator.setFallbackValues | private function setFallbackValues()
{
$hash = md5(null);
$this->currentPage[$hash] = 0;
$this->itemsPerPage[$hash] = 10;
$this->maxPagerItems[$hash] = 3;
$this->totalItems[$hash] = 0;
} | php | private function setFallbackValues()
{
$hash = md5(null);
$this->currentPage[$hash] = 0;
$this->itemsPerPage[$hash] = 10;
$this->maxPagerItems[$hash] = 3;
$this->totalItems[$hash] = 0;
} | [
"private",
"function",
"setFallbackValues",
"(",
")",
"{",
"$",
"hash",
"=",
"md5",
"(",
"null",
")",
";",
"$",
"this",
"->",
"currentPage",
"[",
"$",
"hash",
"]",
"=",
"0",
";",
"$",
"this",
"->",
"itemsPerPage",
"[",
"$",
"hash",
"]",
"=",
"10",
... | Sets default values
@return void | [
"Sets",
"default",
"values"
] | train | https://github.com/javiacei/IdeupSimplePaginatorBundle/blob/12639a9c75bc403649fc2b2881e190a017d8c5b2/Paginator/Paginator.php#L71-L78 |
javiacei/IdeupSimplePaginatorBundle | Paginator/Paginator.php | Paginator.paginate | public function paginate($collection, $id = null)
{
$adapter = $this->adapterFactory->createAdapter($collection);
$this->totalItems[md5($id)] = $adapter->getTotalResults();
$offset = $this->calculateOffset($id);
return $adapter->setOffset($offset)->setLength($this->getItemsPerPage(... | php | public function paginate($collection, $id = null)
{
$adapter = $this->adapterFactory->createAdapter($collection);
$this->totalItems[md5($id)] = $adapter->getTotalResults();
$offset = $this->calculateOffset($id);
return $adapter->setOffset($offset)->setLength($this->getItemsPerPage(... | [
"public",
"function",
"paginate",
"(",
"$",
"collection",
",",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"adapterFactory",
"->",
"createAdapter",
"(",
"$",
"collection",
")",
";",
"$",
"this",
"->",
"totalItems",
"[",
"m... | Transforms the given Doctrine DQL into a paginated query
If you need to paginate various queries in the same controller, you need to specify an $id
@param mixed $collection
@param string $id
@return Doctrine\ORM\Query | [
"Transforms",
"the",
"given",
"Doctrine",
"DQL",
"into",
"a",
"paginated",
"query",
"If",
"you",
"need",
"to",
"paginate",
"various",
"queries",
"in",
"the",
"same",
"controller",
"you",
"need",
"to",
"specify",
"an",
"$id"
] | train | https://github.com/javiacei/IdeupSimplePaginatorBundle/blob/12639a9c75bc403649fc2b2881e190a017d8c5b2/Paginator/Paginator.php#L129-L137 |
javiacei/IdeupSimplePaginatorBundle | Paginator/Paginator.php | Paginator.getTotalItems | public function getTotalItems($id = null)
{
$hash = md5($id);
return isset($this->totalItems[$hash]) ? $this->totalItems[$hash] : 0;
} | php | public function getTotalItems($id = null)
{
$hash = md5($id);
return isset($this->totalItems[$hash]) ? $this->totalItems[$hash] : 0;
} | [
"public",
"function",
"getTotalItems",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"hash",
"=",
"md5",
"(",
"$",
"id",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"totalItems",
"[",
"$",
"hash",
"]",
")",
"?",
"$",
"this",
"->",
"totalIt... | Get the total items in the non-paginated version of the query
@param string $id
@return int | [
"Get",
"the",
"total",
"items",
"in",
"the",
"non",
"-",
"paginated",
"version",
"of",
"the",
"query"
] | train | https://github.com/javiacei/IdeupSimplePaginatorBundle/blob/12639a9c75bc403649fc2b2881e190a017d8c5b2/Paginator/Paginator.php#L241-L245 |
javiacei/IdeupSimplePaginatorBundle | Paginator/Paginator.php | Paginator.getLastPage | public function getLastPage($id = null)
{
$totalItems = ($this->getTotalItems($id) > 0) ? $this->getTotalItems($id) : 1;
return (int)ceil($totalItems / $this->getItemsPerPage($id));
} | php | public function getLastPage($id = null)
{
$totalItems = ($this->getTotalItems($id) > 0) ? $this->getTotalItems($id) : 1;
return (int)ceil($totalItems / $this->getItemsPerPage($id));
} | [
"public",
"function",
"getLastPage",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"$",
"totalItems",
"=",
"(",
"$",
"this",
"->",
"getTotalItems",
"(",
"$",
"id",
")",
">",
"0",
")",
"?",
"$",
"this",
"->",
"getTotalItems",
"(",
"$",
"id",
")",
":",
"1... | Gets the last page number
@param string $id
@return int | [
"Gets",
"the",
"last",
"page",
"number"
] | train | https://github.com/javiacei/IdeupSimplePaginatorBundle/blob/12639a9c75bc403649fc2b2881e190a017d8c5b2/Paginator/Paginator.php#L253-L257 |
netgen/metadata-bundle | bundle/Core/FieldType/Metadata/Type.php | Type.isEmptyValue | public function isEmptyValue(SPIValue $value)
{
return $value === null || $value->xml->saveXML() == $this->getEmptyValue()->xml->saveXML();
} | php | public function isEmptyValue(SPIValue $value)
{
return $value === null || $value->xml->saveXML() == $this->getEmptyValue()->xml->saveXML();
} | [
"public",
"function",
"isEmptyValue",
"(",
"SPIValue",
"$",
"value",
")",
"{",
"return",
"$",
"value",
"===",
"null",
"||",
"$",
"value",
"->",
"xml",
"->",
"saveXML",
"(",
")",
"==",
"$",
"this",
"->",
"getEmptyValue",
"(",
")",
"->",
"xml",
"->",
"... | Returns if the given $value is considered empty by the field type.
Default implementation, which performs a "==" check with the value
returned by {@link getEmptyValue()}. Overwrite in the specific field
type, if necessary.
@param \eZ\Publish\Core\FieldType\Value $value
@return bool | [
"Returns",
"if",
"the",
"given",
"$value",
"is",
"considered",
"empty",
"by",
"the",
"field",
"type",
"."
] | train | https://github.com/netgen/metadata-bundle/blob/12bfca68e8e8f4be409c7151f99dff665c53755b/bundle/Core/FieldType/Metadata/Type.php#L56-L59 |
netgen/metadata-bundle | bundle/Core/FieldType/Metadata/Type.php | Type.fromHash | public function fromHash($hash)
{
if (empty($hash) || empty($hash['xml'])) {
return $this->getEmptyValue();
}
return new Value($hash['xml']);
} | php | public function fromHash($hash)
{
if (empty($hash) || empty($hash['xml'])) {
return $this->getEmptyValue();
}
return new Value($hash['xml']);
} | [
"public",
"function",
"fromHash",
"(",
"$",
"hash",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"hash",
")",
"||",
"empty",
"(",
"$",
"hash",
"[",
"'xml'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getEmptyValue",
"(",
")",
";",
"}",
"return"... | Converts an $hash to the Value defined by the field type.
This is the reverse operation to {@link toHash()}. At least the hash
format generated by {@link toHash()} must be converted in reverse.
Additional formats might be supported in the rare case that this is
necessary. See the class description for more details on ... | [
"Converts",
"an",
"$hash",
"to",
"the",
"Value",
"defined",
"by",
"the",
"field",
"type",
"."
] | train | https://github.com/netgen/metadata-bundle/blob/12bfca68e8e8f4be409c7151f99dff665c53755b/bundle/Core/FieldType/Metadata/Type.php#L75-L82 |
netgen/metadata-bundle | bundle/Core/FieldType/Metadata/Type.php | Type.createValueFromInput | protected function createValueFromInput($inputValue)
{
if (is_array($inputValue) && !empty($inputValue)) {
$title = !empty($inputValue['title']) ? $inputValue['title'] : '';
$keywords = !empty($inputValue['keywords']) ? $inputValue['keywords'] : array();
$description = !e... | php | protected function createValueFromInput($inputValue)
{
if (is_array($inputValue) && !empty($inputValue)) {
$title = !empty($inputValue['title']) ? $inputValue['title'] : '';
$keywords = !empty($inputValue['keywords']) ? $inputValue['keywords'] : array();
$description = !e... | [
"protected",
"function",
"createValueFromInput",
"(",
"$",
"inputValue",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"inputValue",
")",
"&&",
"!",
"empty",
"(",
"$",
"inputValue",
")",
")",
"{",
"$",
"title",
"=",
"!",
"empty",
"(",
"$",
"inputValue",
"... | Inspects given $inputValue and potentially converts it into a dedicated value object.
If given $inputValue could not be converted or is already an instance of dedicate value object,
the method should simply return it.
This is an operation method for {@see acceptValue()}.
Example implementation:
<code>
protected func... | [
"Inspects",
"given",
"$inputValue",
"and",
"potentially",
"converts",
"it",
"into",
"a",
"dedicated",
"value",
"object",
"."
] | train | https://github.com/netgen/metadata-bundle/blob/12bfca68e8e8f4be409c7151f99dff665c53755b/bundle/Core/FieldType/Metadata/Type.php#L126-L180 |
yuncms/framework | src/rest/models/UserMobileRegistrationForm.php | UserMobileRegistrationForm.register | public function register()
{
if ($this->validate()) {
/** @var User $user */
$user = new User();
$user->setScenario(User::SCENARIO_MOBILE_REGISTER);
$this->loadAttributes($user);
if ($user->createUser()) {
return $user;
... | php | public function register()
{
if ($this->validate()) {
/** @var User $user */
$user = new User();
$user->setScenario(User::SCENARIO_MOBILE_REGISTER);
$this->loadAttributes($user);
if ($user->createUser()) {
return $user;
... | [
"public",
"function",
"register",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"validate",
"(",
")",
")",
"{",
"/** @var User $user */",
"$",
"user",
"=",
"new",
"User",
"(",
")",
";",
"$",
"user",
"->",
"setScenario",
"(",
"User",
"::",
"SCENARIO_MOBI... | Registers a new user account. If registration was successful it will set flash message.
@return User|false | [
"Registers",
"a",
"new",
"user",
"account",
".",
"If",
"registration",
"was",
"successful",
"it",
"will",
"set",
"flash",
"message",
"."
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/rest/models/UserMobileRegistrationForm.php#L92-L104 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.default_data_provider | public static function default_data_provider()
{
return array(
'last_active' => time(),
'current_lang' => \CCLang::current(),
'client_agent' => \CCServer::client( 'agent' ),
'client_ip' => \CCServer::client( 'ip' ),
'client_port' => \CCServer::client( 'port' ),
'client_lang' => \CCServer::client(... | php | public static function default_data_provider()
{
return array(
'last_active' => time(),
'current_lang' => \CCLang::current(),
'client_agent' => \CCServer::client( 'agent' ),
'client_ip' => \CCServer::client( 'ip' ),
'client_port' => \CCServer::client( 'port' ),
'client_lang' => \CCServer::client(... | [
"public",
"static",
"function",
"default_data_provider",
"(",
")",
"{",
"return",
"array",
"(",
"'last_active'",
"=>",
"time",
"(",
")",
",",
"'current_lang'",
"=>",
"\\",
"CCLang",
"::",
"current",
"(",
")",
",",
"'client_agent'",
"=>",
"\\",
"CCServer",
":... | Some default values for our session
@return array | [
"Some",
"default",
"values",
"for",
"our",
"session"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L60-L70 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.valid_fingerprint | public function valid_fingerprint( $fingerprint = null )
{
if ( is_null( $fingerprint ) )
{
$fingerprint = \CCIn::get( \ClanCats::$config->get( 'session.default_fingerprint_parameter' ), false );
}
return $this->fingerprint === $fingerprint;
} | php | public function valid_fingerprint( $fingerprint = null )
{
if ( is_null( $fingerprint ) )
{
$fingerprint = \CCIn::get( \ClanCats::$config->get( 'session.default_fingerprint_parameter' ), false );
}
return $this->fingerprint === $fingerprint;
} | [
"public",
"function",
"valid_fingerprint",
"(",
"$",
"fingerprint",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"fingerprint",
")",
")",
"{",
"$",
"fingerprint",
"=",
"\\",
"CCIn",
"::",
"get",
"(",
"\\",
"ClanCats",
"::",
"$",
"config",
"->... | Does the current session fingerprint match a parameter
When no parameter is given we use GET->s as default parameter
@param string $fingerprint
@return string | [
"Does",
"the",
"current",
"session",
"fingerprint",
"match",
"a",
"parameter"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L247-L255 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.once | public function once( $key, $default = null )
{
$value = \CCArr::get( $key, $this->_data, $default );
\CCArr::delete( $key, $this->_data );
return $value;
} | php | public function once( $key, $default = null )
{
$value = \CCArr::get( $key, $this->_data, $default );
\CCArr::delete( $key, $this->_data );
return $value;
} | [
"public",
"function",
"once",
"(",
"$",
"key",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"\\",
"CCArr",
"::",
"get",
"(",
"$",
"key",
",",
"$",
"this",
"->",
"_data",
",",
"$",
"default",
")",
";",
"\\",
"CCArr",
"::",
"del... | Get a value from data and remove it afterwards
@param string $key
@param mixed $default
@return mixed | [
"Get",
"a",
"value",
"from",
"data",
"and",
"remove",
"it",
"afterwards"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L264-L269 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.read | public function read()
{
// Do we already have a session id if not we regenerate
// the session and assign the default data.
if ( $this->id )
{
if ( !$this->_data = $this->_driver->read( $this->id ) )
{
$this->regenerate();
$this->_data = array();
}
if ( !is_array( $this->_data ) )
... | php | public function read()
{
// Do we already have a session id if not we regenerate
// the session and assign the default data.
if ( $this->id )
{
if ( !$this->_data = $this->_driver->read( $this->id ) )
{
$this->regenerate();
$this->_data = array();
}
if ( !is_array( $this->_data ) )
... | [
"public",
"function",
"read",
"(",
")",
"{",
"// Do we already have a session id if not we regenerate",
"// the session and assign the default data.",
"if",
"(",
"$",
"this",
"->",
"id",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_data",
"=",
"$",
"this",
"->",... | Read data from the session driver. This overwrite's
any changes made on runtime.
@return void | [
"Read",
"data",
"from",
"the",
"session",
"driver",
".",
"This",
"overwrite",
"s",
"any",
"changes",
"made",
"on",
"runtime",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L277-L301 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.write | public function write()
{
$this->_driver->write( $this->id, $this->_data );
// We also have to set the cookie again to keep it alive
\CCCookie::set( $this->cookie_name(), $this->id, \CCArr::get( 'lifetime', $this->_config, \CCDate::minutes( 5 ) ) );
} | php | public function write()
{
$this->_driver->write( $this->id, $this->_data );
// We also have to set the cookie again to keep it alive
\CCCookie::set( $this->cookie_name(), $this->id, \CCArr::get( 'lifetime', $this->_config, \CCDate::minutes( 5 ) ) );
} | [
"public",
"function",
"write",
"(",
")",
"{",
"$",
"this",
"->",
"_driver",
"->",
"write",
"(",
"$",
"this",
"->",
"id",
",",
"$",
"this",
"->",
"_data",
")",
";",
"// We also have to set the cookie again to keep it alive",
"\\",
"CCCookie",
"::",
"set",
"("... | Write the session to the driver
@return void | [
"Write",
"the",
"session",
"to",
"the",
"driver"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L308-L314 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.regenerate | public function regenerate()
{
do
{
$id = \CCStr::random( 32 );
}
while ( $this->_driver->has( $id ) );
$this->fingerprint = sha1( $id );
return $this->id = $id;
} | php | public function regenerate()
{
do
{
$id = \CCStr::random( 32 );
}
while ( $this->_driver->has( $id ) );
$this->fingerprint = sha1( $id );
return $this->id = $id;
} | [
"public",
"function",
"regenerate",
"(",
")",
"{",
"do",
"{",
"$",
"id",
"=",
"\\",
"CCStr",
"::",
"random",
"(",
"32",
")",
";",
"}",
"while",
"(",
"$",
"this",
"->",
"_driver",
"->",
"has",
"(",
"$",
"id",
")",
")",
";",
"$",
"this",
"->",
... | Generate a new session id and checks the dirver for dublicates.
@return string The new generated session id. | [
"Generate",
"a",
"new",
"session",
"id",
"and",
"checks",
"the",
"dirver",
"for",
"dublicates",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L321-L331 |
ClanCats/Core | src/bundles/Session/Manager.php | Manager.gc | public function gc()
{
$lifetime = \CCArr::get( 'lifetime', $this->_config, \CCDate::minutes( 5 ) );
if ( $lifetime < ( $min_lifetime = \CCArr::get( 'min_lifetime', $this->_config, \CCDate::minutes( 5 ) ) ) )
{
$lifetime = $min_lifetime;
}
$this->_driver->gc( $lifetime );
} | php | public function gc()
{
$lifetime = \CCArr::get( 'lifetime', $this->_config, \CCDate::minutes( 5 ) );
if ( $lifetime < ( $min_lifetime = \CCArr::get( 'min_lifetime', $this->_config, \CCDate::minutes( 5 ) ) ) )
{
$lifetime = $min_lifetime;
}
$this->_driver->gc( $lifetime );
} | [
"public",
"function",
"gc",
"(",
")",
"{",
"$",
"lifetime",
"=",
"\\",
"CCArr",
"::",
"get",
"(",
"'lifetime'",
",",
"$",
"this",
"->",
"_config",
",",
"\\",
"CCDate",
"::",
"minutes",
"(",
"5",
")",
")",
";",
"if",
"(",
"$",
"lifetime",
"<",
"("... | Garbage collection, delete all outdated sessions
@return void | [
"Garbage",
"collection",
"delete",
"all",
"outdated",
"sessions"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/Session/Manager.php#L347-L357 |
webforge-labs/psc-cms | lib/Psc/Exception.php | Exception.handler | public static function handler (\Exception $e) {
try {
$project = PSC::getProject();
} catch (\Exception $noProjet) {
$project = NULL;
}
$format = PHP_SAPI === 'cli' ? 'text' : 'html';
$text = self::getExceptionText($e, $format, $project);
print $text;
PSC::ge... | php | public static function handler (\Exception $e) {
try {
$project = PSC::getProject();
} catch (\Exception $noProjet) {
$project = NULL;
}
$format = PHP_SAPI === 'cli' ? 'text' : 'html';
$text = self::getExceptionText($e, $format, $project);
print $text;
PSC::ge... | [
"public",
"static",
"function",
"handler",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"try",
"{",
"$",
"project",
"=",
"PSC",
"::",
"getProject",
"(",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"noProjet",
")",
"{",
"$",
"project",
"=",
... | /*
public function __construct ($message = "", $code = 0, Exception $previous = NULL) {
parent::__construct($message,$code,$previous);
} | [
"/",
"*",
"public",
"function",
"__construct",
"(",
"$message",
"=",
"$code",
"=",
"0",
"Exception",
"$previous",
"=",
"NULL",
")",
"{",
"parent",
"::",
"__construct",
"(",
"$message",
"$code",
"$previous",
")",
";",
"}"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Exception.php#L69-L83 |
fubhy/graphql-php | src/Schema.php | Schema.getDirective | public function getDirective($name)
{
foreach ($this->getDirectives() as $directive) {
if ($directive->getName() === $name) {
return $directive;
}
}
return NULL;
} | php | public function getDirective($name)
{
foreach ($this->getDirectives() as $directive) {
if ($directive->getName() === $name) {
return $directive;
}
}
return NULL;
} | [
"public",
"function",
"getDirective",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getDirectives",
"(",
")",
"as",
"$",
"directive",
")",
"{",
"if",
"(",
"$",
"directive",
"->",
"getName",
"(",
")",
"===",
"$",
"name",
")",
"{",
... | @param string $name
@return \Fubhy\GraphQL\Type\Directives\DirectiveInterface|null | [
"@param",
"string",
"$name"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Schema.php#L77-L85 |
fubhy/graphql-php | src/Schema.php | Schema.getType | public function getType($name)
{
$map = $this->getTypeMap();
return isset($map[$name]) ? $map[$name] : NULL;
} | php | public function getType($name)
{
$map = $this->getTypeMap();
return isset($map[$name]) ? $map[$name] : NULL;
} | [
"public",
"function",
"getType",
"(",
"$",
"name",
")",
"{",
"$",
"map",
"=",
"$",
"this",
"->",
"getTypeMap",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"map",
"[",
"$",
"name",
"]",
")",
"?",
"$",
"map",
"[",
"$",
"name",
"]",
":",
"NULL",
... | @param string $name
@return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface | [
"@param",
"string",
"$name"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Schema.php#L129-L133 |
fubhy/graphql-php | src/Schema.php | Schema.typeMapReducer | protected function typeMapReducer(array $map, $type)
{
if ($type instanceof ModifierInterface) {
return $this->typeMapReducer($map, $type->getWrappedType());
}
if (!$type instanceof TypeInterface) {
return $map;
}
if (!empty($map[$type->getName()])) ... | php | protected function typeMapReducer(array $map, $type)
{
if ($type instanceof ModifierInterface) {
return $this->typeMapReducer($map, $type->getWrappedType());
}
if (!$type instanceof TypeInterface) {
return $map;
}
if (!empty($map[$type->getName()])) ... | [
"protected",
"function",
"typeMapReducer",
"(",
"array",
"$",
"map",
",",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"type",
"instanceof",
"ModifierInterface",
")",
"{",
"return",
"$",
"this",
"->",
"typeMapReducer",
"(",
"$",
"map",
",",
"$",
"type",
"->",
... | @param \Fubhy\GraphQL\Type\Definition\Types\TypeInterface[] $map
@param mixed $type
@return \Fubhy\GraphQL\Type\Definition\Types\TypeInterface[] | [
"@param",
"\\",
"Fubhy",
"\\",
"GraphQL",
"\\",
"Type",
"\\",
"Definition",
"\\",
"Types",
"\\",
"TypeInterface",
"[]",
"$map",
"@param",
"mixed",
"$type"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Schema.php#L141-L184 |
webforge-labs/psc-cms | lib/Psc/DateTime/TimeBenchmark.php | TimeBenchmark.getTime | public function getTime($format = self::MILLISECONDS) {
$end = (isset($this->end)) ? $this->end : microtime();
list ($endSeconds, $endMicro) = $end;
list ($startSeconds, $startMicro) = $this->start;
$microseconds = ($endSeconds - $startSeconds) * pow(10,6) + abs($endMicro - $startMic... | php | public function getTime($format = self::MILLISECONDS) {
$end = (isset($this->end)) ? $this->end : microtime();
list ($endSeconds, $endMicro) = $end;
list ($startSeconds, $startMicro) = $this->start;
$microseconds = ($endSeconds - $startSeconds) * pow(10,6) + abs($endMicro - $startMic... | [
"public",
"function",
"getTime",
"(",
"$",
"format",
"=",
"self",
"::",
"MILLISECONDS",
")",
"{",
"$",
"end",
"=",
"(",
"isset",
"(",
"$",
"this",
"->",
"end",
")",
")",
"?",
"$",
"this",
"->",
"end",
":",
"microtime",
"(",
")",
";",
"list",
"(",... | Gibt die verganene Zeit des Benchmarks zurück
Ist vorher nicht end() aufgerufen worden, wird die aktuelle Zeit als Timestamp benutzt und der Benchmark läuft weiter
@return float | [
"Gibt",
"die",
"verganene",
"Zeit",
"des",
"Benchmarks",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/DateTime/TimeBenchmark.php#L67-L84 |
phrest/sdk | src/Generator.php | Generator.generate | public function generate()
{
$this->printMessage('');
$this->printMessage(
'Creating Collection config'
);
Files::saveCollectionConfig((new ConfigGenerator($this->config))->create());
$this->printMessage(
'Creating Models, Controllers, Requests, Responses, and Exceptions'
);
... | php | public function generate()
{
$this->printMessage('');
$this->printMessage(
'Creating Collection config'
);
Files::saveCollectionConfig((new ConfigGenerator($this->config))->create());
$this->printMessage(
'Creating Models, Controllers, Requests, Responses, and Exceptions'
);
... | [
"public",
"function",
"generate",
"(",
")",
"{",
"$",
"this",
"->",
"printMessage",
"(",
"''",
")",
";",
"$",
"this",
"->",
"printMessage",
"(",
"'Creating Collection config'",
")",
";",
"Files",
"::",
"saveCollectionConfig",
"(",
"(",
"new",
"ConfigGenerator"... | Generate the SDK | [
"Generate",
"the",
"SDK"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator.php#L69-L156 |
phrest/sdk | src/Generator.php | Generator.vaidateEntityConfig | public function vaidateEntityConfig($entityName, $entity)
{
if (empty($entity->requests))
{
$this->printMessage(
"Entity: {$entityName} doesn't have any requests set up for it."
. " Controllers, exceptions, requests will be skipped."
);
}
else
{
foreach ($entity-... | php | public function vaidateEntityConfig($entityName, $entity)
{
if (empty($entity->requests))
{
$this->printMessage(
"Entity: {$entityName} doesn't have any requests set up for it."
. " Controllers, exceptions, requests will be skipped."
);
}
else
{
foreach ($entity-... | [
"public",
"function",
"vaidateEntityConfig",
"(",
"$",
"entityName",
",",
"$",
"entity",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"entity",
"->",
"requests",
")",
")",
"{",
"$",
"this",
"->",
"printMessage",
"(",
"\"Entity: {$entityName} doesn't have any requests... | @param string $entityName
@param Config $entity
@returns Config | [
"@param",
"string",
"$entityName",
"@param",
"Config",
"$entity"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator.php#L164-L217 |
phrest/sdk | src/Generator.php | Generator.getExceptionsFromEntityConfig | public function getExceptionsFromEntityConfig($entity)
{
$exceptions = [];
foreach ($entity->requests as $request)
{
foreach ($request as $action)
{
if (isset($action->throws))
{
$exceptions[] = $action->throws;
}
}
}
return $exceptions;
} | php | public function getExceptionsFromEntityConfig($entity)
{
$exceptions = [];
foreach ($entity->requests as $request)
{
foreach ($request as $action)
{
if (isset($action->throws))
{
$exceptions[] = $action->throws;
}
}
}
return $exceptions;
} | [
"public",
"function",
"getExceptionsFromEntityConfig",
"(",
"$",
"entity",
")",
"{",
"$",
"exceptions",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"entity",
"->",
"requests",
"as",
"$",
"request",
")",
"{",
"foreach",
"(",
"$",
"request",
"as",
"$",
"actio... | @param Config $entity
@return \stdClass[] | [
"@param",
"Config",
"$entity"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator.php#L224-L240 |
Lansoweb/LosReCaptcha | src/Captcha/ReCaptcha.php | ReCaptcha.isValid | public function isValid($value, $context = null)
{
if (! is_array($value) && ! is_array($context)) {
$this->error(self::MISSING_VALUE);
return false;
}
if (! is_array($value) && is_array($context)) {
$value = $context;
}
if (empty($value[... | php | public function isValid($value, $context = null)
{
if (! is_array($value) && ! is_array($context)) {
$this->error(self::MISSING_VALUE);
return false;
}
if (! is_array($value) && is_array($context)) {
$value = $context;
}
if (empty($value[... | [
"public",
"function",
"isValid",
"(",
"$",
"value",
",",
"$",
"context",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"is_array",
"(",
"$",
"context",
")",
")",
"{",
"$",
"this",
"->",
"error",
"(",
"self"... | Validate captcha
@see \Zend\Validator\ValidatorInterface::isValid()
@param mixed $value
@param mixed $context
@return bool | [
"Validate",
"captcha"
] | train | https://github.com/Lansoweb/LosReCaptcha/blob/8df866995501db087c3850f97fd2b6547632e6ed/src/Captcha/ReCaptcha.php#L79-L110 |
okitcom/ok-lib-php | src/Service/Ticketing.php | Ticketing.create | public function create(TicketObject $ticket) {
$response = $this->client->post('tickets', array('ticket' => $ticket));
return new TicketObject($response);
} | php | public function create(TicketObject $ticket) {
$response = $this->client->post('tickets', array('ticket' => $ticket));
return new TicketObject($response);
} | [
"public",
"function",
"create",
"(",
"TicketObject",
"$",
"ticket",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"post",
"(",
"'tickets'",
",",
"array",
"(",
"'ticket'",
"=>",
"$",
"ticket",
")",
")",
";",
"return",
"new",
"Ticket... | Creates a ticket
@param TicketObject $ticket
@return TicketObject
@throws \OK\Model\Network\Exception\NetworkException | [
"Creates",
"a",
"ticket"
] | train | https://github.com/okitcom/ok-lib-php/blob/1f441f3d216af7c952788e864bfe66bc4f089467/src/Service/Ticketing.php#L33-L36 |
okitcom/ok-lib-php | src/Service/Ticketing.php | Ticketing.update | public function update(TicketObject $ticket) {
return new TicketObject($this->client->post('tickets/' . $ticket->guid, array("ticket" => $ticket)));
} | php | public function update(TicketObject $ticket) {
return new TicketObject($this->client->post('tickets/' . $ticket->guid, array("ticket" => $ticket)));
} | [
"public",
"function",
"update",
"(",
"TicketObject",
"$",
"ticket",
")",
"{",
"return",
"new",
"TicketObject",
"(",
"$",
"this",
"->",
"client",
"->",
"post",
"(",
"'tickets/'",
".",
"$",
"ticket",
"->",
"guid",
",",
"array",
"(",
"\"ticket\"",
"=>",
"$"... | Updates the ticket
@param TicketObject $ticket
@return mixed
@throws \OK\Model\Network\Exception\NetworkException | [
"Updates",
"the",
"ticket"
] | train | https://github.com/okitcom/ok-lib-php/blob/1f441f3d216af7c952788e864bfe66bc4f089467/src/Service/Ticketing.php#L44-L46 |
okitcom/ok-lib-php | src/Service/Ticketing.php | Ticketing.check | public function check($eventId, $barcode, $terminalId = null, Location $location = null) {
return new TicketCheckIn($this->client->post('check', [
'event' => $eventId,
'barcode' => $barcode,
'terminalId' => $terminalId,
'location' => $location
]));
} | php | public function check($eventId, $barcode, $terminalId = null, Location $location = null) {
return new TicketCheckIn($this->client->post('check', [
'event' => $eventId,
'barcode' => $barcode,
'terminalId' => $terminalId,
'location' => $location
]));
} | [
"public",
"function",
"check",
"(",
"$",
"eventId",
",",
"$",
"barcode",
",",
"$",
"terminalId",
"=",
"null",
",",
"Location",
"$",
"location",
"=",
"null",
")",
"{",
"return",
"new",
"TicketCheckIn",
"(",
"$",
"this",
"->",
"client",
"->",
"post",
"("... | Check a ticket barcode for an event.
@param $eventId integer event id
@param $barcode string barcode
@param $terminalId integer _optional_ terminal id
@param $location Location _optional_ location
@return TicketCheckIn result
@throws \OK\Model\Network\Exception\NetworkException | [
"Check",
"a",
"ticket",
"barcode",
"for",
"an",
"event",
"."
] | train | https://github.com/okitcom/ok-lib-php/blob/1f441f3d216af7c952788e864bfe66bc4f089467/src/Service/Ticketing.php#L70-L77 |
anime-db/app-bundle | src/Controller/FormController.php | FormController.localPathAction | public function localPathAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse();
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$form = $this->createForm(
new Choi... | php | public function localPathAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse();
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
$form = $this->createForm(
new Choi... | [
"public",
"function",
"localPathAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getCacheTimeKeeper",
"(",
")",
"->",
"getResponse",
"(",
")",
";",
"// response was not modified for this request",
"if",
"(",
"$",
"resp... | Form field local path.
@param Request $request
@return Response | [
"Form",
"field",
"local",
"path",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Controller/FormController.php#L29-L45 |
anime-db/app-bundle | src/Controller/FormController.php | FormController.localPathFoldersAction | public function localPathFoldersAction(Request $request)
{
$form = $this->createForm(new ChoiceLocalPath());
$form->handleRequest($request);
$path = $form->get('path')->getData() ?: Filesystem::getUserHomeDir();
if (($root = $request->get('root')) && strpos($path, $root) !== 0) {
... | php | public function localPathFoldersAction(Request $request)
{
$form = $this->createForm(new ChoiceLocalPath());
$form->handleRequest($request);
$path = $form->get('path')->getData() ?: Filesystem::getUserHomeDir();
if (($root = $request->get('root')) && strpos($path, $root) !== 0) {
... | [
"public",
"function",
"localPathFoldersAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"ChoiceLocalPath",
"(",
")",
")",
";",
"$",
"form",
"->",
"handleRequest",
"(",
"$",
"request",
")",
... | Return list folders for path.
@param Request $request
@return JsonResponse | [
"Return",
"list",
"folders",
"for",
"path",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Controller/FormController.php#L54-L76 |
anime-db/app-bundle | src/Controller/FormController.php | FormController.imageAction | public function imageAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse();
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
return $this->render('AnimeDbAppBundle:Form:image.h... | php | public function imageAction(Request $request)
{
$response = $this->getCacheTimeKeeper()->getResponse();
// response was not modified for this request
if ($response->isNotModified($request)) {
return $response;
}
return $this->render('AnimeDbAppBundle:Form:image.h... | [
"public",
"function",
"imageAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getCacheTimeKeeper",
"(",
")",
"->",
"getResponse",
"(",
")",
";",
"// response was not modified for this request",
"if",
"(",
"$",
"response... | Form field image.
@param Request $request
@return Response | [
"Form",
"field",
"image",
"."
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Controller/FormController.php#L85-L97 |
anime-db/app-bundle | src/Controller/FormController.php | FormController.imageUploadAction | public function imageUploadAction(Request $request)
{
$image = new ImageField();
/* @var $form Form */
$form = $this->createForm(new UploadImage(), $image);
$form->handleRequest($request);
if (!$form->isValid()) {
$errors = $form->getErrors();
return... | php | public function imageUploadAction(Request $request)
{
$image = new ImageField();
/* @var $form Form */
$form = $this->createForm(new UploadImage(), $image);
$form->handleRequest($request);
if (!$form->isValid()) {
$errors = $form->getErrors();
return... | [
"public",
"function",
"imageUploadAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"image",
"=",
"new",
"ImageField",
"(",
")",
";",
"/* @var $form Form */",
"$",
"form",
"=",
"$",
"this",
"->",
"createForm",
"(",
"new",
"UploadImage",
"(",
")",
","... | @param Request $request
@return JsonResponse | [
"@param",
"Request",
"$request"
] | train | https://github.com/anime-db/app-bundle/blob/ca3b342081719d41ba018792a75970cbb1f1fe22/src/Controller/FormController.php#L104-L128 |
ClanCats/Core | src/classes/CCLang.php | CCLang.set_current | public static function set_current( $lang )
{
$lang = static::parse( $lang );
if ( !array_key_exists( $lang, static::$data ) )
{
static::$data[$lang] = array();
}
return static::$current_language = $lang;
} | php | public static function set_current( $lang )
{
$lang = static::parse( $lang );
if ( !array_key_exists( $lang, static::$data ) )
{
static::$data[$lang] = array();
}
return static::$current_language = $lang;
} | [
"public",
"static",
"function",
"set_current",
"(",
"$",
"lang",
")",
"{",
"$",
"lang",
"=",
"static",
"::",
"parse",
"(",
"$",
"lang",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"lang",
",",
"static",
"::",
"$",
"data",
")",
")",
"{",... | Set the current language
The passed string wil be parsed also the parsed / used language will be returnd.
@param string $lang
@return string | [
"Set",
"the",
"current",
"language",
"The",
"passed",
"string",
"wil",
"be",
"parsed",
"also",
"the",
"parsed",
"/",
"used",
"language",
"will",
"be",
"returnd",
"."
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCLang.php#L74-L84 |
ClanCats/Core | src/classes/CCLang.php | CCLang.parse | public static function parse( $lang )
{
$conf = ClanCats::$config->language;
if ( isset( $lang ) && strlen( $lang ) > 1 )
{
$lang = explode( ',', strtolower( $lang ) );
$lang = explode( '-', $lang[0] );
if ( !isset( $lang[1] ) )
{
$lang[1] = $lang[0];
}
$available = $conf['ava... | php | public static function parse( $lang )
{
$conf = ClanCats::$config->language;
if ( isset( $lang ) && strlen( $lang ) > 1 )
{
$lang = explode( ',', strtolower( $lang ) );
$lang = explode( '-', $lang[0] );
if ( !isset( $lang[1] ) )
{
$lang[1] = $lang[0];
}
$available = $conf['ava... | [
"public",
"static",
"function",
"parse",
"(",
"$",
"lang",
")",
"{",
"$",
"conf",
"=",
"ClanCats",
"::",
"$",
"config",
"->",
"language",
";",
"if",
"(",
"isset",
"(",
"$",
"lang",
")",
"&&",
"strlen",
"(",
"$",
"lang",
")",
">",
"1",
")",
"{",
... | Match an language code with the aviable languages
CCLang::parse( 'de' );
CCLang::parse( 'EN-US' );
CCLang::parse( 'de-DE,en,fr' );
@param string $lang
@return string | [
"Match",
"an",
"language",
"code",
"with",
"the",
"aviable",
"languages"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCLang.php#L113-L147 |
ClanCats/Core | src/classes/CCLang.php | CCLang.load | public static function load( $path, $overwrite = false )
{
if ( array_key_exists( $path, static::$data[static::$current_language] ) && $overwrite === false )
{
return;
}
$file_path = CCPath::get( $path, CCDIR_LANGUAGE.static::$current_language.'/', EXT );
if ( !file_exists( $file_path ) )
{
... | php | public static function load( $path, $overwrite = false )
{
if ( array_key_exists( $path, static::$data[static::$current_language] ) && $overwrite === false )
{
return;
}
$file_path = CCPath::get( $path, CCDIR_LANGUAGE.static::$current_language.'/', EXT );
if ( !file_exists( $file_path ) )
{
... | [
"public",
"static",
"function",
"load",
"(",
"$",
"path",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"path",
",",
"static",
"::",
"$",
"data",
"[",
"static",
"::",
"$",
"current_language",
"]",
")",
"&&",
... | Load a language file into the appliaction
CCLang::load( 'some/path/to/file' );
CCLang::load( 'controller/example' );
CCLang::load( 'Blog::controller/dashboard' );
@param string $path
@param bool $overwrite
@return void | [
"Load",
"a",
"language",
"file",
"into",
"the",
"appliaction"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCLang.php#L170-L198 |
ClanCats/Core | src/classes/CCLang.php | CCLang.line | public static function line( $key, $params = array() )
{
$path = substr( $key, 0, strpos( $key, '.' ) );
$key = substr( $key, strpos( $key, '.' )+1 );
// if there is a namespace replace the path with it
if ( isset( static::$aliases[$path] ) )
{
return static::line( static::$aliases[$path].'.'.$key, $... | php | public static function line( $key, $params = array() )
{
$path = substr( $key, 0, strpos( $key, '.' ) );
$key = substr( $key, strpos( $key, '.' )+1 );
// if there is a namespace replace the path with it
if ( isset( static::$aliases[$path] ) )
{
return static::line( static::$aliases[$path].'.'.$key, $... | [
"public",
"static",
"function",
"line",
"(",
"$",
"key",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"path",
"=",
"substr",
"(",
"$",
"key",
",",
"0",
",",
"strpos",
"(",
"$",
"key",
",",
"'.'",
")",
")",
";",
"$",
"key",
"=",
... | Recive a translated line
__( 'some/path.to.my.label' );
__( 'user.welcome', array( 'name' => 'Jeff' ) )
@param string $key
@param array $params
@return string | [
"Recive",
"a",
"translated",
"line"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCLang.php#L210-L246 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanner.php | CoverFishScanner.addCoverageValidatorPoolForCover | public function addCoverageValidatorPoolForCover($coverToken)
{
// covers ClassName::methodName
$this->addValidator(new ValidatorClassNameMethodName($coverToken));
// covers ::methodName
$this->addValidator(new ValidatorMethodName($coverToken));
// covers ClassName
$t... | php | public function addCoverageValidatorPoolForCover($coverToken)
{
// covers ClassName::methodName
$this->addValidator(new ValidatorClassNameMethodName($coverToken));
// covers ::methodName
$this->addValidator(new ValidatorMethodName($coverToken));
// covers ClassName
$t... | [
"public",
"function",
"addCoverageValidatorPoolForCover",
"(",
"$",
"coverToken",
")",
"{",
"// covers ClassName::methodName",
"$",
"this",
"->",
"addValidator",
"(",
"new",
"ValidatorClassNameMethodName",
"(",
"$",
"coverToken",
")",
")",
";",
"// covers ::methodName",
... | init all available cover validator classes use incoming coverToken as parameter
@param $coverToken | [
"init",
"all",
"available",
"cover",
"validator",
"classes",
"use",
"incoming",
"coverToken",
"as",
"parameter"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanner.php#L54-L64 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanner.php | CoverFishScanner.analysePHPUnitFiles | public function analysePHPUnitFiles()
{
$testFiles = $this->scanFilesInPath($this->testSourcePath);
foreach ($testFiles as $file) {
$this->analyseClassesInFile($file);
}
return $this->coverFishOutput->writeResult($this->coverFishResult);
} | php | public function analysePHPUnitFiles()
{
$testFiles = $this->scanFilesInPath($this->testSourcePath);
foreach ($testFiles as $file) {
$this->analyseClassesInFile($file);
}
return $this->coverFishOutput->writeResult($this->coverFishResult);
} | [
"public",
"function",
"analysePHPUnitFiles",
"(",
")",
"{",
"$",
"testFiles",
"=",
"$",
"this",
"->",
"scanFilesInPath",
"(",
"$",
"this",
"->",
"testSourcePath",
")",
";",
"foreach",
"(",
"$",
"testFiles",
"as",
"$",
"file",
")",
"{",
"$",
"this",
"->",... | scan all unit-test files inside specific path
@return string | [
"scan",
"all",
"unit",
"-",
"test",
"files",
"inside",
"specific",
"path"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanner.php#L71-L79 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanner.php | CoverFishScanner.analyseCoverAnnotations | public function analyseCoverAnnotations($phpDocBlock, CoverFishPHPUnitTest $phpUnitTest)
{
$this->validatorCollection->clear();
$phpUnitTest->clearCoverMappings();
$phpUnitTest->clearCoverAnnotation();
/** @var string $cover */
foreach ($phpDocBlock['covers'] as $cover) {
... | php | public function analyseCoverAnnotations($phpDocBlock, CoverFishPHPUnitTest $phpUnitTest)
{
$this->validatorCollection->clear();
$phpUnitTest->clearCoverMappings();
$phpUnitTest->clearCoverAnnotation();
/** @var string $cover */
foreach ($phpDocBlock['covers'] as $cover) {
... | [
"public",
"function",
"analyseCoverAnnotations",
"(",
"$",
"phpDocBlock",
",",
"CoverFishPHPUnitTest",
"$",
"phpUnitTest",
")",
"{",
"$",
"this",
"->",
"validatorCollection",
"->",
"clear",
"(",
")",
";",
"$",
"phpUnitTest",
"->",
"clearCoverMappings",
"(",
")",
... | scan all annotations inside one single unit test file
@param array $phpDocBlock
@param CoverFishPHPUnitTest $phpUnitTest | [
"scan",
"all",
"annotations",
"inside",
"one",
"single",
"unit",
"test",
"file"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanner.php#L87-L101 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanner.php | CoverFishScanner.analyseClassesInFile | public function analyseClassesInFile($file)
{
$ts = new PHP_Token_Stream($file);
$this->phpUnitFile = new CoverFishPHPUnitFile();
foreach ($ts->getClasses() as $className => $classData) {
$fqnClass = sprintf('%s\\%s',
$this->coverFishHelper->getAttributeByKey('na... | php | public function analyseClassesInFile($file)
{
$ts = new PHP_Token_Stream($file);
$this->phpUnitFile = new CoverFishPHPUnitFile();
foreach ($ts->getClasses() as $className => $classData) {
$fqnClass = sprintf('%s\\%s',
$this->coverFishHelper->getAttributeByKey('na... | [
"public",
"function",
"analyseClassesInFile",
"(",
"$",
"file",
")",
"{",
"$",
"ts",
"=",
"new",
"PHP_Token_Stream",
"(",
"$",
"file",
")",
";",
"$",
"this",
"->",
"phpUnitFile",
"=",
"new",
"CoverFishPHPUnitFile",
"(",
")",
";",
"foreach",
"(",
"$",
"ts... | scan all classes inside one defined unit test file
@param string $file
@return array | [
"scan",
"all",
"classes",
"inside",
"one",
"defined",
"unit",
"test",
"file"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanner.php#L110-L129 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/CoverFishScanner.php | CoverFishScanner.analyseClass | public function analyseClass(array $classData)
{
// scan main test class annotation
$this->analyseCoverAnnotations(
$this->coverFishHelper->parseCoverAnnotationDocBlock($classData['docblock']),
$this->setPHPUnitTestByClassData($classData)
);
// iterate throug... | php | public function analyseClass(array $classData)
{
// scan main test class annotation
$this->analyseCoverAnnotations(
$this->coverFishHelper->parseCoverAnnotationDocBlock($classData['docblock']),
$this->setPHPUnitTestByClassData($classData)
);
// iterate throug... | [
"public",
"function",
"analyseClass",
"(",
"array",
"$",
"classData",
")",
"{",
"// scan main test class annotation",
"$",
"this",
"->",
"analyseCoverAnnotations",
"(",
"$",
"this",
"->",
"coverFishHelper",
"->",
"parseCoverAnnotationDocBlock",
"(",
"$",
"classData",
... | scan (test) class and add result to our coverFishResultCollection
@param array $classData
@return array | [
"scan",
"(",
"test",
")",
"class",
"and",
"add",
"result",
"to",
"our",
"coverFishResultCollection"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/CoverFishScanner.php#L138-L164 |
steeffeen/FancyManiaLinks | FML/Script/Features/ToggleInterface.php | ToggleInterface.setKeyCode | public function setKeyCode($keyCode)
{
$this->keyCode = (int)$keyCode;
$this->keyName = null;
return $this;
} | php | public function setKeyCode($keyCode)
{
$this->keyCode = (int)$keyCode;
$this->keyName = null;
return $this;
} | [
"public",
"function",
"setKeyCode",
"(",
"$",
"keyCode",
")",
"{",
"$",
"this",
"->",
"keyCode",
"=",
"(",
"int",
")",
"$",
"keyCode",
";",
"$",
"this",
"->",
"keyName",
"=",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Set the key code
@api
@param int $keyCode Key code
@return static | [
"Set",
"the",
"key",
"code"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ToggleInterface.php#L200-L205 |
steeffeen/FancyManiaLinks | FML/Script/Features/ToggleInterface.php | ToggleInterface.getOnInitScriptText | protected function getOnInitScriptText()
{
$scriptText = null;
if ($this->control) {
$controlId = Builder::escapeText($this->control->getId());
$scriptText = "declare ToggleInterfaceControl <=> Page.GetFirstChild({$controlId});";
} else {
$scriptText = "d... | php | protected function getOnInitScriptText()
{
$scriptText = null;
if ($this->control) {
$controlId = Builder::escapeText($this->control->getId());
$scriptText = "declare ToggleInterfaceControl <=> Page.GetFirstChild({$controlId});";
} else {
$scriptText = "d... | [
"protected",
"function",
"getOnInitScriptText",
"(",
")",
"{",
"$",
"scriptText",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"control",
")",
"{",
"$",
"controlId",
"=",
"Builder",
"::",
"escapeText",
"(",
"$",
"this",
"->",
"control",
"->",
"getId",... | Get the on init script text
@return string | [
"Get",
"the",
"on",
"init",
"script",
"text"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ToggleInterface.php#L248-L262 |
steeffeen/FancyManiaLinks | FML/Script/Features/ToggleInterface.php | ToggleInterface.getKeyPressScriptText | protected function getKeyPressScriptText()
{
$scriptText = null;
$keyProperty = null;
$keyValue = null;
if ($this->keyName) {
$keyProperty = "KeyName";
$keyValue = Builder::getText($this->keyName);
} else if ($this->keyCode) {
$keyPr... | php | protected function getKeyPressScriptText()
{
$scriptText = null;
$keyProperty = null;
$keyValue = null;
if ($this->keyName) {
$keyProperty = "KeyName";
$keyValue = Builder::getText($this->keyName);
} else if ($this->keyCode) {
$keyPr... | [
"protected",
"function",
"getKeyPressScriptText",
"(",
")",
"{",
"$",
"scriptText",
"=",
"null",
";",
"$",
"keyProperty",
"=",
"null",
";",
"$",
"keyValue",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"keyName",
")",
"{",
"$",
"keyProperty",
"=",
"... | Get the key press script text
@return string | [
"Get",
"the",
"key",
"press",
"script",
"text"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/ToggleInterface.php#L269-L303 |
ClanCats/Core | src/classes/CCEvent.php | CCEvent.clear | public static function clear( $event, $what = null ) {
if ( is_null( $what ) ) {
unset( static::$events[$event] ); return;
}
if ( array_key_exists( $what, static::$events[$event][$what] ) ) {
unset( static::$events[$event][$what] );
}
} | php | public static function clear( $event, $what = null ) {
if ( is_null( $what ) ) {
unset( static::$events[$event] ); return;
}
if ( array_key_exists( $what, static::$events[$event][$what] ) ) {
unset( static::$events[$event][$what] );
}
} | [
"public",
"static",
"function",
"clear",
"(",
"$",
"event",
",",
"$",
"what",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"what",
")",
")",
"{",
"unset",
"(",
"static",
"::",
"$",
"events",
"[",
"$",
"event",
"]",
")",
";",
"return",
... | clear an event
@param string $event
@param mixed $callback
@return void | [
"clear",
"an",
"event"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCEvent.php#L58-L66 |
ClanCats/Core | src/classes/CCEvent.php | CCEvent.ready | public static function ready( $event, $params = array() ) {
$responses = static::fire( $event, $params );
foreach( static::pack( $responses ) as $response ) {
if ( $response !== true ) {
return false;
}
}
return true;
} | php | public static function ready( $event, $params = array() ) {
$responses = static::fire( $event, $params );
foreach( static::pack( $responses ) as $response ) {
if ( $response !== true ) {
return false;
}
}
return true;
} | [
"public",
"static",
"function",
"ready",
"(",
"$",
"event",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"responses",
"=",
"static",
"::",
"fire",
"(",
"$",
"event",
",",
"$",
"params",
")",
";",
"foreach",
"(",
"static",
"::",
"pack"... | also fires an event but returns a bool positiv
only if all responses where positiv, like all system ready YESS!
@param string $event
@param array $params
@return array | [
"also",
"fires",
"an",
"event",
"but",
"returns",
"a",
"bool",
"positiv",
"only",
"if",
"all",
"responses",
"where",
"positiv",
"like",
"all",
"system",
"ready",
"YESS!"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCEvent.php#L76-L86 |
ClanCats/Core | src/classes/CCEvent.php | CCEvent.fire | public static function fire( $event, $params = array() ) {
if ( !array_key_exists( $event, static::$events ) ) {
return;
}
$event = static::$events[$event];
$return = array();
if ( array_key_exists( 'before', $event ) ) {
$return['before'] = static::call( $event['before'], $params );
}
i... | php | public static function fire( $event, $params = array() ) {
if ( !array_key_exists( $event, static::$events ) ) {
return;
}
$event = static::$events[$event];
$return = array();
if ( array_key_exists( 'before', $event ) ) {
$return['before'] = static::call( $event['before'], $params );
}
i... | [
"public",
"static",
"function",
"fire",
"(",
"$",
"event",
",",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"event",
",",
"static",
"::",
"$",
"events",
")",
")",
"{",
"return",
";",
"}",
"$",
"e... | fire an event
@param string $event
@param array $params
@return array | [
"fire",
"an",
"event"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCEvent.php#L95-L117 |
ClanCats/Core | src/classes/CCEvent.php | CCEvent.pass | public static function pass( $event, $param = null ) {
if ( !array_key_exists( $event, static::$events ) ) {
return $param;
}
$event = static::$events[$event];
if ( array_key_exists( 'before', $event ) ) {
$param = static::call( $event['before'], $param, true );
}
if ( array_key_exists( 'c... | php | public static function pass( $event, $param = null ) {
if ( !array_key_exists( $event, static::$events ) ) {
return $param;
}
$event = static::$events[$event];
if ( array_key_exists( 'before', $event ) ) {
$param = static::call( $event['before'], $param, true );
}
if ( array_key_exists( 'c... | [
"public",
"static",
"function",
"pass",
"(",
"$",
"event",
",",
"$",
"param",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"event",
",",
"static",
"::",
"$",
"events",
")",
")",
"{",
"return",
"$",
"param",
";",
"}",
"$",
... | pass an var to an event
the diffrence to fire is that the param gets modified by each event
@param string $event
@param mixed $param
@return mixed | [
"pass",
"an",
"var",
"to",
"an",
"event",
"the",
"diffrence",
"to",
"fire",
"is",
"that",
"the",
"param",
"gets",
"modified",
"by",
"each",
"event"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCEvent.php#L127-L148 |
ClanCats/Core | src/classes/CCEvent.php | CCEvent.call | protected static function call( $callbacks, $params, $pass = false ) {
$response = array();
if ( $pass ) {
$response = $params;
}
foreach ( $callbacks as $callback ) {
if ( $pass ) {
$response = call_user_func_array( $callback, array( $response ) );
}
else {
$response[] = call_user_... | php | protected static function call( $callbacks, $params, $pass = false ) {
$response = array();
if ( $pass ) {
$response = $params;
}
foreach ( $callbacks as $callback ) {
if ( $pass ) {
$response = call_user_func_array( $callback, array( $response ) );
}
else {
$response[] = call_user_... | [
"protected",
"static",
"function",
"call",
"(",
"$",
"callbacks",
",",
"$",
"params",
",",
"$",
"pass",
"=",
"false",
")",
"{",
"$",
"response",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"pass",
")",
"{",
"$",
"response",
"=",
"$",
"params",
"... | call an callback array
@param array $callbacks
@param array $params
@param bool $pass
@retrun array | [
"call",
"an",
"callback",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCEvent.php#L158-L176 |
ClanCats/Core | src/classes/CCEvent.php | CCEvent.pack | protected static function pack( $responses ) {
return array_merge( CCArr::get( 'before', $responses, array() ), CCArr::get( 'main', $responses, array() ), CCArr::get( 'after', $responses, array() ) );
} | php | protected static function pack( $responses ) {
return array_merge( CCArr::get( 'before', $responses, array() ), CCArr::get( 'main', $responses, array() ), CCArr::get( 'after', $responses, array() ) );
} | [
"protected",
"static",
"function",
"pack",
"(",
"$",
"responses",
")",
"{",
"return",
"array_merge",
"(",
"CCArr",
"::",
"get",
"(",
"'before'",
",",
"$",
"responses",
",",
"array",
"(",
")",
")",
",",
"CCArr",
"::",
"get",
"(",
"'main'",
",",
"$",
"... | packs all responses into one array
@param array $responses
@return array | [
"packs",
"all",
"responses",
"into",
"one",
"array"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCEvent.php#L184-L186 |
titon/db | src/Titon/Db/Behavior/TimestampBehavior.php | TimestampBehavior.preSave | public function preSave(Event $event, Query $query, $id, array &$data) {
$data[$this->getConfig($query->getType() === Query::UPDATE ? 'updateField' : 'createField')] = time();
return true;
} | php | public function preSave(Event $event, Query $query, $id, array &$data) {
$data[$this->getConfig($query->getType() === Query::UPDATE ? 'updateField' : 'createField')] = time();
return true;
} | [
"public",
"function",
"preSave",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"id",
",",
"array",
"&",
"$",
"data",
")",
"{",
"$",
"data",
"[",
"$",
"this",
"->",
"getConfig",
"(",
"$",
"query",
"->",
"getType",
"(",
")",
"==... | Append the current timestamp to the data.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param int|int[] $id
@param array $data
@return bool | [
"Append",
"the",
"current",
"timestamp",
"to",
"the",
"data",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/TimestampBehavior.php#L42-L46 |
thienhungho/yii2-order-management | src/modules/OrderBase/Order.php | Order.beforeSave | public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if (!$this->isNewRecord) {
$this->total_price = \thienhungho\OrderManagement\models\OrderItem::find()
->where(['order' => $this->id])
->sum('total_price');
... | php | public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
if (!$this->isNewRecord) {
$this->total_price = \thienhungho\OrderManagement\models\OrderItem::find()
->where(['order' => $this->id])
->sum('total_price');
... | [
"public",
"function",
"beforeSave",
"(",
"$",
"insert",
")",
"{",
"if",
"(",
"parent",
"::",
"beforeSave",
"(",
"$",
"insert",
")",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isNewRecord",
")",
"{",
"$",
"this",
"->",
"total_price",
"=",
"\\",
"... | @param bool $insert
@return bool
@throws \yii\base\Exception
@throws \yii\base\InvalidConfigException | [
"@param",
"bool",
"$insert"
] | train | https://github.com/thienhungho/yii2-order-management/blob/f263f0b2168d6f5e99cee2e20a5878d09d4e81c0/src/modules/OrderBase/Order.php#L65-L84 |
site4y/grid | Grid.php | Grid.header | public function header()
{
$head = '';
if ($this->options['rownum']) {
$rownumTh = Html::el('th', ['style' => 'width:1px']);
if (isset($this->options['rownum']['header']['rowspan'])) {
$rownumTh->rowspan($this->options['rownum']['header']['rowspan']);
... | php | public function header()
{
$head = '';
if ($this->options['rownum']) {
$rownumTh = Html::el('th', ['style' => 'width:1px']);
if (isset($this->options['rownum']['header']['rowspan'])) {
$rownumTh->rowspan($this->options['rownum']['header']['rowspan']);
... | [
"public",
"function",
"header",
"(",
")",
"{",
"$",
"head",
"=",
"''",
";",
"if",
"(",
"$",
"this",
"->",
"options",
"[",
"'rownum'",
"]",
")",
"{",
"$",
"rownumTh",
"=",
"Html",
"::",
"el",
"(",
"'th'",
",",
"[",
"'style'",
"=>",
"'width:1px'",
... | Возвращает HTML для вывода заголовка таблицы
@return string | [
"Возвращает",
"HTML",
"для",
"вывода",
"заголовка",
"таблицы"
] | train | https://github.com/site4y/grid/blob/9b2c9a9becab1d556d85ce818df228020280726c/Grid.php#L306-L374 |
site4y/grid | Grid.php | Grid._prepareCol | protected function _prepareCol($colId) {
if (isset($this->columns[$colId]['td'])) return;
$col = &$this->columns[$colId];
$colClass = str_replace(',','',$colId);
$className = 's4y-grid-'.$this->_id.'-col-'.$colClass;
$th = Html::el('th', ['class' => $className]);
$td = H... | php | protected function _prepareCol($colId) {
if (isset($this->columns[$colId]['td'])) return;
$col = &$this->columns[$colId];
$colClass = str_replace(',','',$colId);
$className = 's4y-grid-'.$this->_id.'-col-'.$colClass;
$th = Html::el('th', ['class' => $className]);
$td = H... | [
"protected",
"function",
"_prepareCol",
"(",
"$",
"colId",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"columns",
"[",
"$",
"colId",
"]",
"[",
"'td'",
"]",
")",
")",
"return",
";",
"$",
"col",
"=",
"&",
"$",
"this",
"->",
"columns",
"["... | Выполняет подготовку шаблона вывода ячейки и заголовка колонки
@param $colId | [
"Выполняет",
"подготовку",
"шаблона",
"вывода",
"ячейки",
"и",
"заголовка",
"колонки"
] | train | https://github.com/site4y/grid/blob/9b2c9a9becab1d556d85ce818df228020280726c/Grid.php#L534-L582 |
andrelohmann/silverstripe-geolocation | code/models/fieldtypes/Location.php | Location.getSQLFilter | public function getSQLFilter($radius, $scale = 'km'){
// set Latitude and Longditude Columnnames
GeoFunctions::$Latitude = $this->name.'Latitude';
GeoFunctions::$Longditude = $this->name.'Longditude';
return GeoFunctions::getSQLSquare($this->getLatitude(), $this->getLongditude(), $radius, $scale);
} | php | public function getSQLFilter($radius, $scale = 'km'){
// set Latitude and Longditude Columnnames
GeoFunctions::$Latitude = $this->name.'Latitude';
GeoFunctions::$Longditude = $this->name.'Longditude';
return GeoFunctions::getSQLSquare($this->getLatitude(), $this->getLongditude(), $radius, $scale);
} | [
"public",
"function",
"getSQLFilter",
"(",
"$",
"radius",
",",
"$",
"scale",
"=",
"'km'",
")",
"{",
"// set Latitude and Longditude Columnnames",
"GeoFunctions",
"::",
"$",
"Latitude",
"=",
"$",
"this",
"->",
"name",
".",
"'Latitude'",
";",
"GeoFunctions",
"::",... | return a SQL Bounce for WHERE Clause | [
"return",
"a",
"SQL",
"Bounce",
"for",
"WHERE",
"Clause"
] | train | https://github.com/andrelohmann/silverstripe-geolocation/blob/124062008d8fa25b631bf5bb69b2ca79b53ef81b/code/models/fieldtypes/Location.php#L194-L200 |
andrelohmann/silverstripe-geolocation | code/models/fieldtypes/Location.php | Location.getDistance | public function getDistance($lat, $lng, $scale = 'km'){
return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $lat, $long, $scale);
} | php | public function getDistance($lat, $lng, $scale = 'km'){
return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $lat, $long, $scale);
} | [
"public",
"function",
"getDistance",
"(",
"$",
"lat",
",",
"$",
"lng",
",",
"$",
"scale",
"=",
"'km'",
")",
"{",
"return",
"GeoFunctions",
"::",
"getDistance",
"(",
"$",
"this",
"->",
"getLatitude",
"(",
")",
",",
"$",
"this",
"->",
"getLongditude",
"(... | return the Distance to the given lat/lng | [
"return",
"the",
"Distance",
"to",
"the",
"given",
"lat",
"/",
"lng"
] | train | https://github.com/andrelohmann/silverstripe-geolocation/blob/124062008d8fa25b631bf5bb69b2ca79b53ef81b/code/models/fieldtypes/Location.php#L213-L215 |
andrelohmann/silverstripe-geolocation | code/models/fieldtypes/Location.php | Location.getDistanceFromLocation | public function getDistanceFromLocation(Location $location, $scale = 'km'){
return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $location->getLatitude(), $location->getLongditude(), $scale);
} | php | public function getDistanceFromLocation(Location $location, $scale = 'km'){
return GeoFunctions::getDistance($this->getLatitude(), $this->getLongditude(), $location->getLatitude(), $location->getLongditude(), $scale);
} | [
"public",
"function",
"getDistanceFromLocation",
"(",
"Location",
"$",
"location",
",",
"$",
"scale",
"=",
"'km'",
")",
"{",
"return",
"GeoFunctions",
"::",
"getDistance",
"(",
"$",
"this",
"->",
"getLatitude",
"(",
")",
",",
"$",
"this",
"->",
"getLongditud... | return the Distance to the given location | [
"return",
"the",
"Distance",
"to",
"the",
"given",
"location"
] | train | https://github.com/andrelohmann/silverstripe-geolocation/blob/124062008d8fa25b631bf5bb69b2ca79b53ef81b/code/models/fieldtypes/Location.php#L220-L222 |
ClanCats/Core | src/classes/CCContainer.php | CCContainer.is_callable | public static function is_callable( $key )
{
if ( is_callable( $key ) )
{
return true;
}
if ( array_key_exists( $key, static::$_container ) )
{
return true;
}
return false;
} | php | public static function is_callable( $key )
{
if ( is_callable( $key ) )
{
return true;
}
if ( array_key_exists( $key, static::$_container ) )
{
return true;
}
return false;
} | [
"public",
"static",
"function",
"is_callable",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"is_callable",
"(",
"$",
"key",
")",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"array_key_exists",
"(",
"$",
"key",
",",
"static",
"::",
"$",
"_container",
")... | Is this callable
@param string $key
@return bool | [
"Is",
"this",
"callable"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCContainer.php#L49-L62 |
ClanCats/Core | src/classes/CCContainer.php | CCContainer.call | public static function call()
{
$arguments = func_get_args();
// get the key
$key = array_shift( $arguments );
// container call
if ( is_string( $key ) && array_key_exists( $key, static::$_container ) && is_callable( static::$_container[$key] ) )
{
return call_user_func_array( static::$_container[$key... | php | public static function call()
{
$arguments = func_get_args();
// get the key
$key = array_shift( $arguments );
// container call
if ( is_string( $key ) && array_key_exists( $key, static::$_container ) && is_callable( static::$_container[$key] ) )
{
return call_user_func_array( static::$_container[$key... | [
"public",
"static",
"function",
"call",
"(",
")",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"// get the key",
"$",
"key",
"=",
"array_shift",
"(",
"$",
"arguments",
")",
";",
"// container call",
"if",
"(",
"is_string",
"(",
"$",
"key",
... | call a container
@param string $key
@param mixed $callback
@return void | [
"call",
"a",
"container"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCContainer.php#L71-L91 |
phrest/sdk | src/Generator/SDK/SDKGenerator.php | SDKGenerator.create | public function create()
{
$uses = [
'Phrest\API\DI\PhrestDIInterface',
'Phrest\SDK\PhrestSDK',
'Phrest\SDK\Request\AbstractRequest',
$this->namespace . '\\' . Generator::$name . 'API'
];
foreach($this->requests as $request)
{
$uses[] = $request->getNamespace() . '\\' . ... | php | public function create()
{
$uses = [
'Phrest\API\DI\PhrestDIInterface',
'Phrest\SDK\PhrestSDK',
'Phrest\SDK\Request\AbstractRequest',
$this->namespace . '\\' . Generator::$name . 'API'
];
foreach($this->requests as $request)
{
$uses[] = $request->getNamespace() . '\\' . ... | [
"public",
"function",
"create",
"(",
")",
"{",
"$",
"uses",
"=",
"[",
"'Phrest\\API\\DI\\PhrestDIInterface'",
",",
"'Phrest\\SDK\\PhrestSDK'",
",",
"'Phrest\\SDK\\Request\\AbstractRequest'",
",",
"$",
"this",
"->",
"namespace",
".",
"'\\\\'",
".",
"Generator",
"::",
... | Process and create code/files | [
"Process",
"and",
"create",
"code",
"/",
"files"
] | train | https://github.com/phrest/sdk/blob/e9f2812ad517b07ca4d284512b530f615305eb47/src/Generator/SDK/SDKGenerator.php#L44-L94 |
maniaplanet/matchmaking-lobby | MatchMakingLobby/Lobby/MatchMakers/AbstractDistance.php | AbstractDistance.buildGraph | protected function buildGraph(&$graph, $distanceComputeCallback, array $objects)
{
$graph = new Helpers\Graph();
while($object = array_shift($objects))
{
$graph->addNode(
$object,
$this->computeDistances($object, $objects, $distanceComputeCallback)
);
}
} | php | protected function buildGraph(&$graph, $distanceComputeCallback, array $objects)
{
$graph = new Helpers\Graph();
while($object = array_shift($objects))
{
$graph->addNode(
$object,
$this->computeDistances($object, $objects, $distanceComputeCallback)
);
}
} | [
"protected",
"function",
"buildGraph",
"(",
"&",
"$",
"graph",
",",
"$",
"distanceComputeCallback",
",",
"array",
"$",
"objects",
")",
"{",
"$",
"graph",
"=",
"new",
"Helpers",
"\\",
"Graph",
"(",
")",
";",
"while",
"(",
"$",
"object",
"=",
"array_shift"... | Create a graph where each ready player is a node
@param DistanciableObject[] $bannedPlayers
@return type | [
"Create",
"a",
"graph",
"where",
"each",
"ready",
"player",
"is",
"a",
"node"
] | train | https://github.com/maniaplanet/matchmaking-lobby/blob/384f22cdd2cfb0204a071810549eaf1eb01d8b7f/MatchMakingLobby/Lobby/MatchMakers/AbstractDistance.php#L188-L199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.