Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c370ca

Browse files
committed
Update to PHP CS Fixer 2
1 parent 5edb751 commit 1c370ca

114 files changed

Lines changed: 271 additions & 280 deletions

File tree

Some content is hidden

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

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
.php_cs.cache
2-
composer.phar
3-
composer.lock
4-
phpunit.xml
1+
/.php_cs.cache
2+
/.php_cs
3+
/composer.phar
4+
/composer.lock
5+
/phpunit.xml
56
/vendor/
67
/tests/Fixtures/app/cache/*
78
/tests/Fixtures/app/logs/*

.php_cs

Lines changed: 0 additions & 18 deletions
This file was deleted.

.php_cs.dist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__)
5+
->exclude('tests/Fixtures/app/cache')
6+
;
7+
8+
return PhpCsFixer\Config::create()
9+
->setRules([
10+
'@Symfony' => true,
11+
'ordered_imports' => true,
12+
'phpdoc_order' => true,
13+
'short_array_syntax' => true,
14+
])
15+
->setFinder($finder)
16+
;

features/bootstrap/CoverageContext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function tearDown()
4848
$writer->process(self::$coverage, __DIR__.'/../../build/cov/coverage-behat.cov');
4949
}
5050

51-
private function getCoverageKeyFromScope(BeforeScenarioScope $scope) : string
51+
private function getCoverageKeyFromScope(BeforeScenarioScope $scope): string
5252
{
5353
return sprintf('%s::%s', $scope->getFeature()->getTitle(), $scope->getScenario()->getTitle());
5454
}

features/bootstrap/SwaggerContext.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public function assertPropertyIsRequired(string $propertyName, string $className
137137
}
138138
}
139139

140-
private function getProperty(string $propertyName, string $className) : stdClass
140+
private function getProperty(string $propertyName, string $className): stdClass
141141
{
142142
$properties = $this->getProperties($className);
143143
$propertyInfos = null;
@@ -160,7 +160,7 @@ private function getProperty(string $propertyName, string $className) : stdClass
160160
*
161161
* @return array | stdClass
162162
*/
163-
private function getOperation(string $method, string $className) : stdClass
163+
private function getOperation(string $method, string $className): stdClass
164164
{
165165
foreach ($this->getOperations($className) as $classMethod => $operation) {
166166
if ($classMethod === $method) {
@@ -174,7 +174,7 @@ private function getOperation(string $method, string $className) : stdClass
174174
/**
175175
* Gets all operations of a given class.
176176
*/
177-
private function getOperations(string $className) : stdClass
177+
private function getOperations(string $className): stdClass
178178
{
179179
$classInfos = $this->getClassInfos($className);
180180

@@ -184,14 +184,14 @@ private function getOperations(string $className) : stdClass
184184
/**
185185
* Gets all properties of a given class.
186186
*/
187-
private function getProperties(string $className) : stdClass
187+
private function getProperties(string $className): stdClass
188188
{
189189
$classInfos = $this->getClassInfos($className);
190190

191191
return $classInfos->{'properties'} ?? new stdClass();
192192
}
193193

194-
private function getClassInfos(string $className) : stdClass
194+
private function getClassInfos(string $className): stdClass
195195
{
196196
$json = $this->getLastJsonResponse();
197197
$classInfos = null;
@@ -209,7 +209,7 @@ private function getClassInfos(string $className) : stdClass
209209
return $classInfos;
210210
}
211211

212-
private function getLastJsonResponse() : stdClass
212+
private function getLastJsonResponse(): stdClass
213213
{
214214
$content = $this->restContext->getMink()->getSession()->getDriver()->getContent();
215215
if (null === ($decoded = json_decode($content))) {

src/Action/EntrypointAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(ResourceNameCollectionFactoryInterface $resourceName
2828
$this->resourceNameCollectionFactory = $resourceNameCollectionFactory;
2929
}
3030

31-
public function __invoke() : Entrypoint
31+
public function __invoke(): Entrypoint
3232
{
3333
return new Entrypoint($this->resourceNameCollectionFactory->create());
3434
}

src/Action/ExceptionAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct(SerializerInterface $serializer, array $errorFormats
6363
*
6464
* @return Response
6565
*/
66-
public function __invoke(FlattenException $exception, Request $request) : Response
66+
public function __invoke(FlattenException $exception, Request $request): Response
6767
{
6868
$exceptionClass = $exception->getClass();
6969
foreach ($this->exceptionToStatus as $class => $status) {

src/Api/Entrypoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(ResourceNameCollection $resourceNameCollection)
2727
$this->resourceNameCollection = $resourceNameCollection;
2828
}
2929

30-
public function getResourceNameCollection() : ResourceNameCollection
30+
public function getResourceNameCollection(): ResourceNameCollection
3131
{
3232
return $this->resourceNameCollection;
3333
}

src/Api/FilterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ interface FilterInterface
3333
*
3434
* @return array
3535
*/
36-
public function getDescription(string $resourceClass) : array;
36+
public function getDescription(string $resourceClass): array;
3737
}

src/Api/IriConverterInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function getItemFromIri(string $iri, array $context = []);
4444
*
4545
* @return string
4646
*/
47-
public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface::ABS_PATH) : string;
47+
public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
4848

4949
/**
5050
* Gets the IRI associated with the given resource collection.
@@ -56,5 +56,5 @@ public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface
5656
*
5757
* @return string
5858
*/
59-
public function getIriFromResourceClass(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH) : string;
59+
public function getIriFromResourceClass(string $resourceClass, int $referenceType = UrlGeneratorInterface::ABS_PATH): string;
6060
}

0 commit comments

Comments
 (0)