Skip to content

[7.x] Add missing imports#32276

Closed
lucasmichot wants to merge 3 commits intolaravel:7.xfrom
lucasmichot:feature/7.x/add-missing-imports
Closed

[7.x] Add missing imports#32276
lucasmichot wants to merge 3 commits intolaravel:7.xfrom
lucasmichot:feature/7.x/add-missing-imports

Conversation

@lucasmichot
Copy link
Copy Markdown
Contributor

Add missing imports.

@taylorotwell
Copy link
Copy Markdown
Member

The ones on the encrypt functions are for security.

@lucasmichot
Copy link
Copy Markdown
Contributor Author

See e9f23a3 Taylor

@GrahamCampbell GrahamCampbell changed the title [7.x] Add missing imports. [7.x] Add missing imports Apr 7, 2020
public function runningInConsole()
{
if ($this->isRunningInConsole === null) {
$this->isRunningInConsole = Env::get('APP_RUNNING_IN_CONSOLE') ?? (\PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg');
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please revert these. They are there for performance reasons because runningInConsole is hot code in most apps.

// instance on retrieval, which makes it quite convenient to work with
// date fields without having to create a mutator for each property.
if ($value !== null
&& \in_array($key, $this->getDates(), false)) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This slash also included because this is hot code.

@lucasmichot lucasmichot closed this Apr 7, 2020
@lucasmichot lucasmichot deleted the feature/7.x/add-missing-imports branch April 7, 2020 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants