Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Illuminate/Auth/Middleware/Authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ protected function getModel($request, $model)
{
if ($this->isClassName($model)) {
return trim($model);
} else {
return $request->route($model, null) ?:
((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
}

return $request->route($model, null) ?:
((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Cache/RedisLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public function acquire()
{
if ($this->seconds > 0) {
return $this->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX') == true;
} else {
return $this->redis->setnx($this->name, $this->owner) === 1;
}

return $this->redis->setnx($this->name, $this->owner) === 1;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Connectors/SqlServerConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ protected function getDsn(array $config)

if (in_array('sqlsrv', $this->getAvailableDrivers())) {
return $this->getSqlSrvDsn($config);
} else {
return $this->getDblibDsn($config);
}

return $this->getDblibDsn($config);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1584,9 +1584,9 @@ public function resolveChildRouteBinding($childType, $value, $field)
if ($relationship instanceof HasManyThrough ||
$relationship instanceof BelongsToMany) {
return $relationship->where($relationship->getRelated()->getTable().'.'.$field, $value)->first();
} else {
return $relationship->where($field, $value)->first();
}

return $relationship->where($field, $value)->first();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/TestMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ protected function getDefaultNamespace($rootNamespace)
{
if ($this->option('unit')) {
return $rootNamespace.'\Unit';
} else {
return $rootNamespace.'\Feature';
}

return $rootNamespace.'\Feature';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public function getEvents()
$cache = require $this->app->getCachedEventsPath();

return $cache[get_class($this)] ?? [];
} else {
return array_merge_recursive(
$this->discoveredEvents(),
$this->listens()
);
}

return array_merge_recursive(
$this->discoveredEvents(),
$this->listens()
);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/RouteGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ protected static function formatPrefix($new, $old, $prependExistingPrefix = true

if ($prependExistingPrefix) {
return isset($new['prefix']) ? trim($old, '/').'/'.trim($new['prefix'], '/') : $old;
} else {
return isset($new['prefix']) ? trim($new['prefix'], '/').'/'.trim($old, '/') : $old;
}

return isset($new['prefix']) ? trim($new['prefix'], '/').'/'.trim($old, '/') : $old;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/UrlGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,9 @@ protected function formatAction($action)

if ($this->rootNamespace && strpos($action, '\\') !== 0) {
return $this->rootNamespace.'\\'.$action;
} else {
return trim($action, '\\');
}

return trim($action, '\\');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Session/Middleware/StartSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public function handle($request, Closure $next)
if ($this->manager->shouldBlock() ||
($request->route() && $request->route()->locksFor())) {
return $this->handleRequestWhileBlocking($request, $session, $next);
} else {
return $this->handleStatefulRequest($request, $session, $next);
}

return $this->handleStatefulRequest($request, $session, $next);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,9 +657,9 @@ public static function substrCount($haystack, $needle, $offset = 0, $length = nu
{
if (! is_null($length)) {
return substr_count($haystack, $needle, $offset, $length);
} else {
return substr_count($haystack, $needle, $offset);
}

return substr_count($haystack, $needle, $offset);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/View/Concerns/ManagesComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function renderComponent()

if ($view instanceof View) {
return $view->with($data)->render();
} else {
return $this->make($view, $data)->render();
}

return $this->make($view, $data)->render();
}

/**
Expand Down