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

Add declare strict_types to seed template #2220

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

MasterOdin
Copy link
Member

PR adds a declare(strict_types=1); to the seed template, which brings it inline with how our migrations template file works, where declare was added in #1819. We should be highly forcing people to have correct types usage when interacting with their database to prevent any sort of unexpected data loss/corruption, such as talked about in the linked PR.

@@ -198,7 +198,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$namespace = $config instanceof NamespaceAwareInterface ? $config->getSeedNamespaceByPath($path) : null;
$classes = [
'$namespaceDefinition' => $namespace !== null ? ('namespace ' . $namespace . ';') : '',
'$namespaceDefinition' => $namespace !== null ? (PHP_EOL . 'namespace ' . $namespace . ';' . PHP_EOL) : '',
Copy link
Member Author

Choose a reason for hiding this comment

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

Updating this line so that it looks and works the same as the similar line we have for migrations:

'$namespaceDefinition' => $namespace !== null ? (PHP_EOL . 'namespace ' . $namespace . ';' . PHP_EOL) : '',

@MasterOdin MasterOdin merged commit a1c4ec5 into 0.x Sep 19, 2023
12 checks passed
@MasterOdin MasterOdin deleted the feat-seed-declare branch September 19, 2023 09:20
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.

1 participant