GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

LazyLoadedResource::__get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace prgTW\BaseCRM\Resource;
4
5
abstract class LazyLoadedResource extends Resource
6
{
7
	/** {@inheritdoc} */
8
	public function __get($name)
9
	{
10
		$this->lazyLoadIfNecessary();
11
12
		return parent::__get($name);
13
	}
14
15
	protected function lazyLoadIfNecessary()
16
	{
17
		if (null === $this->data)
18
		{
19
			$this->lazyLoad();
20
		}
21
	}
22
23
	abstract protected function lazyLoad();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
24
}
25