Skip to content

Commit 790f775

Browse files
committed
qa: apply laminas-coding-standard rules
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
1 parent 04d798c commit 790f775

21 files changed

+564
-714
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.phpcs-cache
12
/clover.xml
23
/coveralls-upload.json
34
/phpunit.xml

config/module.config.php

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
<?php
22

3-
/**
4-
* @see https://github.com/laminas-api-tools/api-tools-documentation for the canonical source repository
5-
* @copyright https://github.com/laminas-api-tools/api-tools-documentation/blob/master/COPYRIGHT.md
6-
* @license https://github.com/laminas-api-tools/api-tools-documentation/blob/master/LICENSE.md New BSD License
7-
*/
8-
93
namespace Laminas\ApiTools\Documentation;
104

115
use Laminas\ServiceManager\Factory\InvokableFactory;
126
use Laminas\View\Model\ViewModel;
7+
use ZF\Apigility\Documentation\View\AgAcceptHeaders;
8+
use ZF\Apigility\Documentation\View\AgContentTypeHeaders;
9+
use ZF\Apigility\Documentation\View\AgServicePath;
10+
use ZF\Apigility\Documentation\View\AgStatusCodes;
11+
use ZF\Apigility\Documentation\View\AgTransformDescription;
1312

1413
return [
15-
'router' => [
14+
'router' => [
1615
'routes' => [
1716
'api-tools' => [
1817
'child_routes' => [
1918
'documentation' => [
20-
'type' => 'segment',
19+
'type' => 'segment',
2120
'options' => [
22-
'route' => '/documentation[/:api[-v:version][/:service]]',
21+
'route' => '/documentation[/:api[-v:version][/:service]]',
2322
'constraints' => [
2423
'api' => '[a-zA-Z][a-zA-Z0-9_.%]+',
2524
],
26-
'defaults' => [
25+
'defaults' => [
2726
'controller' => Controller::class,
2827
'action' => 'show',
2928
],
@@ -33,26 +32,26 @@
3332
],
3433
],
3534
],
36-
'service_manager' => [
35+
'service_manager' => [
3736
// Legacy Zend Framework aliases
38-
'aliases' => [
37+
'aliases' => [
3938
\ZF\Apigility\Documentation\ApiFactory::class => ApiFactory::class,
4039
],
4140
'factories' => [
4241
ApiFactory::class => Factory\ApiFactoryFactory::class,
4342
],
4443
],
45-
'controllers' => [
44+
'controllers' => [
4645
// Legacy Zend Framework aliases
47-
'aliases' => [
46+
'aliases' => [
4847
\ZF\Apigility\Documentation\Controller::class => Controller::class,
4948
],
5049
'factories' => [
5150
Controller::class => ControllerFactory::class,
5251
],
5352
],
5453
'api-tools-content-negotiation' => [
55-
'controllers' => [
54+
'controllers' => [
5655
Controller::class => 'Documentation',
5756
],
5857
'accept_whitelist' => [
@@ -61,7 +60,7 @@
6160
1 => 'application/json',
6261
],
6362
],
64-
'selectors' => [
63+
'selectors' => [
6564
'Documentation' => [
6665
ViewModel::class => [
6766
'text/html',
@@ -73,25 +72,25 @@
7372
],
7473
],
7574
],
76-
'view_helpers' => [
77-
'aliases' => [
78-
'agacceptheaders' => View\AgAcceptHeaders::class,
79-
'agAcceptHeaders' => View\AgAcceptHeaders::class,
80-
'agcontenttypeheaders' => View\AgContentTypeHeaders::class,
81-
'agContentTypeHeaders' => View\AgContentTypeHeaders::class,
82-
'agservicepath' => View\AgServicePath::class,
83-
'agServicePath' => View\AgServicePath::class,
84-
'agstatuscodes' => View\AgStatusCodes::class,
85-
'agStatusCodes' => View\AgStatusCodes::class,
86-
'agtransformdescription' => View\AgTransformDescription::class,
87-
'agTransformDescription' => View\AgTransformDescription::class,
75+
'view_helpers' => [
76+
'aliases' => [
77+
'agacceptheaders' => View\AgAcceptHeaders::class,
78+
'agAcceptHeaders' => View\AgAcceptHeaders::class,
79+
'agcontenttypeheaders' => View\AgContentTypeHeaders::class,
80+
'agContentTypeHeaders' => View\AgContentTypeHeaders::class,
81+
'agservicepath' => View\AgServicePath::class,
82+
'agServicePath' => View\AgServicePath::class,
83+
'agstatuscodes' => View\AgStatusCodes::class,
84+
'agStatusCodes' => View\AgStatusCodes::class,
85+
'agtransformdescription' => View\AgTransformDescription::class,
86+
'agTransformDescription' => View\AgTransformDescription::class,
8887

8988
// Legacy Zend Framework aliases
90-
\ZF\Apigility\Documentation\View\AgAcceptHeaders::class => View\AgAcceptHeaders::class,
91-
\ZF\Apigility\Documentation\View\AgContentTypeHeaders::class => View\AgContentTypeHeaders::class,
92-
\ZF\Apigility\Documentation\View\AgServicePath::class => View\AgServicePath::class,
93-
\ZF\Apigility\Documentation\View\AgStatusCodes::class => View\AgStatusCodes::class,
94-
\ZF\Apigility\Documentation\View\AgTransformDescription::class => View\AgTransformDescription::class,
89+
AgAcceptHeaders::class => View\AgAcceptHeaders::class,
90+
AgContentTypeHeaders::class => View\AgContentTypeHeaders::class,
91+
AgServicePath::class => View\AgServicePath::class,
92+
AgStatusCodes::class => View\AgStatusCodes::class,
93+
AgTransformDescription::class => View\AgTransformDescription::class,
9594
],
9695
'factories' => [
9796
View\AgAcceptHeaders::class => InvokableFactory::class,
@@ -101,7 +100,7 @@
101100
View\AgTransformDescription::class => InvokableFactory::class,
102101
],
103102
],
104-
'view_manager' => [
103+
'view_manager' => [
105104
'template_path_stack' => [
106105
__DIR__ . '/../view',
107106
],

src/Api.php

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<?php
22

3-
/**
4-
* @see https://github.com/laminas-api-tools/api-tools-documentation for the canonical source repository
5-
* @copyright https://github.com/laminas-api-tools/api-tools-documentation/blob/master/COPYRIGHT.md
6-
* @license https://github.com/laminas-api-tools/api-tools-documentation/blob/master/LICENSE.md New BSD License
7-
*/
8-
93
namespace Laminas\ApiTools\Documentation;
104

115
use ArrayIterator;
@@ -15,24 +9,16 @@
159

1610
class Api implements IteratorAggregate
1711
{
18-
/**
19-
* @var string
20-
*/
12+
/** @var string */
2113
protected $name;
2214

23-
/**
24-
* @var int|string
25-
*/
15+
/** @var int|string */
2616
protected $version = 1;
2717

28-
/**
29-
* @var array
30-
*/
18+
/** @var array */
3119
protected $authorization;
3220

33-
/**
34-
* @var Service[]
35-
*/
21+
/** @var Service[] */
3622
protected $services = [];
3723

3824
/**
@@ -83,9 +69,6 @@ public function getAuthorization()
8369
return $this->authorization;
8470
}
8571

86-
/**
87-
* @param Service $service
88-
*/
8972
public function addService(Service $service)
9073
{
9174
$this->services[] = $service;
@@ -109,7 +92,7 @@ public function toArray()
10992
$array = [
11093
'name' => $this->name,
11194
'version' => $this->version,
112-
'services' => []
95+
'services' => [],
11396
];
11497
foreach ($this->services as $i => $service) {
11598
$array['services'][$i] = $service->toArray();

0 commit comments

Comments
 (0)