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
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/Phinx/Console/Command/SeedCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) : '',

'$namespace' => $namespace,
'$useClassName' => $config->getSeedBaseClassName(false),
'$className' => $className,
Expand Down
3 changes: 2 additions & 1 deletion src/Phinx/Seed/Seed.template.php.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
$namespaceDefinition

declare(strict_types=1);
$namespaceDefinition
use $useClassName;

class $className extends $baseClassName
Expand Down
Loading