Skip to content

Commit

Permalink
Style fix
Browse files Browse the repository at this point in the history
  • Loading branch information
massimilianobraglia committed Apr 6, 2020
1 parent bd08c69 commit 87779df
Show file tree
Hide file tree
Showing 34 changed files with 61 additions and 66 deletions.
4 changes: 2 additions & 2 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Refugis\ODM\Elastica;

use Elastica\Client;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Psr\Log\LoggerInterface;
use Refugis\ODM\Elastica\Collection\Database;
use Refugis\ODM\Elastica\Metadata\Loader;
use Refugis\ODM\Elastica\Metadata\MetadataFactory;
use Refugis\ODM\Elastica\Type\TypeInterface;
use Refugis\ODM\Elastica\Type\TypeManager;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Psr\Log\LoggerInterface;

final class Builder
{
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function delete(string $id): void;
* for the limitations of this method and the available parameters.
*
* @param Query\AbstractQuery $query
* @param array $params
* @param array $params
*/
public function deleteByQuery(Query\AbstractQuery $query, array $params = []): void;

Expand Down
6 changes: 3 additions & 3 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Refugis\ODM\Elastica;

use Kcs\Metadata\Factory\MetadataFactoryInterface;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Psr\Cache\CacheItemPoolInterface;
use Refugis\ODM\Elastica\Exception\InvalidDocumentRepositoryException;
use Refugis\ODM\Elastica\Repository\DefaultRepositoryFactory;
use Refugis\ODM\Elastica\Repository\DocumentRepository;
use Refugis\ODM\Elastica\Repository\DocumentRepositoryInterface;
use Refugis\ODM\Elastica\Repository\RepositoryFactoryInterface;
use Refugis\ODM\Elastica\Type\TypeManager;
use Kcs\Metadata\Factory\MetadataFactoryInterface;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Psr\Cache\CacheItemPoolInterface;

final class Configuration
{
Expand Down
10 changes: 5 additions & 5 deletions src/DocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

use Doctrine\Common\EventManager;
use Elastica\Query;
use Kcs\Metadata\Factory\MetadataFactoryInterface;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use ProxyManager\Proxy\LazyLoadingInterface;
use ProxyManager\Proxy\ProxyInterface;
use Psr\Cache\CacheItemPoolInterface;
use Refugis\ODM\Elastica\Collection\CollectionInterface;
use Refugis\ODM\Elastica\Collection\DatabaseInterface;
use Refugis\ODM\Elastica\Hydrator\HydratorInterface;
Expand All @@ -16,11 +21,6 @@
use Refugis\ODM\Elastica\Search\Search;
use Refugis\ODM\Elastica\Type\TypeManager;
use Refugis\ODM\Elastica\Util\ClassUtil;
use Kcs\Metadata\Factory\MetadataFactoryInterface;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use ProxyManager\Proxy\LazyLoadingInterface;
use ProxyManager\Proxy\ProxyInterface;
use Psr\Cache\CacheItemPoolInterface;

class DocumentManager implements DocumentManagerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/DocumentManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

use Doctrine\Common\EventManager;
use Doctrine\Common\Persistence\ObjectManager;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Psr\Cache\CacheItemPoolInterface;
use Refugis\ODM\Elastica\Collection\CollectionInterface;
use Refugis\ODM\Elastica\Collection\DatabaseInterface;
use Refugis\ODM\Elastica\Hydrator\HydratorInterface;
use Refugis\ODM\Elastica\Search\Search;
use Refugis\ODM\Elastica\Type\TypeManager;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Psr\Cache\CacheItemPoolInterface;

interface DocumentManagerInterface extends ObjectManager
{
Expand Down
6 changes: 2 additions & 4 deletions src/Geotools/Coordinate/Coordinate.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function getLongitude(): float
public function setFromString($coordinates)
{
if (! \is_string($coordinates)) {
throw new \InvalidArgumentException('The given coordinates should be a string !');
throw new \InvalidArgumentException('The given coordinates should be a string!');
}

$inDecimalDegree = $this->toDecimalDegrees($coordinates);
Expand Down Expand Up @@ -199,9 +199,7 @@ private function toDecimalDegrees($coordinates)
];
}

throw new \InvalidArgumentException(
'It should be a valid and acceptable ways to write geographic coordinates !'
);
throw new \InvalidArgumentException('It should be a valid and acceptable ways to write geographic coordinates !');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Hydrator/Internal/ProxyInstantiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace Refugis\ODM\Elastica\Hydrator\Internal;

use Doctrine\Instantiator\InstantiatorInterface;
use ProxyManager\Proxy\GhostObjectInterface;
use Refugis\ODM\Elastica\DocumentManagerInterface;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use ProxyManager\Proxy\GhostObjectInterface;

class ProxyInstantiator implements InstantiatorInterface
{
Expand Down
5 changes: 1 addition & 4 deletions src/Id/AssignedIdGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ public function generate(DocumentManagerInterface $dm, $document)
$id = $class->getSingleIdentifier($document);

if (null === $id) {
throw new InvalidIdentifierException(
'Document of type "'.$class->name.'" is missing an assigned ID.'.
'NONE generator strategy requires the ID field to be populated before persist is called.'
);
throw new InvalidIdentifierException('Document of type "'.$class->name.'" is missing an assigned ID.'.'NONE generator strategy requires the ID field to be populated before persist is called.');
}

return $id;
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Loader/AnnotationLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Refugis\ODM\Elastica\Metadata\Loader;

use Refugis\ODM\Elastica\Annotation\Document;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Kcs\ClassFinder\Finder\RecursiveFinder;
use Kcs\Metadata\ClassMetadataInterface;
use Kcs\Metadata\Loader\AnnotationProcessorLoader;
use Kcs\Metadata\Loader\Processor\ProcessorFactoryInterface;
use Refugis\ODM\Elastica\Annotation\Document;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;

class AnnotationLoader extends AnnotationProcessorLoader implements LoaderInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Metadata/MetadataFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Doctrine\Common\EventManager;
use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory;
use Refugis\ODM\Elastica\Metadata\Loader\LoaderInterface;
use Kcs\Metadata\ClassMetadataInterface;
use Kcs\Metadata\Exception\InvalidMetadataException;
use Kcs\Metadata\Factory\AbstractMetadataFactory;
use Refugis\ODM\Elastica\Metadata\Loader\LoaderInterface;

class MetadataFactory extends AbstractMetadataFactory implements ClassMetadataFactory
{
Expand Down
6 changes: 3 additions & 3 deletions src/Metadata/Processor/DocumentIdProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\DocumentId;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\DocumentId;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;

/**
* @Processor(annotation=DocumentId::class)
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Processor/DocumentProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\Document;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\Document;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;

/**
* @Processor(annotation=Document::class)
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Processor/FieldProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\Field;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\Field;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;

/**
* @Processor(annotation=Field::class)
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Processor/IndexNameProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\IndexName;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\IndexName;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;

/**
* @Processor(annotation=IndexName::class)
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Processor/IndexProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\Index;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\Index;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;

/**
* @Processor(annotation=Index::class)
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Processor/SettingProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\Setting;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\Setting;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;

/**
* @Processor(annotation=Setting::class)
Expand Down
4 changes: 2 additions & 2 deletions src/Metadata/Processor/TypeNameProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Metadata\Processor;

use Refugis\ODM\Elastica\Annotation\TypeName;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Kcs\Metadata\Loader\Processor\Annotation\Processor;
use Kcs\Metadata\Loader\Processor\ProcessorInterface;
use Kcs\Metadata\MetadataInterface;
use Refugis\ODM\Elastica\Annotation\TypeName;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;

/**
* @Processor(annotation=TypeName::class)
Expand Down
2 changes: 1 addition & 1 deletion src/UnitOfWork.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Doctrine\Common\EventManager;
use Doctrine\Common\Persistence\ObjectManagerAware;
use Elastica\Document;
use ProxyManager\Proxy\LazyLoadingInterface;
use Refugis\ODM\Elastica\Events\LifecycleEventManager;
use Refugis\ODM\Elastica\Events\PreFlushEventArgs;
use Refugis\ODM\Elastica\Exception\IndexNotFoundException;
Expand All @@ -18,7 +19,6 @@
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Refugis\ODM\Elastica\Persister\DocumentPersister;
use Refugis\ODM\Elastica\Util\ClassUtil;
use ProxyManager\Proxy\LazyLoadingInterface;

final class UnitOfWork
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Collection/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Elastica\Search as ElasticaSearch;
use Elastica\Type;
use Elasticsearch\Endpoints;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Refugis\ODM\Elastica\Collection\Collection;
use Refugis\ODM\Elastica\Collection\CollectionInterface;
use Refugis\ODM\Elastica\DocumentManagerInterface;
Expand All @@ -19,8 +21,6 @@
use Refugis\ODM\Elastica\Tests\Fixtures\Document\FooNoAutoCreate;
use Refugis\ODM\Elastica\Tests\Traits\DocumentManagerTestTrait;
use Refugis\ODM\Elastica\Tests\Traits\FixturesTestTrait;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;

class CollectionTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Collection/DatabaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use Elastica\Client;
use Elastica\Index;
use Refugis\ODM\Elastica\Collection\Database;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Refugis\ODM\Elastica\Collection\Database;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;

class DatabaseTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Command/DropSchemaCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

namespace Refugis\ODM\Elastica\Tests\Command;

use PHPUnit\Framework\TestCase;
use Refugis\ODM\Elastica\Command\DropSchemaCommand;
use Refugis\ODM\Elastica\Tests\Traits\DocumentManagerTestTrait;
use Refugis\ODM\Elastica\Tests\Traits\FixturesTestTrait;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester;

class DropSchemaCommandTest extends TestCase
Expand Down
4 changes: 2 additions & 2 deletions tests/DocumentManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Elastica\Index;
use Elastica\Type;
use PHPUnit\Framework\TestCase;
use ProxyManager\Proxy\ProxyInterface;
use Refugis\ODM\Elastica\DocumentManager;
use Refugis\ODM\Elastica\Geotools\Coordinate\Coordinate;
use Refugis\ODM\Elastica\Tests\Fixtures\Document\Foo;
Expand All @@ -12,8 +14,6 @@
use Refugis\ODM\Elastica\Tests\Traits\DocumentManagerTestTrait;
use Refugis\ODM\Elastica\Tests\Traits\FixturesTestTrait;
use Refugis\ODM\Elastica\VarDumper\VarDumperTestTrait;
use PHPUnit\Framework\TestCase;
use ProxyManager\Proxy\ProxyInterface;

/**
* @group functional
Expand Down
8 changes: 4 additions & 4 deletions tests/Hydrator/ObjectHydratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
use Elastica\Response;
use Elastica\Result;
use Elastica\ResultSet;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use ProxyManager\Factory\LazyLoadingGhostFactory;
use Refugis\ODM\Elastica\DocumentManagerInterface;
use Refugis\ODM\Elastica\Hydrator\ObjectHydrator;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
Expand All @@ -17,10 +21,6 @@
use Refugis\ODM\Elastica\Type\StringType;
use Refugis\ODM\Elastica\Type\TypeManager;
use Refugis\ODM\Elastica\UnitOfWork;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use ProxyManager\Factory\LazyLoadingGhostFactory;

class ObjectHydratorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Internal/DocumentGraphTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Refugis\ODM\Elastica\Tests\Internal;

use PHPUnit\Framework\TestCase;
use Refugis\ODM\Elastica\Internal\DocumentGraph;
use Refugis\ODM\Elastica\Internal\DocumentGraphEdge;
use Refugis\ODM\Elastica\Internal\DocumentGraphNode;
use Refugis\ODM\Elastica\Tests\Fixtures\Document\Foo;
use PHPUnit\Framework\TestCase;

class DocumentGraphTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Metadata/Processor/DocumentIdProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

namespace Refugis\ODM\Elastica\Tests\Metadata\Processor;

use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;
use Refugis\ODM\Elastica\Annotation\DocumentId;
use Refugis\ODM\Elastica\Metadata\DocumentMetadata;
use Refugis\ODM\Elastica\Metadata\FieldMetadata;
use Refugis\ODM\Elastica\Metadata\Processor\DocumentIdProcessor;
use Refugis\ODM\Elastica\Tests\Fixtures\Document\Foo;
use PHPUnit\Framework\TestCase;
use Prophecy\Prophecy\ObjectProphecy;

class DocumentIdProcessorTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Metadata/Processor/IndexProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Refugis\ODM\Elastica\Tests\Metadata\Processor;

use Elastica\Type\Mapping;
use PHPUnit\Framework\TestCase;
use Refugis\ODM\Elastica\Annotation\Analyzer;
use Refugis\ODM\Elastica\Annotation\Filter;
use Refugis\ODM\Elastica\Annotation\Index;
Expand All @@ -11,7 +12,6 @@
use Refugis\ODM\Elastica\Metadata\Processor\IndexProcessor;
use Refugis\ODM\Elastica\Tests\Fixtures\Document\Foo;
use Refugis\ODM\Elastica\Tests\Traits\DocumentManagerTestTrait;
use PHPUnit\Framework\TestCase;

class IndexProcessorTest extends TestCase
{
Expand Down
Loading

0 comments on commit 87779df

Please sign in to comment.