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.
Completed
Push — master ( c6d418...25e7de )
by
unknown
23s queued 11s
created

AbstractFacebookBlockService::validate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
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 Core23\FacebookBundle\Block\Service;
13
14
use Facebook\Authentication\AccessToken;
15
use Facebook\Facebook;
16
use Psr\Log\LoggerAwareInterface;
17
use Psr\Log\LoggerAwareTrait;
18
use Psr\Log\NullLogger;
19
use Sonata\BlockBundle\Block\Service\AbstractBlockService;
20
use Sonata\BlockBundle\Block\Service\EditableBlockService;
21
use Sonata\BlockBundle\Form\Mapper\FormMapper;
22
use Sonata\BlockBundle\Model\BlockInterface;
23
use Sonata\Form\Validator\ErrorElement;
24
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface;
25
26
abstract class AbstractFacebookBlockService extends AbstractBlockService implements EditableBlockService, LoggerAwareInterface
27
{
28
    use LoggerAwareTrait;
29
30
    /**
31
     * @var Facebook
32
     */
33
    private $facebook;
34
35
    public function __construct(string $name, EngineInterface $templating, Facebook $connection)
36
    {
37
        parent::__construct($name, $templating);
38
39
        $this->facebook = $connection;
40
        $this->logger   = new NullLogger();
41
    }
42
43
    public function configureCreateForm(FormMapper $form, BlockInterface $block): void
44
    {
45
        $this->configureEditForm($form, $block);
46
    }
47
48
    public function validate(ErrorElement $errorElement, BlockInterface $block): void
49
    {
50
    }
51
52
    protected function getFacebook(): Facebook
53
    {
54
        return $this->facebook;
55
    }
56
57
    final protected function getAccessToken(): AccessToken
58
    {
59
        return $this->facebook->getApp()->getAccessToken();
60
    }
61
}
62