From f8fe1e0b09fc6170d422325ae192003c3240109e Mon Sep 17 00:00:00 2001 From: Kim Henriksen Date: Sat, 20 Apr 2019 22:14:53 +0200 Subject: [PATCH] Changed private scope to protected scoping --- CommandFailedException.php | 2 +- LICENSE | 2 +- Service.php | 10 +++++----- Tests/ServiceTest.php | 14 +++++++------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CommandFailedException.php b/CommandFailedException.php index cedc17c..97d5030 100644 --- a/CommandFailedException.php +++ b/CommandFailedException.php @@ -20,7 +20,7 @@ class CommandFailedException extends \RuntimeException /** * @var Process */ - private $process; + protected $process; /** * @param Process $process diff --git a/LICENSE b/LICENSE index 9cecc1d..c27e4b6 100644 --- a/LICENSE +++ b/LICENSE @@ -92,7 +92,7 @@ on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, +computer or modifying a protected copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. diff --git a/Service.php b/Service.php index 972db5f..8140528 100644 --- a/Service.php +++ b/Service.php @@ -22,22 +22,22 @@ class Service /** * @var string */ - private static $command = 'systemctl'; + protected static $command = 'systemctl'; /** * @var bool */ - private static $sudo = true; + protected static $sudo = true; /** * @var int */ - private static $timeout = 3; + protected static $timeout = 3; /** * @var string */ - private $name; + protected $name; /** * Sets the systemctl command to use. @@ -184,7 +184,7 @@ public function __toString() * * @return Process */ - private function getProcess(array $arguments) + protected function getProcess(array $arguments) { $command = explode(' ', self::$command); if (self::$sudo) { diff --git a/Tests/ServiceTest.php b/Tests/ServiceTest.php index adcc018..a53a3e4 100644 --- a/Tests/ServiceTest.php +++ b/Tests/ServiceTest.php @@ -22,24 +22,24 @@ * @covers \SystemCtl\Service::__construct * @covers \SystemCtl\Service::setCommand * @covers \SystemCtl\Service::sudo - * @covers \SystemCtl\Service:: + * @covers \SystemCtl\Service:: */ class ServiceTest extends TestCase { /** * @var string */ - private $commandFilename; + protected $commandFilename; /** * @var string */ - private $callCountFilename; + protected $callCountFilename; /** * @var int */ - private $callCount = 1; + protected $callCount = 1; protected function setUp() { @@ -270,7 +270,7 @@ public function testExceptionHasProcess() * * @return Service */ - private function getMockedService($name) + protected function getMockedService($name) { $this->commandFilename = tempnam(sys_get_temp_dir(), 'systemctl'); $this->callCountFilename = tempnam(sys_get_temp_dir(), 'systemctl'); @@ -299,7 +299,7 @@ private function getMockedService($name) * @param string[] $arguments List of expected arguments * @param int $exitCode Exit code which the command should return */ - private function expectCall(array $arguments, $exitCode) + protected function expectCall(array $arguments, $exitCode) { $conditions = []; $index = 1; @@ -324,7 +324,7 @@ private function expectCall(array $arguments, $exitCode) /** * Sets no more expected calls to the systemctl command. */ - private function expectNoOtherCalls() + protected function expectNoOtherCalls() { $code = 'fwrite(STDERR, "Invalid call count or arguments specified: ".$c.", ".var_export($argv, true)); exit(250);'."\n";