Issues (71)

app/bin/schema-drop.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
require __DIR__.'./../vendor/autoload.php';
6
7
use App\Kernel;
8
use Doctrine\ORM\Tools\SchemaTool;
0 ignored issues
show
The type Doctrine\ORM\Tools\SchemaTool was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
$kernel = new Kernel('test', true);
11
$kernel->boot();
12
$container = $kernel->getContainer();
13
14
$manager = $container->get('doctrine')->getManager();
15
$metadatas = $manager->getMetadataFactory()->getAllMetadata();
16
$schemaTool = new SchemaTool($manager);
17
$sqls = $schemaTool->getCreateSchemaSql($metadatas);
18
echo "Schema droping.... \n";
19
$schemaTool->dropSchema($metadatas);
20
/** @var \Doctrine\DBAL\Connection $connection */
21
$connection = $container->get('doctrine')->getConnection();
22
$connection->beginTransaction();
23
$connection->query('DROP TABLE `event_streams`;');
24
$connection->commit();
25
$connection->close();
26
if (empty($sqls)) {
27
    echo "Nothing to Drop \n";
28
29
    return 0;
30
}
31
echo "Schema Drop \n";
32