Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

Changed private scope to protected scoping #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CommandFailedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CommandFailedException extends \RuntimeException
/**
* @var Process
*/
private $process;
protected $process;

/**
* @param Process $process
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 7 additions & 7 deletions Tests/ServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@
* @covers \SystemCtl\Service::__construct
* @covers \SystemCtl\Service::setCommand
* @covers \SystemCtl\Service::sudo
* @covers \SystemCtl\Service::<private>
* @covers \SystemCtl\Service::<protected>
*/
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()
{
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand All @@ -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";

Expand Down