Skip to content

Commit 33988b8

Browse files
committed
Причесывание.
1 parent faea3e1 commit 33988b8

File tree

13 files changed

+69
-46
lines changed

13 files changed

+69
-46
lines changed

src/Bundles/BundlesLoader.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
*/
2525
class BundlesLoader
2626
{
27-
/** @const string PATH_BUNDLES_CONFIG Путь к конфигурационному файлу. */
27+
/**
28+
* @const string PATH_BUNDLES_CONFIG Путь к конфигурационному файлу.
29+
*/
2830
private const PATH_BUNDLES_CONFIG = '/local/configs/standalone_bundles.php';
2931

3032
/**
@@ -55,6 +57,7 @@ public function __construct(
5557
$configPath = $configPath ?: self::PATH_BUNDLES_CONFIG;
5658

5759
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $configPath)) {
60+
/* @noinspection PhpIncludeInspection */
5861
$this->bundles = require $_SERVER['DOCUMENT_ROOT'] . $configPath;
5962
}
6063

@@ -97,10 +100,7 @@ public function load() : void
97100

98101
// Сделать все приватные подписчики событий публичными.
99102
// Без этого они почему-то не подхватываются при загрузке бандлов.
100-
$this->container->addCompilerPass(
101-
new MakePrivateEventsPublic()
102-
103-
);
103+
$this->container->addCompilerPass(new MakePrivateEventsPublic());
104104

105105
// Сделать все приватные команды публичными.
106106
// Без этого они почему-то не подхватываются при загрузке бандлов.

src/CompilePasses/AddTaggedCompilerPass.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,21 @@ public function __construct(
105105
* Lower priority means called earlier.
106106
* If no priority provided, defaults to 0.
107107
*
108-
* @param string $priorityAttribute
108+
* @param string $priorityAttribute Priority attribute.
109109
*
110110
* @return $this
111111
*/
112112
public function enablePriority(string $priorityAttribute = 'priority'): self
113113
{
114114
$this->priorityAttribute = $priorityAttribute;
115+
115116
return $this;
116117
}
117118

118119
/**
119120
* Sets call mode to one of CALL_MODE_* constants
120121
*
121-
* @param string $callMode
122+
* @param string $callMode Call mode.
122123
*
123124
* @return $this
124125
*/
@@ -132,6 +133,7 @@ public function setCallMode(string $callMode): self
132133
* @param ContainerBuilder $container
133134
*
134135
* @return void
136+
* @throws InvalidConfigurationException When no such service.
135137
*/
136138
public function process(ContainerBuilder $container): void
137139
{
@@ -181,7 +183,8 @@ private function prioritizeTags(array $tags) : array
181183
return $tags;
182184
}
183185

184-
usort($tags,
186+
usort(
187+
$tags,
185188
/**
186189
* @param array $tag1
187190
* @param array $tag2
@@ -193,16 +196,17 @@ function (array $tag1, array $tag2) {
193196
$tag2Priority = $tag2['attributes'][$this->priorityAttribute] ?? 0;
194197

195198
return $tag1Priority - $tag2Priority;
196-
});
199+
}
200+
);
197201

198202
return $tags;
199203
}
200204

201205
/**
202206
* Can be overwritten in extended classes
203207
*
204-
* @param ContainerBuilder $container
205-
* @param string $id
208+
* @param ContainerBuilder $container Container.
209+
* @param string $id Service Id.
206210
*
207211
* @return mixed returns argument to pass to the collector service
208212
*/

src/CompilePasses/AggregatedTaggedServicesPass.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
* @since 06.11.2020 Добавление к уже существующим параметрам, а не перезаписывание. Позволяет бандлам
1717
* подмешивать свои добавления.
1818
*/
19-
class AggregatedTaggedServicesPass implements CompilerPassInterface
19+
final class AggregatedTaggedServicesPass implements CompilerPassInterface
2020
{
21-
/** @const string TAG_BOOTSTRAP_SERVICES Тэг сервисов запускающихся при загрузке. */
22-
protected const TAG_BOOTSTRAP_SERVICES = 'service.bootstrap';
21+
/**
22+
* @const string TAG_BOOTSTRAP_SERVICES Тэг сервисов запускающихся при загрузке.
23+
*/
24+
private const TAG_BOOTSTRAP_SERVICES = 'service.bootstrap';
2325

24-
/** @const string VARIABLE_CONTAINER Название переменной в контейнере. */
25-
protected const VARIABLE_CONTAINER = '_bootstrap';
26+
/**
27+
* @const string VARIABLE_CONTAINER Название переменной в контейнере.
28+
*/
29+
private const VARIABLE_CONTAINER = '_bootstrap';
2630

2731
/**
2832
* Движуха.

src/CompilePasses/TagPass/AbstractTagPass.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,17 @@ protected function addCall(
4242

4343
array_splice(
4444
$methodCalls,
45-
(int)array_search('configure',
45+
(int)array_search(
46+
'configure',
4647
array_map(
4748
/**
4849
* @return mixed
4950
*/
5051
function (array $call) {
5152
return $call[0];
52-
}, $methodCalls)
53+
},
54+
$methodCalls
55+
)
5356
),
5457
0,
5558
[[$method, [new Reference($taggedServiceId)]]]

