Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jessarcher committed Jul 13, 2022
1 parent 9fe42ab commit 95192b6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Illuminate/Foundation/Console/ShowModelCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function handle()
* Get the column attributes for the given model.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return Collection
* @return \Illuminate\Support\Collection
*/
protected function getAttributes($model)
{
Expand All @@ -138,18 +138,18 @@ protected function getAttributes($model)
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param \Doctrine\DBAL\Schema\Column[] $columns
* @return Collection
* @return \Illuminate\Support\Collection
*/
protected function getVirtualAttributes($model, $columns)
{
$class = new ReflectionClass($model);

return collect($class->getMethods())
->filter(fn (\ReflectionMethod $method) => ! $method->isStatic()
->filter(fn (ReflectionMethod $method) => ! $method->isStatic()
&& ! $method->isAbstract()
&& $method->getDeclaringClass()->getName() === get_class($model)
)
->mapWithKeys(function (\ReflectionMethod $method) use ($model) {
->mapWithKeys(function (ReflectionMethod $method) use ($model) {
if (preg_match('/^get(.*)Attribute$/', $method->getName(), $matches) === 1) {
return [Str::snake($matches[1]) => 'Accessor'];
} elseif ($model->hasAttributeMutator($method->getName())) {
Expand All @@ -176,12 +176,12 @@ protected function getVirtualAttributes($model, $columns)
* Get the relations from the given model.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return Collection
* @return \Illuminate\Support\Collection
*/
protected function getRelations($model)
{
return collect(get_class_methods($model))
->map(fn ($method) => new \ReflectionMethod($model, $method))
->map(fn ($method) => new ReflectionMethod($model, $method))
->filter(fn (ReflectionMethod $method) => ! $method->isStatic()
&& ! $method->isAbstract()
&& $method->getDeclaringClass()->getName() === get_class($model)
Expand Down Expand Up @@ -336,7 +336,7 @@ protected function getCastType($column, $model)
* Get the model casts, including any date casts.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return Collection
* @return \Illuminate\Support\Collection
*/
protected function getCastsWithDates($model)
{
Expand Down

0 comments on commit 95192b6

Please sign in to comment.