Skip to content

Commit e8fa49f

Browse files
committed
Add use statements for all classes
1 parent b71dd52 commit e8fa49f

File tree

155 files changed

+1271
-891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+1271
-891
lines changed

Action/ActionInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
namespace Payum\Core\Action;
44

5+
use Payum\Core\Exception\RequestNotSupportedException;
6+
57
interface ActionInterface
68
{
79
/**
810
* @param mixed $request
911
*
10-
* @throws \Payum\Core\Exception\RequestNotSupportedException if the action dose not support the request.
12+
* @throws RequestNotSupportedException if the action dose not support the request.
1113
*/
1214
public function execute($request);
1315

Bridge/Doctrine/Storage/DoctrineStorage.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
namespace Payum\Core\Bridge\Doctrine\Storage;
44

55
use Doctrine\Persistence\ObjectManager;
6+
use LogicException;
67
use Payum\Core\Model\Identity;
78
use Payum\Core\Storage\AbstractStorage;
89

910
class DoctrineStorage extends AbstractStorage
1011
{
1112
/**
12-
* @var \Doctrine\Persistence\ObjectManager
13+
* @var ObjectManager
1314
*/
1415
protected $objectManager;
1516

@@ -50,7 +51,7 @@ protected function doGetIdentity($model)
5051
$modelMetadata = $this->objectManager->getClassMetadata(get_class($model));
5152
$id = $modelMetadata->getIdentifierValues($model);
5253
if (count($id) > 1) {
53-
throw new \LogicException('Storage not support composite primary ids');
54+
throw new LogicException('Storage not support composite primary ids');
5455
}
5556

5657
return new Identity(array_shift($id), $model);

Bridge/Doctrine/Types/ObjectType.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Payum\Core\Bridge\Doctrine\Types;
44

55
use Doctrine\ODM\MongoDB\Types\Type;
6+
use LogicException;
67

78
/**
89
* Used as a workaround till I (or you?) found out how to store object to mongo.
@@ -30,7 +31,7 @@ public function convertToPHPValue($value)
3031
$value = (is_resource($value)) ? stream_get_contents($value) : $value;
3132
$val = unserialize($value);
3233
if (false === $val && 'b:0;' !== $value) {
33-
throw new \LogicException('Conversion exception: ' . $value . '. ' . $this->getName());
34+
throw new LogicException('Conversion exception: ' . $value . '. ' . $this->getName());
3435
}
3536

3637
return $val;

Bridge/Guzzle/HttpClientFactory.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Payum\Core\Bridge\Guzzle;
44

55
use GuzzleHttp\Client;
6+
use GuzzleHttp\ClientInterface;
7+
use LogicException;
68
use Payum\Core\HttpClientInterface;
79

810
/**
@@ -13,19 +15,19 @@ class HttpClientFactory
1315
/**
1416
* Create a Guzzle client.
1517
*
16-
* @return \GuzzleHttp\Client
18+
* @return Client
1719
*/
1820
public static function createGuzzle()
1921
{
2022
$client = null;
2123
if (! class_exists(Client::class)) {
2224
@trigger_error('The function "HttpClientFactory::createGuzzle" is depcrecated and will be removed in 2.0.', E_USER_DEPRECATED);
23-
throw new \LogicException('Can not use "HttpClientFactory::createGuzzle" since Guzzle is not installed. This function is deprecated and will be removed in 2.0.');
25+
throw new LogicException('Can not use "HttpClientFactory::createGuzzle" since Guzzle is not installed. This function is deprecated and will be removed in 2.0.');
2426
}
2527

26-
$version = \GuzzleHttp\ClientInterface::VERSION;
28+
$version = ClientInterface::VERSION;
2729
if ('6' !== substr($version, 0, 1)) {
28-
throw new \LogicException('This version of Guzzle is not supported.');
30+
throw new LogicException('This version of Guzzle is not supported.');
2931
}
3032

3133
$curl = curl_version();
@@ -34,7 +36,7 @@ public static function createGuzzle()
3436
CURLOPT_USERAGENT => sprintf('Payum/1.x curl/%s PHP/%s', $curl['version'], PHP_VERSION),
3537
];
3638

37-
return new \GuzzleHttp\Client([
39+
return new Client([
3840
'curl' => $curlOptions,
3941
]);
4042
}

Bridge/Laminas/Storage/TableGatewayStorage.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace Payum\Core\Bridge\Laminas\Storage;
44

5+
use InvalidArgumentException;
56
use Laminas\Db\TableGateway\TableGateway as LaminasTableGateway;
67
use Payum\Core\Exception\LogicException;
78
use Payum\Core\Model\Identity;
89
use Payum\Core\Storage\AbstractStorage;
10+
use ReflectionProperty;
911
use Zend\Db\TableGateway\TableGateway as ZendTableGateway;
1012

1113
/**
@@ -70,7 +72,7 @@ public function __construct($tableGateway, $modelClass, $idField = 'id')
7072
@trigger_error(sprintf('Passing an instance of %s as the first argument to %s is deprecated and won\'t be supported in 2.0. Please using Laminas instead.', ZendTableGateway::class, self::class));
7173
$this->tableGateway = $tableGateway;
7274
} else {
73-
throw new \InvalidArgumentException(sprintf('Argument $tableGateway of %s must be an instance of %s or %s, %s given.', self::class, LaminasTableGateway::class, ZendTableGateway::class, (is_object($tableGateway) ? get_class($tableGateway) : gettype($tableGateway))));
75+
throw new InvalidArgumentException(sprintf('Argument $tableGateway of %s must be an instance of %s or %s, %s given.', self::class, LaminasTableGateway::class, ZendTableGateway::class, (is_object($tableGateway) ? get_class($tableGateway) : gettype($tableGateway))));
7476
}
7577

7678
$this->idField = $idField;
@@ -127,7 +129,7 @@ protected function doGetIdentity($model)
127129
*/
128130
protected function getModelId($model)
129131
{
130-
$rp = new \ReflectionProperty($model, $this->idField);
132+
$rp = new ReflectionProperty($model, $this->idField);
131133
$rp->setAccessible(true);
132134
$id = $rp->getValue($model);
133135
$rp->setAccessible(false);

Bridge/PlainPhp/Security/HttpRequestVerifier.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class HttpRequestVerifier implements HttpRequestVerifierInterface
1212
{
1313
/**
14-
* @var \Payum\Core\Storage\StorageInterface
14+
* @var StorageInterface
1515
*/
1616
protected $tokenStorage;
1717

Bridge/Spl/ArrayObject.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22

33
namespace Payum\Core\Bridge\Spl;
44

5+
use ArrayAccess;
6+
use ArrayIterator;
57
use Payum\Core\Exception\InvalidArgumentException;
68
use Payum\Core\Exception\LogicException;
79
use Payum\Core\Security\SensitiveValue;
10+
use ReturnTypeWillChange;
11+
use Traversable;
812

913
class ArrayObject extends \ArrayObject
1014
{
1115
protected $input;
1216

13-
public function __construct($input = [], $flags = 0, $iterator_class = \ArrayIterator::class)
17+
public function __construct($input = [], $flags = 0, $iterator_class = ArrayIterator::class)
1418
{
15-
if ($input instanceof \ArrayAccess && false == $input instanceof \ArrayObject) {
19+
if ($input instanceof ArrayAccess && false == $input instanceof \ArrayObject) {
1620
$this->input = $input;
1721

18-
if (false == $input instanceof \Traversable) {
22+
if (false == $input instanceof Traversable) {
1923
throw new LogicException('Traversable interface must be implemented in case custom ArrayAccess instance given. It is because some php limitations.');
2024
}
2125

@@ -48,9 +52,9 @@ public function getArray($key, $default = [])
4852
}
4953

5054
/**
51-
* @param array|\Traversable $input
55+
* @param array|Traversable $input
5256
*
53-
* @throws \Payum\Core\Exception\InvalidArgumentException
57+
* @throws InvalidArgumentException
5458
*/
5559
public function replace($input)
5660
{
@@ -64,9 +68,9 @@ public function replace($input)
6468
}
6569

6670
/**
67-
* @param array|\Traversable $input
71+
* @param array|Traversable $input
6872
*
69-
* @throws \Payum\Core\Exception\InvalidArgumentException
73+
* @throws InvalidArgumentException
7074
*/
7175
public function defaults($input)
7276
{
@@ -118,7 +122,7 @@ public function validateNotEmpty($required, $throwOnInvalid = true)
118122
* @param array $required
119123
* @param boolean $throwOnInvalid
120124
*
121-
* @throws \Payum\Core\Exception\LogicException when one of the required fields present
125+
* @throws LogicException when one of the required fields present
122126
*
123127
* @return bool
124128
*/
@@ -142,7 +146,7 @@ public function validatedKeysSet($required, $throwOnInvalid = true)
142146
/**
143147
* {@inheritDoc}
144148
*/
145-
#[\ReturnTypeWillChange]
149+
#[ReturnTypeWillChange]
146150
public function offsetSet($index, $value)
147151
{
148152
if ($this->input) {
@@ -155,7 +159,7 @@ public function offsetSet($index, $value)
155159
/**
156160
* {@inheritDoc}
157161
*/
158-
#[\ReturnTypeWillChange]
162+
#[ReturnTypeWillChange]
159163
public function offsetUnset($index)
160164
{
161165
if ($this->input) {
@@ -171,7 +175,7 @@ public function offsetUnset($index)
171175
*
172176
* {@inheritDoc}
173177
*/
174-
#[\ReturnTypeWillChange]
178+
#[ReturnTypeWillChange]
175179
public function offsetGet($index)
176180
{
177181
if ($this->offsetExists($index)) {

Bridge/Symfony/Action/RenderTemplateAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(EngineInterface $templating, $layout = null)
2828
/**
2929
* @param mixed $request
3030
*
31-
* @throws \Payum\Core\Exception\RequestNotSupportedException if the action dose not support the request.
31+
* @throws RequestNotSupportedException if the action dose not support the request.
3232
*/
3333
public function execute($request)
3434
{

Bridge/Symfony/Reply/HttpResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class HttpResponse extends Base
99
{
1010
/**
11-
* @var \Symfony\Component\HttpFoundation\Response
11+
* @var Response
1212
*/
1313
protected $response;
1414

@@ -18,7 +18,7 @@ public function __construct(Response $response)
1818
}
1919

2020
/**
21-
* @return \Symfony\Component\HttpFoundation\Response
21+
* @return Response
2222
*/
2323
public function getResponse()
2424
{

Bridge/Symfony/ReplyToSymfonyResponseConverter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Payum\Core\Exception\LogicException;
77
use Payum\Core\Reply\HttpResponse;
88
use Payum\Core\Reply\ReplyInterface;
9+
use ReflectionObject;
910
use Symfony\Component\HttpFoundation\Response;
1011

1112
class ReplyToSymfonyResponseConverter
@@ -24,7 +25,7 @@ public function convert(ReplyInterface $reply)
2425
return new Response($reply->getContent(), $reply->getStatusCode(), $headers);
2526
}
2627

27-
$ro = new \ReflectionObject($reply);
28+
$ro = new ReflectionObject($reply);
2829

2930
throw new LogicException(
3031
sprintf('Cannot convert reply %s to http response.', $ro->getShortName()),

0 commit comments

Comments
 (0)