From 6782834178442a6650dcc607e1b9e2573a62bcec Mon Sep 17 00:00:00 2001
From: Matthias Adrowski <matthias.adrowski@sgalinski.de>
Date: Thu, 3 Feb 2022 12:44:19 +0100
Subject: [PATCH] [TASK] Migrate away from Commands.php

---
 Configuration/Commands.php  |  7 -------
 Configuration/Services.yaml | 22 ++++++++++++++--------
 2 files changed, 14 insertions(+), 15 deletions(-)
 delete mode 100644 Configuration/Commands.php

diff --git a/Configuration/Commands.php b/Configuration/Commands.php
deleted file mode 100644
index 64a89a8..0000000
--- a/Configuration/Commands.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-return [
-	'sg_news:migrateNews' => [
-		'class' => \SGalinski\SgNews\Command\MigrateNewsCommandController::class
-	]
-];
diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml
index 0df41ef..3c0cb4e 100644
--- a/Configuration/Services.yaml
+++ b/Configuration/Services.yaml
@@ -1,11 +1,17 @@
 services:
-    _defaults:
-        autowire: true
-        autoconfigure: true
-        public: false
+  _defaults:
+      autowire: true
+      autoconfigure: true
+      public: false
 
-    SGalinski\SgNews\:
-        resource: '../Classes/*'
+  SGalinski\SgNews\:
+      resource: '../Classes/*'
 
-    SGalinski\SgNews\Preview\PreviewRenderer:
-      public: true
+  SGalinski\SgNews\Preview\PreviewRenderer:
+    public: true
+
+# Commands
+  SGalinski\SgNews\Command\MigrateNewsCommandController:
+    tags:
+      - name: 'console.command'
+        command: 'sg_news:migrateNews'
-- 
GitLab