Issues (109)

src/EoC/Info/ServerInfo.php (3 issues)

1
<?php
2
3
/**
4
 * @file ServerInfo.php
5
 * @brief This file contains the ServerInfo class.
6
 * @details
7
 * @author Filippo F. Fadda
8
 */
9
10
11
//! The CouchDB's information namespace.
12
namespace EoC\Info;
13
14
15
use Meta\Extension;
16
17
18
/**
19
 * @brief This class contains the CouchDB's version and MOTD. It's used by Couch::getSvrInfo() method.
20
 * @details Since this class uses the `TProperty` trait, you don't need to call the getter methods to obtain information
21
 * about server.
22
 * @nosubgrouping
23
 *
24
 * @cond HIDDEN_SYMBOLS
25
 *
26
 * @property string $motd
27
 * @property string $version
28
 *
29
 * @endcond
30
 */
31
class ServerInfo {
32
  use Extension\TProperty;
33
34
  /** @name Properties */
35
  //!@{
0 ignored issues
show
Unused Code Comprehensibility introduced by
100% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
36
37
  //! CouchDB MOTD (Message Of The Day).
38
  private $motd;
39
40
  //! CouchDB server version.
41
  private $version;
42
43
  //!@}
0 ignored issues
show
Unused Code Comprehensibility introduced by
100% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
44
45
46
  /**
47
   * @brief Creates the object.
48
   */
49
  public function __construct($motd, $version) {
50
    $this->motd = $motd;
51
    $this->version = "CouchDB ".$version;
52
  }
53
54
55
  /**
56
   * @brief Overrides the magic method to convert the object to a string.
57
   */
58
  public function __toString() {
59
    return $this->motd.PHP_EOL.$this->version.PHP_EOL;
60
  }
61
62
63
  //! @cond HIDDEN_SYMBOLS
64
65
  public function getMotd() {
66
    return $this->motd;
67
  }
68
69
70
  public function getVersion() {
71
    return $this->version;
72
  }
73
74
  //! @endcond
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
75
76
}