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
Pull Request — integration (#2604)
by Brendan
04:35
created

ImportWorkspace   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 25
rs 10
wmc 3
lcom 0
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 19 3
1
<?php
2
namespace SymphonyCms\Installer\Steps;
3
4
use Configuration;
5
use DatabaseException;
6
use Exception;
7
use Symphony;
8
9
class ImportWorkspace extends DefaultStep
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function handle(Configuration $config, array $data)
15
    {
16
        // MySQL: Importing workspace data
17
        $this->logger->info('MYSQL: Importing existing workspace data');
18
19
        if (is_file(WORKSPACE . '/install.sql')) {
20
            try {
21
                Symphony::Database()->import(file_get_contents(WORKSPACE . '/install.sql'));
22
            } catch (DatabaseException $e) {
23
                throw new Exception(sprintf(
24
                    'There was an error while trying to import data to the database. MySQL returned: %s:%s',
25
                    $e->getDatabaseErrorCode(),
26
                    $e->getDatabaseErrorMessage()
27
                ));
28
            }
29
        }
30
31
        return true;
32
    }
33
}
34