Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 1 addition & 3 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,9 +753,7 @@ protected function getContextualConcrete($abstract)
*/
protected function findInContextualBindings($abstract)
{
if (isset($this->contextual[end($this->buildStack)][$abstract])) {
return $this->contextual[end($this->buildStack)][$abstract];
}
return $this->contextual[end($this->buildStack)][$abstract] ?? null;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Illuminate/Database/Connectors/SqlServerConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ protected function buildConnectString($driver, array $arguments)
*/
protected function buildHostString(array $config, $separator)
{
if (isset($config['port']) && ! empty($config['port'])) {
return $config['host'].$separator.$config['port'];
} else {
if (empty($config['port'])) {
return $config['host'];
} else {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else statement could be removed because of early return:

if (empty($config['port'])) {
    return $config['host'];
}

return $config['host'].$separator.$config['port'];

return $config['host'].$separator.$config['port'];
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,7 @@ public function getAttributeValue($key)
*/
protected function getAttributeFromArray($key)
{
if (isset($this->attributes[$key])) {
return $this->attributes[$key];
}
return $this->attributes[$key] ?? null;
}

/**
Expand Down
6 changes: 1 addition & 5 deletions src/Illuminate/Log/ParsesLogConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ protected function level(array $config)
*/
protected function parseChannel(array $config)
{
if (! isset($config['name'])) {
return $this->getFallbackChannelName();
}

return $config['name'];
return $config['name'] ?? $this->getFallbackChannelName();
}
}