Skip to content

Commit a495029

Browse files
authored
laminas/laminas-coding-standard:^3.0 + Apply code style (#175)
--------- Signed-off-by: fezfez <[email protected]>
1 parent 53ba28b commit a495029

File tree

170 files changed

+2009
-1700
lines changed

Some content is hidden

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

170 files changed

+2009
-1700
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"laminas/laminas-view": "^2.18.0"
4040
},
4141
"require-dev": {
42-
"laminas/laminas-coding-standard": "^2.5.0",
43-
"laminas/laminas-json": "^3.6",
42+
"laminas/laminas-coding-standard": "^3.0.1",
43+
"laminas/laminas-json": "^3.7",
4444
"phpunit/phpunit": "^10.5.38",
4545
"webmozart/assert": "^1.11"
4646
},

composer.lock

+55-48
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
<?xml version="1.0"?>
2-
<ruleset name="Laminas coding standard">
3-
<!-- inherit rules from: -->
4-
<rule ref="PSR2"/>
5-
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
6-
<rule ref="Generic.Formatting.SpaceAfterNot"/>
7-
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
8-
<properties>
9-
<property name="ignoreNewlines" value="true"/>
10-
</properties>
11-
</rule>
12-
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
13-
<properties>
14-
<property name="ignoreBlankLines" value="false"/>
15-
</properties>
16-
</rule>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
4+
5+
<arg name="basepath" value="."/>
6+
<arg name="cache" value=".phpcs-cache"/>
7+
<arg name="colors"/>
8+
<arg name="extensions" value="php"/>
9+
<arg name="parallel" value="80"/>
10+
11+
<!-- Show progress -->
12+
<arg value="ps"/>
1713

1814
<!-- Paths to check -->
1915
<file>src</file>
2016
<file>test</file>
17+
18+
<!-- Include all rules from the Laminas Coding Standard -->
19+
<rule ref="LaminasCodingStandard"/>
20+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
21+
<exclude-pattern>src/</exclude-pattern>
22+
</rule>
23+
<rule ref="WebimpressCodingStandard.PHP.CorrectClassNameCase.Invalid">
24+
<exclude-pattern>test/_autoload.php</exclude-pattern>
25+
</rule>
2126
</ruleset>

src/Application.php

+11-19
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
namespace Laminas\Mvc;
44

5-
use Laminas\Mvc\Service\ServiceManagerConfig;
65
use Laminas\EventManager\EventManagerAwareInterface;
76
use Laminas\EventManager\EventManagerInterface;
7+
use Laminas\Mvc\Service\ServiceManagerConfig;
88
use Laminas\ServiceManager\ServiceManager;
99
use Laminas\Stdlib\RequestInterface;
1010
use Laminas\Stdlib\ResponseInterface;
1111

12+
use function array_merge;
13+
use function array_unique;
14+
1215
/**
1316
* Main application class for invoking applications
1417
*
@@ -66,31 +69,22 @@ class Application implements
6669

6770
/**
6871
* MVC event token
72+
*
6973
* @var MvcEvent
7074
*/
7175
protected $event;
7276

73-
/**
74-
* @var EventManagerInterface
75-
*/
77+
/** @var EventManagerInterface */
7678
protected $events;
7779

78-
/**
79-
* @var RequestInterface
80-
*/
80+
/** @var RequestInterface */
8181
protected $request;
8282

83-
/**
84-
* @var ResponseInterface
85-
*/
83+
/** @var ResponseInterface */
8684
protected $response;
8785

8886
/**
8987
* Constructor
90-
*
91-
* @param null|EventManagerInterface $events
92-
* @param null|RequestInterface $request
93-
* @param null|ResponseInterface $response
9488
*/
9589
public function __construct(
9690
protected ServiceManager $serviceManager,
@@ -99,8 +93,8 @@ public function __construct(
9993
?ResponseInterface $response = null
10094
) {
10195
$this->setEventManager($events ?: $serviceManager->get('EventManager'));
102-
$this->request = $request ?: $serviceManager->get('Request');
103-
$this->response = $response ?: $serviceManager->get('Response');
96+
$this->request = $request ?: $serviceManager->get('Request');
97+
$this->response = $response ?: $serviceManager->get('Response');
10498
}
10599

106100
/**
@@ -193,7 +187,6 @@ public function getMvcEvent()
193187
/**
194188
* Set the event manager instance
195189
*
196-
* @param EventManagerInterface $eventManager
197190
* @return Application
198191
*/
199192
public function setEventManager(EventManagerInterface $eventManager)
@@ -282,7 +275,7 @@ public function run()
282275
$event = $this->event;
283276

284277
// Define callback used to determine whether or not to short-circuit
285-
$shortCircuit = static function ($r) use ($event) : bool {
278+
$shortCircuit = static function ($r) use ($event): bool {
286279
if ($r instanceof ResponseInterface) {
287280
return true;
288281
}
@@ -341,7 +334,6 @@ public function run()
341334
* Triggers "render" and "finish" events, and returns response from
342335
* event object.
343336
*
344-
* @param MvcEvent $event
345337
* @return Application
346338
*/
347339
protected function completeRequest(MvcEvent $event)

0 commit comments

Comments
 (0)