Skip to content

Commit 8988a96

Browse files
committed
NTR - Update dependencies
1 parent 24eacc5 commit 8988a96

File tree

11 files changed

+366
-343
lines changed

11 files changed

+366
-343
lines changed

app/config/sculpin_services.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ services:
1212
shopware_devdocs.twig_extension:
1313
class: Shopware\Devdocs\TwigExtension
1414
arguments:
15-
- @sculpin_theme.theme_twig_extension
1615
- %kernel.environment%
1716
tags:
1817
- { name: twig.extension }

app/src/AlgoliaBundle/AlgoliaIndexListener.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class AlgoliaIndexListener implements EventSubscriberInterface
2020
*/
2121
public static function getSubscribedEvents()
2222
{
23-
return array(
23+
return [
2424
Sculpin::EVENT_AFTER_RUN => 'afterRun',
25-
);
25+
];
2626
}
2727

2828
/**
@@ -32,18 +32,18 @@ public static function getSubscribedEvents()
3232
public function __construct(Client $client, $indexName)
3333
{
3434
$this->index = $client->initIndex($indexName);
35-
$this->index->setSettings(array(
36-
"attributesToIndex" => array("title", "tags", "unordered(body)"),
37-
'attributesForFaceting' => array('tags')
38-
));
35+
$this->index->setSettings([
36+
'attributesToIndex' => ['title', 'tags', 'unordered(body)'],
37+
'attributesForFaceting' => ['tags']
38+
]);
3939
}
4040

4141
/**
42-
* @param \Sculpin\Core\Event\SourceSetEvent $event
42+
* @param SourceSetEvent $event
4343
*/
4444
public function afterRun(SourceSetEvent $event)
4545
{
46-
$documents = array();
46+
$documents = [];
4747
/** @var AbstractSource $item */
4848
foreach ($event->allSources() as $item) {
4949
if ($item->data()->get('indexed')) {
@@ -65,15 +65,15 @@ public function afterRun(SourceSetEvent $event)
6565
*/
6666
private function parseSource(AbstractSource $source)
6767
{
68-
$document = array(
68+
$document = [
6969
'objectID' => sha1($source->sourceId()),
7070
'title' => $source->data()->get('title'),
7171
'body' => strip_tags($source->content()),
7272
'url' => rtrim($source->permalink()->relativeUrlPath(), '/').'/',
7373
'date' => $source->data()->get('calculated_date'),
74-
);
74+
];
7575

76-
$tags = (is_array($source->data()->get('tags'))) ? $source->data()->get('tags') : array();
76+
$tags = is_array($source->data()->get('tags')) ? $source->data()->get('tags') : [];
7777
if ($tags) {
7878
$document['tags'] = $tags;
7979
}

app/src/AlgoliaBundle/Resources/config/services.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
</service>
1111

1212
<service id="shopware_search.algolia.listener" class="Shopware\Devdocs\AlgoliaBundle\AlgoliaIndexListener">
13-
<argument type="service" id="shopware_search.algolia.client" />
13+
<argument type="service" id="shopware_search.algolia.client"/>
1414
<argument>%algolia.index_name%</argument>
15-
<tag name="kernel.event_subscriber" />
15+
<tag name="kernel.event_subscriber"/>
1616
</service>
1717
</services>
1818

app/src/AnchorListener.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace Shopware\Devdocs;
33

4+
use IvoPetkov\HTML5DOMDocument;
45
use Sculpin\Core\Event\SourceSetEvent;
56
use Sculpin\Core\Sculpin;
67
use Sculpin\Core\Source\SourceInterface;
@@ -11,16 +12,16 @@ class AnchorListener implements EventSubscriberInterface
1112
/**
1213
* @var string[]
1314
*/
14-
private $usedAnchors = array();
15+
private $usedAnchors = [];
1516

1617
/**
1718
* {@inheritDoc}
1819
*/
1920
public static function getSubscribedEvents()
2021
{
21-
return array(
22+
return [
2223
Sculpin::EVENT_AFTER_FORMAT => 'afterFormat',
23-
);
24+
];
2425
}
2526

2627
public function afterFormat(SourceSetEvent $event)
@@ -63,7 +64,7 @@ private function formatSource(SourceInterface $source)
6364
return;
6465
}
6566

66-
$dom = new \IvoPetkov\HTML5DOMDocument();
67+
$dom = new HTML5DOMDocument();
6768
$dom->loadHTML($content);
6869
if (!$dom) {
6970
return;

app/src/GitHistoryBundle/DependencyInjection/SculpinGitHistoryExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
use Symfony\Component\Config\FileLocator;
55
use Symfony\Component\DependencyInjection\ContainerBuilder;
6-
use Symfony\Component\DependencyInjection\Loader;
6+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
77
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
88

99
class SculpinGitHistoryExtension extends Extension
@@ -13,7 +13,7 @@ class SculpinGitHistoryExtension extends Extension
1313
*/
1414
public function load(array $configs, ContainerBuilder $container)
1515
{
16-
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
16+
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
1717
$loader->load('services.xml');
1818
}
1919
}

app/src/SearchIndexListener.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ class SearchIndexListener implements EventSubscriberInterface
1818
*/
1919
public static function getSubscribedEvents()
2020
{
21-
return array(
21+
return [
2222
Sculpin::EVENT_AFTER_RUN => 'afterRun',
23-
);
23+
];
2424
}
2525

2626
/**
@@ -32,11 +32,11 @@ public function __construct($outputDir)
3232
}
3333

3434
/**
35-
* @param \Sculpin\Core\Event\SourceSetEvent $event
35+
* @param SourceSetEvent $event
3636
*/
3737
public function afterRun(SourceSetEvent $event)
3838
{
39-
$documents = array();
39+
$documents = [];
4040
/** @var AbstractSource $item */
4141
foreach ($event->allSources() as $item) {
4242
if ($item->data()->get('indexed')) {
@@ -60,14 +60,14 @@ public function afterRun(SourceSetEvent $event)
6060
*/
6161
private function parseSource(AbstractSource $source)
6262
{
63-
$tags = (is_array($source->data()->get('tags'))) ? $source->data()->get('tags') : array();
63+
$tags = is_array($source->data()->get('tags')) ? $source->data()->get('tags') : [];
6464

65-
$document = array(
65+
$document = [
6666
'title' => $source->data()->get('title'),
6767
'body' => strip_tags($source->content()),
6868
'tags' => implode(', ', $tags),
6969
'url' => rtrim($source->permalink()->relativeUrlPath(), '/').'/',
70-
);
70+
];
7171

7272
return $document;
7373
}

app/src/TwigExtension.php

+12-30
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,23 @@
22

33
namespace Shopware\Devdocs;
44

5-
use Sculpin\Bundle\ThemeBundle\ThemeTwigExtension;
6-
75
class TwigExtension extends \Twig_Extension
86
{
97
/**
108
* @var string
119
*/
1210
private $environment;
1311

14-
/**
15-
* @var ThemeTwigExtension
16-
*/
17-
private $twigThemeExtension;
18-
19-
public function __construct(ThemeTwigExtension $twigThemeExtension, $environment)
20-
{
21-
$this->twigThemeExtension = $twigThemeExtension;
22-
$this->environment = $environment;
23-
}
24-
25-
/**
26-
* Returns the name of the extension.
27-
*
28-
* @return string The extension name
29-
*/
30-
public function getName()
12+
public function __construct($environment)
3113
{
32-
return __CLASS__;
14+
$this->environment = $environment;
3315
}
3416

3517
public function getFunctions()
3618
{
37-
return array(
38-
'versioned' => new \Twig_Function_Method($this, 'versioned'),
39-
);
19+
return [
20+
new \Twig_SimpleFunction('versioned', [$this, 'versioned']),
21+
];
4022
}
4123

4224
/**
@@ -45,14 +27,14 @@ public function getFunctions()
4527
*/
4628
public function versioned($resource)
4729
{
48-
$parts = pathinfo($resource);
49-
$version = ($this->environment === 'prod') ? '.'.time() : '';
30+
$parts = pathinfo($resource);
31+
$version = ($this->environment === 'prod') ? '.' . time() : '';
5032

5133
return $parts['dirname']
52-
.'/'
53-
.$parts['filename']
54-
.$version
55-
.'.'
56-
.$parts['extension'];
34+
. '/'
35+
. $parts['filename']
36+
. $version
37+
. '.'
38+
. $parts['extension'];
5739
}
5840
}

composer.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"mavimo/sculpin-redirect-bundle": "@dev",
88
"webuni/commonmark-table-extension": "^0.9.0",
99
"janbuecker/sculpin-meta-navigation-bundle": "^0.4",
10-
"ivopetkov/html5-dom-document-php": "^1.1.0"
10+
"ivopetkov/html5-dom-document-php": "^1.1.0",
11+
"symfony/config": "2.8.50",
12+
"symfony/dependency-injection": "2.8.50",
13+
"symfony/event-dispatcher": "2.8.50",
14+
"symfony/http-kernel": "2.8.51",
15+
"twig/twig": "1.37.1"
1116
},
1217
"autoload": {
1318
"psr-4": {

0 commit comments

Comments
 (0)