Skip to content

Commit 302a6b0

Browse files
dereuromarkwww-data
authored andcommitted
Auto-fix CS - CS master branch
1 parent 63e7817 commit 302a6b0

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

src/Command/CleanupCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Cake\Console\ConsoleIo;
88
use Cake\Console\ConsoleOptionParser;
99
use Cake\Core\Configure;
10+
use Exception;
1011
use FilesystemIterator;
1112
use RecursiveDirectoryIterator;
1213
use RecursiveIteratorIterator;
@@ -188,7 +189,7 @@ protected function checkImageFileExistence(array $images, Arguments $args, Conso
188189

189190
try {
190191
$adapter = $fileStorage->getStorage($image->adapter);
191-
} catch (\Exception $e) {
192+
} catch (Exception $e) {
192193
$io->error('Could not get adapter for image ' . $image->id . ': ' . $e->getMessage());
193194

194195
continue;

tests/TestCase/Command/ImageVariantGenerateCommandTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Cake\TestSuite\TestCase;
77
use FileStorage\Command\ImageVariantGenerateCommand;
88
use PhpCollective\Infrastructure\Storage\File;
9+
use ReflectionClass;
910

1011
/**
1112
* @uses \FileStorage\Command\ImageVariantGenerateCommand
@@ -98,7 +99,7 @@ public function testEntityToFileObject(): void
9899
$command = new ImageVariantGenerateCommand();
99100

100101
// Set the table on the command via reflection since it's protected
101-
$reflection = new \ReflectionClass($command);
102+
$reflection = new ReflectionClass($command);
102103
$property = $reflection->getProperty('Table');
103104
$property->setAccessible(true);
104105
$property->setValue($command, $table);
@@ -119,7 +120,7 @@ public function testFileObjectToEntity(): void
119120
$command = new ImageVariantGenerateCommand();
120121

121122
// Set the table on the command via reflection since it's protected
122-
$reflection = new \ReflectionClass($command);
123+
$reflection = new ReflectionClass($command);
123124
$property = $reflection->getProperty('Table');
124125
$property->setAccessible(true);
125126
$property->setValue($command, $table);

tests/bootstrap.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
use Cake\Chronos\Chronos;
77
use Cake\Core\Configure;
88
use Cake\Datasource\ConnectionManager;
9+
use Cake\TestSuite\Fixture\SchemaLoader;
10+
use TestApp\Application;
11+
use TestApp\Controller\AppController;
12+
use TestApp\Storage\Validation\ImageValidator;
13+
use TestApp\View\AppView;
914

1015
if (!defined('DS')) {
1116
define('DS', DIRECTORY_SEPARATOR);
@@ -47,10 +52,10 @@
4752
],
4853
]);
4954

50-
class_alias(TestApp\Application::class, 'App\Application');
51-
class_alias(TestApp\Controller\AppController::class, 'App\Controller\AppController');
52-
class_alias(TestApp\View\AppView::class, 'App\View\AppView');
53-
class_alias(TestApp\Storage\Validation\ImageValidator::class, 'App\FileStorage\Validator\ImageValidator');
55+
class_alias(Application::class, 'App\Application');
56+
class_alias(AppController::class, 'App\Controller\AppController');
57+
class_alias(AppView::class, 'App\View\AppView');
58+
class_alias(ImageValidator::class, 'App\FileStorage\Validator\ImageValidator');
5459

5560
//$Tmp = new Folder(TMP);
5661
//$Tmp->create(TMP . 'cache/models', 0770);
@@ -94,7 +99,7 @@ class_alias(TestApp\Storage\Validation\ImageValidator::class, 'App\FileStorage\V
9499
Chronos::setTestNow(Chronos::now());
95100

96101
if (env('FIXTURE_SCHEMA_METADATA')) {
97-
$loader = new Cake\TestSuite\Fixture\SchemaLoader();
102+
$loader = new SchemaLoader();
98103
$loader->loadInternalFile(env('FIXTURE_SCHEMA_METADATA'));
99104
}
100105
Configure::load('example');

0 commit comments

Comments
 (0)