Skip to content

Commit

Permalink
Apply fixes from StyleCI (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmuscnielsen authored Nov 16, 2021
1 parent 3a0b5f6 commit 09bf35d
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/Builder/Concerns/HasLocaleScopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function localeQueryStatus($key = null, $value = null)
}

/**
* @param string|array $locales
* @param bool $fallbackMaster
* @param string|array $locales
* @param bool $fallbackMaster
* @return $this
*/
public function locale($locales, $fallbackMaster = false)
Expand Down
3 changes: 2 additions & 1 deletion src/ModelChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public static function checkTranslatable(Model $model)

/**
* @param \Illuminate\Database\Eloquent\Model|\Makeable\LaravelTranslatable\Translatable $model
* @throws \BadMethodCallException
* @return \Makeable\LaravelTranslatable\Translatable
*
* @throws \BadMethodCallException
*/
public static function ensureTranslatable(Model $model)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/Concerns/BelongsToBaseImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getRelation()
/**
* Covers edge-case present when running in compatibility-mode and parent is translatable.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Builder $query
* @return void
*/
protected function ensureMasterOnAmbiguousQueries($query)
Expand Down
12 changes: 6 additions & 6 deletions src/Relations/Concerns/HasBufferedLocaleScopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ trait HasBufferedLocaleScopes
protected $hasGetterHook = false;

/**
* @param string|array $locales
* @param bool $fallbackMaster
* @param string|array $locales
* @param bool $fallbackMaster
* @return $this
*/
public function locale($locales, $fallbackMaster = false)
Expand All @@ -36,8 +36,8 @@ public function locale($locales, $fallbackMaster = false)
}

/**
* @param string|array $locales
* @param bool $fallbackMaster
* @param string|array $locales
* @param bool $fallbackMaster
* @return $this
*/
public function defaultLocale($locales, $fallbackMaster = false)
Expand All @@ -48,8 +48,8 @@ public function defaultLocale($locales, $fallbackMaster = false)
}

/**
* @param string|array $locales
* @param bool $fallbackMaster
* @param string|array $locales
* @param bool $fallbackMaster
* @return $this
*/
public function defaultLocaleUnlessDisabled($locales, $fallbackMaster = false)
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/Concerns/HasOneOrManyImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function addEagerConstraints(array $models, callable $extraConstraint = n
/**
* Match the eagerly loaded results to their many parents.
*
* @param array $models
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
* @param string $type
Expand Down
9 changes: 5 additions & 4 deletions src/Relations/Concerns/TranslatedRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected function getModelKeys(array $models, $keyName = null)
}

/**
* @param Model $model
* @param null $keyName
* @param Model $model
* @param null $keyName
* @return mixed
*/
protected function getModelKey(Model $model, $keyName = null)
Expand All @@ -72,8 +72,8 @@ protected function getModelKey(Model $model, $keyName = null)
}

/**
* @param Model $model
* @param null $keyName
* @param Model $model
* @param null $keyName
* @return mixed
*/
protected function getModelKeyName(Model $model, $keyName = null)
Expand Down Expand Up @@ -101,6 +101,7 @@ protected function isTranslatableContext(Model $model)
*
* This is useful for eager-loaded queries where we wish to persist
* the same locale preferences throughout the entire nested queries.
*
* @param \Illuminate\Database\Eloquent\Model|null $model
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/TranslatedBelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function addEagerConstraints(array $models)
/**
* Match the eagerly loaded results to their parents.
*
* @param array $models
* @param array $models
* @param \Illuminate\Database\Eloquent\Collection $results
* @param string $relation
* @return array
Expand Down
2 changes: 1 addition & 1 deletion src/Relations/TranslatedMorphTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function associate($model)
}

/**
* @param Model|string $model
* @param Model|string $model
*/
protected function setOwnerKeyNameFor($model)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Scopes/ApplyLocaleScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class ApplyLocaleScope implements Scope
protected static $mode = self::FETCH_MASTER_LOCALE_BY_DEFAULT;

/**
* @param string $mode
* @param string $mode
*/
public static function setMode($mode)
{
static::$mode = $mode;
}

/**
* @param string $mode
* @param string $mode
* @return bool
*/
public static function modeIs($mode)
Expand Down
4 changes: 2 additions & 2 deletions src/Scopes/LocaleScope.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct($query)
/**
* @param array $locales
* @param bool $fallbackMaster
* @return \Makeable\LaravelTranslatable\Builder\EloquentBuilder $query
* @return \Makeable\LaravelTranslatable\Builder\EloquentBuilder $query
*/
public function __invoke($locales, $fallbackMaster = false)
{
Expand Down Expand Up @@ -239,7 +239,7 @@ protected function getCompatibleWheres(Builder $query)
* Since there is no easy mapping between a where clause and it's original bindings
* we'll instead re-add bindings based on the values in the where clause.
*
* @param array $where
* @param array $where
* @return array
*/
protected function getBindingsForWhere(array $where)
Expand Down
6 changes: 3 additions & 3 deletions src/Translatable.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function versions()
// _________________________________________________________________________________________________________________

/**
* @param Builder $query
* @param Builder $query
* @return Builder
*/
public function scopeMaster($query)
Expand Down Expand Up @@ -135,7 +135,7 @@ public function getSiblingKey()
}

/**
* @param string $locale
* @param string $locale
* @return \Illuminate\Database\Eloquent\Model|null
*/
public function getTranslation($locale)
Expand All @@ -146,7 +146,7 @@ public function getTranslation($locale)
}

/**
* @param string $locale
* @param string $locale
* @return \Illuminate\Database\Eloquent\Model
*/
public function getTranslationOrNew($locale)
Expand Down

0 comments on commit 09bf35d

Please sign in to comment.