Skip to content

Commit

Permalink
avoid aliasing interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jul 29, 2017
1 parent 43bda2a commit 130b5a0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-tinker-tools` will be documented in this file

## 1.0.1 - 2017-07-28

- avoid aliasing interfaces

## 1.0.0 - 2017-05-22

- initial release
8 changes: 7 additions & 1 deletion src/ShortClassNames.php
Expand Up @@ -2,6 +2,8 @@

namespace Spatie\TinkerTools;

use ReflectionClass;

class ShortClassNames
{
/** @var \Illuminate\Support\Collection */
Expand Down Expand Up @@ -36,7 +38,11 @@ public function registerAutoloader()
public function aliasClass($findClass)
{
$class = $this->classes->first(function ($class) use ($findClass) {
return $class['name'] === $findClass;
if ($class['name'] !== $findClass) {
return false;
};

return ! (new ReflectionClass($class['fqcn']))->isInterface();
});

if (! $class) {
Expand Down

0 comments on commit 130b5a0

Please sign in to comment.