Skip to content

Commit

Permalink
Add type declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Jan 12, 2025
1 parent 20b635d commit df4b11b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Upgrade

## 4.0.0

### BC break: type declarations

Type declarations have been added to all method signatures and properties. You
might have to adjust your own code to abide by the new type declarations.

## From 2.x to 3.0.0

- The configuration for the migration namespace and directory changed as follows:
Expand Down
6 changes: 1 addition & 5 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@

<exclude-pattern>tests/Fixtures/CustomEntityManager.php</exclude-pattern>

<rule ref="Doctrine">
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint" />
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint" />
<exclude name="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint" />
</rule>
<rule ref="Doctrine" />

<!-- Disable the rules that will require PHP 7.4 -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
Expand Down
8 changes: 3 additions & 5 deletions src/Collector/MigrationsCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,18 @@ public function collect(Request $request, Response $response, Throwable|null $ex
$this->data['namespaces'] = $configuration->getMigrationDirectories();
}

/** @return string */
public function getName()
public function getName(): string

Check warning on line 72 in src/Collector/MigrationsCollector.php

View check run for this annotation

Codecov / codecov/patch

src/Collector/MigrationsCollector.php#L72

Added line #L72 was not covered by tests
{
return 'doctrine_migrations';
}

/** @return array<string, mixed>|Data */
public function getData()
public function getData(): array|Data

Check warning on line 78 in src/Collector/MigrationsCollector.php

View check run for this annotation

Codecov / codecov/patch

src/Collector/MigrationsCollector.php#L78

Added line #L78 was not covered by tests
{
return $this->data;
}

/** @return void */
public function reset()
public function reset(): void

Check warning on line 83 in src/Collector/MigrationsCollector.php

View check run for this annotation

Codecov / codecov/patch

src/Collector/MigrationsCollector.php#L83

Added line #L83 was not covered by tests
{
$this->data = [];
}
Expand Down
3 changes: 1 addition & 2 deletions src/DoctrineMigrationsBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

class DoctrineMigrationsBundle extends Bundle
{
/** @return void */
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
$container->addCompilerPass(new ConfigureDependencyFactoryPass());
}
Expand Down

0 comments on commit df4b11b

Please sign in to comment.