id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
24,000 | gedex/php-janrain-api | lib/Janrain/Api/Partner/App.php | App.create | public function create(array $params)
{
if (!isset($params['email'])) {
throw new MissingArgumentException('email');
}
if (!isset($params['name'])) {
throw new MissingArgumentException('name');
}
if (!isset($params['domain'])) {
throw new MissingArgumentException('domain');
}
return $this->po... | php | public function create(array $params)
{
if (!isset($params['email'])) {
throw new MissingArgumentException('email');
}
if (!isset($params['name'])) {
throw new MissingArgumentException('name');
}
if (!isset($params['domain'])) {
throw new MissingArgumentException('domain');
}
return $this->po... | [
"public",
"function",
"create",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'email'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'email'",
")",
";",
"}",
"if",
"(",
"!",
"isset"... | Creates a new Engage application.
@param array $params
@link http://developers.janrain.com/documentation/api-methods/partner/app/create/ | [
"Creates",
"a",
"new",
"Engage",
"application",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Partner/App.php#L47-L62 |
24,001 | gedex/php-janrain-api | lib/Janrain/Api/Partner/App.php | App.verifyDomain | public function verifyDomain(array $params)
{
if (!isset($params['provider'])) {
throw new MissingArgumentException('provider');
}
if (!isset($params['code'])) {
throw new MissingArgumentException('code');
}
if (!isset($params['filename'])) {
throw new MissingArgumentException('filename');
}
... | php | public function verifyDomain(array $params)
{
if (!isset($params['provider'])) {
throw new MissingArgumentException('provider');
}
if (!isset($params['code'])) {
throw new MissingArgumentException('code');
}
if (!isset($params['filename'])) {
throw new MissingArgumentException('filename');
}
... | [
"public",
"function",
"verifyDomain",
"(",
"array",
"$",
"params",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"params",
"[",
"'provider'",
"]",
")",
")",
"{",
"throw",
"new",
"MissingArgumentException",
"(",
"'provider'",
")",
";",
"}",
"if",
"(",
"!... | Automates the server-side component of the provider-specific domain
verification mechanism.
@param array $params | [
"Automates",
"the",
"server",
"-",
"side",
"component",
"of",
"the",
"provider",
"-",
"specific",
"domain",
"verification",
"mechanism",
"."
] | 6283f68454e0ad5211ac620f1d337df38cd49597 | https://github.com/gedex/php-janrain-api/blob/6283f68454e0ad5211ac620f1d337df38cd49597/lib/Janrain/Api/Partner/App.php#L184-L199 |
24,002 | ezsystems/ezcomments-ls-extension | classes/ezcomcookiemanager.php | ezcomCookieManager.storeCookie | public function storeCookie( $comment = null )
{
$userData = array();
$sessionID = session_id();
$currentUser = eZUser::currentUser();
if( is_null( $comment ) )
{
if( $currentUser->isAnonymous() )
{
return '';
}
... | php | public function storeCookie( $comment = null )
{
$userData = array();
$sessionID = session_id();
$currentUser = eZUser::currentUser();
if( is_null( $comment ) )
{
if( $currentUser->isAnonymous() )
{
return '';
}
... | [
"public",
"function",
"storeCookie",
"(",
"$",
"comment",
"=",
"null",
")",
"{",
"$",
"userData",
"=",
"array",
"(",
")",
";",
"$",
"sessionID",
"=",
"session_id",
"(",
")",
";",
"$",
"currentUser",
"=",
"eZUser",
"::",
"currentUser",
"(",
")",
";",
... | store data into cookie
if field is null, set cookie based on user data, other wise set cookie based on fields
@param $comment comment object
@return arrary stored data | [
"store",
"data",
"into",
"cookie",
"if",
"field",
"is",
"null",
"set",
"cookie",
"based",
"on",
"user",
"data",
"other",
"wise",
"set",
"cookie",
"based",
"on",
"fields"
] | 2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5 | https://github.com/ezsystems/ezcomments-ls-extension/blob/2b4cd8c34d4a77813e4d6a9c5a0d317a274c63c5/classes/ezcomcookiemanager.php#L33-L62 |
24,003 | Speicher210/monsum-api | src/Service/Customer/CustomerService.php | CustomerService.getCustomers | public function getCustomers(Get\RequestData $requestData = null)
{
$request = new Get\Request($requestData);
$apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
/** @var Get\Response $response */
$response = $apiResponse->getResponse();
foreach ($response-... | php | public function getCustomers(Get\RequestData $requestData = null)
{
$request = new Get\Request($requestData);
$apiResponse = $this->sendRequest($request, Get\ApiResponse::class);
/** @var Get\Response $response */
$response = $apiResponse->getResponse();
foreach ($response-... | [
"public",
"function",
"getCustomers",
"(",
"Get",
"\\",
"RequestData",
"$",
"requestData",
"=",
"null",
")",
"{",
"$",
"request",
"=",
"new",
"Get",
"\\",
"Request",
"(",
"$",
"requestData",
")",
";",
"$",
"apiResponse",
"=",
"$",
"this",
"->",
"sendRequ... | Get the customers.
@param Get\RequestData|null $requestData The request data.
@return Get\ApiResponse | [
"Get",
"the",
"customers",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Customer/CustomerService.php#L19-L34 |
24,004 | Speicher210/monsum-api | src/Service/Customer/CustomerService.php | CustomerService.getCustomer | public function getCustomer($customerId)
{
$requestData = new Get\RequestData();
$requestData->setCustomerId($customerId);
$customers = $this->getCustomers($requestData)->getResponse()->getCustomers();
return isset($customers[0]) ? $customers[0] : null;
} | php | public function getCustomer($customerId)
{
$requestData = new Get\RequestData();
$requestData->setCustomerId($customerId);
$customers = $this->getCustomers($requestData)->getResponse()->getCustomers();
return isset($customers[0]) ? $customers[0] : null;
} | [
"public",
"function",
"getCustomer",
"(",
"$",
"customerId",
")",
"{",
"$",
"requestData",
"=",
"new",
"Get",
"\\",
"RequestData",
"(",
")",
";",
"$",
"requestData",
"->",
"setCustomerId",
"(",
"$",
"customerId",
")",
";",
"$",
"customers",
"=",
"$",
"th... | Get one customer by ID.
@param integer $customerId The customer ID.
@return Customer|null | [
"Get",
"one",
"customer",
"by",
"ID",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Customer/CustomerService.php#L42-L50 |
24,005 | Speicher210/monsum-api | src/Service/Customer/CustomerService.php | CustomerService.getCustomerByExternalUid | public function getCustomerByExternalUid($customerExternalUid)
{
$requestData = new Get\RequestData();
$requestData->setCustomerExternalUid($customerExternalUid);
$customers = $this->getCustomers($requestData)->getResponse()->getCustomers();
return isset($customers[0]) ? $customers... | php | public function getCustomerByExternalUid($customerExternalUid)
{
$requestData = new Get\RequestData();
$requestData->setCustomerExternalUid($customerExternalUid);
$customers = $this->getCustomers($requestData)->getResponse()->getCustomers();
return isset($customers[0]) ? $customers... | [
"public",
"function",
"getCustomerByExternalUid",
"(",
"$",
"customerExternalUid",
")",
"{",
"$",
"requestData",
"=",
"new",
"Get",
"\\",
"RequestData",
"(",
")",
";",
"$",
"requestData",
"->",
"setCustomerExternalUid",
"(",
"$",
"customerExternalUid",
")",
";",
... | Get once customer by the external ID.
@param string $customerExternalUid The external customer ID.
@return Customer|null | [
"Get",
"once",
"customer",
"by",
"the",
"external",
"ID",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Customer/CustomerService.php#L58-L66 |
24,006 | Speicher210/monsum-api | src/Service/Customer/CustomerService.php | CustomerService.deleteCustomer | public function deleteCustomer($customerId)
{
$requestData = new Delete\RequestData($customerId);
$request = new Delete\Request($requestData);
return $this->sendRequest($request, Delete\ApiResponse::class);
} | php | public function deleteCustomer($customerId)
{
$requestData = new Delete\RequestData($customerId);
$request = new Delete\Request($requestData);
return $this->sendRequest($request, Delete\ApiResponse::class);
} | [
"public",
"function",
"deleteCustomer",
"(",
"$",
"customerId",
")",
"{",
"$",
"requestData",
"=",
"new",
"Delete",
"\\",
"RequestData",
"(",
"$",
"customerId",
")",
";",
"$",
"request",
"=",
"new",
"Delete",
"\\",
"Request",
"(",
"$",
"requestData",
")",
... | Delete a customer.
@param integer $customerId The customer ID to delete.
@return Delete\ApiResponse | [
"Delete",
"a",
"customer",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Customer/CustomerService.php#L100-L106 |
24,007 | Speicher210/monsum-api | src/Service/Customer/CustomerService.php | CustomerService.addCredits | public function addCredits($customerId, $amount)
{
$requestData = new AddCredits\RequestData($customerId, $amount);
$request = new AddCredits\Request($requestData);
return $this->sendRequest($request, AddCredits\ApiResponse::class);
} | php | public function addCredits($customerId, $amount)
{
$requestData = new AddCredits\RequestData($customerId, $amount);
$request = new AddCredits\Request($requestData);
return $this->sendRequest($request, AddCredits\ApiResponse::class);
} | [
"public",
"function",
"addCredits",
"(",
"$",
"customerId",
",",
"$",
"amount",
")",
"{",
"$",
"requestData",
"=",
"new",
"AddCredits",
"\\",
"RequestData",
"(",
"$",
"customerId",
",",
"$",
"amount",
")",
";",
"$",
"request",
"=",
"new",
"AddCredits",
"... | Add credits to a customer.
@param integer $customerId The customer ID.
@param float $amount The amount of credit to add.
@return AddCredits\ApiResponse | [
"Add",
"credits",
"to",
"a",
"customer",
"."
] | 4611a048097de5d2b0efe9d4426779c783c0af4d | https://github.com/Speicher210/monsum-api/blob/4611a048097de5d2b0efe9d4426779c783c0af4d/src/Service/Customer/CustomerService.php#L115-L121 |
24,008 | mothership-ec/composer | src/Composer/Package/Archiver/BaseExcludeFilter.php | BaseExcludeFilter.parseLines | protected function parseLines(array $lines, $lineParser)
{
return array_filter(
array_map(
function ($line) use ($lineParser) {
$line = trim($line);
if (!$line || 0 === strpos($line, '#')) {
return;
... | php | protected function parseLines(array $lines, $lineParser)
{
return array_filter(
array_map(
function ($line) use ($lineParser) {
$line = trim($line);
if (!$line || 0 === strpos($line, '#')) {
return;
... | [
"protected",
"function",
"parseLines",
"(",
"array",
"$",
"lines",
",",
"$",
"lineParser",
")",
"{",
"return",
"array_filter",
"(",
"array_map",
"(",
"function",
"(",
"$",
"line",
")",
"use",
"(",
"$",
"lineParser",
")",
"{",
"$",
"line",
"=",
"trim",
... | Processes a file containing exclude rules of different formats per line
@param array $lines A set of lines to be parsed
@param callback $lineParser The parser to be used on each line
@return array Exclude patterns to be used in filter() | [
"Processes",
"a",
"file",
"containing",
"exclude",
"rules",
"of",
"different",
"formats",
"per",
"line"
] | fa6ad031a939d8d33b211e428fdbdd28cfce238c | https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Package/Archiver/BaseExcludeFilter.php#L78-L97 |
24,009 | mikelgoig/nova-spotify-auth-tool | src/Http/Controllers/SpotifyAuthToolController.php | SpotifyAuthToolController.auth | public function auth()
{
$spotify = app()
->make('SpotifyWrapper', [
'callback' => '/nova-vendor/nova-spotify-auth-tool/auth',
'scope' => [],
'show_dialog' => true,
])
->requestAccessToken();
$spotify->api->setAcces... | php | public function auth()
{
$spotify = app()
->make('SpotifyWrapper', [
'callback' => '/nova-vendor/nova-spotify-auth-tool/auth',
'scope' => [],
'show_dialog' => true,
])
->requestAccessToken();
$spotify->api->setAcces... | [
"public",
"function",
"auth",
"(",
")",
"{",
"$",
"spotify",
"=",
"app",
"(",
")",
"->",
"make",
"(",
"'SpotifyWrapper'",
",",
"[",
"'callback'",
"=>",
"'/nova-vendor/nova-spotify-auth-tool/auth'",
",",
"'scope'",
"=>",
"[",
"]",
",",
"'show_dialog'",
"=>",
... | Spotify authentication.
@return mixed | [
"Spotify",
"authentication",
"."
] | a5351c386206c45f77fe6ae833cdac51f2a030f4 | https://github.com/mikelgoig/nova-spotify-auth-tool/blob/a5351c386206c45f77fe6ae833cdac51f2a030f4/src/Http/Controllers/SpotifyAuthToolController.php#L21-L44 |
24,010 | webdevvie/pheanstalk-task-queue-bundle | Command/Tender/ChildProcessContainer.php | ChildProcessContainer.checkHealth | public function checkHealth()
{
if (!$this->process->isRunning()) {
if ($this->status == self::STATUS_CLEANINGUP || $this->status == self::STATUS_CLEANEDUP) {
//okay so we're ready to stop!
$this->status = self::STATUS_DEAD;
return true;
... | php | public function checkHealth()
{
if (!$this->process->isRunning()) {
if ($this->status == self::STATUS_CLEANINGUP || $this->status == self::STATUS_CLEANEDUP) {
//okay so we're ready to stop!
$this->status = self::STATUS_DEAD;
return true;
... | [
"public",
"function",
"checkHealth",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"process",
"->",
"isRunning",
"(",
")",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"status",
"==",
"self",
"::",
"STATUS_CLEANINGUP",
"||",
"$",
"this",
"->",
"status... | Checks the health of this child and returns true if healthy otherwise marks it for cleanup
@return boolean | [
"Checks",
"the",
"health",
"of",
"this",
"child",
"and",
"returns",
"true",
"if",
"healthy",
"otherwise",
"marks",
"it",
"for",
"cleanup"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/Tender/ChildProcessContainer.php#L138-L156 |
24,011 | webdevvie/pheanstalk-task-queue-bundle | Command/Tender/ChildProcessContainer.php | ChildProcessContainer.cleanUp | public function cleanUp()
{
$this->status = self::STATUS_CLEANINGUP;
if ($this->process->isRunning()) {
$this->sendTERMSignal();
} else {
$this->status = self::STATUS_CLEANEDUP;
}
} | php | public function cleanUp()
{
$this->status = self::STATUS_CLEANINGUP;
if ($this->process->isRunning()) {
$this->sendTERMSignal();
} else {
$this->status = self::STATUS_CLEANEDUP;
}
} | [
"public",
"function",
"cleanUp",
"(",
")",
"{",
"$",
"this",
"->",
"status",
"=",
"self",
"::",
"STATUS_CLEANINGUP",
";",
"if",
"(",
"$",
"this",
"->",
"process",
"->",
"isRunning",
"(",
")",
")",
"{",
"$",
"this",
"->",
"sendTERMSignal",
"(",
")",
"... | Cleans up a process
@return void | [
"Cleans",
"up",
"a",
"process"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/Tender/ChildProcessContainer.php#L173-L182 |
24,012 | webdevvie/pheanstalk-task-queue-bundle | Command/Tender/ChildProcessContainer.php | ChildProcessContainer.processOutput | public function processOutput($childName)
{
$output = $this->outputBuffer . $this->process->getIncrementalOutput();
$errorOutput = $this->errorOutputBuffer . $this->process->getIncrementalErrorOutput();
$outputLines = explode("\n", $output);
$errorOutputLines = explode("\n", $errorOu... | php | public function processOutput($childName)
{
$output = $this->outputBuffer . $this->process->getIncrementalOutput();
$errorOutput = $this->errorOutputBuffer . $this->process->getIncrementalErrorOutput();
$outputLines = explode("\n", $output);
$errorOutputLines = explode("\n", $errorOu... | [
"public",
"function",
"processOutput",
"(",
"$",
"childName",
")",
"{",
"$",
"output",
"=",
"$",
"this",
"->",
"outputBuffer",
".",
"$",
"this",
"->",
"process",
"->",
"getIncrementalOutput",
"(",
")",
";",
"$",
"errorOutput",
"=",
"$",
"this",
"->",
"er... | Looks into and processes the child's output
@param string $childName
@return void | [
"Looks",
"into",
"and",
"processes",
"the",
"child",
"s",
"output"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/Tender/ChildProcessContainer.php#L211-L243 |
24,013 | webdevvie/pheanstalk-task-queue-bundle | Command/Tender/ChildProcessContainer.php | ChildProcessContainer.start | public function start()
{
$cmd = 'app/console ' . $this->workerCommand;
if ($this->tube != '') {
$cmd .= ' --use-tube=' . escapeshellarg($this->tube);
}
if ($this->parent->isVerbose()) {
$cmd .= ' -vvvv';
}
$this->startTime = time();
$t... | php | public function start()
{
$cmd = 'app/console ' . $this->workerCommand;
if ($this->tube != '') {
$cmd .= ' --use-tube=' . escapeshellarg($this->tube);
}
if ($this->parent->isVerbose()) {
$cmd .= ' -vvvv';
}
$this->startTime = time();
$t... | [
"public",
"function",
"start",
"(",
")",
"{",
"$",
"cmd",
"=",
"'app/console '",
".",
"$",
"this",
"->",
"workerCommand",
";",
"if",
"(",
"$",
"this",
"->",
"tube",
"!=",
"''",
")",
"{",
"$",
"cmd",
".=",
"' --use-tube='",
".",
"escapeshellarg",
"(",
... | Starts the child process
@return void | [
"Starts",
"the",
"child",
"process"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/Tender/ChildProcessContainer.php#L250-L268 |
24,014 | webdevvie/pheanstalk-task-queue-bundle | Command/Tender/ChildProcessContainer.php | ChildProcessContainer.sendTERMSignal | private function sendTERMSignal()
{
if (!$this->hasReceivedHUP) {
$this->hasReceivedHUP = true;
try {
$this->process->signal(SIGTERM);
} catch (\Symfony\Component\Process\Exception\LogicException $e) {
//In case the process ends between che... | php | private function sendTERMSignal()
{
if (!$this->hasReceivedHUP) {
$this->hasReceivedHUP = true;
try {
$this->process->signal(SIGTERM);
} catch (\Symfony\Component\Process\Exception\LogicException $e) {
//In case the process ends between che... | [
"private",
"function",
"sendTERMSignal",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasReceivedHUP",
")",
"{",
"$",
"this",
"->",
"hasReceivedHUP",
"=",
"true",
";",
"try",
"{",
"$",
"this",
"->",
"process",
"->",
"signal",
"(",
"SIGTERM",
")",... | Sends a signal to the process, this method prevents the signal from being sent twice
@return void | [
"Sends",
"a",
"signal",
"to",
"the",
"process",
"this",
"method",
"prevents",
"the",
"signal",
"from",
"being",
"sent",
"twice"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/Tender/ChildProcessContainer.php#L286-L296 |
24,015 | webdevvie/pheanstalk-task-queue-bundle | Command/Tender/ChildProcessContainer.php | ChildProcessContainer.getReadyForBed | public function getReadyForBed()
{
$busyStatusses = array(ChildProcessContainer::STATUS_SLEEPY,
ChildProcessContainer::STATUS_BUSY_BUT_SLEEPY
);
if (in_array($this->status, $busyStatusses)) {
//ready for bed
return;
}
if($this->status == C... | php | public function getReadyForBed()
{
$busyStatusses = array(ChildProcessContainer::STATUS_SLEEPY,
ChildProcessContainer::STATUS_BUSY_BUT_SLEEPY
);
if (in_array($this->status, $busyStatusses)) {
//ready for bed
return;
}
if($this->status == C... | [
"public",
"function",
"getReadyForBed",
"(",
")",
"{",
"$",
"busyStatusses",
"=",
"array",
"(",
"ChildProcessContainer",
"::",
"STATUS_SLEEPY",
",",
"ChildProcessContainer",
"::",
"STATUS_BUSY_BUT_SLEEPY",
")",
";",
"if",
"(",
"in_array",
"(",
"$",
"this",
"->",
... | Tells the child to not pick up any more work and go to bed
@return void | [
"Tells",
"the",
"child",
"to",
"not",
"pick",
"up",
"any",
"more",
"work",
"and",
"go",
"to",
"bed"
] | db5e63a8f844e345dc2e69ce8e94b32d851020eb | https://github.com/webdevvie/pheanstalk-task-queue-bundle/blob/db5e63a8f844e345dc2e69ce8e94b32d851020eb/Command/Tender/ChildProcessContainer.php#L303-L324 |
24,016 | mridang/magazine | lib/magento/Target.php | Mage_Connect_Package_Target._getTargetMap | protected function _getTargetMap()
{
if (is_null($this->_targetMap)) {
$this->_targetMap = array();
$this->_targetMap[] = array('name'=>"magelocal" ,'label'=>"Magento Local module file" , 'uri'=>"./app/code/local");
$this->_targetMap[] = array('name'=>"magecommunity" ,'la... | php | protected function _getTargetMap()
{
if (is_null($this->_targetMap)) {
$this->_targetMap = array();
$this->_targetMap[] = array('name'=>"magelocal" ,'label'=>"Magento Local module file" , 'uri'=>"./app/code/local");
$this->_targetMap[] = array('name'=>"magecommunity" ,'la... | [
"protected",
"function",
"_getTargetMap",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_targetMap",
")",
")",
"{",
"$",
"this",
"->",
"_targetMap",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"_targetMap",
"[",
"]",
"=",
"array",... | Retrieve content from target.xml.
@return SimpleXMLElement | [
"Retrieve",
"content",
"from",
"target",
".",
"xml",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Target.php#L57-L75 |
24,017 | mridang/magazine | lib/magento/Target.php | Mage_Connect_Package_Target.getTargets | public function getTargets()
{
if (!is_array($this->_targets)) {
$this->_targets = array();
if($this->_getTargetMap()) {
foreach ($this->_getTargetMap() as $_target) {
$this->_targets[$_target['name']] = (string)$_target['uri'];
}
... | php | public function getTargets()
{
if (!is_array($this->_targets)) {
$this->_targets = array();
if($this->_getTargetMap()) {
foreach ($this->_getTargetMap() as $_target) {
$this->_targets[$_target['name']] = (string)$_target['uri'];
}
... | [
"public",
"function",
"getTargets",
"(",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"_targets",
")",
")",
"{",
"$",
"this",
"->",
"_targets",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"_getTargetMap",
"(",
")",
... | Retrieve targets as associative array from target.xml.
@return array | [
"Retrieve",
"targets",
"as",
"associative",
"array",
"from",
"target",
".",
"xml",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Target.php#L82-L93 |
24,018 | mridang/magazine | lib/magento/Target.php | Mage_Connect_Package_Target.getLabelTargets | public function getLabelTargets()
{
$targets = array();
foreach ($this->_getTargetMap() as $_target) {
$targets[$_target['name']] = $_target['label'];
}
return $targets;
} | php | public function getLabelTargets()
{
$targets = array();
foreach ($this->_getTargetMap() as $_target) {
$targets[$_target['name']] = $_target['label'];
}
return $targets;
} | [
"public",
"function",
"getLabelTargets",
"(",
")",
"{",
"$",
"targets",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"_getTargetMap",
"(",
")",
"as",
"$",
"_target",
")",
"{",
"$",
"targets",
"[",
"$",
"_target",
"[",
"'name'",
"]"... | Retrieve tragets with label for select options.
@return array | [
"Retrieve",
"tragets",
"with",
"label",
"for",
"select",
"options",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Target.php#L100-L107 |
24,019 | mridang/magazine | lib/magento/Target.php | Mage_Connect_Package_Target.getTargetUri | public function getTargetUri($name)
{
foreach ($this->getTargets() as $_name=>$_uri) {
if ($name == $_name) {
return $_uri;
}
}
return '';
} | php | public function getTargetUri($name)
{
foreach ($this->getTargets() as $_name=>$_uri) {
if ($name == $_name) {
return $_uri;
}
}
return '';
} | [
"public",
"function",
"getTargetUri",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getTargets",
"(",
")",
"as",
"$",
"_name",
"=>",
"$",
"_uri",
")",
"{",
"if",
"(",
"$",
"name",
"==",
"$",
"_name",
")",
"{",
"return",
"$",
"_u... | Get uri by target's name.
@param string $name
@return string | [
"Get",
"uri",
"by",
"target",
"s",
"name",
"."
] | 5b3cfecc472c61fde6af63efe62690a30a267a04 | https://github.com/mridang/magazine/blob/5b3cfecc472c61fde6af63efe62690a30a267a04/lib/magento/Target.php#L115-L123 |
24,020 | nabab/bbn | src/bbn/str.php | str.change_case | public static function change_case($st, $case = 'x'): string
{
$st = self::cast($st);
$case = substr(strtolower((string)$case), 0, 1);
switch ( $case ){
case "l":
$case = MB_CASE_LOWER;
break;
case "u":
$case = MB_CASE_UPPER;
break;
default:
$case ... | php | public static function change_case($st, $case = 'x'): string
{
$st = self::cast($st);
$case = substr(strtolower((string)$case), 0, 1);
switch ( $case ){
case "l":
$case = MB_CASE_LOWER;
break;
case "u":
$case = MB_CASE_UPPER;
break;
default:
$case ... | [
"public",
"static",
"function",
"change_case",
"(",
"$",
"st",
",",
"$",
"case",
"=",
"'x'",
")",
":",
"string",
"{",
"$",
"st",
"=",
"self",
"::",
"cast",
"(",
"$",
"st",
")",
";",
"$",
"case",
"=",
"substr",
"(",
"strtolower",
"(",
"(",
"string... | Converts the case of a string.
```php
$st = 'TEST CASE';
\bbn\x::dump(\bbn\str::change_case($st, 'lower'));
// (string) "test case"
\bbn\x::dump(\bbn\str::change_case('TEsT Case', 'upper'));
// (string) "TEST CASE"
\bbn\x::dump(\bbn\str::change_case('test case'));
// (string) "Test Case"
```
@param mixed $st The item... | [
"Converts",
"the",
"case",
"of",
"a",
"string",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L62-L80 |
24,021 | nabab/bbn | src/bbn/str.php | str.encode_filename | public static function encode_filename($st, $maxlength = 50, $extension = null, $is_path = false): string
{
$st = self::remove_accents(self::cast($st));
$allowed = '~\-_.,\(\[\)\]';
// Arguments order doesn't matter
$args = \func_get_args();
foreach ( $args as $i => $a ){
if ( $i > 0 ){
... | php | public static function encode_filename($st, $maxlength = 50, $extension = null, $is_path = false): string
{
$st = self::remove_accents(self::cast($st));
$allowed = '~\-_.,\(\[\)\]';
// Arguments order doesn't matter
$args = \func_get_args();
foreach ( $args as $i => $a ){
if ( $i > 0 ){
... | [
"public",
"static",
"function",
"encode_filename",
"(",
"$",
"st",
",",
"$",
"maxlength",
"=",
"50",
",",
"$",
"extension",
"=",
"null",
",",
"$",
"is_path",
"=",
"false",
")",
":",
"string",
"{",
"$",
"st",
"=",
"self",
"::",
"remove_accents",
"(",
... | Returns a cross-platform filename for the file.
```php
\bbn\x::dump(\bbn\str::encode_filename('test file/,1', 15, 'txt'));
// (string) "test_file_1.txt"
```
@param string $st The name as string.
@param int $maxlength The maximum filename length (without extension), default: "50".
@param string $extension The extensio... | [
"Returns",
"a",
"cross",
"-",
"platform",
"filename",
"for",
"the",
"file",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L373-L419 |
24,022 | nabab/bbn | src/bbn/str.php | str.encode_dbname | public static function encode_dbname($st, $maxlength = 50): string
{
$st = self::remove_accents(self::cast($st));
$res = '';
if ( !\is_int($maxlength) ){
$maxlength = mb_strlen($st);
}
for ( $i = 0; $i < $maxlength; $i++ ){
if ( mb_ereg_match('[A-z0-9]',mb_substr($st,$i,1)) ){
... | php | public static function encode_dbname($st, $maxlength = 50): string
{
$st = self::remove_accents(self::cast($st));
$res = '';
if ( !\is_int($maxlength) ){
$maxlength = mb_strlen($st);
}
for ( $i = 0; $i < $maxlength; $i++ ){
if ( mb_ereg_match('[A-z0-9]',mb_substr($st,$i,1)) ){
... | [
"public",
"static",
"function",
"encode_dbname",
"(",
"$",
"st",
",",
"$",
"maxlength",
"=",
"50",
")",
":",
"string",
"{",
"$",
"st",
"=",
"self",
"::",
"remove_accents",
"(",
"self",
"::",
"cast",
"(",
"$",
"st",
")",
")",
";",
"$",
"res",
"=",
... | Returns a corrected string for database naming.
```php
\bbn\x::dump(\bbn\str::encode_dbname('my.database_name ? test :,; !plus'));
// (string) "my_database_name_test_plus"
```
@param string $st The name as string.
@param int $maxlength The maximum length, default: "50".
@return string | [
"Returns",
"a",
"corrected",
"string",
"for",
"database",
"naming",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L433-L456 |
24,023 | nabab/bbn | src/bbn/str.php | str.genpwd | public static function genpwd(int $int_max = 12, int $int_min = 6): string
{
mt_srand();
$len = ($int_min > 0) && ($int_min < $int_max) ? random_int($int_min, $int_max) : $int_max;
$mdp = '';
for( $i = 0; $i < $len; $i++ ){
// First character is a letter
$type = $i === 0 ? random_int(2, 3)... | php | public static function genpwd(int $int_max = 12, int $int_min = 6): string
{
mt_srand();
$len = ($int_min > 0) && ($int_min < $int_max) ? random_int($int_min, $int_max) : $int_max;
$mdp = '';
for( $i = 0; $i < $len; $i++ ){
// First character is a letter
$type = $i === 0 ? random_int(2, 3)... | [
"public",
"static",
"function",
"genpwd",
"(",
"int",
"$",
"int_max",
"=",
"12",
",",
"int",
"$",
"int_min",
"=",
"6",
")",
":",
"string",
"{",
"mt_srand",
"(",
")",
";",
"$",
"len",
"=",
"(",
"$",
"int_min",
">",
"0",
")",
"&&",
"(",
"$",
"int... | Returns a random password.
```php
\bbn\x::dump(\bbn\str::genpwd());
// (string) "khc9P871w"
\bbn\x::dump(\bbn\str::genpwd(6, 4));
// (string) "dDEtxY"
```
@param int $int_max Maximum password characters, default: "12".
@param int $int_min Minimum password characters, default: "6".
@return string | [
"Returns",
"a",
"random",
"password",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L501-L522 |
24,024 | nabab/bbn | src/bbn/str.php | str.is_json | public static function is_json($st)
{
if ( \is_string($st) && !empty($st) &&
( (substr($st, 0, 1) === '{') || (substr($st, 0, 1) === '[') )){
json_decode($st);
return (json_last_error() == JSON_ERROR_NONE);
}
return false;
} | php | public static function is_json($st)
{
if ( \is_string($st) && !empty($st) &&
( (substr($st, 0, 1) === '{') || (substr($st, 0, 1) === '[') )){
json_decode($st);
return (json_last_error() == JSON_ERROR_NONE);
}
return false;
} | [
"public",
"static",
"function",
"is_json",
"(",
"$",
"st",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"st",
")",
"&&",
"!",
"empty",
"(",
"$",
"st",
")",
"&&",
"(",
"(",
"substr",
"(",
"$",
"st",
",",
"0",
",",
"1",
")",
"===",
"'{'",
... | Checks if the string is a json string.
```php
\bbn\x::dump(\bbn\str::is_json('{"firstName": "John", "lastName": "Smith", "age": 25}'));
// (bool) true
```
@param string $st The string.
@return bool | [
"Checks",
"if",
"the",
"string",
"is",
"a",
"json",
"string",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L535-L543 |
24,025 | nabab/bbn | src/bbn/str.php | str.is_number | public static function is_number(): bool
{
$args = \func_get_args();
foreach ( $args as $a ){
if ( \is_string($a) || (abs($a) > PHP_INT_MAX) ){
if ( !preg_match('/^-?(?:\d+|\d*\.\d+)$/', $a) ){
return false;
}
}
else if ( !\is_int($a) && !\is_float($a) ){
re... | php | public static function is_number(): bool
{
$args = \func_get_args();
foreach ( $args as $a ){
if ( \is_string($a) || (abs($a) > PHP_INT_MAX) ){
if ( !preg_match('/^-?(?:\d+|\d*\.\d+)$/', $a) ){
return false;
}
}
else if ( !\is_int($a) && !\is_float($a) ){
re... | [
"public",
"static",
"function",
"is_number",
"(",
")",
":",
"bool",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"a",
")",
"||",
"(",
... | Checks if the item is a number.
Can take as many arguments and will return false if one of them is not a number.
```php
\bbn\x::dump(\bbn\str::is_number([1, 2]));
// (bool) false
\bbn\x::dump(\bbn\str::is_number(150);
// (bool) 1
\bbn\x::dump(\bbn\str::is_number('150'));
// (bool) 1
\bbn\x::dump(\bbn\str::is_number(1... | [
"Checks",
"if",
"the",
"item",
"is",
"a",
"number",
".",
"Can",
"take",
"as",
"many",
"arguments",
"and",
"will",
"return",
"false",
"if",
"one",
"of",
"them",
"is",
"not",
"a",
"number",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L563-L577 |
24,026 | nabab/bbn | src/bbn/str.php | str.is_integer | public static function is_integer(): bool
{
$args = \func_get_args();
foreach ( $args as $a ){
if ( \is_string($a) || (abs($a) > PHP_INT_MAX) ){
if ( !preg_match('/^-?(\d+)$/', (string)$a) ){
return false;
}
}
else if ( !\is_int($a) ){
return false;
}
... | php | public static function is_integer(): bool
{
$args = \func_get_args();
foreach ( $args as $a ){
if ( \is_string($a) || (abs($a) > PHP_INT_MAX) ){
if ( !preg_match('/^-?(\d+)$/', (string)$a) ){
return false;
}
}
else if ( !\is_int($a) ){
return false;
}
... | [
"public",
"static",
"function",
"is_integer",
"(",
")",
":",
"bool",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"a",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"a",
")",
"||",
"(",
... | Checks if the item is a integer.
Can take as many arguments and will return false if one of them is not an integer or the string of an integer.
```php
\bbn\x::dump(\bbn\str::is_integer(13.2));
// (bool) false
\bbn\x::dump(\bbn\str::is_integer(14));
// (bool) true
\bbn\x::dump(\bbn\str::is_integer('14'));
// (bool) tru... | [
"Checks",
"if",
"the",
"item",
"is",
"a",
"integer",
".",
"Can",
"take",
"as",
"many",
"arguments",
"and",
"will",
"return",
"false",
"if",
"one",
"of",
"them",
"is",
"not",
"an",
"integer",
"or",
"the",
"string",
"of",
"an",
"integer",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L595-L609 |
24,027 | nabab/bbn | src/bbn/str.php | str.is_buid | public static function is_buid($st): bool
{
if ( \is_string($st) && (\strlen($st) === 16) && !ctype_print($st) && !ctype_space($st) ){
$enc = mb_detect_encoding($st, ['8bit', 'UTF-8']);
if ( !$enc || ($enc === '8bit') ){
return true;
}
}
return false;
} | php | public static function is_buid($st): bool
{
if ( \is_string($st) && (\strlen($st) === 16) && !ctype_print($st) && !ctype_space($st) ){
$enc = mb_detect_encoding($st, ['8bit', 'UTF-8']);
if ( !$enc || ($enc === '8bit') ){
return true;
}
}
return false;
} | [
"public",
"static",
"function",
"is_buid",
"(",
"$",
"st",
")",
":",
"bool",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"st",
")",
"&&",
"(",
"\\",
"strlen",
"(",
"$",
"st",
")",
"===",
"16",
")",
"&&",
"!",
"ctype_print",
"(",
"$",
"st",
")"... | Checks if the string is a valid binary UID string.
@param string $st
@return boolean | [
"Checks",
"if",
"the",
"string",
"is",
"a",
"valid",
"binary",
"UID",
"string",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L691-L700 |
24,028 | nabab/bbn | src/bbn/str.php | str.is_email | public static function is_email($email): bool
{
if ( function_exists('filter_var') ){
return filter_var($email,FILTER_VALIDATE_EMAIL) ? true : false;
}
else
{
$isValid = true;
$atIndex = mb_strrpos($email, "@");
if (\is_bool($atIndex) && !$atIndex)
{
$isValid = fa... | php | public static function is_email($email): bool
{
if ( function_exists('filter_var') ){
return filter_var($email,FILTER_VALIDATE_EMAIL) ? true : false;
}
else
{
$isValid = true;
$atIndex = mb_strrpos($email, "@");
if (\is_bool($atIndex) && !$atIndex)
{
$isValid = fa... | [
"public",
"static",
"function",
"is_email",
"(",
"$",
"email",
")",
":",
"bool",
"{",
"if",
"(",
"function_exists",
"(",
"'filter_var'",
")",
")",
"{",
"return",
"filter_var",
"(",
"$",
"email",
",",
"FILTER_VALIDATE_EMAIL",
")",
"?",
"true",
":",
"false",... | Checks if the string is the correct type of e-mail address.
```php
\bbn\x::dump(\bbn\str::is_email('test@email.com'));
// (bool) true
\bbn\x::dump(\bbn\str::is_email('test@email'));
// (bool) false
\bbn\x::dump(\bbn\str::is_email('test@.com'));
// (bool) false
\bbn\x::dump(\bbn\str::is_email('testemail.com'));
// (boo... | [
"Checks",
"if",
"the",
"string",
"is",
"the",
"correct",
"type",
"of",
"e",
"-",
"mail",
"address",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L719-L767 |
24,029 | nabab/bbn | src/bbn/str.php | str.correct_types | public static function correct_types($st){
if ( \is_string($st) ){
if ( self::is_buid($st) ){
$st = bin2hex($st);
}
else{
if ( self::is_json($st) ){
if ( strpos($st, '": ') && ($json = json_decode($st)) ){
return json_encode($json);
}
retur... | php | public static function correct_types($st){
if ( \is_string($st) ){
if ( self::is_buid($st) ){
$st = bin2hex($st);
}
else{
if ( self::is_json($st) ){
if ( strpos($st, '": ') && ($json = json_decode($st)) ){
return json_encode($json);
}
retur... | [
"public",
"static",
"function",
"correct_types",
"(",
"$",
"st",
")",
"{",
"if",
"(",
"\\",
"is_string",
"(",
"$",
"st",
")",
")",
"{",
"if",
"(",
"self",
"::",
"is_buid",
"(",
"$",
"st",
")",
")",
"{",
"$",
"st",
"=",
"bin2hex",
"(",
"$",
"st"... | If it looks like an int or float type, the string variable is converted into the correct type.
```php
\bbn\x::dump(\bbn\str::correct_types(1230));
// (int) 1230
\bbn\x::dump(\bbn\str::correct_types(12.30));
// (float) 12.3
\bbn\x::dump(\bbn\str::correct_types("12.3"));
// (float) 12.3
\bbn\x::dump(\bbn\str::correct_ty... | [
"If",
"it",
"looks",
"like",
"an",
"int",
"or",
"float",
"type",
"the",
"string",
"variable",
"is",
"converted",
"into",
"the",
"correct",
"type",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L851-L891 |
24,030 | nabab/bbn | src/bbn/str.php | str.parse_url | public static function parse_url($url): array
{
$url = self::cast($url);
$r = x::merge_arrays(parse_url($url), ['url' => $url,'query' => '','params' => []]);
if ( strpos($url,'?') > 0 )
{
$p = explode('?',$url);
$r['url'] = $p[0];
$r['query'] = $p[1];
$ps = explode('&',$r['quer... | php | public static function parse_url($url): array
{
$url = self::cast($url);
$r = x::merge_arrays(parse_url($url), ['url' => $url,'query' => '','params' => []]);
if ( strpos($url,'?') > 0 )
{
$p = explode('?',$url);
$r['url'] = $p[0];
$r['query'] = $p[1];
$ps = explode('&',$r['quer... | [
"public",
"static",
"function",
"parse_url",
"(",
"$",
"url",
")",
":",
"array",
"{",
"$",
"url",
"=",
"self",
"::",
"cast",
"(",
"$",
"url",
")",
";",
"$",
"r",
"=",
"x",
"::",
"merge_arrays",
"(",
"parse_url",
"(",
"$",
"url",
")",
",",
"[",
... | Returns an array containing any of the various components of the URL that are present.
```php
\bbn\x::hdump(\bbn\str::parse_url('http://localhost/phpmyadmin/?db=test&table=users&server=1&target=&token=e45a102c5672b2b4fe84ae75d9148981');
/* (array)
[
'scheme' => 'http',
'host' => 'localhost',
'path' => '/phpmyadmin/',
... | [
"Returns",
"an",
"array",
"containing",
"any",
"of",
"the",
"various",
"components",
"of",
"the",
"URL",
"that",
"are",
"present",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L918-L934 |
24,031 | nabab/bbn | src/bbn/str.php | str.check_name | public static function check_name(): bool
{
$args = \func_get_args();
// Each argument must be a string starting with a letter, and having only one character made of letters, numbers and underscores
foreach ( $args as $a ){
$a = self::cast($a);
$t = preg_match('#[A-z0-9_]+#',$a,$m);
if ... | php | public static function check_name(): bool
{
$args = \func_get_args();
// Each argument must be a string starting with a letter, and having only one character made of letters, numbers and underscores
foreach ( $args as $a ){
$a = self::cast($a);
$t = preg_match('#[A-z0-9_]+#',$a,$m);
if ... | [
"public",
"static",
"function",
"check_name",
"(",
")",
":",
"bool",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"// Each argument must be a string starting with a letter, and having only one character made of letters, numbers and underscores",
"foreach",
"(",
... | Checks if a string complies with SQL naming convention.
```php
\bbn\x::dump(\bbn\str::check_name("Paul"));
// (bool) true
\bbn\x::dump(\bbn\str::check_name("Pa ul"));
// (bool) false
```
@return bool | [
"Checks",
"if",
"a",
"string",
"complies",
"with",
"SQL",
"naming",
"convention",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L1012-L1026 |
24,032 | nabab/bbn | src/bbn/str.php | str.check_filename | public static function check_filename(): bool
{
$args = \func_get_args();
// Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores
foreach ( $args as $a ){
if ( !\is_string($a) || (strpos($a, '/') !== false) || (strpos($a, '\\'... | php | public static function check_filename(): bool
{
$args = \func_get_args();
// Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores
foreach ( $args as $a ){
if ( !\is_string($a) || (strpos($a, '/') !== false) || (strpos($a, '\\'... | [
"public",
"static",
"function",
"check_filename",
"(",
")",
":",
"bool",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"// Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores",
"foreach",
"... | Checks if a string doesn't contain a filesystem path.
```php
\bbn\x::dump(\bbn\str::check_filename("Paul"));
// (bool) true
\bbn\x::dump(\bbn\str::check_filename("Paul/"));
// (bool) false
```
@return bool | [
"Checks",
"if",
"a",
"string",
"doesn",
"t",
"contain",
"a",
"filesystem",
"path",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L1039-L1050 |
24,033 | nabab/bbn | src/bbn/str.php | str.has_slash | public static function has_slash(): bool
{
$args = \func_get_args();
// Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores
foreach ( $args as $a ){
if ( (strpos($a, '/') !== false) || (strpos($a, '\\') !== false) ){
... | php | public static function has_slash(): bool
{
$args = \func_get_args();
// Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores
foreach ( $args as $a ){
if ( (strpos($a, '/') !== false) || (strpos($a, '\\') !== false) ){
... | [
"public",
"static",
"function",
"has_slash",
"(",
")",
":",
"bool",
"{",
"$",
"args",
"=",
"\\",
"func_get_args",
"(",
")",
";",
"// Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores",
"foreach",
"(",
... | Checks if a string complies with SQL naming convention.
Returns "true" if slash or backslash are present.
```php
\bbn\x::dump(\bbn\str::has_slash("Paul"));
// (bool) false
\bbn\x::dump(\bbn\str::has_slash("Paul/");
// (bool) 1
\bbn\x::dump(\bbn\str::has_slash("Paul\\");
// (bool) 1
```
@return bool | [
"Checks",
"if",
"a",
"string",
"complies",
"with",
"SQL",
"naming",
"convention",
".",
"Returns",
"true",
"if",
"slash",
"or",
"backslash",
"are",
"present",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L1068-L1080 |
24,034 | nabab/bbn | src/bbn/str.php | str.say_size | public static function say_size($bytes, $unit = 'B', $stop = false): string
{
// pretty printer for byte values
//
$i = 0;
$units = ['', 'K', 'M', 'G', 'T'];
while ( $stop || ($bytes > 2000) ){
$i++;
$bytes /= 1024;
if ( $stop === $units[$i] ){
break;
}
}
return spr... | php | public static function say_size($bytes, $unit = 'B', $stop = false): string
{
// pretty printer for byte values
//
$i = 0;
$units = ['', 'K', 'M', 'G', 'T'];
while ( $stop || ($bytes > 2000) ){
$i++;
$bytes /= 1024;
if ( $stop === $units[$i] ){
break;
}
}
return spr... | [
"public",
"static",
"function",
"say_size",
"(",
"$",
"bytes",
",",
"$",
"unit",
"=",
"'B'",
",",
"$",
"stop",
"=",
"false",
")",
":",
"string",
"{",
"// pretty printer for byte values",
"//",
"$",
"i",
"=",
"0",
";",
"$",
"units",
"=",
"[",
"''",
",... | Converts the bytes to another unit form.
@param int $bytes The bytes
@param string The unit you want to convert ('B', 'K', 'M', 'G', 'T')
@parma boolean $stop
@return string | [
"Converts",
"the",
"bytes",
"to",
"another",
"unit",
"form",
"."
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/str.php#L1311-L1325 |
24,035 | soloproyectos-php/text-parser | src/text/parser/exception/TextParserException.php | TextParserException.getPrintableMessage | public function getPrintableMessage()
{
$ret = $this->message;
if ($this->_parser != null) {
$string = rtrim($this->_parser->getString());
$offset = $this->_parser->getOffset();
$rightStr = substr($string, $offset);
$offset0 = $offset + strlen($right... | php | public function getPrintableMessage()
{
$ret = $this->message;
if ($this->_parser != null) {
$string = rtrim($this->_parser->getString());
$offset = $this->_parser->getOffset();
$rightStr = substr($string, $offset);
$offset0 = $offset + strlen($right... | [
"public",
"function",
"getPrintableMessage",
"(",
")",
"{",
"$",
"ret",
"=",
"$",
"this",
"->",
"message",
";",
"if",
"(",
"$",
"this",
"->",
"_parser",
"!=",
"null",
")",
"{",
"$",
"string",
"=",
"rtrim",
"(",
"$",
"this",
"->",
"_parser",
"->",
"... | Gets a printable message.
This function provides a method to get printable messages.
@return string | [
"Gets",
"a",
"printable",
"message",
"."
] | 3ef2e8a26f7c53b170383d74ccf4106b0f3dd8b1 | https://github.com/soloproyectos-php/text-parser/blob/3ef2e8a26f7c53b170383d74ccf4106b0f3dd8b1/src/text/parser/exception/TextParserException.php#L48-L82 |
24,036 | codezero-be/curl | src/ResponseFactory.php | ResponseFactory.make | public function make($responseBody, array $responseInfo)
{
$info = $this->makeResponseInfo($responseInfo);
$response = $this->makeResponse($responseBody, $info);
return $response;
} | php | public function make($responseBody, array $responseInfo)
{
$info = $this->makeResponseInfo($responseInfo);
$response = $this->makeResponse($responseBody, $info);
return $response;
} | [
"public",
"function",
"make",
"(",
"$",
"responseBody",
",",
"array",
"$",
"responseInfo",
")",
"{",
"$",
"info",
"=",
"$",
"this",
"->",
"makeResponseInfo",
"(",
"$",
"responseInfo",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"makeResponse",
"("... | Make a response
@param $responseBody
@param array $responseInfo
@return Response | [
"Make",
"a",
"response"
] | c1385479886662b6276c18dd9140df529959d95c | https://github.com/codezero-be/curl/blob/c1385479886662b6276c18dd9140df529959d95c/src/ResponseFactory.php#L13-L19 |
24,037 | hametuha/wpametu | src/WPametu/Http/Input.php | Input.file_error_message | public function file_error_message( $key ) {
if ( $this->file_info( $key ) ) {
return '';
} elseif ( ! isset( $_FILES[ $key ] ) ) {
return $this->__( 'File is not specified.' );
} else {
switch ( $_FILES[ $key ]['error'] ) {
case UPLOAD_ERR_FORM_SIZE:
case UPLOAD_ERR_INI_SIZE:
return $this->... | php | public function file_error_message( $key ) {
if ( $this->file_info( $key ) ) {
return '';
} elseif ( ! isset( $_FILES[ $key ] ) ) {
return $this->__( 'File is not specified.' );
} else {
switch ( $_FILES[ $key ]['error'] ) {
case UPLOAD_ERR_FORM_SIZE:
case UPLOAD_ERR_INI_SIZE:
return $this->... | [
"public",
"function",
"file_error_message",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"file_info",
"(",
"$",
"key",
")",
")",
"{",
"return",
"''",
";",
"}",
"elseif",
"(",
"!",
"isset",
"(",
"$",
"_FILES",
"[",
"$",
"key",
"]",
")"... | Get file upload error message
@param string $key
@return string | [
"Get",
"file",
"upload",
"error",
"message"
] | 0939373800815a8396291143d2a57967340da5aa | https://github.com/hametuha/wpametu/blob/0939373800815a8396291143d2a57967340da5aa/src/WPametu/Http/Input.php#L98-L114 |
24,038 | zyberspace/php-discovery-shell | lib/Zyberspace/DiscoveryShell.php | DiscoveryShell._runShell | protected function _runShell()
{
echo wordwrap('-- discovery-shell to help discover a class or library --' . PHP_EOL . PHP_EOL
. 'Use TAB for autocompletion and your arrow-keys to navigate through your method-history.' . PHP_EOL
. 'Beware! This is not a full-featured php-shell. The i... | php | protected function _runShell()
{
echo wordwrap('-- discovery-shell to help discover a class or library --' . PHP_EOL . PHP_EOL
. 'Use TAB for autocompletion and your arrow-keys to navigate through your method-history.' . PHP_EOL
. 'Beware! This is not a full-featured php-shell. The i... | [
"protected",
"function",
"_runShell",
"(",
")",
"{",
"echo",
"wordwrap",
"(",
"'-- discovery-shell to help discover a class or library --'",
".",
"PHP_EOL",
".",
"PHP_EOL",
".",
"'Use TAB for autocompletion and your arrow-keys to navigate through your method-history.'",
".",
"PHP_E... | Runs the shell | [
"Runs",
"the",
"shell"
] | a5b4bb268c06e2cafb25e0b0383435bf448263a8 | https://github.com/zyberspace/php-discovery-shell/blob/a5b4bb268c06e2cafb25e0b0383435bf448263a8/lib/Zyberspace/DiscoveryShell.php#L90-L105 |
24,039 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/utilities_oracle.php | ezcDbUtilitiesOracle.createTemporaryTable | public function createTemporaryTable( $tableNamePattern, $tableDefinition )
{
$tableNamePattern = $this->getPrefixedTableNames($tableNamePattern);
if ( strpos( $tableNamePattern, '%' ) === false )
{
$tableName = $tableNamePattern;
}
else // generate unique table name... | php | public function createTemporaryTable( $tableNamePattern, $tableDefinition )
{
$tableNamePattern = $this->getPrefixedTableNames($tableNamePattern);
if ( strpos( $tableNamePattern, '%' ) === false )
{
$tableName = $tableNamePattern;
}
else // generate unique table name... | [
"public",
"function",
"createTemporaryTable",
"(",
"$",
"tableNamePattern",
",",
"$",
"tableDefinition",
")",
"{",
"$",
"tableNamePattern",
"=",
"$",
"this",
"->",
"getPrefixedTableNames",
"(",
"$",
"tableNamePattern",
")",
";",
"if",
"(",
"strpos",
"(",
"$",
... | Creates a new temporary table and returns the name.
@throws ezcDbException::GENERIC_ERROR in case of inability to generate
a unique temporary table name.
@see ezcDbHandler::createTemporaryTable()
@param string $tableNamePattern Name of temporary table user wants
to create.
@param string $tableDefinition Definit... | [
"Creates",
"a",
"new",
"temporary",
"table",
"and",
"returns",
"the",
"name",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/utilities_oracle.php#L89-L119 |
24,040 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/utilities_oracle.php | ezcDbUtilitiesOracle.dropTemporaryTable | public function dropTemporaryTable( $tableName )
{
$tableName = $this->getPrefixedTableNames($tableName);
$this->db->exec( "TRUNCATE TABLE $tableName" );
$this->db->exec( "DROP TABLE $tableName" );
} | php | public function dropTemporaryTable( $tableName )
{
$tableName = $this->getPrefixedTableNames($tableName);
$this->db->exec( "TRUNCATE TABLE $tableName" );
$this->db->exec( "DROP TABLE $tableName" );
} | [
"public",
"function",
"dropTemporaryTable",
"(",
"$",
"tableName",
")",
"{",
"$",
"tableName",
"=",
"$",
"this",
"->",
"getPrefixedTableNames",
"(",
"$",
"tableName",
")",
";",
"$",
"this",
"->",
"db",
"->",
"exec",
"(",
"\"TRUNCATE TABLE $tableName\"",
")",
... | Drop specified temporary table
in a portable way.
Developers should use this method instead of dropping temporary
tables with the appropriate SQL queries
to maintain inter-DBMS portability.
@see createTemporaryTable()
@param string $tableName Name of temporary table to drop.
@return void | [
"Drop",
"specified",
"temporary",
"table",
"in",
"a",
"portable",
"way",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Database/src/sqlabstraction/implementations/utilities_oracle.php#L134-L139 |
24,041 | ArrowSphere/Client | src/xAC/Entity.php | Entity.getBaseUri | public function getBaseUri()
{
return sprintf('%s%s'
, $this->params['endpoint']
, ! empty($this->id) ? '/' . $this->id : null
);
} | php | public function getBaseUri()
{
return sprintf('%s%s'
, $this->params['endpoint']
, ! empty($this->id) ? '/' . $this->id : null
);
} | [
"public",
"function",
"getBaseUri",
"(",
")",
"{",
"return",
"sprintf",
"(",
"'%s%s'",
",",
"$",
"this",
"->",
"params",
"[",
"'endpoint'",
"]",
",",
"!",
"empty",
"(",
"$",
"this",
"->",
"id",
")",
"?",
"'/'",
".",
"$",
"this",
"->",
"id",
":",
... | Return entity endpoint base uri | [
"Return",
"entity",
"endpoint",
"base",
"uri"
] | 6608f8257060375e7d3a27c485b23268b73f6ef7 | https://github.com/ArrowSphere/Client/blob/6608f8257060375e7d3a27c485b23268b73f6ef7/src/xAC/Entity.php#L56-L62 |
24,042 | i-lateral/silverstripe-users | code/extensions/Ext_Users_Member.php | Ext_Users_Member.Register | public function Register($data)
{
// If we have passed a confirm password field, clean the
// data
if (isset($data["Password"]) && is_array($data["Password"]) && isset($data["Password"]["_Password"])) {
$data["Password"] = $data["Password"]["_Password"];
}
... | php | public function Register($data)
{
// If we have passed a confirm password field, clean the
// data
if (isset($data["Password"]) && is_array($data["Password"]) && isset($data["Password"]["_Password"])) {
$data["Password"] = $data["Password"]["_Password"];
}
... | [
"public",
"function",
"Register",
"(",
"$",
"data",
")",
"{",
"// If we have passed a confirm password field, clean the",
"// data",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"\"Password\"",
"]",
")",
"&&",
"is_array",
"(",
"$",
"data",
"[",
"\"Password\"",
"]"... | Register a new user account using the provided data
and then return the current member
@param array $data Array of data to create member from
@return Member | [
"Register",
"a",
"new",
"user",
"account",
"using",
"the",
"provided",
"data",
"and",
"then",
"return",
"the",
"current",
"member"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/extensions/Ext_Users_Member.php#L33-L72 |
24,043 | i-lateral/silverstripe-users | code/extensions/Ext_Users_Member.php | Ext_Users_Member.sendVerificationEmail | public function sendVerificationEmail()
{
if ($this->owner->exists()) {
$controller = Injector::inst()->get("Users_Register_Controller");
$subject = _t("Users.PleaseVerify", "Please verify your account");
if (Users::config()->send_email_from) {
$from = Us... | php | public function sendVerificationEmail()
{
if ($this->owner->exists()) {
$controller = Injector::inst()->get("Users_Register_Controller");
$subject = _t("Users.PleaseVerify", "Please verify your account");
if (Users::config()->send_email_from) {
$from = Us... | [
"public",
"function",
"sendVerificationEmail",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"exists",
"(",
")",
")",
"{",
"$",
"controller",
"=",
"Injector",
"::",
"inst",
"(",
")",
"->",
"get",
"(",
"\"Users_Register_Controller\"",
")",
"... | Send a verification email to this user account
@return boolean | [
"Send",
"a",
"verification",
"email",
"to",
"this",
"user",
"account"
] | 27ddc38890fa2709ac419eccf854ab6b439f0d9a | https://github.com/i-lateral/silverstripe-users/blob/27ddc38890fa2709ac419eccf854ab6b439f0d9a/code/extensions/Ext_Users_Member.php#L79-L115 |
24,044 | surebert/surebert-framework | src/sb/PDO/Logger.php | Logger.exec | public function exec($sql)
{
$this->writeToLog("Exec: " . $sql);
$result = parent::exec($sql);
return $result;
} | php | public function exec($sql)
{
$this->writeToLog("Exec: " . $sql);
$result = parent::exec($sql);
return $result;
} | [
"public",
"function",
"exec",
"(",
"$",
"sql",
")",
"{",
"$",
"this",
"->",
"writeToLog",
"(",
"\"Exec: \"",
".",
"$",
"sql",
")",
";",
"$",
"result",
"=",
"parent",
"::",
"exec",
"(",
"$",
"sql",
")",
";",
"return",
"$",
"result",
";",
"}"
] | Used to issue statements which return no results but rather the number of rows affected
@param string $sql
@return integer The number of rows affected | [
"Used",
"to",
"issue",
"statements",
"which",
"return",
"no",
"results",
"but",
"rather",
"the",
"number",
"of",
"rows",
"affected"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Logger.php#L114-L119 |
24,045 | surebert/surebert-framework | src/sb/PDO/Logger.php | Logger.prepare | public function prepare($sql, $options = null)
{
$md5 = md5($sql);
if (isset($this->prepared_sql[$md5])) {
return $this->prepared_sql[$md5];
}
//$this->writeToLog("Preparing: ".$sql);
$stmt = parent::prepare($sql);
$this->prepared_sql[$md5] = $stmt;
... | php | public function prepare($sql, $options = null)
{
$md5 = md5($sql);
if (isset($this->prepared_sql[$md5])) {
return $this->prepared_sql[$md5];
}
//$this->writeToLog("Preparing: ".$sql);
$stmt = parent::prepare($sql);
$this->prepared_sql[$md5] = $stmt;
... | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"md5",
"=",
"md5",
"(",
"$",
"sql",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"prepared_sql",
"[",
"$",
"md5",
"]",
")",
")",
"{",
... | Used to prepare sql statements for value binding
@param string $sql
@return PDO_Statement A PDO_statment instance | [
"Used",
"to",
"prepare",
"sql",
"statements",
"for",
"value",
"binding"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Logger.php#L127-L140 |
24,046 | surebert/surebert-framework | src/sb/PDO/Logger.php | Logger.writeToLog | public function writeToLog($message)
{
if (is_null($this->logger)) {
$this->setLogger();
}
if (empty($this->sbf_id) || $this->sbf_id == \sb\Gateway::$cookie['SBF_ID']) {
$message = preg_replace("~\t~", " ", $message);
return $this->logger->{$this->log_s... | php | public function writeToLog($message)
{
if (is_null($this->logger)) {
$this->setLogger();
}
if (empty($this->sbf_id) || $this->sbf_id == \sb\Gateway::$cookie['SBF_ID']) {
$message = preg_replace("~\t~", " ", $message);
return $this->logger->{$this->log_s... | [
"public",
"function",
"writeToLog",
"(",
"$",
"message",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"logger",
")",
")",
"{",
"$",
"this",
"->",
"setLogger",
"(",
")",
";",
"}",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"sbf_id",
")... | Logs all sql statements to a file, if the log file is specified
@param string $message The string to log | [
"Logs",
"all",
"sql",
"statements",
"to",
"a",
"file",
"if",
"the",
"log",
"file",
"is",
"specified"
] | f2f32eb693bd39385ceb93355efb5b2a429f27ce | https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/PDO/Logger.php#L147-L159 |
24,047 | SachaMorard/phalcon-model-annotations | Library/Phalcon/Annotations/ModelStrategy.php | ModelStrategy.getMetaData | public function getMetaData(ModelInterface $model, DiInterface $di)
{
/** @var Reflection $reflection */
$reflection = $di->getAnnotations()->get($model);
$properties = $reflection->getPropertiesAnnotations();
if (!$properties) {
throw new \Exception('There are no propert... | php | public function getMetaData(ModelInterface $model, DiInterface $di)
{
/** @var Reflection $reflection */
$reflection = $di->getAnnotations()->get($model);
$properties = $reflection->getPropertiesAnnotations();
if (!$properties) {
throw new \Exception('There are no propert... | [
"public",
"function",
"getMetaData",
"(",
"ModelInterface",
"$",
"model",
",",
"DiInterface",
"$",
"di",
")",
"{",
"/** @var Reflection $reflection */",
"$",
"reflection",
"=",
"$",
"di",
"->",
"getAnnotations",
"(",
")",
"->",
"get",
"(",
"$",
"model",
")",
... | Initializes the model's meta-data
@param ModelInterface $model
@param DiInterface $di
@return mixed
@throws \Exception | [
"Initializes",
"the",
"model",
"s",
"meta",
"-",
"data"
] | 64cb04903f101c1fd85e8067c0dcdfc6ca133fb5 | https://github.com/SachaMorard/phalcon-model-annotations/blob/64cb04903f101c1fd85e8067c0dcdfc6ca133fb5/Library/Phalcon/Annotations/ModelStrategy.php#L32-L55 |
24,048 | SachaMorard/phalcon-model-annotations | Library/Phalcon/Annotations/ModelStrategy.php | ModelStrategy.getColumnMaps | public function getColumnMaps(ModelInterface $model, DiInterface $di)
{
$reflection = $di['annotations']->get($model);
$columnMap = array();
$reverseColumnMap = array();
$renamed = false;
foreach ($reflection->getPropertiesAnnotations() as $name => $collection) {
... | php | public function getColumnMaps(ModelInterface $model, DiInterface $di)
{
$reflection = $di['annotations']->get($model);
$columnMap = array();
$reverseColumnMap = array();
$renamed = false;
foreach ($reflection->getPropertiesAnnotations() as $name => $collection) {
... | [
"public",
"function",
"getColumnMaps",
"(",
"ModelInterface",
"$",
"model",
",",
"DiInterface",
"$",
"di",
")",
"{",
"$",
"reflection",
"=",
"$",
"di",
"[",
"'annotations'",
"]",
"->",
"get",
"(",
"$",
"model",
")",
";",
"$",
"columnMap",
"=",
"array",
... | Initializes the model's column map
@param \Phalcon\Mvc\ModelInterface $model
@param \Phalcon\DiInterface $di
@return array | [
"Initializes",
"the",
"model",
"s",
"column",
"map"
] | 64cb04903f101c1fd85e8067c0dcdfc6ca133fb5 | https://github.com/SachaMorard/phalcon-model-annotations/blob/64cb04903f101c1fd85e8067c0dcdfc6ca133fb5/Library/Phalcon/Annotations/ModelStrategy.php#L106-L136 |
24,049 | accompli/chrono | src/Process/ProcessExecutionResult.php | ProcessExecutionResult.getOutputAsArray | public function getOutputAsArray()
{
$output = trim($this->getOutput());
if (empty($output) === false) {
return preg_split('{\r?\n}', $output);
}
return array();
} | php | public function getOutputAsArray()
{
$output = trim($this->getOutput());
if (empty($output) === false) {
return preg_split('{\r?\n}', $output);
}
return array();
} | [
"public",
"function",
"getOutputAsArray",
"(",
")",
"{",
"$",
"output",
"=",
"trim",
"(",
"$",
"this",
"->",
"getOutput",
"(",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"output",
")",
"===",
"false",
")",
"{",
"return",
"preg_split",
"(",
"'{\\r?\... | Returns the output separated by newline as array.
@return array | [
"Returns",
"the",
"output",
"separated",
"by",
"newline",
"as",
"array",
"."
] | 5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc | https://github.com/accompli/chrono/blob/5f3201ee1e3fdc519fabac92bc9bfb7d9bebdebc/src/Process/ProcessExecutionResult.php#L82-L90 |
24,050 | gpupo/common-schema | src/ORM/Entity/Application/API/OAuth/Client/Client.php | Client.setAccessToken | public function setAccessToken(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\AccessToken $accessToken = null)
{
$this->access_token = $accessToken;
return $this;
} | php | public function setAccessToken(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\AccessToken $accessToken = null)
{
$this->access_token = $accessToken;
return $this;
} | [
"public",
"function",
"setAccessToken",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Application",
"\\",
"API",
"\\",
"OAuth",
"\\",
"Client",
"\\",
"AccessToken",
"$",
"accessToken",
"=",
"null",
")",
"{",
"$",
"this",
"->... | Set accessToken.
@param null|\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\AccessToken $accessToken
@return Client | [
"Set",
"accessToken",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Application/API/OAuth/Client/Client.php#L281-L286 |
24,051 | gpupo/common-schema | src/ORM/Entity/Application/API/OAuth/Client/Client.php | Client.setProvider | public function setProvider(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Provider $provider = null)
{
$this->provider = $provider;
return $this;
} | php | public function setProvider(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Provider $provider = null)
{
$this->provider = $provider;
return $this;
} | [
"public",
"function",
"setProvider",
"(",
"\\",
"Gpupo",
"\\",
"CommonSchema",
"\\",
"ORM",
"\\",
"Entity",
"\\",
"Application",
"\\",
"API",
"\\",
"OAuth",
"\\",
"Provider",
"$",
"provider",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"provider",
"=",
"$"... | Set provider.
@param null|\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Provider $provider
@return Client | [
"Set",
"provider",
"."
] | a762d2eb3063b7317c72c69cbb463b1f95b86b0a | https://github.com/gpupo/common-schema/blob/a762d2eb3063b7317c72c69cbb463b1f95b86b0a/src/ORM/Entity/Application/API/OAuth/Client/Client.php#L305-L310 |
24,052 | nabab/bbn | src/bbn/parsers/doc.php | doc.set_tags | private function set_tags(){
if ( $this->mode ){
if ( $this->mode === 'vue' ){
$tags = \bbn\x::merge_arrays($this->all_tags['js'], $this->all_tags['vue']);
}
else {
$tags = $this->all_tags[$this->mode];
}
$this->tags = \bbn\x::merge_arrays($this->all_tags['common'], $ta... | php | private function set_tags(){
if ( $this->mode ){
if ( $this->mode === 'vue' ){
$tags = \bbn\x::merge_arrays($this->all_tags['js'], $this->all_tags['vue']);
}
else {
$tags = $this->all_tags[$this->mode];
}
$this->tags = \bbn\x::merge_arrays($this->all_tags['common'], $ta... | [
"private",
"function",
"set_tags",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mode",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"mode",
"===",
"'vue'",
")",
"{",
"$",
"tags",
"=",
"\\",
"bbn",
"\\",
"x",
"::",
"merge_arrays",
"(",
"$",
"this",
... | Sets the tags list relative to the selected mode
@return array | [
"Sets",
"the",
"tags",
"list",
"relative",
"to",
"the",
"selected",
"mode"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L172-L183 |
24,053 | nabab/bbn | src/bbn/parsers/doc.php | doc.get_tags | private function get_tags(string $block){
preg_match_all($this->pattern['tag'], $block, $tags, PREG_OFFSET_CAPTURE);
if ( !empty($tags[0]) ){
return $tags[0];
}
return [];
} | php | private function get_tags(string $block){
preg_match_all($this->pattern['tag'], $block, $tags, PREG_OFFSET_CAPTURE);
if ( !empty($tags[0]) ){
return $tags[0];
}
return [];
} | [
"private",
"function",
"get_tags",
"(",
"string",
"$",
"block",
")",
"{",
"preg_match_all",
"(",
"$",
"this",
"->",
"pattern",
"[",
"'tag'",
"]",
",",
"$",
"block",
",",
"$",
"tags",
",",
"PREG_OFFSET_CAPTURE",
")",
";",
"if",
"(",
"!",
"empty",
"(",
... | Gets te tags list of a docblock
@param string $block The docblock
@return array | [
"Gets",
"te",
"tags",
"list",
"of",
"a",
"docblock"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L279-L285 |
24,054 | nabab/bbn | src/bbn/parsers/doc.php | doc.group_tags | private function group_tags(array $tags){
$res = [];
if ( !empty($tags) ){
foreach ( $tags as $i => $tag ){
// Skip the 'memberof' tag
if ( $tag['tag'] === 'memberof' ){
continue;
}
$t = $tag['tag'];
unset($tag['tag']);
$res[$t][] = $tag['text'] ??... | php | private function group_tags(array $tags){
$res = [];
if ( !empty($tags) ){
foreach ( $tags as $i => $tag ){
// Skip the 'memberof' tag
if ( $tag['tag'] === 'memberof' ){
continue;
}
$t = $tag['tag'];
unset($tag['tag']);
$res[$t][] = $tag['text'] ??... | [
"private",
"function",
"group_tags",
"(",
"array",
"$",
"tags",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"tags",
")",
")",
"{",
"foreach",
"(",
"$",
"tags",
"as",
"$",
"i",
"=>",
"$",
"tag",
")",
"{",
"// S... | Groups tags by name
@param array $tags The tags list
@return array | [
"Groups",
"tags",
"by",
"name"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L293-L312 |
24,055 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_has_type | private function tag_has_type(string $tag){
return in_array('type', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | php | private function tag_has_type(string $tag){
return in_array('type', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | [
"private",
"function",
"tag_has_type",
"(",
"string",
"$",
"tag",
")",
"{",
"return",
"in_array",
"(",
"'type'",
",",
"array_values",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
"?",
"$",
"this",
"->",
"tags",
"[... | Cheks if a tag has 'type'
@param string $tag The tag name
@return boolean | [
"Cheks",
"if",
"a",
"tag",
"has",
"type"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L320-L326 |
24,056 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_has_default | private function tag_has_default(string $tag){
return in_array('default', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | php | private function tag_has_default(string $tag){
return in_array('default', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | [
"private",
"function",
"tag_has_default",
"(",
"string",
"$",
"tag",
")",
"{",
"return",
"in_array",
"(",
"'default'",
",",
"array_values",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
"?",
"$",
"this",
"->",
"tags"... | Cheks if a tag has 'default'
@param string $tag The tag name
@return boolean | [
"Cheks",
"if",
"a",
"tag",
"has",
"default"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L334-L340 |
24,057 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_has_name | private function tag_has_name(string $tag){
return in_array('name', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | php | private function tag_has_name(string $tag){
return in_array('name', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | [
"private",
"function",
"tag_has_name",
"(",
"string",
"$",
"tag",
")",
"{",
"return",
"in_array",
"(",
"'name'",
",",
"array_values",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
"?",
"$",
"this",
"->",
"tags",
"[... | Cheks if a tag has 'name'
@param string $tag The tag name
@return boolean | [
"Cheks",
"if",
"a",
"tag",
"has",
"name"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L348-L354 |
24,058 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_has_desc | private function tag_has_desc(string $tag){
return in_array('description', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | php | private function tag_has_desc(string $tag){
return in_array('description', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | [
"private",
"function",
"tag_has_desc",
"(",
"string",
"$",
"tag",
")",
"{",
"return",
"in_array",
"(",
"'description'",
",",
"array_values",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
"?",
"$",
"this",
"->",
"tags... | Cheks if a tag has 'description'
@param string $tag The tag name
@return boolean | [
"Cheks",
"if",
"a",
"tag",
"has",
"description"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L362-L368 |
24,059 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_has_text | private function tag_has_text(string $tag){
return in_array('text', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | php | private function tag_has_text(string $tag){
return in_array('text', array_values(
\is_array($this->tags[$tag]) ?
$this->tags[$tag] :
$this->tags[$this->tags[$tag]]
));
} | [
"private",
"function",
"tag_has_text",
"(",
"string",
"$",
"tag",
")",
"{",
"return",
"in_array",
"(",
"'text'",
",",
"array_values",
"(",
"\\",
"is_array",
"(",
"$",
"this",
"->",
"tags",
"[",
"$",
"tag",
"]",
")",
"?",
"$",
"this",
"->",
"tags",
"[... | Cheks if a tag has 'text'
@param string $tag The tag name
@return boolean | [
"Cheks",
"if",
"a",
"tag",
"has",
"text"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L376-L382 |
24,060 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_get_type | private function tag_get_type(string $text){
if (
($this->mode === 'js') ||
($this->mode === 'vue')
){
preg_match('/(?:\{)(.+)(?:\})/', $text, $type, PREG_OFFSET_CAPTURE);
}
else if ( $this->mode === 'php' ){
preg_match('/(?:\@[a-z]+\s{1})(.+)(?:\s{1}\$)/', $text, $type, PREG_OFF... | php | private function tag_get_type(string $text){
if (
($this->mode === 'js') ||
($this->mode === 'vue')
){
preg_match('/(?:\{)(.+)(?:\})/', $text, $type, PREG_OFFSET_CAPTURE);
}
else if ( $this->mode === 'php' ){
preg_match('/(?:\@[a-z]+\s{1})(.+)(?:\s{1}\$)/', $text, $type, PREG_OFF... | [
"private",
"function",
"tag_get_type",
"(",
"string",
"$",
"text",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"mode",
"===",
"'js'",
")",
"||",
"(",
"$",
"this",
"->",
"mode",
"===",
"'vue'",
")",
")",
"{",
"preg_match",
"(",
"'/(?:\\{)(.+)(?:\\})/'"... | Gets tag 'type'
@param string $text The tag text
@return array | [
"Gets",
"tag",
"type"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L390-L402 |
24,061 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_get_default | private function tag_get_default(string $text){
if (
($this->mode === 'js') ||
($this->mode === 'vue')
){
preg_match('/(?:\[)(.+)(?:\])/', $text, $def, PREG_OFFSET_CAPTURE);
}
return $def;
} | php | private function tag_get_default(string $text){
if (
($this->mode === 'js') ||
($this->mode === 'vue')
){
preg_match('/(?:\[)(.+)(?:\])/', $text, $def, PREG_OFFSET_CAPTURE);
}
return $def;
} | [
"private",
"function",
"tag_get_default",
"(",
"string",
"$",
"text",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"mode",
"===",
"'js'",
")",
"||",
"(",
"$",
"this",
"->",
"mode",
"===",
"'vue'",
")",
")",
"{",
"preg_match",
"(",
"'/(?:\\[)(.+)(?:\\])... | Gets tag 'default'
@param string $text The tag text
@return array | [
"Gets",
"tag",
"default"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L410-L418 |
24,062 | nabab/bbn | src/bbn/parsers/doc.php | doc.tag_get_name | private function tag_get_name(string $text){
if (
($this->mode === 'js') ||
($this->mode === 'vue')
){
//preg_match('/\w+/', $text, $name, PREG_OFFSET_CAPTURE);
preg_match('/[[:graph:]]+/', $text, $name, PREG_OFFSET_CAPTURE);
}
else if ( $this->mode === 'php' ){
preg_match(... | php | private function tag_get_name(string $text){
if (
($this->mode === 'js') ||
($this->mode === 'vue')
){
//preg_match('/\w+/', $text, $name, PREG_OFFSET_CAPTURE);
preg_match('/[[:graph:]]+/', $text, $name, PREG_OFFSET_CAPTURE);
}
else if ( $this->mode === 'php' ){
preg_match(... | [
"private",
"function",
"tag_get_name",
"(",
"string",
"$",
"text",
")",
"{",
"if",
"(",
"(",
"$",
"this",
"->",
"mode",
"===",
"'js'",
")",
"||",
"(",
"$",
"this",
"->",
"mode",
"===",
"'vue'",
")",
")",
"{",
"//preg_match('/\\w+/', $text, $name, PREG_OFFS... | Gets tag 'name'
@param string $text The tag text
@return array | [
"Gets",
"tag",
"name"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L426-L438 |
24,063 | nabab/bbn | src/bbn/parsers/doc.php | doc.get | private function get(string $tag, string $memberof = '', bool $grouped = true){
if ( empty($this->parsed) ){
$this->parse();
}
if ( !empty($this->parsed) ){
$res = [];
foreach ( $this->parsed as $p ){
if (
!empty($p['tags']) &&
(($i = \bbn\x::find($p['tags'], ['... | php | private function get(string $tag, string $memberof = '', bool $grouped = true){
if ( empty($this->parsed) ){
$this->parse();
}
if ( !empty($this->parsed) ){
$res = [];
foreach ( $this->parsed as $p ){
if (
!empty($p['tags']) &&
(($i = \bbn\x::find($p['tags'], ['... | [
"private",
"function",
"get",
"(",
"string",
"$",
"tag",
",",
"string",
"$",
"memberof",
"=",
"''",
",",
"bool",
"$",
"grouped",
"=",
"true",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"parsed",
")",
")",
"{",
"$",
"this",
"->",
"parse... | Parses the parsed array to get an array of the given tag
@param string $tag The tag name
@param string $memberof The parent tag name
@return array|false | [
"Parses",
"the",
"parsed",
"array",
"to",
"get",
"an",
"array",
"of",
"the",
"given",
"tag"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L447-L488 |
24,064 | nabab/bbn | src/bbn/parsers/doc.php | doc.get_components | private function get_components(string $memberof = ''){
$res = [];
if ( $components = $this->get('component', $memberof) ){
foreach ( $components as $comp ){
if ( !empty($comp['name']) ){
$res[] = array_merge($comp, $this->get_vue($comp['name']));
}
}
}
return $res;... | php | private function get_components(string $memberof = ''){
$res = [];
if ( $components = $this->get('component', $memberof) ){
foreach ( $components as $comp ){
if ( !empty($comp['name']) ){
$res[] = array_merge($comp, $this->get_vue($comp['name']));
}
}
}
return $res;... | [
"private",
"function",
"get_components",
"(",
"string",
"$",
"memberof",
"=",
"''",
")",
"{",
"$",
"res",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"components",
"=",
"$",
"this",
"->",
"get",
"(",
"'component'",
",",
"$",
"memberof",
")",
")",
"{",
"for... | Gets an array of 'component' tags
@param string $memberof The parent tag name
@return array|false | [
"Gets",
"an",
"array",
"of",
"component",
"tags"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L566-L576 |
24,065 | nabab/bbn | src/bbn/parsers/doc.php | doc.set_source | public function set_source(string $src){
$this->source = is_file($src) ? file_get_contents($src) : $src;
$this->parsed = [];
return $this;
} | php | public function set_source(string $src){
$this->source = is_file($src) ? file_get_contents($src) : $src;
$this->parsed = [];
return $this;
} | [
"public",
"function",
"set_source",
"(",
"string",
"$",
"src",
")",
"{",
"$",
"this",
"->",
"source",
"=",
"is_file",
"(",
"$",
"src",
")",
"?",
"file_get_contents",
"(",
"$",
"src",
")",
":",
"$",
"src",
";",
"$",
"this",
"->",
"parsed",
"=",
"[",... | Sets the source to parse
@param string $src The source code or an absolute file path
@return \bbn\parsers\doc | [
"Sets",
"the",
"source",
"to",
"parse"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L616-L620 |
24,066 | nabab/bbn | src/bbn/parsers/doc.php | doc.set_mode | public function set_mode(string $mode){
if ( !empty($mode) && in_array($mode, $this->modes) ){
$this->mode = $mode;
return $this;
}
die(_('Error: mode not allowed.'));
} | php | public function set_mode(string $mode){
if ( !empty($mode) && in_array($mode, $this->modes) ){
$this->mode = $mode;
return $this;
}
die(_('Error: mode not allowed.'));
} | [
"public",
"function",
"set_mode",
"(",
"string",
"$",
"mode",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"mode",
")",
"&&",
"in_array",
"(",
"$",
"mode",
",",
"$",
"this",
"->",
"modes",
")",
")",
"{",
"$",
"this",
"->",
"mode",
"=",
"$",
"mo... | Sets the mode
@param string $mode The mode to set
@return \bbn\parsers\doc | [
"Sets",
"the",
"mode"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L628-L634 |
24,067 | nabab/bbn | src/bbn/parsers/doc.php | doc.parse | public function parse(){
preg_match_all($this->pattern['start'], $this->source, $matches, PREG_OFFSET_CAPTURE);
if ( isset($matches[0]) ){
foreach ( $matches[0] as $match ){
preg_match($this->pattern['end'], $this->source, $mat, PREG_OFFSET_CAPTURE, $match[1]);
$start = $match[1];
... | php | public function parse(){
preg_match_all($this->pattern['start'], $this->source, $matches, PREG_OFFSET_CAPTURE);
if ( isset($matches[0]) ){
foreach ( $matches[0] as $match ){
preg_match($this->pattern['end'], $this->source, $mat, PREG_OFFSET_CAPTURE, $match[1]);
$start = $match[1];
... | [
"public",
"function",
"parse",
"(",
")",
"{",
"preg_match_all",
"(",
"$",
"this",
"->",
"pattern",
"[",
"'start'",
"]",
",",
"$",
"this",
"->",
"source",
",",
"$",
"matches",
",",
"PREG_OFFSET_CAPTURE",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"matches"... | Parses the current source
@return array | [
"Parses",
"the",
"current",
"source"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L641-L652 |
24,068 | nabab/bbn | src/bbn/parsers/doc.php | doc.parse_docblock | public function parse_docblock(string $block){
$b = [
'description' => '',
'tags' => []
];
// Remove start pattern
//$block = trim(substr($block, 3));
// Remove end pattern
$block = trim(substr($block, 0, strlen($block) - 2));
// Tags
$tags = $this->get_tags($block);
foreach ( $tags as... | php | public function parse_docblock(string $block){
$b = [
'description' => '',
'tags' => []
];
// Remove start pattern
//$block = trim(substr($block, 3));
// Remove end pattern
$block = trim(substr($block, 0, strlen($block) - 2));
// Tags
$tags = $this->get_tags($block);
foreach ( $tags as... | [
"public",
"function",
"parse_docblock",
"(",
"string",
"$",
"block",
")",
"{",
"$",
"b",
"=",
"[",
"'description'",
"=>",
"''",
",",
"'tags'",
"=>",
"[",
"]",
"]",
";",
"// Remove start pattern",
"//$block = trim(substr($block, 3));",
"// Remove end pattern",
"$",... | Parses a given docblock
@param string $block The docblock
@return array | [
"Parses",
"a",
"given",
"docblock"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L661-L686 |
24,069 | nabab/bbn | src/bbn/parsers/doc.php | doc.get_vue | public function get_vue(string $memberof = ''){
return [
'description' => $this->get_file($memberof),
'methods' => $this->get_methods($memberof),
'events' => $this->get_events($memberof),
'mixins' => $this->get_mixins($memberof),
'props' => $this->get_props($memberof),
'data' => ... | php | public function get_vue(string $memberof = ''){
return [
'description' => $this->get_file($memberof),
'methods' => $this->get_methods($memberof),
'events' => $this->get_events($memberof),
'mixins' => $this->get_mixins($memberof),
'props' => $this->get_props($memberof),
'data' => ... | [
"public",
"function",
"get_vue",
"(",
"string",
"$",
"memberof",
"=",
"''",
")",
"{",
"return",
"[",
"'description'",
"=>",
"$",
"this",
"->",
"get_file",
"(",
"$",
"memberof",
")",
",",
"'methods'",
"=>",
"$",
"this",
"->",
"get_methods",
"(",
"$",
"m... | Gets Vue.js structure
@param string $memberof The parent tag name
@return array | [
"Gets",
"Vue",
".",
"js",
"structure"
] | 439fea2faa0de22fdaae2611833bab8061f40c37 | https://github.com/nabab/bbn/blob/439fea2faa0de22fdaae2611833bab8061f40c37/src/bbn/parsers/doc.php#L708-L721 |
24,070 | WellCommerce/AppBundle | Twig/ClientAddressFormatterExtension.php | ClientAddressFormatterExtension.formatBillingAddress | public function formatBillingAddress(ClientBillingAddress $address, $lineSeparator = self::LINES_SEPARATOR)
{
$lines = [];
$lines[] = sprintf('%s %s', $address->getFirstName(), $address->getLastName());
if ('' !== $address->getCompanyName()) {
$lines[] = $address->getCompanyNam... | php | public function formatBillingAddress(ClientBillingAddress $address, $lineSeparator = self::LINES_SEPARATOR)
{
$lines = [];
$lines[] = sprintf('%s %s', $address->getFirstName(), $address->getLastName());
if ('' !== $address->getCompanyName()) {
$lines[] = $address->getCompanyNam... | [
"public",
"function",
"formatBillingAddress",
"(",
"ClientBillingAddress",
"$",
"address",
",",
"$",
"lineSeparator",
"=",
"self",
"::",
"LINES_SEPARATOR",
")",
"{",
"$",
"lines",
"=",
"[",
"]",
";",
"$",
"lines",
"[",
"]",
"=",
"sprintf",
"(",
"'%s %s'",
... | Formats the billing address
@param ClientBillingAddress $address
@param string $lineSeparator
@return string | [
"Formats",
"the",
"billing",
"address"
] | 2add687d1c898dd0b24afd611d896e3811a0eac3 | https://github.com/WellCommerce/AppBundle/blob/2add687d1c898dd0b24afd611d896e3811a0eac3/Twig/ClientAddressFormatterExtension.php#L52-L64 |
24,071 | xiewulong/yii2-fileupload | oss/libs/guzzle/plugin/Guzzle/Plugin/Oauth/OauthPlugin.php | OauthPlugin.getStringToSign | public function getStringToSign(RequestInterface $request, $timestamp, $nonce)
{
$params = $this->getParamsToSign($request, $timestamp, $nonce);
// Convert booleans to strings.
$params = $this->prepareParameters($params);
// Build signing string from combined params
$parame... | php | public function getStringToSign(RequestInterface $request, $timestamp, $nonce)
{
$params = $this->getParamsToSign($request, $timestamp, $nonce);
// Convert booleans to strings.
$params = $this->prepareParameters($params);
// Build signing string from combined params
$parame... | [
"public",
"function",
"getStringToSign",
"(",
"RequestInterface",
"$",
"request",
",",
"$",
"timestamp",
",",
"$",
"nonce",
")",
"{",
"$",
"params",
"=",
"$",
"this",
"->",
"getParamsToSign",
"(",
"$",
"request",
",",
"$",
"timestamp",
",",
"$",
"nonce",
... | Calculate string to sign
@param RequestInterface $request Request to generate a signature for
@param int $timestamp Timestamp to use for nonce
@param string $nonce
@return string | [
"Calculate",
"string",
"to",
"sign"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/plugin/Guzzle/Plugin/Oauth/OauthPlugin.php#L137-L152 |
24,072 | xiewulong/yii2-fileupload | oss/libs/guzzle/plugin/Guzzle/Plugin/Oauth/OauthPlugin.php | OauthPlugin.getParamsToSign | public function getParamsToSign(RequestInterface $request, $timestamp, $nonce)
{
$params = new Collection(array(
'oauth_consumer_key' => $this->config['consumer_key'],
'oauth_nonce' => $nonce,
'oauth_signature_method' => $this->config['signature_method'],
... | php | public function getParamsToSign(RequestInterface $request, $timestamp, $nonce)
{
$params = new Collection(array(
'oauth_consumer_key' => $this->config['consumer_key'],
'oauth_nonce' => $nonce,
'oauth_signature_method' => $this->config['signature_method'],
... | [
"public",
"function",
"getParamsToSign",
"(",
"RequestInterface",
"$",
"request",
",",
"$",
"timestamp",
",",
"$",
"nonce",
")",
"{",
"$",
"params",
"=",
"new",
"Collection",
"(",
"array",
"(",
"'oauth_consumer_key'",
"=>",
"$",
"this",
"->",
"config",
"[",
... | Parameters sorted and filtered in order to properly sign a request
@param RequestInterface $request Request to generate a signature for
@param integer $timestamp Timestamp to use for nonce
@param string $nonce
@return array | [
"Parameters",
"sorted",
"and",
"filtered",
"in",
"order",
"to",
"properly",
"sign",
"a",
"request"
] | 3e75b17a4a18dd8466e3f57c63136de03470ca82 | https://github.com/xiewulong/yii2-fileupload/blob/3e75b17a4a18dd8466e3f57c63136de03470ca82/oss/libs/guzzle/plugin/Guzzle/Plugin/Oauth/OauthPlugin.php#L163-L196 |
24,073 | OpenBuildings/monetary | src/OpenBuildings/Monetary/Cache.php | Cache.cache_driver | public function cache_driver()
{
if ( ! $this->_cache)
{
$adapter = new DCache_Adapter\File(
realpath(__DIR__.'../../../'.static::CACHE_DIR)
);
$adapter->setOption('ttl', static::CACHE_LIFETIME);
$this->_cache = new DCache\Cache($adapter);
}
return $this->_cache;
} | php | public function cache_driver()
{
if ( ! $this->_cache)
{
$adapter = new DCache_Adapter\File(
realpath(__DIR__.'../../../'.static::CACHE_DIR)
);
$adapter->setOption('ttl', static::CACHE_LIFETIME);
$this->_cache = new DCache\Cache($adapter);
}
return $this->_cache;
} | [
"public",
"function",
"cache_driver",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_cache",
")",
"{",
"$",
"adapter",
"=",
"new",
"DCache_Adapter",
"\\",
"File",
"(",
"realpath",
"(",
"__DIR__",
".",
"'../../../'",
".",
"static",
"::",
"CACHE_DIR",... | Get an instance of the cache helper
@return Desarrolla2\Cache\Cache | [
"Get",
"an",
"instance",
"of",
"the",
"cache",
"helper"
] | f7831ab055eaba7105f3f3530506b96de7fedd29 | https://github.com/OpenBuildings/monetary/blob/f7831ab055eaba7105f3f3530506b96de7fedd29/src/OpenBuildings/Monetary/Cache.php#L32-L44 |
24,074 | comodojo/daemon | src/Comodojo/Daemon/Process.php | Process.signalToEvent | public function signalToEvent($signal) {
if ( $this->pid == ProcessTools::getPid() ) {
$signame = $this->signals->signame($signal);
$this->logger->debug("Received $signame ($signal) signal, firing associated event(s)");
$this->events->emit(new PosixEvent($signal, $this));... | php | public function signalToEvent($signal) {
if ( $this->pid == ProcessTools::getPid() ) {
$signame = $this->signals->signame($signal);
$this->logger->debug("Received $signame ($signal) signal, firing associated event(s)");
$this->events->emit(new PosixEvent($signal, $this));... | [
"public",
"function",
"signalToEvent",
"(",
"$",
"signal",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pid",
"==",
"ProcessTools",
"::",
"getPid",
"(",
")",
")",
"{",
"$",
"signame",
"=",
"$",
"this",
"->",
"signals",
"->",
"signame",
"(",
"$",
"signal"... | The generic signal handler.
It transforms a signal into framework catchable event.
@param int $signal
@return self | [
"The",
"generic",
"signal",
"handler",
"."
] | 361b0a3a91dc7720dd3bec448bb4ca47d0ef0292 | https://github.com/comodojo/daemon/blob/361b0a3a91dc7720dd3bec448bb4ca47d0ef0292/src/Comodojo/Daemon/Process.php#L81-L96 |
24,075 | thecodingmachine/mvc.splash-common | src/Mouf/Mvc/Splash/Routers/PhpVarsCheckRouter.php | PhpVarsCheckRouter.getMinInConfiguration | private function getMinInConfiguration($val1, $val2)
{
if ($val1 && $val2) {
return min(array($val1, $val2));
}
if ($val1) {
return $val1;
}
if ($val2) {
return $val2;
}
return null;
} | php | private function getMinInConfiguration($val1, $val2)
{
if ($val1 && $val2) {
return min(array($val1, $val2));
}
if ($val1) {
return $val1;
}
if ($val2) {
return $val2;
}
return null;
} | [
"private",
"function",
"getMinInConfiguration",
"(",
"$",
"val1",
",",
"$",
"val2",
")",
"{",
"if",
"(",
"$",
"val1",
"&&",
"$",
"val2",
")",
"{",
"return",
"min",
"(",
"array",
"(",
"$",
"val1",
",",
"$",
"val2",
")",
")",
";",
"}",
"if",
"(",
... | Get the min in 2 values if there exist.
@param int $val1
@param int $val2
@return int|NULL | [
"Get",
"the",
"min",
"in",
"2",
"values",
"if",
"there",
"exist",
"."
] | eed0269ceda4d7d090a330a220490906a7aa60bd | https://github.com/thecodingmachine/mvc.splash-common/blob/eed0269ceda4d7d090a330a220490906a7aa60bd/src/Mouf/Mvc/Splash/Routers/PhpVarsCheckRouter.php#L39-L52 |
24,076 | thecodingmachine/mvc.splash-common | src/Mouf/Mvc/Splash/Routers/PhpVarsCheckRouter.php | PhpVarsCheckRouter.iniGetBytes | private static function iniGetBytes($val)
{
$val = trim(ini_get($val));
if ($val != '') {
$last = strtolower(
$val{strlen($val) - 1}
);
} else {
$last = '';
}
$val = (int) $val;
switch ($last) {
// The 'G... | php | private static function iniGetBytes($val)
{
$val = trim(ini_get($val));
if ($val != '') {
$last = strtolower(
$val{strlen($val) - 1}
);
} else {
$last = '';
}
$val = (int) $val;
switch ($last) {
// The 'G... | [
"private",
"static",
"function",
"iniGetBytes",
"(",
"$",
"val",
")",
"{",
"$",
"val",
"=",
"trim",
"(",
"ini_get",
"(",
"$",
"val",
")",
")",
";",
"if",
"(",
"$",
"val",
"!=",
"''",
")",
"{",
"$",
"last",
"=",
"strtolower",
"(",
"$",
"val",
"{... | Returns the number of bytes from php.ini parameter.
@param $val
@return int|string | [
"Returns",
"the",
"number",
"of",
"bytes",
"from",
"php",
".",
"ini",
"parameter",
"."
] | eed0269ceda4d7d090a330a220490906a7aa60bd | https://github.com/thecodingmachine/mvc.splash-common/blob/eed0269ceda4d7d090a330a220490906a7aa60bd/src/Mouf/Mvc/Splash/Routers/PhpVarsCheckRouter.php#L61-L83 |
24,077 | mergado/mergado-api-client-php | src/mergadoclient/HttpClient.php | HttpClient.requestAsync | public function requestAsync($url, $method = 'GET', $data = [])
{
$stack = HandlerStack::create();
$stack->push(ApiMiddleware::auth());
$client = new Client(['handler' => $stack]);
$promise = $client->requestAsync($method, $url, [
'headers' => [
'Authori... | php | public function requestAsync($url, $method = 'GET', $data = [])
{
$stack = HandlerStack::create();
$stack->push(ApiMiddleware::auth());
$client = new Client(['handler' => $stack]);
$promise = $client->requestAsync($method, $url, [
'headers' => [
'Authori... | [
"public",
"function",
"requestAsync",
"(",
"$",
"url",
",",
"$",
"method",
"=",
"'GET'",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"stack",
"=",
"HandlerStack",
"::",
"create",
"(",
")",
";",
"$",
"stack",
"->",
"push",
"(",
"ApiMiddleware",
... | Guzzle async request
@param $url
@param string $method
@param array $data
@return \GuzzleHttp\Promise\PromiseInterface | [
"Guzzle",
"async",
"request"
] | 6c13b994a81bf5a3d6f3f791ea1dfbe2c420565f | https://github.com/mergado/mergado-api-client-php/blob/6c13b994a81bf5a3d6f3f791ea1dfbe2c420565f/src/mergadoclient/HttpClient.php#L78-L95 |
24,078 | mergado/mergado-api-client-php | src/mergadoclient/HttpClient.php | HttpClient.requestCurl | public function requestCurl($url, $method = 'GET', $data = [])
{
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
... | php | public function requestCurl($url, $method = 'GET', $data = [])
{
$data_string = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
... | [
"public",
"function",
"requestCurl",
"(",
"$",
"url",
",",
"$",
"method",
"=",
"'GET'",
",",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"$",
"data_string",
"=",
"json_encode",
"(",
"$",
"data",
")",
";",
"$",
"ch",
"=",
"curl_init",
"(",
"$",
"url",
"... | Curl request - instead of Guzzle
@param $url
@param string $method
@param array $data
@return array|mixed
@throws UnauthorizedException
@throws \Exception | [
"Curl",
"request",
"-",
"instead",
"of",
"Guzzle"
] | 6c13b994a81bf5a3d6f3f791ea1dfbe2c420565f | https://github.com/mergado/mergado-api-client-php/blob/6c13b994a81bf5a3d6f3f791ea1dfbe2c420565f/src/mergadoclient/HttpClient.php#L106-L132 |
24,079 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/delivery_status_parser.php | ezcMailDeliveryStatusParser.parseBody | public function parseBody( $line )
{
$this->parseHeader( $line, $this->headers );
$this->size += strlen( $line );
} | php | public function parseBody( $line )
{
$this->parseHeader( $line, $this->headers );
$this->size += strlen( $line );
} | [
"public",
"function",
"parseBody",
"(",
"$",
"line",
")",
"{",
"$",
"this",
"->",
"parseHeader",
"(",
"$",
"line",
",",
"$",
"this",
"->",
"headers",
")",
";",
"$",
"this",
"->",
"size",
"+=",
"strlen",
"(",
"$",
"line",
")",
";",
"}"
] | Parses each line of the mail part.
@param string $line | [
"Parses",
"each",
"line",
"of",
"the",
"mail",
"part",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/delivery_status_parser.php#L62-L66 |
24,080 | Eresus/EresusCMS | src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/delivery_status_parser.php | ezcMailDeliveryStatusParser.finish | public function finish()
{
unset( $this->part->recipients[$this->section - 1] ); // because one extra recipient is created in parseHeader()
$this->part->size = $this->size;
return $this->part;
} | php | public function finish()
{
unset( $this->part->recipients[$this->section - 1] ); // because one extra recipient is created in parseHeader()
$this->part->size = $this->size;
return $this->part;
} | [
"public",
"function",
"finish",
"(",
")",
"{",
"unset",
"(",
"$",
"this",
"->",
"part",
"->",
"recipients",
"[",
"$",
"this",
"->",
"section",
"-",
"1",
"]",
")",
";",
"// because one extra recipient is created in parseHeader()",
"$",
"this",
"->",
"part",
"... | Returns the ezcMailDeliveryStatus part corresponding to the parsed message.
@return ezcMailDeliveryStatus | [
"Returns",
"the",
"ezcMailDeliveryStatus",
"part",
"corresponding",
"to",
"the",
"parsed",
"message",
"."
] | b0afc661105f0a2f65d49abac13956cc93c5188d | https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/delivery_status_parser.php#L108-L113 |
24,081 | glynnforrest/active-doctrine | src/ActiveDoctrine/Schema/SchemaCreator.php | SchemaCreator.addEntityDirectory | public function addEntityDirectory($namespace, $directory)
{
if (!is_dir($directory)) {
return;
}
$files = new \DirectoryIterator($directory);
foreach ($files as $file) {
if ($file->isDir() && !$file->isDot()) {
$this->addEntityDirectory($name... | php | public function addEntityDirectory($namespace, $directory)
{
if (!is_dir($directory)) {
return;
}
$files = new \DirectoryIterator($directory);
foreach ($files as $file) {
if ($file->isDir() && !$file->isDot()) {
$this->addEntityDirectory($name... | [
"public",
"function",
"addEntityDirectory",
"(",
"$",
"namespace",
",",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"return",
";",
"}",
"$",
"files",
"=",
"new",
"\\",
"DirectoryIterator",
"(",
"$",
"dire... | Add all entity classes in a directory.
@param string $namespace The base namespace of the entities
@param string $directory The directory | [
"Add",
"all",
"entity",
"classes",
"in",
"a",
"directory",
"."
] | fcf8c434c7df4704966107bf9a95c005a0b37168 | https://github.com/glynnforrest/active-doctrine/blob/fcf8c434c7df4704966107bf9a95c005a0b37168/src/ActiveDoctrine/Schema/SchemaCreator.php#L62-L85 |
24,082 | alevilar/ristorantino-vendor | Printers/Utility/Printaitor.php | Printaitor.__createOutput | public static function __createOutput ( $printerId ) {
// cargar datos de la impresora
$Printer = ClassRegistry::init("Printers.Printer");
$Printer->recursive = -1;
$printer = $Printer->read(null, $printerId);
if ( empty($printer['Printer']['output']) ) {
return fals... | php | public static function __createOutput ( $printerId ) {
// cargar datos de la impresora
$Printer = ClassRegistry::init("Printers.Printer");
$Printer->recursive = -1;
$printer = $Printer->read(null, $printerId);
if ( empty($printer['Printer']['output']) ) {
return fals... | [
"public",
"static",
"function",
"__createOutput",
"(",
"$",
"printerId",
")",
"{",
"// cargar datos de la impresora",
"$",
"Printer",
"=",
"ClassRegistry",
"::",
"init",
"(",
"\"Printers.Printer\"",
")",
";",
"$",
"Printer",
"->",
"recursive",
"=",
"-",
"1",
";"... | Gets the name of the printer engine
@return boolean true si hay outut false si no la hay | [
"Gets",
"the",
"name",
"of",
"the",
"printer",
"engine"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Utility/Printaitor.php#L151-L166 |
24,083 | alevilar/ristorantino-vendor | Printers/Utility/Printaitor.php | Printaitor._loadPrinterOutput | public static function _loadPrinterOutput( $outputType ) {
$outputType = ucfirst(strtolower( $outputType ));
$printerOutputName = $outputType."PrinterOutput";
App::uses($printerOutputName, "Printers.PrinterOutput");
self::$PrinterOutput = new $printerOutputName();
} | php | public static function _loadPrinterOutput( $outputType ) {
$outputType = ucfirst(strtolower( $outputType ));
$printerOutputName = $outputType."PrinterOutput";
App::uses($printerOutputName, "Printers.PrinterOutput");
self::$PrinterOutput = new $printerOutputName();
} | [
"public",
"static",
"function",
"_loadPrinterOutput",
"(",
"$",
"outputType",
")",
"{",
"$",
"outputType",
"=",
"ucfirst",
"(",
"strtolower",
"(",
"$",
"outputType",
")",
")",
";",
"$",
"printerOutputName",
"=",
"$",
"outputType",
".",
"\"PrinterOutput\"",
";"... | Instanciates an Engine for change Output Printing
@param string $outputType
Actualmente pueden ser la opciones: "cups" o "file"
@return PrinterOutput or false | [
"Instanciates",
"an",
"Engine",
"for",
"change",
"Output",
"Printing"
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Utility/Printaitor.php#L188-L194 |
24,084 | alevilar/ristorantino-vendor | Printers/Utility/Printaitor.php | Printaitor.getView | public static function getView( PrintaitorViewObj $printViewObj ) {
$data = $printViewObj->dataToView;
$printer_id = $printViewObj->printerId;
$templateName = $printViewObj->viewName;
if (empty($printer_id)) {
return -1;
}
$pluginPath = App::path('L... | php | public static function getView( PrintaitorViewObj $printViewObj ) {
$data = $printViewObj->dataToView;
$printer_id = $printViewObj->printerId;
$templateName = $printViewObj->viewName;
if (empty($printer_id)) {
return -1;
}
$pluginPath = App::path('L... | [
"public",
"static",
"function",
"getView",
"(",
"PrintaitorViewObj",
"$",
"printViewObj",
")",
"{",
"$",
"data",
"=",
"$",
"printViewObj",
"->",
"dataToView",
";",
"$",
"printer_id",
"=",
"$",
"printViewObj",
"->",
"printerId",
";",
"$",
"templateName",
"=",
... | Logic for creating the view rendered.
@param PrintaitorViewObj $printViewObj | [
"Logic",
"for",
"creating",
"the",
"view",
"rendered",
"."
] | 6b91a1e20cc0ba09a1968d77e3de6512cfa2d966 | https://github.com/alevilar/ristorantino-vendor/blob/6b91a1e20cc0ba09a1968d77e3de6512cfa2d966/Printers/Utility/Printaitor.php#L204-L246 |
24,085 | alchemy-fr/GeonamesServer-PHP-Plugin | src/Alchemy/Geonames/Connector.php | Connector.search | public function search($place, $limit = 40, $clientIp = null)
{
$parameters = array(
'sort' => 'closeness',
'name' => $place,
'limit' => $limit,
);
if ($clientIp) {
$parameters['client-ip'] = $clientIp;
}
$result = $this->ge... | php | public function search($place, $limit = 40, $clientIp = null)
{
$parameters = array(
'sort' => 'closeness',
'name' => $place,
'limit' => $limit,
);
if ($clientIp) {
$parameters['client-ip'] = $clientIp;
}
$result = $this->ge... | [
"public",
"function",
"search",
"(",
"$",
"place",
",",
"$",
"limit",
"=",
"40",
",",
"$",
"clientIp",
"=",
"null",
")",
"{",
"$",
"parameters",
"=",
"array",
"(",
"'sort'",
"=>",
"'closeness'",
",",
"'name'",
"=>",
"$",
"place",
",",
"'limit'",
"=>"... | Search for a place by its name.
@param string $place
@param integer $limit
@param string $clientIp
@return array
@throws Exception | [
"Search",
"for",
"a",
"place",
"by",
"its",
"name",
"."
] | a14bd64b2badaf65ff03cca37ca52bff65f31152 | https://github.com/alchemy-fr/GeonamesServer-PHP-Plugin/blob/a14bd64b2badaf65ff03cca37ca52bff65f31152/src/Alchemy/Geonames/Connector.php#L43-L60 |
24,086 | alchemy-fr/GeonamesServer-PHP-Plugin | src/Alchemy/Geonames/Connector.php | Connector.get | private function get($endPoint, array $queryParameters = array())
{
$request = $this->client->get($this->serverUri . $endPoint, array(
'accept' => 'application/json'
));
foreach ($queryParameters as $key => $value) {
$request->getQuery()->add($key, $value);
}... | php | private function get($endPoint, array $queryParameters = array())
{
$request = $this->client->get($this->serverUri . $endPoint, array(
'accept' => 'application/json'
));
foreach ($queryParameters as $key => $value) {
$request->getQuery()->add($key, $value);
}... | [
"private",
"function",
"get",
"(",
"$",
"endPoint",
",",
"array",
"$",
"queryParameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"client",
"->",
"get",
"(",
"$",
"this",
"->",
"serverUri",
".",
"$",
"endPoint",
",",... | Executes a GET HTTP query.
@param string $endPoint
@param array $queryParameters
@return array
@throws NotFoundException
@throws TransportException | [
"Executes",
"a",
"GET",
"HTTP",
"query",
"."
] | a14bd64b2badaf65ff03cca37ca52bff65f31152 | https://github.com/alchemy-fr/GeonamesServer-PHP-Plugin/blob/a14bd64b2badaf65ff03cca37ca52bff65f31152/src/Alchemy/Geonames/Connector.php#L113-L139 |
24,087 | heidelpay/PhpDoc | src/phpDocumentor/Parser/Parser.php | Parser.getFilenames | protected function getFilenames(Collection $files)
{
$paths = $files->getFilenames();
if (count($paths) < 1) {
throw new FilesNotFoundException();
}
$this->log('Starting to process ' . count($paths) . ' files');
return $paths;
} | php | protected function getFilenames(Collection $files)
{
$paths = $files->getFilenames();
if (count($paths) < 1) {
throw new FilesNotFoundException();
}
$this->log('Starting to process ' . count($paths) . ' files');
return $paths;
} | [
"protected",
"function",
"getFilenames",
"(",
"Collection",
"$",
"files",
")",
"{",
"$",
"paths",
"=",
"$",
"files",
"->",
"getFilenames",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"paths",
")",
"<",
"1",
")",
"{",
"throw",
"new",
"FilesNotFoundExce... | Extract all filenames from the given collection and output the amount of files.
@param Collection $files
@throws FilesNotFoundException if no files were found.
@return string[] | [
"Extract",
"all",
"filenames",
"from",
"the",
"given",
"collection",
"and",
"output",
"the",
"amount",
"of",
"files",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Parser/Parser.php#L337-L346 |
24,088 | heidelpay/PhpDoc | src/phpDocumentor/Parser/Parser.php | Parser.parseFileIntoDescriptor | protected function parseFileIntoDescriptor(ProjectDescriptorBuilder $builder, $filename)
{
$parser = new File($this);
$parser->parse($filename, $builder);
} | php | protected function parseFileIntoDescriptor(ProjectDescriptorBuilder $builder, $filename)
{
$parser = new File($this);
$parser->parse($filename, $builder);
} | [
"protected",
"function",
"parseFileIntoDescriptor",
"(",
"ProjectDescriptorBuilder",
"$",
"builder",
",",
"$",
"filename",
")",
"{",
"$",
"parser",
"=",
"new",
"File",
"(",
"$",
"this",
")",
";",
"$",
"parser",
"->",
"parse",
"(",
"$",
"filename",
",",
"$"... | Parses a file and creates a Descriptor for it in the project.
@param ProjectDescriptorBuilder $builder
@param string $filename
@return void | [
"Parses",
"a",
"file",
"and",
"creates",
"a",
"Descriptor",
"for",
"it",
"in",
"the",
"project",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Parser/Parser.php#L356-L360 |
24,089 | heidelpay/PhpDoc | src/phpDocumentor/Parser/Parser.php | Parser.logAfterParsingAFile | protected function logAfterParsingAFile($memory)
{
if (!$this->stopwatch) {
return $memory;
}
$lap = $this->stopwatch->lap('parser.parse');
$oldMemory = $memory;
$periods = $lap->getPeriods();
$memory = end($periods)->getMemory();
$this->log(
... | php | protected function logAfterParsingAFile($memory)
{
if (!$this->stopwatch) {
return $memory;
}
$lap = $this->stopwatch->lap('parser.parse');
$oldMemory = $memory;
$periods = $lap->getPeriods();
$memory = end($periods)->getMemory();
$this->log(
... | [
"protected",
"function",
"logAfterParsingAFile",
"(",
"$",
"memory",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"stopwatch",
")",
"{",
"return",
"$",
"memory",
";",
"}",
"$",
"lap",
"=",
"$",
"this",
"->",
"stopwatch",
"->",
"lap",
"(",
"'parser.pars... | Collects the time and duration of processing a file, logs it and returns the new amount of memory in use.
@param integer $memory
@return integer | [
"Collects",
"the",
"time",
"and",
"duration",
"of",
"processing",
"a",
"file",
"logs",
"it",
"and",
"returns",
"the",
"new",
"amount",
"of",
"memory",
"in",
"use",
"."
] | 5ac9e842cbd4cbb70900533b240c131f3515ee02 | https://github.com/heidelpay/PhpDoc/blob/5ac9e842cbd4cbb70900533b240c131f3515ee02/src/phpDocumentor/Parser/Parser.php#L384-L405 |
24,090 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Node/Host.php | Host.serverGetByName | public function serverGetByName($name)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_name"] == $name) return $server;
}
throw new Exception("invalid serverID", 0x400);
} | php | public function serverGetByName($name)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_name"] == $name) return $server;
}
throw new Exception("invalid serverID", 0x400);
} | [
"public",
"function",
"serverGetByName",
"(",
"$",
"name",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"serverList",
"(",
")",
"as",
"$",
"server",
")",
"{",
"if",
"(",
"$",
"server",
"[",
"\"virtualserver_name\"",
"]",
"==",
"$",
"name",
")",
"return... | Returns the first Server object matching the given name.
@param string $name
@throws Exception
@return Server | [
"Returns",
"the",
"first",
"Server",
"object",
"matching",
"the",
"given",
"name",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Host.php#L292-L300 |
24,091 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Node/Host.php | Host.serverGetByUid | public function serverGetByUid($uid)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_unique_identifier"] == $uid) return $server;
}
throw new Exception("invalid serverID", 0x400);
} | php | public function serverGetByUid($uid)
{
foreach($this->serverList() as $server)
{
if($server["virtualserver_unique_identifier"] == $uid) return $server;
}
throw new Exception("invalid serverID", 0x400);
} | [
"public",
"function",
"serverGetByUid",
"(",
"$",
"uid",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"serverList",
"(",
")",
"as",
"$",
"server",
")",
"{",
"if",
"(",
"$",
"server",
"[",
"\"virtualserver_unique_identifier\"",
"]",
"==",
"$",
"uid",
")",... | Returns the first Server object matching the given unique identifier.
@param string $uid
@throws Exception
@return Server | [
"Returns",
"the",
"first",
"Server",
"object",
"matching",
"the",
"given",
"unique",
"identifier",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Host.php#L309-L317 |
24,092 | lukasz-adamski/teamspeak3-framework | src/TeamSpeak3/Node/Host.php | Host.permissionList | public function permissionList()
{
if($this->permissionList === null)
{
$this->fetchPermissionList();
}
foreach($this->permissionList as $permname => $permdata)
{
if(isset($permdata["permcatid"]) && $permdata["permgrant"])
{
continue;
}
$this->permissionList... | php | public function permissionList()
{
if($this->permissionList === null)
{
$this->fetchPermissionList();
}
foreach($this->permissionList as $permname => $permdata)
{
if(isset($permdata["permcatid"]) && $permdata["permgrant"])
{
continue;
}
$this->permissionList... | [
"public",
"function",
"permissionList",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"permissionList",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"fetchPermissionList",
"(",
")",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"permissionList",
"as",
"$",
... | Returns a list of permissions available on the server instance.
@return array | [
"Returns",
"a",
"list",
"of",
"permissions",
"available",
"on",
"the",
"server",
"instance",
"."
] | 39a56eca608da6b56b6aa386a7b5b31dc576c41a | https://github.com/lukasz-adamski/teamspeak3-framework/blob/39a56eca608da6b56b6aa386a7b5b31dc576c41a/src/TeamSpeak3/Node/Host.php#L457-L487 |
24,093 | siad007/versioncontrol_hg | src/Command/AbstractCommand.php | AbstractCommand.execute | public function execute()
{
$output = [];
$code = 0;
exec(sprintf($this->command, $this->hgPath, $this) . " 2>&1", $output, $code);
if ($code != 0) {
throw new \RuntimeException(
'An error occurred while using VersionControl_HG; hg returned: '
... | php | public function execute()
{
$output = [];
$code = 0;
exec(sprintf($this->command, $this->hgPath, $this) . " 2>&1", $output, $code);
if ($code != 0) {
throw new \RuntimeException(
'An error occurred while using VersionControl_HG; hg returned: '
... | [
"public",
"function",
"execute",
"(",
")",
"{",
"$",
"output",
"=",
"[",
"]",
";",
"$",
"code",
"=",
"0",
";",
"exec",
"(",
"sprintf",
"(",
"$",
"this",
"->",
"command",
",",
"$",
"this",
"->",
"hgPath",
",",
"$",
"this",
")",
".",
"\" 2>&1\"",
... | Execute mercurial command.
@return string
@throws \RuntimeException | [
"Execute",
"mercurial",
"command",
"."
] | e02ec9f1e88efae48f0e3296f65b1d99718b27cd | https://github.com/siad007/versioncontrol_hg/blob/e02ec9f1e88efae48f0e3296f65b1d99718b27cd/src/Command/AbstractCommand.php#L146-L162 |
24,094 | siad007/versioncontrol_hg | src/Command/AbstractCommand.php | AbstractCommand.assembleOptionString | protected function assembleOptionString()
{
$optionString = '';
foreach ($this->options as $name => $option) {
if ($option === true) {
$optionString .= " {$name}";
} elseif (is_string($option) && $option !== '') {
$optionString .= " {$name} " ... | php | protected function assembleOptionString()
{
$optionString = '';
foreach ($this->options as $name => $option) {
if ($option === true) {
$optionString .= " {$name}";
} elseif (is_string($option) && $option !== '') {
$optionString .= " {$name} " ... | [
"protected",
"function",
"assembleOptionString",
"(",
")",
"{",
"$",
"optionString",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"options",
"as",
"$",
"name",
"=>",
"$",
"option",
")",
"{",
"if",
"(",
"$",
"option",
"===",
"true",
")",
"{",
"$... | Concatinates string options.
@return string | [
"Concatinates",
"string",
"options",
"."
] | e02ec9f1e88efae48f0e3296f65b1d99718b27cd | https://github.com/siad007/versioncontrol_hg/blob/e02ec9f1e88efae48f0e3296f65b1d99718b27cd/src/Command/AbstractCommand.php#L235-L250 |
24,095 | siad007/versioncontrol_hg | src/Command/AbstractCommand.php | AbstractCommand.getCommandName | private function getCommandName()
{
$className = implode('', array_slice(explode('\\', get_class($this)), -1));
$commandName = str_replace('command', '', strtolower($className));
return $commandName;
} | php | private function getCommandName()
{
$className = implode('', array_slice(explode('\\', get_class($this)), -1));
$commandName = str_replace('command', '', strtolower($className));
return $commandName;
} | [
"private",
"function",
"getCommandName",
"(",
")",
"{",
"$",
"className",
"=",
"implode",
"(",
"''",
",",
"array_slice",
"(",
"explode",
"(",
"'\\\\'",
",",
"get_class",
"(",
"$",
"this",
")",
")",
",",
"-",
"1",
")",
")",
";",
"$",
"commandName",
"=... | Returns the concrete commands name.
@return string | [
"Returns",
"the",
"concrete",
"commands",
"name",
"."
] | e02ec9f1e88efae48f0e3296f65b1d99718b27cd | https://github.com/siad007/versioncontrol_hg/blob/e02ec9f1e88efae48f0e3296f65b1d99718b27cd/src/Command/AbstractCommand.php#L257-L263 |
24,096 | comodojo/daemon | src/Comodojo/Daemon/Worker/Manager.php | Manager.install | public function install(
WorkerInterface $worker,
$looptime = 1,
$forever = false
) {
$name = $worker->getName();
if ( $this->isInstalled($name) ) {
throw new Exception("Worker already installed");
}
$w = Worker::create()
->setInstan... | php | public function install(
WorkerInterface $worker,
$looptime = 1,
$forever = false
) {
$name = $worker->getName();
if ( $this->isInstalled($name) ) {
throw new Exception("Worker already installed");
}
$w = Worker::create()
->setInstan... | [
"public",
"function",
"install",
"(",
"WorkerInterface",
"$",
"worker",
",",
"$",
"looptime",
"=",
"1",
",",
"$",
"forever",
"=",
"false",
")",
"{",
"$",
"name",
"=",
"$",
"worker",
"->",
"getName",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isI... | Install a worker into the stack
@param WorkerInterface $worker
@param int $looptime
@param bool $forever
@return Manager | [
"Install",
"a",
"worker",
"into",
"the",
"stack"
] | 361b0a3a91dc7720dd3bec448bb4ca47d0ef0292 | https://github.com/comodojo/daemon/blob/361b0a3a91dc7720dd3bec448bb4ca47d0ef0292/src/Comodojo/Daemon/Worker/Manager.php#L80-L103 |
24,097 | dragonmantank/fillet | src/Fillet/TextUtils/GenerateSlug.php | GenerateSlug.generateSlug | public function generateSlug($title)
{
$title = strtolower($title);
$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
$title = preg_replace('/\s+/', '-', $title);
$title = preg_replace('|-+|', '-', $title);
$title = trim($title, '-');
return $title;
} | php | public function generateSlug($title)
{
$title = strtolower($title);
$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
$title = preg_replace('/\s+/', '-', $title);
$title = preg_replace('|-+|', '-', $title);
$title = trim($title, '-');
return $title;
} | [
"public",
"function",
"generateSlug",
"(",
"$",
"title",
")",
"{",
"$",
"title",
"=",
"strtolower",
"(",
"$",
"title",
")",
";",
"$",
"title",
"=",
"preg_replace",
"(",
"'/[^%a-z0-9 _-]/'",
",",
"''",
",",
"$",
"title",
")",
";",
"$",
"title",
"=",
"... | Generate an appropriate slug from a title
This function will turn a title into a lowercase and hyphenated title that is compatible with how Sculpin expects
slugs.
@param string $title Raw title
@return string | [
"Generate",
"an",
"appropriate",
"slug",
"from",
"a",
"title",
"This",
"function",
"will",
"turn",
"a",
"title",
"into",
"a",
"lowercase",
"and",
"hyphenated",
"title",
"that",
"is",
"compatible",
"with",
"how",
"Sculpin",
"expects",
"slugs",
"."
] | b197947608c05ac2318e8f6b296345494004d9c6 | https://github.com/dragonmantank/fillet/blob/b197947608c05ac2318e8f6b296345494004d9c6/src/Fillet/TextUtils/GenerateSlug.php#L21-L30 |
24,098 | sciactive/nymph-server | src/Drivers/DriverTrait.php | DriverTrait.entityReferenceSearch | protected function entityReferenceSearch($value, $entity) {
if (!is_array($value) && !($value instanceof Traversable)) {
return false;
}
if (!isset($entity)) {
throw new Exceptions\InvalidParametersException();
}
// Get the GUID, if the passed $entity is an object.
if (is_array($enti... | php | protected function entityReferenceSearch($value, $entity) {
if (!is_array($value) && !($value instanceof Traversable)) {
return false;
}
if (!isset($entity)) {
throw new Exceptions\InvalidParametersException();
}
// Get the GUID, if the passed $entity is an object.
if (is_array($enti... | [
"protected",
"function",
"entityReferenceSearch",
"(",
"$",
"value",
",",
"$",
"entity",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"value",
")",
"&&",
"!",
"(",
"$",
"value",
"instanceof",
"Traversable",
")",
")",
"{",
"return",
"false",
";",
"}"... | Search through a value for an entity reference.
@param mixed $value Any value to search.
@param array|Entity|int $entity An entity, GUID, or array of either to
search for.
@return bool True if the reference is found, false otherwise.
@access protected | [
"Search",
"through",
"a",
"value",
"for",
"an",
"entity",
"reference",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/DriverTrait.php#L469-L500 |
24,099 | sciactive/nymph-server | src/Drivers/DriverTrait.php | DriverTrait.pullCache | protected function pullCache($guid, $className) {
// Increment the entity access count.
if (!isset($this->entityCount[$guid])) {
$this->entityCount[$guid] = 0;
}
$this->entityCount[$guid]++;
if (isset($this->entityCache[$guid][$className])) {
return (clone $this->entityCache[$guid][$clas... | php | protected function pullCache($guid, $className) {
// Increment the entity access count.
if (!isset($this->entityCount[$guid])) {
$this->entityCount[$guid] = 0;
}
$this->entityCount[$guid]++;
if (isset($this->entityCache[$guid][$className])) {
return (clone $this->entityCache[$guid][$clas... | [
"protected",
"function",
"pullCache",
"(",
"$",
"guid",
",",
"$",
"className",
")",
"{",
"// Increment the entity access count.",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"entityCount",
"[",
"$",
"guid",
"]",
")",
")",
"{",
"$",
"this",
"->",
"en... | Pull an entity from the cache.
@param int $guid The entity's GUID.
@param string $className The entity's class.
@return Entity|null The entity or null if it's not cached.
@access protected | [
"Pull",
"an",
"entity",
"from",
"the",
"cache",
"."
] | 3c18dbf45c2750d07c798e14534dba87387beeba | https://github.com/sciactive/nymph-server/blob/3c18dbf45c2750d07c798e14534dba87387beeba/src/Drivers/DriverTrait.php#L839-L849 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.