Skip to content

Commit fb7401b

Browse files
author
Fred-Jan van der Eijken
authored
Merge pull request #5 from MyOnlineStore/kernel-name
2 parents 9f1a6af + 9bcd6df commit fb7401b

6 files changed

Lines changed: 30 additions & 10 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
},
3030
"require-dev": {
3131
"roave/security-advisories": "dev-master",
32-
"phpunit/phpunit": "^8.5"
32+
"phpunit/phpunit": "^8.5",
33+
"vimeo/psalm": "^4.13"
3334
},
3435
"autoload": {
3536
"psr-4": {

psalm.xml.dist

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="7"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
16+
<issueHandlers>
17+
<ParamNameMismatch errorLevel="info"/>
18+
</issueHandlers>
19+
</psalm>

src/Decoda/Decoda.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function hasFilter($id)
201201
*
202202
* @param string $id
203203
*
204-
* @throws InvalidArgumentException
204+
* @throws \InvalidArgumentException
205205
*
206206
* @return \Decoda\Filter[]
207207
*/
@@ -264,7 +264,7 @@ public function hasHook($id)
264264
*
265265
* @param string $id
266266
*
267-
* @throws InvalidArgumentException
267+
* @throws \InvalidArgumentException
268268
*
269269
* @return \Decoda\Hook[]
270270
*/

src/Decoda/DecodaManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ private function set($filterSet, Decoda $decoda = null)
461461
/**
462462
* Gets a DecodaPhpEngine.
463463
*
464-
* @return DecodaPhpEngine
464+
* @return PhpEngine
465465
*/
466466
private function getPhpEngine()
467467
{

src/DependencyInjection/FMBbcodeExtension.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ public function load(array $configs, ContainerBuilder $container)
3030
$loader->load('filters.xml');
3131
$loader->load('hooks.xml');
3232

33-
$hooksConfig = isset($config['config']['hooks']) ? $config['config']['hooks'] : array();
33+
$hooksConfig = $config['config']['hooks'] ?? [];
3434
$hooks = array();
3535
foreach ($hooksConfig as $hook) {
3636
$hooks[$hook['classname']] = $hook['class'];
3737
}
3838

39-
$filtersConfig = isset($config['config']['filters']) ? $config['config']['filters'] : array();
39+
$filtersConfig = $config['config']['filters'] ?? [];
4040
$filters = array();
4141
foreach ($filtersConfig as $filter) {
4242
$filters[$filter['classname']] = $filter['class'];
@@ -45,8 +45,8 @@ public function load(array $configs, ContainerBuilder $container)
4545
$container->setParameter('fm_bbcode.filter_sets', $config['filter_sets']);
4646
$container->setParameter('fm_bbcode.config.filters', $filters);
4747
$container->setParameter('fm_bbcode.config.hooks', $hooks);
48-
$container->setParameter('fm_bbcode.config.messages', isset($config['config']['messages']) ? $config['config']['messages'] : null);
49-
$container->setParameter('fm_bbcode.config.templates', isset($config['config']['templates']) ? $config['config']['templates'] : array());
48+
$container->setParameter('fm_bbcode.config.messages', $config['config']['messages'] ?? null);
49+
$container->setParameter('fm_bbcode.config.templates', $config['config']['templates'] ?? []);
5050

5151
if (isset($config['emoticon'])) {
5252
$this->registerEmoticonConfiguration($config['emoticon'], $container, $loader);
@@ -62,7 +62,7 @@ public function load(array $configs, ContainerBuilder $container)
6262
*/
6363
private function registerEmoticonConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
6464
{
65-
$container->setParameter('fm_bbcode.emoticon.cache_class_prefix', $container->getParameter('kernel.name').ucfirst($container->getParameter('kernel.environment')));
65+
$container->setParameter('fm_bbcode.emoticon.cache_class_prefix', $container->getParameter('kernel.container_class').ucfirst($container->getParameter('kernel.environment')));
6666
$container->setParameter('fm_bbcode.emoticon.folder', $config['folder']);
6767

6868
$hook = $container->findDefinition('fm_bbcode.decoda.hook.emoticon');

src/Emoticon/EmoticonCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function has($name)
103103
*
104104
* @param string $name The emoticon name
105105
*
106-
* @return Emoticons|null A Emoticons instance or null when not found
106+
* @return Emoticon|null A Emoticons instance or null when not found
107107
*/
108108
public function get($name)
109109
{

0 commit comments

Comments
 (0)