code
stringlengths 17
296k
| docstring
stringlengths 30
30.3k
| func_name
stringlengths 1
89
| language
stringclasses 1
value | repo
stringlengths 7
63
| path
stringlengths 7
153
| url
stringlengths 51
209
| license
stringclasses 4
values |
---|---|---|---|---|---|---|---|
public static function manufacture($partId, $manufacturerId, $manufacturerName)
{
$part = new self();
// After instantiation of the object we apply the "PartWasManufacturedEvent".
$part->apply(new PartWasManufacturedEvent($partId, $manufacturerId, $manufacturerName));
return $part;
} | Factory method to create a part. | manufacture | php | broadway/broadway | examples/event-sourced-child-entity/Parts.php | https://github.com/broadway/broadway/blob/master/examples/event-sourced-child-entity/Parts.php | MIT |
protected function handleManufacturePartCommand(ManufacturePartCommand $command)
{
$part = Part::manufacture($command->partId, $command->manufacturerId, $command->manufacturerName);
$this->repository->save($part);
} | A new part aggregate root is created and added to the repository. | handleManufacturePartCommand | php | broadway/broadway | examples/event-sourced-child-entity/Parts.php | https://github.com/broadway/broadway/blob/master/examples/event-sourced-child-entity/Parts.php | MIT |
protected function handleRenameManufacturerForPartCommand(RenameManufacturerForPartCommand $command)
{
$part = $this->repository->load($command->partId);
$part->renameManufacturer($command->manufacturerName);
$this->repository->save($part);
} | An existing part aggregate root is loaded and renameManufacturerTo() is
called. | handleRenameManufacturerForPartCommand | php | broadway/broadway | examples/event-sourced-child-entity/Parts.php | https://github.com/broadway/broadway/blob/master/examples/event-sourced-child-entity/Parts.php | MIT |
public function get(string $key)
{
return $this->values[$key] ?? null;
} | Get a specific metadata value based on key. | get | php | broadway/broadway | src/Broadway/Domain/Metadata.php | https://github.com/broadway/broadway/blob/master/src/Broadway/Domain/Metadata.php | MIT |
public function process($text)
{
$iterations = $this->maxIterations === null ? 1 : $this->maxIterations;
$context = new ProcessorContext();
$context->processor = $this;
while ($iterations--) {
$context->iterationNumber++;
$newText = $this->processIteration($text, $context, null);
if ($newText === $text) {
break;
}
$text = $newText;
$iterations += $this->maxIterations === null ? 1 : 0;
}
return $text;
} | Entry point for shortcode processing. Implements iterative algorithm for
both limited and unlimited number of iterations.
@param string $text Text to process
@return string | process | php | thunderer/Shortcode | src/Processor/Processor.php | https://github.com/thunderer/Shortcode/blob/master/src/Processor/Processor.php | MIT |
public function withEventContainer(EventContainerInterface $eventContainer)
{
$self = clone $this;
$self->eventContainer = $eventContainer;
return $self;
} | Container for event handlers used in this processor.
@param EventContainerInterface $eventContainer
@return self | withEventContainer | php | thunderer/Shortcode | src/Processor/Processor.php | https://github.com/thunderer/Shortcode/blob/master/src/Processor/Processor.php | MIT |
public function withRecursionDepth($depth)
{
/** @psalm-suppress DocblockTypeContradiction */
if (null !== $depth && !(is_int($depth) && $depth >= 0)) {
$msg = 'Recursion depth must be null (infinite) or integer >= 0!';
throw new \InvalidArgumentException($msg);
}
$self = clone $this;
$self->recursionDepth = $depth;
return $self;
} | Recursion depth level, null means infinite, any integer greater than or
equal to zero sets value (number of recursion levels). Zero disables
recursion. Defaults to null.
@param int|null $depth
@return self | withRecursionDepth | php | thunderer/Shortcode | src/Processor/Processor.php | https://github.com/thunderer/Shortcode/blob/master/src/Processor/Processor.php | MIT |
public function withMaxIterations($iterations)
{
/** @psalm-suppress DocblockTypeContradiction */
if (null !== $iterations && !(is_int($iterations) && $iterations > 0)) {
$msg = 'Maximum number of iterations must be null (infinite) or integer > 0!';
throw new \InvalidArgumentException($msg);
}
$self = clone $this;
$self->maxIterations = $iterations;
return $self;
} | Maximum number of iterations, null means infinite, any integer greater
than zero sets value. Zero is invalid because there must be at least one
iteration. Defaults to 1. Loop breaks if result of two consequent
iterations shows no change in processed text.
@param int|null $iterations
@return self | withMaxIterations | php | thunderer/Shortcode | src/Processor/Processor.php | https://github.com/thunderer/Shortcode/blob/master/src/Processor/Processor.php | MIT |
public function withAutoProcessContent($flag)
{
/** @psalm-suppress DocblockTypeContradiction */
if (!is_bool($flag)) {
$msg = 'Auto processing flag must be a boolean value!';
throw new \InvalidArgumentException($msg);
}
$self = clone $this;
$self->autoProcessContent = $flag;
return $self;
} | Whether shortcode content will be automatically processed and handler
already receives shortcode with processed content. If false, every
shortcode handler needs to process content on its own. Default true.
@param bool $flag True if enabled (default), false otherwise
@return self | withAutoProcessContent | php | thunderer/Shortcode | src/Processor/Processor.php | https://github.com/thunderer/Shortcode/blob/master/src/Processor/Processor.php | MIT |
public function __invoke(ShortcodeInterface $shortcode)
{
return $shortcode->getContent();
} | [content]text to display[/content]
@param ShortcodeInterface $shortcode
@return null|string | __invoke | php | thunderer/Shortcode | src/Handler/ContentHandler.php | https://github.com/thunderer/Shortcode/blob/master/src/Handler/ContentHandler.php | MIT |
public function __invoke(ShortcodeInterface $shortcode)
{
return null;
} | Special shortcode to discard any input and return empty text
@param ShortcodeInterface $shortcode
@return null | __invoke | php | thunderer/Shortcode | src/Handler/NullHandler.php | https://github.com/thunderer/Shortcode/blob/master/src/Handler/NullHandler.php | MIT |
public function __invoke(ProcessedShortcode $shortcode)
{
return $shortcode->getTextContent();
} | [raw]any content [with] or [without /] shortcodes[/raw]
@param ProcessedShortcode $shortcode
@return string | __invoke | php | thunderer/Shortcode | src/Handler/RawHandler.php | https://github.com/thunderer/Shortcode/blob/master/src/Handler/RawHandler.php | MIT |
public function __invoke(ShortcodeInterface $shortcode)
{
return $this->serializer->serialize($shortcode);
} | [text arg=val /]
[text arg=val]content[/text]
[json arg=val /]
[json arg=val]content[/json]
[xml arg=val /]
[xml arg=val]content[/xml]
[yaml arg=val /]
[yaml arg=val]content[/yaml]
@param ShortcodeInterface $shortcode
@return string | __invoke | php | thunderer/Shortcode | src/Handler/SerializerHandler.php | https://github.com/thunderer/Shortcode/blob/master/src/Handler/SerializerHandler.php | MIT |
public function __invoke(ShortcodeInterface $shortcode)
{
return $shortcode->getName();
} | [name /]
[name]content is ignored[/name]
@param ShortcodeInterface $shortcode
@return string | __invoke | php | thunderer/Shortcode | src/Handler/NameHandler.php | https://github.com/thunderer/Shortcode/blob/master/src/Handler/NameHandler.php | MIT |
public static function isFakerColumn($replacement)
{
return str_starts_with($replacement, self::PREFIX);
} | check if replacement option is a faker option
static to prevent unnecessary instantiation for non-faker columns.
@param string $replacement
@return bool | isFakerColumn | php | webfactory/slimdump | src/Webfactory/Slimdump/Config/FakerReplacer.php | https://github.com/webfactory/slimdump/blob/master/src/Webfactory/Slimdump/Config/FakerReplacer.php | MIT |
public function generateReplacement($replacementId)
{
$replacementMethodName = str_replace(self::PREFIX, '', $replacementId);
if (str_contains($replacementMethodName, '->')) {
[$modifierName, $replacementMethodName] = explode('->', $replacementMethodName);
$this->validateReplacementConfiguredModifier($modifierName, $replacementMethodName);
return (string) $this->faker->$modifierName->$replacementMethodName;
}
$this->validateReplacementConfigured($replacementMethodName);
return (string) $this->faker->$replacementMethodName;
} | wrapper method which removes the prefix calls the defined faker method.
@param string $replacementId
@return string | generateReplacement | php | webfactory/slimdump | src/Webfactory/Slimdump/Config/FakerReplacer.php | https://github.com/webfactory/slimdump/blob/master/src/Webfactory/Slimdump/Config/FakerReplacer.php | MIT |
private function validateReplacementConfigured($replacementName)
{
try {
$this->faker->$replacementName();
} catch (InvalidArgumentException $exception) {
throw new InvalidReplacementOptionException($replacementName.' is no valid faker replacement');
}
} | validates if this type of replacement was configured.
@param string $replacementName
@throws InvalidReplacementOptionException if not a faker method | validateReplacementConfigured | php | webfactory/slimdump | src/Webfactory/Slimdump/Config/FakerReplacer.php | https://github.com/webfactory/slimdump/blob/master/src/Webfactory/Slimdump/Config/FakerReplacer.php | MIT |
public function merge(self $other)
{
$this->tables = array_merge($this->tables, $other->getTables());
} | Merge two configurations together.
If two configurations specify the same table,
the last one wins. | merge | php | webfactory/slimdump | src/Webfactory/Slimdump/Config/Config.php | https://github.com/webfactory/slimdump/blob/master/src/Webfactory/Slimdump/Config/Config.php | MIT |
public function provideValidReplacementIds()
{
return [
[FakerReplacer::PREFIX.'firstname'], // original faker property
[FakerReplacer::PREFIX.'lastname'], // original faker property
];
} | provides valid faker replacement ids.
@return array | provideValidReplacementIds | php | webfactory/slimdump | test/Webfactory/Slimdump/Config/FakerReplacerTest.php | https://github.com/webfactory/slimdump/blob/master/test/Webfactory/Slimdump/Config/FakerReplacerTest.php | MIT |
public function provideValidReplacementNames()
{
return [
['firstname'], // original faker property
['lastname'], // original faker property
];
} | provides valid faker replacement ids.
@return array | provideValidReplacementNames | php | webfactory/slimdump | test/Webfactory/Slimdump/Config/FakerReplacerTest.php | https://github.com/webfactory/slimdump/blob/master/test/Webfactory/Slimdump/Config/FakerReplacerTest.php | MIT |
public function commonPrefix($text1, $text2)
{
// Quick check for common null cases.
if ($text1 === '' || $text2 === '' || mb_substr($text1, 0, 1) !== mb_substr($text2, 0, 1)) {
return 0;
}
// Binary search.
// Performance analysis: http://neil.fraser.name/news/2007/10/09/
$pointermin = 0;
$pointermax = min(mb_strlen($text1), mb_strlen($text2));
$pointermid = $pointermax;
$pointerstart = 0;
while ($pointermin < $pointermid) {
if (mb_substr($text1, $pointerstart, $pointermid - $pointerstart) === mb_substr($text2, $pointerstart,
$pointermid - $pointerstart)
) {
$pointermin = $pointermid;
$pointerstart = $pointermin;
} else {
$pointermax = $pointermid;
}
$pointermid = (int)(($pointermax - $pointermin) / 2) + $pointermin;
}
return $pointermid;
} | Determine the common prefix of two strings.
@param string $text1 First string.
@param string $text2 Second string.
@return int The number of characters common to the start of each string. | commonPrefix | php | yetanotherape/diff-match-patch | src/DiffToolkit.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffToolkit.php | Apache-2.0 |
public function commonSuffix($text1, $text2)
{
// Quick check for common null cases.
if ($text1 === '' || $text2 === '' || mb_substr($text1, -1, 1) !== mb_substr($text2, -1, 1)) {
return 0;
}
// Binary search.
// Performance analysis: http://neil.fraser.name/news/2007/10/09/
$pointermin = 0;
$pointermax = min(mb_strlen($text1), mb_strlen($text2));
$pointermid = $pointermax;
$pointerend = 0;
while ($pointermin < $pointermid) {
if (mb_substr($text1, -$pointermid, $pointermid - $pointerend) === mb_substr($text2, -$pointermid,
$pointermid - $pointerend)
) {
$pointermin = $pointermid;
$pointerend = $pointermin;
} else {
$pointermax = $pointermid;
}
$pointermid = (int)(($pointermax - $pointermin) / 2) + $pointermin;
}
return $pointermid;
} | Determine the common suffix of two strings.
@param string $text1 First string.
@param string $text2 Second string.
@return int The number of characters common to the end of each string. | commonSuffix | php | yetanotherape/diff-match-patch | src/DiffToolkit.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffToolkit.php | Apache-2.0 |
public function halfMatch($text1, $text2)
{
if (mb_strlen($text1) > mb_strlen($text2)) {
$longtext = $text1;
$shorttext = $text2;
} else {
$shorttext = $text1;
$longtext = $text2;
}
if (mb_strlen($longtext) < 4 || mb_strlen($shorttext) * 2 < mb_strlen($longtext)) {
// Pointless
return null;
}
// First check if the second quarter is the seed for a half-match.
$hm1 = $this->halfMatchI($longtext, $shorttext, (int)((mb_strlen($longtext) + 3) / 4));
// Check again based on the third quarter.
$hm2 = $this->halfMatchI($longtext, $shorttext, (int)((mb_strlen($longtext) + 1) / 2));
if (empty($hm1) && empty($hm2)) {
return null;
} elseif (empty($hm2)) {
$hm = $hm1;
} elseif (empty($hm1)) {
$hm = $hm2;
} else {
// Both matched. Select the longest.
if (mb_strlen($hm1[4]) > mb_strlen($hm2[4])) {
$hm = $hm1;
} else {
$hm = $hm2;
}
}
// A half-match was found, sort out the return data.
if (mb_strlen($text1) > mb_strlen($text2)) {
return array($hm[0], $hm[1], $hm[2], $hm[3], $hm[4]);
} else {
return array($hm[2], $hm[3], $hm[0], $hm[1], $hm[4]);
}
} | Do the two texts share a substring which is at least half the length of the longer text?
This speedup can produce non-minimal diffs.
@param string $text1 First string.
@param string $text2 Second string.
@return null|array Five element array, containing the prefix of text1, the suffix of text1,
the prefix of text2, the suffix of text2 and the common middle. Or null if there was no match. | halfMatch | php | yetanotherape/diff-match-patch | src/DiffToolkit.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffToolkit.php | Apache-2.0 |
protected function halfMatchI($longtext, $shorttext, $i)
{
$seed = mb_substr($longtext, $i, (int)(mb_strlen($longtext) / 4));
$best_common = $best_longtext_a = $best_longtext_b = $best_shorttext_a = $best_shorttext_b = '';
$j = mb_strpos($shorttext, $seed);
while ($j !== false) {
$prefixLegth = $this->commonPrefix(mb_substr($longtext, $i), mb_substr($shorttext, $j));
$suffixLegth = $this->commonSuffix(mb_substr($longtext, 0, $i), mb_substr($shorttext, 0, $j));
if (mb_strlen($best_common) < $suffixLegth + $prefixLegth) {
$best_common = mb_substr($shorttext, $j - $suffixLegth, $suffixLegth) . mb_substr($shorttext, $j,
$prefixLegth);
$best_longtext_a = mb_substr($longtext, 0, $i - $suffixLegth);
$best_longtext_b = mb_substr($longtext, $i + $prefixLegth);
$best_shorttext_a = mb_substr($shorttext, 0, $j - $suffixLegth);
$best_shorttext_b = mb_substr($shorttext, $j + $prefixLegth);
}
$j = mb_strpos($shorttext, $seed, $j + 1);
}
if (mb_strlen($best_common) * 2 >= mb_strlen($longtext)) {
return array($best_longtext_a, $best_longtext_b, $best_shorttext_a, $best_shorttext_b, $best_common);
} else {
return null;
}
} | Does a substring of shorttext exist within longtext such that the substring
is at least half the length of longtext?
@param string $longtext Longer string.
@param string $shorttext Shorter string.
@param int $i Start index of quarter length substring within longtext.
@return null|array Five element array, containing the prefix of longtext, the suffix of longtext,
the prefix of shorttext, the suffix of shorttext and the common middle. Or null if there was no match. | halfMatchI | php | yetanotherape/diff-match-patch | src/DiffToolkit.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffToolkit.php | Apache-2.0 |
public function linesToChars($text1, $text2)
{
// e.g. $lineArray[4] === "Hello\n"
$lineArray = array();
// e.g. $lineHash["Hello\n"] == 4
$lineHash = array();
// "\x00" is a valid character, but various debuggers don't like it.
// So we'll insert a junk entry to avoid generating a null character.
$lineArray[] = '';
$chars1 = $this->linesToCharsMunge($text1, $lineArray, $lineHash);
$chars2 = $this->linesToCharsMunge($text2, $lineArray, $lineHash);
return array($chars1, $chars2, $lineArray);
} | Split two texts into an array of strings. Reduce the texts to a string of hashes where each
Unicode character represents one line.
@param string $text1 First string.
@param string $text2 Second string.
@return array Three element array, containing the encoded text1, the encoded text2 and the array
of unique strings. The zeroth element of the array of unique strings is intentionally blank. | linesToChars | php | yetanotherape/diff-match-patch | src/DiffToolkit.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffToolkit.php | Apache-2.0 |
public function charsToLines(&$diffs, $lineArray)
{
foreach ($diffs as &$diff) {
$text = '';
for ($i = 0; $i < mb_strlen($diff[1]); $i++) {
$char = mb_substr($diff[1], $i, 1);
$text .= $lineArray[Utils::unicodeOrd($char)];
}
$diff[1] = $text;
}
unset($diff);
} | Rehydrate the text in a diff from a string of line hashes to real lines of text.
Modifies $diffs. TODO try to fix it!
@param array $diffs Array of diff arrays.
@param array $lineArray Array of unique strings. | charsToLines | php | yetanotherape/diff-match-patch | src/DiffToolkit.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffToolkit.php | Apache-2.0 |
public function cleanupSemanticLossless()
{
$diffs = $this->getChanges();
$pointer = 1;
// Intentionally ignore the first and last element (don't need checking).
while ($pointer < count($diffs) - 1) {
if ($diffs[$pointer - 1][0] == self::EQUAL && $diffs[$pointer + 1][0] == self::EQUAL) {
// This is a single edit surrounded by equalities.
$equality1 = $diffs[$pointer - 1][1];
$edit = $diffs[$pointer][1];
$equality2 = $diffs[$pointer + 1][1];
// First, shift the edit as far left as possible.
$commonOffset = $this->getToolkit()->commonSuffix($equality1, $edit);
if ($commonOffset) {
$commonString = mb_substr($edit, -$commonOffset);
$equality1 = mb_substr($equality1, 0, -$commonOffset);
$edit = $commonString . mb_substr($edit, 0, -$commonOffset);
$equality2 = $commonString . $equality2;
}
// Second, step character by character right, looking for the best fit.
$bestEquality1 = $equality1;
$bestEdit = $edit;
$bestEquality2 = $equality2;
$bestScore = $this->cleanupSemanticScore($equality1, $edit) + $this->cleanupSemanticScore($edit, $equality2);
while ($edit && $equality2 && mb_substr($edit, 0, 1) === mb_substr($equality2, 0, 1)) {
$equality1 .= mb_substr($edit, 0, 1);
$edit = mb_substr($edit, 1) . mb_substr($equality2, 0, 1);
$equality2 = mb_substr($equality2, 1);
$score = $this->cleanupSemanticScore($equality1, $edit) + $this->cleanupSemanticScore($edit, $equality2);
// The >= encourages trailing rather than leading whitespace on edits.
if ($score >= $bestScore) {
$bestScore = $score;
$bestEquality1 = $equality1;
$bestEdit = $edit;
$bestEquality2 = $equality2;
}
}
if ($diffs[$pointer - 1][1] !== $bestEquality1) {
// We have an improvement, save it back to the diff.
if ($bestEquality1 !== '') {
$diffs[$pointer - 1][1] = $bestEquality1;
} else {
array_splice($diffs, $pointer - 1, 1);
$pointer -= 1;
}
$diffs[$pointer][1] = $bestEdit;
if ($bestEquality2 !== '') {
$diffs[$pointer + 1][1] = $bestEquality2;
} else {
array_splice($diffs, $pointer + 1, 1);
$pointer -= 1;
}
}
}
$pointer++;
}
$this->setChanges($diffs);
return $this;
} | Look for single edits surrounded on both sides by equalities
which can be shifted sideways to align the edit to a word boundary.
e.g: The c<ins>at c</ins>ame. -> The <ins>cat </ins>came.
@return $this | cleanupSemanticLossless | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
protected function cleanupSemanticScore($one, $two)
{
if ($one === '' || $two === '') {
// Edges are the best.
return 6;
}
// Each port of this function behaves slightly differently due to
// subtle differences in each language's definition of things like
// 'whitespace'. Since this function's purpose is largely cosmetic,
// the choice has been made to use each language's native features
// rather than force total conformity.
$char1 = mb_substr($one, -1, 1);
$char2 = mb_substr($two, 0, 1);
$nonAlphaNumeric1 = preg_match('/[^[:alnum:]]/u', $char1);
$nonAlphaNumeric2 = preg_match('/[^[:alnum:]]/u', $char2);
$whitespace1 = $nonAlphaNumeric1 && preg_match('/\s/', $char1);
$whitespace2 = $nonAlphaNumeric2 && preg_match('/\s/', $char2);
$lineBreak1 = $whitespace1 && preg_match('/[\r\n]/', $char1);
$lineBreak2 = $whitespace2 && preg_match('/[\r\n]/', $char2);
$blankLine1 = $lineBreak1 && preg_match('/\n\r?\n$/', $one);
$blankLine2 = $lineBreak2 && preg_match('/^\r?\n\r?\n/', $two);
if ($blankLine1 || $blankLine2) {
// Five points for blank lines.
return 5;
} elseif ($lineBreak1 || $lineBreak2) {
// Four points for line breaks.
return 4;
} elseif ($nonAlphaNumeric1 && !$whitespace1 && $whitespace2) {
// Three points for end of sentences.
return 3;
} elseif ($whitespace1 || $whitespace2) {
// Two points for whitespace.
return 2;
} elseif ($nonAlphaNumeric1 || $nonAlphaNumeric2) {
// One point for non-alphanumeric.
return 1;
}
return 0;
} | Given two strings, compute a score representing whether the internal boundary falls on logical boundaries.
Scores range from 6 (best) to 0 (worst).
@param string $one First string.
@param string $two Second string.
@return int The score. | cleanupSemanticScore | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function cleanupSemantic()
{
$diffs = $this->getChanges();
$changes = false;
// Stack of indices where equalities are found.
$equalities = array();
// Always equal to diffs[equalities[-1]][1]
$lastequality = null;
// Index of current position.
$pointer = 0;
// Number of chars that changed prior to the equality.
$length_insertions1 = 0;
$length_deletions1 = 0;
// Number of chars that changed after the equality.
$length_insertions2 = 0;
$length_deletions2 = 0;
while ($pointer < count($diffs)) {
if ($diffs[$pointer][0] == self::EQUAL) {
$equalities[] = $pointer;
$length_insertions1 = $length_insertions2;
$length_insertions2 = 0;
$length_deletions1 = $length_deletions2;
$length_deletions2 = 0;
$lastequality = $diffs[$pointer][1];
} else {
if ($diffs[$pointer][0] == self::INSERT) {
$length_insertions2 += mb_strlen($diffs[$pointer][1]);
} else {
$length_deletions2 += mb_strlen($diffs[$pointer][1]);
}
// Eliminate an equality that is smaller or equal to the edits on both sides of it.
if (
$lastequality !== null &&
mb_strlen($lastequality) <= max($length_insertions1, $length_deletions1) &&
mb_strlen($lastequality) <= max($length_insertions2, $length_deletions2)
) {
$insertPointer = array_pop($equalities);
// Duplicate record.
array_splice($diffs, $insertPointer, 0, array(array(
self::DELETE,
$lastequality,
)));
// Change second copy to insert.
$diffs[$insertPointer + 1][0] = self::INSERT;
// Throw away the previous equality (it needs to be reevaluated).
if (count($equalities)) {
array_pop($equalities);
}
if (count($equalities)) {
$pointer = end($equalities);
} else {
$pointer = -1;
}
// Reset the counters.
$length_insertions1 = 0;
$length_deletions1 = 0;
$length_insertions2 = 0;
$length_deletions2 = 0;
$lastequality = null;
$changes = true;
}
}
$pointer++;
}
$this->setChanges($diffs);
// Normalize the diff.
if ($changes) {
$this->cleanupMerge();
}
$this->cleanupSemanticLossless();
$diffs = $this->getChanges();
// Find any overlaps between deletions and insertions.
// e.g: <del>abcxxx</del><ins>xxxdef</ins>
// -> <del>abc</del>xxx<ins>def</ins>
// e.g: <del>xxxabc</del><ins>defxxx</ins>
// -> <ins>def</ins>xxx<del>abc</del>
// Only extract an overlap if it is as big as the edit ahead or behind it.
$pointer = 1;
while ($pointer < count($diffs)) {
if ($diffs[$pointer - 1][0] == self::DELETE && $diffs[$pointer][0] == self::INSERT) {
$deletion = $diffs[$pointer - 1][1];
$insertion = $diffs[$pointer][1];
$overlap_length1 = $this->getToolkit()->commontOverlap($deletion, $insertion);
$overlap_length2 = $this->getToolkit()->commontOverlap($insertion, $deletion);
if ($overlap_length1 >= $overlap_length2) {
if ($overlap_length1 >= mb_strlen($deletion) / 2 || $overlap_length1 >= mb_strlen($insertion) / 2) {
// Overlap found. Insert an equality and trim the surrounding edits.
array_splice($diffs, $pointer, 0, array(array(
self::EQUAL,
mb_substr($insertion, 0, $overlap_length1),
)));
$diffs[$pointer - 1][1] = mb_substr($deletion, 0, -$overlap_length1);
$diffs[$pointer + 1][1] = mb_substr($insertion, $overlap_length1);
$pointer++;
}
} else {
if ($overlap_length2 >= mb_strlen($deletion) / 2 || $overlap_length2 >= mb_strlen($insertion) / 2) {
// Reverse overlap found.
// Insert an equality and swap and trim the surrounding edits.
array_splice($diffs, $pointer, 0, array(array(
self::EQUAL,
mb_substr($deletion, 0, $overlap_length2),
)));
$diffs[$pointer - 1] = array(
self::INSERT,
mb_substr($insertion, 0, $overlap_length2),
);
$diffs[$pointer + 1] = array(
self::DELETE,
mb_substr($deletion, $overlap_length2),
);
$pointer++;
}
}
$pointer++;
}
$pointer++;
}
$this->setChanges($diffs);
return $this;
} | Reduce the number of edits by eliminating semantically trivial equalities.
TODO refactor this cap's code
@return $this | cleanupSemantic | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function cleanupEfficiency() {
$diffs = $this->getChanges();
$changes = false;
// Stack of indices where equalities are found.
$equalities = array();
// Always equal to diffs[equalities[-1]][1]
$lastequality = null;
// Index of current position.
$pointer = 0;
// Is there an insertion operation before the last equality.
$pre_ins = false;
// Is there a deletion operation before the last equality.
$pre_del = false;
// Is there an insertion operation after the last equality.
$post_ins = false;
// Is there a deletion operation after the last equality.
$post_del = false;
while ($pointer < count($diffs)) {
if ($diffs[$pointer][0] == self::EQUAL) {
if (mb_strlen($diffs[$pointer][1]) < $this->getEditCost() && ($post_ins || $post_del)) {
// Candidate found.
$equalities[] = $pointer;
$pre_ins = $post_ins;
$pre_del = $post_del;
$lastequality = $diffs[$pointer][1];
} else {
// Not a candidate, and can never become one.
$equalities = array();
$lastequality = null;
}
$post_ins = false;
$post_del = false;
} else {
if ($diffs[$pointer][0] == self::DELETE) {
$post_del = true;
} else {
$post_ins = true;
}
// Five types to be split:
// <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del>
// <ins>A</ins>X<ins>C</ins><del>D</del>
// <ins>A</ins><del>B</del>X<ins>C</ins>
// <ins>A</del>X<ins>C</ins><del>D</del>
// <ins>A</ins><del>B</del>X<del>C</del>
// TODO refactor condition
if (
$lastequality !== null &&
(
($pre_ins && $pre_del && $post_ins && $post_del) ||
(
mb_strlen($lastequality) < $this->getEditCost() / 2 &&
($pre_ins + $pre_del + $post_del + $post_ins == 3)
)
)
) {
$insertPointer = array_pop($equalities);
// Duplicate record.
array_splice($diffs, $insertPointer, 0, array(array(
self::DELETE,
$lastequality,
)));
// Change second copy to insert.
$diffs[$insertPointer + 1][0] = self::INSERT;
// Throw away the previous equality (it needs to be reevaluated).
if (count($equalities)) {
array_pop($equalities);
}
$lastequality = null;
if ($pre_ins && $pre_del) {
// No changes made which could affect previous entry, keep going.
$post_ins = true;
$post_del = true;
$equalities = array();
} else {
if (count($equalities)) {
// Throw away the previous equality.
array_pop($equalities);
}
if (count($equalities)) {
$pointer = end($equalities);
} else {
$pointer = -1;
}
$post_ins = false;
$post_del = false;
}
$changes = true;
}
}
$pointer++;
}
$this->setChanges($diffs);
if ($changes) {
$this->cleanupMerge();
}
return $this;
} | Reduce the number of edits by eliminating operationally trivial equalities.
TODO refactor this Cap's code
@return $this | cleanupEfficiency | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function text1()
{
$diffs = $this->getChanges();
$text = '';
foreach ($diffs as $change) {
$op = $change[0];
$data = $change[1];
if ($op != self::INSERT) {
$text .= $data;
}
}
return $text;
} | Compute and return the source text (all equalities and deletions).
@return string Source text. | text1 | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function text2()
{
$diffs = $this->getChanges();
$text = '';
foreach ($diffs as $change) {
$op = $change[0];
$data = $change[1];
if ($op != self::DELETE) {
$text .= $data;
}
}
return $text;
} | Compute and return the destination text (all equalities and insertions).
@return string Destination text. | text2 | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function toDelta() {
$diffs = $this->getChanges();
$text = array();
foreach ($diffs as $change) {
$op = $change[0];
$data = $change[1];
if ($op == self::INSERT) {
$text[] = '+'. Utils::escapeString($data);
} elseif ($op == self::DELETE) {
$text[] = '-' . mb_strlen($data);
} else {
$text[] = '=' . mb_strlen($data);
}
}
return implode("\t", $text);
} | Crush the diff into an encoded string which describes the operations
required to transform text1 into text2.
E.g. =3\t-2\t+ing -> Keep 3 chars, delete 2 chars, insert 'ing'.
Operations are tab-separated. Inserted text is escaped using %xx notation.
@return string Delta text. | toDelta | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function xIndex($loc)
{
$diffs = $this->getChanges();
$chars1 = 0;
$chars2 = 0;
$last_chars1 = 0;
$last_chars2 = 0;
$i = 0;
foreach ($diffs as $change) {
$op = $change[0];
$text = $change[1];
// Equality or deletion.
if ($op != self::INSERT) {
$chars1 += mb_strlen($text);
}
// Equality or insertion.
if ($op != self::DELETE) {
$chars2 += mb_strlen($text);
}
// Overshot the location.
if ($chars1 > $loc) {
break;
}
$last_chars1 = $chars1;
$last_chars2 = $chars2;
$i++;
}
// The location was deleted.
if (count($diffs) != $i && $diffs[$i][0] == self::DELETE) {
return $last_chars2;
}
return $loc + $last_chars2 - $last_chars1;
} | Compute and return location in text2 equivalent to the $loc in text1.
e.g. "The cat" vs "The big cat", 1->1, 5->8
@param int $loc Location within text1.
@return int Location within text2. | xIndex | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public function levenshtein()
{
$diffs = $this->getChanges();
$levenshtein = 0;
$insertions = 0;
$deletions = 0;
foreach ($diffs as $change) {
$op = $change[0];
$text = $change[1];
switch ($op) {
case self::INSERT:
$insertions += mb_strlen($text);
break;
case self::DELETE:
$deletions += mb_strlen($text);
break;
case self::EQUAL:
// A deletion and an insertion is one substitution.
$levenshtein += max($insertions, $deletions);
$insertions = 0;
$deletions = 0;
break;
}
}
$levenshtein += max($insertions, $deletions);
return $levenshtein;
} | Compute the Levenshtein distance; the number of inserted, deleted or substituted characters.
@return int Number of changes. | levenshtein | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
protected function compute($text1, $text2, $checklines, $deadline)
{
if ($text1 === '') {
// Just add some text (speedup).
return array(
array(self::INSERT, $text2),
);
}
if ($text2 === '') {
// Just delete some text (speedup).
return array(
array(self::DELETE, $text1),
);
}
if (mb_strlen($text1) < mb_strlen($text2)) {
$shortText = $text1;
$longText = $text2;
} else {
$shortText = $text2;
$longText = $text1;
}
$i = mb_strpos($longText, $shortText);
if ($i !== false) {
// Shorter text is inside the longer text (speedup).
$diffs = array(
array(self::INSERT, mb_substr($longText, 0, $i)),
array(self::EQUAL, $shortText),
array(self::INSERT, mb_substr($longText, $i + mb_strlen($shortText))),
);
// Swap insertions for deletions if diff is reversed.
if (mb_strlen($text2) < mb_strlen($text1)) {
$diffs[0][0] = self::DELETE;
$diffs[2][0] = self::DELETE;
}
return $diffs;
}
if (mb_strlen($shortText) == 1) {
// Single character string.
// After the previous speedup, the character can't be an equality.
$diffs = array(
array(self::DELETE, $text1),
array(self::INSERT, $text2),
);
return $diffs;
}
// Don't risk returning a non-optimal diff if we have unlimited time.
if ($this->getTimeout() > 0) {
// Check to see if the problem can be split in two.
$hm = $this->getToolkit()->halfMatch($text1, $text2);
if ($hm) {
// A half-match was found, sort out the return data.
list($text1_a, $text1_b, $text2_a, $text2_b, $mid_common) = $hm;
// Send both pairs off for separate processing.
$diffA = new Diff();
$diffA->main($text1_a, $text2_a, $checklines, $deadline);
$diffB = new Diff();
$diffB->main($text1_b, $text2_b, $checklines, $deadline);
// Merge the results.
$diffs = array_merge(
$diffA->getChanges(),
array(
array(self::EQUAL, $mid_common),
),
$diffB->getChanges()
);
return $diffs;
}
}
if ($checklines
&& mb_strlen($text1) > Diff::LINEMODE_THRESOLD
&& mb_strlen($text2) > Diff::LINEMODE_THRESOLD) {
return $this->lineMode($text1, $text2, $deadline);
}
return $this->bisect($text1, $text2, $deadline);
} | Find the differences between two texts. Assumes that the texts do not
have any common prefix or suffix.
@param string $text1 Old string to be diffed.
@param string $text2 New string to be diffed.
@param bool $checklines Speedup flag. If false, then don't run a line-level diff
first to identify the changed areas.
If true, then run a faster, slightly less optimal diff.
@param int $deadline Time when the diff should be complete by.
@return array Array of changes. | compute | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
protected function lineMode($text1, $text2, $deadline)
{
// Scan the text on a line-by-line basis first.
list($text1, $text2, $lineArray) = $this->getToolkit()->linesToChars($text1, $text2);
$diff = new Diff();
$diff->main($text1, $text2, false, $deadline);
$diffs = $diff->getChanges();
// Convert the diff back to original text.
$this->getToolkit()->charsToLines($diffs, $lineArray);
$diff->setChanges($diffs);
// Eliminate freak matches (e.g. blank lines)
$diff->cleanupSemantic();
$diffs = $diff->getChanges();
// Rediff any replacement blocks, this time character-by-character.
// Add a dummy entry at the end.
array_push($diffs, array(self::EQUAL, ''));
$pointer = 0;
$countDelete = 0;
$countInsert = 0;
$textDelete = '';
$textInsert = '';
while ($pointer < count($diffs)) {
switch ($diffs[$pointer][0]) {
case self::DELETE:
$countDelete++;
$textDelete .= $diffs[$pointer][1];
break;
case self::INSERT:
$countInsert++;
$textInsert .= $diffs[$pointer][1];
break;
case self::EQUAL:
// Upon reaching an equality, check for prior redundancies.
if ($countDelete > 0 && $countInsert > 0) {
// Delete the offending records and add the merged ones.
$subDiff = new Diff();
$subDiff->main($textDelete, $textInsert, false, $deadline);
array_splice($diffs, $pointer - $countDelete - $countInsert, $countDelete + $countInsert, $subDiff->getChanges());
$pointer = $pointer - $countDelete - $countInsert + count($subDiff->getChanges());
}
$countDelete = 0;
$countInsert = 0;
$textDelete = '';
$textInsert = '';
break;
}
$pointer++;
}
// Remove the dummy entry at the end.
array_pop($diffs);
return $diffs;
} | Do a quick line-level diff on both strings, then rediff the parts for greater accuracy.
This speedup can produce non-minimal diffs.
@param string $text1 Old string to be diffed.
@param string $text2 New string to be diffed.
@param int $deadline Time when the diff should be complete by.
@return array Array of changes. | lineMode | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
protected function bisect($text1, $text2, $deadline)
{
// Cache the text lengths to prevent multiple calls.
$text1Length = mb_strlen($text1);
$text2Length = mb_strlen($text2);
$maxD = (int)(($text1Length + $text2Length + 1) / 2);
$vOffset = $maxD;
$vLength = 2 * $maxD;
$v1 = array_fill(0, $vLength, -1);
$v1[$vOffset + 1] = 0;
$v2 = $v1;
$delta = $text1Length - $text2Length;
// If the total number of characters is odd, then the front path will collide with the reverse path.
$front = $delta % 2 != 0;
// Offsets for start and end of k loop.
// Prevents mapping of space beyond the grid.
$k1Start = 0;
$k1End = 0;
$k2Start = 0;
$k2End = 0;
for ($d = 0; $d < $maxD; $d++) {
// Bail out if deadline is reached.
if (microtime(1) > $deadline) {
break;
}
// Walk the front path one step.
for ($k1 = -$d + $k1Start; $k1 < $d + 1 - $k1End; $k1 += 2) {
$k1Offset = $vOffset + $k1;
if ($k1 == -$d || ($k1 != $d && $v1[$k1Offset - 1] < $v1[$k1Offset + 1])) {
$x1 = $v1[$k1Offset + 1];
} else {
$x1 = $v1[$k1Offset - 1] + 1;
}
$y1 = $x1 - $k1;
while ($x1 < $text1Length && $y1 < $text2Length && mb_substr($text1, $x1, 1) === mb_substr($text2, $y1, 1)) {
$x1++;
$y1++;
}
$v1[$k1Offset] = $x1;
if ($x1 > $text1Length) {
// Ran off the right of the graph.
$k1End += 2;
} elseif ($y1 > $text2Length) {
// Ran off the bottom of the graph.
$k1Start += 2;
} elseif ($front) {
$k2Offset = $vOffset + $delta - $k1;
if ($k2Offset >= 0 && $k2Offset < $vLength && $v2[$k2Offset] != -1) {
// Mirror x2 onto top-left coordinate system.
$x2 = $text1Length - $v2[$k2Offset];
if ($x1 >= $x2) {
// Overlap detected.
return $this->bisectSplit($text1, $text2, $x1, $y1, $deadline);
}
}
}
}
// Walk the reverse path one step.
for ($k2 = -$d + $k2Start; $k2 < $d + 1 - $k2End; $k2 += 2) {
$k2Offset = $vOffset + $k2;
if ($k2 == -$d || ($k2 != $d && $v2[$k2Offset - 1] < $v2[$k2Offset + 1])) {
$x2 = $v2[$k2Offset + 1];
} else {
$x2 = $v2[$k2Offset - 1] + 1;
}
$y2 = $x2 - $k2;
while ($x2 < $text1Length && $y2 < $text2Length && mb_substr($text1, -$x2 - 1, 1) === mb_substr($text2, -$y2 - 1, 1)) {
$x2++;
$y2++;
}
$v2[$k2Offset] = $x2;
if ($x2 > $text1Length) {
// Ran off the right of the graph.
$k2End += 2;
} elseif ($y2 > $text2Length) {
// Ran off the bottom of the graph.
$k2Start += 2;
} elseif (!$front) {
$k1Offset = $vOffset + $delta - $k2;
if ($k1Offset >= 0 && $k1Offset < $vLength && $v1[$k1Offset] != -1) {
$x1 = $v1[$k1Offset];
$y1 = $vOffset + $x1 - $k1Offset;
// Mirror x2 onto top-left coordinate system.
$x2 = $text1Length - $x2;
if ($x1 >= $x2) {
// Overlap detected.
return $this->bisectSplit($text1, $text2, $x1, $y1, $deadline);
}
}
}
}
}
// Diff took too long and hit the deadline or
// number of diffs equals number of characters, no commonality at all.
return array(
array(self::DELETE, $text1),
array(self::INSERT, $text2),
);
} | Find the 'middle snake' of a diff, split the problem in two
and return the recursively constructed diff.
See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.
@param string $text1 Old string to be diffed.
@param string $text2 New string to be diffed.
@param int $deadline Time at which to bail if not yet complete.
@return array Array of diff arrays. | bisect | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
protected function bisectSplit($text1, $text2, $x, $y, $deadline)
{
$text1A = mb_substr($text1, 0, $x);
$text2A = mb_substr($text2, 0, $y);
$text1B = mb_substr($text1, $x);
$text2B = mb_substr($text2, $y);
// Compute both diffs serially.
$diffA = new Diff();
$diffA->main($text1A, $text2A, false, $deadline);
$diffB = new Diff();
$diffB->main($text1B, $text2B, false, $deadline);
return array_merge($diffA->getChanges(), $diffB->getChanges());
} | Given the location of the 'middle snake', split the diff in two parts and recurse.
@param string $text1 Old string to be diffed.
@param string $text2 New string to be diffed.
@param int $x Index of split point in text1.
@param int $y Index of split point in text2.
@param int $deadline Time at which to bail if not yet complete.
@return array Array of diff arrays. | bisectSplit | php | yetanotherape/diff-match-patch | src/Diff.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Diff.php | Apache-2.0 |
public static function unicodeChr($code) {
return mb_chr($code);
} | Multibyte replacement for standard chr()
@param int $code Character code.
@return string Char with given code | unicodeChr | php | yetanotherape/diff-match-patch | src/Utils.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Utils.php | Apache-2.0 |
public static function unicodeOrd($char) {
return mb_ord($char);
} | Multibyte replacement for standard ord()
@param string $char Char.
@return int Code of given char. | unicodeOrd | php | yetanotherape/diff-match-patch | src/Utils.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Utils.php | Apache-2.0 |
public function main($text, $pattern, $loc = 0){
// Check for null inputs.
if (!isset($text, $pattern)) {
throw new \InvalidArgumentException("Null inputs.");
}
$loc = max(0, min($loc, mb_strlen($text)));
if ($text === $pattern) {
// Shortcut (potentially not guaranteed by the algorithm)
return 0;
} elseif ($text === '') {
// Nothing to match.
return -1;
} elseif (mb_substr($text, $loc, mb_strlen($pattern)) == $pattern) {
// Perfect match at the perfect spot! (Includes case of null pattern)
return $loc;
} else {
// Do a fuzzy compare.
return $this->bitap($text, $pattern, $loc);
}
} | Locate the best instance of 'pattern' in 'text' near 'loc'.
@param string $text The text to search.
@param string $pattern The pattern to search for.
@param int $loc The location to search around.
@throws \InvalidArgumentException If null inout.
@return int Best match index or -1. | main | php | yetanotherape/diff-match-patch | src/Matcher.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Matcher.php | Apache-2.0 |
public function bitap($text, $pattern, $loc)
{
if ($this->getMaxBits() != 0 && $this->getMaxBits() < mb_strlen($pattern)) {
throw new \RangeException('Pattern too long for this application.');
}
// Initialise the alphabet.
$s = $this->alphabet($pattern);
$patternLen = mb_strlen($pattern);
$textLen = mb_strlen($text);
// Highest score beyond which we give up.
$scoreThreshold = $this->getThreshold();
// Is there a nearby exact match? (speedup)
$bestLoc = mb_strpos($text, $pattern, $loc);
if ($bestLoc !== false) {
$scoreThreshold = min($this->bitapScore(0, $bestLoc, $patternLen, $loc), $scoreThreshold);
// What about in the other direction? (speedup)
$bestLoc = mb_strrpos($text,$pattern, $loc + $patternLen);
if ($bestLoc !== false) {
$scoreThreshold = min($this->bitapScore(0, $bestLoc, $patternLen, $loc), $scoreThreshold);
}
}
// Initialise the bit arrays.
$matchMask = 1 << ($patternLen - 1);
$bestLoc = -1;
$binMax = $patternLen + $textLen;
$lastRd = null;
for ($d = 0; $d < $patternLen; $d++) {
// Scan for the best match each iteration allows for one more error.
// Run a binary search to determine how far from 'loc' we can stray at
// this error level.
$binMin = 0;
$binMid = $binMax;
while ($binMin < $binMid) {
if ($this->bitapScore($d, $loc + $binMid, $patternLen, $loc) <= $scoreThreshold) {
$binMin = $binMid;
} else {
$binMax = $binMid;
}
$binMid = (int)(($binMax - $binMin) / 2) + $binMin;
}
// Use the result from this iteration as the maximum for the next.
$binMax = $binMid;
$start = max(1, $loc - $binMid + 1);
$finish = min($loc + $binMid, $textLen) + $patternLen;
$rd = array_fill(0, $finish + 2, 0);
$rd[$finish + 1] = (1 << $d) - 1;
for ($j = $finish; $j > $start - 1; $j--) {
if ($textLen <= $j - 1) {
// Out of range.
$charMatch = 0;
} else {
$charMatch = isset($s[$text[$j - 1]]) ? $s[$text[$j - 1]] : 0;
}
if ($d == 0) {
// First pass: exact match.
$rd[$j] = (($rd[$j + 1] << 1) | 1) & $charMatch;
} else {
// Subsequent passes: fuzzy match.
$rd[$j] = ((($rd[$j + 1] << 1) | 1) & $charMatch) |
((($lastRd[$j + 1] | $lastRd[$j]) << 1) | 1) |
$lastRd[$j + 1];
}
if ($rd[$j] & $matchMask) {
$score = $this->bitapScore($d, $j - 1, $patternLen, $loc);
// This match will almost certainly be better than any existing match.
// But check anyway.
if ($score <= $scoreThreshold) {
// Told you so.
$scoreThreshold = $score;
$bestLoc = $j - 1;
if ($bestLoc > $loc) {
// When passing loc, don't exceed our current distance from loc.
$start = max(1, 2 * $loc - $bestLoc);
} else {
// Already passed loc, downhill from here on in.
break;
}
}
}
}
// No hope for a (better) match at greater error levels.
if ($this->bitapScore($d + 1, $loc, $patternLen, $loc) > $scoreThreshold) {
break;
}
$lastRd = $rd;
}
return $bestLoc;
} | Locate the best instance of 'pattern' in 'text' near 'loc' using the
Bitap algorithm.
@param string $text The text to search.
@param string $pattern The pattern to search for.
@param int $loc The location to search around.
@throws \RangeException If pattern longer than number of bits in int.
@return int Best match index or -1. | bitap | php | yetanotherape/diff-match-patch | src/Matcher.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Matcher.php | Apache-2.0 |
protected function bitapScore($errors, $matchLoc, $patternLen, $searchLoc)
{
$accuracy = $errors / $patternLen;
$proximity = abs($searchLoc - $matchLoc);
if (!$this->getDistance()) {
// Dodge divide by zero error.
return $proximity ? 1.0 : $accuracy;
}
return $accuracy + ($proximity/$this->getDistance());
} | Compute and return the score for a match with e errors and x location.
Accesses loc and pattern through being a closure.
@param int $errors Number of errors in match.
@param int $matchLoc Location of match.
@param int $patternLen Length of pattern to search.
@param int $searchLoc The location to search around.
TODO refactor param usage.
@return float Overall score for match (0.0 = good, 1.0 = bad). | bitapScore | php | yetanotherape/diff-match-patch | src/Matcher.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Matcher.php | Apache-2.0 |
public function alphabet($pattern)
{
$s = array();
foreach (preg_split("//u", $pattern, -1, PREG_SPLIT_NO_EMPTY) as $char) {
$s[$char] = 0;
}
for ($i = 0; $i < mb_strlen($pattern); $i++) {
$s[mb_substr($pattern, $i, 1)] |= 1 << (mb_strlen($pattern) - $i - 1);
}
return $s;
} | Initialise the alphabet for the Bitap algorithm.
@param string $pattern The text to encode.
@return array Hash of character locations. | alphabet | php | yetanotherape/diff-match-patch | src/Matcher.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Matcher.php | Apache-2.0 |
public function __get($name)
{
switch ($name){
case 'Diff_Timeout':
$result = $this->diff->getTimeout();
break;
case 'Diff_EditCost':
$result = $this->diff->getEditCost();
break;
case 'Match_Threshold':
$result = $this->matcher->getThreshold();
break;
case 'Match_Distance':
$result = $this->matcher->getDistance();
break;
case 'Match_MaxBits':
$result = $this->matcher->getMaxBits();
break;
case 'Patch_DeleteThreshold':
$result = $this->patch->getDeleteTreshold();
break;
case 'Patch_Margin':
$result = $this->patch->getMargin();
break;
default:
throw new \UnexpectedValueException('Unknown property: ' . $name);
}
return $result;
} | Proxy getting properties to real objects.
@param string $name Property name.
@throws \UnexpectedValueException If property unknown.
@return float | __get | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function __set($name, $value)
{
switch ($name){
case 'Diff_Timeout':
$this->diff->setTimeout($value);
break;
case 'Diff_EditCost':
$this->diff->setEditCost($value);
break;
case 'Match_Threshold':
$this->matcher->setThreshold($value);
break;
case 'Match_Distance':
$this->matcher->setDistance($value);
break;
case 'Match_MaxBits':
$this->matcher->setMaxBits($value);
break;
case 'Patch_DeleteThreshold':
$this->patch->setDeleteTreshold($value);
break;
case 'Patch_Margin':
$this->patch->setMargin($value);
break;
default:
throw new \UnexpectedValueException('Unknown property: ' . $name);
}
} | Proxy setting properties to real objects.
@param string $name Property name.
@param mixed $value Property value.
@throws \UnexpectedValueException If property unknown.
@return float | __set | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function diff_main($text1, $text2, $checklines = true)
{
return $this->diff->main($text1, $text2, $checklines)->getChanges();
} | Find the differences between two texts. Simplifies the problem by
stripping any common prefix or suffix off the texts before diffing.
@param string $text1 Old string to be diffed.
@param string $text2 New string to be diffed.
@param bool $checklines Optional speedup flag. If present and false, then don't run
a line-level diff first to identify the changed areas.
Defaults to true, which does a faster, slightly less optimal diff.
@throws \InvalidArgumentException If texts is null.
@return array Array of changes. | diff_main | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function diff_cleanupSemantic(&$diffs)
{
$this->diff->setChanges($diffs);
$this->diff->cleanupSemantic();
$diffs = $this->diff->getChanges();
} | Reduce the number of edits by eliminating semantically trivial equalities.
Modifies $diffs.
@param array $diffs Array of diff arrays. | diff_cleanupSemantic | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function diff_cleanupEfficiency(&$diffs)
{
$this->diff->setChanges($diffs);
$this->diff->cleanupEfficiency();
$diffs = $this->diff->getChanges();
} | Reduce the number of edits by eliminating operationally trivial equalities.
Modifies $diffs.
@param array $diffs Array of diff arrays. | diff_cleanupEfficiency | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function diff_levenshtein($diffs)
{
$this->diff->setChanges($diffs);
return $this->diff->levenshtein();
} | Compute the Levenshtein distance; the number of inserted, deleted or substituted characters.
@param array $diffs Array of diff arrays.
@return int Number of changes. | diff_levenshtein | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function diff_prettyHtml($diffs)
{
$this->diff->setChanges($diffs);
return $this->diff->prettyHtml();
} | Convert a diff array into a pretty HTML report.
@param array $diffs Array of diff arrays.
@return string HTML representation. | diff_prettyHtml | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function match_main($text, $pattern, $loc = 0)
{
return $this->matcher->main($text, $pattern, $loc);
} | Locate the best instance of 'pattern' in 'text' near 'loc'.
@param string $text The text to search.
@param string $pattern The pattern to search for.
@param int $loc The location to search around.
@throws \InvalidArgumentException If null inout.
@return int Best match index or -1. | match_main | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function patch_make($a, $b = null, $c = null)
{
return $this->patch->make($a, $b, $c);
} | Compute a list of patches to turn text1 into text2.
Use diffs if provided, otherwise compute it ourselves.
There are four ways to call this function, depending on what data is
available to the caller:
Method 1:
a = text1, b = text2
Method 2:
a = diffs
Method 3 (optimal):
a = text1, b = diffs
Method 4 (deprecated, use method 3):
a = text1, b = text2, c = diffs
@param string|array $a text1 (methods 1,3,4) or Array of diff arrays for text1 to text2 (method 2).
@param string|array|null $b text2 (methods 1,4) or Array of diff arrays for text1 to text2 (method 3)
or null (method 2).
@param array|null $c Array of diff arrays for text1 to text2 (method 4) or null (methods 1,2,3).
@throws \InvalidArgumentException If unknown call format.
@return PatchObject[] Array of PatchObjects. | patch_make | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function patch_toText($patches)
{
return $this->patch->toText($patches);
} | Take a list of patches and return a textual representation.
@param PatchObject[] $patches Array of PatchObjects.
@return string Text representation of patches. | patch_toText | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function patch_fromText($text)
{
return $this->patch->fromText($text);
} | Parse a textual representation of patches and return a list of patch objects.
@param string $text Text representation of patches.
@throws \InvalidArgumentException If invalid input.
@throws \UnexpectedValueException If text has bad syntax.
@return PatchObject[] Array of PatchObjects. | patch_fromText | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function patch_apply($patches, $text)
{
return $this->patch->apply($patches, $text);
} | Merge a set of patches onto the text. Return a patched text, as well
as a list of true/false values indicating which patches were applied.
@param PatchObject[] $patches Array of PatchObjects.
@param string $text Old text.
@return array Two element Array, containing the new text and an array of boolean values. | patch_apply | php | yetanotherape/diff-match-patch | src/DiffMatchPatch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/DiffMatchPatch.php | Apache-2.0 |
public function addContext(PatchObject $patch, $text)
{
if (!mb_strlen($text)) {
return;
}
$padding = 0;
$pattern = mb_substr($text, $patch->getStart1(), $patch->getLength1());
// Look for the first and last matches of pattern in text.
// If two different matches are found, increase the pattern length.
$matcher = $this->getMatcher();
while (
($pattern === '' || mb_strpos($text, $pattern) !== mb_strrpos($text, $pattern)) &&
($matcher->getMaxBits() == 0 || mb_strlen($pattern) < $matcher->getMaxBits() - 2 * $this->getMargin())
) {
$padding += $this->getMargin();
$pattern = mb_substr(
$text,
max(0, $patch->getStart2() - $padding),
$patch->getStart2() + $patch->getLength1() + $padding - max(0, $patch->getStart2() - $padding)
);
}
// Add one chunk for good luck.
$padding += $this->getMargin();
// Add the prefix.
$prefix = mb_substr($text, max(0, $patch->getStart2() - $padding), min($patch->getStart2(), $padding));
if ($prefix !== '') {
$patch->prependChanges(array(Diff::EQUAL, $prefix));
}
// Add the suffix.
$suffix = mb_substr($text, $patch->getStart2() + $patch->getLength1(), $padding);
if ($suffix !== '') {
$patch->appendChanges(array(Diff::EQUAL, $suffix));
}
// Roll back the start points.
$prefixLen = mb_strlen($prefix);
$patch->setStart1($patch->getStart1() - $prefixLen);
$patch->setStart2($patch->getStart2() - $prefixLen);
// Extend lengths.
$suffixLen = mb_strlen($suffix);
$patch->setLength1($patch->getLength1() + $prefixLen + $suffixLen);
$patch->setLength2($patch->getLength2() + $prefixLen + $suffixLen);
} | Increase the context until it is unique, but don't let the pattern expand beyond Match->maxBits.
@param PatchObject $patch The patch to grow.
@param string $text Source text. | addContext | php | yetanotherape/diff-match-patch | src/Patch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Patch.php | Apache-2.0 |
protected function deepCopy($patches)
{
$patchesCopy = array();
foreach ($patches as $patch) {
$patchCopy = clone $patch;
$patchesCopy[] = $patchCopy;
}
return $patchesCopy;
} | Given an array of patches, return another array that is identical.
@param PatchObject[] $patches Array of PatchObjects.
@return PatchObject[] Array of PatchObjects. | deepCopy | php | yetanotherape/diff-match-patch | src/Patch.php | https://github.com/yetanotherape/diff-match-patch/blob/master/src/Patch.php | Apache-2.0 |
public static function getValidType($type, $xsdTypesPath = null, $fallback = null)
{
return XsdTypes::instance($xsdTypesPath)->isXsd(str_replace('[]', '', $type)) ? $fallback : $type;
} | See http://php.net/manual/fr/language.oop5.typehinting.php for these cases
Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp.
@param mixed $type
@param null $xsdTypesPath
@param mixed $fallback
@return mixed | getValidType | php | WsdlToPhp/PackageGenerator | src/File/AbstractModelFile.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/src/File/AbstractModelFile.php | MIT |
public static function getPhpType($type, $xsdTypesPath = null, $fallback = self::TYPE_STRING)
{
return XsdTypes::instance($xsdTypesPath)->isXsd(str_replace('[]', '', $type)) ? XsdTypes::instance($xsdTypesPath)->phpType($type) : $fallback;
} | See http://php.net/manual/fr/language.oop5.typehinting.php for these cases
Also see http://www.w3schools.com/schema/schema_dtypes_numeric.asp.
@param mixed $type
@param null $xsdTypesPath
@param mixed $fallback
@return mixed | getPhpType | php | WsdlToPhp/PackageGenerator | src/File/AbstractModelFile.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/src/File/AbstractModelFile.php | MIT |
public static function purgeUniqueNames()
{
self::$uniqueNames = [];
} | Gives the availability for test purpose and multiple package generation to purge unique names. | purgeUniqueNames | php | WsdlToPhp/PackageGenerator | src/Model/AbstractModel.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/src/Model/AbstractModel.php | MIT |
public static function purgePhpReservedKeywords()
{
self::$replacedPhpReservedKeywords = [];
} | Gives the availability for test purpose and multiple package generation to purge reserved keywords usage. | purgePhpReservedKeywords | php | WsdlToPhp/PackageGenerator | src/Model/AbstractModel.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/src/Model/AbstractModel.php | MIT |
public function GetVersion()
{
try {
$this->setResult($resultGetVersion = $this->getSoapClient()->__soapCall('GetVersion', [], [], [], $this->outputHeaders));
return $resultGetVersion;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetVersion
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return int|bool | GetVersion | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetClientsList(\StructType\ClientInfoRequest $params)
{
try {
$this->setResult($resultGetClientsList = $this->getSoapClient()->__soapCall('GetClientsList', [
$params,
], [], [], $this->outputHeaders));
return $resultGetClientsList;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetClientsList
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\ClientInfoRequest $params
@return \StructType\ClientInfo[]|bool | GetClientsList | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetSubClients(\StructType\GetSubClientsRequest $params)
{
try {
$this->setResult($resultGetSubClients = $this->getSoapClient()->__soapCall('GetSubClients', [
$params,
], [], [], $this->outputHeaders));
return $resultGetSubClients;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetSubClients
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetSubClientsRequest $params
@return \StructType\ShortClientInfo[]|bool | GetSubClients | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetSummaryStat(\StructType\GetSummaryStatRequest $params)
{
try {
$this->setResult($resultGetSummaryStat = $this->getSoapClient()->__soapCall('GetSummaryStat', [
$params,
], [], [], $this->outputHeaders));
return $resultGetSummaryStat;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetSummaryStat
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetSummaryStatRequest $params
@return \StructType\StatItem[]|bool | GetSummaryStat | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetCampaignParams(\StructType\CampaignIDInfo $params)
{
try {
$this->setResult($resultGetCampaignParams = $this->getSoapClient()->__soapCall('GetCampaignParams', [
$params,
], [], [], $this->outputHeaders));
return $resultGetCampaignParams;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetCampaignParams
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\CampaignIDInfo $params
@return \StructType\CampaignInfo|bool | GetCampaignParams | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetCampaignsParams(\StructType\CampaignIDSInfo $params)
{
try {
$this->setResult($resultGetCampaignsParams = $this->getSoapClient()->__soapCall('GetCampaignsParams', [
$params,
], [], [], $this->outputHeaders));
return $resultGetCampaignsParams;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetCampaignsParams
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\CampaignIDSInfo $params
@return \StructType\CampaignInfo[]|bool | GetCampaignsParams | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetReportList()
{
try {
$this->setResult($resultGetReportList = $this->getSoapClient()->__soapCall('GetReportList', [], [], [], $this->outputHeaders));
return $resultGetReportList;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetReportList
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\ReportInfo[]|bool | GetReportList | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetClientsUnits(array $params)
{
try {
$this->setResult($resultGetClientsUnits = $this->getSoapClient()->__soapCall('GetClientsUnits', [
$params,
], [], [], $this->outputHeaders));
return $resultGetClientsUnits;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetClientsUnits
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param string[] $params
@return \StructType\ClientsUnitInfo[]|bool | GetClientsUnits | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetClientInfo(array $params)
{
try {
$this->setResult($resultGetClientInfo = $this->getSoapClient()->__soapCall('GetClientInfo', [
$params,
], [], [], $this->outputHeaders));
return $resultGetClientInfo;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetClientInfo
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param string[] $params
@return \StructType\ClientInfo[]|bool | GetClientInfo | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetBanners(\StructType\GetBannersInfo $params)
{
try {
$this->setResult($resultGetBanners = $this->getSoapClient()->__soapCall('GetBanners', [
$params,
], [], [], $this->outputHeaders));
return $resultGetBanners;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetBanners
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetBannersInfo $params
@return \StructType\BannerInfo[]|bool | GetBanners | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetCampaignsList(array $params)
{
try {
$this->setResult($resultGetCampaignsList = $this->getSoapClient()->__soapCall('GetCampaignsList', [
$params,
], [], [], $this->outputHeaders));
return $resultGetCampaignsList;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetCampaignsList
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param string[] $params
@return \StructType\ShortCampaignInfo[]|bool | GetCampaignsList | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetCampaignsListFilter(\StructType\GetCampaignsInfo $params)
{
try {
$this->setResult($resultGetCampaignsListFilter = $this->getSoapClient()->__soapCall('GetCampaignsListFilter', [
$params,
], [], [], $this->outputHeaders));
return $resultGetCampaignsListFilter;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetCampaignsListFilter
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetCampaignsInfo $params
@return \StructType\ShortCampaignInfo[]|bool | GetCampaignsListFilter | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetBalance(array $params)
{
try {
$this->setResult($resultGetBalance = $this->getSoapClient()->__soapCall('GetBalance', [
$params,
], [], [], $this->outputHeaders));
return $resultGetBalance;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetBalance
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param int[] $params
@return \StructType\CampaignBalanceInfo[]|bool | GetBalance | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetBannerPhrases(array $params)
{
try {
$this->setResult($resultGetBannerPhrases = $this->getSoapClient()->__soapCall('GetBannerPhrases', [
$params,
], [], [], $this->outputHeaders));
return $resultGetBannerPhrases;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetBannerPhrases
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param int[] $params
@return \StructType\BannerPhraseInfo[]|bool | GetBannerPhrases | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetBannerPhrasesFilter(\StructType\BannerPhrasesFilterRequestInfo $params)
{
try {
$this->setResult($resultGetBannerPhrasesFilter = $this->getSoapClient()->__soapCall('GetBannerPhrasesFilter', [
$params,
], [], [], $this->outputHeaders));
return $resultGetBannerPhrasesFilter;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetBannerPhrasesFilter
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\BannerPhrasesFilterRequestInfo $params
@return \StructType\BannerPhraseInfo[]|bool | GetBannerPhrasesFilter | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetRegions()
{
try {
$this->setResult($resultGetRegions = $this->getSoapClient()->__soapCall('GetRegions', [], [], [], $this->outputHeaders));
return $resultGetRegions;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetRegions
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\RegionInfo[]|bool | GetRegions | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetBannersStat(\StructType\NewReportInfo $params)
{
try {
$this->setResult($resultGetBannersStat = $this->getSoapClient()->__soapCall('GetBannersStat', [
$params,
], [], [], $this->outputHeaders));
return $resultGetBannersStat;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetBannersStat
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\NewReportInfo $params
@return \StructType\GetBannersStatResponse|bool | GetBannersStat | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetForecast($params)
{
try {
$this->setResult($resultGetForecast = $this->getSoapClient()->__soapCall('GetForecast', [
$params,
], [], [], $this->outputHeaders));
return $resultGetForecast;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetForecast
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param string $params
@return \StructType\GetForecastInfo|bool | GetForecast | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetRubrics()
{
try {
$this->setResult($resultGetRubrics = $this->getSoapClient()->__soapCall('GetRubrics', [], [], [], $this->outputHeaders));
return $resultGetRubrics;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetRubrics
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\RubricInfo[]|bool | GetRubrics | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetTimeZones()
{
try {
$this->setResult($resultGetTimeZones = $this->getSoapClient()->__soapCall('GetTimeZones', [], [], [], $this->outputHeaders));
return $resultGetTimeZones;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetTimeZones
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\TimeZoneInfo[]|bool | GetTimeZones | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetForecastList()
{
try {
$this->setResult($resultGetForecastList = $this->getSoapClient()->__soapCall('GetForecastList', [], [], [], $this->outputHeaders));
return $resultGetForecastList;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetForecastList
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\ForecastStatusInfo[]|bool | GetForecastList | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetAvailableVersions()
{
try {
$this->setResult($resultGetAvailableVersions = $this->getSoapClient()->__soapCall('GetAvailableVersions', [], [], [], $this->outputHeaders));
return $resultGetAvailableVersions;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetAvailableVersions
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\VersionDesc[]|bool | GetAvailableVersions | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetKeywordsSuggestion(\StructType\KeywordsSuggestionInfo $params)
{
try {
$this->setResult($resultGetKeywordsSuggestion = $this->getSoapClient()->__soapCall('GetKeywordsSuggestion', [
$params,
], [], [], $this->outputHeaders));
return $resultGetKeywordsSuggestion;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetKeywordsSuggestion
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\KeywordsSuggestionInfo $params
@return string[]|bool | GetKeywordsSuggestion | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetWordstatReportList()
{
try {
$this->setResult($resultGetWordstatReportList = $this->getSoapClient()->__soapCall('GetWordstatReportList', [], [], [], $this->outputHeaders));
return $resultGetWordstatReportList;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetWordstatReportList
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\WordstatReportStatusInfo[]|bool | GetWordstatReportList | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetWordstatReport($params)
{
try {
$this->setResult($resultGetWordstatReport = $this->getSoapClient()->__soapCall('GetWordstatReport', [
$params,
], [], [], $this->outputHeaders));
return $resultGetWordstatReport;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetWordstatReport
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param string $params
@return \StructType\WordstatReportInfo[]|bool | GetWordstatReport | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetStatGoals(\StructType\StatGoalsCampaignIDInfo $params)
{
try {
$this->setResult($resultGetStatGoals = $this->getSoapClient()->__soapCall('GetStatGoals', [
$params,
], [], [], $this->outputHeaders));
return $resultGetStatGoals;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetStatGoals
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\StatGoalsCampaignIDInfo $params
@return \StructType\StatGoalInfo[]|bool | GetStatGoals | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetChanges(\StructType\GetChangesRequest $params)
{
try {
$this->setResult($resultGetChanges = $this->getSoapClient()->__soapCall('GetChanges', [
$params,
], [], [], $this->outputHeaders));
return $resultGetChanges;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetChanges
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetChangesRequest $params
@return \StructType\GetChangesResponse|bool | GetChanges | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetEventsLog(\StructType\GetEventsLogRequest $params)
{
try {
$this->setResult($resultGetEventsLog = $this->getSoapClient()->__soapCall('GetEventsLog', [
$params,
], [], [], $this->outputHeaders));
return $resultGetEventsLog;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetEventsLog
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetEventsLogRequest $params
@return \StructType\EventsLogItem[]|bool | GetEventsLog | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetCampaignsTags(\StructType\CampaignIDSInfo $params)
{
try {
$this->setResult($resultGetCampaignsTags = $this->getSoapClient()->__soapCall('GetCampaignsTags', [
$params,
], [], [], $this->outputHeaders));
return $resultGetCampaignsTags;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetCampaignsTags
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\CampaignIDSInfo $params
@return \StructType\CampaignTagsInfo[]|bool | GetCampaignsTags | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetBannersTags(\StructType\BannersRequestInfo $params)
{
try {
$this->setResult($resultGetBannersTags = $this->getSoapClient()->__soapCall('GetBannersTags', [
$params,
], [], [], $this->outputHeaders));
return $resultGetBannersTags;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetBannersTags
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\BannersRequestInfo $params
@return \StructType\BannerTagsInfo[]|bool | GetBannersTags | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetCreditLimits()
{
try {
$this->setResult($resultGetCreditLimits = $this->getSoapClient()->__soapCall('GetCreditLimits', [], [], [], $this->outputHeaders));
return $resultGetCreditLimits;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetCreditLimits
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\CreditLimitsInfo|bool | GetCreditLimits | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetRetargetingGoals(\StructType\GetRetargetingGoalsRequest $params)
{
try {
$this->setResult($resultGetRetargetingGoals = $this->getSoapClient()->__soapCall('GetRetargetingGoals', [
$params,
], [], [], $this->outputHeaders));
return $resultGetRetargetingGoals;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetRetargetingGoals
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\GetRetargetingGoalsRequest $params
@return \StructType\RetargetingGoal[]|bool | GetRetargetingGoals | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function GetOfflineReportList()
{
try {
$this->setResult($resultGetOfflineReportList = $this->getSoapClient()->__soapCall('GetOfflineReportList', [], [], [], $this->outputHeaders));
return $resultGetOfflineReportList;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named GetOfflineReportList
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@return \StructType\OfflineReportInfo[]|bool | GetOfflineReportList | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidYandexDirectApiLiveGet.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidYandexDirectApiLiveGet.php | MIT |
public function __construct(array $adGroups)
{
$this
->setAdGroups($adGroups);
} | Constructor method for AddRequest
@uses ApiAddRequest::setAdGroups()
@param \StructType\ApiAdGroupAddItem[] $adGroups | __construct | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidAddRequestRepeatedMaxOccurs.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidAddRequestRepeatedMaxOccurs.php | MIT |
public function __construct(\StructType\ApiFareItineraryPrice $price, string $key, array $firstSegmentsIds, ?string $clickoutURLParams = null, ?bool $resident = null, ?array $secondSegmentsIds = null, ?array $thirdSegmentsIds = null)
{
$this
->setPrice($price)
->setKey($key)
->setFirstSegmentsIds($firstSegmentsIds)
->setClickoutURLParams($clickoutURLParams)
->setResident($resident)
->setSecondSegmentsIds($secondSegmentsIds)
->setThirdSegmentsIds($thirdSegmentsIds);
} | Constructor method for fareItinerary
@uses ApiFareItinerary::setPrice()
@uses ApiFareItinerary::setKey()
@uses ApiFareItinerary::setFirstSegmentsIds()
@uses ApiFareItinerary::setClickoutURLParams()
@uses ApiFareItinerary::setResident()
@uses ApiFareItinerary::setSecondSegmentsIds()
@uses ApiFareItinerary::setThirdSegmentsIds()
@param \StructType\ApiFareItineraryPrice $price
@param string $key
@param int[] $firstSegmentsIds
@param string $clickoutURLParams
@param bool $resident
@param int[] $secondSegmentsIds
@param int[] $thirdSegmentsIds | __construct | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidApiFareItinerary.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidApiFareItinerary.php | MIT |
public function DoMobileCheckoutPayment(\StructType\DoMobileCheckoutPaymentReq $doMobileCheckoutPaymentRequest)
{
try {
$this->setResult($resultDoMobileCheckoutPayment = $this->getSoapClient()->__soapCall('DoMobileCheckoutPayment', [
$doMobileCheckoutPaymentRequest,
], [], [], $this->outputHeaders));
return $resultDoMobileCheckoutPayment;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named DoMobileCheckoutPayment
Meta information extracted from the WSDL
- SOAPHeaderNames: RequesterCredentials
- SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI
- SOAPHeaderTypes: \StructType\CustomSecurityHeaderType
- SOAPHeaders: required
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\DoMobileCheckoutPaymentReq $doMobileCheckoutPaymentRequest
@return \StructType\DoMobileCheckoutPaymentResponseType|bool | DoMobileCheckoutPayment | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidDoWithoutPrefix.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidDoWithoutPrefix.php | MIT |
public function DoExpressCheckoutPayment(\StructType\DoExpressCheckoutPaymentReq $doExpressCheckoutPaymentRequest)
{
try {
$this->setResult($resultDoExpressCheckoutPayment = $this->getSoapClient()->__soapCall('DoExpressCheckoutPayment', [
$doExpressCheckoutPaymentRequest,
], [], [], $this->outputHeaders));
return $resultDoExpressCheckoutPayment;
} catch (SoapFault $soapFault) {
$this->saveLastError(__METHOD__, $soapFault);
return false;
}
} | Method to call the operation originally named DoExpressCheckoutPayment
Meta information extracted from the WSDL
- SOAPHeaderNames: RequesterCredentials
- SOAPHeaderNamespaces: urn:ebay:api:PayPalAPI
- SOAPHeaderTypes: \StructType\CustomSecurityHeaderType
- SOAPHeaders: required
@uses AbstractSoapClientBase::getSoapClient()
@uses AbstractSoapClientBase::setResult()
@uses AbstractSoapClientBase::saveLastError()
@param \StructType\DoExpressCheckoutPaymentReq $doExpressCheckoutPaymentRequest
@return \StructType\DoExpressCheckoutPaymentResponseType|bool | DoExpressCheckoutPayment | php | WsdlToPhp/PackageGenerator | tests/resources/generated/ValidDoWithoutPrefix.php | https://github.com/WsdlToPhp/PackageGenerator/blob/master/tests/resources/generated/ValidDoWithoutPrefix.php | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.