| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function getLocks($uri, $returnChildLocks) |
||
| 40 | { |
||
| 41 | $node = $this->fs->findNodeByPath($uri); |
||
| 42 | |||
| 43 | if (!$node->isLocked()) { |
||
| 44 | return []; |
||
| 45 | } |
||
| 46 | |||
| 47 | $lock = $node->getLock(); |
||
| 48 | $info = new LockInfo(); |
||
| 49 | $info->owner = (string) $lock['owner']; |
||
| 50 | $info->token = $lock['id']; |
||
| 51 | $info->timeout = $lock['expire']->toDateTime()->format('U') - time(); |
||
| 52 | $info->created = $lock['created']->toDateTime()->format('U'); |
||
| 53 | $info->uri = $uri; |
||
| 54 | |||
| 55 | return [$info]; |
||
| 56 | } |
||
| 57 | |||
| 76 |