Verified Commit f4167b86 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3407159 by longwave, quietone: [11.x] Add void returns for Symfony 7

parent 6ec3e269
Loading
Loading
Loading
Loading
Loading
+2 −8
Changes for core/lib/Drupal/Component/DependencyInjection/Container.php: 2 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -304,11 +304,8 @@ protected function createService(array $definition, $id) {

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  public function set($id, $service) {
  public function set($id, $service): void {
    $this->services[$id] = $service;
  }

@@ -343,11 +340,8 @@ public function hasParameter($name): bool {

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  public function setParameter($name, $value) {
  public function setParameter($name, $value): void {
    if ($this->frozen) {
      throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
    }
+4 −16
Changes for core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php: 4 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -210,22 +210,16 @@ public function hasListeners($event_name = NULL): bool {

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  public function addListener($event_name, $listener, $priority = 0) {
  public function addListener($event_name, $listener, $priority = 0): void {
    $this->listeners[$event_name][$priority][] = ['callable' => $listener];
    $this->unsorted[$event_name] = TRUE;
  }

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  public function removeListener($event_name, $listener) {
  public function removeListener($event_name, $listener): void {
    if (!isset($this->listeners[$event_name])) {
      return;
    }
@@ -261,11 +255,8 @@ public function removeListener($event_name, $listener) {

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  public function addSubscriber(EventSubscriberInterface $subscriber) {
  public function addSubscriber(EventSubscriberInterface $subscriber): void {
    foreach ($subscriber->getSubscribedEvents() as $event_name => $params) {
      if (is_string($params)) {
        $this->addListener($event_name, [$subscriber, $params]);
@@ -283,11 +274,8 @@ public function addSubscriber(EventSubscriberInterface $subscriber) {

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  public function removeSubscriber(EventSubscriberInterface $subscriber) {
  public function removeSubscriber(EventSubscriberInterface $subscriber): void {
    foreach ($subscriber->getSubscribedEvents() as $event_name => $params) {
      if (is_array($params) && is_array($params[0])) {
        foreach ($params as $listener) {
+1 −4
Changes for core/lib/Drupal/Core/Command/DbCommandBase.php: 1 added line, 4 removed lines.
Original line number Diff line number Diff line
@@ -14,11 +14,8 @@ class DbCommandBase extends Command {

  /**
   * {@inheritdoc}
   *
   * phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
   * @return void
   */
  protected function configure() {
  protected function configure(): void {
    $this->addOption('database', NULL, InputOption::VALUE_OPTIONAL, 'The database connection name to use.', 'default')
      ->addOption('database-url', 'db-url', InputOption::VALUE_OPTIONAL, 'A database url to parse and use as the database connection.')
      ->addOption('prefix', NULL, InputOption::VALUE_OPTIONAL, 'Override or set the table prefix used in the database connection.');
+1 −1
Changes for core/lib/Drupal/Core/Command/DbDumpCommand.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ class DbDumpCommand extends DbCommandBase {
  /**
   * {@inheritdoc}
   */
  protected function configure() {
  protected function configure(): void {
    $this->setName('dump-database-d8-mysql')
      ->setDescription('Dump the current database to a generation script')
      ->addOption('schema-only', NULL, InputOption::VALUE_OPTIONAL, 'A comma separated list of tables to only export the schema without data.', 'cache.*,sessions,watchdog')
+1 −1
Changes for core/lib/Drupal/Core/Command/DbImportCommand.php: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ class DbImportCommand extends DbCommandBase {
  /**
   * {@inheritdoc}
   */
  protected function configure() {
  protected function configure(): void {
    parent::configure();
    $this->setName('import')
      ->setDescription('Import database from a generation script.')
Loading