Skip to content
This repository has been archived by the owner on Mar 29, 2023. It is now read-only.

Commit

Permalink
Update cs and when to check it
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwurtz committed Oct 17, 2018
1 parent 4b6db81 commit dbe7b63
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function execute(InputInterface $input, OutputInterface $output)

$options = require $configFile;

if (!is_array($options)) {
if (!\is_array($options)) {
throw new \RuntimeException(sprintf('Invalid config file specified or invalid return type in file %s', $configFile));
}

Expand Down
2 changes: 1 addition & 1 deletion Generator/EndpointGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ private function getGetBody(Operation $operation, Context $context): Stmt\ClassM
$isSerializableBody = false;
$isFormBody = false;
$hasFileInForm = false;
$consumes = is_array($operation->getOperation()->getConsumes()) ? $operation->getOperation()->getConsumes() : [$operation->getOperation()->getConsumes()];
$consumes = \is_array($operation->getOperation()->getConsumes()) ? $operation->getOperation()->getConsumes() : [$operation->getOperation()->getConsumes()];

foreach ($operation->getParameters() as $key => $parameter) {
if ($parameter instanceof BodyParameter && $parameter->getSchema() !== null) {
Expand Down
2 changes: 1 addition & 1 deletion Generator/Psr7HttplugClientGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private function getHttpClientCreateExpr(Context $context)
if (null !== $openApi->getHost()) {
$scheme = 'https';

if (null !== $openApi->getSchemes() && count($openApi->getSchemes()) > 0 && !in_array('https', $openApi->getSchemes())) {
if (null !== $openApi->getSchemes() && \count($openApi->getSchemes()) > 0 && !\in_array('https', $openApi->getSchemes())) {
$scheme = $openApi->getSchemes()[0];
}

Expand Down
2 changes: 1 addition & 1 deletion Guesser/OpenApiSchema/AdditionalPropertiesGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function supportObject($object)
return false;
}

if (true !== $object->getAdditionalProperties() && !is_object($object->getAdditionalProperties())) {
if (true !== $object->getAdditionalProperties() && !\is_object($object->getAdditionalProperties())) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion Guesser/OpenApiSchema/AllOfGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class AllOfGuesser extends BaseAllOfGuesser
*/
public function supportObject($object)
{
return ($object instanceof Schema) && is_array($object->getAllOf()) && count($object->getAllOf()) > 0;
return ($object instanceof Schema) && \is_array($object->getAllOf()) && \count($object->getAllOf()) > 0;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions Guesser/OpenApiSchema/ItemsGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function supportObject($object)
$object->getItems() instanceof Schema
||
(
is_array($object->getItems())
\is_array($object->getItems())
&&
count($object->getItems()) > 0
\count($object->getItems()) > 0
)
)
;
Expand Down
2 changes: 1 addition & 1 deletion Guesser/OpenApiSchema/MultipleGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ class MultipleGuesser extends BaseMultipleGuesser
*/
public function supportObject($object)
{
return ($object instanceof Schema) && is_array($object->getType());
return ($object instanceof Schema) && \is_array($object->getType());
}
}
4 changes: 2 additions & 2 deletions Guesser/OpenApiSchema/SimpleTypeGuesser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public function supportObject($object)
{
return ($object instanceof Schema)
&&
in_array($object->getType(), $this->typesSupported)
\in_array($object->getType(), $this->typesSupported)
&&
!in_array($object->getFormat(), $this->excludeFormat)
!\in_array($object->getFormat(), $this->excludeFormat)
;
}
}
4 changes: 2 additions & 2 deletions Naming/OperationUrlNaming.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ function ($match) {
}
} else {
$methodNameParts[] = ucfirst($part);
$lastNonParameterPartIndex = count($methodNameParts) - 1;
$lastNonParameterPartIndex = \count($methodNameParts) - 1;
}
}

if ($shouldSingularize && count($methodNameParts) > 0) {
if ($shouldSingularize && \count($methodNameParts) > 0) {
$methodNameParts[$lastNonParameterPartIndex] = Inflector::singularize($methodNameParts[$lastNonParameterPartIndex]);
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/JaneOpenApiResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testRessources($name, SplFileInfo $testDirectory)

$generatedData = [];

$this->assertEquals(count($expectedFinder), count($generatedFinder), 'Assert same files for ' . $testDirectory->getRealPath());
$this->assertEquals(\count($expectedFinder), \count($generatedFinder), 'Assert same files for ' . $testDirectory->getRealPath());

foreach ($generatedFinder as $generatedFile) {
$generatedData[$generatedFile->getRelativePathname()] = $generatedFile->getRealPath();
Expand Down

0 comments on commit dbe7b63

Please sign in to comment.