Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Remove usages of the with() helper #17888

Merged
merged 2 commits into from
Feb 12, 2017
Merged
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
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ public static function destroy($ids)
// We will actually pull the models from the database table and call delete on
// each of them individually so that their events get fired properly with a
// correct set of attributes in case the developers wants to check these.
$key = with($instance = new static)->getKeyName();
$key = ($instance = new static)->getKeyName();

foreach ($instance->whereIn($key, $ids)->get() as $model) {
if ($model->delete()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MySqlProcessor extends Processor
public function processColumnListing($results)
{
return array_map(function ($result) {
return with((object) $result)->column_name;
return ((object) $result)->column_name;
}, $results);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function processInsertGetId(Builder $query, $sql, $values, $sequence = nu
public function processColumnListing($results)
{
return array_map(function ($result) {
return with((object) $result)->column_name;
return ((object) $result)->column_name;
}, $results);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SQLiteProcessor extends Processor
public function processColumnListing($results)
{
return array_map(function ($result) {
return with((object) $result)->name;
return ((object) $result)->name;
}, $results);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function processInsertGetIdForOdbc(Connection $connection)
public function processColumnListing($results)
{
return array_map(function ($result) {
return with((object) $result)->name;
return ((object) $result)->name;
}, $results);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function bootstrap(Application $app)
*/
protected function checkForSpecificEnvironmentFile($app)
{
if (php_sapi_name() == 'cli' && with($input = new ArgvInput)->hasParameterOption('--env')) {
if (php_sapi_name() == 'cli' && ($input = new ArgvInput)->hasParameterOption('--env')) {
$this->setEnvironmentFilePath(
$app, $app->environmentFile().'.'.$input->getParameterOption('--env')
);
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/Markdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function render($view, array $data = [], $inliner = null)
'mail', $this->htmlComponentPaths()
)->make($view, $data)->render();

return new HtmlString(with($inliner ?: new CssToInlineStyles)->convert(
return new HtmlString(($inliner ?: new CssToInlineStyles)->convert(
$contents, $this->view->make('mail::themes.'.$this->theme)->render()
));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/Jobs/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function fire()

list($class, $method) = JobName::parse($payload['job']);

with($this->instance = $this->resolve($class))->{$method}($this, $payload['data']);
($this->instance = $this->resolve($class))->{$method}($this, $payload['data']);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function median($key = null)
return;
}

$values = with(isset($key) ? $this->pluck($key) : $this)
$values = (isset($key) ? $this->pluck($key) : $this)
->sort()->values();

$middle = (int) ($count / 2);
Expand Down