Skip to content
This repository was archived by the owner on Mar 28, 2026. It is now read-only.

Commit a52247a

Browse files
committed
Merge branch 'dev' of https://github.com/zachleigh/yarak into dev
2 parents 558ae96 + b755db2 commit a52247a

18 files changed

Lines changed: 86 additions & 93 deletions

src/Commands/YarakCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class YarakCommand extends Command
1515

1616
/**
1717
* Construct.
18-
*
18+
*
1919
* @param array $configArray
2020
*/
2121
public function __construct(array $configArray)

src/DB/ConnectionResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ConnectionResolver
1010
* Get connection to database.
1111
*
1212
* @param array $dbConfig
13-
*
13+
*
1414
* @return Phalcon\Db\Adapter\Pdo
1515
*/
1616
public function getConnection(array $dbConfig)

src/Helpers/Str.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static function studly($value)
3333
return $studlyCache[$key];
3434
}
3535

36-
$value = ucwords(str_replace(array('-', '_'), ' ', $value));
36+
$value = ucwords(str_replace(['-', '_'], ' ', $value));
3737

3838
return $studlyCache[$key] = str_replace(' ', '', $value);
3939
}

src/Helpers/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function dd()
1313
array_map(function ($x) {
1414
$string = (new Dump(null, true))->variable($x);
1515

16-
echo (PHP_SAPI == 'cli' ? strip_tags($string) . PHP_EOL : $string);
16+
echo PHP_SAPI == 'cli' ? strip_tags($string).PHP_EOL : $string;
1717
}, func_get_args());
1818

1919
die(1);

src/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Kernel
1717

1818
/**
1919
* Construct.
20-
*
20+
*
2121
* @param array $config
2222
*/
2323
public function __construct(array $config)
@@ -36,7 +36,7 @@ public function handle($input = null, $output = null)
3636

3737
if ($input && $output) {
3838
$application->setAutoExit(false);
39-
39+
4040
return $application->run($input, $output);
4141
}
4242

