Skip to content

Commit f16b23f

Browse files
committed
Merge branch 'cleanup'
2 parents 2bf259e + a00d70e commit f16b23f

File tree

130 files changed

+862
-553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+862
-553
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
__DIR__ . '/src',
66
__DIR__ . '/stubs',
77
__DIR__ . '/tests/unit',
8+
__DIR__ . '/tests/fixtures',
89
__DIR__ . '/lk-util',
910
__DIR__ . '/scripts',
1011
])
@@ -22,6 +23,7 @@
2223
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
2324
'no_unneeded_import_alias' => true,
2425
'no_unused_imports' => true,
26+
'phpdoc_no_useless_inheritdoc' => true,
2527
'single_import_per_statement' => true,
2628
'yoda_style' => ['equal' => false, 'identical' => false],
2729
])

bootstrap.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php declare(strict_types=1);
22

3-
if (\Composer\InstalledVersions::isInstalled('adodb/adodb-php')) {
4-
require \Composer\InstalledVersions::getInstallPath('adodb/adodb-php') . '/adodb-exceptions.inc.php';
3+
use Composer\InstalledVersions;
4+
5+
if (InstalledVersions::isInstalled('adodb/adodb-php')) {
6+
require InstalledVersions::getInstallPath('adodb/adodb-php') . '/adodb-exceptions.inc.php';
57
}

lk-util/Command/Generate/GenerateTests.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Lkrms\LkUtil\Command\Generate\Concept\GenerateCommand;
99
use Lkrms\Utility\Reflect;
1010
use Lkrms\Utility\Str;
11+
use PHPUnit\Framework\TestCase;
1112

1213
/**
1314
* Generates PHPUnit tests
@@ -140,7 +141,7 @@ protected function run(string ...$args)
140141

141142
$this->Extends[] = $classPrefix . (
142143
$extends === null
143-
? \PHPUnit\Framework\TestCase::class
144+
? TestCase::class
144145
: $extends
145146
);
146147

scripts/generate.php

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33

44
use Lkrms\Cli\CliApplication;
55
use Lkrms\Cli\CliOption;
6+
use Lkrms\Cli\CliOptionBuilder;
67
use Lkrms\Console\Catalog\ConsoleLevel as Level;
78
use Lkrms\Console\ConsoleWriter;
89
use Lkrms\Container\Application;
910
use Lkrms\Container\Container;
1011
use Lkrms\Curler\Support\CurlerPage;
12+
use Lkrms\Curler\Support\CurlerPageBuilder;
1113
use Lkrms\Curler\Curler;
14+
use Lkrms\Curler\CurlerBuilder;
15+
use Lkrms\Facade\App;
16+
use Lkrms\Facade\Cache;
1217
use Lkrms\Facade\Console;
18+
use Lkrms\Facade\DI;
19+
use Lkrms\Facade\Err;
20+
use Lkrms\Facade\Event;
21+
use Lkrms\Facade\Profile;
22+
use Lkrms\Facade\Sync;
1323
use Lkrms\LkUtil\Catalog\EnvVar;
1424
use Lkrms\LkUtil\Command\Generate\Concept\GenerateCommand;
1525
use Lkrms\LkUtil\Command\Generate\GenerateBuilder;
@@ -21,9 +31,13 @@
2131
use Lkrms\Support\EventDispatcher;
2232
use Lkrms\Support\Timekeeper;
2333
use Lkrms\Sync\Support\DbSyncDefinition;
34+
use Lkrms\Sync\Support\DbSyncDefinitionBuilder;
2435
use Lkrms\Sync\Support\HttpSyncDefinition;
36+
use Lkrms\Sync\Support\HttpSyncDefinitionBuilder;
2537
use Lkrms\Sync\Support\SyncError;
38+
use Lkrms\Sync\Support\SyncErrorBuilder;
2639
use Lkrms\Sync\Support\SyncSerializeRules;
40+
use Lkrms\Sync\Support\SyncSerializeRulesBuilder;
2741
use Lkrms\Sync\Support\SyncStore;
2842
use Lkrms\Tests\Sync\Entity\Album;
2943
use Lkrms\Tests\Sync\Entity\Comment;
@@ -38,24 +52,24 @@
3852
$loader = require dirname(__DIR__) . '/vendor/autoload.php';
3953

4054
$facades = [
41-
Application::class => \Lkrms\Facade\App::class,
42-
CacheStore::class => \Lkrms\Facade\Cache::class,
43-
ConsoleWriter::class => \Lkrms\Facade\Console::class,
44-
Container::class => \Lkrms\Facade\DI::class,
45-
ErrorHandler::class => [\Lkrms\Facade\Err::class, '--skip', 'handleShutdown,handleError,handleException'],
46-
EventDispatcher::class => \Lkrms\Facade\Event::class,
47-
SyncStore::class => \Lkrms\Facade\Sync::class,
48-
Timekeeper::class => \Lkrms\Facade\Profile::class,
55+
Application::class => App::class,
56+
CacheStore::class => Cache::class,
57+
ConsoleWriter::class => Console::class,
58+
Container::class => DI::class,
59+
ErrorHandler::class => [Err::class, '--skip', 'handleShutdown,handleError,handleException'],
60+
EventDispatcher::class => Event::class,
61+
SyncStore::class => Sync::class,
62+
Timekeeper::class => Profile::class,
4963
];
5064

5165
$builders = [
52-
CliOption::class => [\Lkrms\Cli\CliOptionBuilder::class, '--forward=load'],
53-
Curler::class => [\Lkrms\Curler\CurlerBuilder::class, '--forward', '--skip', 'responseContentTypeIs,getQueryUrl'],
54-
CurlerPage::class => \Lkrms\Curler\Support\CurlerPageBuilder::class,
55-
DbSyncDefinition::class => \Lkrms\Sync\Support\DbSyncDefinitionBuilder::class,
56-
HttpSyncDefinition::class => \Lkrms\Sync\Support\HttpSyncDefinitionBuilder::class,
57-
SyncError::class => \Lkrms\Sync\Support\SyncErrorBuilder::class,
58-
SyncSerializeRules::class => \Lkrms\Sync\Support\SyncSerializeRulesBuilder::class,
66+
CliOption::class => [CliOptionBuilder::class, '--forward=load'],
67+
Curler::class => [CurlerBuilder::class, '--forward', '--skip', 'responseContentTypeIs,getQueryUrl'],
68+
CurlerPage::class => CurlerPageBuilder::class,
69+
DbSyncDefinition::class => DbSyncDefinitionBuilder::class,
70+
HttpSyncDefinition::class => HttpSyncDefinitionBuilder::class,
71+
SyncError::class => SyncErrorBuilder::class,
72+
SyncSerializeRules::class => SyncSerializeRulesBuilder::class,
5973
];
6074

6175
$entities = [

src/Cli/Catalog/CliHelpSectionName.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace Lkrms\Cli\Catalog;
44

5+
use Lkrms\Cli\CliCommand;
56
use Lkrms\Concept\Dictionary;
67

78
/**
89
* Section names commonly used in help messages / manual pages
910
*
1011
* @extends Dictionary<string>
1112
*
12-
* @see \Lkrms\Cli\CliCommand::getHelpSections()
13+
* @see CliCommand::getHelpSections()
1314
*/
1415
final class CliHelpSectionName extends Dictionary
1516
{

src/Cli/Catalog/CliOptionValueType.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Lkrms\Cli\Catalog;
44

55
use Lkrms\Concept\ConvertibleEnumeration;
6+
use Lkrms\Utility\Test;
7+
use DateTimeImmutable;
68
use LogicException;
79

810
/**
@@ -15,8 +17,7 @@ final class CliOptionValueType extends ConvertibleEnumeration
1517
/**
1618
* A boolean value
1719
*
18-
* Boolean strings recognised by {@see \Lkrms\Utility\Test::isBoolValue()}
19-
* are accepted.
20+
* Boolean strings recognised by {@see Test::isBoolValue()} are accepted.
2021
*/
2122
public const BOOLEAN = 0;
2223

@@ -36,7 +37,7 @@ final class CliOptionValueType extends ConvertibleEnumeration
3637
* A date and/or time
3738
*
3839
* Strings understood by {@see strtotime()} are accepted and normalised to
39-
* {@see \DateTimeImmutable} instances.
40+
* {@see DateTimeImmutable} instances.
4041
*/
4142
public const DATE = 3;
4243

src/Cli/CliOption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ private function doLoad(): void
478478
}
479479
if (
480480
$this->DefaultValue && (
481-
Arr::sameValues($this->DefaultValue, $values) ||
481+
Arr::same($this->DefaultValue, $values) ||
482482
in_array('ALL', $this->DefaultValue, true)
483483
)
484484
) {

src/Cli/Exception/CliInvalidArgumentsException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
namespace Lkrms\Cli\Exception;
44

5+
use Lkrms\Exception\MultipleErrorException;
6+
57
/**
68
* Thrown when invalid command line arguments are given
79
*/
8-
class CliInvalidArgumentsException extends \Lkrms\Exception\MultipleErrorException
10+
class CliInvalidArgumentsException extends MultipleErrorException
911
{
1012
public function __construct(string ...$errors)
1113
{

src/Cli/Exception/CliUnknownValueException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace Lkrms\Cli\Exception;
44

5+
use Lkrms\Exception\Exception;
6+
57
/**
68
* Thrown when an unknown value is rejected by a command line option
79
*/
8-
class CliUnknownValueException extends \Lkrms\Exception\Exception {}
10+
class CliUnknownValueException extends Exception {}

src/Concern/TConstructible.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
namespace Lkrms\Concern;
44

55
use Lkrms\Container\Container;
6+
use Lkrms\Contract\IConstructible;
67
use Lkrms\Contract\IContainer;
8+
use Lkrms\Contract\IExtensible;
79
use Lkrms\Contract\ITreeable;
810
use Lkrms\Support\Catalog\ArrayKeyConformity;
911
use Lkrms\Support\Introspector;
@@ -12,7 +14,7 @@
1214
/**
1315
* Implements IConstructible to create instances from associative arrays
1416
*
15-
* @see \Lkrms\Contract\IConstructible
17+
* @see IConstructible
1618
*/
1719
trait TConstructible
1820
{
@@ -21,9 +23,8 @@ trait TConstructible
2123
*
2224
* The constructor (if any) is invoked with parameters taken from `$data`.
2325
* If `$data` values remain, they are assigned to writable properties. If
24-
* further values remain and the class implements
25-
* {@see \Lkrms\Contract\IExtensible}, they are assigned via
26-
* {@see \Lkrms\Contract\IExtensible::setMetaProperty()}.
26+
* further values remain and the class implements {@see IExtensible}, they
27+
* are assigned via {@see IExtensible::setMetaProperty()}.
2728
*
2829
* Array keys, constructor parameters and public property names are
2930
* normalised for comparison.

0 commit comments

Comments
 (0)