From 9beb93cebbece595aeff12c705d779f8abcf81a5 Mon Sep 17 00:00:00 2001 From: Christoph Kappestein Date: Sun, 27 Dec 2015 03:07:38 +0100 Subject: [PATCH] organize uses and fixed coding styles --- library/PSX/Controller/Behaviour/ImporterTrait.php | 4 +--- library/PSX/Controller/Tool/DocumentationController.php | 2 -- library/PSX/Data/Record/GraphTraverser.php | 2 +- library/PSX/Data/Record/ImporterManager.php | 5 ++--- library/PSX/Data/Record/Transformer.php | 1 - library/PSX/Validate/ValidatorAbstract.php | 1 - .../Controller/Foo/Application/TestApiValidateController.php | 4 ++-- .../Controller/Foo/Application/TestSchemaApiController.php | 2 -- tests/PSX/Data/Record/Visitor/ValidationVisitorTest.php | 1 - tests/PSX/Data/Record/Visitor/XmlWriterVisitorTest.php | 2 +- .../Data/Schema/Visitor/ValidationVisitorValidatorTest.php | 3 --- tests/PSX/Json/ComparatorTest.php | 1 - tests/PSX/LoaderTest.php | 2 +- 13 files changed, 8 insertions(+), 22 deletions(-) diff --git a/library/PSX/Controller/Behaviour/ImporterTrait.php b/library/PSX/Controller/Behaviour/ImporterTrait.php index cf73090f..3db56fbb 100644 --- a/library/PSX/Controller/Behaviour/ImporterTrait.php +++ b/library/PSX/Controller/Behaviour/ImporterTrait.php @@ -20,10 +20,8 @@ namespace PSX\Controller\Behaviour; -use PSX\Data\TransformerInterface; use PSX\Data\Record\Importer; -use PSX\Data\Record\ImporterManager; -use PSX\Data\Record\ImporterInterface; +use PSX\Data\TransformerInterface; use PSX\Validate\ValidatorAwareInterface; use PSX\Validate\ValidatorInterface; diff --git a/library/PSX/Controller/Tool/DocumentationController.php b/library/PSX/Controller/Tool/DocumentationController.php index 776eaaff..753e2888 100644 --- a/library/PSX/Controller/Tool/DocumentationController.php +++ b/library/PSX/Controller/Tool/DocumentationController.php @@ -23,10 +23,8 @@ use PSX\Api\DocumentationInterface; use PSX\Api\Resource; use PSX\Api\Resource\Generator; -use PSX\Api\Resource\Generator\HtmlAbstract; use PSX\Controller\ApiAbstract; use PSX\Data\Record; -use PSX\Data\SchemaInterface; use PSX\Data\Schema\Generator as SchemaGenerator; use PSX\Exception; use PSX\Http\Exception as HttpException; diff --git a/library/PSX/Data/Record/GraphTraverser.php b/library/PSX/Data/Record/GraphTraverser.php index a2cb5d3b..61c60d37 100644 --- a/library/PSX/Data/Record/GraphTraverser.php +++ b/library/PSX/Data/Record/GraphTraverser.php @@ -99,7 +99,7 @@ protected function traverseValue($value, VisitorInterface $visitor) } /** - * Method which reveals the true value of an object if it has a known + * Method which reveals the true value of an object if it has a known * interface. Note this resolves also all Traversable instances to an array * * @param mixed $object diff --git a/library/PSX/Data/Record/ImporterManager.php b/library/PSX/Data/Record/ImporterManager.php index 3705a372..3818ff91 100644 --- a/library/PSX/Data/Record/ImporterManager.php +++ b/library/PSX/Data/Record/ImporterManager.php @@ -20,11 +20,10 @@ namespace PSX\Data\Record; -use PSX\Data\RecordInterface; -use PSX\Data\Record\FactoryFactory; use PSX\Data\Record\Importer; -use PSX\Data\SchemaInterface; +use PSX\Data\RecordInterface; use PSX\Data\Schema\Assimilator; +use PSX\Data\SchemaInterface; use PSX\Sql\TableInterface; /** diff --git a/library/PSX/Data/Record/Transformer.php b/library/PSX/Data/Record/Transformer.php index 1b517d0f..94e028a7 100644 --- a/library/PSX/Data/Record/Transformer.php +++ b/library/PSX/Data/Record/Transformer.php @@ -20,7 +20,6 @@ namespace PSX\Data\Record; -use PSX\Data\RecordInterface; use PSX\Data\Record\Visitor\RecordSerializeVisitor; use PSX\Data\Record\Visitor\StdClassSerializeVisitor; diff --git a/library/PSX/Validate/ValidatorAbstract.php b/library/PSX/Validate/ValidatorAbstract.php index 71a7b273..cb2899fa 100644 --- a/library/PSX/Validate/ValidatorAbstract.php +++ b/library/PSX/Validate/ValidatorAbstract.php @@ -24,7 +24,6 @@ use PSX\Data\Record\GraphTraverser; use PSX\Data\Record\Visitor\ValidationVisitor; use PSX\Validate; -use RuntimeException; /** * ValidatorAbstract diff --git a/tests/PSX/Controller/Foo/Application/TestApiValidateController.php b/tests/PSX/Controller/Foo/Application/TestApiValidateController.php index d6bfa229..8527be10 100644 --- a/tests/PSX/Controller/Foo/Application/TestApiValidateController.php +++ b/tests/PSX/Controller/Foo/Application/TestApiValidateController.php @@ -67,8 +67,8 @@ public function doInsert() $this->testCase->assertInstanceOf('PSX\Data\RecordInterface', $data); - // we check that the validator is only applied for the request. If the - // importer manager is not immutable the importer would also have the + // we check that the validator is only applied for the request. If the + // importer manager is not immutable the importer would also have the // request validator $message = new Message([], '{"title": "foofoofoo"}'); $data = $this->importer->import($this->schemaManager->getSchema('PSX\Controller\Foo\Schema\NestedEntry'), $message); diff --git a/tests/PSX/Controller/Foo/Application/TestSchemaApiController.php b/tests/PSX/Controller/Foo/Application/TestSchemaApiController.php index 5f4f0fe5..4f168a30 100644 --- a/tests/PSX/Controller/Foo/Application/TestSchemaApiController.php +++ b/tests/PSX/Controller/Foo/Application/TestSchemaApiController.php @@ -29,8 +29,6 @@ use PSX\Loader\Context; use PSX\Test\Environment; use PSX\Validate; -use PSX\Validate\Property; -use PSX\Validate\Validator; /** * TestSchemaApiController diff --git a/tests/PSX/Data/Record/Visitor/ValidationVisitorTest.php b/tests/PSX/Data/Record/Visitor/ValidationVisitorTest.php index 81c07b34..f42c9840 100644 --- a/tests/PSX/Data/Record/Visitor/ValidationVisitorTest.php +++ b/tests/PSX/Data/Record/Visitor/ValidationVisitorTest.php @@ -22,7 +22,6 @@ use PSX\Data\Record; use PSX\Data\Record\GraphTraverser; -use PSX\Test\Assert; use PSX\Uri; use PSX\Validate\ValidatorInterface; diff --git a/tests/PSX/Data/Record/Visitor/XmlWriterVisitorTest.php b/tests/PSX/Data/Record/Visitor/XmlWriterVisitorTest.php index f8366bc2..f73b6c54 100644 --- a/tests/PSX/Data/Record/Visitor/XmlWriterVisitorTest.php +++ b/tests/PSX/Data/Record/Visitor/XmlWriterVisitorTest.php @@ -59,7 +59,7 @@ public function testInvalidElementName() $key = ''; for ($i = 0; $i <= 0x7F; $i++) { - $key.= chr($i); + $key.= chr($i); } $record = Record::fromArray([ diff --git a/tests/PSX/Data/Schema/Visitor/ValidationVisitorValidatorTest.php b/tests/PSX/Data/Schema/Visitor/ValidationVisitorValidatorTest.php index bb6cd205..8afbffb8 100644 --- a/tests/PSX/Data/Schema/Visitor/ValidationVisitorValidatorTest.php +++ b/tests/PSX/Data/Schema/Visitor/ValidationVisitorValidatorTest.php @@ -21,13 +21,10 @@ namespace PSX\Data\Schema\Visitor; use PSX\Data\Schema\Property; -use PSX\Data\Schema\Visitor\ValidationVisitor; use PSX\DateTime; use PSX\DateTime\Date; use PSX\DateTime\Duration; use PSX\DateTime\Time; -use PSX\Uri; -use PSX\Validate\Validator; /** * Checks whether the validator is called for each property diff --git a/tests/PSX/Json/ComparatorTest.php b/tests/PSX/Json/ComparatorTest.php index 0b41584c..e81b8961 100644 --- a/tests/PSX/Json/ComparatorTest.php +++ b/tests/PSX/Json/ComparatorTest.php @@ -21,7 +21,6 @@ namespace PSX\Json; use PSX\Data\Record; -use stdClass; /** * ComparatorTest diff --git a/tests/PSX/LoaderTest.php b/tests/PSX/LoaderTest.php index b591b5ec..67859835 100644 --- a/tests/PSX/LoaderTest.php +++ b/tests/PSX/LoaderTest.php @@ -22,8 +22,8 @@ use Monolog\Handler\NullHandler; use Monolog\Logger; -use PSX\Dispatch\FilterInterface as DispatchFilterInterface; use PSX\Dispatch\FilterChainInterface; +use PSX\Dispatch\FilterInterface as DispatchFilterInterface; use PSX\Http\Request; use PSX\Http\RequestInterface; use PSX\Http\Response;