src/Migrations/CreateMigrationsTable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ public function up(Pdo $connection)
2020
[
2121
'columns' => [
2222
new Column('migration', [
23-
'type' => Column::TYPE_VARCHAR,
24-
'size' => 250,
23+
'type' => Column::TYPE_VARCHAR,
24+
'size' => 250,
2525
'notNull' => true,
2626
]),
2727
new Column('batch', [
28-
'type' => Column::TYPE_INTEGER,
29-
'size' => 10,
28+
'type' => Column::TYPE_INTEGER,
29+
'size' => 10,
3030
'notNull' => true,
3131
]),
3232
],

src/Migrations/MigrationRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface MigrationRepository
66
{
7-
/**
7+
/**
88
* Set the repository connection on the object.
99
*
1010
* @param Pdo $connection

src/Yarak.php

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

33
namespace Yarak;
44

5-
use Yarak\Kernel;
65
use Phalcon\Di\FactoryDefault;
76
use Symfony\Component\Console\Input\ArrayInput;
87
use Symfony\Component\Console\Output\NullOutput;
@@ -12,8 +11,8 @@ class Yarak
1211
/**
1312
* Call a Yarak console command.
1413
*
15-
* @param array $arguments Argument array.
16-
* @param array $config Config values, for testing purposes.
14+
* @param array $arguments Argument array.
15+
* @param array $config Config values, for testing purposes.
1716
*/
1817
public static function call(array $arguments, array $config = [])
1918
{

tests/Concerns/DatabaseConcerns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait DatabaseConcerns
99
*
1010
* @return Phalcon\Db\Adapter\Pdo
1111
*/
12-
abstract function getConnection();
12+
abstract public function getConnection();
1313

1414
/**
1515
* Assert that a given where condition exists in the database.

tests/Integration/MigrateTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function it_runs_migrations()
2121
$this->seeTableDoesntExist('posts');
2222

2323
Yarak::call([
24-
'command' => 'migrate'
24+
'command' => 'migrate',
2525
], $this->getConfig()->getAll());
2626

2727
$this->seeTableExists('users');
@@ -30,12 +30,12 @@ public function it_runs_migrations()
3030

3131
$this->seeInDatabase('migrations', [
3232
'migration' => '2017_01_01_000001_create_users_table',
33-
'batch' => 1
33+
'batch' => 1,
3434
]);
3535

3636
$this->seeInDatabase('migrations', [
3737
'migration' => '2017_01_01_000002_create_posts_table',
38-
'batch' => 1
38+
'batch' => 1,
3939
]);
4040
}
4141

@@ -53,20 +53,20 @@ public function it_rollsback_single_step()
5353
$this->seeTableExists('posts');
5454

5555
Yarak::call([
56-
'command' => 'migrate',
57-
'--rollback' => true
56+
'command' => 'migrate',
57+
'--rollback' => true,
5858
], $this->getConfig()->getAll());
5959

6060
$this->seeTableDoesntExist('users');
6161

6262
$this->seeTableDoesntExist('posts');
6363

6464
$this->dontSeeInDatabase('migrations', [
65-
'migration' => '2017_01_01_000001_create_users_table'
65+
'migration' => '2017_01_01_000001_create_users_table',
6666
]);
6767

6868
$this->dontSeeInDatabase('migrations', [
69-
'migration' => '2017_01_01_000002_create_posts_table'
69+
'migration' => '2017_01_01_000002_create_posts_table',
7070
]);
7171
}
7272

@@ -84,20 +84,20 @@ public function it_rollsback_mutliple_steps()
8484
$this->seeTableExists('posts');
8585

8686
Yarak::call([
87-
'command' => 'migrate',
88-
'--rollback' => 2
87+
'command' => 'migrate',
88+
'--rollback' => 2,
8989
], $this->getConfig()->getAll());
9090

9191
$this->seeTableDoesntExist('users');
9292

9393
$this->seeTableDoesntExist('posts');
9494

9595
$this->dontSeeInDatabase('migrations', [
96-
'migration' => '2017_01_01_000001_create_users_table'
96+
'migration' => '2017_01_01_000001_create_users_table',
9797
]);
9898

9999
$this->dontSeeInDatabase('migrations', [
100-
'migration' => '2017_01_01_000002_create_posts_table'
100+
'migration' => '2017_01_01_000002_create_posts_table',
101101
]);
102102
}
103103

@@ -116,19 +116,19 @@ public function it_resets_the_database()
116116

117117
Yarak::call([
118118
'command' => 'migrate',
119-
'--reset' => true
119+
'--reset' => true,
120120
], $this->getConfig()->getAll());
121121

122122
$this->seeTableDoesntExist('users');
123123

124124
$this->seeTableDoesntExist('posts');
125125

126126
$this->dontSeeInDatabase('migrations', [
127-
'migration' => '2017_01_01_000001_create_users_table'
127+
'migration' => '2017_01_01_000001_create_users_table',
128128
]);
129129

130130
$this->dontSeeInDatabase('migrations', [
131-
'migration' => '2017_01_01_000002_create_posts_table'
131+
'migration' => '2017_01_01_000002_create_posts_table',
132132
]);
133133
}
134134

@@ -147,17 +147,17 @@ public function it_refreshes_the_database()
147147

148148
$this->seeInDatabase('migrations', [
149149
'migration' => '2017_01_01_000001_create_users_table',
150-
'batch' => 1
150+
'batch' => 1,
151151
]);
152152

153153
$this->seeInDatabase('migrations', [
154154
'migration' => '2017_01_01_000002_create_posts_table',
155-
'batch' => 2
155+
'batch' => 2,
156156
]);
157157

158158
Yarak::call([
159-
'command' => 'migrate',
160-
'--refresh' => true
159+
'command' => 'migrate',
160+
'--refresh' => true,
161161
], $this->getConfig()->getAll());
162162

163163
$this->seeTableExists('users');
@@ -166,12 +166,12 @@ public function it_refreshes_the_database()
166166

167167
$this->seeInDatabase('migrations', [
168168
'migration' => '2017_01_01_000001_create_users_table',
169-
'batch' => 1
169+
'batch' => 1,
170170
]);
171171

172172
$this->seeInDatabase('migrations', [
173173
'migration' => '2017_01_01_000002_create_posts_table',
174-
'batch' => 1
174+
'batch' => 1,
175175
]);
176176
}
177177
}

0 commit comments

Comments
 (0)