repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listUserReposPaginate
public function listUserReposPaginate($authorization, $pageURL) { $instance = new listUserReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listUserReposPaginate($authorization, $pageURL) { $instance = new listUserReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listUserReposPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listUserReposPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",",...
listUserReposPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cas...
[ "listUserReposPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2208-L2211
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listOrgReposPaginate
public function listOrgReposPaginate($authorization, $pageURL) { $instance = new listOrgReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listOrgReposPaginate($authorization, $pageURL) { $instance = new listOrgReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listOrgReposPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listOrgReposPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",", ...
listOrgReposPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cast...
[ "listOrgReposPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2225-L2228
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listPublicReposPaginate
public function listPublicReposPaginate($authorization, $pageURL) { $instance = new listPublicReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listPublicReposPaginate($authorization, $pageURL) { $instance = new listPublicReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listPublicReposPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listPublicReposPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ...
listPublicReposPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be c...
[ "listPublicReposPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2242-L2245
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.getRepoPaginate
public function getRepoPaginate($authorization, $pageURL) { $instance = new getRepoPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function getRepoPaginate($authorization, $pageURL) { $instance = new getRepoPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "getRepoPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "getRepoPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",", "$", "p...
getRepoPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cast to a...
[ "getRepoPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2259-L2262
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listRepoContributorsPaginate
public function listRepoContributorsPaginate($authorization, $pageURL) { $instance = new listRepoContributorsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listRepoContributorsPaginate($authorization, $pageURL) { $instance = new listRepoContributorsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listRepoContributorsPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listRepoContributorsPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(",...
listRepoContributorsPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can...
[ "listRepoContributorsPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2276-L2279
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listRepoLanguagesPaginate
public function listRepoLanguagesPaginate($authorization, $pageURL) { $instance = new listRepoLanguagesPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listRepoLanguagesPaginate($authorization, $pageURL) { $instance = new listRepoLanguagesPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listRepoLanguagesPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listRepoLanguagesPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")"...
listRepoLanguagesPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be...
[ "listRepoLanguagesPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2293-L2296
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listRepoTeamsPaginate
public function listRepoTeamsPaginate($authorization, $pageURL) { $instance = new listRepoTeamsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listRepoTeamsPaginate($authorization, $pageURL) { $instance = new listRepoTeamsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listRepoTeamsPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listRepoTeamsPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",",...
listRepoTeamsPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cas...
[ "listRepoTeamsPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2310-L2313
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listRepoTagsPaginate
public function listRepoTagsPaginate($authorization, $pageURL) { $instance = new listRepoTagsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listRepoTagsPaginate($authorization, $pageURL) { $instance = new listRepoTagsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listRepoTagsPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listRepoTagsPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",", ...
listRepoTagsPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cast...
[ "listRepoTagsPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2327-L2330
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listRepoBranchesPaginate
public function listRepoBranchesPaginate($authorization, $pageURL) { $instance = new listRepoBranchesPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listRepoBranchesPaginate($authorization, $pageURL) { $instance = new listRepoBranchesPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listRepoBranchesPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listRepoBranchesPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ...
listRepoBranchesPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be ...
[ "listRepoBranchesPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2344-L2347
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.getRepoBranchPaginate
public function getRepoBranchPaginate($authorization, $pageURL) { $instance = new getRepoBranchPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function getRepoBranchPaginate($authorization, $pageURL) { $instance = new getRepoBranchPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "getRepoBranchPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "getRepoBranchPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",",...
getRepoBranchPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cas...
[ "getRepoBranchPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2361-L2364
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.searchReposPaginate
public function searchReposPaginate($authorization, $pageURL) { $instance = new searchReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function searchReposPaginate($authorization, $pageURL) { $instance = new searchReposPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "searchReposPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "searchReposPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",", "...
searchReposPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cast ...
[ "searchReposPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2378-L2381
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.listUserEmailsPaginate
public function listUserEmailsPaginate($authorization, $pageURL) { $instance = new listUserEmailsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function listUserEmailsPaginate($authorization, $pageURL) { $instance = new listUserEmailsPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "listUserEmailsPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "listUserEmailsPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",...
listUserEmailsPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be ca...
[ "listUserEmailsPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2395-L2398
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.getUserPaginate
public function getUserPaginate($authorization, $pageURL) { $instance = new getUserPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function getUserPaginate($authorization, $pageURL) { $instance = new getUserPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "getUserPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "getUserPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",", "$", "p...
getUserPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cast to a...
[ "getUserPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2412-L2415
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.getSelfUserPaginate
public function getSelfUserPaginate($authorization, $pageURL) { $instance = new getSelfUserPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
php
public function getSelfUserPaginate($authorization, $pageURL) { $instance = new getSelfUserPaginate($this, $authorization, $this->getUserAgent(), $pageURL); return $instance; }
[ "public", "function", "getSelfUserPaginate", "(", "$", "authorization", ",", "$", "pageURL", ")", "{", "$", "instance", "=", "new", "getSelfUserPaginate", "(", "$", "this", ",", "$", "authorization", ",", "$", "this", "->", "getUserAgent", "(", ")", ",", "...
getSelfUserPaginate @param GithubService\AuthToken $Authorization The token to use for the request. This should either be an a complete token in the format appropriate format e.g. 'token 123567890' for an oauth token, or '"Basic ".base64_encode($username.":".$password)"' for a Basic token or anything that can be cast ...
[ "getSelfUserPaginate" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2429-L2432
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.execute
public function execute(\Amp\Artax\Request $request, \ArtaxServiceBuilder\Operation $operation) { $originalRequest = clone $request; $cachingHeaders = $this->responseCache->getCachingHeaders($request); $request->setAllHeaders($cachingHeaders); $promise = $this->client->request($request);...
php
public function execute(\Amp\Artax\Request $request, \ArtaxServiceBuilder\Operation $operation) { $originalRequest = clone $request; $cachingHeaders = $this->responseCache->getCachingHeaders($request); $request->setAllHeaders($cachingHeaders); $promise = $this->client->request($request);...
[ "public", "function", "execute", "(", "\\", "Amp", "\\", "Artax", "\\", "Request", "$", "request", ",", "\\", "ArtaxServiceBuilder", "\\", "Operation", "$", "operation", ")", "{", "$", "originalRequest", "=", "clone", "$", "request", ";", "$", "cachingHeader...
execute Sends a request to the API synchronously @param $request \Amp\Artax\Request The request to send. @param $operation \ArtaxServiceBuilder\Operation The response that is called the execute. @return \Amp\Artax\Response The response from Artax
[ "execute" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2455-L2488
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.executeAsync
public function executeAsync(\Amp\Artax\Request $request, \ArtaxServiceBuilder\Operation $operation, callable $callback) { $originalRequest = clone $request; $cachingHeaders = $this->responseCache->getCachingHeaders($request); $request->setAllHeaders($cachingHeaders); $promise = $this->c...
php
public function executeAsync(\Amp\Artax\Request $request, \ArtaxServiceBuilder\Operation $operation, callable $callback) { $originalRequest = clone $request; $cachingHeaders = $this->responseCache->getCachingHeaders($request); $request->setAllHeaders($cachingHeaders); $promise = $this->c...
[ "public", "function", "executeAsync", "(", "\\", "Amp", "\\", "Artax", "\\", "Request", "$", "request", ",", "\\", "ArtaxServiceBuilder", "\\", "Operation", "$", "operation", ",", "callable", "$", "callback", ")", "{", "$", "originalRequest", "=", "clone", "...
executeAsync Execute an operation asynchronously. @param \ArtaxServiceBuilder\Operation $operation The operation to perform @param callable $callback The callback to call on completion/response. The signature of the method should be: function( \Exception $error = null, // null if no error $parsedData = null, //The pa...
[ "executeAsync" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2507-L2558
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.shouldResponseBeCached
public function shouldResponseBeCached(\Amp\Artax\Response $response) { $status = $response->getStatus(); if ($status == 200) { return true; } return false; }
php
public function shouldResponseBeCached(\Amp\Artax\Response $response) { $status = $response->getStatus(); if ($status == 200) { return true; } return false; }
[ "public", "function", "shouldResponseBeCached", "(", "\\", "Amp", "\\", "Artax", "\\", "Response", "$", "response", ")", "{", "$", "status", "=", "$", "response", "->", "getStatus", "(", ")", ";", "if", "(", "$", "status", "==", "200", ")", "{", "retur...
Determine whether the response should be cached. @return boolean
[ "Determine", "whether", "the", "response", "should", "be", "cached", "." ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2574-L2581
Danack/GithubArtaxService
lib/GithubService/GithubArtaxService/GithubArtaxService.php
GithubArtaxService.translateResponseToException
public function translateResponseToException(\Amp\Artax\Response $response) { $status = $response->getStatus(); if ($status < 200 || $status >= 300) { return new BadResponseException( "Status $status is not treated as OK.", $response ); } ...
php
public function translateResponseToException(\Amp\Artax\Response $response) { $status = $response->getStatus(); if ($status < 200 || $status >= 300) { return new BadResponseException( "Status $status is not treated as OK.", $response ); } ...
[ "public", "function", "translateResponseToException", "(", "\\", "Amp", "\\", "Artax", "\\", "Response", "$", "response", ")", "{", "$", "status", "=", "$", "response", "->", "getStatus", "(", ")", ";", "if", "(", "$", "status", "<", "200", "||", "$", ...
Inspect the response and return an exception if it is an error response. * Exceptions should extend \ArtaxServiceBuilder\BadResponseException @return BadResponseException
[ "Inspect", "the", "response", "and", "return", "an", "exception", "if", "it", "is", "an", "error", "response", ".", "*", "Exceptions", "should", "extend", "\\", "ArtaxServiceBuilder", "\\", "BadResponseException" ]
train
https://github.com/Danack/GithubArtaxService/blob/9f62b5be4f413207d4012e7fa084d0ae505680eb/lib/GithubService/GithubArtaxService/GithubArtaxService.php#L2604-L2614
roshangara/parser
src/Parser.php
Parser.fromXml
public function fromXml(string $xml): array { if (!$this->isEmptyValue($xml)) { libxml_use_internal_errors(true); // convert string to xml object $result = simplexml_load_string("$xml", 'SimpleXMLElement', LIBXML_NOCDATA); if ($result) { ret...
php
public function fromXml(string $xml): array { if (!$this->isEmptyValue($xml)) { libxml_use_internal_errors(true); // convert string to xml object $result = simplexml_load_string("$xml", 'SimpleXMLElement', LIBXML_NOCDATA); if ($result) { ret...
[ "public", "function", "fromXml", "(", "string", "$", "xml", ")", ":", "array", "{", "if", "(", "!", "$", "this", "->", "isEmptyValue", "(", "$", "xml", ")", ")", "{", "libxml_use_internal_errors", "(", "true", ")", ";", "// convert string to xml object", "...
Convert xml to array @param string $xml @return array|mixed
[ "Convert", "xml", "to", "array" ]
train
https://github.com/roshangara/parser/blob/24c6c3781fd4416fefb5218daad765b9edbcaa76/src/Parser.php#L27-L57
roshangara/parser
src/Parser.php
Parser.fromXSD
public function fromXSD($xsd): array { if (!$this->isEmptyValue($xsd)) { return $this->fromXml($xsd->output); } return $this->result; }
php
public function fromXSD($xsd): array { if (!$this->isEmptyValue($xsd)) { return $this->fromXml($xsd->output); } return $this->result; }
[ "public", "function", "fromXSD", "(", "$", "xsd", ")", ":", "array", "{", "if", "(", "!", "$", "this", "->", "isEmptyValue", "(", "$", "xsd", ")", ")", "{", "return", "$", "this", "->", "fromXml", "(", "$", "xsd", "->", "output", ")", ";", "}", ...
Convert class to array @param $xsd @return array|mixed
[ "Convert", "class", "to", "array" ]
train
https://github.com/roshangara/parser/blob/24c6c3781fd4416fefb5218daad765b9edbcaa76/src/Parser.php#L81-L89
roshangara/parser
src/Parser.php
Parser.fromJson
public function fromJson(string $json): array { if (!$this->isEmptyValue($json)) { if ($decode = json_decode(trim($json), true) and json_last_error() == JSON_ERROR_NONE) $this->result = $decode; else $this->setError(json_last_error(), json_last_error_...
php
public function fromJson(string $json): array { if (!$this->isEmptyValue($json)) { if ($decode = json_decode(trim($json), true) and json_last_error() == JSON_ERROR_NONE) $this->result = $decode; else $this->setError(json_last_error(), json_last_error_...
[ "public", "function", "fromJson", "(", "string", "$", "json", ")", ":", "array", "{", "if", "(", "!", "$", "this", "->", "isEmptyValue", "(", "$", "json", ")", ")", "{", "if", "(", "$", "decode", "=", "json_decode", "(", "trim", "(", "$", "json", ...
Convert json to array @param string $json @return array|mixed
[ "Convert", "json", "to", "array" ]
train
https://github.com/roshangara/parser/blob/24c6c3781fd4416fefb5218daad765b9edbcaa76/src/Parser.php#L112-L123
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.setSourceList
protected function setSourceList(array $sourceParameters, array $globalParameters = array()) { // Creating as many Source instances as configured in the configuration file foreach ($sourceParameters as $key => $parameters) { if (!isset($parameters['type'])) { throw new Ex...
php
protected function setSourceList(array $sourceParameters, array $globalParameters = array()) { // Creating as many Source instances as configured in the configuration file foreach ($sourceParameters as $key => $parameters) { if (!isset($parameters['type'])) { throw new Ex...
[ "protected", "function", "setSourceList", "(", "array", "$", "sourceParameters", ",", "array", "$", "globalParameters", "=", "array", "(", ")", ")", "{", "// Creating as many Source instances as configured in the configuration file", "foreach", "(", "$", "sourceParameters",...
Creates and adds to the Source object list all the configured Source instances @param array $sourceParameters the configuration parameter array @param array $globalParameters the global configuration parameter array @throws \Msl\ResourceProxy\Exception\BadProxyConfigurationException @return void
[ "Creates", "and", "adds", "to", "the", "Source", "object", "list", "all", "the", "configured", "Source", "instances" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L171-L211
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.processResources
public function processResources() { // Fetching the sources iterator $errors = array(); foreach($this->sourcesIterator as $source) { // Processing all resources associated to the current source object if ($source instanceof SourceInterface) { try { ...
php
public function processResources() { // Fetching the sources iterator $errors = array(); foreach($this->sourcesIterator as $source) { // Processing all resources associated to the current source object if ($source instanceof SourceInterface) { try { ...
[ "public", "function", "processResources", "(", ")", "{", "// Fetching the sources iterator", "$", "errors", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "sourcesIterator", "as", "$", "source", ")", "{", "// Processing all resources associated to t...
Processes all resources associated to the configured source objects for a proxy implementation @throws \Msl\ResourceProxy\Exception\GlobalProcessException @return void
[ "Processes", "all", "resources", "associated", "to", "the", "configured", "source", "objects", "for", "a", "proxy", "implementation" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L222-L261
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.processResourcesBySource
public function processResourcesBySource(SourceInterface $source) { // Getting all resources for the given source and process them (save the content in the configured output folder) // Getting result iterator $resources = $this->getResources($source); // Parsing the resource iterato...
php
public function processResourcesBySource(SourceInterface $source) { // Getting all resources for the given source and process them (save the content in the configured output folder) // Getting result iterator $resources = $this->getResources($source); // Parsing the resource iterato...
[ "public", "function", "processResourcesBySource", "(", "SourceInterface", "$", "source", ")", "{", "// Getting all resources for the given source and process them (save the content in the configured output folder)", "// Getting result iterator", "$", "resources", "=", "$", "this", "-...
Processes all resources associated to the given Source object @param SourceInterface $source the source object to be processed @throws \Msl\ResourceProxy\Exception\SourceGetDataException @throws \Msl\ResourceProxy\Exception\PostParseException @return bool
[ "Processes", "all", "resources", "associated", "to", "the", "given", "Source", "object" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L273-L344
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.processResourcesBySourceName
public function processResourcesBySourceName($sourceName) { // Getting source object $source = $this->getSourceByName($sourceName); if (!$source instanceof SourceInterface) { throw new Exception\SourceNotFoundException( $sourceName, sprintf( ...
php
public function processResourcesBySourceName($sourceName) { // Getting source object $source = $this->getSourceByName($sourceName); if (!$source instanceof SourceInterface) { throw new Exception\SourceNotFoundException( $sourceName, sprintf( ...
[ "public", "function", "processResourcesBySourceName", "(", "$", "sourceName", ")", "{", "// Getting source object", "$", "source", "=", "$", "this", "->", "getSourceByName", "(", "$", "sourceName", ")", ";", "if", "(", "!", "$", "source", "instanceof", "SourceIn...
Processes all resources associated to a Source object for the given source name @param string $sourceName the source name to be processed @return bool @throws \Msl\ResourceProxy\Exception\SourceNotFoundException @throws \Msl\ResourceProxy\Exception\SourceGetDataException @throws \Msl\ResourceProxy\Exception\PostPars...
[ "Processes", "all", "resources", "associated", "to", "a", "Source", "object", "for", "the", "given", "source", "name" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L357-L373
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.getCurrentResources
public function getCurrentResources() { // Getting the current Source element $source = $this->getCurrentSource(); // Getting the data if ($source instanceof SourceInterface) { // Getting result iterator return $this->getResources($source); } ...
php
public function getCurrentResources() { // Getting the current Source element $source = $this->getCurrentSource(); // Getting the data if ($source instanceof SourceInterface) { // Getting result iterator return $this->getResources($source); } ...
[ "public", "function", "getCurrentResources", "(", ")", "{", "// Getting the current Source element", "$", "source", "=", "$", "this", "->", "getCurrentSource", "(", ")", ";", "// Getting the data", "if", "(", "$", "source", "instanceof", "SourceInterface", ")", "{",...
Returns an Iterator instance containing all the resources for the current source object (from the source iterator). @throws \Msl\ResourceProxy\Exception\SourceGetDataException @return null|Iterator
[ "Returns", "an", "Iterator", "instance", "containing", "all", "the", "resources", "for", "the", "current", "source", "object", "(", "from", "the", "source", "iterator", ")", "." ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L385-L396
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.getSourceByName
public function getSourceByName($sourceName) { if (isset($this->sources[$sourceName])) { return $this->sources[$sourceName]; } return null; }
php
public function getSourceByName($sourceName) { if (isset($this->sources[$sourceName])) { return $this->sources[$sourceName]; } return null; }
[ "public", "function", "getSourceByName", "(", "$", "sourceName", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "sources", "[", "$", "sourceName", "]", ")", ")", "{", "return", "$", "this", "->", "sources", "[", "$", "sourceName", "]", ";", "}...
Returns the Source object for the given source name @param string $sourceName the source name @return null|SourceInterface
[ "Returns", "the", "Source", "object", "for", "the", "given", "source", "name" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L439-L445
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.getResources
public function getResources(SourceInterface $source) { // Getting resources iterator try { return $source->getContentIterator(); } catch (\Exception $e) { throw new Exception\SourceGetDataException( sprintf( 'Exception caught while...
php
public function getResources(SourceInterface $source) { // Getting resources iterator try { return $source->getContentIterator(); } catch (\Exception $e) { throw new Exception\SourceGetDataException( sprintf( 'Exception caught while...
[ "public", "function", "getResources", "(", "SourceInterface", "$", "source", ")", "{", "// Getting resources iterator", "try", "{", "return", "$", "source", "->", "getContentIterator", "(", ")", ";", "}", "catch", "(", "\\", "Exception", "$", "e", ")", "{", ...
Returns an Iterator containing all the resources for the given source object @param \Msl\ResourceProxy\Source\SourceInterface $source the source object @throws \Msl\ResourceProxy\Exception\SourceGetDataException @return null|Iterator
[ "Returns", "an", "Iterator", "containing", "all", "the", "resources", "for", "the", "given", "source", "object" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L456-L469
mslib/resource-proxy
Msl/ResourceProxy/Proxy/AbstractProxy.php
AbstractProxy.getResourcesBySourceName
public function getResourcesBySourceName($sourceName) { // Getting source object first $source = $this->getSourceByName($sourceName); // Getting the data if ($source instanceof SourceInterface) { // Getting result iterator try { return $source...
php
public function getResourcesBySourceName($sourceName) { // Getting source object first $source = $this->getSourceByName($sourceName); // Getting the data if ($source instanceof SourceInterface) { // Getting result iterator try { return $source...
[ "public", "function", "getResourcesBySourceName", "(", "$", "sourceName", ")", "{", "// Getting source object first", "$", "source", "=", "$", "this", "->", "getSourceByName", "(", "$", "sourceName", ")", ";", "// Getting the data", "if", "(", "$", "source", "inst...
Returns an Iterator containing all the resources for the given source name @param string $sourceName the source name @throws \Msl\ResourceProxy\Exception\SourceGetDataException @return null|Iterator
[ "Returns", "an", "Iterator", "containing", "all", "the", "resources", "for", "the", "given", "source", "name" ]
train
https://github.com/mslib/resource-proxy/blob/be3f8589753f738f5114443a3465f5e84aecd156/Msl/ResourceProxy/Proxy/AbstractProxy.php#L480-L500
jasny/codeception-module
src/Module.php
Module.initContainer
protected function initContainer() { $container = $this->loadContainer(Configuration::projectDir() . $this->config['container']); if (!$container instanceof ContainerInterface) { throw new \UnexpectedValueException("Failed to get a container from '{$this->config['container']}'"); ...
php
protected function initContainer() { $container = $this->loadContainer(Configuration::projectDir() . $this->config['container']); if (!$container instanceof ContainerInterface) { throw new \UnexpectedValueException("Failed to get a container from '{$this->config['container']}'"); ...
[ "protected", "function", "initContainer", "(", ")", "{", "$", "container", "=", "$", "this", "->", "loadContainer", "(", "Configuration", "::", "projectDir", "(", ")", ".", "$", "this", "->", "config", "[", "'container'", "]", ")", ";", "if", "(", "!", ...
Get the container. @return ContainerInterface
[ "Get", "the", "container", "." ]
train
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L61-L70
jasny/codeception-module
src/Module.php
Module.init
public function init() { $this->container = $this->initContainer(); if ($this->container->has(ServerRequestInterface::class)) { $this->baseRequest = $this->container->get(ServerRequestInterface::class); } if ($this->container->has(ResponseInterface::class)) { ...
php
public function init() { $this->container = $this->initContainer(); if ($this->container->has(ServerRequestInterface::class)) { $this->baseRequest = $this->container->get(ServerRequestInterface::class); } if ($this->container->has(ResponseInterface::class)) { ...
[ "public", "function", "init", "(", ")", "{", "$", "this", "->", "container", "=", "$", "this", "->", "initContainer", "(", ")", ";", "if", "(", "$", "this", "->", "container", "->", "has", "(", "ServerRequestInterface", "::", "class", ")", ")", "{", ...
Initialize the module
[ "Initialize", "the", "module" ]
train
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L109-L120
jasny/codeception-module
src/Module.php
Module._before
public function _before(TestInterface $test) { $this->init(); $this->client = new Connector(); $this->client->setRouter($this->container->get(RouterInterface::class)); if (isset($this->baseRequest)) { $this->client->setBaseRequest($this->baseRequest); } ...
php
public function _before(TestInterface $test) { $this->init(); $this->client = new Connector(); $this->client->setRouter($this->container->get(RouterInterface::class)); if (isset($this->baseRequest)) { $this->client->setBaseRequest($this->baseRequest); } ...
[ "public", "function", "_before", "(", "TestInterface", "$", "test", ")", "{", "$", "this", "->", "init", "(", ")", ";", "$", "this", "->", "client", "=", "new", "Connector", "(", ")", ";", "$", "this", "->", "client", "->", "setRouter", "(", "$", "...
Before each test @param TestInterface $test
[ "Before", "each", "test" ]
train
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L153-L169
jasny/codeception-module
src/Module.php
Module._after
public function _after(TestInterface $test) { if ($this->sessionStatus() === PHP_SESSION_ACTIVE) { $this->sessionDestroy(); } if (isset($this->client) && $this->client instanceof Connector) { $this->client->reset(); if (isset($this->baseReque...
php
public function _after(TestInterface $test) { if ($this->sessionStatus() === PHP_SESSION_ACTIVE) { $this->sessionDestroy(); } if (isset($this->client) && $this->client instanceof Connector) { $this->client->reset(); if (isset($this->baseReque...
[ "public", "function", "_after", "(", "TestInterface", "$", "test", ")", "{", "if", "(", "$", "this", "->", "sessionStatus", "(", ")", "===", "PHP_SESSION_ACTIVE", ")", "{", "$", "this", "->", "sessionDestroy", "(", ")", ";", "}", "if", "(", "isset", "(...
After each test @param TestInterface $test
[ "After", "each", "test" ]
train
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L176-L195
jasny/codeception-module
src/Module.php
Module._failed
public function _failed(TestInterface $test, $fail) { if (isset($this->container) && $this->container->has(ErrorHandlerInterface::class)) { $error = $this->container->get(ErrorHandlerInterface::class)->getError(); if ($error) { $this->debug((string)$error...
php
public function _failed(TestInterface $test, $fail) { if (isset($this->container) && $this->container->has(ErrorHandlerInterface::class)) { $error = $this->container->get(ErrorHandlerInterface::class)->getError(); if ($error) { $this->debug((string)$error...
[ "public", "function", "_failed", "(", "TestInterface", "$", "test", ",", "$", "fail", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "container", ")", "&&", "$", "this", "->", "container", "->", "has", "(", "ErrorHandlerInterface", "::", "class", ...
Called when test fails @param TestInterface $test @param mixed $fail
[ "Called", "when", "test", "fails" ]
train
https://github.com/jasny/codeception-module/blob/5c2b12e4ab291f26424fda9fbf1618c818bc8d6e/src/Module.php#L203-L215
kbond/ControllerUtil
src/EventListener/SerializerViewListener.php
SerializerViewListener.getContent
protected function getContent(View $view, $format) { return $this->serializer->serialize($view->getData(), $format); }
php
protected function getContent(View $view, $format) { return $this->serializer->serialize($view->getData(), $format); }
[ "protected", "function", "getContent", "(", "View", "$", "view", ",", "$", "format", ")", "{", "return", "$", "this", "->", "serializer", "->", "serialize", "(", "$", "view", "->", "getData", "(", ")", ",", "$", "format", ")", ";", "}" ]
{@inheritdoc}
[ "{" ]
train
https://github.com/kbond/ControllerUtil/blob/67375d43c73d6a3f16356f3d683f62b176766e91/src/EventListener/SerializerViewListener.php#L39-L42
wboyz/laravel-enum
src/BaseEnum.php
BaseEnum.getValue
public static function getValue($key) { $className = get_called_class(); $reflectionClass = new ReflectionClass($className); if (! $reflectionClass->hasConstant($key)) { return static::DEFAULT_VALUE; } return $reflectionClass->getConstant($key); }
php
public static function getValue($key) { $className = get_called_class(); $reflectionClass = new ReflectionClass($className); if (! $reflectionClass->hasConstant($key)) { return static::DEFAULT_VALUE; } return $reflectionClass->getConstant($key); }
[ "public", "static", "function", "getValue", "(", "$", "key", ")", "{", "$", "className", "=", "get_called_class", "(", ")", ";", "$", "reflectionClass", "=", "new", "ReflectionClass", "(", "$", "className", ")", ";", "if", "(", "!", "$", "reflectionClass",...
Returns an enum value by its key. @return mixed
[ "Returns", "an", "enum", "value", "by", "its", "key", "." ]
train
https://github.com/wboyz/laravel-enum/blob/7e34d4eca779e3764fb9b56f612db9bc0b54c9c2/src/BaseEnum.php#L16-L26
wboyz/laravel-enum
src/BaseEnum.php
BaseEnum.toDictionary
public static function toDictionary() { $className = get_called_class(); $reflectionClass = new ReflectionClass($className); $dictionary = $reflectionClass->getConstants(); unset($dictionary['DEFAULT_VALUE']); return $dictionary; }
php
public static function toDictionary() { $className = get_called_class(); $reflectionClass = new ReflectionClass($className); $dictionary = $reflectionClass->getConstants(); unset($dictionary['DEFAULT_VALUE']); return $dictionary; }
[ "public", "static", "function", "toDictionary", "(", ")", "{", "$", "className", "=", "get_called_class", "(", ")", ";", "$", "reflectionClass", "=", "new", "ReflectionClass", "(", "$", "className", ")", ";", "$", "dictionary", "=", "$", "reflectionClass", "...
Returns the enum as dictionary. @return array
[ "Returns", "the", "enum", "as", "dictionary", "." ]
train
https://github.com/wboyz/laravel-enum/blob/7e34d4eca779e3764fb9b56f612db9bc0b54c9c2/src/BaseEnum.php#L53-L62
windwork/wf-db
lib/adapter/MySQLi.php
MySQLi.getAll
public function getAll($sql, array $args = []) { $result = $this->query($sql, $args); if (!$result) { return []; } $rows = $result->fetch_all(MYSQLI_ASSOC); return $rows; }
php
public function getAll($sql, array $args = []) { $result = $this->query($sql, $args); if (!$result) { return []; } $rows = $result->fetch_all(MYSQLI_ASSOC); return $rows; }
[ "public", "function", "getAll", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "result", "=", "$", "this", "->", "query", "(", "$", "sql", ",", "$", "args", ")", ";", "if", "(", "!", "$", "result", ")", "{", "return...
(non-PHPdoc) @see DB::getAll()
[ "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/MySQLi.php#L139-L150
windwork/wf-db
lib/adapter/MySQLi.php
MySQLi.getRow
public function getRow($sql, array $args = []) { $result = $this->query($sql, $args); if (!$result) { return []; } $row = $result->fetch_row(); return $row; }
php
public function getRow($sql, array $args = []) { $result = $this->query($sql, $args); if (!$result) { return []; } $row = $result->fetch_row(); return $row; }
[ "public", "function", "getRow", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "result", "=", "$", "this", "->", "query", "(", "$", "sql", ",", "$", "args", ")", ";", "if", "(", "!", "$", "result", ")", "{", "return...
(non-PHPdoc) @see DB::getRow()
[ "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/MySQLi.php#L156-L167
windwork/wf-db
lib/adapter/MySQLi.php
MySQLi.getColumn
public function getColumn($sql, array $args = []) { $result = $this->query($sql, $args); if (!$result) { return null; } $row = $result->fetch_row(); return $row[0]; }
php
public function getColumn($sql, array $args = []) { $result = $this->query($sql, $args); if (!$result) { return null; } $row = $result->fetch_row(); return $row[0]; }
[ "public", "function", "getColumn", "(", "$", "sql", ",", "array", "$", "args", "=", "[", "]", ")", "{", "$", "result", "=", "$", "this", "->", "query", "(", "$", "sql", ",", "$", "args", ")", ";", "if", "(", "!", "$", "result", ")", "{", "ret...
(non-PHPdoc) @see DB::getColumn()
[ "(", "non", "-", "PHPdoc", ")" ]
train
https://github.com/windwork/wf-db/blob/b9ee5740a42d572ce728907ea24ba22c158863f5/lib/adapter/MySQLi.php#L173-L184
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.send
public function send( ezcMail $mail ) { // sanity check the e-mail // need at least one recepient if ( ( count( $mail->to ) + count( $mail->cc ) + count( $mail->bcc ) ) < 1 ) { throw new ezcMailTransportException( "Can not send e-mail with no 'to' recipients." ); ...
php
public function send( ezcMail $mail ) { // sanity check the e-mail // need at least one recepient if ( ( count( $mail->to ) + count( $mail->cc ) + count( $mail->bcc ) ) < 1 ) { throw new ezcMailTransportException( "Can not send e-mail with no 'to' recipients." ); ...
[ "public", "function", "send", "(", "ezcMail", "$", "mail", ")", "{", "// sanity check the e-mail", "// need at least one recepient", "if", "(", "(", "count", "(", "$", "mail", "->", "to", ")", "+", "count", "(", "$", "mail", "->", "cc", ")", "+", "count", ...
Sends the ezcMail $mail using the SMTP protocol. If you want to send several emails use keepConnection() to leave the connection to the server open between each mail. @throws ezcMailTransportException if the mail could not be sent @throws ezcBaseFeatureNotFoundException if trying to use SSL and the openssl extension ...
[ "Sends", "the", "ezcMail", "$mail", "using", "the", "SMTP", "protocol", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L443-L523
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.connect
protected function connect() { $errno = null; $errstr = null; if ( $this->options->connectionType !== self::CONNECTION_PLAIN && !ezcBaseFeatures::hasExtensionSupport( 'openssl' ) ) { throw new ezcBaseExtensionNotFoundException( 'openssl', null, "PHP not confi...
php
protected function connect() { $errno = null; $errstr = null; if ( $this->options->connectionType !== self::CONNECTION_PLAIN && !ezcBaseFeatures::hasExtensionSupport( 'openssl' ) ) { throw new ezcBaseExtensionNotFoundException( 'openssl', null, "PHP not confi...
[ "protected", "function", "connect", "(", ")", "{", "$", "errno", "=", "null", ";", "$", "errstr", "=", "null", ";", "if", "(", "$", "this", "->", "options", "->", "connectionType", "!==", "self", "::", "CONNECTION_PLAIN", "&&", "!", "ezcBaseFeatures", ":...
Creates a connection to the SMTP server and initiates the login procedure. @todo The @ should be removed when PHP doesn't throw warnings for connect problems @throws ezcMailTransportSmtpException if no connection could be made or if the login failed @throws ezcBaseExtensionNotFoundException if trying to use SSL and t...
[ "Creates", "a", "connection", "to", "the", "SMTP", "server", "and", "initiates", "the", "login", "procedure", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L537-L569
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.login
protected function login() { if ( $this->doAuthenticate ) { $this->sendData( 'EHLO ' . $this->senderHost ); } else { $this->sendData( 'HELO ' . $this->senderHost ); } if ( $this->getReplyCode( $response ) !== '250' ) { ...
php
protected function login() { if ( $this->doAuthenticate ) { $this->sendData( 'EHLO ' . $this->senderHost ); } else { $this->sendData( 'HELO ' . $this->senderHost ); } if ( $this->getReplyCode( $response ) !== '250' ) { ...
[ "protected", "function", "login", "(", ")", "{", "if", "(", "$", "this", "->", "doAuthenticate", ")", "{", "$", "this", "->", "sendData", "(", "'EHLO '", ".", "$", "this", "->", "senderHost", ")", ";", "}", "else", "{", "$", "this", "->", "sendData",...
Performs the initial handshake with the SMTP server and authenticates the user, if login data is provided to the constructor. @throws ezcMailTransportSmtpException if the HELO/EHLO command or authentication fails
[ "Performs", "the", "initial", "handshake", "with", "the", "SMTP", "server", "and", "authenticates", "the", "user", "if", "login", "data", "is", "provided", "to", "the", "constructor", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L579-L632
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.getSupportedAuthMethods
public static function getSupportedAuthMethods() { return array( ezcMailSmtpTransport::AUTH_DIGEST_MD5, ezcMailSmtpTransport::AUTH_CRAM_MD5, ezcMailSmtpTransport::AUTH_NTLM, ezcMailSmtpTransport::AUTH_LOGIN, ezcMailSmtpTransport::AUTH_PLAIN, ...
php
public static function getSupportedAuthMethods() { return array( ezcMailSmtpTransport::AUTH_DIGEST_MD5, ezcMailSmtpTransport::AUTH_CRAM_MD5, ezcMailSmtpTransport::AUTH_NTLM, ezcMailSmtpTransport::AUTH_LOGIN, ezcMailSmtpTransport::AUTH_PLAIN, ...
[ "public", "static", "function", "getSupportedAuthMethods", "(", ")", "{", "return", "array", "(", "ezcMailSmtpTransport", "::", "AUTH_DIGEST_MD5", ",", "ezcMailSmtpTransport", "::", "AUTH_CRAM_MD5", ",", "ezcMailSmtpTransport", "::", "AUTH_NTLM", ",", "ezcMailSmtpTranspor...
Returns an array with the authentication methods supported by the SMTP transport class (not by the SMTP server!). The returned array has the methods sorted by their relative strengths, so stronger methods are first in the array. @return array(string)
[ "Returns", "an", "array", "with", "the", "authentication", "methods", "supported", "by", "the", "SMTP", "transport", "class", "(", "not", "by", "the", "SMTP", "server!", ")", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L643-L652
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.sortAuthMethods
protected function sortAuthMethods( array $methods ) { $result = array(); $unsupported = array(); $supportedAuthMethods = self::getSupportedAuthMethods(); foreach ( $supportedAuthMethods as $method ) { if ( in_array( $method, $methods ) ) { ...
php
protected function sortAuthMethods( array $methods ) { $result = array(); $unsupported = array(); $supportedAuthMethods = self::getSupportedAuthMethods(); foreach ( $supportedAuthMethods as $method ) { if ( in_array( $method, $methods ) ) { ...
[ "protected", "function", "sortAuthMethods", "(", "array", "$", "methods", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "unsupported", "=", "array", "(", ")", ";", "$", "supportedAuthMethods", "=", "self", "::", "getSupportedAuthMethods", "(", ...
Sorts the specified array of AUTH methods $methods by strength, so higher strength methods will be used first. For example, if the server supports: <code> $methods = array( 'PLAIN', 'LOGIN', 'CRAM-MD5' ); </code> then this method will return: <code> $methods = array( 'CRAM-MD5', 'LOGIN', 'PLAIN' ); </code> @param ar...
[ "Sorts", "the", "specified", "array", "of", "AUTH", "methods", "$methods", "by", "strength", "so", "higher", "strength", "methods", "will", "be", "used", "first", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L671-L684
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.auth
protected function auth( $method ) { switch ( $method ) { case self::AUTH_DIGEST_MD5: $authenticated = $this->authDigestMd5(); break; case self::AUTH_CRAM_MD5: $authenticated = $this->authCramMd5(); break; ...
php
protected function auth( $method ) { switch ( $method ) { case self::AUTH_DIGEST_MD5: $authenticated = $this->authDigestMd5(); break; case self::AUTH_CRAM_MD5: $authenticated = $this->authCramMd5(); break; ...
[ "protected", "function", "auth", "(", "$", "method", ")", "{", "switch", "(", "$", "method", ")", "{", "case", "self", "::", "AUTH_DIGEST_MD5", ":", "$", "authenticated", "=", "$", "this", "->", "authDigestMd5", "(", ")", ";", "break", ";", "case", "se...
Calls the appropiate authentication method based on $method. @throws ezcMailTransportSmtpException if $method is not supported by the transport class @return bool
[ "Calls", "the", "appropiate", "authentication", "method", "based", "on", "$method", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L693-L722
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authDigestMd5
protected function authDigestMd5() { $this->sendData( 'AUTH DIGEST-MD5' ); if ( $this->getReplyCode( $serverResponse ) !== '334' ) { throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH DIGEST-MD5.' ); } $serverDigest = base64_decode( trim( ...
php
protected function authDigestMd5() { $this->sendData( 'AUTH DIGEST-MD5' ); if ( $this->getReplyCode( $serverResponse ) !== '334' ) { throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH DIGEST-MD5.' ); } $serverDigest = base64_decode( trim( ...
[ "protected", "function", "authDigestMd5", "(", ")", "{", "$", "this", "->", "sendData", "(", "'AUTH DIGEST-MD5'", ")", ";", "if", "(", "$", "this", "->", "getReplyCode", "(", "$", "serverResponse", ")", "!==", "'334'", ")", "{", "throw", "new", "ezcMailTra...
Tries to login to the SMTP server with 'AUTH DIGEST-MD5' and returns true if successful. @todo implement auth-int and auth-conf quality of protection (qop) modes @todo support other algorithms than md5-sess? @throws ezcMailTransportSmtpException if the SMTP server returned an error @return bool
[ "Tries", "to", "login", "to", "the", "SMTP", "server", "with", "AUTH", "DIGEST", "-", "MD5", "and", "returns", "true", "if", "successful", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L735-L818
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authCramMd5
protected function authCramMd5() { $this->sendData( 'AUTH CRAM-MD5' ); if ( $this->getReplyCode( $response ) !== '334' ) { throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH CRAM-MD5.' ); } $serverDigest = trim( substr( $response, 4 ) ); ...
php
protected function authCramMd5() { $this->sendData( 'AUTH CRAM-MD5' ); if ( $this->getReplyCode( $response ) !== '334' ) { throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH CRAM-MD5.' ); } $serverDigest = trim( substr( $response, 4 ) ); ...
[ "protected", "function", "authCramMd5", "(", ")", "{", "$", "this", "->", "sendData", "(", "'AUTH CRAM-MD5'", ")", ";", "if", "(", "$", "this", "->", "getReplyCode", "(", "$", "response", ")", "!==", "'334'", ")", "{", "throw", "new", "ezcMailTransportSmtp...
Tries to login to the SMTP server with 'AUTH CRAM-MD5' and returns true if successful. @throws ezcMailTransportSmtpException if the SMTP server returned an error @return bool
[ "Tries", "to", "login", "to", "the", "SMTP", "server", "with", "AUTH", "CRAM", "-", "MD5", "and", "returns", "true", "if", "successful", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L828-L847
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authNtlm
protected function authNtlm() { if ( !ezcBaseFeatures::hasExtensionSupport( 'mcrypt' ) ) { throw new ezcBaseExtensionNotFoundException( 'mcrypt', null, "PHP not compiled with --with-mcrypt." ); } // Send NTLM type 1 message $msg1 = base64_encode( $this->authNtlmM...
php
protected function authNtlm() { if ( !ezcBaseFeatures::hasExtensionSupport( 'mcrypt' ) ) { throw new ezcBaseExtensionNotFoundException( 'mcrypt', null, "PHP not compiled with --with-mcrypt." ); } // Send NTLM type 1 message $msg1 = base64_encode( $this->authNtlmM...
[ "protected", "function", "authNtlm", "(", ")", "{", "if", "(", "!", "ezcBaseFeatures", "::", "hasExtensionSupport", "(", "'mcrypt'", ")", ")", "{", "throw", "new", "ezcBaseExtensionNotFoundException", "(", "'mcrypt'", ",", "null", ",", "\"PHP not compiled with --wit...
Tries to login to the SMTP server with 'AUTH NTLM' and returns true if successful. @throws ezcMailTransportSmtpException if the SMTP server returned an error @return bool
[ "Tries", "to", "login", "to", "the", "SMTP", "server", "with", "AUTH", "NTLM", "and", "returns", "true", "if", "successful", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L857-L894
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authLogin
protected function authLogin() { $this->sendData( 'AUTH LOGIN' ); if ( $this->getReplyCode( $error ) !== '334' ) { throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH LOGIN.' ); } $this->sendData( base64_encode( $this->user ) ); if ...
php
protected function authLogin() { $this->sendData( 'AUTH LOGIN' ); if ( $this->getReplyCode( $error ) !== '334' ) { throw new ezcMailTransportSmtpException( 'SMTP server does not accept AUTH LOGIN.' ); } $this->sendData( base64_encode( $this->user ) ); if ...
[ "protected", "function", "authLogin", "(", ")", "{", "$", "this", "->", "sendData", "(", "'AUTH LOGIN'", ")", ";", "if", "(", "$", "this", "->", "getReplyCode", "(", "$", "error", ")", "!==", "'334'", ")", "{", "throw", "new", "ezcMailTransportSmtpExceptio...
Tries to login to the SMTP server with 'AUTH LOGIN' and returns true if successful. @throws ezcMailTransportSmtpException if the SMTP server returned an error @return bool
[ "Tries", "to", "login", "to", "the", "SMTP", "server", "with", "AUTH", "LOGIN", "and", "returns", "true", "if", "successful", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L904-L925
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authPlain
protected function authPlain() { $digest = base64_encode( "\0{$this->user}\0{$this->password}" ); $this->sendData( "AUTH PLAIN {$digest}" ); if ( $this->getReplyCode( $error ) !== '235' ) { throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided ...
php
protected function authPlain() { $digest = base64_encode( "\0{$this->user}\0{$this->password}" ); $this->sendData( "AUTH PLAIN {$digest}" ); if ( $this->getReplyCode( $error ) !== '235' ) { throw new ezcMailTransportSmtpException( 'SMTP server did not accept the provided ...
[ "protected", "function", "authPlain", "(", ")", "{", "$", "digest", "=", "base64_encode", "(", "\"\\0{$this->user}\\0{$this->password}\"", ")", ";", "$", "this", "->", "sendData", "(", "\"AUTH PLAIN {$digest}\"", ")", ";", "if", "(", "$", "this", "->", "getReply...
Tries to login to the SMTP server with 'AUTH PLAIN' and returns true if successful. @throws ezcMailTransportSmtpException if the SMTP server returned an error @return bool
[ "Tries", "to", "login", "to", "the", "SMTP", "server", "with", "AUTH", "PLAIN", "and", "returns", "true", "if", "successful", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L935-L945
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.disconnect
public function disconnect() { if ( $this->status != self::STATUS_NOT_CONNECTED ) { $this->sendData( 'QUIT' ); $replyCode = $this->getReplyCode( $error ) !== '221'; fclose( $this->connection ); $this->status = self::STATUS_NOT_CONNECTED; if...
php
public function disconnect() { if ( $this->status != self::STATUS_NOT_CONNECTED ) { $this->sendData( 'QUIT' ); $replyCode = $this->getReplyCode( $error ) !== '221'; fclose( $this->connection ); $this->status = self::STATUS_NOT_CONNECTED; if...
[ "public", "function", "disconnect", "(", ")", "{", "if", "(", "$", "this", "->", "status", "!=", "self", "::", "STATUS_NOT_CONNECTED", ")", "{", "$", "this", "->", "sendData", "(", "'QUIT'", ")", ";", "$", "replyCode", "=", "$", "this", "->", "getReply...
Sends the QUIT command to the server and breaks the connection. @throws ezcMailTransportSmtpException if the QUIT command failed
[ "Sends", "the", "QUIT", "command", "to", "the", "server", "and", "breaks", "the", "connection", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L953-L966
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.cmdMail
protected function cmdMail( $from ) { if ( $this->status === self::STATUS_AUTHENTICATED ) { $this->sendData( 'MAIL FROM:' . $this->composeSmtpMailAddress( $from ) . '' ); if ( $this->getReplyCode( $error ) !== '250' ) { throw new ezcMailTransportSm...
php
protected function cmdMail( $from ) { if ( $this->status === self::STATUS_AUTHENTICATED ) { $this->sendData( 'MAIL FROM:' . $this->composeSmtpMailAddress( $from ) . '' ); if ( $this->getReplyCode( $error ) !== '250' ) { throw new ezcMailTransportSm...
[ "protected", "function", "cmdMail", "(", "$", "from", ")", "{", "if", "(", "$", "this", "->", "status", "===", "self", "::", "STATUS_AUTHENTICATED", ")", "{", "$", "this", "->", "sendData", "(", "'MAIL FROM:'", ".", "$", "this", "->", "composeSmtpMailAddre...
Sends the MAIL FROM command, with the sender's mail address $from. This method must be called once to tell the server the sender address. The sender's mail address $from may be enclosed in angle brackets. @throws ezcMailTransportSmtpException if there is no valid connection or if the MAIL FROM command failed @param ...
[ "Sends", "the", "MAIL", "FROM", "command", "with", "the", "sender", "s", "mail", "address", "$from", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L997-L1007
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.cmdRcpt
protected function cmdRcpt( $email ) { if ( $this->status === self::STATUS_AUTHENTICATED ) { $this->sendData( 'RCPT TO:' . $this->composeSmtpMailAddress( $email ) ); if ( $this->getReplyCode( $error ) !== '250' ) { throw new ezcMailTransportSmtpExc...
php
protected function cmdRcpt( $email ) { if ( $this->status === self::STATUS_AUTHENTICATED ) { $this->sendData( 'RCPT TO:' . $this->composeSmtpMailAddress( $email ) ); if ( $this->getReplyCode( $error ) !== '250' ) { throw new ezcMailTransportSmtpExc...
[ "protected", "function", "cmdRcpt", "(", "$", "email", ")", "{", "if", "(", "$", "this", "->", "status", "===", "self", "::", "STATUS_AUTHENTICATED", ")", "{", "$", "this", "->", "sendData", "(", "'RCPT TO:'", ".", "$", "this", "->", "composeSmtpMailAddres...
Sends the 'RCTP TO' to the server with the address $email. This method must be called once for each recipient of the mail including cc and bcc recipients. The RCPT TO commands control where the mail is actually sent. It does not affect the headers of the email. The recipient mail address $email may be enclosed in ang...
[ "Sends", "the", "RCTP", "TO", "to", "the", "server", "with", "the", "address", "$email", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1024-L1034
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.cmdData
protected function cmdData() { if ( $this->status === self::STATUS_AUTHENTICATED ) { $this->sendData( 'DATA' ); if ( $this->getReplyCode( $error ) !== '354' ) { throw new ezcMailTransportSmtpException( "DATA failed with error: $error." ); ...
php
protected function cmdData() { if ( $this->status === self::STATUS_AUTHENTICATED ) { $this->sendData( 'DATA' ); if ( $this->getReplyCode( $error ) !== '354' ) { throw new ezcMailTransportSmtpException( "DATA failed with error: $error." ); ...
[ "protected", "function", "cmdData", "(", ")", "{", "if", "(", "$", "this", "->", "status", "===", "self", "::", "STATUS_AUTHENTICATED", ")", "{", "$", "this", "->", "sendData", "(", "'DATA'", ")", ";", "if", "(", "$", "this", "->", "getReplyCode", "(",...
Sends the DATA command to the SMTP server. @throws ezcMailTransportSmtpException if there is no valid connection or if the DATA command failed
[ "Sends", "the", "DATA", "command", "to", "the", "SMTP", "server", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1043-L1053
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.getData
protected function getData() { $data = ''; $line = ''; $loops = 0; if ( is_resource( $this->connection ) ) { while ( ( strpos( $data, self::CRLF ) === false || (string) substr( $line, 3, 1 ) !== ' ' ) && $loops < 100 ) { $line = fge...
php
protected function getData() { $data = ''; $line = ''; $loops = 0; if ( is_resource( $this->connection ) ) { while ( ( strpos( $data, self::CRLF ) === false || (string) substr( $line, 3, 1 ) !== ' ' ) && $loops < 100 ) { $line = fge...
[ "protected", "function", "getData", "(", ")", "{", "$", "data", "=", "''", ";", "$", "line", "=", "''", ";", "$", "loops", "=", "0", ";", "if", "(", "is_resource", "(", "$", "this", "->", "connection", ")", ")", "{", "while", "(", "(", "strpos", ...
Returns data received from the connection stream. @throws ezcMailTransportSmtpException if there is no valid connection @return string
[ "Returns", "data", "received", "from", "the", "connection", "stream", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1083-L1100
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.generateNonce
protected function generateNonce( $length = 32 ) { $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $result = ''; for ( $i = 0; $i < $length; $i++ ) { $result .= $chars[mt_rand( 0, strlen( $chars ) - 1 )]; } return $result; }
php
protected function generateNonce( $length = 32 ) { $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; $result = ''; for ( $i = 0; $i < $length; $i++ ) { $result .= $chars[mt_rand( 0, strlen( $chars ) - 1 )]; } return $result; }
[ "protected", "function", "generateNonce", "(", "$", "length", "=", "32", ")", "{", "$", "chars", "=", "\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"", ";", "$", "result", "=", "''", ";", "for", "(", "$", "i", "=", "0", ";", "$", "i", "<"...
Generates an alpha-numeric random string with the specified $length. Used in the DIGEST-MD5 authentication method. @param int $length @return string
[ "Generates", "an", "alpha", "-", "numeric", "random", "string", "with", "the", "specified", "$length", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1126-L1136
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authNtlmMessageType1
protected function authNtlmMessageType1( $workstation, $domain ) { $parts = array( "NTLMSSP\x00", "\x01\x00\x00\x00", "\x07\x32\x00\x00", $this->authNtlmSecurityBuffer( $domain, 32 + strlen( $workstation ) ), ...
php
protected function authNtlmMessageType1( $workstation, $domain ) { $parts = array( "NTLMSSP\x00", "\x01\x00\x00\x00", "\x07\x32\x00\x00", $this->authNtlmSecurityBuffer( $domain, 32 + strlen( $workstation ) ), ...
[ "protected", "function", "authNtlmMessageType1", "(", "$", "workstation", ",", "$", "domain", ")", "{", "$", "parts", "=", "array", "(", "\"NTLMSSP\\x00\"", ",", "\"\\x01\\x00\\x00\\x00\"", ",", "\"\\x07\\x32\\x00\\x00\"", ",", "$", "this", "->", "authNtlmSecurityBu...
Generates an NTLM type 1 message. @param string $workstation @param string $domain @return string
[ "Generates", "an", "NTLM", "type", "1", "message", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1145-L1158
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authNtlmMessageType3
protected function authNtlmMessageType3( $challenge, $user, $password, $workstation, $domain ) { $domain = chunk_split( $domain, 1, "\x00" ); $user = chunk_split( $user, 1, "\x00" ); $workstation = chunk_split( $workstation, 1, "\x00" ); $lm = ''; $ntlm = $this->authNtlmRespo...
php
protected function authNtlmMessageType3( $challenge, $user, $password, $workstation, $domain ) { $domain = chunk_split( $domain, 1, "\x00" ); $user = chunk_split( $user, 1, "\x00" ); $workstation = chunk_split( $workstation, 1, "\x00" ); $lm = ''; $ntlm = $this->authNtlmRespo...
[ "protected", "function", "authNtlmMessageType3", "(", "$", "challenge", ",", "$", "user", ",", "$", "password", ",", "$", "workstation", ",", "$", "domain", ")", "{", "$", "domain", "=", "chunk_split", "(", "$", "domain", ",", "1", ",", "\"\\x00\"", ")",...
Generates an NTLM type 3 message from the $challenge sent by the SMTP server in an NTLM type 2 message. @param string $challenge @param string $user @param string $password @param string $workstation @param string $domain @return string
[ "Generates", "an", "NTLM", "type", "3", "message", "from", "the", "$challenge", "sent", "by", "the", "SMTP", "server", "in", "an", "NTLM", "type", "2", "message", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1171-L1205
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authNtlmResponse
protected function authNtlmResponse( $challenge, $password ) { $password = chunk_split( $password, 1, "\x00" ); $password = hash( 'md4', $password, true ); $password .= str_repeat( "\x00", 21 - strlen( $password ) ); $td = mcrypt_module_open( 'des', '', 'ecb', '' ); $iv = mc...
php
protected function authNtlmResponse( $challenge, $password ) { $password = chunk_split( $password, 1, "\x00" ); $password = hash( 'md4', $password, true ); $password .= str_repeat( "\x00", 21 - strlen( $password ) ); $td = mcrypt_module_open( 'des', '', 'ecb', '' ); $iv = mc...
[ "protected", "function", "authNtlmResponse", "(", "$", "challenge", ",", "$", "password", ")", "{", "$", "password", "=", "chunk_split", "(", "$", "password", ",", "1", ",", "\"\\x00\"", ")", ";", "$", "password", "=", "hash", "(", "'md4'", ",", "$", "...
Calculates an NTLM response to be used in the creation of the NTLM type 3 message. @param string $challenge @param string $password @return string
[ "Calculates", "an", "NTLM", "response", "to", "be", "used", "in", "the", "creation", "of", "the", "NTLM", "type", "3", "message", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1215-L1248
Eresus/EresusCMS
src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php
ezcMailSmtpTransport.authNtlmSecurityBuffer
protected function authNtlmSecurityBuffer( $text, $offset ) { return pack( 'v', strlen( $text ) ) . pack( 'v', strlen( $text ) ) . pack( 'V', $offset ); }
php
protected function authNtlmSecurityBuffer( $text, $offset ) { return pack( 'v', strlen( $text ) ) . pack( 'v', strlen( $text ) ) . pack( 'V', $offset ); }
[ "protected", "function", "authNtlmSecurityBuffer", "(", "$", "text", ",", "$", "offset", ")", "{", "return", "pack", "(", "'v'", ",", "strlen", "(", "$", "text", ")", ")", ".", "pack", "(", "'v'", ",", "strlen", "(", "$", "text", ")", ")", ".", "pa...
Creates an NTLM security buffer information string. The structure of the security buffer is: - a short containing the length of the buffer content in bytes (may be zero). - a short containing the allocated space for the buffer in bytes (greater than or equal to the length; typically the same as the length). - a long c...
[ "Creates", "an", "NTLM", "security", "buffer", "information", "string", "." ]
train
https://github.com/Eresus/EresusCMS/blob/b0afc661105f0a2f65d49abac13956cc93c5188d/src/core/framework/core/3rdparty/ezcomponents/Mail/src/transports/smtp/smtp_transport.php#L1272-L1277
surebert/surebert-framework
src/sb/Excel/Reader/HTML.php
HTML.getCssStyle
public function getCssStyle($row, $col, $sheet=0) { $css = ""; $font = $this->font($row, $col, $sheet); if ($font != "") { $css .= "font-family:$font;"; } $align = $this->align($row, $col, $sheet); if ($align != "") { $css .= "text-align:$align...
php
public function getCssStyle($row, $col, $sheet=0) { $css = ""; $font = $this->font($row, $col, $sheet); if ($font != "") { $css .= "font-family:$font;"; } $align = $this->align($row, $col, $sheet); if ($align != "") { $css .= "text-align:$align...
[ "public", "function", "getCssStyle", "(", "$", "row", ",", "$", "col", ",", "$", "sheet", "=", "0", ")", "{", "$", "css", "=", "\"\"", ";", "$", "font", "=", "$", "this", "->", "font", "(", "$", "row", ",", "$", "col", ",", "$", "sheet", ")",...
Converts excel file cell style info into css @param int $row @param int $col @param int $sheet @return string
[ "Converts", "excel", "file", "cell", "style", "info", "into", "css" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader/HTML.php#L21-L98
surebert/surebert-framework
src/sb/Excel/Reader/HTML.php
HTML.hyperlink
public function hyperlink($row, $col, $sheet=0) { $link = isset($this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink']) ? $this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink'] : false; if ($link) { return $link['link']; } return ''; }
php
public function hyperlink($row, $col, $sheet=0) { $link = isset($this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink']) ? $this->sheets[$sheet]['cellsInfo'][$row][$col]['hyperlink'] : false; if ($link) { return $link['link']; } return ''; }
[ "public", "function", "hyperlink", "(", "$", "row", ",", "$", "col", ",", "$", "sheet", "=", "0", ")", "{", "$", "link", "=", "isset", "(", "$", "this", "->", "sheets", "[", "$", "sheet", "]", "[", "'cellsInfo'", "]", "[", "$", "row", "]", "[",...
get hyperlink if cell is hyperlinked @param int $row @param int $col @param int $sheet @return string
[ "get", "hyperlink", "if", "cell", "is", "hyperlinked" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader/HTML.php#L107-L114
surebert/surebert-framework
src/sb/Excel/Reader/HTML.php
HTML.toHtml
public function toHtml($row_numbers=false, $col_letters=false, $sheet=0, $table_class='excel') { $out = "<table class=\"$table_class\" cellspacing=0>"; if ($col_letters) { $out .= "<thead>\n\t<tr>"; if ($row_numbers) { $out .= "\n\t\t<th>&nbsp</th>"; ...
php
public function toHtml($row_numbers=false, $col_letters=false, $sheet=0, $table_class='excel') { $out = "<table class=\"$table_class\" cellspacing=0>"; if ($col_letters) { $out .= "<thead>\n\t<tr>"; if ($row_numbers) { $out .= "\n\t\t<th>&nbsp</th>"; ...
[ "public", "function", "toHtml", "(", "$", "row_numbers", "=", "false", ",", "$", "col_letters", "=", "false", ",", "$", "sheet", "=", "0", ",", "$", "table_class", "=", "'excel'", ")", "{", "$", "out", "=", "\"<table class=\\\"$table_class\\\" cellspacing=0>\"...
Dumps an HTML file representing xls data, removed htmlentities to allow for UTF chars @param boolean $row_numbers Should row numbers show @param boolean $col_letters Should col letters show @param integer $sheet Which sheet to dump @param string $table_class Which class to give the table @return string
[ "Dumps", "an", "HTML", "file", "representing", "xls", "data", "removed", "htmlentities", "to", "allow", "for", "UTF", "chars" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/Excel/Reader/HTML.php#L314-L383
JBZoo/Assets
src/Collection.php
Collection.remove
public function remove($name) { $names = (array)$name; foreach ($names as $name) { if (Arr::key($name, $this->_assets)) { unset($this->_assets[$name]); } } }
php
public function remove($name) { $names = (array)$name; foreach ($names as $name) { if (Arr::key($name, $this->_assets)) { unset($this->_assets[$name]); } } }
[ "public", "function", "remove", "(", "$", "name", ")", "{", "$", "names", "=", "(", "array", ")", "$", "name", ";", "foreach", "(", "$", "names", "as", "$", "name", ")", "{", "if", "(", "Arr", "::", "key", "(", "$", "name", ",", "$", "this", ...
Removes assets from collection. @param string|array $name @return void
[ "Removes", "assets", "from", "collection", "." ]
train
https://github.com/JBZoo/Assets/blob/134a109378f5b5e955dfb15e6ed2821581564991/src/Collection.php#L82-L91
wilmoore/attributes.php
src/Attributes.php
Attributes.resetChangeHistory
function resetChangeHistory($attribute) { if ($this->propertyExists($attribute, 'changes')) { $this->setPropertyFor($attribute, 'changes', [], null, false); } return $this; }
php
function resetChangeHistory($attribute) { if ($this->propertyExists($attribute, 'changes')) { $this->setPropertyFor($attribute, 'changes', [], null, false); } return $this; }
[ "function", "resetChangeHistory", "(", "$", "attribute", ")", "{", "if", "(", "$", "this", "->", "propertyExists", "(", "$", "attribute", ",", "'changes'", ")", ")", "{", "$", "this", "->", "setPropertyFor", "(", "$", "attribute", ",", "'changes'", ",", ...
`resetChangeHistory` clears the change history for an attribute @param string $attribute attribute name @return $this
[ "resetChangeHistory", "clears", "the", "change", "history", "for", "an", "attribute" ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L48-L54
wilmoore/attributes.php
src/Attributes.php
Attributes.propertyExists
function propertyExists($attribute, $property) { return array_key_exists($attribute, $this->__attributes) && array_key_exists($property, $this->__attributes[$attribute]); }
php
function propertyExists($attribute, $property) { return array_key_exists($attribute, $this->__attributes) && array_key_exists($property, $this->__attributes[$attribute]); }
[ "function", "propertyExists", "(", "$", "attribute", ",", "$", "property", ")", "{", "return", "array_key_exists", "(", "$", "attribute", ",", "$", "this", "->", "__attributes", ")", "&&", "array_key_exists", "(", "$", "property", ",", "$", "this", "->", "...
`propertyExists` determines if an attribute property has been set. @param string $attribute attribute name @param string $property property name @api public @return boolean
[ "propertyExists", "determines", "if", "an", "attribute", "property", "has", "been", "set", "." ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L79-L82
wilmoore/attributes.php
src/Attributes.php
Attributes.get
function get($name, $default=null) { $map = array_map(function($name) use($default){ if ($this->__isset($name)) { return $this->__attributes[$name]['value']; } elseif ($this->propertyExists($name, 'default')) { return $this->__attributes[$name]['default']; } return (null ===...
php
function get($name, $default=null) { $map = array_map(function($name) use($default){ if ($this->__isset($name)) { return $this->__attributes[$name]['value']; } elseif ($this->propertyExists($name, 'default')) { return $this->__attributes[$name]['default']; } return (null ===...
[ "function", "get", "(", "$", "name", ",", "$", "default", "=", "null", ")", "{", "$", "map", "=", "array_map", "(", "function", "(", "$", "name", ")", "use", "(", "$", "default", ")", "{", "if", "(", "$", "this", "->", "__isset", "(", "$", "nam...
`get` returns attributes value or, if attribute value is null, returns default value if given @param string $name attribute name @param mixed $default [optional] default return value @return mixed
[ "get", "returns", "attributes", "value", "or", "if", "attribute", "value", "is", "null", "returns", "default", "value", "if", "given" ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L109-L121
wilmoore/attributes.php
src/Attributes.php
Attributes.set
function set($attribute, $value = null) { $attributes = is_array($attribute) ? $attribute : [$attribute => $value]; foreach ($attributes as $attr => $val) { if ($this->getPropertyFor($attr, 'accepts')) { $acceptsConstraint = new Attributes\Constraint\Accepts($th...
php
function set($attribute, $value = null) { $attributes = is_array($attribute) ? $attribute : [$attribute => $value]; foreach ($attributes as $attr => $val) { if ($this->getPropertyFor($attr, 'accepts')) { $acceptsConstraint = new Attributes\Constraint\Accepts($th...
[ "function", "set", "(", "$", "attribute", ",", "$", "value", "=", "null", ")", "{", "$", "attributes", "=", "is_array", "(", "$", "attribute", ")", "?", "$", "attribute", ":", "[", "$", "attribute", "=>", "$", "value", "]", ";", "foreach", "(", "$"...
`set` attributes value @param string $attribute attribute name @param mixed $value attribute value @return $this
[ "set", "attributes", "value" ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L144-L176
wilmoore/attributes.php
src/Attributes.php
Attributes.push
function push($attribute, $value) { if (! $this->has($attribute)) { return $this; } $new = $this->get($attribute); if (! is_array($new) && !$new instanceof Traversable) { return $this; } $new[] = $value; $this->setPropertyFor($attribute, 'value', $new, 'push'); return $...
php
function push($attribute, $value) { if (! $this->has($attribute)) { return $this; } $new = $this->get($attribute); if (! is_array($new) && !$new instanceof Traversable) { return $this; } $new[] = $value; $this->setPropertyFor($attribute, 'value', $new, 'push'); return $...
[ "function", "push", "(", "$", "attribute", ",", "$", "value", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "attribute", ")", ")", "{", "return", "$", "this", ";", "}", "$", "new", "=", "$", "this", "->", "get", "(", "$", "att...
`push` a new value onto end of array @param string $attribute attribute name @param mixed $value attribute value @return $this
[ "push", "a", "new", "value", "onto", "end", "of", "array" ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L187-L202
wilmoore/attributes.php
src/Attributes.php
Attributes.getPropertyFor
private function getPropertyFor($attribute, $property) { return $this->propertyExists($attribute, $property) ? $this->__attributes[$attribute][$property] : null; }
php
private function getPropertyFor($attribute, $property) { return $this->propertyExists($attribute, $property) ? $this->__attributes[$attribute][$property] : null; }
[ "private", "function", "getPropertyFor", "(", "$", "attribute", ",", "$", "property", ")", "{", "return", "$", "this", "->", "propertyExists", "(", "$", "attribute", ",", "$", "property", ")", "?", "$", "this", "->", "__attributes", "[", "$", "attribute", ...
`getPropertyFor` returns an attribute property by name @param string $attribute attribute name @param string $property property name @return boolean
[ "getPropertyFor", "returns", "an", "attribute", "property", "by", "name" ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L239-L243
wilmoore/attributes.php
src/Attributes.php
Attributes.setPropertyFor
private function setPropertyFor($attribute, $property, $value, $action, $changeTracking = true) { if (! $this->has($attribute)) {return;} if ($changeTracking) { $this->__attributes[$attribute]['changes'][] = [ 'action' => $action, 'from' => $this->get($attribute), 'to' => $v...
php
private function setPropertyFor($attribute, $property, $value, $action, $changeTracking = true) { if (! $this->has($attribute)) {return;} if ($changeTracking) { $this->__attributes[$attribute]['changes'][] = [ 'action' => $action, 'from' => $this->get($attribute), 'to' => $v...
[ "private", "function", "setPropertyFor", "(", "$", "attribute", ",", "$", "property", ",", "$", "value", ",", "$", "action", ",", "$", "changeTracking", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "has", "(", "$", "attribute", ")", ")",...
`setPropertyFor` sets an attribute property value @param string $attribute attribute name @param string $property property name @param mixed $value property value @return boolean
[ "setPropertyFor", "sets", "an", "attribute", "property", "value" ]
train
https://github.com/wilmoore/attributes.php/blob/d36de26a0d28c35d64ce9b3fc868572e39911ee7/src/Attributes.php#L255-L268
barrelstrength/craftnet-php
src/PluginLicenses.php
PluginLicenses.get
public function get(array $options = []) { $pagination = ''; if (isset($options['page']) && is_int($options['page'])) { $pagination = '?page='.$options['page']; } if (isset($options['key'])) { return $this->client->get('plugin-licenses/'.$options['key'].$pag...
php
public function get(array $options = []) { $pagination = ''; if (isset($options['page']) && is_int($options['page'])) { $pagination = '?page='.$options['page']; } if (isset($options['key'])) { return $this->client->get('plugin-licenses/'.$options['key'].$pag...
[ "public", "function", "get", "(", "array", "$", "options", "=", "[", "]", ")", "{", "$", "pagination", "=", "''", ";", "if", "(", "isset", "(", "$", "options", "[", "'page'", "]", ")", "&&", "is_int", "(", "$", "options", "[", "'page'", "]", ")",...
Gets one or more licenses for the given Craft ID account @param array $options @return mixed|\Psr\Http\Message\ResponseInterface @throws \GuzzleHttp\Exception\GuzzleException
[ "Gets", "one", "or", "more", "licenses", "for", "the", "given", "Craft", "ID", "account" ]
train
https://github.com/barrelstrength/craftnet-php/blob/90c9767b6bef6078bc062b3bfcdde38b24c843fc/src/PluginLicenses.php#L30-L43
Velliz/pte
lib/Pte.php
Pte.RenderHtml
public function RenderHtml(&$Content, &$Data) { header('Content-Type: text/html'); foreach ($Content as $key => $val) { $datum = isset($Data[$val['key']]) ? $Data[$val['key']] : null; $hasChild = isset($val['child']) ? true : false; $this->_Output .= $val['text...
php
public function RenderHtml(&$Content, &$Data) { header('Content-Type: text/html'); foreach ($Content as $key => $val) { $datum = isset($Data[$val['key']]) ? $Data[$val['key']] : null; $hasChild = isset($val['child']) ? true : false; $this->_Output .= $val['text...
[ "public", "function", "RenderHtml", "(", "&", "$", "Content", ",", "&", "$", "Data", ")", "{", "header", "(", "'Content-Type: text/html'", ")", ";", "foreach", "(", "$", "Content", "as", "$", "key", "=>", "$", "val", ")", "{", "$", "datum", "=", "iss...
@param $Content @param $Data @return string content is template in array format @throws PteException Content is template in array format Data is returned date from controller
[ "@param", "$Content", "@param", "$Data", "@return", "string", "content", "is", "template", "in", "array", "format", "@throws", "PteException" ]
train
https://github.com/Velliz/pte/blob/8f8edc2289740d554a5942ff96eb727d838e866a/lib/Pte.php#L203-L274
surebert/surebert-framework
src/sb/CURL/Client/NTLM.php
NTLM.load
public function load($url, $data = null, $headers = null, $curl_opts = []) { if(!isset($curl_opts[CURLOPT_HTTP_VERSION])){ $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; } if(!isset($curl_opts[CURLOPT_HTTPAUTH])){ $curl_opts[CURLOPT_HTTPAUTH] = CURLAU...
php
public function load($url, $data = null, $headers = null, $curl_opts = []) { if(!isset($curl_opts[CURLOPT_HTTP_VERSION])){ $curl_opts[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_1; } if(!isset($curl_opts[CURLOPT_HTTPAUTH])){ $curl_opts[CURLOPT_HTTPAUTH] = CURLAU...
[ "public", "function", "load", "(", "$", "url", ",", "$", "data", "=", "null", ",", "$", "headers", "=", "null", ",", "$", "curl_opts", "=", "[", "]", ")", "{", "if", "(", "!", "isset", "(", "$", "curl_opts", "[", "CURLOPT_HTTP_VERSION", "]", ")", ...
Loads a response from an NTLM service @param string $url The url to visit @param string/array $post The post data to send @param array $headers The headers to send @param array $curl_opts Any additional curl_opts to send @return string the response text @throws \Exception
[ "Loads", "a", "response", "from", "an", "NTLM", "service" ]
train
https://github.com/surebert/surebert-framework/blob/f2f32eb693bd39385ceb93355efb5b2a429f27ce/src/sb/CURL/Client/NTLM.php#L37-L52
phpnfe/tools
src/Certificado/Base.php
Base.pem2Der
protected static function pem2Der($pemData) { $begin = 'CERTIFICATE-----'; $end = '-----END'; //extrai o conteúdo do certificado entre as marcas BEGIN e END $pemData1 = substr($pemData, strpos($pemData, $begin) + strlen($begin)); $pemData2 = substr($pemData1, 0, strpos($pemDa...
php
protected static function pem2Der($pemData) { $begin = 'CERTIFICATE-----'; $end = '-----END'; //extrai o conteúdo do certificado entre as marcas BEGIN e END $pemData1 = substr($pemData, strpos($pemData, $begin) + strlen($begin)); $pemData2 = substr($pemData1, 0, strpos($pemDa...
[ "protected", "static", "function", "pem2Der", "(", "$", "pemData", ")", "{", "$", "begin", "=", "'CERTIFICATE-----'", ";", "$", "end", "=", "'-----END'", ";", "//extrai o conteúdo do certificado entre as marcas BEGIN e END", "$", "pemData1", "=", "substr", "(", "$",...
pem2Der Transforma o certificado do formato PEM para o formato DER. @param string $pem_data @return string
[ "pem2Der", "Transforma", "o", "certificado", "do", "formato", "PEM", "para", "o", "formato", "DER", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L12-L23
phpnfe/tools
src/Certificado/Base.php
Base.oidtoHex
protected static function oidtoHex($oid) { if ($oid == '') { return ''; } $abBinary = []; //coloca cada parte do numero do OID em uma linha da matriz $partes = explode('.', $oid); $bun = 0; //para cada numero compor o valor asc do mesmo for...
php
protected static function oidtoHex($oid) { if ($oid == '') { return ''; } $abBinary = []; //coloca cada parte do numero do OID em uma linha da matriz $partes = explode('.', $oid); $bun = 0; //para cada numero compor o valor asc do mesmo for...
[ "protected", "static", "function", "oidtoHex", "(", "$", "oid", ")", "{", "if", "(", "$", "oid", "==", "''", ")", "{", "return", "''", ";", "}", "$", "abBinary", "=", "[", "]", ";", "//coloca cada parte do numero do OID em uma linha da matriz", "$", "partes"...
oidtoHex Converte o numero de identificação do OID em uma representação asc, coerente com o formato do certificado. @param string $oid numero OID (com os pontos de separação) @return string sequencia em hexadecimal
[ "oidtoHex", "Converte", "o", "numero", "de", "identificação", "do", "OID", "em", "uma", "representação", "asc", "coerente", "com", "o", "formato", "do", "certificado", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L33-L60
phpnfe/tools
src/Certificado/Base.php
Base.xBase128
protected static function xBase128($abIn, $qIn, $flag) { $abc = $abIn; if ($qIn > 127) { $abc = self::xBase128($abc, floor($qIn / 128), false); } $qIn2 = $qIn % 128; if ($flag) { $abc[] = $qIn2; } else { $abc[] = 0x80 | $qIn2; ...
php
protected static function xBase128($abIn, $qIn, $flag) { $abc = $abIn; if ($qIn > 127) { $abc = self::xBase128($abc, floor($qIn / 128), false); } $qIn2 = $qIn % 128; if ($flag) { $abc[] = $qIn2; } else { $abc[] = 0x80 | $qIn2; ...
[ "protected", "static", "function", "xBase128", "(", "$", "abIn", ",", "$", "qIn", ",", "$", "flag", ")", "{", "$", "abc", "=", "$", "abIn", ";", "if", "(", "$", "qIn", ">", "127", ")", "{", "$", "abc", "=", "self", "::", "xBase128", "(", "$", ...
xBase128 Retorna o dado convertido em asc. @param array $abIn @param int $qIn @param bool $flag @return int
[ "xBase128", "Retorna", "o", "dado", "convertido", "em", "asc", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L71-L85
phpnfe/tools
src/Certificado/Base.php
Base.printHex
protected static function printHex($value) { $tabVal = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; $hex = ''; for ($i = 0; $i < strlen($value); $i++) { $lsig = ord(substr($value, $i, 1)) % 16; $msig = (ord(substr($value, $i, 1)) -...
php
protected static function printHex($value) { $tabVal = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; $hex = ''; for ($i = 0; $i < strlen($value); $i++) { $lsig = ord(substr($value, $i, 1)) % 16; $msig = (ord(substr($value, $i, 1)) -...
[ "protected", "static", "function", "printHex", "(", "$", "value", ")", "{", "$", "tabVal", "=", "[", "'0'", ",", "'1'", ",", "'2'", ",", "'3'", ",", "'4'", ",", "'5'", ",", "'6'", ",", "'7'", ",", "'8'", ",", "'9'", ",", "'A'", ",", "'B'", ",",...
Retorna o valor em caracteres hexadecimais. @param string $value @return string @return void
[ "Retorna", "o", "valor", "em", "caracteres", "hexadecimais", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L94-L107
phpnfe/tools
src/Certificado/Base.php
Base.getLength
protected static function getLength(&$len, &$bytes, $data) { $len = ord($data[1]); $bytes = 0; // Testa se tamanho menor/igual a 127 bytes, // se for, então $len já é o tamanho do conteúdo if ($len & 0x80) { // Testa se tamanho indefinido (nao deve ocorrer em uma ...
php
protected static function getLength(&$len, &$bytes, $data) { $len = ord($data[1]); $bytes = 0; // Testa se tamanho menor/igual a 127 bytes, // se for, então $len já é o tamanho do conteúdo if ($len & 0x80) { // Testa se tamanho indefinido (nao deve ocorrer em uma ...
[ "protected", "static", "function", "getLength", "(", "&", "$", "len", ",", "&", "$", "bytes", ",", "$", "data", ")", "{", "$", "len", "=", "ord", "(", "$", "data", "[", "1", "]", ")", ";", "$", "bytes", "=", "0", ";", "// Testa se tamanho menor/igu...
Obtêm o comprimento do conteúdo de uma sequência de dados do certificado. @param int $len variável passada por referência @param int $bytes variável passada por referência @param string $data campo a @return void
[ "Obtêm", "o", "comprimento", "do", "conteúdo", "de", "uma", "sequência", "de", "dados", "do", "certificado", "." ]
train
https://github.com/phpnfe/tools/blob/303ca311989e0b345071f61b71d2b3bf7ee80454/src/Certificado/Base.php#L117-L138
php-lug/lug
src/Component/Resource/Form/Type/Doctrine/ResourceChoiceType.php
ResourceChoiceType.configureOptions
public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver ->setRequired('resource') ->setAllowedTypes('resource', ResourceInterface::class) ->setDefaults([ 'class' => function (Options $options) {...
php
public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver ->setRequired('resource') ->setAllowedTypes('resource', ResourceInterface::class) ->setDefaults([ 'class' => function (Options $options) {...
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setRequired", "(", "'resource'", ")", "->", "setAllowedTypes", "(", "'resourc...
{@inheritdoc}
[ "{" ]
train
https://github.com/php-lug/lug/blob/81c109f187eba0a60f17e8cc59984ebb31841db7/src/Component/Resource/Form/Type/Doctrine/ResourceChoiceType.php#L27-L46
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Controller/ModelManager.php
Aoe_Layout_Controller_ModelManager.newAction
public function newAction() { $model = $this->loadModel(); if (!$model->isObjectNew()) { $this->_forward('noroute'); return; } if ($this->getRequest()->isPost()) { $postData = $this->getRequest()->getPost(); try { $mode...
php
public function newAction() { $model = $this->loadModel(); if (!$model->isObjectNew()) { $this->_forward('noroute'); return; } if ($this->getRequest()->isPost()) { $postData = $this->getRequest()->getPost(); try { $mode...
[ "public", "function", "newAction", "(", ")", "{", "$", "model", "=", "$", "this", "->", "loadModel", "(", ")", ";", "if", "(", "!", "$", "model", "->", "isObjectNew", "(", ")", ")", "{", "$", "this", "->", "_forward", "(", "'noroute'", ")", ";", ...
Create a new record
[ "Create", "a", "new", "record" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/ModelManager.php#L7-L46
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Controller/ModelManager.php
Aoe_Layout_Controller_ModelManager.editAction
public function editAction() { $model = $this->loadModel(); if ($model->isObjectNew()) { $this->_forward('noroute'); return; } if ($this->getRequest()->isPost()) { $postData = $this->getRequest()->getPost(); try { forea...
php
public function editAction() { $model = $this->loadModel(); if ($model->isObjectNew()) { $this->_forward('noroute'); return; } if ($this->getRequest()->isPost()) { $postData = $this->getRequest()->getPost(); try { forea...
[ "public", "function", "editAction", "(", ")", "{", "$", "model", "=", "$", "this", "->", "loadModel", "(", ")", ";", "if", "(", "$", "model", "->", "isObjectNew", "(", ")", ")", "{", "$", "this", "->", "_forward", "(", "'noroute'", ")", ";", "retur...
Edit an existing record
[ "Edit", "an", "existing", "record" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/ModelManager.php#L51-L80
AOEpeople/Aoe_Layout
app/code/local/Aoe/Layout/Controller/ModelManager.php
Aoe_Layout_Controller_ModelManager.deleteAction
public function deleteAction() { $model = $this->loadModel(); if ($model->isObjectNew()) { $this->_forward('noroute'); return; } try { $model->delete(); $this->_redirectUrl($this->getHelper()->getGridUrl()); $this->_getSess...
php
public function deleteAction() { $model = $this->loadModel(); if ($model->isObjectNew()) { $this->_forward('noroute'); return; } try { $model->delete(); $this->_redirectUrl($this->getHelper()->getGridUrl()); $this->_getSess...
[ "public", "function", "deleteAction", "(", ")", "{", "$", "model", "=", "$", "this", "->", "loadModel", "(", ")", ";", "if", "(", "$", "model", "->", "isObjectNew", "(", ")", ")", "{", "$", "this", "->", "_forward", "(", "'noroute'", ")", ";", "ret...
Delete an existing record
[ "Delete", "an", "existing", "record" ]
train
https://github.com/AOEpeople/Aoe_Layout/blob/d88ba3406cf12dbaf09548477133c3cb27d155ed/app/code/local/Aoe/Layout/Controller/ModelManager.php#L85-L105
mothership-ec/composer
src/Composer/Installer.php
Installer.run
public function run() { gc_collect_cycles(); gc_disable(); if ($this->dryRun) { $this->verbose = true; $this->runScripts = false; $this->installationManager->addInstaller(new NoopInstaller); $this->mockLocalRepositories($this->repositoryManage...
php
public function run() { gc_collect_cycles(); gc_disable(); if ($this->dryRun) { $this->verbose = true; $this->runScripts = false; $this->installationManager->addInstaller(new NoopInstaller); $this->mockLocalRepositories($this->repositoryManage...
[ "public", "function", "run", "(", ")", "{", "gc_collect_cycles", "(", ")", ";", "gc_disable", "(", ")", ";", "if", "(", "$", "this", "->", "dryRun", ")", "{", "$", "this", "->", "verbose", "=", "true", ";", "$", "this", "->", "runScripts", "=", "fa...
Run installation (or update) @return int 0 on success or a positive error code on failure @throws \Exception
[ "Run", "installation", "(", "or", "update", ")" ]
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Installer.php#L164-L352
mothership-ec/composer
src/Composer/Installer.php
Installer.movePluginsToFront
private function movePluginsToFront(array $operations) { $installerOps = array(); foreach ($operations as $idx => $op) { if ($op instanceof InstallOperation) { $package = $op->getPackage(); } elseif ($op instanceof UpdateOperation) { $package =...
php
private function movePluginsToFront(array $operations) { $installerOps = array(); foreach ($operations as $idx => $op) { if ($op instanceof InstallOperation) { $package = $op->getPackage(); } elseif ($op instanceof UpdateOperation) { $package =...
[ "private", "function", "movePluginsToFront", "(", "array", "$", "operations", ")", "{", "$", "installerOps", "=", "array", "(", ")", ";", "foreach", "(", "$", "operations", "as", "$", "idx", "=>", "$", "op", ")", "{", "if", "(", "$", "op", "instanceof"...
Workaround: if your packages depend on plugins, we must be sure that those are installed / updated first; else it would lead to packages being installed multiple times in different folders, when running Composer twice. While this does not fix the root-causes of https://github.com/composer/composer/issues/1147, it at l...
[ "Workaround", ":", "if", "your", "packages", "depend", "on", "plugins", "we", "must", "be", "sure", "that", "those", "are", "installed", "/", "updated", "first", ";", "else", "it", "would", "lead", "to", "packages", "being", "installed", "multiple", "times",...
train
https://github.com/mothership-ec/composer/blob/fa6ad031a939d8d33b211e428fdbdd28cfce238c/src/Composer/Installer.php#L631-L660
jeffturcotte/jest
src/Jest/Injector.php
Injector.invoke
public function invoke(Callable $callable) { $reflection = $this->reflectCallable($callable); $args = []; foreach($reflection->getParameters() as $param) { $type = $param->getClass()->getName(); if (in_array($type, $this->resolving)) { throw new \LogicException("Recursive dependency: $type is curren...
php
public function invoke(Callable $callable) { $reflection = $this->reflectCallable($callable); $args = []; foreach($reflection->getParameters() as $param) { $type = $param->getClass()->getName(); if (in_array($type, $this->resolving)) { throw new \LogicException("Recursive dependency: $type is curren...
[ "public", "function", "invoke", "(", "Callable", "$", "callable", ")", "{", "$", "reflection", "=", "$", "this", "->", "reflectCallable", "(", "$", "callable", ")", ";", "$", "args", "=", "[", "]", ";", "foreach", "(", "$", "reflection", "->", "getPara...
Invoke a callable and injects dependencies @param $callable mixed The Closure or object to inject dependencies into @return mixed The value return from the callable
[ "Invoke", "a", "callable", "and", "injects", "dependencies" ]
train
https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L55-L72
jeffturcotte/jest
src/Jest/Injector.php
Injector.offsetGet
public function offsetGet($class) { if (!isset($this->factories[$class]) && !isset($this->instances[$class])) { throw new \InvalidArgumentException("$class has not been defined"); } if (isset($this->instances[$class])) { return $this->instances[$class]; } array_push($this->resolving, $class); $obje...
php
public function offsetGet($class) { if (!isset($this->factories[$class]) && !isset($this->instances[$class])) { throw new \InvalidArgumentException("$class has not been defined"); } if (isset($this->instances[$class])) { return $this->instances[$class]; } array_push($this->resolving, $class); $obje...
[ "public", "function", "offsetGet", "(", "$", "class", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "factories", "[", "$", "class", "]", ")", "&&", "!", "isset", "(", "$", "this", "->", "instances", "[", "$", "class", "]", ")", ")", ...
get a dependency for the supplied class @param $type string The type to get @return mixed The dependency/type value
[ "get", "a", "dependency", "for", "the", "supplied", "class" ]
train
https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L110-L125
jeffturcotte/jest
src/Jest/Injector.php
Injector.offsetSet
public function offsetSet($class, $factory) { if (is_callable($factory)) { $this->factories[$class] = $factory; } else if (is_object($factory)) { $this->instances[$class] = $factory; } else { throw new \InvalidArgumentException("Dependency supplied is neither a callable or an object"); } }
php
public function offsetSet($class, $factory) { if (is_callable($factory)) { $this->factories[$class] = $factory; } else if (is_object($factory)) { $this->instances[$class] = $factory; } else { throw new \InvalidArgumentException("Dependency supplied is neither a callable or an object"); } }
[ "public", "function", "offsetSet", "(", "$", "class", ",", "$", "factory", ")", "{", "if", "(", "is_callable", "(", "$", "factory", ")", ")", "{", "$", "this", "->", "factories", "[", "$", "class", "]", "=", "$", "factory", ";", "}", "else", "if", ...
Registers a dependency for injection @throws \InvalidArgumentException @param $class string The class to register @param $factory mixed A callable or object The factory used to create the dependency or the instance of the dependency
[ "Registers", "a", "dependency", "for", "injection" ]
train
https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L139-L148
jeffturcotte/jest
src/Jest/Injector.php
Injector.reflectCallable
protected function reflectCallable($callable) { if (is_string($callable) && strpos($callable, '::')) { $callable = explode('::', $callable, 2); } if (is_a($callable, 'Closure')) { $reflection = new \ReflectionFunction($callable); } else if (is_object($callable)) { $reflection = new \ReflectionMethod(...
php
protected function reflectCallable($callable) { if (is_string($callable) && strpos($callable, '::')) { $callable = explode('::', $callable, 2); } if (is_a($callable, 'Closure')) { $reflection = new \ReflectionFunction($callable); } else if (is_object($callable)) { $reflection = new \ReflectionMethod(...
[ "protected", "function", "reflectCallable", "(", "$", "callable", ")", "{", "if", "(", "is_string", "(", "$", "callable", ")", "&&", "strpos", "(", "$", "callable", ",", "'::'", ")", ")", "{", "$", "callable", "=", "explode", "(", "'::'", ",", "$", "...
Reflect a callable @param $callable Callable The callable to reflect @return ReflectionFunction|ReflectionMethod
[ "Reflect", "a", "callable" ]
train
https://github.com/jeffturcotte/jest/blob/1afab9a2939d0c3d977b3992563ca37e77f87c1f/src/Jest/Injector.php#L159-L176
InactiveProjects/limoncello-illuminate
app/Database/Seeds/Runner.php
Runner.run
public function run() { Model::unguard(); try { foreach ($this->seederClasses as $seederClass) { $this->parentSeeder->call($seederClass); } } finally { Model::reguard(); } }
php
public function run() { Model::unguard(); try { foreach ($this->seederClasses as $seederClass) { $this->parentSeeder->call($seederClass); } } finally { Model::reguard(); } }
[ "public", "function", "run", "(", ")", "{", "Model", "::", "unguard", "(", ")", ";", "try", "{", "foreach", "(", "$", "this", "->", "seederClasses", "as", "$", "seederClass", ")", "{", "$", "this", "->", "parentSeeder", "->", "call", "(", "$", "seede...
Run seeders. @return void @SuppressWarnings(PHPMD.StaticAccess)
[ "Run", "seeders", "." ]
train
https://github.com/InactiveProjects/limoncello-illuminate/blob/cae6fc26190efcf090495a5c3582c10fa2430897/app/Database/Seeds/Runner.php#L44-L54
interactivesolutions/honeycomb-core
src/http/controllers/traits/HCQueryMaking.php
HCQueryMaking.getRequestParameters
protected function getRequestParameters(Builder $query, array $availableFields) { $givenFields = $this->getRequestParametersRaw(); foreach ($givenFields as $fieldName => $value) { $from = substr($fieldName, 0, -5); $to = substr($fieldName, 0, -3); if (in_array(...
php
protected function getRequestParameters(Builder $query, array $availableFields) { $givenFields = $this->getRequestParametersRaw(); foreach ($givenFields as $fieldName => $value) { $from = substr($fieldName, 0, -5); $to = substr($fieldName, 0, -3); if (in_array(...
[ "protected", "function", "getRequestParameters", "(", "Builder", "$", "query", ",", "array", "$", "availableFields", ")", "{", "$", "givenFields", "=", "$", "this", "->", "getRequestParametersRaw", "(", ")", ";", "foreach", "(", "$", "givenFields", "as", "$", ...
Get only valid request params for records filtering @param Builder $query @param array $availableFields - Model available fields to select @return mixed
[ "Get", "only", "valid", "request", "params", "for", "records", "filtering" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/traits/HCQueryMaking.php#L40-L63
interactivesolutions/honeycomb-core
src/http/controllers/traits/HCQueryMaking.php
HCQueryMaking.getStrictRequestParameters
protected function getStrictRequestParameters() { $data = []; foreach ($this->strictUpdateKeys as $value) if (request()->has($value)) $data[$value] = request($value); return $data; }
php
protected function getStrictRequestParameters() { $data = []; foreach ($this->strictUpdateKeys as $value) if (request()->has($value)) $data[$value] = request($value); return $data; }
[ "protected", "function", "getStrictRequestParameters", "(", ")", "{", "$", "data", "=", "[", "]", ";", "foreach", "(", "$", "this", "->", "strictUpdateKeys", "as", "$", "value", ")", "if", "(", "request", "(", ")", "->", "has", "(", "$", "value", ")", ...
Gathering all allowed request parameters for strict update @return array
[ "Gathering", "all", "allowed", "request", "parameters", "for", "strict", "update" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/traits/HCQueryMaking.php#L80-L89
interactivesolutions/honeycomb-core
src/http/controllers/traits/HCQueryMaking.php
HCQueryMaking.orderData
protected function orderData(Builder $query, array $availableFields) { $sortBy = request()->input('sort_by'); $sortOrder = request()->input('sort_order'); if (in_array($sortBy, $availableFields)) if (in_array(strtolower($sortOrder), ['asc', 'desc'])) return $quer...
php
protected function orderData(Builder $query, array $availableFields) { $sortBy = request()->input('sort_by'); $sortOrder = request()->input('sort_order'); if (in_array($sortBy, $availableFields)) if (in_array(strtolower($sortOrder), ['asc', 'desc'])) return $quer...
[ "protected", "function", "orderData", "(", "Builder", "$", "query", ",", "array", "$", "availableFields", ")", "{", "$", "sortBy", "=", "request", "(", ")", "->", "input", "(", "'sort_by'", ")", ";", "$", "sortOrder", "=", "request", "(", ")", "->", "i...
Ordering content @param Builder $query @param array $availableFields @return mixed
[ "Ordering", "content" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/traits/HCQueryMaking.php#L98-L108
interactivesolutions/honeycomb-core
src/http/controllers/traits/HCQueryMaking.php
HCQueryMaking.search
protected function search(Builder $query) { $q = request('q'); if (!$q || strlen($q) < $this->minimumSearchInputLength) return $query; return $this->searchQuery($query, $q); }
php
protected function search(Builder $query) { $q = request('q'); if (!$q || strlen($q) < $this->minimumSearchInputLength) return $query; return $this->searchQuery($query, $q); }
[ "protected", "function", "search", "(", "Builder", "$", "query", ")", "{", "$", "q", "=", "request", "(", "'q'", ")", ";", "if", "(", "!", "$", "q", "||", "strlen", "(", "$", "q", ")", "<", "$", "this", "->", "minimumSearchInputLength", ")", "retur...
Creating data list based on search @param Builder $query @return mixed
[ "Creating", "data", "list", "based", "on", "search" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/traits/HCQueryMaking.php#L116-L124
interactivesolutions/honeycomb-core
src/http/controllers/traits/HCQueryMaking.php
HCQueryMaking.checkForDeleted
protected function checkForDeleted(Builder $query) { if (request()->has('deleted') && request()->input('deleted') === '1') $query = $query->onlyTrashed(); return $query; }
php
protected function checkForDeleted(Builder $query) { if (request()->has('deleted') && request()->input('deleted') === '1') $query = $query->onlyTrashed(); return $query; }
[ "protected", "function", "checkForDeleted", "(", "Builder", "$", "query", ")", "{", "if", "(", "request", "(", ")", "->", "has", "(", "'deleted'", ")", "&&", "request", "(", ")", "->", "input", "(", "'deleted'", ")", "===", "'1'", ")", "$", "query", ...
Check for deleted records option @param Builder $query @return mixed
[ "Check", "for", "deleted", "records", "option" ]
train
https://github.com/interactivesolutions/honeycomb-core/blob/06b8d88bb285e73a1a286e60411ca5f41863f39f/src/http/controllers/traits/HCQueryMaking.php#L140-L146
gregoryv/php-logger
src/Logger.php
Logger.turn
public function turn($toggle) { if(preg_match_all('/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/', $toggle, $matches)) { $flag = $matches[1][0]; $all = $matches[2][0]; $name = $matches[3][0]; $this->sieve->toggle($flag, $name); ...
php
public function turn($toggle) { if(preg_match_all('/^(on|off) (all)?\s?(debug|info|notice|warn|error|critical|alert|emergency)$/', $toggle, $matches)) { $flag = $matches[1][0]; $all = $matches[2][0]; $name = $matches[3][0]; $this->sieve->toggle($flag, $name); ...
[ "public", "function", "turn", "(", "$", "toggle", ")", "{", "if", "(", "preg_match_all", "(", "'/^(on|off) (all)?\\s?(debug|info|notice|warn|error|critical|alert|emergency)$/'", ",", "$", "toggle", ",", "$", "matches", ")", ")", "{", "$", "flag", "=", "$", "matche...
Sets logging state of the given severity level in a readable format @example $log->turn('on debug'); @example $log->turn('off all warn'); @param string $toggle format: (on|off) [all] (debug|info|notice|warn|error|critical|alert|emergency)
[ "Sets", "logging", "state", "of", "the", "given", "severity", "level", "in", "a", "readable", "format" ]
train
https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/Logger.php#L68-L81
gregoryv/php-logger
src/Logger.php
Logger.debug
public function debug($value='') { if($this->sieve->debug) { self::$writer->swrite(LOG_DEBUG, sprintf($this->template, 'DEBUG', $value)); } }
php
public function debug($value='') { if($this->sieve->debug) { self::$writer->swrite(LOG_DEBUG, sprintf($this->template, 'DEBUG', $value)); } }
[ "public", "function", "debug", "(", "$", "value", "=", "''", ")", "{", "if", "(", "$", "this", "->", "sieve", "->", "debug", ")", "{", "self", "::", "$", "writer", "->", "swrite", "(", "LOG_DEBUG", ",", "sprintf", "(", "$", "this", "->", "template"...
Debug (severity 7): debug-level messages
[ "Debug", "(", "severity", "7", ")", ":", "debug", "-", "level", "messages" ]
train
https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/Logger.php#L87-L92
gregoryv/php-logger
src/Logger.php
Logger.debugf
public function debugf() { $args = func_get_args(); $format = array_shift($args); $this->debug(vsprintf($format, $args)); }
php
public function debugf() { $args = func_get_args(); $format = array_shift($args); $this->debug(vsprintf($format, $args)); }
[ "public", "function", "debugf", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "format", "=", "array_shift", "(", "$", "args", ")", ";", "$", "this", "->", "debug", "(", "vsprintf", "(", "$", "format", ",", "$", "args", ")", ...
Same as debug(sprintf($format, $args...))
[ "Same", "as", "debug", "(", "sprintf", "(", "$format", "$args", "...", "))" ]
train
https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/Logger.php#L97-L102
gregoryv/php-logger
src/Logger.php
Logger.info
public function info($value='') { if($this->sieve->info) { self::$writer->swrite(LOG_INFO, sprintf($this->template, 'INFO', $value)); } }
php
public function info($value='') { if($this->sieve->info) { self::$writer->swrite(LOG_INFO, sprintf($this->template, 'INFO', $value)); } }
[ "public", "function", "info", "(", "$", "value", "=", "''", ")", "{", "if", "(", "$", "this", "->", "sieve", "->", "info", ")", "{", "self", "::", "$", "writer", "->", "swrite", "(", "LOG_INFO", ",", "sprintf", "(", "$", "this", "->", "template", ...
Informational (severity 6): informational messages
[ "Informational", "(", "severity", "6", ")", ":", "informational", "messages" ]
train
https://github.com/gregoryv/php-logger/blob/0f8ffc360a0233531a9775359929af8876997862/src/Logger.php#L107-L112