Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d05a860

Browse files
Merge branch 'prepare-next'
2 parents ff27409 + 02c12db commit d05a860

File tree

20 files changed

+160
-119
lines changed

20 files changed

+160
-119
lines changed

‎.tools/.report/.build/coverage.txt‎

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

33
Code Coverage Report Summary:
44
Classes: 100.00% (207/207)
5-
Methods: 100.00% (737/737)
6-
Lines: 100.00% (3718/3718)
5+
Methods: 100.00% (736/736)
6+
Lines: 100.00% (3715/3715)
77

‎.tools/.report/.deptrac/.deptrac.report‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Violations 0
66
Skipped violations 0
77
Uncovered 177
8-
Allowed 2543
8+
Allowed 2545
99
Warnings 0
1010
Errors 0
1111
-------------------- ------

‎.tools/.report/.phploc/.src.phploc.report‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Directories 77
44
Files 419
55

66
Size
7-
Lines of Code (LOC) 13578
8-
Comment Lines of Code (CLOC) 739 (5.44%)
9-
Non-Comment Lines of Code (NCLOC) 12839 (94.56%)
10-
Logical Lines of Code (LLOC) 1419 (10.45%)
11-
Classes 1318 (92.88%)
7+
Lines of Code (LOC) 13573
8+
Comment Lines of Code (CLOC) 737 (5.43%)
9+
Non-Comment Lines of Code (NCLOC) 12836 (94.57%)
10+
Logical Lines of Code (LLOC) 1418 (10.45%)
11+
Classes 1317 (92.88%)
1212
Average Class Length 3
1313
Minimum Class Length 0
1414
Maximum Class Length 27
@@ -36,12 +36,12 @@ Dependencies
3636
Global Constants 0 (0.00%)
3737
Global Variables 0 (0.00%)
3838
Super-Global Variables 0 (0.00%)
39-
Attribute Accesses 604
40-
Non-Static 588 (97.35%)
39+
Attribute Accesses 603
40+
Non-Static 587 (97.35%)
4141
Static 16 (2.65%)
42-
Method Calls 758
43-
Non-Static 681 (89.84%)
44-
Static 77 (10.16%)
42+
Method Calls 755
43+
Non-Static 678 (89.80%)
44+
Static 77 (10.20%)
4545

4646
Structure
4747
Namespaces 77
@@ -52,14 +52,14 @@ Structure
5252
Concrete Classes 191 (93.17%)
5353
Final Classes 70 (36.65%)
5454
Non-Final Classes 121 (63.35%)
55-
Methods 968
55+
Methods 969
5656
Scope
57-
Non-Static Methods 903 (93.29%)
57+
Non-Static Methods 904 (93.29%)
5858
Static Methods 65 (6.71%)
5959
Visibility
60-
Public Methods 763 (78.82%)
61-
Protected Methods 64 (6.61%)
62-
Private Methods 141 (14.57%)
60+
Public Methods 764 (78.84%)
61+
Protected Methods 64 (6.60%)
62+
Private Methods 141 (14.55%)
6363
Functions 37
6464
Named Functions 7 (18.92%)
6565
Anonymous Functions 30 (81.08%)

‎.tools/.report/.phploc/.test.phploc.report‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Directories 74
44
Files 273
55

66
Size
7-
Lines of Code (LOC) 30544
7+
Lines of Code (LOC) 30609
88
Comment Lines of Code (CLOC) 458 (1.50%)
9-
Non-Comment Lines of Code (NCLOC) 30086 (98.50%)
10-
Logical Lines of Code (LLOC) 6687 (21.89%)
11-
Classes 6679 (99.88%)
9+
Non-Comment Lines of Code (NCLOC) 30151 (98.50%)
10+
Logical Lines of Code (LLOC) 6711 (21.92%)
11+
Classes 6703 (99.88%)
1212
Average Class Length 24
1313
Minimum Class Length 0
1414
Maximum Class Length 871
@@ -24,7 +24,7 @@ Size
2424

