diff --git a/app/code/Magento/Backend/Block/Dashboard/Graph.php b/app/code/Magento/Backend/Block/Dashboard/Graph.php index 8e238ccab44cb..83fc552ab0ed8 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Graph.php +++ b/app/code/Magento/Backend/Block/Dashboard/Graph.php @@ -331,7 +331,7 @@ public function getChartUrl($directUrl = true) $thisdataarray = $serie; if ($this->_encoding == "s") { // SIMPLE ENCODING - for ($j = 0; $j < sizeof($thisdataarray); $j++) { + for ($j = 0, $jMax = sizeof($thisdataarray); $j < $jMax; $j++) { $currentvalue = $thisdataarray[$j]; if (is_numeric($currentvalue)) { $ylocation = round( @@ -344,7 +344,7 @@ public function getChartUrl($directUrl = true) } } else { // EXTENDED ENCODING - for ($j = 0; $j < sizeof($thisdataarray); $j++) { + for ($j = 0, $jMax = sizeof($thisdataarray); $j < $jMax; $j++) { $currentvalue = $thisdataarray[$j]; if (is_numeric($currentvalue)) { if ($yrange) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index a5b6b34d324f7..12b468ee445aa 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -325,7 +325,7 @@ public function getBreadcrumbsJavascript($path, $javascriptVarName) * * @param Node|array $node * @param int $level - * @return string + * @return array * @SuppressWarnings(PHPMD.CyclomaticComplexity) * @SuppressWarnings(PHPMD.NPathComplexity) */ diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php index 5e98313f95f0f..b5330ab66af71 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Widget/Chooser.php @@ -144,7 +144,7 @@ function (node, e) { * * @param \Magento\Framework\Data\Tree\Node|array $node * @param int $level - * @return string + * @return array */ protected function _getNodeJson($node, $level = 0) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Fieldset/Element.php b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Fieldset/Element.php index 10214fc1d16fd..ad6df27b89334 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Fieldset/Element.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Fieldset/Element.php @@ -21,7 +21,7 @@ class Element extends \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Eleme /** * Retrieve data object related with form * - * @return \Magento\Catalog\Model\Product || \Magento\Catalog\Model\Category + * @return \Magento\Catalog\Model\Product|\Magento\Catalog\Model\Category */ public function getDataObject() { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php index ab5026b1e69b9..66e04ef03f771 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php @@ -101,8 +101,7 @@ protected function _prepareColumns() 'type' => 'options', 'options' => ['1' => __('Yes'), '0' => __('No')], 'align' => 'center' - ], - 'is_user_defined' + ] ); $this->_eventManager->dispatch('product_attribute_grid_build', ['grid' => $this]); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php index d5f66231f1d82..e1b97f996c769 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php @@ -81,7 +81,7 @@ public function getSelectorOptions() * * @param string $labelPart * @param int $templateId - * @return \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection + * @return array */ public function getSuggestedAttributes($labelPart, $templateId = null) { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php b/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php index dbeff93683bc0..9d13d89d54b80 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Rss/Grid/Link.php @@ -69,7 +69,7 @@ public function isRssAllowed() } /** - * @return string + * @return array */ protected function getLinkParams() { diff --git a/app/code/Magento/Catalog/Block/Category/Rss/Link.php b/app/code/Magento/Catalog/Block/Category/Rss/Link.php index 0599d5f4b989c..e40b81200574c 100644 --- a/app/code/Magento/Catalog/Block/Category/Rss/Link.php +++ b/app/code/Magento/Catalog/Block/Category/Rss/Link.php @@ -62,7 +62,7 @@ public function getLabel() } /** - * @return string + * @return array */ protected function getLinkParams() { diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index d4af775ad20da..58800802cc60d 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -195,7 +195,7 @@ public function getAddToCompareUrl() * Gets minimal sales quantity * * @param \Magento\Catalog\Model\Product $product - * @return int|null + * @return float|null */ public function getMinimalQty($product) { diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index 66bf5eafb156e..d582005f653ef 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -178,7 +178,7 @@ public function getPrice($price, $includingTax = null) * Returns price converted to current currency rate * * @param float $price - * @return float + * @return float|string */ public function getCurrencyPrice($price) { diff --git a/app/code/Magento/Catalog/Block/Rss/Product/Special.php b/app/code/Magento/Catalog/Block/Rss/Product/Special.php index c61bee4417cbc..a9107f14cc5e4 100644 --- a/app/code/Magento/Catalog/Block/Rss/Product/Special.php +++ b/app/code/Magento/Catalog/Block/Rss/Product/Special.php @@ -107,7 +107,7 @@ protected function _construct() } /** - * @return string + * @return array */ public function getRssData() { diff --git a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php index 995aac371e598..782e67353a4d6 100644 --- a/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php +++ b/app/code/Magento/Catalog/Test/Unit/Model/Product/Type/PriceTest.php @@ -202,7 +202,7 @@ public function testTierPrices($priceScope, $expectedWebsiteId) $this->assertTrue(is_array($tpArray)); $this->assertEquals(sizeof($tps), sizeof($tpArray)); - for ($i = 0; $i < sizeof($tps); $i++) { + for ($i = 0, $iMax = sizeof($tps); $i < $iMax; $i++) { $tpData = $tpArray[$i]; $this->assertEquals($expectedWebsiteId, $tpData['website_id'], 'Website Id does not match'); $this->assertEquals($tps[$i]->getValue(), $tpData['price'], 'Price/Value does not match'); @@ -233,7 +233,7 @@ public function testTierPrices($priceScope, $expectedWebsiteId) $this->assertEquals(50, $tpRest->getExtensionAttributes()->getPercentageValue()); } - for ($i = 0; $i < sizeof($tps); $i++) { + for ($i = 0, $iMax = sizeof($tps); $i < $iMax; $i++) { $this->assertEquals( $tps[$i]->getValue(), $tpRests[$i]->getValue(), diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index c23ad5b535dd8..16e3b9f8bc1cc 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -297,7 +297,7 @@ public function validateCcNum($ccNumber) $cardNumber = strrev($ccNumber); $numSum = 0; - for ($i = 0; $i < strlen($cardNumber); $i++) { + for ($i = 0, $iMax = strlen($cardNumber); $i < $iMax; $i++) { $currentNum = substr($cardNumber, $i, 1); /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php index c7df909192d3b..2fe42747344d4 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/AbstractPdf.php @@ -186,7 +186,7 @@ public function widthForStringUsingFontSize($string, $font, $fontSize) ); $characters = []; - for ($i = 0; $i < strlen($drawingString); $i++) { + for ($i = 0, $iMax = strlen($drawingString); $i < $iMax; $i++) { $characters[] = ord($drawingString[$i++]) << 8 | ord($drawingString[$i]); } $glyphs = $font->glyphNumbersForCharacters($characters); diff --git a/app/code/Magento/Sales/Model/Order/Shipment/Item.php b/app/code/Magento/Sales/Model/Order/Shipment/Item.php index 6a4712906dcd3..29cc1d2d3d90d 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment/Item.php +++ b/app/code/Magento/Sales/Model/Order/Shipment/Item.php @@ -146,8 +146,7 @@ public function getOrderItem() * Declare qty * * @param float $qty - * @return \Magento\Sales\Model\Order\Shipment\Item - * @throws \Magento\Framework\Exception\LocalizedException + * @return $this */ public function setQty($qty) { @@ -159,7 +158,6 @@ public function setQty($qty) * Applying qty to order item * * @return $this - * @throws \Magento\Framework\Exception\LocalizedException */ public function register() { diff --git a/app/code/Magento/SalesInventory/Model/Order/ReturnProcessor.php b/app/code/Magento/SalesInventory/Model/Order/ReturnProcessor.php index ed95ecd7e4380..3f2ba38fa5a55 100644 --- a/app/code/Magento/SalesInventory/Model/Order/ReturnProcessor.php +++ b/app/code/Magento/SalesInventory/Model/Order/ReturnProcessor.php @@ -10,6 +10,8 @@ /** * Class ReturnProcessor + * + * @api */ class ReturnProcessor { diff --git a/app/code/Magento/Ui/Model/Export/ConvertToCsv.php b/app/code/Magento/Ui/Model/Export/ConvertToCsv.php index 40b10749db21e..eb811bfae788f 100644 --- a/app/code/Magento/Ui/Model/Export/ConvertToCsv.php +++ b/app/code/Magento/Ui/Model/Export/ConvertToCsv.php @@ -9,7 +9,6 @@ use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Ui\Component\MassAction\Filter; /** @@ -18,7 +17,7 @@ class ConvertToCsv { /** - * @var WriteInterface + * @var DirectoryList */ protected $directory; diff --git a/app/code/Magento/Ui/Model/Export/ConvertToXml.php b/app/code/Magento/Ui/Model/Export/ConvertToXml.php index 5f6e45a948f24..19eb651113fcf 100644 --- a/app/code/Magento/Ui/Model/Export/ConvertToXml.php +++ b/app/code/Magento/Ui/Model/Export/ConvertToXml.php @@ -13,7 +13,6 @@ use Magento\Framework\Exception\FileSystemException; use Magento\Framework\Exception\LocalizedException; use Magento\Framework\Filesystem; -use Magento\Framework\Filesystem\Directory\WriteInterface; use Magento\Ui\Component\MassAction\Filter; /** @@ -22,7 +21,7 @@ class ConvertToXml { /** - * @var WriteInterface + * @var DirectoryList */ protected $directory; diff --git a/app/code/Magento/Widget/Model/Widget/Instance.php b/app/code/Magento/Widget/Model/Widget/Instance.php index f21609cb1ef5c..afe7ef3766f7c 100644 --- a/app/code/Magento/Widget/Model/Widget/Instance.php +++ b/app/code/Magento/Widget/Model/Widget/Instance.php @@ -22,6 +22,7 @@ * @method int getThemeId() * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + * @SuppressWarnings(PHPMD.TooManyFields) * @since 100.0.2 */ class Instance extends \Magento\Framework\Model\AbstractModel @@ -96,6 +97,16 @@ class Instance extends \Magento\Framework\Model\AbstractModel */ protected $_relatedCacheTypes; + /** + * @var \Magento\Catalog\Model\Product\Type + */ + protected $_productType; + + /** + * @var \Magento\Widget\Model\Config\Reader + */ + protected $_reader; + /** * @var \Magento\Framework\Escaper */ diff --git a/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml b/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml index 02e65707d322f..6deddeca59ef9 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml +++ b/app/code/Magento/Widget/Test/Unit/Model/_files/widget.xml @@ -41,7 +41,7 @@ - + Select Product... diff --git a/app/code/Magento/Widget/Test/Unit/Model/_files/widget_config.php b/app/code/Magento/Widget/Test/Unit/Model/_files/widget_config.php index 098fb14c9cec9..697e56cbcbb38 100644 --- a/app/code/Magento/Widget/Test/Unit/Model/_files/widget_config.php +++ b/app/code/Magento/Widget/Test/Unit/Model/_files/widget_config.php @@ -48,7 +48,7 @@ 'type' => 'label', '@' => ['type' => 'complex'], 'helper_block' => [ - 'type' => \Magento\Backend\Block\Catalog\Product\Widget\Chooser::class, + 'type' => \Magento\Catalog\Block\Adminhtml\Product\Widget\Chooser::class, 'data' => ['button' => ['open' => 'Select Product...']], ], 'visible' => '1', diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_shipping_and_invoice.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_shipping_and_invoice.php index a889235ea1862..4c892904b3c3e 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_shipping_and_invoice.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_with_shipping_and_invoice.php @@ -3,6 +3,9 @@ * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ + +use Magento\Sales\Model\Order\ShipmentFactory; + require 'order.php'; $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -36,4 +39,10 @@ $order->setIsInProcess(true); -$transaction->addObject($invoice)->addObject($order)->save(); +$items = []; +foreach ($order->getItems() as $orderItem) { + $items[$orderItem->getId()] = $orderItem->getQtyOrdered(); +} +$shipment = $objectManager->get(ShipmentFactory::class)->create($order, $items); + +$transaction->addObject($invoice)->addObject($shipment)->addObject($order)->save(); diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php index 472fff4f4f287..f0a4c44cc3c98 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Language/DictionaryTest.php @@ -52,7 +52,7 @@ public function testDictionaryGetter() } $file = $this->getMockForAbstractClass(\Magento\Framework\Filesystem\File\ReadInterface::class); - for ($i = 0; $i < count($data); $i++) { + for ($i = 0, $iMax = count($data); $i < $iMax; $i++) { $file->expects($this->at($i))->method('readCsv')->will($this->returnValue($data[$i])); } $file->expects($this->at($i))->method('readCsv')->will($this->returnValue(false)); diff --git a/lib/internal/Magento/Framework/Archive.php b/lib/internal/Magento/Framework/Archive.php index d43c976431b51..b5e24718ff524 100644 --- a/lib/internal/Magento/Framework/Archive.php +++ b/lib/internal/Magento/Framework/Archive.php @@ -96,7 +96,7 @@ public function pack($source, $destination = 'packed.tgz', $skipRoot = false) { $archivers = $this->_getArchivers($destination); $interimSource = ''; - for ($i = 0; $i < count($archivers); $i++) { + for ($i = 0, $iMax = count($archivers); $i < $iMax; $i++) { if ($i == count($archivers) - 1) { $packed = $destination; } else { diff --git a/lib/internal/Magento/Framework/Filesystem/Io/AbstractIo.php b/lib/internal/Magento/Framework/Filesystem/Io/AbstractIo.php index e30499523f3a3..f2cec25c846e7 100644 --- a/lib/internal/Magento/Framework/Filesystem/Io/AbstractIo.php +++ b/lib/internal/Magento/Framework/Filesystem/Io/AbstractIo.php @@ -80,7 +80,7 @@ public function getCleanPath($path) $pathParts = explode("/", $pathTokP); $realPathParts = []; - for ($i = 0, $realPathParts = []; $i < count($pathParts); $i++) { + for ($i = 0, $realPathParts = [], $iMax = count($pathParts); $i < $iMax; $i++) { if ($pathParts[$i] == '.') { continue; } elseif ($pathParts[$i] == '..') { diff --git a/lib/internal/Magento/Framework/Filter/Template.php b/lib/internal/Magento/Framework/Filter/Template.php index 68b636cdc22c1..ee486d8d3248e 100644 --- a/lib/internal/Magento/Framework/Filter/Template.php +++ b/lib/internal/Magento/Framework/Filter/Template.php @@ -313,7 +313,7 @@ protected function getVariable($value, $default = '{no_value_defined}') $stackVars = $tokenizer->tokenize(); $result = $default; $last = 0; - for ($i = 0; $i < count($stackVars); $i++) { + for ($i = 0, $iMax = count($stackVars); $i < $iMax; $i++) { if ($i == 0 && isset($this->templateVars[$stackVars[$i]['name']])) { // Getting of template value $stackVars[$i]['variable'] = & $this->templateVars[$stackVars[$i]['name']]; diff --git a/lib/internal/Magento/Framework/Profiler/Driver/Standard/Stat.php b/lib/internal/Magento/Framework/Profiler/Driver/Standard/Stat.php index 9774bef8cb513..0a8fb7a0d1c56 100644 --- a/lib/internal/Magento/Framework/Profiler/Driver/Standard/Stat.php +++ b/lib/internal/Magento/Framework/Profiler/Driver/Standard/Stat.php @@ -200,7 +200,7 @@ protected function _getOrderedTimerIds() $prevTimerId = $timerIds[0]; $result = [$prevTimerId]; - for ($i = 1; $i < count($timerIds); $i++) { + for ($i = 1, $iMax = count($timerIds); $i < $iMax; $i++) { $timerId = $timerIds[$i]; /* Skip already added timer */ if (!$timerId) { @@ -209,7 +209,7 @@ protected function _getOrderedTimerIds() /* Loop over all timers that need to be closed under previous timer */ while (strpos($timerId, $prevTimerId . Profiler::NESTING_SEPARATOR) !== 0) { /* Add to result all timers nested in the previous timer */ - for ($j = $i + 1; $j < count($timerIds); $j++) { + for ($j = $i + 1, $jMax = count($timerIds); $j < $jMax; $j++) { if (strpos($timerIds[$j], $prevTimerId . Profiler::NESTING_SEPARATOR) === 0) { $result[] = $timerIds[$j]; /* Mark timer as already added */ diff --git a/lib/internal/Magento/Framework/System/Ftp.php b/lib/internal/Magento/Framework/System/Ftp.php index 216026be8d72e..8d7d48a0e21ad 100644 --- a/lib/internal/Magento/Framework/System/Ftp.php +++ b/lib/internal/Magento/Framework/System/Ftp.php @@ -58,7 +58,7 @@ public function mkdirRecursive($path, $mode = 0777) $dir = explode("/", $path); $path = ""; $ret = true; - for ($i = 0; $i < count($dir); $i++) { + for ($i = 0, $iMax = count($dir); $i < $iMax; $i++) { $path .= "/" . $dir[$i]; if (!@ftp_chdir($this->_conn, $path)) { @ftp_chdir($this->_conn, "/"); diff --git a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php index a4e3063abece4..d15adfedb64da 100644 --- a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php +++ b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Html.php @@ -31,7 +31,7 @@ protected function _parse() $results = []; preg_match_all(Filter::CONSTRUCTION_PATTERN, $data, $results, PREG_SET_ORDER); - for ($i = 0; $i < count($results); $i++) { + for ($i = 0, $iMax = count($results); $i < $iMax; $i++) { if ($results[$i][1] === Filter::TRANS_DIRECTIVE_NAME) { $directive = []; if (preg_match(Filter::TRANS_DIRECTIVE_REGEX, $results[$i][2], $directive) !== 1) { @@ -43,7 +43,7 @@ protected function _parse() } preg_match_all(self::HTML_FILTER, $data, $results, PREG_SET_ORDER); - for ($i = 0; $i < count($results); $i++) { + for ($i = 0, $iMax = count($results); $i < $iMax; $i++) { if (!empty($results[$i]['value'])) { $this->_addPhrase($results[$i]['value']); } diff --git a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php index 4095b12c9a6c6..1d7b5fd4b767a 100644 --- a/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php +++ b/setup/src/Magento/Setup/Module/I18n/Parser/Adapter/Js.php @@ -22,7 +22,7 @@ protected function _parse() $fileRow = fgets($fileHandle, 4096); $results = []; preg_match_all('/mage\.__\(\s*([\'"])(.*?[^\\\])\1.*?[),]/', $fileRow, $results, PREG_SET_ORDER); - for ($i = 0; $i < count($results); $i++) { + for ($i = 0, $iMax = count($results); $i < $iMax; $i++) { if (isset($results[$i][2])) { $quote = $results[$i][1]; $this->_addPhrase($quote . $results[$i][2] . $quote, $lineNumber); @@ -30,7 +30,7 @@ protected function _parse() } preg_match_all('/\\$t\(\s*([\'"])(.*?[^\\\])\1.*?[),]/', $fileRow, $results, PREG_SET_ORDER); - for ($i = 0; $i < count($results); $i++) { + for ($i = 0, $iMax = count($results); $i < $iMax; $i++) { if (isset($results[$i][2])) { $quote = $results[$i][1]; $this->_addPhrase($quote . $results[$i][2] . $quote, $lineNumber);