Skip to content

Commit

Permalink
Fix #218: Update Application to support PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz authored Jan 23, 2025
1 parent fbd079e commit d1f22d9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Enh #207: Add `--open` option for `serve` command (@xepozz)
- Enh #207: Print possible options for `serve` command (@xepozz)
- Enh #218: Update Application to support PHP 8.4 (@alexander-schranz)

## 2.2.0 February 17, 2024

Expand Down
20 changes: 7 additions & 13 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->paths([
return RectorConfig::configure()
->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);

// register a single rule
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);

// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_80,
]);
};
])
->withRules([
InlineConstructorDefaultToPropertyRector::class,
])
->withPhpSets(php80: true);
2 changes: 1 addition & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function addOptions(InputOption $options): void
->addOption($options);
}

public function extractNamespace(string $name, int $limit = null): string
public function extractNamespace(string $name, ?int $limit = null): string
{
return parent::extractNamespace(str_replace('/', ':', $name), $limit);
}
Expand Down
2 changes: 1 addition & 1 deletion src/SymfonyEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(private PsrEventDispatcherInterface $dispatcher)
*
* @psalm-return T
*/
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
/** @psalm-var T */
return $this->dispatcher->dispatch($event);
Expand Down

0 comments on commit d1f22d9

Please sign in to comment.