2525
Cyclomatic Complexity
2626
Average Complexity per LLOC 0.07
27-
Average Complexity per Class 2.60
27+
Average Complexity per Class 2.59
2828
Minimum Class Complexity 1.00
2929
Maximum Class Complexity 16.00
3030
Average Complexity per Method 1.26
@@ -39,9 +39,9 @@ Dependencies
3939
Attribute Accesses 28
4040
Non-Static 23 (82.14%)
4141
Static 5 (17.86%)
42-
Method Calls 9132
43-
Non-Static 5989 (65.58%)
44-
Static 3143 (34.42%)
42+
Method Calls 9164
43+
Non-Static 6009 (65.57%)
44+
Static 3155 (34.43%)
4545

4646
Structure
4747
Namespaces 74
@@ -52,14 +52,14 @@ Structure
5252
Concrete Classes 266 (98.52%)
5353
Final Classes 248 (93.23%)
5454
Non-Final Classes 18 (6.77%)
55-
Methods 1724
55+
Methods 1726
5656
Scope
57-
Non-Static Methods 1616 (93.74%)
57+
Non-Static Methods 1618 (93.74%)
5858
Static Methods 108 (6.26%)
5959
Visibility
60-
Public Methods 1036 (60.09%)
61-
Protected Methods 313 (18.16%)
62-
Private Methods 375 (21.75%)
60+
Public Methods 1038 (60.14%)
61+
Protected Methods 313 (18.13%)
62+
Private Methods 375 (21.73%)
6363
Functions 90
6464
Named Functions 2 (2.22%)
6565
Anonymous Functions 88 (97.78%)

‎doc/usage.md‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ $driver = \AlecRabbit\Spinner\Facade::getDriver();
2424

2525
while (true) {
2626
$driver->render();
27-
usleep(100000);
27+
// do some work
2828
}
2929
```
3030

@@ -49,13 +49,7 @@ class Dots extends ACharPalette {
4949
protected function sequence(): Traversable
5050
{
5151
// note the width of each element
52-
$a = [' ', '. ', '.. ', '...', ' ..', ' .', ' '];
53-
54-
if ($this->options->getReversed()) {
55-
$a = array_reverse($a);
56-
}
57-
58-
yield from $a;
52+
yield from [' ', '. ', '.. ', '...', ' ..', ' .', ' '];
5953
}
6054
}
6155
```
@@ -67,7 +61,7 @@ class Greeny extends AStylePalette {
6761
protected function ansi4StyleFrames(): Traversable
6862
{
6963
yield from [
70-
$this->createFrame("\e[92m%s\e[39m"),
64+
$this->createFrame("\e[92m%s\e[39m"), // note the ANSI codes
7165
];
7266
}
7367

‎example/async/bootstrap.async.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ static function (IContainer $container): IDriverLinker {
2929
},
3030
IServiceDefinition::SINGLETON,
3131
),
32-
);
33-
34-
// Register driver linker with output factory
35-
$registry->bind(
32+
// Register driver linker decorator factory
3633
new ServiceDefinition(IDriverLinkerDecoratorFactory::class, DriverLinkerDecoratorFactory::class),
3734
);
3835

‎example/benchmark/container.php‎

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,32 +45,28 @@
4545

4646
$registry = DefinitionRegistry::getInstance();
4747

