| @@ -171,7 +171,7 @@ discard block | ||
| 171 | 171 | * what should we use to validate a host adapter that is being added | 
| 172 | 172 | * to one of the hosts in this group? | 
| 173 | 173 | * | 
| 174 | - * @return \Storyplayer\TestEnvironments\HostAdapterValidator | |
| 174 | + * @return \Storyplayer\SPv3\TestEnvironments\HostAdapterValidator | |
| 175 | 175 | */ | 
| 176 | 176 | public function getHostAdapterValidator() | 
| 177 | 177 |      { | 
| @@ -220,7 +220,7 @@ discard block | ||
| 220 | 220 | /** | 
| 221 | 221 | * how should we provision this environment? | 
| 222 | 222 | * | 
| 223 | - * @return array<ProvisioningAdapters> | |
| 223 | + * @return ProvisioningAdapter[] | |
| 224 | 224 | */ | 
| 225 | 225 | public function getProvisioningAdapters() | 
| 226 | 226 |      { | 
| @@ -265,7 +265,7 @@ discard block | ||
| 265 | 265 | /** | 
| 266 | 266 | * what hosts exist in this group? | 
| 267 | 267 | * | 
| 268 | - * @return array<TestEnvironment_HostDefinition> | |
| 268 | + * @return TestEnvironmentHost[] | |
| 269 | 269 | */ | 
| 270 | 270 | public function getHosts() | 
| 271 | 271 |      { | 
| @@ -74,6 +74,9 @@ discard block | ||
| 74 | 74 | */ | 
| 75 | 75 | protected $storySettings; | 
| 76 | 76 | |
| 77 | + /** | |
| 78 | + * @param string $hostId | |
| 79 | + */ | |
| 77 | 80 | public function __construct(TestEnvironment_GroupDefinition $parentGroup, $hostId) | 
| 78 | 81 |      { | 
| 79 | 82 | $this->setParentGroup($parentGroup); | 
| @@ -494,7 +497,7 @@ discard block | ||
| 494 | 497 | /** | 
| 495 | 498 | * get access to the adapter for the group that we belong to | 
| 496 | 499 | * | 
| 497 | - * @return \Storyplayer\TestEnvironments\GroupAdapter | |
| 500 | + * @return \Storyplayer\SPv3\TestEnvironments\GroupAdapter | |
| 498 | 501 | */ | 
| 499 | 502 | public function getGroupAdapter() | 
| 500 | 503 |      { | 
| @@ -61,75 +61,75 @@ | ||
| 61 | 61 | |
| 62 | 62 | class Dsbuild_Adapter implements ProvisioningAdapter | 
| 63 | 63 |  { | 
| 64 | - public function __construct() | |
| 65 | -	{ | |
| 66 | - $this->setExecutePath(getcwd() . DIRECTORY_SEPARATOR . "dsbuild.sh"); | |
| 67 | - } | |
| 68 | - | |
| 69 | - // ================================================================== | |
| 70 | - // | |
| 71 | - // Support for executing the script | |
| 72 | - // | |
| 73 | - // ------------------------------------------------------------------ | |
| 74 | - | |
| 75 | - /** | |
| 76 | - * where is the script that we are going to execute? | |
| 77 | - * | |
| 78 | - * @var string | |
| 79 | - */ | |
| 80 | - protected $executePath; | |
| 81 | - | |
| 82 | - /** | |
| 83 | - * which folder are we executing things in? | |
| 84 | - * | |
| 85 | - * @return string | |
| 86 | - */ | |
| 87 | - public function getExecuteDir() | |
| 88 | -	{ | |
| 89 | - return dirname($this->executePath); | |
| 90 | - } | |
| 91 | - | |
| 92 | - /** | |
| 93 | - * where is the script that we are going to execute? | |
| 94 | - * | |
| 95 | - * @return string | |
| 96 | - */ | |
| 97 | - public function getExecutePath() | |
| 98 | -	{ | |
| 99 | - return $this->executePath; | |
| 100 | - } | |
| 101 | - | |
| 102 | - /** | |
| 103 | - * tell me which script to execute | |
| 104 | - * | |
| 105 | - * @param string $path | |
| 106 | - * path to the dsbuild script | |
| 107 | - */ | |
| 108 | - public function setExecutePath($path) | |
| 109 | -	{ | |
| 110 | - $this->executePath = $path; | |
| 111 | - | |
| 112 | - return $this; | |
| 113 | - } | |
| 114 | - | |
| 115 | - // ================================================================== | |
| 116 | - // | |
| 117 | - // SPv3.0-style config support | |
| 118 | - // | |
| 119 | - // ------------------------------------------------------------------ | |
| 120 | - | |
| 121 | - public function getAsConfig() | |
| 122 | -	{ | |
| 123 | - // our return value | |
| 124 | - $retval = new BaseObject; | |
| 125 | - | |
| 126 | - // this is who we are | |
| 127 | - $retval->engine = "dsbuild"; | |
| 128 | - | |
| 129 | - // this is what needs running | |
| 130 | - $retval->execute = $this->getExecutePath(); | |
| 131 | - | |
| 132 | - // all done | |
| 133 | - return $retval; | |
| 134 | - } | |
| 64 | + public function __construct() | |
| 65 | +    { | |
| 66 | + $this->setExecutePath(getcwd() . DIRECTORY_SEPARATOR . "dsbuild.sh"); | |
| 67 | + } | |
| 68 | + | |
| 69 | + // ================================================================== | |
| 70 | + // | |
| 71 | + // Support for executing the script | |
| 72 | + // | |
| 73 | + // ------------------------------------------------------------------ | |
| 74 | + | |
| 75 | + /** | |
| 76 | + * where is the script that we are going to execute? | |
| 77 | + * | |
| 78 | + * @var string | |
| 79 | + */ | |
| 80 | + protected $executePath; | |
| 81 | + | |
| 82 | + /** | |
| 83 | + * which folder are we executing things in? | |
| 84 | + * | |
| 85 | + * @return string | |
| 86 | + */ | |
| 87 | + public function getExecuteDir() | |
| 88 | +    { | |
| 89 | + return dirname($this->executePath); | |
| 90 | + } | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * where is the script that we are going to execute? | |
| 94 | + * | |
| 95 | + * @return string | |
| 96 | + */ | |
| 97 | + public function getExecutePath() | |
| 98 | +    { | |
| 99 | + return $this->executePath; | |
| 100 | + } | |
| 101 | + | |
| 102 | + /** | |
| 103 | + * tell me which script to execute | |
| 104 | + * | |
| 105 | + * @param string $path | |
| 106 | + * path to the dsbuild script | |
| 107 | + */ | |
| 108 | + public function setExecutePath($path) | |
| 109 | +    { | |
| 110 | + $this->executePath = $path; | |
| 111 | + | |
| 112 | + return $this; | |
| 113 | + } | |
| 114 | + | |
| 115 | + // ================================================================== | |
| 116 | + // | |
| 117 | + // SPv3.0-style config support | |
| 118 | + // | |
| 119 | + // ------------------------------------------------------------------ | |
| 120 | + | |
| 121 | + public function getAsConfig() | |
| 122 | +    { | |
| 123 | + // our return value | |
| 124 | + $retval = new BaseObject; | |
| 125 | + | |
| 126 | + // this is who we are | |
| 127 | + $retval->engine = "dsbuild"; | |
| 128 | + | |
| 129 | + // this is what needs running | |
| 130 | + $retval->execute = $this->getExecutePath(); | |
| 131 | + | |
| 132 | + // all done | |
| 133 | + return $retval; | |
| 134 | + } | |
| 135 | 135 | } | 
| @@ -59,12 +59,12 @@ | ||
| 59 | 59 | |
| 60 | 60 | interface OsAdapterValidator | 
| 61 | 61 |  { | 
| 62 | - /** | |
| 63 | - * validate an operating system adapter | |
| 64 | - * | |
| 65 | - * @param OsAdapter $osAdapter | |
| 66 | - * the adapter to validate | |
| 67 | - * @return void | |
| 68 | - */ | |
| 69 | - public function validate(OsAdapter $osAdapter); | |
| 62 | + /** | |
| 63 | + * validate an operating system adapter | |
| 64 | + * | |
| 65 | + * @param OsAdapter $osAdapter | |
| 66 | + * the adapter to validate | |
| 67 | + * @return void | |
| 68 | + */ | |
| 69 | + public function validate(OsAdapter $osAdapter); | |
| 70 | 70 | } | 
| @@ -60,9 +60,9 @@ | ||
| 60 | 60 | */ | 
| 61 | 61 | class Vagrant_E4xx_NoVagrantFile extends Vagrant_E4xx_Exception | 
| 62 | 62 |  { | 
| 63 | - public function __construct($candidates) | |
| 64 | -	{ | |
| 65 | -		$msg = "Cannot find your Vagrantfile. Expected to find it in one of these folders: " . implode(", ", $candidates); | |
| 66 | - parent::__construct(400, $msg, $msg); | |
| 67 | - } | |
| 63 | + public function __construct($candidates) | |
| 64 | +    { | |
| 65 | +        $msg = "Cannot find your Vagrantfile. Expected to find it in one of these folders: " . implode(", ", $candidates); | |
| 66 | + parent::__construct(400, $msg, $msg); | |
| 67 | + } | |
| 68 | 68 | } | 
| @@ -59,48 +59,48 @@ discard block | ||
| 59 | 59 | |
| 60 | 60 | class Vagrant_GroupAdapter implements GroupAdapter | 
| 61 | 61 |  { | 
| 62 | - public function __construct() | |
| 63 | -	{ | |
| 64 | - $this->determineBaseFolder(); | |
| 65 | - } | |
| 62 | + public function __construct() | |
| 63 | +    { | |
| 64 | + $this->determineBaseFolder(); | |
| 65 | + } | |
| 66 | 66 | |
| 67 | - // ================================================================== | |
| 68 | - // | |
| 69 | - // Base folder support goes here | |
| 70 | - // | |
| 71 | - // ------------------------------------------------------------------ | |
| 67 | + // ================================================================== | |
| 68 | + // | |
| 69 | + // Base folder support goes here | |
| 70 | + // | |
| 71 | + // ------------------------------------------------------------------ | |
| 72 | 72 | |
| 73 | - protected $baseFolder; | |
| 73 | + protected $baseFolder; | |
| 74 | 74 | |
| 75 | - /** | |
| 76 | - * automagically work out where our test environment's files and | |
| 77 | - * such like are | |
| 78 | - * | |
| 79 | - * @return void | |
| 80 | - */ | |
| 81 | - protected function determineBaseFolder() | |
| 82 | -	{ | |
| 83 | - // where should we be looking? | |
| 84 | - // | |
| 85 | - // first match wins! | |
| 86 | - $candidates = [ | |
| 87 | - dirname(debug_backtrace()[1]['file']), | |
| 88 | - getcwd() | |
| 89 | - ]; | |
| 75 | + /** | |
| 76 | + * automagically work out where our test environment's files and | |
| 77 | + * such like are | |
| 78 | + * | |
| 79 | + * @return void | |
| 80 | + */ | |
| 81 | + protected function determineBaseFolder() | |
| 82 | +    { | |
| 83 | + // where should we be looking? | |
| 84 | + // | |
| 85 | + // first match wins! | |
| 86 | + $candidates = [ | |
| 87 | + dirname(debug_backtrace()[1]['file']), | |
| 88 | + getcwd() | |
| 89 | + ]; | |
| 90 | 90 | |
| 91 | -		foreach ($candidates as $folder) { | |
| 92 | -			if (file_exists($folder . '/Vagrantfile')) { | |
| 93 | - $this->baseFolder = str_replace(getcwd(), '.', $folder); | |
| 91 | +        foreach ($candidates as $folder) { | |
| 92 | +            if (file_exists($folder . '/Vagrantfile')) { | |
| 93 | + $this->baseFolder = str_replace(getcwd(), '.', $folder); | |
| 94 | 94 | |
| 95 | - // all done | |
| 96 | - return; | |
| 97 | - } | |
| 98 | - } | |
| 95 | + // all done | |
| 96 | + return; | |
| 97 | + } | |
| 98 | + } | |
| 99 | 99 | |
| 100 | - // if we get here, then we do not know where the Vagrantfile | |
| 101 | - // is, and it is time to bail | |
| 102 | - throw new Vagrant_E4xx_NoVagrantFile($candidates); | |
| 103 | - } | |
| 100 | + // if we get here, then we do not know where the Vagrantfile | |
| 101 | + // is, and it is time to bail | |
| 102 | + throw new Vagrant_E4xx_NoVagrantFile($candidates); | |
| 103 | + } | |
| 104 | 104 | |
| 105 | 105 | /** | 
| 106 | 106 | * which folder should SPv3 be in when interacting with this group | 
| @@ -110,33 +110,33 @@ discard block | ||
| 110 | 110 | */ | 
| 111 | 111 | public function getBaseFolder() | 
| 112 | 112 |      { | 
| 113 | - return $this->baseFolder; | |
| 113 | + return $this->baseFolder; | |
| 114 | 114 | } | 
| 115 | 115 | |
| 116 | - // ================================================================== | |
| 117 | - // | |
| 118 | - // Host support goes here | |
| 119 | - // | |
| 120 | - // ------------------------------------------------------------------ | |
| 116 | + // ================================================================== | |
| 117 | + // | |
| 118 | + // Host support goes here | |
| 119 | + // | |
| 120 | + // ------------------------------------------------------------------ | |
| 121 | 121 | |
| 122 | - /** | |
| 123 | - * how do we validate any host adapters used by hosts in this group? | |
| 124 | - * | |
| 125 | - * @return HostAdapterValidator | |
| 126 | - */ | |
| 127 | - public function getHostAdapterValidator() | |
| 128 | -	{ | |
| 129 | - return new Vagrant_HostAdapterValidator($this); | |
| 130 | - } | |
| 122 | + /** | |
| 123 | + * how do we validate any host adapters used by hosts in this group? | |
| 124 | + * | |
| 125 | + * @return HostAdapterValidator | |
| 126 | + */ | |
| 127 | + public function getHostAdapterValidator() | |
| 128 | +    { | |
| 129 | + return new Vagrant_HostAdapterValidator($this); | |
| 130 | + } | |
| 131 | 131 | |
| 132 | - // ================================================================== | |
| 133 | - // | |
| 134 | - // Stuff to support SPv3.0-style internals goes here | |
| 135 | - // | |
| 136 | - // Everything below here is technical debt, and the plan is to | |
| 137 | - // gradually phase it all out over several SPv3 releases | |
| 138 | - // | |
| 139 | - // ------------------------------------------------------------------ | |
| 132 | + // ================================================================== | |
| 133 | + // | |
| 134 | + // Stuff to support SPv3.0-style internals goes here | |
| 135 | + // | |
| 136 | + // Everything below here is technical debt, and the plan is to | |
| 137 | + // gradually phase it all out over several SPv3 releases | |
| 138 | + // | |
| 139 | + // ------------------------------------------------------------------ | |
| 140 | 140 | |
| 141 | 141 | /** | 
| 142 | 142 | * what type of group are we? | 
| @@ -146,8 +146,8 @@ discard block | ||
| 146 | 146 | * | 
| 147 | 147 | * @return string | 
| 148 | 148 | */ | 
| 149 | - public function getType() | |
| 150 | -	{ | |
| 151 | - return "LocalVagrantVms"; | |
| 152 | - } | |
| 149 | + public function getType() | |
| 150 | +    { | |
| 151 | + return "LocalVagrantVms"; | |
| 152 | + } | |
| 153 | 153 | } | 
| @@ -59,20 +59,20 @@ | ||
| 59 | 59 | |
| 60 | 60 | class Vagrant_HostAdapterValidator implements HostAdapterValidator | 
| 61 | 61 |  { | 
| 62 | - /** | |
| 63 | - * check to make sure that a host adapter plugin is compatible with | |
| 64 | - * the group adapter | |
| 65 | - * | |
| 66 | - * @param HostAdapter $hostAdapter | |
| 67 | - * the adapter to validate | |
| 68 | - * @return boolean | |
| 69 | - */ | |
| 70 | - public function validate(HostAdapter $hostAdapter) | |
| 71 | -	{ | |
| 72 | -		if (!$hostAdapter instanceof Vagrant_HostAdapter) { | |
| 73 | - return false; | |
| 74 | - } | |
| 62 | + /** | |
| 63 | + * check to make sure that a host adapter plugin is compatible with | |
| 64 | + * the group adapter | |
| 65 | + * | |
| 66 | + * @param HostAdapter $hostAdapter | |
| 67 | + * the adapter to validate | |
| 68 | + * @return boolean | |
| 69 | + */ | |
| 70 | + public function validate(HostAdapter $hostAdapter) | |
| 71 | +    { | |
| 72 | +        if (!$hostAdapter instanceof Vagrant_HostAdapter) { | |
| 73 | + return false; | |
| 74 | + } | |
| 75 | 75 | |
| 76 | - return true; | |
| 77 | - } | |
| 76 | + return true; | |
| 77 | + } | |
| 78 | 78 | } | 
| @@ -62,18 +62,18 @@ | ||
| 62 | 62 | |
| 63 | 63 | class Vagrant_VirtualboxHostAdapter extends Vagrant_HostAdapter | 
| 64 | 64 |  { | 
| 65 | - /** | |
| 66 | - * create an empty host definition for this kind of host | |
| 67 | - * | |
| 68 | - * @param TestEnvironment_GroupDefinition $groupDef | |
| 69 | - * the group that we belong to | |
| 70 | - * @param string $hostId | |
| 71 | - * the alias for this host | |
| 72 | - * @return object | |
| 73 | - * a host definition to populate | |
| 74 | - */ | |
| 75 | - public function newHostDefinition(TestEnvironment_GroupDefinition $groupDef, $hostId) | |
| 76 | -	{ | |
| 77 | - return new Vagrant_VirtualboxHostDefinition($groupDef, $hostId, $this); | |
| 78 | - } | |
| 65 | + /** | |
| 66 | + * create an empty host definition for this kind of host | |
| 67 | + * | |
| 68 | + * @param TestEnvironment_GroupDefinition $groupDef | |
| 69 | + * the group that we belong to | |
| 70 | + * @param string $hostId | |
| 71 | + * the alias for this host | |
| 72 | + * @return object | |
| 73 | + * a host definition to populate | |
| 74 | + */ | |
| 75 | + public function newHostDefinition(TestEnvironment_GroupDefinition $groupDef, $hostId) | |
| 76 | +    { | |
| 77 | + return new Vagrant_VirtualboxHostDefinition($groupDef, $hostId, $this); | |
| 78 | + } | |
| 79 | 79 | } | 
| @@ -61,15 +61,15 @@ | ||
| 61 | 61 | |
| 62 | 62 | interface HostAdapter | 
| 63 | 63 |  { | 
| 64 | - /** | |
| 65 | - * create an empty host definition for this kind of host | |
| 66 | - * | |
| 67 | - * @param TestEnvironment_GroupDefinition $groupDef | |
| 68 | - * the group that we belong to | |
| 69 | - * @param string $hostId | |
| 70 | - * the alias for this host | |
| 71 | - * @return object | |
| 72 | - * a host definition to populate | |
| 73 | - */ | |
| 74 | - public function newHostDefinition(TestEnvironment_GroupDefinition $groupDef, $hostId); | |
| 64 | + /** | |
| 65 | + * create an empty host definition for this kind of host | |
| 66 | + * | |
| 67 | + * @param TestEnvironment_GroupDefinition $groupDef | |
| 68 | + * the group that we belong to | |
| 69 | + * @param string $hostId | |
| 70 | + * the alias for this host | |
| 71 | + * @return object | |
| 72 | + * a host definition to populate | |
| 73 | + */ | |
| 74 | + public function newHostDefinition(TestEnvironment_GroupDefinition $groupDef, $hostId); | |
| 75 | 75 | } |