WorkerCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 6 1
A execute() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of Jitamin.
5
 *
6
 * Copyright (C) Jitamin Team
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Jitamin\Console;
13
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
/**
18
 * Class WorkerCommand.
19
 */
20
class WorkerCommand extends BaseCommand
21
{
22
    /**
23
     * Configure the console command.
24
     *
25
     * @return void
26
     */
27
    protected function configure()
28
    {
29
        $this
30
            ->setName('worker')
31
            ->setDescription('Execute queue worker');
32
    }
33
34
    /**
35
     * Execute the console command.
36
     *
37
     * @param InputInterface  $output
38
     * @param OutputInterface $output
39
     *
40
     * @return void
41
     */
42
    protected function execute(InputInterface $input, OutputInterface $output)
43
    {
44
        $this->queueManager->listen();
0 ignored issues
show
Documentation introduced by
The property queueManager does not exist on object<Jitamin\Console\WorkerCommand>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
45
    }
46
}
47