1
0
mirror of https://github.com/flarum/core.git synced 2025-10-11 23:14:29 +02:00

Fix coding standards to conform to PSR-2

This commit is contained in:
Franz Liedke
2015-05-19 01:03:12 +02:00
parent 6b4c27a944
commit 7885c9a002
22 changed files with 239 additions and 242 deletions

View File

@@ -4,40 +4,41 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class MappedMorphTo extends MorphTo {
class MappedMorphTo extends MorphTo
{
/**
*
* @var string
*/
protected $map;
/**
*
* @var string
*/
protected $map;
/**
* Create a new morph to relationship instance.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Model $parent
* @param string $foreignKey
* @param string $otherKey
* @param string $type
* @param string $relation
* @return void
*/
public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation, $map)
{
$this->map = $map;
/**
* Create a new morph to relationship instance.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param \Illuminate\Database\Eloquent\Model $parent
* @param string $foreignKey
* @param string $otherKey
* @param string $type
* @param string $relation
* @return void
*/
public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey, $type, $relation, $map)
{
$this->map = $map;
parent::__construct($query, $parent, $foreignKey, $otherKey, $type, $relation);
}
parent::__construct($query, $parent, $foreignKey, $otherKey, $type, $relation);
}
/**
* Create a new model instance by type.
*
* @param string $type
* @return \Illuminate\Database\Eloquent\Model
*/
public function createModelByType($type)
{
return new $this->map[$type];
}
/**
* Create a new model instance by type.
*
* @param string $type
* @return \Illuminate\Database\Eloquent\Model
*/
public function createModelByType($type)
{
return new $this->map[$type];
}
}