48-
$registry->bind(new ServiceDefinition(ITimer::class, new MicrosecondTimer()));
49-
$registry->bind(new ServiceDefinition(IDriverProviderFactory::class, BenchmarkingDriverProviderFactory::class));
50-
$registry->bind(new ServiceDefinition(IResultMaker::class, ResultMaker::class));
51-
$registry->bind(new ServiceDefinition(IBenchmarkResultsFactory::class, BenchmarkResultsFactory::class));
52-
$registry->bind(new ServiceDefinition(IBenchmarkingDriverFactory::class, BenchmarkingDriverFactory::class));
53-
$registry->bind(new ServiceDefinition(IBenchmarkingDriverBuilder::class, BenchmarkingDriverBuilder::class));
54-
$registry->bind(new ServiceDefinition(IBenchmarkFactory::class, BenchmarkFactory::class));
55-
$registry->bind(new ServiceDefinition(IMeasurementFactory::class, MeasurementFactory::class));
56-
$registry->bind(new ServiceDefinition(IStopwatchBuilder::class, StopwatchBuilder::class));
57-
$registry->bind(new ServiceDefinition(IStopwatchFactory::class, StopwatchFactory::class));
58-
$registry->bind(new ServiceDefinition(IReportPrinterBuilder::class, ReportPrinterBuilder::class));
59-
$registry->bind(new ServiceDefinition(IReportFormatter::class, ReportFormatter::class));
60-
$registry->bind(new ServiceDefinition(IDatetimeFormatter::class, DatetimeFormatter::class));
61-
$registry->bind(new ServiceDefinition(IResultFormatter::class, ResultFormatter::class));
62-
$registry->bind(new ServiceDefinition(IKeyFormatter::class, KeyFormatter::class));
63-
6448
$registry->bind(
49+
new ServiceDefinition(ITimer::class, new MicrosecondTimer()),
50+
new ServiceDefinition(IDriverProviderFactory::class, BenchmarkingDriverProviderFactory::class),
51+
new ServiceDefinition(IResultMaker::class, ResultMaker::class),
52+
new ServiceDefinition(IBenchmarkResultsFactory::class, BenchmarkResultsFactory::class),
53+
new ServiceDefinition(IBenchmarkingDriverFactory::class, BenchmarkingDriverFactory::class),
54+
new ServiceDefinition(IBenchmarkingDriverBuilder::class, BenchmarkingDriverBuilder::class),
55+
new ServiceDefinition(IBenchmarkFactory::class, BenchmarkFactory::class),
56+
new ServiceDefinition(IMeasurementFactory::class, MeasurementFactory::class),
57+
new ServiceDefinition(IStopwatchBuilder::class, StopwatchBuilder::class),
58+
new ServiceDefinition(IStopwatchFactory::class, StopwatchFactory::class),
59+
new ServiceDefinition(IReportPrinterBuilder::class, ReportPrinterBuilder::class),
60+
new ServiceDefinition(IReportFormatter::class, ReportFormatter::class),
61+
new ServiceDefinition(IDatetimeFormatter::class, DatetimeFormatter::class),
62+
new ServiceDefinition(IResultFormatter::class, ResultFormatter::class),
63+
new ServiceDefinition(IKeyFormatter::class, KeyFormatter::class),
6564
new ServiceDefinition(
6665
IReportPrinter::class,
6766
static function (ContainerInterface $container): IReportPrinter {
6867
return $container->get(IReportPrinterFactory::class)->create();
6968
}
7069
),
71-
);
72-
73-
$registry->bind(
7470
new ServiceDefinition(
7571
IReportPrinterFactory::class,
7672
static function (ContainerInterface $container): IReportPrinterFactory {

‎example/benchmark/container.sync.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ public function write(Traversable $data): void
2222
}
2323
}
2424
),
25-
);
26-
27-
$registry->bind(
2825
new ServiceDefinition(
2926
IDeltaTimer::class,
3027
new class() implements IDeltaTimer {

‎src/Spinner/Container/Contract/IDefinitionRegistry.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ interface IDefinitionRegistry
1313
*/
1414
public function load(): Traversable;
1515

16-
public function bind(IServiceDefinition $serviceDefinition): void;
16+
public function bind(IServiceDefinition ...$serviceDefinitions): void;
1717
}

‎src/Spinner/Container/DefinitionRegistry.php‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ public function load(): Traversable
3636
yield from $this->definitions;
3737
}
3838

39-
public function bind(IServiceDefinition $serviceDefinition): void
39+
public function bind(IServiceDefinition ...$serviceDefinitions): void
4040
{
41-
$this->definitions->offsetSet($serviceDefinition->getId(), $serviceDefinition);
41+
foreach ($serviceDefinitions as $serviceDefinition) {
42+
$this->definitions->offsetSet($serviceDefinition->getId(), $serviceDefinition);
43+
}
4244
}
4345
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /