Skip to content

Commit 9aa35bf

Browse files
authored
Merge pull request #120 from magento/MQE-969
MQE-969: Add some missing @throws phpdoc annotations
2 parents 241734e + 501c65a commit 9aa35bf

24 files changed

+81
-2
lines changed

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/DataObjectHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
1010
use Magento\FunctionalTestingFramework\DataGenerator\Parsers\DataProfileSchemaParser;
11+
use Magento\FunctionalTestingFramework\Exceptions\XmlException;
1112
use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface;
1213
use Magento\FunctionalTestingFramework\ObjectManagerFactory;
1314

@@ -104,6 +105,7 @@ public function getAllObjects()
104105
*
105106
* @param string[] $parserOutput primitive array output from the Magento parser
106107
* @return EntityDataObject[]
108+
* @throws XmlException
107109
*/
108110
private function processParserOutput($parserOutput)
109111
{

src/Magento/FunctionalTestingFramework/DataGenerator/Handlers/OperationDefinitionObjectHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Magento\FunctionalTestingFramework\DataGenerator\Objects\OperationElement;
1010
use Magento\FunctionalTestingFramework\DataGenerator\Parsers\OperationDefinitionParser;
1111
use Magento\FunctionalTestingFramework\DataGenerator\Util\OperationElementExtractor;
12+
use Magento\FunctionalTestingFramework\Exceptions\XmlException;
1213
use Magento\FunctionalTestingFramework\ObjectManager\ObjectHandlerInterface;
1314
use Magento\FunctionalTestingFramework\ObjectManagerFactory;
1415

@@ -125,6 +126,8 @@ public function getOperationDefinition($operation, $dataType)
125126
* into an array of objects.
126127
*
127128
* @return void
129+
* @throws \Exception
130+
*
128131
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
129132
* @SuppressWarnings(PHPMD.NPathComplexity)
130133
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)

src/Magento/FunctionalTestingFramework/DataGenerator/Objects/EntityDataObject.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function getDataByName($name, $uniquenessFormat)
152152
* @param string $uniqueData
153153
* @param string $uniqueDataFormat
154154
* @return null|string
155+
* @throws TestFrameworkException
155156
*/
156157
private function formatUniqueData($name, $uniqueData, $uniqueDataFormat)
157158
{

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/AdminExecutor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class AdminExecutor extends AbstractExecutor implements CurlInterface
5454
* @param bool $removeBackend
5555
*
5656
* @constructor
57+
* @throws TestFrameworkException
5758
*/
5859
public function __construct($removeBackend)
5960
{

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/FrontendExecutor.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class FrontendExecutor extends AbstractExecutor implements CurlInterface
6262
*
6363
* @param string $customerEmail
6464
* @param string $customerPassWord
65+
*
66+
* @throws TestFrameworkException
6567
*/
6668
public function __construct($customerEmail, $customerPassWord)
6769
{

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/Curl/WebapiExecutor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace Magento\FunctionalTestingFramework\DataGenerator\Persist\Curl;
88

9+
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
910
use Magento\FunctionalTestingFramework\Util\Protocol\CurlInterface;
1011
use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport;
1112

@@ -54,6 +55,7 @@ class WebapiExecutor extends AbstractExecutor implements CurlInterface
5455
* WebapiExecutor Constructor.
5556
*
5657
* @param string $storeCode
58+
* @throws TestFrameworkException
5759
*/
5860
public function __construct($storeCode = null)
5961
{
@@ -70,6 +72,7 @@ public function __construct($storeCode = null)
7072
* Returns the authorization token needed for some requests via REST call.
7173
*
7274
* @return void
75+
* @throws TestFrameworkException
7376
*/
7477
protected function authorize()
7578
{
@@ -94,6 +97,7 @@ protected function authorize()
9497
* @param string $method
9598
* @param array $headers
9699
* @return void
100+
* @throws TestFrameworkException
97101
*/
98102
public function write($url, $data = [], $method = CurlInterface::POST, $headers = [])
99103
{
@@ -111,6 +115,7 @@ public function write($url, $data = [], $method = CurlInterface::POST, $headers
111115
* @param string $successRegex
112116
* @param string $returnRegex
113117
* @return string
118+
* @throws TestFrameworkException
114119
*/
115120
public function read($successRegex = null, $returnRegex = null)
116121
{

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/CurlHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public function __construct($operation, $entityObject, $storeCode = null)
100100
* @param array $dependentEntities
101101
* @return array | null
102102
* @throws TestFrameworkException
103+
* @throws \Exception
103104
*/
104105
public function executeRequest($dependentEntities)
105106
{

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/DataPersistenceHandler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
1010
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\DataObjectHandler;
11+
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1112

1213
/**
1314
* Class DataPersistenceHandler
@@ -75,6 +76,7 @@ public function __construct($entityObject, $dependentObjects = [], $customFields
7576
*
7677
* @param string $storeCode
7778
* @return void
79+
* @throws TestFrameworkException
7880
*/
7981
public function createEntity($storeCode = null)
8082
{
@@ -97,6 +99,8 @@ public function createEntity($storeCode = null)
9799
* @param string $updateDataName
98100
* @param array $updateDependentObjects
99101
* @return void
102+
* @throws TestFrameworkException
103+
* @throws \Exception
100104
*/
101105

102106
public function updateEntity($updateDataName, $updateDependentObjects = [])
@@ -121,6 +125,7 @@ public function updateEntity($updateDataName, $updateDependentObjects = [])
121125
* @param integer|null $index
122126
* @param string $storeCode
123127
* @return void
128+
* @throws TestFrameworkException
124129
*/
125130

126131
public function getEntity($index = null, $storeCode = null)
@@ -142,6 +147,7 @@ public function getEntity($index = null, $storeCode = null)
142147
* Function which executes a delete request based on specific operation metadata
143148
*
144149
* @return void
150+
* @throws TestFrameworkException
145151
*/
146152
public function deleteEntity()
147153
{
@@ -163,6 +169,7 @@ public function getCreatedObject()
163169
* Returns a specific data value based on the CreatedObject's definition.
164170
* @param string $dataName
165171
* @return string
172+
* @throws TestFrameworkException
166173
*/
167174
public function getCreatedDataByName($dataName)
168175
{

src/Magento/FunctionalTestingFramework/DataGenerator/Persist/OperationDataArrayResolver.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Magento\FunctionalTestingFramework\DataGenerator\Objects\EntityDataObject;
1212
use Magento\FunctionalTestingFramework\DataGenerator\Objects\OperationElement;
1313
use Magento\FunctionalTestingFramework\DataGenerator\Util\OperationElementExtractor;
14+
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1415

1516
class OperationDataArrayResolver
1617
{
@@ -174,6 +175,7 @@ public function resolveOperationDataArray($entityObject, $operationMetadata, $op
174175
* @param string $operationKey
175176
* @param string $operationElementType
176177
* @return array|string
178+
* @throws TestFrameworkException
177179
*/
178180
private function resolvePrimitiveReference($entityObject, $operationKey, $operationElementType)
179181
{
@@ -234,6 +236,7 @@ private function getDependentEntitiesOfType($type)
234236
* @param EntityDataObject $entityObject
235237
* @param string $operationElementValue
236238
* @return EntityDataObject|null
239+
* @throws \Exception
237240
*/
238241
private function resolveOperationObjectAndEntityData($entityObject, $operationElementValue)
239242
{
@@ -258,6 +261,7 @@ private function resolveOperationObjectAndEntityData($entityObject, $operationEl
258261
* @param string $operation
259262
* @param bool $fromArray
260263
* @return array
264+
* @throws \Exception
261265
*/
262266
private function resolveNonPrimitiveElement($entityName, $operationElement, $operation, $fromArray = false)
263267
{
@@ -290,6 +294,7 @@ private function resolveNonPrimitiveElement($entityName, $operationElement, $ope
290294
*
291295
* @param string $entityName
292296
* @return EntityDataObject
297+
* @throws \Exception
293298
*/
294299
private function resolveLinkedEntityObject($entityName)
295300
{

src/Magento/FunctionalTestingFramework/Page/Handlers/PageObjectHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class PageObjectHandler implements ObjectHandlerInterface
3838

3939
/**
4040
* Private constructor
41+
*
42+
* @throws XmlException
4143
*/
4244
private function __construct()
4345
{
@@ -74,6 +76,7 @@ private function __construct()
7476
* Singleton method to return PageObjectHandler.
7577
*
7678
* @return PageObjectHandler
79+
* @throws XmlException
7780
*/
7881
public static function getInstance()
7982
{

0 commit comments

Comments
 (0)