Skip to content

Commit 4cf9522

Browse files
committed
CS fix
1 parent 894928d commit 4cf9522

17 files changed

+50
-49
lines changed

src/Command/ExtractCardinalitiesCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
use ApiPlatform\SchemaGenerator\CardinalitiesExtractor;
1717
use ApiPlatform\SchemaGenerator\GoodRelationsBridge;
18-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
1918
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
19+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2020
use Symfony\Component\Console\Command\Command;
2121
use Symfony\Component\Console\Input\InputInterface;
2222
use Symfony\Component\Console\Input\InputOption;

src/Schema/Generator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use ApiPlatform\SchemaGenerator\GoodRelationsBridge;
1919
use ApiPlatform\SchemaGenerator\PhpTypeConverter;
2020
use ApiPlatform\SchemaGenerator\Printer;
21+
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2122
use ApiPlatform\SchemaGenerator\TwigBuilder;
2223
use ApiPlatform\SchemaGenerator\TypesGenerator;
23-
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2424
use Symfony\Component\Console\Logger\ConsoleLogger;
2525
use Symfony\Component\Console\Output\OutputInterface;
2626
use Symfony\Component\Console\Style\SymfonyStyle;

src/Schema/PropertyGenerator/PropertyGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
use ApiPlatform\SchemaGenerator\PropertyGenerator\PropertyGeneratorInterface;
2424
use ApiPlatform\SchemaGenerator\Schema\Model\Property as SchemaProperty;
2525
use ApiPlatform\SchemaGenerator\Schema\Model\Type\PrimitiveType;
26-
use ApiPlatform\SchemaGenerator\Schema\TypeConverter;
2726
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
27+
use ApiPlatform\SchemaGenerator\Schema\TypeConverter;
2828
use Psr\Log\LoggerAwareTrait;
2929

3030
final class PropertyGenerator implements PropertyGeneratorInterface

src/Schema/Rdf/RdfResource.php

