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 |
|---|---|---|---|---|---|---|---|---|---|---|
phpguard/plugin-behat | src/Session.php | Session.unserialize | public function unserialize($serialized)
{
$data = unserialize($serialized);
$this->features = $data['features'];
$this->scenarios = $data['scenarios'];
$this->steps = $data['steps'];
$this->results = $data['results'];
$this->path = $data['p... | php | public function unserialize($serialized)
{
$data = unserialize($serialized);
$this->features = $data['features'];
$this->scenarios = $data['scenarios'];
$this->steps = $data['steps'];
$this->results = $data['results'];
$this->path = $data['p... | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"data",
"=",
"unserialize",
"(",
"$",
"serialized",
")",
";",
"$",
"this",
"->",
"features",
"=",
"$",
"data",
"[",
"'features'",
"]",
";",
"$",
"this",
"->",
"scenarios",
"=",... | {inheritdoc} | [
"{",
"inheritdoc",
"}"
] | train | https://github.com/phpguard/plugin-behat/blob/9fa140c4355935196943d2bd8f84232cde1d7d15/src/Session.php#L101-L110 |
agentmedia/phine-core | src/Core/Modules/Backend/UserList.php | UserList.FormUrl | protected function FormUrl(User $user = null)
{
$args = array();
if ($user)
{
$args['user'] = $user->GetID();
}
return BackendRouter::ModuleUrl(new UserForm(), $args);
} | php | protected function FormUrl(User $user = null)
{
$args = array();
if ($user)
{
$args['user'] = $user->GetID();
}
return BackendRouter::ModuleUrl(new UserForm(), $args);
} | [
"protected",
"function",
"FormUrl",
"(",
"User",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"user",
")",
"{",
"$",
"args",
"[",
"'user'",
"]",
"=",
"$",
"user",
"->",
"GetID",
"(",
")",
";",
... | The url to the page with the user edit/create form
@param User $user If user is given, form page will be in edit mode, otherwise in create mode
@return string Returns the form page url | [
"The",
"url",
"to",
"the",
"page",
"with",
"the",
"user",
"edit",
"/",
"create",
"form"
] | train | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/UserList.php#L50-L58 |
agentmedia/phine-core | src/Core/Modules/Backend/UserList.php | UserList.GroupsFormUrl | protected function GroupsFormUrl(User $user)
{
$args = array('user'=>$user->GetID());
return BackendRouter::ModuleUrl(new UsergroupAssignmentForm(), $args);
} | php | protected function GroupsFormUrl(User $user)
{
$args = array('user'=>$user->GetID());
return BackendRouter::ModuleUrl(new UsergroupAssignmentForm(), $args);
} | [
"protected",
"function",
"GroupsFormUrl",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"args",
"=",
"array",
"(",
"'user'",
"=>",
"$",
"user",
"->",
"GetID",
"(",
")",
")",
";",
"return",
"BackendRouter",
"::",
"ModuleUrl",
"(",
"new",
"UsergroupAssignmentForm... | The url to the form for the user groups
@param User $user
@return string | [
"The",
"url",
"to",
"the",
"form",
"for",
"the",
"user",
"groups"
] | train | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/UserList.php#L65-L69 |
agentmedia/phine-core | src/Core/Modules/Backend/UserList.php | UserList.RemovalObject | protected function RemovalObject()
{
$id = Request::PostData('delete');
return $id ? User::Schema()->ByID($id) : null;
} | php | protected function RemovalObject()
{
$id = Request::PostData('delete');
return $id ? User::Schema()->ByID($id) : null;
} | [
"protected",
"function",
"RemovalObject",
"(",
")",
"{",
"$",
"id",
"=",
"Request",
"::",
"PostData",
"(",
"'delete'",
")",
";",
"return",
"$",
"id",
"?",
"User",
"::",
"Schema",
"(",
")",
"->",
"ByID",
"(",
"$",
"id",
")",
":",
"null",
";",
"}"
] | Gets the site for removal if delete id is posted
@return User | [
"Gets",
"the",
"site",
"for",
"removal",
"if",
"delete",
"id",
"is",
"posted"
] | train | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/UserList.php#L104-L108 |
agentmedia/phine-core | src/Core/Modules/Backend/UserList.php | UserList.CanEdit | protected function CanEdit(User $user)
{
return self::Guard()->Allow(BackendAction::Edit(), $user)&&
self::Guard()->Allow(BackendAction::UseIt(), new UserForm());
} | php | protected function CanEdit(User $user)
{
return self::Guard()->Allow(BackendAction::Edit(), $user)&&
self::Guard()->Allow(BackendAction::UseIt(), new UserForm());
} | [
"protected",
"function",
"CanEdit",
"(",
"User",
"$",
"user",
")",
"{",
"return",
"self",
"::",
"Guard",
"(",
")",
"->",
"Allow",
"(",
"BackendAction",
"::",
"Edit",
"(",
")",
",",
"$",
"user",
")",
"&&",
"self",
"::",
"Guard",
"(",
")",
"->",
"All... | True if user can be edited
@param User $user
@return string | [
"True",
"if",
"user",
"can",
"be",
"edited"
] | train | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/UserList.php#L121-L125 |
rickard2/luhnar | Validator.php | Validator.validate | public function validate($input, $country)
{
$country = trim(strtolower($country));
if (!$this->supportsCountry($country)) {
throw new Exception('Unsupported country: ' . $country);
}
if (!$input) {
return true;
}
/** @var \Rickard2\Luhnar\V... | php | public function validate($input, $country)
{
$country = trim(strtolower($country));
if (!$this->supportsCountry($country)) {
throw new Exception('Unsupported country: ' . $country);
}
if (!$input) {
return true;
}
/** @var \Rickard2\Luhnar\V... | [
"public",
"function",
"validate",
"(",
"$",
"input",
",",
"$",
"country",
")",
"{",
"$",
"country",
"=",
"trim",
"(",
"strtolower",
"(",
"$",
"country",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"supportsCountry",
"(",
"$",
"country",
")",
... | @param string $input
@param string $country
@return bool
@throws \Exception | [
"@param",
"string",
"$input",
"@param",
"string",
"$country"
] | train | https://github.com/rickard2/luhnar/blob/e2475a0648396ec51c332e31c673ac97097e48e1/Validator.php#L30-L46 |
tamagokun/rackem | lib/Rackem/Server.php | Server.init | protected function init()
{
set_time_limit(0);
$this->master = @stream_socket_server("tcp://{$this->host}:{$this->port}", $errno, $errstr);
if($this->master === false) {
echo ">> Failed to bind socket.\n", $errno, " - ", $errstr, "\n";
exit(2);
}
strea... | php | protected function init()
{
set_time_limit(0);
$this->master = @stream_socket_server("tcp://{$this->host}:{$this->port}", $errno, $errstr);
if($this->master === false) {
echo ">> Failed to bind socket.\n", $errno, " - ", $errstr, "\n";
exit(2);
}
strea... | [
"protected",
"function",
"init",
"(",
")",
"{",
"set_time_limit",
"(",
"0",
")",
";",
"$",
"this",
"->",
"master",
"=",
"@",
"stream_socket_server",
"(",
"\"tcp://{$this->host}:{$this->port}\"",
",",
"$",
"errno",
",",
"$",
"errstr",
")",
";",
"if",
"(",
"... | /* private | [
"/",
"*",
"private"
] | train | https://github.com/tamagokun/rackem/blob/8f6df86f717f9e88a31a44c0bd152f22562daea9/lib/Rackem/Server.php#L153-L170 |
spiffyjr/spiffy-inject | src/Generator/ArrayGenerator.php | ArrayGenerator.generate | public function generate(Metadata $metadata)
{
return [
$metadata->getClassName(),
$this->buildConstructor($metadata),
$this->buildMethods($metadata)
];
} | php | public function generate(Metadata $metadata)
{
return [
$metadata->getClassName(),
$this->buildConstructor($metadata),
$this->buildMethods($metadata)
];
} | [
"public",
"function",
"generate",
"(",
"Metadata",
"$",
"metadata",
")",
"{",
"return",
"[",
"$",
"metadata",
"->",
"getClassName",
"(",
")",
",",
"$",
"this",
"->",
"buildConstructor",
"(",
"$",
"metadata",
")",
",",
"$",
"this",
"->",
"buildMethods",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/spiffyjr/spiffy-inject/blob/846e365502080e1610d930329f4286489b29a25d/src/Generator/ArrayGenerator.php#L14-L21 |
rutger-speksnijder/restphp | src/RestPHP/Response/Types/Text.php | Text.transformToText | private function transformToText($data, $hypertextRoutes = [], $depth = 0)
{
// Return the data as string if it's not an array
if (!is_array($data)) {
return "{$data}\n{$this->getHypertextString($hypertextRoutes)}";
}
// Loop through the data and add to the string
... | php | private function transformToText($data, $hypertextRoutes = [], $depth = 0)
{
// Return the data as string if it's not an array
if (!is_array($data)) {
return "{$data}\n{$this->getHypertextString($hypertextRoutes)}";
}
// Loop through the data and add to the string
... | [
"private",
"function",
"transformToText",
"(",
"$",
"data",
",",
"$",
"hypertextRoutes",
"=",
"[",
"]",
",",
"$",
"depth",
"=",
"0",
")",
"{",
"// Return the data as string if it's not an array",
"if",
"(",
"!",
"is_array",
"(",
"$",
"data",
")",
")",
"{",
... | Recursively converts the response into a text string.
@param mixed $data The data to transform.
@param optional array $hypertextRoutes An array with hypertext routes.
@return string The response as a text string. | [
"Recursively",
"converts",
"the",
"response",
"into",
"a",
"text",
"string",
"."
] | train | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Response/Types/Text.php#L48-L74 |
rutger-speksnijder/restphp | src/RestPHP/Response/Types/Text.php | Text.getHypertextString | private function getHypertextString($routes = [])
{
// Check if we have routes
if (!$routes) {
return '';
}
// Loop through the routes and add them to the string
$str = "links: \n";
foreach ($routes as $name => $route) {
$str .= "\trel: {$name... | php | private function getHypertextString($routes = [])
{
// Check if we have routes
if (!$routes) {
return '';
}
// Loop through the routes and add them to the string
$str = "links: \n";
foreach ($routes as $name => $route) {
$str .= "\trel: {$name... | [
"private",
"function",
"getHypertextString",
"(",
"$",
"routes",
"=",
"[",
"]",
")",
"{",
"// Check if we have routes",
"if",
"(",
"!",
"$",
"routes",
")",
"{",
"return",
"''",
";",
"}",
"// Loop through the routes and add them to the string",
"$",
"str",
"=",
"... | Transforms the hypertext routes into a string.
@param array $routes The hypertext routes.
@return string The hypertext routes transformed into a string. | [
"Transforms",
"the",
"hypertext",
"routes",
"into",
"a",
"string",
"."
] | train | https://github.com/rutger-speksnijder/restphp/blob/326a7c0d79b266bbdd8a27ff1c8021caf9d28a3d/src/RestPHP/Response/Types/Text.php#L83-L96 |
locomotivemtl/charcoal-queue | src/Charcoal/Queue/AbstractQueueManager.php | AbstractQueueManager.processQueue | public function processQueue(callable $callback = null)
{
$queued = $this->loadQueueItems();
if (!is_callable($callback)) {
$callback = $this->processedCallback;
}
$success = [];
$failures = [];
$skipped = [];
foreach ($queued as $q) {
... | php | public function processQueue(callable $callback = null)
{
$queued = $this->loadQueueItems();
if (!is_callable($callback)) {
$callback = $this->processedCallback;
}
$success = [];
$failures = [];
$skipped = [];
foreach ($queued as $q) {
... | [
"public",
"function",
"processQueue",
"(",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"queued",
"=",
"$",
"this",
"->",
"loadQueueItems",
"(",
")",
";",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"callback",
")",
")",
"{",
"$",
"callback",
... | Process the items of the queue.
If no callback is passed and a self::$processedCallback is set, the latter is used.
@param callable $callback An optional alternative callback routine executed
after all queue items are processed.
@return boolean Success / Failure | [
"Process",
"the",
"items",
"of",
"the",
"queue",
"."
] | train | https://github.com/locomotivemtl/charcoal-queue/blob/90c47581cd35fbb554eca513f909171a70325b44/src/Charcoal/Queue/AbstractQueueManager.php#L257-L297 |
locomotivemtl/charcoal-queue | src/Charcoal/Queue/AbstractQueueManager.php | AbstractQueueManager.loadQueueItems | public function loadQueueItems()
{
$loader = new CollectionLoader([
'logger' => $this->logger,
'factory' => $this->queueItemFactory(),
]);
$loader->setModel($this->queueItemProto());
$loader->addFilter([
'property' => 'processed',
'val... | php | public function loadQueueItems()
{
$loader = new CollectionLoader([
'logger' => $this->logger,
'factory' => $this->queueItemFactory(),
]);
$loader->setModel($this->queueItemProto());
$loader->addFilter([
'property' => 'processed',
'val... | [
"public",
"function",
"loadQueueItems",
"(",
")",
"{",
"$",
"loader",
"=",
"new",
"CollectionLoader",
"(",
"[",
"'logger'",
"=>",
"$",
"this",
"->",
"logger",
",",
"'factory'",
"=>",
"$",
"this",
"->",
"queueItemFactory",
"(",
")",
",",
"]",
")",
";",
... | Retrieve the items of the current queue.
@return \Charcoal\Model\Collection|array | [
"Retrieve",
"the",
"items",
"of",
"the",
"current",
"queue",
"."
] | train | https://github.com/locomotivemtl/charcoal-queue/blob/90c47581cd35fbb554eca513f909171a70325b44/src/Charcoal/Queue/AbstractQueueManager.php#L304-L342 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setEmail | public function setEmail($email)
{
if (!is_string($email)) {
$email = strval($email);
}
$this->email = $email;
} | php | public function setEmail($email)
{
if (!is_string($email)) {
$email = strval($email);
}
$this->email = $email;
} | [
"public",
"function",
"setEmail",
"(",
"$",
"email",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"email",
")",
")",
"{",
"$",
"email",
"=",
"strval",
"(",
"$",
"email",
")",
";",
"}",
"$",
"this",
"->",
"email",
"=",
"$",
"email",
";",
"}"... | Sets the email address.
@param string $email email address
@return void | [
"Sets",
"the",
"email",
"address",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L231-L238 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setTelno | public function setTelno($telno)
{
if (!is_string($telno)) {
$telno = strval($telno);
}
$this->telno = $telno;
} | php | public function setTelno($telno)
{
if (!is_string($telno)) {
$telno = strval($telno);
}
$this->telno = $telno;
} | [
"public",
"function",
"setTelno",
"(",
"$",
"telno",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"telno",
")",
")",
"{",
"$",
"telno",
"=",
"strval",
"(",
"$",
"telno",
")",
";",
"}",
"$",
"this",
"->",
"telno",
"=",
"$",
"telno",
";",
"}"... | Sets the phone number.
@param string $telno telno
@return void | [
"Sets",
"the",
"phone",
"number",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L257-L263 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setCellno | public function setCellno($cellno)
{
if (!is_string($cellno)) {
$cellno = strval($cellno);
}
$this->cellno = $cellno;
} | php | public function setCellno($cellno)
{
if (!is_string($cellno)) {
$cellno = strval($cellno);
}
$this->cellno = $cellno;
} | [
"public",
"function",
"setCellno",
"(",
"$",
"cellno",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"cellno",
")",
")",
"{",
"$",
"cellno",
"=",
"strval",
"(",
"$",
"cellno",
")",
";",
"}",
"$",
"this",
"->",
"cellno",
"=",
"$",
"cellno",
";"... | Sets the cellphone number.
@param string $cellno mobile number
@return void | [
"Sets",
"the",
"cellphone",
"number",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L282-L289 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setFirstName | public function setFirstName($fname)
{
if (!is_string($fname)) {
$fname = strval($fname);
}
$this->fname = $fname;
} | php | public function setFirstName($fname)
{
if (!is_string($fname)) {
$fname = strval($fname);
}
$this->fname = $fname;
} | [
"public",
"function",
"setFirstName",
"(",
"$",
"fname",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"fname",
")",
")",
"{",
"$",
"fname",
"=",
"strval",
"(",
"$",
"fname",
")",
";",
"}",
"$",
"this",
"->",
"fname",
"=",
"$",
"fname",
";",
... | Sets the first name.
@param string $fname firstname
@return void | [
"Sets",
"the",
"first",
"name",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L308-L315 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setLastName | public function setLastName($lname)
{
if (!is_string($lname)) {
$lname = strval($lname);
}
$this->lname = $lname;
} | php | public function setLastName($lname)
{
if (!is_string($lname)) {
$lname = strval($lname);
}
$this->lname = $lname;
} | [
"public",
"function",
"setLastName",
"(",
"$",
"lname",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"lname",
")",
")",
"{",
"$",
"lname",
"=",
"strval",
"(",
"$",
"lname",
")",
";",
"}",
"$",
"this",
"->",
"lname",
"=",
"$",
"lname",
";",
... | Sets the last name.
@param string $lname lastname
@return void | [
"Sets",
"the",
"last",
"name",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L334-L341 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setCompanyName | public function setCompanyName($company)
{
if (!is_string($company)) {
$company = strval($company);
}
$this->company = $company;
} | php | public function setCompanyName($company)
{
if (!is_string($company)) {
$company = strval($company);
}
$this->company = $company;
} | [
"public",
"function",
"setCompanyName",
"(",
"$",
"company",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"company",
")",
")",
"{",
"$",
"company",
"=",
"strval",
"(",
"$",
"company",
")",
";",
"}",
"$",
"this",
"->",
"company",
"=",
"$",
"comp... | Sets the company name.
If the purchase results in a company purchase,
reference person will be used from first and last name,
or the value set with {@link Klarna::setReference()}.
@param string $company company name
@see Klarna::setReference
@return void | [
"Sets",
"the",
"company",
"name",
".",
"If",
"the",
"purchase",
"results",
"in",
"a",
"company",
"purchase",
"reference",
"person",
"will",
"be",
"used",
"from",
"first",
"and",
"last",
"name",
"or",
"the",
"value",
"set",
"with",
"{",
"@link",
"Klarna",
... | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L364-L371 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setCareof | public function setCareof($careof)
{
if (!is_string($careof)) {
$careof = strval($careof);
}
$this->careof = $careof;
} | php | public function setCareof($careof)
{
if (!is_string($careof)) {
$careof = strval($careof);
}
$this->careof = $careof;
} | [
"public",
"function",
"setCareof",
"(",
"$",
"careof",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"careof",
")",
")",
"{",
"$",
"careof",
"=",
"strval",
"(",
"$",
"careof",
")",
";",
"}",
"$",
"this",
"->",
"careof",
"=",
"$",
"careof",
";"... | Sets the care of, C/O.
@param string $careof care of address
@return void | [
"Sets",
"the",
"care",
"of",
"C",
"/",
"O",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L390-L397 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setStreet | public function setStreet($street)
{
if (!is_string($street)) {
$street = strval($street);
}
$this->street = $street;
} | php | public function setStreet($street)
{
if (!is_string($street)) {
$street = strval($street);
}
$this->street = $street;
} | [
"public",
"function",
"setStreet",
"(",
"$",
"street",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"street",
")",
")",
"{",
"$",
"street",
"=",
"strval",
"(",
"$",
"street",
")",
";",
"}",
"$",
"this",
"->",
"street",
"=",
"$",
"street",
";"... | Sets the street address.
@param string $street street address
@return void | [
"Sets",
"the",
"street",
"address",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L416-L423 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setZipCode | public function setZipCode($zip)
{
if (!is_string($zip)) {
$zip = strval($zip);
}
$zip = str_replace(' ', '', $zip); //remove spaces
$this->zip = $zip;
} | php | public function setZipCode($zip)
{
if (!is_string($zip)) {
$zip = strval($zip);
}
$zip = str_replace(' ', '', $zip); //remove spaces
$this->zip = $zip;
} | [
"public",
"function",
"setZipCode",
"(",
"$",
"zip",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"zip",
")",
")",
"{",
"$",
"zip",
"=",
"strval",
"(",
"$",
"zip",
")",
";",
"}",
"$",
"zip",
"=",
"str_replace",
"(",
"' '",
",",
"''",
",",
... | Sets the zip code.
@param string $zip zip code
@return void | [
"Sets",
"the",
"zip",
"code",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L442-L452 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setCity | public function setCity($city)
{
if (!is_string($city)) {
$city = strval($city);
}
$this->city = $city;
} | php | public function setCity($city)
{
if (!is_string($city)) {
$city = strval($city);
}
$this->city = $city;
} | [
"public",
"function",
"setCity",
"(",
"$",
"city",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"city",
")",
")",
"{",
"$",
"city",
"=",
"strval",
"(",
"$",
"city",
")",
";",
"}",
"$",
"this",
"->",
"city",
"=",
"$",
"city",
";",
"}"
] | Sets the city.
@param string $city city
@return void | [
"Sets",
"the",
"city",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L471-L478 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setCountry | public function setCountry($country)
{
if ($country === null) {
throw new Klarna_ArgumentNotSetException('Country');
}
if (is_numeric($country)) {
if (!is_int($country)) {
$country = intval($country);
}
$this->country = $country... | php | public function setCountry($country)
{
if ($country === null) {
throw new Klarna_ArgumentNotSetException('Country');
}
if (is_numeric($country)) {
if (!is_int($country)) {
$country = intval($country);
}
$this->country = $country... | [
"public",
"function",
"setCountry",
"(",
"$",
"country",
")",
"{",
"if",
"(",
"$",
"country",
"===",
"null",
")",
"{",
"throw",
"new",
"Klarna_ArgumentNotSetException",
"(",
"'Country'",
")",
";",
"}",
"if",
"(",
"is_numeric",
"(",
"$",
"country",
")",
"... | Sets the country, use either a two letter representation or the integer
constant.
@param int $country {@link KlarnaCountry}
@throws KlarnaException
@return void | [
"Sets",
"the",
"country",
"use",
"either",
"a",
"two",
"letter",
"representation",
"or",
"the",
"integer",
"constant",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L510-L527 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setHouseNumber | public function setHouseNumber($houseNo)
{
if (!is_string($houseNo)) {
$houseNo = strval($houseNo);
}
$this->houseNo = $houseNo;
} | php | public function setHouseNumber($houseNo)
{
if (!is_string($houseNo)) {
$houseNo = strval($houseNo);
}
$this->houseNo = $houseNo;
} | [
"public",
"function",
"setHouseNumber",
"(",
"$",
"houseNo",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"houseNo",
")",
")",
"{",
"$",
"houseNo",
"=",
"strval",
"(",
"$",
"houseNo",
")",
";",
"}",
"$",
"this",
"->",
"houseNo",
"=",
"$",
"hous... | Sets the house number.<br>
Only used in Germany and Netherlands.<br>
@param string $houseNo house number
@return void | [
"Sets",
"the",
"house",
"number",
".",
"<br",
">",
"Only",
"used",
"in",
"Germany",
"and",
"Netherlands",
".",
"<br",
">"
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L548-L555 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.setHouseExt | public function setHouseExt($houseExt)
{
if (!is_string($houseExt)) {
$houseExt = strval($houseExt);
}
$this->houseExt = $houseExt;
} | php | public function setHouseExt($houseExt)
{
if (!is_string($houseExt)) {
$houseExt = strval($houseExt);
}
$this->houseExt = $houseExt;
} | [
"public",
"function",
"setHouseExt",
"(",
"$",
"houseExt",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"houseExt",
")",
")",
"{",
"$",
"houseExt",
"=",
"strval",
"(",
"$",
"houseExt",
")",
";",
"}",
"$",
"this",
"->",
"houseExt",
"=",
"$",
"ho... | Sets the house extension.<br>
Only used in Netherlands.<br>
@param string $houseExt house extension
@return void | [
"Sets",
"the",
"house",
"extension",
".",
"<br",
">",
"Only",
"used",
"in",
"Netherlands",
".",
"<br",
">"
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L576-L583 |
Subscribo/klarna-invoice-sdk-wrapped | src/klarnaaddr.php | KlarnaAddr.toArray | public function toArray()
{
return array(
'email' => $this->getEmail(),
'telno' => $this->getTelno(),
'cellno' => $this->getCellno(),
'fname' => $this->getFirstName(),
'lname' => $this->getLastName(),
'company' => $this->getCompanyName(... | php | public function toArray()
{
return array(
'email' => $this->getEmail(),
'telno' => $this->getTelno(),
'cellno' => $this->getCellno(),
'fname' => $this->getFirstName(),
'lname' => $this->getLastName(),
'company' => $this->getCompanyName(... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"return",
"array",
"(",
"'email'",
"=>",
"$",
"this",
"->",
"getEmail",
"(",
")",
",",
"'telno'",
"=>",
"$",
"this",
"->",
"getTelno",
"(",
")",
",",
"'cellno'",
"=>",
"$",
"this",
"->",
"getCellno",
"(... | Returns an associative array representing this object.
@return array | [
"Returns",
"an",
"associative",
"array",
"representing",
"this",
"object",
"."
] | train | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/klarnaaddr.php#L590-L607 |
Talis90/HtmlMediaFinder | library/HtmlMediaFinder/RemoteXpathAdapter.php | RemoteXpathAdapter.remoteXpathQuery | static function remoteXpathQuery($url, $xpath, array $post = []) {
if (count($post) > 0) {
$cont = self::postRequest($url, $post);
} else {
$cont = file_get_contents($url);
}
return self::xpathQuery($cont, $xpath);
} | php | static function remoteXpathQuery($url, $xpath, array $post = []) {
if (count($post) > 0) {
$cont = self::postRequest($url, $post);
} else {
$cont = file_get_contents($url);
}
return self::xpathQuery($cont, $xpath);
} | [
"static",
"function",
"remoteXpathQuery",
"(",
"$",
"url",
",",
"$",
"xpath",
",",
"array",
"$",
"post",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"post",
")",
">",
"0",
")",
"{",
"$",
"cont",
"=",
"self",
"::",
"postRequest",
"(",
... | Curl the $url and get the elements matching the given $xpath
@param string $url
@param string $xpath
@return DOMNodeList | [
"Curl",
"the",
"$url",
"and",
"get",
"the",
"elements",
"matching",
"the",
"given",
"$xpath"
] | train | https://github.com/Talis90/HtmlMediaFinder/blob/fd19212a88d5d3f78d20aeea1accf7be427643b0/library/HtmlMediaFinder/RemoteXpathAdapter.php#L13-L20 |
Talis90/HtmlMediaFinder | library/HtmlMediaFinder/RemoteXpathAdapter.php | RemoteXpathAdapter.xpathQuery | static function xpathQuery($html, $xpath) {
$ddoc = new \DOMDocument();
@$ddoc->loadHTML($html);
$dxpath = new \DOMXPath($ddoc);
return $dxpath->query($xpath);
} | php | static function xpathQuery($html, $xpath) {
$ddoc = new \DOMDocument();
@$ddoc->loadHTML($html);
$dxpath = new \DOMXPath($ddoc);
return $dxpath->query($xpath);
} | [
"static",
"function",
"xpathQuery",
"(",
"$",
"html",
",",
"$",
"xpath",
")",
"{",
"$",
"ddoc",
"=",
"new",
"\\",
"DOMDocument",
"(",
")",
";",
"@",
"$",
"ddoc",
"->",
"loadHTML",
"(",
"$",
"html",
")",
";",
"$",
"dxpath",
"=",
"new",
"\\",
"DOMX... | Get the elements matching the given $xpath
@param string $html
@param string $xpath
@return DOMNodeList | [
"Get",
"the",
"elements",
"matching",
"the",
"given",
"$xpath"
] | train | https://github.com/Talis90/HtmlMediaFinder/blob/fd19212a88d5d3f78d20aeea1accf7be427643b0/library/HtmlMediaFinder/RemoteXpathAdapter.php#L28-L34 |
Talis90/HtmlMediaFinder | library/HtmlMediaFinder/RemoteXpathAdapter.php | RemoteXpathAdapter.postRequest | static function postRequest($url, array $post) {
$handle = curl_init($url);
curl_setopt_array($handle, [
CURLOPT_POST => count($post),
CURLOPT_POSTFIELDS => http_build_query($post),
CURLOPT_RETURNTRANSFER => 1
]);
$result = curl_exec($handle);
curl_close($handle);
return $result;
} | php | static function postRequest($url, array $post) {
$handle = curl_init($url);
curl_setopt_array($handle, [
CURLOPT_POST => count($post),
CURLOPT_POSTFIELDS => http_build_query($post),
CURLOPT_RETURNTRANSFER => 1
]);
$result = curl_exec($handle);
curl_close($handle);
return $result;
} | [
"static",
"function",
"postRequest",
"(",
"$",
"url",
",",
"array",
"$",
"post",
")",
"{",
"$",
"handle",
"=",
"curl_init",
"(",
"$",
"url",
")",
";",
"curl_setopt_array",
"(",
"$",
"handle",
",",
"[",
"CURLOPT_POST",
"=>",
"count",
"(",
"$",
"post",
... | Get result string of post request
@param string $url
@param array $post
@return string | [
"Get",
"result",
"string",
"of",
"post",
"request"
] | train | https://github.com/Talis90/HtmlMediaFinder/blob/fd19212a88d5d3f78d20aeea1accf7be427643b0/library/HtmlMediaFinder/RemoteXpathAdapter.php#L42-L55 |
romm/configuration_object | Classes/Validation/Validator/Internal/MixedTypeValidator.php | MixedTypeValidator.isValid | public function isValid($object)
{
if (is_object($object)) {
$validator = Core::get()->getValidatorResolver()
->getBaseValidatorConjunction(get_class($object));
$this->result->merge($validator->validate($object));
}
} | php | public function isValid($object)
{
if (is_object($object)) {
$validator = Core::get()->getValidatorResolver()
->getBaseValidatorConjunction(get_class($object));
$this->result->merge($validator->validate($object));
}
} | [
"public",
"function",
"isValid",
"(",
"$",
"object",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"$",
"validator",
"=",
"Core",
"::",
"get",
"(",
")",
"->",
"getValidatorResolver",
"(",
")",
"->",
"getBaseValidatorConjunction",
"... | The property of the object is a mixed type: the validator could not be
guessed in the validator resolver, because the property was not filled
yet.
We have to build the resolver now for the given object and merge its
result with the result of this validator.
@inheritdoc | [
"The",
"property",
"of",
"the",
"object",
"is",
"a",
"mixed",
"type",
":",
"the",
"validator",
"could",
"not",
"be",
"guessed",
"in",
"the",
"validator",
"resolver",
"because",
"the",
"property",
"was",
"not",
"filled",
"yet",
"."
] | train | https://github.com/romm/configuration_object/blob/d3a40903386c2e0766bd8279337fe6da45cf5ce3/Classes/Validation/Validator/Internal/MixedTypeValidator.php#L35-L43 |
koolkode/meta | src/Source/SourceParser.php | SourceParser.parse | public function parse(SourceStream $code, SourceStorageInterface $storage = NULL)
{
$buffer = new SourceBuffer();
$this->doParse($code, $buffer, $storage);
return $buffer;
} | php | public function parse(SourceStream $code, SourceStorageInterface $storage = NULL)
{
$buffer = new SourceBuffer();
$this->doParse($code, $buffer, $storage);
return $buffer;
} | [
"public",
"function",
"parse",
"(",
"SourceStream",
"$",
"code",
",",
"SourceStorageInterface",
"$",
"storage",
"=",
"NULL",
")",
"{",
"$",
"buffer",
"=",
"new",
"SourceBuffer",
"(",
")",
";",
"$",
"this",
"->",
"doParse",
"(",
"$",
"code",
",",
"$",
"... | Parse the given code and create a SourceGenerator from it, extracted data for static
analysis is stored in the given storage implementation.
@param SourceStream $code The source code to be parsed.
@param SourceStorageInterface $storage The stoage implementation for extracted data.
@return SourceGenerator | [
"Parse",
"the",
"given",
"code",
"and",
"create",
"a",
"SourceGenerator",
"from",
"it",
"extracted",
"data",
"for",
"static",
"analysis",
"is",
"stored",
"in",
"the",
"given",
"storage",
"implementation",
"."
] | train | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceParser.php#L40-L46 |
koolkode/meta | src/Source/SourceParser.php | SourceParser.lookup | protected function lookup($localName, $namespace = '', array $import = [])
{
if($localName == '')
{
return $localName;
}
switch(strtolower($localName))
{
case 'bool':
case 'int':
case 'float':
case 'string':
case 'array':
case 'callable':
return strtolower($localName);
break;
... | php | protected function lookup($localName, $namespace = '', array $import = [])
{
if($localName == '')
{
return $localName;
}
switch(strtolower($localName))
{
case 'bool':
case 'int':
case 'float':
case 'string':
case 'array':
case 'callable':
return strtolower($localName);
break;
... | [
"protected",
"function",
"lookup",
"(",
"$",
"localName",
",",
"$",
"namespace",
"=",
"''",
",",
"array",
"$",
"import",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"$",
"localName",
"==",
"''",
")",
"{",
"return",
"$",
"localName",
";",
"}",
"switch",
"("... | Lookup a fully qualified name in the given namespace considering imports.
@param string $localName
@param string $namespace
@param array<string, string> $import
@return string | [
"Lookup",
"a",
"fully",
"qualified",
"name",
"in",
"the",
"given",
"namespace",
"considering",
"imports",
"."
] | train | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceParser.php#L638-L678 |
koolkode/meta | src/Source/SourceParser.php | SourceParser.parseTypeModifiers | protected function parseTypeModifiers(array $tokens)
{
$modifiers = 0;
foreach($tokens as $tok)
{
if(is_array($tok))
{
switch($tok[0])
{
case T_ABSTRACT:
$modifiers |= MetaInfo::IS_ABSTRACT;
break;
case T_FINAL:
$modifiers |= MetaInfo::IS_FINAL;
br... | php | protected function parseTypeModifiers(array $tokens)
{
$modifiers = 0;
foreach($tokens as $tok)
{
if(is_array($tok))
{
switch($tok[0])
{
case T_ABSTRACT:
$modifiers |= MetaInfo::IS_ABSTRACT;
break;
case T_FINAL:
$modifiers |= MetaInfo::IS_FINAL;
br... | [
"protected",
"function",
"parseTypeModifiers",
"(",
"array",
"$",
"tokens",
")",
"{",
"$",
"modifiers",
"=",
"0",
";",
"foreach",
"(",
"$",
"tokens",
"as",
"$",
"tok",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"tok",
")",
")",
"{",
"switch",
"(",
... | Extract all type modifiers from the given tokens and combine them into a bit mask.
@param array $tokens
@return integer | [
"Extract",
"all",
"type",
"modifiers",
"from",
"the",
"given",
"tokens",
"and",
"combine",
"them",
"into",
"a",
"bit",
"mask",
"."
] | train | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceParser.php#L686-L707 |
koolkode/meta | src/Source/SourceParser.php | SourceParser.parseFieldModifiers | protected function parseFieldModifiers(array $tokens)
{
$modifiers = MetaInfo::IS_PUBLIC;
foreach($tokens as $tok)
{
if(is_array($tok))
{
switch($tok[0])
{
case T_VAR:
case T_PUBLIC:
$modifiers = ($modifiers | MetaInfo::MASK_VISIBILITY) ^ MetaInfo::IS_NOT_PUBLIC;
break;
... | php | protected function parseFieldModifiers(array $tokens)
{
$modifiers = MetaInfo::IS_PUBLIC;
foreach($tokens as $tok)
{
if(is_array($tok))
{
switch($tok[0])
{
case T_VAR:
case T_PUBLIC:
$modifiers = ($modifiers | MetaInfo::MASK_VISIBILITY) ^ MetaInfo::IS_NOT_PUBLIC;
break;
... | [
"protected",
"function",
"parseFieldModifiers",
"(",
"array",
"$",
"tokens",
")",
"{",
"$",
"modifiers",
"=",
"MetaInfo",
"::",
"IS_PUBLIC",
";",
"foreach",
"(",
"$",
"tokens",
"as",
"$",
"tok",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"tok",
")",
")... | Parse all field modifiers from the given tokens and combine them into a bit mask.
@param array $tokens
@return integer | [
"Parse",
"all",
"field",
"modifiers",
"from",
"the",
"given",
"tokens",
"and",
"combine",
"them",
"into",
"a",
"bit",
"mask",
"."
] | train | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceParser.php#L715-L743 |
koolkode/meta | src/Source/SourceParser.php | SourceParser.parseMethodModifiers | protected function parseMethodModifiers(array $tokens)
{
$modifiers = MetaInfo::IS_PUBLIC;
foreach($tokens as $tok)
{
if(is_array($tok))
{
switch($tok[0])
{
case T_PUBLIC:
$modifiers = ($modifiers | MetaInfo::MASK_VISIBILITY) ^ MetaInfo::IS_NOT_PUBLIC;
break;
case... | php | protected function parseMethodModifiers(array $tokens)
{
$modifiers = MetaInfo::IS_PUBLIC;
foreach($tokens as $tok)
{
if(is_array($tok))
{
switch($tok[0])
{
case T_PUBLIC:
$modifiers = ($modifiers | MetaInfo::MASK_VISIBILITY) ^ MetaInfo::IS_NOT_PUBLIC;
break;
case... | [
"protected",
"function",
"parseMethodModifiers",
"(",
"array",
"$",
"tokens",
")",
"{",
"$",
"modifiers",
"=",
"MetaInfo",
"::",
"IS_PUBLIC",
";",
"foreach",
"(",
"$",
"tokens",
"as",
"$",
"tok",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"tok",
")",
"... | Parse all method modifiers from the given tokens and combine them into a bit mask.
@param array $tokens
@return integer | [
"Parse",
"all",
"method",
"modifiers",
"from",
"the",
"given",
"tokens",
"and",
"combine",
"them",
"into",
"a",
"bit",
"mask",
"."
] | train | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceParser.php#L751-L784 |
koolkode/meta | src/Source/SourceParser.php | SourceParser.expandNamesInternal | protected function expandNamesInternal(array & $tokens, $typeName, NamespaceContext $context)
{
$buffer = '';
for($size = count($tokens), $i = 0; $i < $size; $i ++)
{
if(is_array($tokens[$i]) && ($tokens[$i][0] == T_STRING || $tokens[$i][0] == T_NS_SEPARATOR || $tokens[$i][0] == T_NEW))
{
$isNew = (... | php | protected function expandNamesInternal(array & $tokens, $typeName, NamespaceContext $context)
{
$buffer = '';
for($size = count($tokens), $i = 0; $i < $size; $i ++)
{
if(is_array($tokens[$i]) && ($tokens[$i][0] == T_STRING || $tokens[$i][0] == T_NS_SEPARATOR || $tokens[$i][0] == T_NEW))
{
$isNew = (... | [
"protected",
"function",
"expandNamesInternal",
"(",
"array",
"&",
"$",
"tokens",
",",
"$",
"typeName",
",",
"NamespaceContext",
"$",
"context",
")",
"{",
"$",
"buffer",
"=",
"''",
";",
"for",
"(",
"$",
"size",
"=",
"count",
"(",
"$",
"tokens",
")",
",... | Expand all unqualified names using the given namespace context in the given source code tokens.
@param array $tokens
@param NamespaceContext $context
@return string | [
"Expand",
"all",
"unqualified",
"names",
"using",
"the",
"given",
"namespace",
"context",
"in",
"the",
"given",
"source",
"code",
"tokens",
"."
] | train | https://github.com/koolkode/meta/blob/339db24d3ce461190f552c96e243bca21010f360/src/Source/SourceParser.php#L798-L881 |
PenoaksDev/Milky-Framework | src/Milky/Annotations/AnnotationException.php | AnnotationException.enumeratorError | public static function enumeratorError($attributeName, $annotationName, $context, $available, $given)
{
return new self(sprintf(
'[Enum Error] Attribute "%s" of @%s declared on %s accept only [%s], but got %s.',
$attributeName,
$annotationName,
$context,
implode(', ', $available),
... | php | public static function enumeratorError($attributeName, $annotationName, $context, $available, $given)
{
return new self(sprintf(
'[Enum Error] Attribute "%s" of @%s declared on %s accept only [%s], but got %s.',
$attributeName,
$annotationName,
$context,
implode(', ', $available),
... | [
"public",
"static",
"function",
"enumeratorError",
"(",
"$",
"attributeName",
",",
"$",
"annotationName",
",",
"$",
"context",
",",
"$",
"available",
",",
"$",
"given",
")",
"{",
"return",
"new",
"self",
"(",
"sprintf",
"(",
"'[Enum Error] Attribute \"%s\" of @%... | Creates a new AnnotationException describing a invalid enummerator.
@since 2.4
@param string $attributeName
@param string $annotationName
@param string $context
@param array $available
@param mixed $given
@return AnnotationException | [
"Creates",
"a",
"new",
"AnnotationException",
"describing",
"a",
"invalid",
"enummerator",
"."
] | train | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/AnnotationException.php#L147-L157 |
phossa/phossa-shared | src/Phossa/Shared/Message/MessageAbstract.php | MessageAbstract.get | public static function get()/*# : string */
{
// process arguments
$args = func_get_args();
if (sizeof($args) < 1) {
// return empty string
return '';
} else {
$code = array_shift($args);
// first argument is not numeric
if ... | php | public static function get()/*# : string */
{
// process arguments
$args = func_get_args();
if (sizeof($args) < 1) {
// return empty string
return '';
} else {
$code = array_shift($args);
// first argument is not numeric
if ... | [
"public",
"static",
"function",
"get",
"(",
")",
"/*# : string */",
"{",
"// process arguments",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"sizeof",
"(",
"$",
"args",
")",
"<",
"1",
")",
"{",
"// return empty string",
"return",
"''",
";"... | {@inheritDoc} | [
"{"
] | train | https://github.com/phossa/phossa-shared/blob/fcf140c09e94c3a441ee4e285de0b4c18cb6504b/src/Phossa/Shared/Message/MessageAbstract.php#L85-L127 |
phossa/phossa-shared | src/Phossa/Shared/Message/MessageAbstract.php | MessageAbstract.loadMappings | protected static function loadMappings(/*# string */ $class)
{
// mapping status changed ?
if (self::isStatusUpdated()) {
self::resetMappings();
self::setStatus(false);
}
// $class' mapping loaded already
if ($class::hasMappings()) {
retur... | php | protected static function loadMappings(/*# string */ $class)
{
// mapping status changed ?
if (self::isStatusUpdated()) {
self::resetMappings();
self::setStatus(false);
}
// $class' mapping loaded already
if ($class::hasMappings()) {
retur... | [
"protected",
"static",
"function",
"loadMappings",
"(",
"/*# string */",
"$",
"class",
")",
"{",
"// mapping status changed ?",
"if",
"(",
"self",
"::",
"isStatusUpdated",
"(",
")",
")",
"{",
"self",
"::",
"resetMappings",
"(",
")",
";",
"self",
"::",
"setStat... | Load message mappings for $class
@param string $class fully qualified class name
@return void
@access protected
@static | [
"Load",
"message",
"mappings",
"for",
"$class"
] | train | https://github.com/phossa/phossa-shared/blob/fcf140c09e94c3a441ee4e285de0b4c18cb6504b/src/Phossa/Shared/Message/MessageAbstract.php#L137-L161 |
phossa/phossa-shared | src/Phossa/Shared/Message/MessageAbstract.php | MessageAbstract.buildMessage | protected static function buildMessage(
/*# string */ $template,
array $arguments
)/*# : string */ {
// use formatter
if (self::hasFormatter()) {
return self::getFormatter()
->formatMessage($template, $arguments);
// default is vsprintf()
... | php | protected static function buildMessage(
/*# string */ $template,
array $arguments
)/*# : string */ {
// use formatter
if (self::hasFormatter()) {
return self::getFormatter()
->formatMessage($template, $arguments);
// default is vsprintf()
... | [
"protected",
"static",
"function",
"buildMessage",
"(",
"/*# string */",
"$",
"template",
",",
"array",
"$",
"arguments",
")",
"/*# : string */",
"{",
"// use formatter",
"if",
"(",
"self",
"::",
"hasFormatter",
"(",
")",
")",
"{",
"return",
"self",
"::",
"get... | Build message from template and arguments.
- Make sure '%s' matches the arguments provided.
- Use message formatter if exists
@param string $template message template
@param array $arguments arguments for the template
@return string
@access protected
@static | [
"Build",
"message",
"from",
"template",
"and",
"arguments",
"."
] | train | https://github.com/phossa/phossa-shared/blob/fcf140c09e94c3a441ee4e285de0b4c18cb6504b/src/Phossa/Shared/Message/MessageAbstract.php#L175-L202 |
RocketPropelledTortoise/Core | src/Translation/I18NToolbar.php | I18NToolbar.loadLanguage | public function loadLanguage($language)
{
if ($this->isLoaded($language)) {
return;
}
$this->strings[$language] = [];
$this->languagesLoaded[] = $language;
} | php | public function loadLanguage($language)
{
if ($this->isLoaded($language)) {
return;
}
$this->strings[$language] = [];
$this->languagesLoaded[] = $language;
} | [
"public",
"function",
"loadLanguage",
"(",
"$",
"language",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isLoaded",
"(",
"$",
"language",
")",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"strings",
"[",
"$",
"language",
"]",
"=",
"[",
"]",
";",
... | Load a language file
@param string $language
@return bool | [
"Load",
"a",
"language",
"file"
] | train | https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Translation/I18NToolbar.php#L56-L64 |
jonesiscoding/device | src/DeviceFeatureInfo.php | DeviceFeatureInfo.get | public function get( $item = null )
{
if( empty( $this->_detect ) || !array_key_exists( $item, $this->_detect ) )
{
$this->_detect = $this->detect();
}
if( $item )
{
return ( array_key_exists( $item, $this->_detect ) ) ? $this->_detect[ $item ] : false;
}
return $this->_detec... | php | public function get( $item = null )
{
if( empty( $this->_detect ) || !array_key_exists( $item, $this->_detect ) )
{
$this->_detect = $this->detect();
}
if( $item )
{
return ( array_key_exists( $item, $this->_detect ) ) ? $this->_detect[ $item ] : false;
}
return $this->_detec... | [
"public",
"function",
"get",
"(",
"$",
"item",
"=",
"null",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"_detect",
")",
"||",
"!",
"array_key_exists",
"(",
"$",
"item",
",",
"$",
"this",
"->",
"_detect",
")",
")",
"{",
"$",
"this",
"->"... | Retrieves the full results of the current client detection, or a specific parameter. Available parameters are
hidpi, width, height, speed, modern, touch, and cookies.
@param string|null $item The parameter you wish to detect
@return string|array|bool The detected parameter, or if $item was not given, the ar... | [
"Retrieves",
"the",
"full",
"results",
"of",
"the",
"current",
"client",
"detection",
"or",
"a",
"specific",
"parameter",
".",
"Available",
"parameters",
"are",
"hidpi",
"width",
"height",
"speed",
"modern",
"touch",
"and",
"cookies",
"."
] | train | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DeviceFeatureInfo.php#L49-L62 |
jonesiscoding/device | src/DeviceFeatureInfo.php | DeviceFeatureInfo.detect | private function detect()
{
$detect = array();
$defaults = $this->getDefaults();
if( $this->isDetected() )
{
$detect = json_decode( $_COOKIE[ $this->cookieName ], true );
if( !is_null( $detect ) )
{
// Convert Boolean values from strings
foreach( $detect as $k => $... | php | private function detect()
{
$detect = array();
$defaults = $this->getDefaults();
if( $this->isDetected() )
{
$detect = json_decode( $_COOKIE[ $this->cookieName ], true );
if( !is_null( $detect ) )
{
// Convert Boolean values from strings
foreach( $detect as $k => $... | [
"private",
"function",
"detect",
"(",
")",
"{",
"$",
"detect",
"=",
"array",
"(",
")",
";",
"$",
"defaults",
"=",
"$",
"this",
"->",
"getDefaults",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isDetected",
"(",
")",
")",
"{",
"$",
"detect",
"=",... | Parses the cookie left by d.js. If the cookie is not set due to Javascript being disabled, or cookies being
being blocked, DetectByUserAgent is used to determine the values by the user agent.
Using the user agent can be quite flawed. As we are limiting it to feature detection, it makes a good backup here.
@return ar... | [
"Parses",
"the",
"cookie",
"left",
"by",
"d",
".",
"js",
".",
"If",
"the",
"cookie",
"is",
"not",
"set",
"due",
"to",
"Javascript",
"being",
"disabled",
"or",
"cookies",
"being",
"being",
"blocked",
"DetectByUserAgent",
"is",
"used",
"to",
"determine",
"th... | train | https://github.com/jonesiscoding/device/blob/d3c66f934bcaa8e5e0424cf684c995b1c80cee29/src/DeviceFeatureInfo.php#L221-L253 |
nicmart/Arrayze | src/MapsCollection.php | MapsCollection.registerMaps | public function registerMaps(array $maps)
{
foreach ($maps as $name => $map) {
$this->maps[$name] = $map;
}
return $this;
} | php | public function registerMaps(array $maps)
{
foreach ($maps as $name => $map) {
$this->maps[$name] = $map;
}
return $this;
} | [
"public",
"function",
"registerMaps",
"(",
"array",
"$",
"maps",
")",
"{",
"foreach",
"(",
"$",
"maps",
"as",
"$",
"name",
"=>",
"$",
"map",
")",
"{",
"$",
"this",
"->",
"maps",
"[",
"$",
"name",
"]",
"=",
"$",
"map",
";",
"}",
"return",
"$",
"... | @param callable[] $maps
@return $this | [
"@param",
"callable",
"[]",
"$maps"
] | train | https://github.com/nicmart/Arrayze/blob/7a86c8a661456b5f7055857aeda3e6ee3af05b13/src/MapsCollection.php#L36-L43 |
nicmart/Arrayze | src/MapsCollection.php | MapsCollection.apply | public function apply($mapName, $value1, $value2 = null)
{
$args = func_get_args();
array_shift($args);
return call_user_func_array($this->getMap($mapName), $args);
} | php | public function apply($mapName, $value1, $value2 = null)
{
$args = func_get_args();
array_shift($args);
return call_user_func_array($this->getMap($mapName), $args);
} | [
"public",
"function",
"apply",
"(",
"$",
"mapName",
",",
"$",
"value1",
",",
"$",
"value2",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"array_shift",
"(",
"$",
"args",
")",
";",
"return",
"call_user_func_array",
"(",
"$",
... | @param string $mapName
@param mixed $value
@return mixed | [
"@param",
"string",
"$mapName",
"@param",
"mixed",
"$value"
] | train | https://github.com/nicmart/Arrayze/blob/7a86c8a661456b5f7055857aeda3e6ee3af05b13/src/MapsCollection.php#L81-L87 |
nicmart/Arrayze | src/MapsCollection.php | MapsCollection.map | public function map($value/*, $value2, ... */)
{
$args = func_get_args();
foreach ($this->getMaps() as $name => $map)
{
yield $name => call_user_func_array($map, $args);
}
} | php | public function map($value/*, $value2, ... */)
{
$args = func_get_args();
foreach ($this->getMaps() as $name => $map)
{
yield $name => call_user_func_array($map, $args);
}
} | [
"public",
"function",
"map",
"(",
"$",
"value",
"/*, $value2, ... */",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getMaps",
"(",
")",
"as",
"$",
"name",
"=>",
"$",
"map",
")",
"{",
"yield",
"$",
... | @param $value
@return \Generator | [
"@param",
"$value"
] | train | https://github.com/nicmart/Arrayze/blob/7a86c8a661456b5f7055857aeda3e6ee3af05b13/src/MapsCollection.php#L94-L101 |
AnonymPHP/Anonym-Cookie | src/Anonym/Components/Http/CookieBag.php | CookieBag.rendeCookieString | private function rendeCookieString($cookie = '')
{
if ($cookie !== '') {
$explode = explode(";", $cookie);
$cookies = [];
foreach ($explode as $ex) {
$ex = explode('=', $ex, 2);
$cookies[trim($ex[0])] = ($ex[1]);
}
... | php | private function rendeCookieString($cookie = '')
{
if ($cookie !== '') {
$explode = explode(";", $cookie);
$cookies = [];
foreach ($explode as $ex) {
$ex = explode('=', $ex, 2);
$cookies[trim($ex[0])] = ($ex[1]);
}
... | [
"private",
"function",
"rendeCookieString",
"(",
"$",
"cookie",
"=",
"''",
")",
"{",
"if",
"(",
"$",
"cookie",
"!==",
"''",
")",
"{",
"$",
"explode",
"=",
"explode",
"(",
"\";\"",
",",
"$",
"cookie",
")",
";",
"$",
"cookies",
"=",
"[",
"]",
";",
... | Cookie verilerini parçalar
@param string $cookie
@return array | [
"Cookie",
"verilerini",
"parçalar"
] | train | https://github.com/AnonymPHP/Anonym-Cookie/blob/7e02403f76fab42355f02326c5589d3fca271e3b/src/Anonym/Components/Http/CookieBag.php#L48-L64 |
cubicmushroom/valueobjects | src/DateTime/Date.php | Date.fromNative | public static function fromNative()
{
$args = func_get_args();
$year = new Year($args[0]);
$month = Month::fromNative($args[1]);
$day = new MonthDay($args[2]);
return new static($year, $month, $day);
} | php | public static function fromNative()
{
$args = func_get_args();
$year = new Year($args[0]);
$month = Month::fromNative($args[1]);
$day = new MonthDay($args[2]);
return new static($year, $month, $day);
} | [
"public",
"static",
"function",
"fromNative",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"year",
"=",
"new",
"Year",
"(",
"$",
"args",
"[",
"0",
"]",
")",
";",
"$",
"month",
"=",
"Month",
"::",
"fromNative",
"(",
"$",
"... | Returns a new Date from native year, month and day values
@param int $year
@param string $month
@param int $day
@return Date | [
"Returns",
"a",
"new",
"Date",
"from",
"native",
"year",
"month",
"and",
"day",
"values"
] | train | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Date.php#L28-L37 |
cubicmushroom/valueobjects | src/DateTime/Date.php | Date.fromNativeDateTime | public static function fromNativeDateTime(\DateTime $date)
{
$year = \intval($date->format('Y'));
$month = Month::fromNativeDateTime($date);
$day = \intval($date->format('d'));
return new static(new Year($year), $month, new MonthDay($day));
} | php | public static function fromNativeDateTime(\DateTime $date)
{
$year = \intval($date->format('Y'));
$month = Month::fromNativeDateTime($date);
$day = \intval($date->format('d'));
return new static(new Year($year), $month, new MonthDay($day));
} | [
"public",
"static",
"function",
"fromNativeDateTime",
"(",
"\\",
"DateTime",
"$",
"date",
")",
"{",
"$",
"year",
"=",
"\\",
"intval",
"(",
"$",
"date",
"->",
"format",
"(",
"'Y'",
")",
")",
";",
"$",
"month",
"=",
"Month",
"::",
"fromNativeDateTime",
"... | Returns a new Date from a native PHP \DateTime
@param \DateTime $date
@return Date | [
"Returns",
"a",
"new",
"Date",
"from",
"a",
"native",
"PHP",
"\\",
"DateTime"
] | train | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Date.php#L45-L52 |
cubicmushroom/valueobjects | src/DateTime/Date.php | Date.sameValueAs | public function sameValueAs(ValueObjectInterface $date)
{
if (false === Util::classEquals($this, $date)) {
return false;
}
return $this->getYear()->sameValueAs($date->getYear()) &&
$this->getMonth()->sameValueAs($date->getMonth()) &&
$this->getDay()... | php | public function sameValueAs(ValueObjectInterface $date)
{
if (false === Util::classEquals($this, $date)) {
return false;
}
return $this->getYear()->sameValueAs($date->getYear()) &&
$this->getMonth()->sameValueAs($date->getMonth()) &&
$this->getDay()... | [
"public",
"function",
"sameValueAs",
"(",
"ValueObjectInterface",
"$",
"date",
")",
"{",
"if",
"(",
"false",
"===",
"Util",
"::",
"classEquals",
"(",
"$",
"this",
",",
"$",
"date",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"$",
"this",
"->"... | Tells whether two Date are equal by comparing their values
@param ValueObjectInterface $date
@return bool | [
"Tells",
"whether",
"two",
"Date",
"are",
"equal",
"by",
"comparing",
"their",
"values"
] | train | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Date.php#L94-L103 |
cubicmushroom/valueobjects | src/DateTime/Date.php | Date.toNativeDateTime | public function toNativeDateTime()
{
$year = $this->getYear()->toNative();
$month = $this->getMonth()->getNumericValue();
$day = $this->getDay()->toNative();
$date = new \DateTime();
$date->setDate($year, $month, $day);
$date->setTime(0, 0, 0);
return $da... | php | public function toNativeDateTime()
{
$year = $this->getYear()->toNative();
$month = $this->getMonth()->getNumericValue();
$day = $this->getDay()->toNative();
$date = new \DateTime();
$date->setDate($year, $month, $day);
$date->setTime(0, 0, 0);
return $da... | [
"public",
"function",
"toNativeDateTime",
"(",
")",
"{",
"$",
"year",
"=",
"$",
"this",
"->",
"getYear",
"(",
")",
"->",
"toNative",
"(",
")",
";",
"$",
"month",
"=",
"$",
"this",
"->",
"getMonth",
"(",
")",
"->",
"getNumericValue",
"(",
")",
";",
... | Returns a native PHP \DateTime version of the current Date
@return \DateTime | [
"Returns",
"a",
"native",
"PHP",
"\\",
"DateTime",
"version",
"of",
"the",
"current",
"Date"
] | train | https://github.com/cubicmushroom/valueobjects/blob/4554239ab75d65eeb9773219aa5b07e9fbfabb92/src/DateTime/Date.php#L140-L151 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.__static | static function __static()
{
DOMXPathNavigator::$nodeTypeMap = array(
XML_ELEMENT_NODE => XPathNodeType::Element,
XML_ATTRIBUTE_NODE => XPathNodeType::Attribute,
XML_TEXT_NODE => XPathNodeType::Text,
// XML_CDATA_SECTION_NODE => 4,
// XML_ENTITY_REF_NODE => 5,
// XML_ENTITY_NODE => 6,
... | php | static function __static()
{
DOMXPathNavigator::$nodeTypeMap = array(
XML_ELEMENT_NODE => XPathNodeType::Element,
XML_ATTRIBUTE_NODE => XPathNodeType::Attribute,
XML_TEXT_NODE => XPathNodeType::Text,
// XML_CDATA_SECTION_NODE => 4,
// XML_ENTITY_REF_NODE => 5,
// XML_ENTITY_NODE => 6,
... | [
"static",
"function",
"__static",
"(",
")",
"{",
"DOMXPathNavigator",
"::",
"$",
"nodeTypeMap",
"=",
"array",
"(",
"XML_ELEMENT_NODE",
"=>",
"XPathNodeType",
"::",
"Element",
",",
"XML_ATTRIBUTE_NODE",
"=>",
"XPathNodeType",
"::",
"Attribute",
",",
"XML_TEXT_NODE",
... | Static constructor | [
"Static",
"constructor"
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L98-L122 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.ComparePosition | public function ComparePosition( $other, $useLineNo = false)
{
$thisDomNode = $this->getUnderlyingObject();
$otherDomNode = $other->getUnderlyingObject();
$doc1 = $thisDomNode->baseURI;
$doc2 = $otherDomNode->baseURI;
if ( strcasecmp( $doc1, $doc2 ) != 0 )
// if ( spl_object_hash( $this->domNode->... | php | public function ComparePosition( $other, $useLineNo = false)
{
$thisDomNode = $this->getUnderlyingObject();
$otherDomNode = $other->getUnderlyingObject();
$doc1 = $thisDomNode->baseURI;
$doc2 = $otherDomNode->baseURI;
if ( strcasecmp( $doc1, $doc2 ) != 0 )
// if ( spl_object_hash( $this->domNode->... | [
"public",
"function",
"ComparePosition",
"(",
"$",
"other",
",",
"$",
"useLineNo",
"=",
"false",
")",
"{",
"$",
"thisDomNode",
"=",
"$",
"this",
"->",
"getUnderlyingObject",
"(",
")",
";",
"$",
"otherDomNode",
"=",
"$",
"other",
"->",
"getUnderlyingObject",
... | Compares the position of the current XPathNavigator with the
position of the XPathNavigator specified.
@param XPathNavigator $other : The XPathNavigator to compare against.
@param bool $useLineNo (Default: false)
@return XmlNodeOrder An XmlNodeOrder value representing the comparative position of the two XPathNavigator... | [
"Compares",
"the",
"position",
"of",
"the",
"current",
"XPathNavigator",
"with",
"the",
"position",
"of",
"the",
"XPathNavigator",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L155-L217 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getLineNo | public function getLineNo()
{
if ( ! isset( $this->domNode ) || $this->domNode instanceof \DOMDocument )
{
return 0;
}
return $this->domNode->getLineNo();
} | php | public function getLineNo()
{
if ( ! isset( $this->domNode ) || $this->domNode instanceof \DOMDocument )
{
return 0;
}
return $this->domNode->getLineNo();
} | [
"public",
"function",
"getLineNo",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
"return",
"0",
";",
"}",
"return",
"$",
"this",
"->",
... | return the line number in the underlying XML document of the current node | [
"return",
"the",
"line",
"number",
"in",
"the",
"underlying",
"XML",
"document",
"of",
"the",
"current",
"node"
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L222-L230 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.GetAttribute | public function GetAttribute( $localName, $namespaceURI )
{
if ( $this->domNode->nodeType != XML_ELEMENT_NODE )
{
return "";
}
foreach ( $this->domNode->attributes as /** @var \DOMAttr $attribute */ $attribute )
{
if ( $attribute->namespaceURI != $namespaceURI || $attribute->localName != $loc... | php | public function GetAttribute( $localName, $namespaceURI )
{
if ( $this->domNode->nodeType != XML_ELEMENT_NODE )
{
return "";
}
foreach ( $this->domNode->attributes as /** @var \DOMAttr $attribute */ $attribute )
{
if ( $attribute->namespaceURI != $namespaceURI || $attribute->localName != $loc... | [
"public",
"function",
"GetAttribute",
"(",
"$",
"localName",
",",
"$",
"namespaceURI",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"domNode",
"->",
"nodeType",
"!=",
"XML_ELEMENT_NODE",
")",
"{",
"return",
"\"\"",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",... | Gets the value of the attribute with the specified local name and namespace URI.
@param string $localName : The local name of the attribute.
@param string $namespaceURI : The namespace URI of the attribute.
@return string A string that contains the value of the specified attribute; Empty
if a matching attribute is no... | [
"Gets",
"the",
"value",
"of",
"the",
"attribute",
"with",
"the",
"specified",
"local",
"name",
"and",
"namespace",
"URI",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L253-L271 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getHasChildren | public function getHasChildren( $type = null )
{
if ( is_null( $this->domNode ) ) return false;
$hasAnyChildren = $this->domNode->hasChildNodes();
if ( ! $hasAnyChildren || is_null( $type ) ) return $hasAnyChildren;
$clone = $this->CloneInstance();
return $clone->MoveToChild( $type );
} | php | public function getHasChildren( $type = null )
{
if ( is_null( $this->domNode ) ) return false;
$hasAnyChildren = $this->domNode->hasChildNodes();
if ( ! $hasAnyChildren || is_null( $type ) ) return $hasAnyChildren;
$clone = $this->CloneInstance();
return $clone->MoveToChild( $type );
} | [
"public",
"function",
"getHasChildren",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"$",
"hasAnyChildren",
"=",
"$",
"this",
"->",
"domNode",
"->",
"hasChildNodes",
... | Not used but implement
Gets a value indicating whether the current node has any child nodes.
@param XPathNodeType $type
@return bool $HasChildren true if the current node has any child nodes; otherwise, false. | [
"Not",
"used",
"but",
"implement",
"Gets",
"a",
"value",
"indicating",
"whether",
"the",
"current",
"node",
"has",
"any",
"child",
"nodes",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L305-L313 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getInnerXml | public function getInnerXml()
{
if ( is_null( $this->domNode ) ) return null;
$owner = $this->domNode instanceof \DOMDocument ? $this->domNode : $this->domNode->ownerDocument;
$xml = $owner->saveXml( $this->domNode, LIBXML_NOEMPTYTAG );
$xml = ltrim( preg_replace( "/^<\?xml.*\?>/", "", $xml ) );
$xml =... | php | public function getInnerXml()
{
if ( is_null( $this->domNode ) ) return null;
$owner = $this->domNode instanceof \DOMDocument ? $this->domNode : $this->domNode->ownerDocument;
$xml = $owner->saveXml( $this->domNode, LIBXML_NOEMPTYTAG );
$xml = ltrim( preg_replace( "/^<\?xml.*\?>/", "", $xml ) );
$xml =... | [
"public",
"function",
"getInnerXml",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"null",
";",
"$",
"owner",
"=",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMDocument",
"?",
"$",
"this",
"->",
... | Not used but implement
Gets or sets the markup representing the child nodes of the current node.
@return string A string that contains the markup of the child nodes of the current node. | [
"Not",
"used",
"but",
"implement",
"Gets",
"or",
"sets",
"the",
"markup",
"representing",
"the",
"child",
"nodes",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L321-L329 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getLocalName | public function getLocalName()
{
if ( is_null( $this->domNode ) ) return null;
if ( $this->domNode instanceof \DOMNameSpaceNode )
{
return $this->domNode->localName;
}
else
{
return $this->domNode->nodeType == XPathNodeType::ProcessingInstruction
? "{$this->domNode->nodeName}"
: "{... | php | public function getLocalName()
{
if ( is_null( $this->domNode ) ) return null;
if ( $this->domNode instanceof \DOMNameSpaceNode )
{
return $this->domNode->localName;
}
else
{
return $this->domNode->nodeType == XPathNodeType::ProcessingInstruction
? "{$this->domNode->nodeName}"
: "{... | [
"public",
"function",
"getLocalName",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMNameSpaceNode",
")",
"{",
"return",
"$",
"th... | When overridden in a derived class, gets the XPathNavigator.Name
of the current node without any namespace prefix.
@return string A string that contains the local name of the current node, or Empty
if the current node does not have a name (for example, text or comment nodes). | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"gets",
"the",
"XPathNavigator",
".",
"Name",
"of",
"the",
"current",
"node",
"without",
"any",
"namespace",
"prefix",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L350-L363 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getName | public function getName()
{
if ( is_null( $this->domNode ) ) return null;
if ( $this->domNode instanceof \DOMNameSpaceNode )
{
return $this->domNode->prefix;
}
else
{
return empty( $this->domNode->prefix )
? "{$this->domNode->localName}"
: "{$this->domNode->prefix}:{$this->domNod... | php | public function getName()
{
if ( is_null( $this->domNode ) ) return null;
if ( $this->domNode instanceof \DOMNameSpaceNode )
{
return $this->domNode->prefix;
}
else
{
return empty( $this->domNode->prefix )
? "{$this->domNode->localName}"
: "{$this->domNode->prefix}:{$this->domNod... | [
"public",
"function",
"getName",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMNameSpaceNode",
")",
"{",
"return",
"$",
"this",
... | When overridden in a derived class, gets the qualified name of the current node.
@return string A string that contains the qualified XPathNavigator.Name of the
current node, or Empty if the current node does not have a name
(for example, text or comment nodes). | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"gets",
"the",
"qualified",
"name",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L372-L386 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getNamespaceURI | public function getNamespaceURI()
{
if ( is_null( $this->domNode ) ) return null;
return is_null( $this->domNode->namespaceURI ) ? "" : $this->domNode->namespaceURI;
} | php | public function getNamespaceURI()
{
if ( is_null( $this->domNode ) ) return null;
return is_null( $this->domNode->namespaceURI ) ? "" : $this->domNode->namespaceURI;
} | [
"public",
"function",
"getNamespaceURI",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"null",
";",
"return",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
"->",
"namespaceURI",
")",
"?",
"\"\"",
":",
"$",
... | When overridden in a derived class, gets the namespace URI of the current node.
@return string A string that contains the namespace URI of the current node,
or Empty if the current node has no namespace URI. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"gets",
"the",
"namespace",
"URI",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L394-L398 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getNodeType | public function getNodeType()
{
if ( is_null( $this->domNode ) ) return null;
return isset( DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] )
? DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ]
: XPathNodeType::Element;
} | php | public function getNodeType()
{
if ( is_null( $this->domNode ) ) return null;
return isset( DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] )
? DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ]
: XPathNodeType::Element;
} | [
"public",
"function",
"getNodeType",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"null",
";",
"return",
"isset",
"(",
"DOMXPathNavigator",
"::",
"$",
"nodeTypeMap",
"[",
"$",
"this",
"->",
"domNode",
"->",
... | When overridden in a derived class, gets the XPathNodeType of the current node.
@return XPathNodeType One of the XPathNodeType values representing the current node. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"gets",
"the",
"XPathNodeType",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L416-L422 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getOuterXml | public function getOuterXml()
{
if ( is_null( $this->domNode ) ) return "";
return is_null( $this->domNode->parentNode )
? $this->domNode->ownerDocument->saveXml( $this->domNode )
: $this->domNode->ownerDocument->saveXml( $this->domNode->parentNode );
} | php | public function getOuterXml()
{
if ( is_null( $this->domNode ) ) return "";
return is_null( $this->domNode->parentNode )
? $this->domNode->ownerDocument->saveXml( $this->domNode )
: $this->domNode->ownerDocument->saveXml( $this->domNode->parentNode );
} | [
"public",
"function",
"getOuterXml",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"\"\"",
";",
"return",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
"->",
"parentNode",
")",
"?",
"$",
"this",
"->",
"do... | Gets or sets the markup representing the opening and closing tags of the current node and its child nodes.
@return string A string that contains the markup representing the opening and closing
tags of the current node and its child nodes. | [
"Gets",
"or",
"sets",
"the",
"markup",
"representing",
"the",
"opening",
"and",
"closing",
"tags",
"of",
"the",
"current",
"node",
"and",
"its",
"child",
"nodes",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L430-L436 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getSchemaInfo | public function getSchemaInfo()
{
if ( is_null( $this->domNode ) ) return null;
switch( $this->domNode->nodeType )
{
case XML_ATTRIBUTE_NODE:
case XML_ELEMENT_NODE:
return new DOMName( $this->domNode );
case XML_TEXT_NODE:
return new DOMName( $this->domNode->parentNode );
defa... | php | public function getSchemaInfo()
{
if ( is_null( $this->domNode ) ) return null;
switch( $this->domNode->nodeType )
{
case XML_ATTRIBUTE_NODE:
case XML_ELEMENT_NODE:
return new DOMName( $this->domNode );
case XML_TEXT_NODE:
return new DOMName( $this->domNode->parentNode );
defa... | [
"public",
"function",
"getSchemaInfo",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"null",
";",
"switch",
"(",
"$",
"this",
"->",
"domNode",
"->",
"nodeType",
")",
"{",
"case",
"XML_ATTRIBUTE_NODE",
":",
... | Gets the schema information that has been assigned to the current node as a result of schema validation.
@return IXmlSchemaInfo An IXmlSchemaInfo object that contains the schema information
for the current node. | [
"Gets",
"the",
"schema",
"information",
"that",
"has",
"been",
"assigned",
"to",
"the",
"current",
"node",
"as",
"a",
"result",
"of",
"schema",
"validation",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L455-L471 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.getXmlLang | public function getXmlLang()
{
// Take and work on a copy of the node so it can be manipulated
$node = $this->domNode;
while ( ! $node instanceof \DOMDocument )
{
if ( $node->hasAttributes() )
{
foreach ( $node->attributes as $name => $attrNode )
{
// This should return the lang ... | php | public function getXmlLang()
{
// Take and work on a copy of the node so it can be manipulated
$node = $this->domNode;
while ( ! $node instanceof \DOMDocument )
{
if ( $node->hasAttributes() )
{
foreach ( $node->attributes as $name => $attrNode )
{
// This should return the lang ... | [
"public",
"function",
"getXmlLang",
"(",
")",
"{",
"// Take and work on a copy of the node so it can be manipulated\r",
"$",
"node",
"=",
"$",
"this",
"->",
"domNode",
";",
"while",
"(",
"!",
"$",
"node",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
"if",
"(",
"... | Not used but implement
Gets the xml:lang scope for the current node.
@return string $XmlLang
A string that contains the value of the xml:lang scope, or Empty
if the current node has no xml:lang scope value to return. | [
"Not",
"used",
"but",
"implement",
"Gets",
"the",
"xml",
":",
"lang",
"scope",
"for",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L493-L515 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.CloneInstance | public function CloneInstance()
{
// Clone in this sense means be able to have a different current position so creating a new
// DOMXPathNavigator instance should be sufficient. There is no need to clone the current node.
return is_null( $this->domNode )
? $this
: new DOMXPathNavigator( $this->domNod... | php | public function CloneInstance()
{
// Clone in this sense means be able to have a different current position so creating a new
// DOMXPathNavigator instance should be sufficient. There is no need to clone the current node.
return is_null( $this->domNode )
? $this
: new DOMXPathNavigator( $this->domNod... | [
"public",
"function",
"CloneInstance",
"(",
")",
"{",
"// Clone in this sense means be able to have a different current position so creating a new\r",
"// DOMXPathNavigator instance should be sufficient. There is no need to clone the current node.\r",
"return",
"is_null",
"(",
"$",
"this",
... | When overridden in a derived class, creates a new XPathNavigator
positioned at the same node as this XPathNavigator.
@return XPathNavigator A new XPathNavigator positioned at the same node as this XPathNavigator. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"creates",
"a",
"new",
"XPathNavigator",
"positioned",
"at",
"the",
"same",
"node",
"as",
"this",
"XPathNavigator",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L585-L592 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.IsSamePosition | public function IsSamePosition( $other )
{
if ( is_null( $this->domNode ) || is_null( $other ) ) return false;
return $this->domNode->isSameNode( $other->getUnderlyingObject() );
} | php | public function IsSamePosition( $other )
{
if ( is_null( $this->domNode ) || is_null( $other ) ) return false;
return $this->domNode->isSameNode( $other->getUnderlyingObject() );
} | [
"public",
"function",
"IsSamePosition",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"is_null",
"(",
"$",
"other",
")",
")",
"return",
"false",
";",
"return",
"$",
"this",
"->",
"domNode",
"->",
"is... | When overridden in a derived class, determines whether the current XPathNavigator
is at the same position as the specified XPathNavigator.
@param XPathNavigator $other : The XPathNavigator to compare to this XPathNavigator.
@return bool true if the two XPathNavigator objects have the same position; otherwise, false. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"determines",
"whether",
"the",
"current",
"XPathNavigator",
"is",
"at",
"the",
"same",
"position",
"as",
"the",
"specified",
"XPathNavigator",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L602-L606 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.IsWhitespaceNode | public function IsWhitespaceNode()
{
return $this->getNodeType() == XPathNodeType::Text ||
$this->getNodeType() == XPathNodeType::Whitespace ||
$this->getNodeType() == XPathNodeType::SignificantWhitespace
? preg_match( "/^\s+$/", $this->getValue() ) // Test for only whitespace
: false;
} | php | public function IsWhitespaceNode()
{
return $this->getNodeType() == XPathNodeType::Text ||
$this->getNodeType() == XPathNodeType::Whitespace ||
$this->getNodeType() == XPathNodeType::SignificantWhitespace
? preg_match( "/^\s+$/", $this->getValue() ) // Test for only whitespace
: false;
} | [
"public",
"function",
"IsWhitespaceNode",
"(",
")",
"{",
"return",
"$",
"this",
"->",
"getNodeType",
"(",
")",
"==",
"XPathNodeType",
"::",
"Text",
"||",
"$",
"this",
"->",
"getNodeType",
"(",
")",
"==",
"XPathNodeType",
"::",
"Whitespace",
"||",
"$",
"thi... | IsWhitespaceNode
@return bool | [
"IsWhitespaceNode"
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L612-L619 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveTo | public function MoveTo( $other )
{
if ( is_null( $this->domNode ) || is_null( $other ) ) return false;
// Replace the domNode with a clone of the one from $other
$this->domNode = $other->getUnderlyingObject(); // ->cloneNode();
return true;
} | php | public function MoveTo( $other )
{
if ( is_null( $this->domNode ) || is_null( $other ) ) return false;
// Replace the domNode with a clone of the one from $other
$this->domNode = $other->getUnderlyingObject(); // ->cloneNode();
return true;
} | [
"public",
"function",
"MoveTo",
"(",
"$",
"other",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"is_null",
"(",
"$",
"other",
")",
")",
"return",
"false",
";",
"// Replace the domNode with a clone of the one from $other\r",
"$"... | When overridden in a derived class, moves the XPathNavigator
to the same position as the specified XPathNavigator.
@param XPathNavigator $other : The XPathNavigator positioned on the node that you want to move to.
@return bool true if the XPathNavigator is successful moving to the same position as the specified
XPath... | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"same",
"position",
"as",
"the",
"specified",
"XPathNavigator",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L630-L637 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToChild | public function MoveToChild( $kind )
{
if ( is_null( $this->domNode ) ||
is_null( $kind ) ||
! property_exists( $this->domNode, 'firstChild') // ||
// ! $this->domNode->hasChildNodes()
) return false;
// Create a list of the valid DOM node types based on the $kind value
$domNodeTypes =... | php | public function MoveToChild( $kind )
{
if ( is_null( $this->domNode ) ||
is_null( $kind ) ||
! property_exists( $this->domNode, 'firstChild') // ||
// ! $this->domNode->hasChildNodes()
) return false;
// Create a list of the valid DOM node types based on the $kind value
$domNodeTypes =... | [
"public",
"function",
"MoveToChild",
"(",
"$",
"kind",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"is_null",
"(",
"$",
"kind",
")",
"||",
"!",
"property_exists",
"(",
"$",
"this",
"->",
"domNode",
",",
"'firstChild'",... | Moves the XPathNavigator to the child node of the XPathNodeType specified.
@param XPathNodeType $kind The XPathNodeType of the child node to move to.
@return bool Returns true if the XPathNavigator is successful moving to the child node; otherwise, false.
If false, the position of the XPathNavigator is unchanged. | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"child",
"node",
"of",
"the",
"XPathNodeType",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L646-L680 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToFirstAttribute | public function MoveToFirstAttribute()
{
// If the current node is already an attribute or there are no attributes return false
if ( is_null( $this->domNode ) || $this->domNode instanceof \DOMAttr || ! $this->domNode->hasAttributes() ) return false;
$this->domNode = $this->domNode->attributes->item(0);
... | php | public function MoveToFirstAttribute()
{
// If the current node is already an attribute or there are no attributes return false
if ( is_null( $this->domNode ) || $this->domNode instanceof \DOMAttr || ! $this->domNode->hasAttributes() ) return false;
$this->domNode = $this->domNode->attributes->item(0);
... | [
"public",
"function",
"MoveToFirstAttribute",
"(",
")",
"{",
"// If the current node is already an attribute or there are no attributes return false\r",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
... | When overridden in a derived class, moves the XPathNavigator to the first attribute of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the first attribute of the current node;
otherwise, false. If false, the position of the XPathNavigator is unchanged. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"first",
"attribute",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L688-L695 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToAttribute | public function MoveToAttribute( $localName, $namespaceURI )
{
if ( ! $this->MoveToFirstAttribute() )
{
return false;
}
do
{
if ( $this->getLocalName() == $localName && ( ( is_null( $namespaceURI ) && empty( $this->getNamespaceURI() ) ) || $this->getNamespaceURI() == $namespaceURI ) )
{
... | php | public function MoveToAttribute( $localName, $namespaceURI )
{
if ( ! $this->MoveToFirstAttribute() )
{
return false;
}
do
{
if ( $this->getLocalName() == $localName && ( ( is_null( $namespaceURI ) && empty( $this->getNamespaceURI() ) ) || $this->getNamespaceURI() == $namespaceURI ) )
{
... | [
"public",
"function",
"MoveToAttribute",
"(",
"$",
"localName",
",",
"$",
"namespaceURI",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"MoveToFirstAttribute",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"do",
"{",
"if",
"(",
"$",
"this",
"->",
"... | Moves the XPathNavigator to the attribute with the matching local name and namespace URI.
@param string $localName : The local name of the attribute.
@param string $namespaceURI : The namespace URI of the attribute; null for an empty namespace.
@return bool Returns true if the XPathNavigator is successful moving to t... | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"attribute",
"with",
"the",
"matching",
"local",
"name",
"and",
"namespace",
"URI",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L706-L725 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToFirstChild | public function MoveToFirstChild()
{
if (
is_null( $this->domNode ) ||
( ! $this->domNode instanceof \DOMDocument && ! $this->domNode instanceof \DOMElement ) ||
! $this->domNode->hasChildNodes()
) return false;
// if ( $this->domNode instanceof \DOMDocument )
// {
// $this->domNode = $t... | php | public function MoveToFirstChild()
{
if (
is_null( $this->domNode ) ||
( ! $this->domNode instanceof \DOMDocument && ! $this->domNode instanceof \DOMElement ) ||
! $this->domNode->hasChildNodes()
) return false;
// if ( $this->domNode instanceof \DOMDocument )
// {
// $this->domNode = $t... | [
"public",
"function",
"MoveToFirstChild",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"(",
"!",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMDocument",
"&&",
"!",
"$",
"this",
"->",
"domNode",
"instanceof",... | When overridden in a derived class, moves the XPathNavigator to the first child node of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the first child node of the current node;
otherwise, false. If false, the position of the XPathNavigator is unchanged. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"first",
"child",
"node",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L733-L749 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToFirstNamespace | public function MoveToFirstNamespace( $namespaceScope = XPathNamespaceScope::Local )
{
if ( is_null( $this->domNode ) ) return false;
if ( $this->domNode->nodeType != XML_ELEMENT_NODE && $this->domNode->nodeType != XML_DOCUMENT_NODE ) return false;
$expression = $namespaceScope == XPathNamespaceScope::Loca... | php | public function MoveToFirstNamespace( $namespaceScope = XPathNamespaceScope::Local )
{
if ( is_null( $this->domNode ) ) return false;
if ( $this->domNode->nodeType != XML_ELEMENT_NODE && $this->domNode->nodeType != XML_DOCUMENT_NODE ) return false;
$expression = $namespaceScope == XPathNamespaceScope::Loca... | [
"public",
"function",
"MoveToFirstNamespace",
"(",
"$",
"namespaceScope",
"=",
"XPathNamespaceScope",
"::",
"Local",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"domNode... | When overridden in a derived class, moves the XPathNavigator to the first namespace node that matches the
XPathNamespaceScope specified.
@param XPathNamespaceScope namespaceScope : An XPathNamespaceScope value describing the namespace scope.
@return bool Returns true if the XPathNavigator is successful moving to the ... | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"first",
"namespace",
"node",
"that",
"matches",
"the",
"XPathNamespaceScope",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L760-L776 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.isNodeAncestorOf | public function isNodeAncestorOf( $target )
{
if ( $this->domNode instanceof \DOMDocument ) return false;
if ( $target->getUnderlyingObject() instanceof \DOMDocument ) return false;
// Clone so the target's position is not changed on exit
$targetClone = $target->CloneInstance();
$targetClone->MoveToP... | php | public function isNodeAncestorOf( $target )
{
if ( $this->domNode instanceof \DOMDocument ) return false;
if ( $target->getUnderlyingObject() instanceof \DOMDocument ) return false;
// Clone so the target's position is not changed on exit
$targetClone = $target->CloneInstance();
$targetClone->MoveToP... | [
"public",
"function",
"isNodeAncestorOf",
"(",
"$",
"target",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMDocument",
")",
"return",
"false",
";",
"if",
"(",
"$",
"target",
"->",
"getUnderlyingObject",
"(",
")",
"instanceof",
... | Checks to determine if the current node is an ancestor of $target
@param DOMXPathNavigator $target The node to determine if the current node is an ancestor
@return bool | [
"Checks",
"to",
"determine",
"if",
"the",
"current",
"node",
"is",
"an",
"ancestor",
"of",
"$target"
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L783-L793 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToFirst | public function MoveToFirst()
{
if ( ! isset( $this->domNode ) || ! $this->getIsNode() ) return false;
// The DOMDocument and document element are their own first siblings
if ( $this->domNode instanceof \DOMDocument || $this->domNode->parentNode instanceof \DOMDocument ) return true;
$this->domNode = ... | php | public function MoveToFirst()
{
if ( ! isset( $this->domNode ) || ! $this->getIsNode() ) return false;
// The DOMDocument and document element are their own first siblings
if ( $this->domNode instanceof \DOMDocument || $this->domNode->parentNode instanceof \DOMDocument ) return true;
$this->domNode = ... | [
"public",
"function",
"MoveToFirst",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"!",
"$",
"this",
"->",
"getIsNode",
"(",
")",
")",
"return",
"false",
";",
"// The DOMDocument and document element are their own first ... | Moves the XPathNavigator to the first sibling node of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the first sibling node of the current node;
false if there is no first sibling, or if the XPathNavigator is currently positioned on an attribute
node. If the XPathNavigator is... | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"first",
"sibling",
"node",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L805-L814 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToFollowing | public function MoveToFollowing( $kind, $end = null )
{
if ( is_null( $this->domNode ) ||
is_null( $kind ) ||
$this->domNode instanceof \DOMAttr ||
$this->domNode instanceof \DOMNameSpaceNode
) return false;
if ( ! is_null( $end ) && $this->IsSamePosition( $end ) ) return false;
if ... | php | public function MoveToFollowing( $kind, $end = null )
{
if ( is_null( $this->domNode ) ||
is_null( $kind ) ||
$this->domNode instanceof \DOMAttr ||
$this->domNode instanceof \DOMNameSpaceNode
) return false;
if ( ! is_null( $end ) && $this->IsSamePosition( $end ) ) return false;
if ... | [
"public",
"function",
"MoveToFollowing",
"(",
"$",
"kind",
",",
"$",
"end",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"is_null",
"(",
"$",
"kind",
")",
"||",
"$",
"this",
"->",
"domNode",
"instanceof",... | Moves the XPathNavigator to the following element of the XPathNodeType specified, to the boundary specified,
in document order.
@param XPathNodeType $kind : The XPathNodeType of the element. The XPathNodeType cannot be XPathNodeType.Attribute or
XPathNodeType.Namespace.
@param XPathNavigator $end : (optional) The XPat... | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"following",
"element",
"of",
"the",
"XPathNodeType",
"specified",
"to",
"the",
"boundary",
"specified",
"in",
"document",
"order",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L827-L878 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToNext | public function MoveToNext( $kind = XPathNodeType::All )
{
if ( is_null( $this->domNode ) || is_null( $kind ) /* || ! $this->domNode instanceof \DOMElement */ ) return false;
// Create a list of the valid DOM node types based on the $kind value
$domNodeTypes = array_keys( array_filter(
DOMXPathNavigato... | php | public function MoveToNext( $kind = XPathNodeType::All )
{
if ( is_null( $this->domNode ) || is_null( $kind ) /* || ! $this->domNode instanceof \DOMElement */ ) return false;
// Create a list of the valid DOM node types based on the $kind value
$domNodeTypes = array_keys( array_filter(
DOMXPathNavigato... | [
"public",
"function",
"MoveToNext",
"(",
"$",
"kind",
"=",
"XPathNodeType",
"::",
"All",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"is_null",
"(",
"$",
"kind",
")",
"/* || ! $this->domNode instanceof \\DOMElement */",
")",
... | Moves the XPathNavigator to the next sibling node of the current
node that matches the XPathNodeType specified.
@param XPathNodeType $kind : (optional) The XPathNodeType of the sibling node to move to.
@return bool true if the XPathNavigator is successful moving to the next sibling node; otherwise,
false if there are ... | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"next",
"sibling",
"node",
"of",
"the",
"current",
"node",
"that",
"matches",
"the",
"XPathNodeType",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L889-L915 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToNextAttribute | public function MoveToNextAttribute()
{
if ( is_null( $this->domNode ) || ! $this->domNode instanceof \DOMAttr )
{
return false;
}
$next = $this->domNode->nextSibling;
if ( is_null( $next ) ) return false;
$this->domNode = $next;
return true;
} | php | public function MoveToNextAttribute()
{
if ( is_null( $this->domNode ) || ! $this->domNode instanceof \DOMAttr )
{
return false;
}
$next = $this->domNode->nextSibling;
if ( is_null( $next ) ) return false;
$this->domNode = $next;
return true;
} | [
"public",
"function",
"MoveToNextAttribute",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"!",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMAttr",
")",
"{",
"return",
"false",
";",
"}",
"$",
"next",
"=",
... | When overridden in a derived class, moves the XPathNavigator
to the next attribute.
@return bool Returns true if the XPathNavigator is successful moving to the next attribute;
false if there are no more attributes. If false, the position of the XPathNavigator is unchanged. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"next",
"attribute",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L924-L937 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToNextNamespace | public function MoveToNextNamespace( $namespaceScope = XPathNamespaceScope::Local )
{
if ( is_null( $this->domNode ) ) return false;
if ( $this->domNode->nodeType != XML_NAMESPACE_DECL_NODE ) return false;
$expression = $namespaceScope == XPathNamespaceScope::Local
? 'namespace::*[not(. = ../../namespa... | php | public function MoveToNextNamespace( $namespaceScope = XPathNamespaceScope::Local )
{
if ( is_null( $this->domNode ) ) return false;
if ( $this->domNode->nodeType != XML_NAMESPACE_DECL_NODE ) return false;
$expression = $namespaceScope == XPathNamespaceScope::Local
? 'namespace::*[not(. = ../../namespa... | [
"public",
"function",
"MoveToNextNamespace",
"(",
"$",
"namespaceScope",
"=",
"XPathNamespaceScope",
"::",
"Local",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"domNode"... | When overridden in a derived class, moves the XPathNavigator to the next namespace node matching the
XPathNamespaceScope specified.
@param XPathNamespaceScope $namespaceScope : (optional) An XPathNamespaceScope value describing the namespace scope.
@return bool Returns true if the XPathNavigator is successful moving t... | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"next",
"namespace",
"node",
"matching",
"the",
"XPathNamespaceScope",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L947-L980 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToParent | public function MoveToParent()
{
if ( is_null( $this->domNode ) ) return false;
$parent = $this->domNode->parentNode;
if ( is_null( $parent ) ) return false;
$this->domNode = $parent;
return true;
} | php | public function MoveToParent()
{
if ( is_null( $this->domNode ) ) return false;
$parent = $this->domNode->parentNode;
if ( is_null( $parent ) ) return false;
$this->domNode = $parent;
return true;
} | [
"public",
"function",
"MoveToParent",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"$",
"parent",
"=",
"$",
"this",
"->",
"domNode",
"->",
"parentNode",
";",
"if",
"(",
"is_null",
"(",
"$",... | When overridden in a derived class, moves the XPathNavigator to the parent node of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the parent node of the current node; otherwise,
false. If false, the position of the XPathNavigator is unchanged. | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"parent",
"node",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L988-L997 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToPrevious | public function MoveToPrevious()
{
if ( is_null( $this->domNode ) || $this->domNode instanceof \DOMAttr ) return false;
$previous = $this->domNode->previousSibling;
if ( is_null( $previous ) ) return false;
$this->domNode = $previous;
return true;
} | php | public function MoveToPrevious()
{
if ( is_null( $this->domNode ) || $this->domNode instanceof \DOMAttr ) return false;
$previous = $this->domNode->previousSibling;
if ( is_null( $previous ) ) return false;
$this->domNode = $previous;
return true;
} | [
"public",
"function",
"MoveToPrevious",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
"||",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMAttr",
")",
"return",
"false",
";",
"$",
"previous",
"=",
"$",
"this",
"->"... | When overridden in a derived class, moves the XPathNavigator to the previous sibling node of the current node.
@return bool Returns true if the XPathNavigator is successful moving to the previous sibling node; otherwise,
false if there is no previous sibling node or if the XPathNavigator is currently positioned on an
... | [
"When",
"overridden",
"in",
"a",
"derived",
"class",
"moves",
"the",
"XPathNavigator",
"to",
"the",
"previous",
"sibling",
"node",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1006-L1016 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToDocumentElement | public function MoveToDocumentElement()
{
if ( is_null( $this->domNode ) ) return false;
// Already at the root?
$newNode = $this->domNode->nodeType == XML_DOCUMENT_NODE
? $this->domNode
: $this->domNode->ownerDocument;
$this->domNode = $newNode->documentElement;
return true;
} | php | public function MoveToDocumentElement()
{
if ( is_null( $this->domNode ) ) return false;
// Already at the root?
$newNode = $this->domNode->nodeType == XML_DOCUMENT_NODE
? $this->domNode
: $this->domNode->ownerDocument;
$this->domNode = $newNode->documentElement;
return true;
} | [
"public",
"function",
"MoveToDocumentElement",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"// Already at the root?\r",
"$",
"newNode",
"=",
"$",
"this",
"->",
"domNode",
"->",
"nodeType",
"==",
... | Moves the XPathNavigator to the root node that the current node belongs to.
@return void | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"root",
"node",
"that",
"the",
"current",
"node",
"belongs",
"to",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1022-L1033 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.MoveToRoot | public function MoveToRoot()
{
if ( is_null( $this->domNode ) ) return false;
// Already at the root?
if ( $this->domNode->nodeType == XML_DOCUMENT_NODE ) return true;
$this->domNode = $this->domNode->ownerDocument;
return true;
} | php | public function MoveToRoot()
{
if ( is_null( $this->domNode ) ) return false;
// Already at the root?
if ( $this->domNode->nodeType == XML_DOCUMENT_NODE ) return true;
$this->domNode = $this->domNode->ownerDocument;
return true;
} | [
"public",
"function",
"MoveToRoot",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"false",
";",
"// Already at the root?\r",
"if",
"(",
"$",
"this",
"->",
"domNode",
"->",
"nodeType",
"==",
"XML_DOCUMENT_NODE",
... | Moves the XPathNavigator to the root node that the current node belongs to.
@return void | [
"Moves",
"the",
"XPathNavigator",
"to",
"the",
"root",
"node",
"that",
"the",
"current",
"node",
"belongs",
"to",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1039-L1048 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.SelectChildrenByName | public function SelectChildrenByName( $name, $namespaceURI )
{
$clone = $this->CloneInstance();
if ( ! $clone->getHasChildren() )
return new XPathNodeIterator( null, null );
$clone->MoveToFirstChild();
return new XPathNodeIterator( $this, function( /** @var DOMXPathNavigator $nav */ $nav ) use( $nam... | php | public function SelectChildrenByName( $name, $namespaceURI )
{
$clone = $this->CloneInstance();
if ( ! $clone->getHasChildren() )
return new XPathNodeIterator( null, null );
$clone->MoveToFirstChild();
return new XPathNodeIterator( $this, function( /** @var DOMXPathNavigator $nav */ $nav ) use( $nam... | [
"public",
"function",
"SelectChildrenByName",
"(",
"$",
"name",
",",
"$",
"namespaceURI",
")",
"{",
"$",
"clone",
"=",
"$",
"this",
"->",
"CloneInstance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"clone",
"->",
"getHasChildren",
"(",
")",
")",
"return",
"ne... | Not used
Selects all the child nodes of the current node that have the local name and
namespace URI specified.
@param string $name : The local name of the child nodes.
@param string $namespaceURI : The namespace URI of the child nodes.
@return XPathNodeIterator An XPathNodeIterator that contains the selected nodes.
... | [
"Not",
"used",
"Selects",
"all",
"the",
"child",
"nodes",
"of",
"the",
"current",
"node",
"that",
"have",
"the",
"local",
"name",
"and",
"namespace",
"URI",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1062-L1073 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.SelectChildrenByType | public function SelectChildrenByType( $type )
{
$clone = $this->CloneInstance();
if ( ! $clone->getHasChildren() )
return EmptyIterator::$Shared; // XPathNodeIterator( null, null );
if ( ! $clone->MoveToFirstChild() )
return EmptyIterator::$Shared; //XPathNodeIterator( null, null );
return... | php | public function SelectChildrenByType( $type )
{
$clone = $this->CloneInstance();
if ( ! $clone->getHasChildren() )
return EmptyIterator::$Shared; // XPathNodeIterator( null, null );
if ( ! $clone->MoveToFirstChild() )
return EmptyIterator::$Shared; //XPathNodeIterator( null, null );
return... | [
"public",
"function",
"SelectChildrenByType",
"(",
"$",
"type",
")",
"{",
"$",
"clone",
"=",
"$",
"this",
"->",
"CloneInstance",
"(",
")",
";",
"if",
"(",
"!",
"$",
"clone",
"->",
"getHasChildren",
"(",
")",
")",
"return",
"EmptyIterator",
"::",
"$",
"... | Not used
Selects all the child nodes of the current node that have the local name and
namespace URI specified.
@param XPathNodeType $type : The type of the child nodes to return.
@return XPathNodeIterator An XPathNodeIterator that contains the selected nodes.
@throws \lyquidity\xml\exceptions\ArgumentNullException: n... | [
"Not",
"used",
"Selects",
"all",
"the",
"child",
"nodes",
"of",
"the",
"current",
"node",
"that",
"have",
"the",
"local",
"name",
"and",
"namespace",
"URI",
"specified",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1084-L1098 |
bseddon/XPath20 | DOM/DOMXPathNavigator.php | DOMXPathNavigator.ToString | public function ToString()
{
if ( is_null( $this->domNode ) ) return "";
if ( $this->domNode instanceof \DOMDocument )
{
$result = $this->domNode->saveXML( null );
// Remove any initial PI
$result = preg_replace( "/^<\?xml.*\?>\s/", "", $result );
return $result;
}
else
{
// Inne... | php | public function ToString()
{
if ( is_null( $this->domNode ) ) return "";
if ( $this->domNode instanceof \DOMDocument )
{
$result = $this->domNode->saveXML( null );
// Remove any initial PI
$result = preg_replace( "/^<\?xml.*\?>\s/", "", $result );
return $result;
}
else
{
// Inne... | [
"public",
"function",
"ToString",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"domNode",
")",
")",
"return",
"\"\"",
";",
"if",
"(",
"$",
"this",
"->",
"domNode",
"instanceof",
"\\",
"DOMDocument",
")",
"{",
"$",
"result",
"=",
"$",
... | Gets the text value of the current node.
@return string A string that contains the text value of the current node. | [
"Gets",
"the",
"text",
"value",
"of",
"the",
"current",
"node",
"."
] | train | https://github.com/bseddon/XPath20/blob/69882b6efffaa5470a819d5fdd2f6473ddeb046d/DOM/DOMXPathNavigator.php#L1105-L1128 |
cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Schema/Index/IndexFactory.php | IndexFactory.create | public function create($name, $hashKey, $rangeKey, $projectionType, $projectionAttributes, $readCapacity, $writeCapacity)
{
if ($rangeKey !== null) {
return new CompositeIndex($this->class, $name, $hashKey, $rangeKey, $projectionType, $projectionAttributes, $readCapacity, $writeCapacity);
... | php | public function create($name, $hashKey, $rangeKey, $projectionType, $projectionAttributes, $readCapacity, $writeCapacity)
{
if ($rangeKey !== null) {
return new CompositeIndex($this->class, $name, $hashKey, $rangeKey, $projectionType, $projectionAttributes, $readCapacity, $writeCapacity);
... | [
"public",
"function",
"create",
"(",
"$",
"name",
",",
"$",
"hashKey",
",",
"$",
"rangeKey",
",",
"$",
"projectionType",
",",
"$",
"projectionAttributes",
",",
"$",
"readCapacity",
",",
"$",
"writeCapacity",
")",
"{",
"if",
"(",
"$",
"rangeKey",
"!==",
"... | @param string $name
@param HashKey $hashKey
@param RangeKey|null $rangeKey
@param string $projectionType
@param array|null $projectionAttributes
@param string $readCapacity
@param string $writeCapacity
@return CompositeIndex|Index | [
"@param",
"string",
"$name",
"@param",
"HashKey",
"$hashKey",
"@param",
"RangeKey|null",
"$rangeKey",
"@param",
"string",
"$projectionType",
"@param",
"array|null",
"$projectionAttributes",
"@param",
"string",
"$readCapacity",
"@param",
"string",
"$writeCapacity"
] | train | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Schema/Index/IndexFactory.php#L52-L59 |
ciims/ciims-plugins-awsuploader | CiiAWSUploader.php | CiiAWSUploader.getCdnURI | private function getCdnURI($path)
{
$cleancdn = explode('/', $path);
unset($cleancdn[0]);
unset($cleancdn[1]);
reset($cleancdn);
return implode($cleancdn, '/');
} | php | private function getCdnURI($path)
{
$cleancdn = explode('/', $path);
unset($cleancdn[0]);
unset($cleancdn[1]);
reset($cleancdn);
return implode($cleancdn, '/');
} | [
"private",
"function",
"getCdnURI",
"(",
"$",
"path",
")",
"{",
"$",
"cleancdn",
"=",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
";",
"unset",
"(",
"$",
"cleancdn",
"[",
"0",
"]",
")",
";",
"unset",
"(",
"$",
"cleancdn",
"[",
"1",
"]",
")",
... | Retrieves a clean version of the CDN URI
@param string $path
@return string | [
"Retrieves",
"a",
"clean",
"version",
"of",
"the",
"CDN",
"URI"
] | train | https://github.com/ciims/ciims-plugins-awsuploader/blob/59e447e59f873521ebf966051fab6334696546a2/CiiAWSUploader.php#L60-L67 |
jkaflik/process-util | src/ProcessUtil/ProcessUtil.php | ProcessUtil.executeCommand | public function executeCommand(array $arguments, $processBuilderCallback = null)
{
$processBuilder = clone $this->processBuilder;
$processBuilder->setArguments($arguments);
if (is_callable($processBuilderCallback)) {
$processBuilderCallback($processBuilder);
}
$... | php | public function executeCommand(array $arguments, $processBuilderCallback = null)
{
$processBuilder = clone $this->processBuilder;
$processBuilder->setArguments($arguments);
if (is_callable($processBuilderCallback)) {
$processBuilderCallback($processBuilder);
}
$... | [
"public",
"function",
"executeCommand",
"(",
"array",
"$",
"arguments",
",",
"$",
"processBuilderCallback",
"=",
"null",
")",
"{",
"$",
"processBuilder",
"=",
"clone",
"$",
"this",
"->",
"processBuilder",
";",
"$",
"processBuilder",
"->",
"setArguments",
"(",
... | Executes given command
@param array $arguments
@param null $processBuilderCallback
@return \Symfony\Component\Process\Process
@throws ExecutableNotFoundException
@throws ProcessFailedException | [
"Executes",
"given",
"command"
] | train | https://github.com/jkaflik/process-util/blob/8d77f677189980e18e7b57e836d8908b56822bb8/src/ProcessUtil/ProcessUtil.php#L63-L84 |
QueuePHP/Queue | src/Worker/Worker.php | Worker.runJob | private function runJob(JobInterface $job)
{
$this->log(LogLevel::DEBUG, 'Job starting');
$status = $this->executor->execute($job);
$this->log(LogLevel::DEBUG, 'Job finished');
return $status;
} | php | private function runJob(JobInterface $job)
{
$this->log(LogLevel::DEBUG, 'Job starting');
$status = $this->executor->execute($job);
$this->log(LogLevel::DEBUG, 'Job finished');
return $status;
} | [
"private",
"function",
"runJob",
"(",
"JobInterface",
"$",
"job",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"LogLevel",
"::",
"DEBUG",
",",
"'Job starting'",
")",
";",
"$",
"status",
"=",
"$",
"this",
"->",
"executor",
"->",
"execute",
"(",
"$",
"job",
... | @param JobInterface $job
@return bool | [
"@param",
"JobInterface",
"$job"
] | train | https://github.com/QueuePHP/Queue/blob/b21b9ff87430f9aaf3a07e2591601363642019bc/src/Worker/Worker.php#L122-L129 |
angrycoders/db-driver | src/Db.php | Db.createTable | public function createTable($tableName, $attributes)
{
try {
$this->db->createTable($tableName, $attributes);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function createTable($tableName, $attributes)
{
try {
$this->db->createTable($tableName, $attributes);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"createTable",
"(",
"$",
"tableName",
",",
"$",
"attributes",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"db",
"->",
"createTable",
"(",
"$",
"tableName",
",",
"$",
"attributes",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
... | Creates a table with the specified name and attributes
@param string $tableName
@param array $attributes
@throws DbException | [
"Creates",
"a",
"table",
"with",
"the",
"specified",
"name",
"and",
"attributes"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L60-L67 |
angrycoders/db-driver | src/Db.php | Db.deleteTable | public function deleteTable($tableName)
{
try {
$this->db->deleteTable($tableName);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function deleteTable($tableName)
{
try {
$this->db->deleteTable($tableName);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"deleteTable",
"(",
"$",
"tableName",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"db",
"->",
"deleteTable",
"(",
"$",
"tableName",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e",
")",
"{",
"throw",
"new",
"DbException",
... | Delete a table from db
@param string $tableName the name of the table
@throws DbException | [
"Delete",
"a",
"table",
"from",
"db"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L74-L81 |
angrycoders/db-driver | src/Db.php | Db.insertRecord | public function insertRecord($tableName, $newRecord)
{
try {
$this->db->insertRecord($tableName, $newRecord);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function insertRecord($tableName, $newRecord)
{
try {
$this->db->insertRecord($tableName, $newRecord);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"insertRecord",
"(",
"$",
"tableName",
",",
"$",
"newRecord",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"db",
"->",
"insertRecord",
"(",
"$",
"tableName",
",",
"$",
"newRecord",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
... | Inserts a new record to the db
@param string $tableName
@param array $newRecord
@throws DbException | [
"Inserts",
"a",
"new",
"record",
"to",
"the",
"db"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L89-L96 |
angrycoders/db-driver | src/Db.php | Db.deleteRecord | public function deleteRecord($tableName, $value, $field)
{
try {
$this->db->deleteRecord($tableName, $value, $field);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function deleteRecord($tableName, $value, $field)
{
try {
$this->db->deleteRecord($tableName, $value, $field);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"deleteRecord",
"(",
"$",
"tableName",
",",
"$",
"value",
",",
"$",
"field",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"db",
"->",
"deleteRecord",
"(",
"$",
"tableName",
",",
"$",
"value",
",",
"$",
"field",
")",
";",
"}",
"cat... | Deletes the specified record from the table
@param string $tableName name of table
@param string $value the value to be matched
@param string $field the field to check value matched
@throws DbException | [
"Deletes",
"the",
"specified",
"record",
"from",
"the",
"table"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L105-L112 |
angrycoders/db-driver | src/Db.php | Db.getRecord | public function getRecord($tableName, $field, $value, $fields = array())
{
try {
return $this->db->getRecord($tableName, $field, $value, $fields);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function getRecord($tableName, $field, $value, $fields = array())
{
try {
return $this->db->getRecord($tableName, $field, $value, $fields);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"getRecord",
"(",
"$",
"tableName",
",",
"$",
"field",
",",
"$",
"value",
",",
"$",
"fields",
"=",
"array",
"(",
")",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"getRecord",
"(",
"$",
"tableName",
",",
"$",... | Return record(s) from specified table
@param string $tableName
@param string $field field to match
@param string $value value to match with field
@param array $fields columns to be returned
@return string executable SQL statement
@throws DbException | [
"Return",
"record",
"(",
"s",
")",
"from",
"specified",
"table"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L123-L130 |
angrycoders/db-driver | src/Db.php | Db.updateRecord | public function updateRecord($tableName, $fields, $values, $field, $value)
{
try {
return $this->db->updateRecord($tableName, $fields, $values, $field, $value);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function updateRecord($tableName, $fields, $values, $field, $value)
{
try {
return $this->db->updateRecord($tableName, $fields, $values, $field, $value);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"updateRecord",
"(",
"$",
"tableName",
",",
"$",
"fields",
",",
"$",
"values",
",",
"$",
"field",
",",
"$",
"value",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"updateRecord",
"(",
"$",
"tableName",
",",
"$",... | updates record(s) in db
@param string $tableName the name of table in db
@param array $fields the fields to be updated
@param array $values the values to update the fields
@param string $field the field to check
@param string $value the value of the field to check
@throws DbException | [
"updates",
"record",
"(",
"s",
")",
"in",
"db"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L141-L148 |
angrycoders/db-driver | src/Db.php | Db.getAllRecords | public function getAllRecords($tableName, $fields = array(), $limit = 0, $start = 0)
{
try {
return $this->db->getAllRecords($tableName, $fields, $limit, $start);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | php | public function getAllRecords($tableName, $fields = array(), $limit = 0, $start = 0)
{
try {
return $this->db->getAllRecords($tableName, $fields, $limit, $start);
} catch (\Exception $e) {
throw new DbException($e->getMessage());
}
} | [
"public",
"function",
"getAllRecords",
"(",
"$",
"tableName",
",",
"$",
"fields",
"=",
"array",
"(",
")",
",",
"$",
"limit",
"=",
"0",
",",
"$",
"start",
"=",
"0",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"db",
"->",
"getAllRecords",
"(",... | Get all record from db
@param $tableName the name of table in db
@param array $fields the field to be returned. Returns all fields if not specified
@param int $limit the number of records to return. Returns all record if not returned
@param int $start the record index to start record. Starts from the first record if no... | [
"Get",
"all",
"record",
"from",
"db"
] | train | https://github.com/angrycoders/db-driver/blob/e5df527ac0ea5fa434cbda79692f37cf6f2abc73/src/Db.php#L159-L166 |
mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.retrieveModels | protected function retrieveModels(array $entity = [])
{
$models = [];
foreach ((array) $entity as $node) {
$models[] = $this->models->get($node);
}
if (empty($models)) {
$models = $this->models->all();
}
return $models;
} | php | protected function retrieveModels(array $entity = [])
{
$models = [];
foreach ((array) $entity as $node) {
$models[] = $this->models->get($node);
}
if (empty($models)) {
$models = $this->models->all();
}
return $models;
} | [
"protected",
"function",
"retrieveModels",
"(",
"array",
"$",
"entity",
"=",
"[",
"]",
")",
"{",
"$",
"models",
"=",
"[",
"]",
";",
"foreach",
"(",
"(",
"array",
")",
"$",
"entity",
"as",
"$",
"node",
")",
"{",
"$",
"models",
"[",
"]",
"=",
"$",
... | Returns array with models for operation
@param array $entity
@return ModelInterface[] | [
"Returns",
"array",
"with",
"models",
"for",
"operation"
] | train | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L129-L141 |
mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.buildCreate | protected function buildCreate(array $models)
{
$schemaManager = $this->connection->getSchemaManager();
foreach ($models as $model) {
if ($schemaManager->tablesExist([$model->table()])) {
throw new SchemaException(sprintf('Unable to create table, table "%s" already exist... | php | protected function buildCreate(array $models)
{
$schemaManager = $this->connection->getSchemaManager();
foreach ($models as $model) {
if ($schemaManager->tablesExist([$model->table()])) {
throw new SchemaException(sprintf('Unable to create table, table "%s" already exist... | [
"protected",
"function",
"buildCreate",
"(",
"array",
"$",
"models",
")",
"{",
"$",
"schemaManager",
"=",
"$",
"this",
"->",
"connection",
"->",
"getSchemaManager",
"(",
")",
";",
"foreach",
"(",
"$",
"models",
"as",
"$",
"model",
")",
"{",
"if",
"(",
... | Builds create table queries
@param ModelInterface[] $models
@throws SchemaException | [
"Builds",
"create",
"table",
"queries"
] | train | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L150-L166 |
mossphp/moss-storage | Moss/Storage/Schema/Schema.php | Schema.createTable | protected function createTable(SchemaAsset $schema, ModelInterface $model)
{
$table = $schema->createTable($this->quoteIdentifier($model->table()));
foreach ($model->fields() as $field) {
$table->addColumn(
$this->quoteIdentifier($field->mappedName()),
$f... | php | protected function createTable(SchemaAsset $schema, ModelInterface $model)
{
$table = $schema->createTable($this->quoteIdentifier($model->table()));
foreach ($model->fields() as $field) {
$table->addColumn(
$this->quoteIdentifier($field->mappedName()),
$f... | [
"protected",
"function",
"createTable",
"(",
"SchemaAsset",
"$",
"schema",
",",
"ModelInterface",
"$",
"model",
")",
"{",
"$",
"table",
"=",
"$",
"schema",
"->",
"createTable",
"(",
"$",
"this",
"->",
"quoteIdentifier",
"(",
"$",
"model",
"->",
"table",
"(... | Creates table from model into schema
@param SchemaAsset $schema
@param ModelInterface $model | [
"Creates",
"table",
"from",
"model",
"into",
"schema"
] | train | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Schema/Schema.php#L197-L240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.