@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function register() |
| 43 | 43 | { |
| 44 | 44 | $container = $this->getContainer(); |
| 45 | - $container->singleton(Services::HELPERSET, function () use ($container) { |
|
| 45 | + $container->singleton(Services::HELPERSET, function() use ($container) { |
|
| 46 | 46 | $helperSet = new HelperSet(); |
| 47 | 47 | $helperSet->set($container->get(Services::HELPERSET_QUESTION), 'question'); |
| 48 | 48 | |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $container->singleton(Services::MIGRATION_FACTORY, SimpleFactory::class); |
| 53 | 53 | |
| 54 | - $container->singleton(Services::REPOSITORY_FILESYSTEM, function (Config $appConfig) { |
|
| 54 | + $container->singleton(Services::REPOSITORY_FILESYSTEM, function(Config $appConfig) { |
|
| 55 | 55 | $adapter = new Local(dirname($appConfig->getConfigFilePath())); |
| 56 | 56 | |
| 57 | 57 | return new Filesystem($adapter); |
| 58 | 58 | })->withArgument(Services::CONFIG); |
| 59 | 59 | |
| 60 | - $container->singleton(Services::REPOSITORY, function (Config $config, FactoryInterface $migrationFactory) { |
|
| 60 | + $container->singleton(Services::REPOSITORY, function(Config $config, FactoryInterface $migrationFactory) { |
|
| 61 | 61 | $migrationsDir = $config->getMigrationsDirectoryPath(); |
| 62 | 62 | if (!is_dir($migrationsDir)) { |
| 63 | 63 | $result = mkdir($migrationsDir, 0777, true); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | // make sure classes in the migration directory are autoloaded |
| 72 | 72 | /** @var \Composer\Autoload\ClassLoader $autoloader */ |
| 73 | 73 | $autoloader = $this->getContainer()->get(Services::AUTOLOADER); |
| 74 | - $autoloader->addPsr4($config->getMigrationsNamespace().'\\', $migrationsDir); |
|
| 74 | + $autoloader->addPsr4($config->getMigrationsNamespace() . '\\', $migrationsDir); |
|
| 75 | 75 | |
| 76 | 76 | return new DirectoryRepository($migrationsDir, $migrationFactory); |
| 77 | 77 | })->withArguments([Services::CONFIG, Services::MIGRATION_FACTORY]); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | public function register() |
| 43 | 43 | { |
| 44 | 44 | $container = $this->getContainer(); |
| 45 | - $container->singleton(Services::STORAGE, function (Config $config) { |
|
| 45 | + $container->singleton(Services::STORAGE, function(Config $config) { |
|
| 46 | 46 | $storageFile = $config->getStorageFilePath(); |
| 47 | 47 | $result = touch($storageFile); |
| 48 | 48 | if (!$result) { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | $container->singleton( |
| 54 | 54 | Services::TIMELINE, |
| 55 | - function (RepositoryInterface $repository, StorageInterface $storage, ComparatorInterface $comparator) { |
|
| 55 | + function(RepositoryInterface $repository, StorageInterface $storage, ComparatorInterface $comparator) { |
|
| 56 | 56 | $available = $repository->fetchAll(); |
| 57 | 57 | $migrated = $storage->fetchAll(); |
| 58 | 58 | $factory = new TimelineFactory($available, $migrated); |
@@ -95,8 +95,7 @@ |
||
| 95 | 95 | foreach ($arrays[$i] as $v) { |
| 96 | 96 | foreach ($tmp as $t) { |
| 97 | 97 | $result[] = is_array($t) ? |
| 98 | - array_merge(array($v), $t) : |
|
| 99 | - array($v, $t); |
|
| 98 | + array_merge(array($v), $t) : array($v, $t); |
|
| 100 | 99 | } |
| 101 | 100 | } |
| 102 | 101 | |
@@ -80,8 +80,8 @@ |
||
| 80 | 80 | public function executeProvider() |
| 81 | 81 | { |
| 82 | 82 | return [ |
| 83 | - [ true ], |
|
| 84 | - [ false ], |
|
| 83 | + [true], |
|
| 84 | + [false], |
|
| 85 | 85 | ]; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -64,8 +64,8 @@ |
||
| 64 | 64 | 'setAliases' => [ |
| 65 | 65 | 'with' => [['init']], |
| 66 | 66 | ], |
| 67 | - [ 'name' => 'setDescription', |
|
| 68 | - 'with' => m::type('string'),] |
|
| 67 | + ['name' => 'setDescription', |
|
| 68 | + 'with' => m::type('string'), ] |
|
| 69 | 69 | ]; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -207,28 +207,28 @@ |
||
| 207 | 207 | public function handleProvider() |
| 208 | 208 | { |
| 209 | 209 | return [ |
| 210 | - [ // simple test |
|
| 210 | + [// simple test |
|
| 211 | 211 | ['SimpleTitle' => 'SimpleTitle'], |
| 212 | 212 | ['SimpleNamespace' => 'SimpleNamespace'], |
| 213 | 213 | true, // success |
| 214 | 214 | ], |
| 215 | - [ // simple test with editor cmd |
|
| 215 | + [// simple test with editor cmd |
|
| 216 | 216 | ['SimpleTitle' => 'SimpleTitle'], |
| 217 | 217 | ['SimpleNamespace' => 'SimpleNamespace'], |
| 218 | 218 | true, |
| 219 | 219 | 'which' // FIXME: it would be better to test whether this gets called |
| 220 | 220 | ], |
| 221 | - [ // test null namespace (load from config) |
|
| 221 | + [// test null namespace (load from config) |
|
| 222 | 222 | ['SimpleTitle' => 'SimpleTitle'], |
| 223 | 223 | [0 => 'SimpleNamespace'], |
| 224 | 224 | true, |
| 225 | 225 | ], |
| 226 | - [ // test write failure |
|
| 226 | + [// test write failure |
|
| 227 | 227 | ['SimpleTitle' => 'SimpleTitle'], |
| 228 | 228 | ['SimpleNamespace\\' => 'SimpleNamespace'], // also test trailing \ in namespace name |
| 229 | 229 | false, |
| 230 | 230 | ], |
| 231 | - [ // test title and namespace sanitizing |
|
| 231 | + [// test title and namespace sanitizing |
|
| 232 | 232 | ['I!n@v@a#l$i%d=_-+^T&i*t(l)e' => 'Invalid_Title'], |
| 233 | 233 | ['I!n@v#a$l%i^d&_¶N*a(m)e∞s-p+a=ce' => 'Invalid_Namespace'], |
| 234 | 234 | true, |
@@ -55,22 +55,22 @@ |
||
| 55 | 55 | protected function getExpectations() |
| 56 | 56 | { |
| 57 | 57 | return [ |
| 58 | - [ 'name' => 'setName', |
|
| 58 | + ['name' => 'setName', |
|
| 59 | 59 | 'with' => 'migrations:create', |
| 60 | 60 | ], |
| 61 | - [ 'name' => 'setAliases', |
|
| 61 | + ['name' => 'setAliases', |
|
| 62 | 62 | 'with' => [['create']], |
| 63 | 63 | ], |
| 64 | - [ 'name' => 'setDescription', |
|
| 64 | + ['name' => 'setDescription', |
|
| 65 | 65 | 'with' => [m::type('string')], |
| 66 | 66 | ], |
| 67 | - [ 'name' => 'addArgument', |
|
| 67 | + ['name' => 'addArgument', |
|
| 68 | 68 | 'with' => ['title', m::any(), m::type('string'), m::any()] |
| 69 | 69 | ], |
| 70 | - [ 'name' => 'addOption', |
|
| 70 | + ['name' => 'addOption', |
|
| 71 | 71 | 'with' => ['namespace', m::any(), InputOption::VALUE_OPTIONAL, m::type('string'), m::any()] |
| 72 | 72 | ], |
| 73 | - [ 'name' => 'addOption', |
|
| 73 | + ['name' => 'addOption', |
|
| 74 | 74 | 'with' => ['editor-cmd', m::any(), InputOption::VALUE_OPTIONAL, m::type('string')] |
| 75 | 75 | ], |
| 76 | 76 | ]; |