Skip to content

Commit a19ca28

Browse files
committed
Add migration files and index.php to PHPCS, fix lint errors
Exclude CSS
1 parent 1df27f4 commit a19ca28

File tree

8 files changed

+96
-117
lines changed

8 files changed

+96
-117
lines changed
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare( strict_types = 1 );
44

55
namespace DoctrineMigrations;
66

@@ -10,26 +10,23 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20170623203059 extends AbstractMigration
14-
{
15-
/**
16-
* @param Schema $schema
17-
*/
18-
public function up(Schema $schema): void
19-
{
20-
$table = $schema->createTable('usage_timeline');
21-
$table->addColumn('id', 'integer', ['autoincrement' => true]);
22-
$table->addColumn('date', 'date');
23-
$table->addColumn('tool', 'string');
24-
$table->addColumn('count', 'integer');
25-
$table->setPrimaryKey(['id']);
26-
}
13+
final class Version20170623203059 extends AbstractMigration {
14+
/**
15+
* @param Schema $schema
16+
*/
17+
public function up( Schema $schema ): void {
18+
$table = $schema->createTable( 'usage_timeline' );
19+
$table->addColumn( 'id', 'integer', [ 'autoincrement' => true ] );
20+
$table->addColumn( 'date', 'date' );
21+
$table->addColumn( 'tool', 'string' );
22+
$table->addColumn( 'count', 'integer' );
23+
$table->setPrimaryKey( [ 'id' ] );
24+
}
2725

28-
/**
29-
* @param Schema $schema
30-
*/
31-
public function down(Schema $schema): void
32-
{
33-
$schema->dropTable('usage_timeline');
34-
}
26+
/**
27+
* @param Schema $schema
28+
*/
29+
public function down( Schema $schema ): void {
30+
$schema->dropTable( 'usage_timeline' );
31+
}
3532
}
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare( strict_types = 1 );
44

55
namespace DoctrineMigrations;
66

@@ -10,26 +10,23 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20170623205224 extends AbstractMigration
14-
{
15-
/**
16-
* @param Schema $schema
17-
*/
18-
public function up(Schema $schema): void
19-
{
20-
$table = $schema->createTable('usage_projects');
21-
$table->addColumn('id', 'integer', ['autoincrement' => true]);
22-
$table->addColumn('tool', 'string');
23-
$table->addColumn('project', 'string');
24-
$table->addColumn('count', 'integer');
25-
$table->setPrimaryKey(['id']);
26-
}
13+
final class Version20170623205224 extends AbstractMigration {
14+
/**
15+
* @param Schema $schema
16+
*/
17+
public function up( Schema $schema ): void {
18+
$table = $schema->createTable( 'usage_projects' );
19+
$table->addColumn( 'id', 'integer', [ 'autoincrement' => true ] );
20+
$table->addColumn( 'tool', 'string' );
21+
$table->addColumn( 'project', 'string' );
22+
$table->addColumn( 'count', 'integer' );
23+
$table->setPrimaryKey( [ 'id' ] );
24+
}
2725

28-
/**
29-
* @param Schema $schema
30-
*/
31-
public function down(Schema $schema): void
32-
{
33-
$schema->dropTable('usage_projects');
34-
}
26+
/**
27+
* @param Schema $schema
28+
*/
29+
public function down( Schema $schema ): void {
30+
$schema->dropTable( 'usage_projects' );
31+
}
3532
}
Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare( strict_types = 1 );
44

55
namespace DoctrineMigrations;
66

@@ -10,26 +10,23 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20171208040821 extends AbstractMigration
14-
{
15-
/**
16-
* @param Schema $schema
17-
*/
18-
public function up(Schema $schema): void
19-
{
20-
$table = $schema->createTable('usage_api_timeline');
21-
$table->addColumn('id', 'integer', ['autoincrement' => true]);
22-
$table->addColumn('date', 'date');
23-
$table->addColumn('endpoint', 'string');
24-
$table->addColumn('count', 'integer');
25-
$table->setPrimaryKey(['id']);
26-
}
13+
final class Version20171208040821 extends AbstractMigration {
14+
/**
15+
* @param Schema $schema
16+
*/
17+
public function up( Schema $schema ): void {
18+
$table = $schema->createTable( 'usage_api_timeline' );
19+
$table->addColumn( 'id', 'integer', [ 'autoincrement' => true ] );
20+
$table->addColumn( 'date', 'date' );
21+
$table->addColumn( 'endpoint', 'string' );
22+
$table->addColumn( 'count', 'integer' );
23+
$table->setPrimaryKey( [ 'id' ] );
24+
}
2725

28-
/**
29-
* @param Schema $schema
30-
*/
31-
public function down(Schema $schema): void
32-
{
33-
$schema->dropTable('usage_api_timeline');
34-
}
26+
/**
27+
* @param Schema $schema
28+
*/
29+
public function down( Schema $schema ): void {
30+
$schema->dropTable( 'usage_api_timeline' );
31+
}
3532
}
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types=1);
3+
declare( strict_types=1 );
44

55
namespace DoctrineMigrations;
66

@@ -10,17 +10,14 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20190302022255 extends AbstractMigration
14-
{
15-
public function up(Schema $schema) : void
16-
{
17-
$this->addSql('CREATE UNIQUE INDEX date_tool ON usage_timeline (date, tool)');
18-
$this->addSql('CREATE UNIQUE INDEX project_tool ON usage_projects (project, tool)');
19-
}
13+
final class Version20190302022255 extends AbstractMigration {
14+
public function up( Schema $schema ): void {
15+
$this->addSql( 'CREATE UNIQUE INDEX date_tool ON usage_timeline (date, tool)' );
16+
$this->addSql( 'CREATE UNIQUE INDEX project_tool ON usage_projects (project, tool)' );
17+
}
2018

21-
public function down(Schema $schema) : void
22-
{
23-
$this->addSql('DROP INDEX date_tool ON usage_timeline');
24-
$this->addSql('DROP INDEX project_tool ON usage_projects');
25-
}
19+
public function down( Schema $schema ): void {
20+
$this->addSql( 'DROP INDEX date_tool ON usage_timeline' );
21+
$this->addSql( 'DROP INDEX project_tool ON usage_projects' );
22+
}
2623
}
Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types=1);
3+
declare( strict_types=1 );
44

55
namespace DoctrineMigrations;
66

@@ -10,29 +10,25 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20230412051210 extends AbstractMigration
14-
{
15-
public function getDescription() : string
16-
{
17-
return 'Creates the table that stores user sessions.';
18-
}
13+
final class Version20230412051210 extends AbstractMigration {
14+
public function getDescription(): string {
15+
return 'Creates the table that stores user sessions.';
16+
}
1917

20-
public function up(Schema $schema) : void
21-
{
22-
// From https://symfony.com/doc/5.4/session.html#mariadb-mysql
23-
$this->addSql(
24-
"CREATE TABLE `sessions` (
18+
public function up( Schema $schema ): void {
19+
// From https://symfony.com/doc/5.4/session.html#mariadb-mysql
20+
$this->addSql(
21+
"CREATE TABLE `sessions` (
2522
`sess_id` VARBINARY(128) NOT NULL PRIMARY KEY,
2623
`sess_data` BLOB NOT NULL,
2724
`sess_lifetime` INTEGER UNSIGNED NOT NULL,
2825
`sess_time` INTEGER UNSIGNED NOT NULL,
2926
INDEX `sessions_sess_lifetime_idx` (`sess_lifetime`)
3027
) COLLATE utf8mb4_bin, ENGINE = InnoDB;"
31-
);
32-
}
28+
);
29+
}
3330

34-
public function down(Schema $schema) : void
35-
{
36-
$schema->dropTable('sessions');
37-
}
31+
public function down( Schema $schema ): void {
32+
$schema->dropTable( 'sessions' );
33+
}
3834
}
Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types=1);
3+
declare( strict_types=1 );
44

55
namespace DoctrineMigrations;
66

@@ -10,20 +10,16 @@
1010
/**
1111
* Auto-generated Migration: Please modify to your needs!
1212
*/
13-
final class Version20230419221648 extends AbstractMigration
14-
{
15-
public function getDescription() : string
16-
{
17-
return 'Adds unique indexes to usage_api_timeline';
18-
}
13+
final class Version20230419221648 extends AbstractMigration {
14+
public function getDescription(): string {
15+
return 'Adds unique indexes to usage_api_timeline';
16+
}
1917

20-
public function up(Schema $schema) : void
21-
{
22-
$this->addSql('CREATE UNIQUE INDEX date_endpoint ON usage_api_timeline (date, endpoint)');
23-
}
18+
public function up( Schema $schema ): void {
19+
$this->addSql( 'CREATE UNIQUE INDEX date_endpoint ON usage_api_timeline (date, endpoint)' );
20+
}
2421

25-
public function down(Schema $schema) : void
26-
{
27-
$this->addSql('DROP INDEX date_endpoint ON usage_api_timeline');
28-
}
22+
public function down( Schema $schema ): void {
23+
$this->addSql( 'DROP INDEX date_endpoint ON usage_api_timeline' );
24+
}
2925
}

phpcs.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55

66
<file>.</file>
77
<exclude-pattern>vendor/</exclude-pattern>
8-
<exclude-pattern>public/</exclude-pattern>
9-
<exclude-pattern>migrations/</exclude-pattern>
108
<exclude-pattern>var/</exclude-pattern>
119
<exclude-pattern>node_modules/</exclude-pattern>
1210
<exclude-pattern>assets/vendor/</exclude-pattern>
1311
<exclude-pattern>*.js</exclude-pattern>
12+
<exclude-pattern>*.css</exclude-pattern>
1413
<exclude-pattern>bootstrap.php</exclude-pattern>
1514
<exclude-pattern>bin/.phpunit/</exclude-pattern>
1615

public/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
use App\Kernel;
44

5-
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
5+
require_once dirname( __DIR__ ) . '/vendor/autoload_runtime.php';
66

7-
return function (array $context) {
8-
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
7+
return static function ( array $context ) {
8+
return new Kernel( $context['APP_ENV'], (bool)$context['APP_DEBUG'] );
99
};

0 commit comments

Comments
 (0)