Skip to content

Commit 3a778ca

Browse files
committed
code reformat
1 parent 51f7914 commit 3a778ca

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/Interaction.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Multicaret\Acquaintances;
44

55
use Illuminate\Database\Eloquent\Model;
6-
use Illuminate\Support\Str;
76
use Illuminate\Database\Eloquent\Relations\MorphToMany;
7+
use Illuminate\Support\Str;
88
use stdClass;
99

1010
/**
@@ -71,8 +71,10 @@ public static function isRelationExists(Model $model, $relation, $target, $class
7171
$userIdFkColumnName = config('acquaintances.tables.interactions_user_id_fk_column_name', 'user_id');
7272

7373
return $model->{$relation}($target->classname)
74-
->where($class ? config('acquaintances.tables.interactions', 'interactions') . '.subject_id' : config('acquaintances.tables.interactions', 'interactions') . '.' . $userIdFkColumnName, head($target->ids))
75-
->exists();
74+
->where($class ? config('acquaintances.tables.interactions',
75+
'interactions').'.subject_id' : config('acquaintances.tables.interactions',
76+
'interactions').'.'.$userIdFkColumnName, head($target->ids))
77+
->exists();
7678
}
7779

7880
/**
@@ -160,7 +162,7 @@ public static function formatTargets($targets, $classname, array $update = [])
160162
$result = new stdClass();
161163
$result->classname = $classname;
162164

163-
if (! is_array($targets)) {
165+
if ( ! is_array($targets)) {
164166
$targets = [$targets];
165167
}
166168

@@ -191,7 +193,7 @@ public static function formatTargets($targets, $classname, array $update = [])
191193
*/
192194
protected static function getRelationTypeFromRelation(MorphToMany $relation)
193195
{
194-
if (! \array_key_exists($relation->getRelationName(), self::$relationMap)) {
196+
if ( ! \array_key_exists($relation->getRelationName(), self::$relationMap)) {
195197
throw new \Exception('Invalid relation definition.');
196198
}
197199

@@ -202,7 +204,7 @@ static public function numberToReadable($number, $precision = 1, $divisors = nul
202204
{
203205
$shorthand = '';
204206
$divisor = pow(1000, 0);
205-
if (! isset($divisors)) {
207+
if ( ! isset($divisors)) {
206208
$divisors = [
207209
$divisor => $shorthand, // 1000^0 == 1
208210
pow(1000, 1) => 'K', // Thousand
@@ -219,11 +221,10 @@ static public function numberToReadable($number, $precision = 1, $divisors = nul
219221
}
220222
}
221223

222-
return number_format($number / $divisor, $precision) . $shorthand;
224+
return number_format($number / $divisor, $precision).$shorthand;
223225
}
224226

225227

226-
227228
public static function getFullModelName($modelClassName)
228229
{
229230
if (class_exists($modelClassName)) {
@@ -234,7 +235,7 @@ public static function getFullModelName($modelClassName)
234235

235236
return empty($namespace)
236237
? Str::studly($modelClassName)
237-
: $namespace . '\\' . Str::studly($modelClassName);
238+
: $namespace.'\\'.Str::studly($modelClassName);
238239
}
239240

240241
public static function getUserModelName()

0 commit comments

Comments
 (0)