Skip to content

Commit f01e63e

Browse files
committed
Add some doc block comments with dynamic properties & return types
This doesn't cover all but some of the classes / methods.
1 parent f41356e commit f01e63e

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
99
## Fixed
1010
Cant restore snapshot from VM
1111

12+
## Dev
13+
Add some dynamic properties and return types to satisfy phpstan
14+
1215
# [0.23.0]
1316

1417
## Changed

src/Endpoint/Images.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use Opensaucesystems\Lxd\Exception\InvalidEndpointException;
66

7+
/**
8+
* @property-read \Opensaucesystems\Lxd\Endpoint\Images\Aliases $aliases
9+
*/
710
class Images extends AbstractEndpoint
811
{
912
protected function getEndpoint()
@@ -44,7 +47,7 @@ public function all(int $recursion = 0)
4447
* @param string $secret Secret to access private image by untrusted client
4548
* @return object
4649
*/
47-
public function info($fingerprint, $secret = null)
50+
public function info($fingerprint, $secret = null) :array
4851
{
4952
$endpoint = $this->getEndpoint().$fingerprint;
5053
if (!empty($secret)) {

src/Endpoint/InstaceBase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
use Opensaucesystems\Lxd\Exception\SourceImageException;
88
use Opensaucesystems\Lxd\Exception\InvalidEndpointException;
99

10+
/**
11+
* @property-read \Opensaucesystems\Lxd\Endpoint\Instance\Snapshots $snapshots
12+
* @property-read \Opensaucesystems\Lxd\Endpoint\Instance\Files $files
13+
* @property-read \Opensaucesystems\Lxd\Endpoint\Instance\Logs $logs
14+
* @property-read \Opensaucesystems\Lxd\Endpoint\Instance\Backups $backups
15+
*/
1016
abstract class InstaceBase extends AbstractEndpoint
1117
{
1218
/**

src/Endpoint/Warnings.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use Opensaucesystems\Lxd\Exception\InvalidEndpointException;
66

7+
/**
8+
* @property-read \Opensaucesystems\Lxd\Endpoint\Warnings\Status $status
9+
*/
710
class Warnings extends AbstractEndpoint
811
{
912
protected function getEndpoint()

0 commit comments

Comments
 (0)