| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function __construct($basePath, $userAgent = '') |
||
| 20 | { |
||
| 21 | $this->parser = Parser::create()->parse($this->getUserAgent($userAgent)); |
||
| 22 | |||
| 23 | $this->userAgent = $this->parser->ua; |
||
| 24 | |||
| 25 | $this->operatingSystem = $this->parser->os; |
||
| 26 | |||
| 27 | $this->device = $this->parser->device; |
||
| 28 | |||
| 29 | $this->basePath = $basePath; |
||
|
|
|||
| 30 | |||
| 31 | $this->originalUserAgent = $this->parser->originalUserAgent; |
||
| 32 | } |
||
| 33 | |||
| 61 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: