Skip to content

Commit

Permalink
Merge pull request #5079 from GrahamCampbell/4.2-names
Browse files Browse the repository at this point in the history
[4.2] Avoid Using Fully Qualified Names Within The Code
  • Loading branch information
taylorotwell committed Sep 10, 2014
2 parents 33a3654 + 92e1146 commit bc0a1c6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/Illuminate/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use PDO;
use Closure;
use DateTime;
use Illuminate\Events\Dispatcher;
use Illuminate\Database\Query\Processors\Processor;
use Doctrine\DBAL\Connection as DoctrineConnection;

Expand Down Expand Up @@ -947,7 +948,7 @@ public function getEventDispatcher()
* @param \Illuminate\Events\Dispatcher
* @return void
*/
public function setEventDispatcher(\Illuminate\Events\Dispatcher $events)
public function setEventDispatcher(Dispatcher $events)
{
$this->events = $events;
}
Expand Down
5 changes: 3 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Query\Expression;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\ModelNotFoundException;

Expand Down Expand Up @@ -266,15 +267,15 @@ public function getRelationCountQuery(Builder $query, Builder $parent)
*/
public function getRelationCountQueryForSelfJoin(Builder $query, Builder $parent)
{
$query->select(new \Illuminate\Database\Query\Expression('count(*)'));
$query->select(new Expression('count(*)'));

$tablePrefix = $this->query->getQuery()->getConnection()->getTablePrefix();

$query->from($this->table.' as '.$tablePrefix.$hash = $this->getRelationCountHash());

$key = $this->wrap($this->getQualifiedParentKeyName());

return $query->where($hash.'.'.$this->foreignKey, '=', new \Illuminate\Database\Query\Expression($key));
return $query->where($hash.'.'.$this->foreignKey, '=', new Expression($key));
}

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Illuminate/Foundation/Application.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Illuminate\Foundation;

use Closure;
use Stack\Builder;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Config\FileLoader;
Expand Down Expand Up @@ -655,7 +656,7 @@ protected function getStackedClient()
{
$sessionReject = $this->bound('session.reject') ? $this['session.reject'] : null;

$client = (new \Stack\Builder)
$client = (new Builder)
->push('Illuminate\Cookie\Guard', $this['encrypter'])
->push('Illuminate\Cookie\Queue', $this['cookie'])
->push('Illuminate\Session\Middleware', $this['session'], $sessionReject);
Expand All @@ -671,7 +672,7 @@ protected function getStackedClient()
* @param \Stack\Builder
* @return void
*/
protected function mergeCustomMiddlewares(\Stack\Builder $stack)
protected function mergeCustomMiddlewares(Builder $stack)
{
foreach ($this->middlewares as $middleware)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/Console/TinkerCommand.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Illuminate\Foundation\Console;

use Boris\Boris;
use Illuminate\Console\Command;

class TinkerCommand extends Command {
Expand Down Expand Up @@ -46,7 +47,7 @@ protected function runBorisShell()
{
$this->setupBorisErrorHandling();

(new \Boris\Boris('> '))->start();
(new Boris('> '))->start();
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Illuminate\Support;

use Patchwork\Utf8;
use Illuminate\Support\Traits\MacroableTrait;

class Str {
Expand All @@ -14,7 +15,7 @@ class Str {
*/
public static function ascii($value)
{
return \Patchwork\Utf8::toAscii($value);
return Utf8::toAscii($value);
}

/**
Expand Down

0 comments on commit bc0a1c6

Please sign in to comment.