Skip to content

Commit 8d0061d

Browse files
committed
style: fix (updated) code style
1 parent 5441932 commit 8d0061d

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

src/Indexable.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function indexedRecord()
3232

3333
public function indexRecord()
3434
{
35-
if (null === $this->indexedRecord) {
35+
if ($this->indexedRecord === null) {
3636
$this->indexedRecord = new IndexedRecord();
3737
$this->indexedRecord->indexable()->associate($this);
3838
}
@@ -41,7 +41,7 @@ public function indexRecord()
4141

4242
public function unIndexRecord()
4343
{
44-
if (null !== $this->indexedRecord) {
44+
if ($this->indexedRecord !== null) {
4545
$this->indexedRecord->delete();
4646
}
4747
}

src/ModelObserver.php

+7-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ModelObserver
1414
/**
1515
* Enable syncing for the given class.
1616
*
17-
* @param string $class
17+
* @param string $class
1818
*/
1919
public static function enableSyncingFor($class)
2020
{
@@ -24,7 +24,7 @@ public static function enableSyncingFor($class)
2424
/**
2525
* Disable syncing for the given class.
2626
*
27-
* @param string $class
27+
* @param string $class
2828
*/
2929
public static function disableSyncingFor($class)
3030
{
@@ -34,8 +34,7 @@ public static function disableSyncingFor($class)
3434
/**
3535
* Determine if syncing is disabled for the given class or model.
3636
*
37-
* @param object|string $class
38-
*
37+
* @param object|string $class
3938
* @return bool
4039
*/
4140
public static function syncingDisabledFor($class)
@@ -48,7 +47,7 @@ public static function syncingDisabledFor($class)
4847
/**
4948
* Handle the created event for the model.
5049
*
51-
* @param \Illuminate\Database\Eloquent\Model $model
50+
* @param \Illuminate\Database\Eloquent\Model $model
5251
*/
5352
public function created($model)
5453
{
@@ -62,7 +61,7 @@ public function created($model)
6261
/**
6362
* Handle the updated event for the model.
6463
*
65-
* @param \Illuminate\Database\Eloquent\Model $model
64+
* @param \Illuminate\Database\Eloquent\Model $model
6665
*/
6766
public function updated($model)
6867
{
@@ -72,7 +71,7 @@ public function updated($model)
7271
/**
7372
* Handle the deleted event for the model.
7473
*
75-
* @param \Illuminate\Database\Eloquent\Model $model
74+
* @param \Illuminate\Database\Eloquent\Model $model
7675
*/
7776
public function deleted($model)
7877
{
@@ -86,7 +85,7 @@ public function deleted($model)
8685
/**
8786
* Handle the restored event for the model.
8887
*
89-
* @param \Illuminate\Database\Eloquent\Model $model
88+
* @param \Illuminate\Database\Eloquent\Model $model
9089
*/
9190
public function restored($model)
9291
{

src/Search.php

+8-11
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
class Search implements SearchInterface
66
{
77
/**
8-
* @param string $search
9-
*
8+
* @param string $search
109
* @return \Illuminate\Database\Eloquent\Collection|\Swis\Laravel\Fulltext\IndexedRecord[]
1110
*/
1211
public function run($search)
@@ -17,9 +16,8 @@ public function run($search)
1716
}
1817

1918
/**
20-
* @param string $search
21-
* @param string $class
22-
*
19+
* @param string $search
20+
* @param string $class
2321
* @return \Illuminate\Database\Eloquent\Collection|\Swis\Laravel\Fulltext\IndexedRecord[]
2422
*/
2523
public function runForClass($search, $class)
@@ -31,8 +29,7 @@ public function runForClass($search, $class)
3129
}
3230

3331
/**
34-
* @param string $search
35-
*
32+
* @param string $search
3633
* @return \Illuminate\Database\Eloquent\Builder
3734
*/
3835
public function searchQuery($search)
@@ -51,12 +48,12 @@ public function searchQuery($search)
5148
$contentWeight = str_replace(',', '.', (float) config('laravel-fulltext.weight.content', 1.0));
5249

5350
$query = IndexedRecord::query()
54-
->whereRaw('MATCH (indexed_title, indexed_content) AGAINST (? IN BOOLEAN MODE)', [$termsBool])
55-
->orderByRaw(
56-
'('.$titleWeight.' * (MATCH (indexed_title) AGAINST (?)) +
51+
->whereRaw('MATCH (indexed_title, indexed_content) AGAINST (? IN BOOLEAN MODE)', [$termsBool])
52+
->orderByRaw(
53+
'('.$titleWeight.' * (MATCH (indexed_title) AGAINST (?)) +
5754
'.$contentWeight.' * (MATCH (indexed_title, indexed_content) AGAINST (?))
5855
) DESC',
59-
[$termsMatch, $termsMatch])
56+
[$termsMatch, $termsMatch])
6057
->limit(config('laravel-fulltext.limit-results'));
6158

6259
if (config('laravel-fulltext.exclude_feature_enabled')) {

0 commit comments

Comments
 (0)