Skip to content

Commit e94b5e1

Browse files
authored
Format code by the latest cs-fixer. (#6617)
1 parent 096913c commit e94b5e1

26 files changed

+38
-8
lines changed

publish/scout.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
use Hyperf\Scout\Provider\ElasticsearchProvider;
13+
1214
use function Hyperf\Support\env;
1315

1416
return [
@@ -22,7 +24,7 @@
2224
'concurrency' => 100,
2325
'engine' => [
2426
'elasticsearch' => [
25-
'driver' => Hyperf\Scout\Provider\ElasticsearchProvider::class,
27+
'driver' => ElasticsearchProvider::class,
2628
'index' => null,
2729
'hosts' => [
2830
env('ELASTICSEARCH_HOST', 'http://127.0.0.1:9200'),

src/Builder.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
use Closure;

src/ConfigProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
use Hyperf\Scout\Console\FlushCommand;

src/Console/FlushCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Console;
1314

1415
use Hyperf\Command\Command as HyperfCommand;

src/Console/ImportCommand.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Console;
1314

1415
use Hyperf\Command\Command;

src/Engine/ElasticsearchEngine.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Engine;
1314

1415
use Elasticsearch\Client;

src/Engine/Engine.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Engine;
1314

1415
use Hyperf\Collection\Collection as BaseCollection;

src/Engine/NullEngine.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Engine;
1314

1415
use Hyperf\Collection\Collection as BaseCollection;

src/EngineFactory.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
use Hyperf\Contract\ConfigInterface;

src/Event/ModelsFlushed.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Event;
1314

1415
use Hyperf\Database\Model\Collection;

src/Event/ModelsImported.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Event;
1314

1415
use Hyperf\Database\Model\Collection;

src/Exception/RuntimeException.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Exception;
1314

1415
class RuntimeException extends \RuntimeException

src/ModelObserver.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
use Hyperf\Context\Context;

src/Provider/ElasticsearchProvider.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Provider;
1314

1415
use Hyperf\Contract\ConfigInterface;

src/Provider/ProviderInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout\Provider;
1314

1415
use Hyperf\Scout\Engine\Engine;

src/Searchable.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
use Closure;

src/SearchableInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
/**

src/SearchableScope.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace Hyperf\Scout;
1314

1415
use Hyperf\Context\ApplicationContext;

tests/Cases/BuilderTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Cases;
1314

1415
use Hyperf\Database\Model\Collection;

tests/Cases/ElasticsearchEngineTest.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Cases;
1314

15+
use Elasticsearch\Client;
1416
use Hyperf\Database\Model\Collection;
1517
use Hyperf\Database\Model\Model;
1618
use Hyperf\Scout\Builder;
@@ -19,6 +21,7 @@
1921
use HyperfTest\Scout\Stub\ElasticsearchEngineTestModel;
2022
use HyperfTest\Scout\Stub\SearchableModel;
2123
use Mockery;
24+
use Mockery\MockInterface;
2225
use PHPUnit\Framework\Attributes\CoversNothing;
2326
use PHPUnit\Framework\TestCase;
2427

@@ -112,14 +115,14 @@ public function testSearchSendsCorrectParametersToElasticsearch()
112115

113116
public function testBuilderCallbackCanManipulateSearchParametersToElasticsearch()
114117
{
115-
/** @var \Elasticsearch\Client|\Mockery\MockInterface $client */
116-
$client = Mockery::mock(\Elasticsearch\Client::class);
118+
/** @var Client|MockInterface $client */
119+
$client = Mockery::mock(Client::class);
117120
$client->shouldReceive('search')->with(['modified_by_callback']);
118121
$engine = new ElasticsearchEngine($client, 'scout');
119122
$builder = new Builder(
120123
new ElasticsearchEngineTestModel(),
121124
'huayra',
122-
function (\Elasticsearch\Client $client, $query, $params) {
125+
function (Client $client, $query, $params) {
123126
$this->assertNotEmpty($params);
124127
$this->assertEquals('huayra', $query);
125128
$params = ['modified_by_callback'];

tests/Cases/ModelObserverTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Cases;
1314

1415
use Hyperf\Database\Model\Events\Deleted;

tests/Cases/SearchableTest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Cases;
1314

15+
use Hyperf\Database\Model\Collection;
1416
use HyperfTest\Scout\Stub\ContainerStub;
1517
use HyperfTest\Scout\Stub\ModelStubForMakeAllSearchable;
1618
use HyperfTest\Scout\Stub\SearchableModel;
@@ -39,7 +41,7 @@ protected function tearDown(): void
3941

4042
public function testSearchableUsingUpdateIsCalledOnCollection()
4143
{
42-
$collection = m::mock(\Hyperf\Database\Model\Collection::class);
44+
$collection = m::mock(Collection::class);
4345
$collection->shouldReceive('isEmpty')->andReturn(false);
4446
$collection->shouldReceive('first->searchableUsing->update')->with($collection);
4547
$model = new SearchableModel();
@@ -48,7 +50,7 @@ public function testSearchableUsingUpdateIsCalledOnCollection()
4850

4951
public function testSearchableUsingUpdateIsNotCalledOnEmptyCollection()
5052
{
51-
$collection = m::mock(\Hyperf\Database\Model\Collection::class);
53+
$collection = m::mock(Collection::class);
5254
$collection->shouldReceive('isEmpty')->andReturn(true);
5355
$collection->shouldNotReceive('first->searchableUsing->update');
5456
$model = new SearchableModel();
@@ -57,7 +59,7 @@ public function testSearchableUsingUpdateIsNotCalledOnEmptyCollection()
5759

5860
public function testSearchableUsingDeleteIsCalledOnCollection()
5961
{
60-
$collection = m::mock(\Hyperf\Database\Model\Collection::class);
62+
$collection = m::mock(Collection::class);
6163
$collection->shouldReceive('isEmpty')->andReturn(false);
6264
$collection->shouldReceive('first->searchableUsing->delete')->with($collection);
6365
$model = new SearchableModel();
@@ -66,7 +68,7 @@ public function testSearchableUsingDeleteIsCalledOnCollection()
6668

6769
public function testSearchableUsingDeleteIsNotCalledOnEmptyCollection()
6870
{
69-
$collection = m::mock(\Hyperf\Database\Model\Collection::class);
71+
$collection = m::mock(Collection::class);
7072
$collection->shouldReceive('isEmpty')->andReturn(true);
7173
$collection->shouldNotReceive('first->searchableUsing->delete');
7274
$model = new SearchableModel();

tests/Stub/ContainerStub.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Stub;
1314

1415
use Hyperf\Context\ApplicationContext;

tests/Stub/ElasticsearchEngineTestModel.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Stub;
1314

1415
use Hyperf\Database\Model\Model;

tests/Stub/ModelStubForMakeAllSearchable.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Stub;
1314

1415
use Hyperf\Scout\Builder;

tests/Stub/SearchableModel.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* @contact [email protected]
1010
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
12+
1213
namespace HyperfTest\Scout\Stub;
1314

1415
use Closure;

0 commit comments

Comments
 (0)