src/CompilePasses/TagPass/TagPass.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function process(ContainerBuilder $container) : void
7474
$taggedServices = $this->sortByPriority($taggedServices);
7575

7676
foreach ($taggedServices as $taggedServiceId => $tags) {
77-
foreach ($this->destinations as $destination) {
78-
$this->addCall($destination['id'], $destination['method'], $taggedServiceId);
79-
}
80-
}
77+
foreach ($this->destinations as $destination) {
78+
$this->addCall($destination['id'], $destination['method'], $taggedServiceId);
79+
}
80+
}
8181
}
8282
}

src/CompilePasses/ValidateServiceDefinitions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ final class ValidateServiceDefinitions implements CompilerPassInterface
3434
*
3535
* @inheritDoc
3636
*
37+
* @return void
3738
* @throws Exception
3839
*/
3940
public function process(ContainerBuilder $container) : void

src/Framework/SymfonyCompilerPassBagInterface.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
interface SymfonyCompilerPassBagInterface
1212
{
1313
/**
14-
* @param array $standartCompilerPasses
14+
* Стандартные compiler pass Symfony.
15+
*
16+
* @param array $standartCompilerPasses Compiler passes.
1517
*
1618
* @return void
1719
*/
1820
public function setStandartCompilerPasses(array $standartCompilerPasses): void;
1921

2022
/**
23+
* Стандартные compiler pass Symfony.
24+
*
2125
* @return array
2226
*/
2327
public function getStandartCompilerPasses(): array;

src/PostLoadingPass/InitBitrixEvents.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class InitBitrixEvents implements PostLoadingPassInterface
3737
/**
3838
* @inheritDoc
3939
*
40-
* @throws RuntimePostLoadingPassException
40+
* @throws RuntimePostLoadingPassException Когда что-то не так с параметрами PostLoadingPasss.
4141
* @throws Exception
4242
*/
4343
public function action(Container $containerBuilder): bool
@@ -69,10 +69,10 @@ public function action(Container $containerBuilder): bool
6969
* Обработать параметры события и запустить обработчик.
7070
*
7171
* @param object $service Экземпляр сервиса.
72-
* @param array $arData Данные.
72+
* @param array $arData Данные.
7373
*
7474
* @return boolean
75-
* @throws RuntimePostLoadingPassException
75+
* @throws RuntimePostLoadingPassException Когда что-то не так с параметрами PostLoadingPasss.
7676
*/
7777
private function processEventItem($service, array $arData): bool
7878
{

src/Services/AppKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function getBundlesMetaData() : array
150150
/**
151151
* Sets the container.
152152
*
153-
* @param ContainerInterface|null $container
153+
* @param ContainerInterface|null $container Контейнер.
154154
*
155155
* @return void
156156
*

src/Services/PSR/BitrixRequestConvertor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class BitrixRequestConvertor
2222
private $bitrixRequest;
2323

2424
/**
25-
* @var ServerPsrRequest $psrRequest
25+
* @var ServerPsrRequest $psrRequest PSR Request.
2626
*/
2727
private $psrRequest;
2828

0 commit comments

Comments
 (0)