Code improvements (#1649)

* use global namespace for faster lookups
* phpstan level 5
This commit is contained in:
Kevin Papst
2020-04-19 14:37:14 +02:00
committed by GitHub
parent 7b25e9acaf
commit 0f3fa8fdbe
183 changed files with 604 additions and 574 deletions

View File

@@ -119,7 +119,7 @@ class TimesheetQuery extends ActivityQuery
*/
public function getActivity()
{
if (count($this->activities) > 0) {
if (\count($this->activities) > 0) {
return $this->activities[0];
}
@@ -189,7 +189,7 @@ class TimesheetQuery extends ActivityQuery
public function setState($state)
{
$state = (int) $state;
if (in_array($state, [self::STATE_ALL, self::STATE_RUNNING, self::STATE_STOPPED], true)) {
if (\in_array($state, [self::STATE_ALL, self::STATE_RUNNING, self::STATE_STOPPED], true)) {
$this->state = $state;
}
@@ -211,7 +211,7 @@ class TimesheetQuery extends ActivityQuery
public function setExported($exported)
{
$exported = (int) $exported;
if (in_array($exported, [self::STATE_ALL, self::STATE_EXPORTED, self::STATE_NOT_EXPORTED], true)) {
if (\in_array($exported, [self::STATE_ALL, self::STATE_EXPORTED, self::STATE_NOT_EXPORTED], true)) {
$this->exported = $exported;
}