+11-10
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class RdfResource implements \ArrayAccess
4141
*
4242
* @param EasyRdfGraph|RdfGraph|null $graph
4343
*/
44-
public function __construct(?string $uri, $graph = null, ?EasyRdfResource $resource = null)
44+
public function __construct(?string $uri, $graph = null, EasyRdfResource $resource = null)
4545
{
4646
$graph = ($graph instanceof RdfGraph) ? $graph->getEasyGraph() : $graph;
4747
$this->resource = $resource ?? new EasyRdfResource($uri, $graph);
@@ -174,7 +174,7 @@ public function localId(): ?string
174174
* Returns the label of the resource in the given language with given style
175175
* or make use of the default label if none exists in the defined language.
176176
*/
177-
private function labelAsName(?string $language, ?string $namingConvention = null): ?string
177+
private function labelAsName(?string $language, string $namingConvention = null): ?string
178178
{
179179
// English is the default language, forseeing graphs with several ones.
180180
$language = $language ?: 'en';
@@ -185,18 +185,19 @@ private function labelAsName(?string $language, ?string $namingConvention = null
185185
return $label ? u($label->getValue())->snake()->__toString() :
186186
($defaultLabel ? u($defaultLabel->getValue())->snake()->__toString() : null);
187187
}
188+
188189
// default is camel case style as with schema.org
189190
return $label ? u($label->getValue())->camel()->__toString() :
190191
($defaultLabel ? u($defaultLabel->getValue())->camel()->__toString() : null);
191192
}
192193

193-
/**
194-
* Gets the graph related to this resource as a Schema Generator's RdfGraph.
195-
*/
196-
public function getGraph(): ?RdfGraph
197-
{
198-
return ($this->hasGraph()) ? RdfGraph::fromEasyRdf($this->resource->getGraph()) : null;
199-
}
194+
/**
195+
* Gets the graph related to this resource as a Schema Generator's RdfGraph.
196+
*/
197+
public function getGraph(): ?RdfGraph
198+
{
199+
return ($this->hasGraph()) ? RdfGraph::fromEasyRdf($this->resource->getGraph()) : null;
200+
}
200201

201202
/**
202203
* Returns true if the current RdfResource belongs to a graph.
@@ -405,7 +406,7 @@ public function offsetExists($offset): bool
405406
/**
406407
* Array Access Interface: perform get at using array syntax.
407408
*
408-
* @return mixed Can return all value types.
409+
* @return mixed can return all value types
409410
*/
410411
#[\ReturnTypeWillChange]
411412
public function offsetGet($offset)

src/TypesGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
use ApiPlatform\SchemaGenerator\Schema\Model\Property as SchemaProperty;
2929
use ApiPlatform\SchemaGenerator\Schema\PropertyGenerator\IdPropertyGenerator;
3030
use ApiPlatform\SchemaGenerator\Schema\PropertyGenerator\PropertyGenerator;
31-
use ApiPlatform\SchemaGenerator\Schema\TypeConverter;
3231
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
3332
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
33+
use ApiPlatform\SchemaGenerator\Schema\TypeConverter;
3434
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfigurationHolder as Config;
3535
use Doctrine\Common\Collections\ArrayCollection;
3636
use Doctrine\Common\Collections\Collection;

tests/AnnotationGenerator/PhpDocAnnotationGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
2323
use ApiPlatform\SchemaGenerator\Schema\Model\Property as SchemaProperty;
2424
use ApiPlatform\SchemaGenerator\Schema\Model\Type\PrimitiveType as SchemaPrimitiveType;
25-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2625
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2726
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
27+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2828
use PHPUnit\Framework\TestCase;
2929
use Symfony\Component\Config\Definition\Processor;
3030
use Symfony\Component\String\Inflector\EnglishInflector;

tests/AttributeGenerator/ApiPlatformCoreAttributeGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
use ApiPlatform\SchemaGenerator\PhpTypeConverter;
3030
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
3131
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
32-
use ApiPlatform\SchemaGenerator\TypesGenerator;
3332
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
3433
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
34+
use ApiPlatform\SchemaGenerator\TypesGenerator;
3535
use Nette\PhpGenerator\Literal;
3636
use PHPUnit\Framework\TestCase;
3737
use Symfony\Component\String\Inflector\EnglishInflector;

tests/AttributeGenerator/ConfigurationAttributeGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
use ApiPlatform\SchemaGenerator\PhpTypeConverter;
2020
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
2121
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
22-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2322
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2423
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
24+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2525
use PHPUnit\Framework\TestCase;
2626
use Symfony\Component\String\Inflector\EnglishInflector;
2727

tests/AttributeGenerator/ConstraintAttributeGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
2222
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
2323
use ApiPlatform\SchemaGenerator\Schema\Model\Type\PrimitiveType as SchemaPrimitiveType;
24-
use ApiPlatform\SchemaGenerator\TypesGenerator;
2524
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2625
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
26+
use ApiPlatform\SchemaGenerator\TypesGenerator;
2727
use Nette\PhpGenerator\Literal;
2828
use PHPUnit\Framework\TestCase;
2929
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;

tests/AttributeGenerator/DoctrineMongoDBAttributeGeneratorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
2222
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
2323
use ApiPlatform\SchemaGenerator\Schema\Model\Type\PrimitiveType as SchemaPrimitiveType;
24-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
25-
use ApiPlatform\SchemaGenerator\TypesGenerator;
2624
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2725
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
26+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
27+
use ApiPlatform\SchemaGenerator\TypesGenerator;
2828
use Nette\PhpGenerator\Literal;
2929
use PHPUnit\Framework\TestCase;
3030
use Symfony\Component\Config\Definition\Processor;

tests/AttributeGenerator/DoctrineOrmAssociationOverrideAttributeGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use ApiPlatform\SchemaGenerator\PhpTypeConverter;
1919
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
2020
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
21-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2221
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2322
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
23+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2424
use Nette\PhpGenerator\Literal;
2525
use PHPUnit\Framework\TestCase;
2626
use Symfony\Component\Config\Definition\Processor;

tests/AttributeGenerator/DoctrineOrmAttributeGeneratorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
2222
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
2323
use ApiPlatform\SchemaGenerator\Schema\Model\Type\PrimitiveType as SchemaPrimitiveType;
24-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
25-
use ApiPlatform\SchemaGenerator\TypesGenerator;
2624
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2725
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
26+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
27+
use ApiPlatform\SchemaGenerator\TypesGenerator;
2828
use Nette\PhpGenerator\Literal;
2929
use PHPUnit\Framework\TestCase;
3030
use Symfony\Component\Config\Definition\Processor;

tests/ClassMutator/ClassParentMutatorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
use ApiPlatform\SchemaGenerator\Model\Use_;
1818
use ApiPlatform\SchemaGenerator\PhpTypeConverter;
1919
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
20-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2120
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2221
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
22+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2323
use PHPUnit\Framework\TestCase;
2424
use Prophecy\PhpUnit\ProphecyTrait;
2525
use Prophecy\Prophecy\ObjectProphecy;

tests/ClassMutator/ClassPropertiesAppenderTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
use ApiPlatform\SchemaGenerator\Schema\Model\Property;
2222
use ApiPlatform\SchemaGenerator\Schema\Model\Type\PrimitiveType as SchemaPrimitiveType;
2323
use ApiPlatform\SchemaGenerator\Schema\PropertyGenerator\PropertyGenerator as SchemaPropertyGenerator;
24-
use ApiPlatform\SchemaGenerator\Schema\TypeConverter;
25-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2624
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2725
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
26+
use ApiPlatform\SchemaGenerator\Schema\TypeConverter;
27+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2828
use PHPUnit\Framework\TestCase;
2929
use Prophecy\PhpUnit\ProphecyTrait;
3030
use Prophecy\Prophecy\ObjectProphecy;

tests/Schema/Model/ClassTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
use ApiPlatform\SchemaGenerator\Model\Use_;
1818
use ApiPlatform\SchemaGenerator\Schema\Model\Class_ as SchemaClass;
1919
use ApiPlatform\SchemaGenerator\Schema\Model\Property as SchemaProperty;
20-
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2120
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2221
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfResource;
22+
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2323
use PHPUnit\Framework\TestCase;
2424
use Symfony\Component\Config\Definition\Processor;
2525
use Symfony\Component\String\Inflector\EnglishInflector;

tests/Schema/Rdf/RdfResourceTest.php

+21-21
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,18 @@ public function testUpdateResourceName(): void
188188
}
189189
}
190190

191-
public function testResetResourceNamingBehavior(): void
192-
{
193-
foreach (self::$testGroups as $testValues) {
194-
$resource = $this->createConfiguredRdfResource($this->getAllTypesRdfResourceConfig($testValues), $testValues['resourceUri'], $testValues['graph']);
191+
public function testResetResourceNamingBehavior(): void
192+
{
193+
foreach (self::$testGroups as $testValues) {
194+
$resource = $this->createConfiguredRdfResource($this->getAllTypesRdfResourceConfig($testValues), $testValues['resourceUri'], $testValues['graph']);
195195

196-
$resource->resetResourceNamingBehavior();
197-
$this->assertNull($resource->getResourceName());
196+
$resource->resetResourceNamingBehavior();
197+
$this->assertNull($resource->getResourceName());
198198

199-
$resource->updateResourceName();
200-
$this->assertEquals($testValues['id'], $resource->localName());
201-
}
202-
}
199+
$resource->updateResourceName();
200+
$this->assertEquals($testValues['id'], $resource->localName());
201+
}
202+
}
203203

204204
public function testLocalId(): void
205205
{
@@ -220,17 +220,17 @@ public function testLabelAsName(): void
220220
}
221221
}
222222

223-
public function testGetGraph(): void
224-
{
225-
foreach (self::$testGroups as $testValues) {
226-
$resource = new RdfResource($testValues['resourceUri']);
227-
$this->assertNull($resource->getGraph());
228-
$resource = new RdfResource($testValues['resourceUri'], $testValues['graph']);
229-
$this->assertInstanceOf(RdfGraph::class, $resource->getGraph());
230-
$resource = new RdfResource($testValues['resourceUri'], new EasyRdfGraph($testValues['graphUri']));
231-
$this->assertInstanceOf(RdfGraph::class, $resource->getGraph());
232-
}
233-
}
223+
public function testGetGraph(): void
224+
{
225+
foreach (self::$testGroups as $testValues) {
226+
$resource = new RdfResource($testValues['resourceUri']);
227+
$this->assertNull($resource->getGraph());
228+
$resource = new RdfResource($testValues['resourceUri'], $testValues['graph']);
229+
$this->assertInstanceOf(RdfGraph::class, $resource->getGraph());
230+
$resource = new RdfResource($testValues['resourceUri'], new EasyRdfGraph($testValues['graphUri']));
231+
$this->assertInstanceOf(RdfGraph::class, $resource->getGraph());
232+
}
233+
}
234234

235235
public function testAll(): void
236236
{

tests/TypesGeneratorTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
use ApiPlatform\SchemaGenerator\GoodRelationsBridge;
1919
use ApiPlatform\SchemaGenerator\PhpTypeConverter;
2020
use ApiPlatform\SchemaGenerator\Printer;
21+
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2122
use ApiPlatform\SchemaGenerator\SchemaGeneratorConfiguration;
2223
use ApiPlatform\SchemaGenerator\TypesGenerator;
23-
use ApiPlatform\SchemaGenerator\Schema\Rdf\RdfGraph;
2424
use EasyRdf\RdfNamespace;
2525
use PHPUnit\Framework\TestCase;
2626
use Prophecy\Argument;

0 commit comments

Comments
 (0)