diff --git a/src/Builder/BuilderAbstract.php b/src/Builder/BuilderAbstract.php index 9f47803..6ff202d 100644 --- a/src/Builder/BuilderAbstract.php +++ b/src/Builder/BuilderAbstract.php @@ -4,6 +4,30 @@ abstract class BuilderAbstract implements BuilderInterface { + /** + * The command's name. + * + * @var string + */ + protected $command; + + /** + * Constructor. Offers an opportunity to set a command's alias/path. + * + * @throws InvalidArgumentException If the argument isn't a string. + */ + public function __construct() + { + $args = func_get_args(); + if (!empty($args)) { + if (is_string($args[0])) { + $this->command = $args[0]; + } else { + throw new InvalidArgumentException('This constructor expects a string argument.'); + } + } + } + /** * Build the command string to be executed. * diff --git a/src/Builder/GrowlNotifyBuilder.php b/src/Builder/GrowlNotifyBuilder.php index 62fcb57..107c004 100644 --- a/src/Builder/GrowlNotifyBuilder.php +++ b/src/Builder/GrowlNotifyBuilder.php @@ -11,23 +11,6 @@ class GrowlNotifyBuilder extends BuilderAbstract */ protected $command = 'growlnotify'; - /** - * Constructor. Offers an opportunity to set a command's alias. - * - * @throws InvalidArgumentException If the argument isn't a string. - */ - public function __construct() - { - $args = func_get_args(); - if (!empty($args)) { - if (is_string($args[0])) { - $this->command = $args[0]; - } else { - throw new InvalidArgumentException('This constructor expects a string argument.'); - } - } - } - /** * Builds the growlnotify command to be executed. * diff --git a/src/Builder/GrowlNotifyWindowsBuilder.php b/src/Builder/GrowlNotifyWindowsBuilder.php index 54e5fed..fc71636 100644 --- a/src/Builder/GrowlNotifyWindowsBuilder.php +++ b/src/Builder/GrowlNotifyWindowsBuilder.php @@ -11,23 +11,6 @@ class GrowlNotifyWindowsBuilder extends BuilderAbstract */ protected $command = 'growlnotify'; - /** - * Constructor. Offers an opportunity to set a command's alias. - * - * @throws InvalidArgumentException If the argument isn't a string. - */ - public function __construct() - { - $args = func_get_args(); - if (!empty($args)) { - if (is_string($args[0])) { - $this->command = $args[0]; - } else { - throw new InvalidArgumentException('This constructor expects a string argument.'); - } - } - } - /** * Builds the growlnotify command to be executed. * diff --git a/src/Builder/NotifySendBuilder.php b/src/Builder/NotifySendBuilder.php index 5f70e73..08a42fa 100644 --- a/src/Builder/NotifySendBuilder.php +++ b/src/Builder/NotifySendBuilder.php @@ -11,23 +11,6 @@ class NotifySendBuilder extends BuilderAbstract */ protected $command = 'notify-send'; - /** - * Constructor. Offers an opportunity to set a command's alias. - * - * @throws InvalidArgumentException If the argument isn't a string. - */ - public function __construct() - { - $args = func_get_args(); - if (!empty($args)) { - if (is_string($args[0])) { - $this->command = $args[0]; - } else { - throw new InvalidArgumentException('This constructor expects a string argument.'); - } - } - } - /** * Builds the notify-send command to be executed. * diff --git a/src/Builder/TerminalNotifierBuilder.php b/src/Builder/TerminalNotifierBuilder.php index c116681..e667c0f 100644 --- a/src/Builder/TerminalNotifierBuilder.php +++ b/src/Builder/TerminalNotifierBuilder.php @@ -11,23 +11,6 @@ class TerminalNotifierBuilder extends BuilderAbstract */ protected $command = 'terminal-notifier'; - /** - * Constructor. Offers an opportunity to set a command's alias. - * - * @throws InvalidArgumentException If the argument isn't a string. - */ - public function __construct() - { - $args = func_get_args(); - if (!empty($args)) { - if (is_string($args[0])) { - $this->command = $args[0]; - } else { - throw new InvalidArgumentException('This constructor expects a string argument.'); - } - } - } - /** * Builds the terminal-notifier command to be executed. *