move constructor to command base class
authorChristian Weiske <cweiske@cweiske.de>
Wed, 14 Sep 2016 19:28:44 +0000 (21:28 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 14 Sep 2016 19:28:44 +0000 (21:28 +0200)
src/shpub/Command/AbstractProps.php
src/shpub/Command/Article.php
src/shpub/Command/Delete.php
src/shpub/Command/Like.php
src/shpub/Command/Note.php
src/shpub/Command/Reply.php
src/shpub/Command/Repost.php

index 08dbc97c21467756df42de795956d5cd0317e150..6d7ef3b8c27c346ca87f0cff8feedafbe56a70ea 100644 (file)
@@ -6,6 +6,16 @@ namespace shpub;
  */
 class Command_AbstractProps
 {
+    /**
+     * @var Config
+     */
+    protected $cfg;
+
+    public function __construct($cfg)
+    {
+        $this->cfg = $cfg;
+    }
+
     public static function optsGeneric(\Console_CommandLine_Command $cmd)
     {
         $cmd->addOption(
index b51740de1487674143128fa52958e0f241ca2670..9f40daf82f97943479f3905a0c314ccc2535f915 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Article extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('article');
index fec839fe94d89509d0d6db2f8fae59ff325da271..a13775aa603881141f838384f8e9042b224af05d 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Delete extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('delete');
index 5b456f955a56de5688d94af4e6051cf9d522b04d..65020dc04cd832f57e8d6cc95929729bcccf7486 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Like extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('like');
index 1ea599b57e847386d596ee149513e8fde61d5bd7..2e07e9d69765de69d984c233c21692b74208a420 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Note extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('note');
index b67d46b23b42bfdb7ee69671bee6d3f998b0f5af..493d58716808de438821c7d269c57f96f1d9b78b 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Reply extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('reply');
index 2f4b46f7c568f70145a522c18b0564533f83f10a..3c39178c84af83cda21e45a84cac6f2611fa5fb0 100644 (file)
@@ -3,16 +3,6 @@ namespace shpub;
 
 class Command_Repost extends Command_AbstractProps
 {
-    /**
-     * @var Config
-     */
-    protected $cfg;
-
-    public function __construct($cfg)
-    {
-        $this->cfg = $cfg;
-    }
-
     public static function opts(\Console_CommandLine $optParser)
     {
         $cmd = $optParser->addCommand('repost');