Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit b75f6df

Browse files
Use PHPStan 0.11 (#40)
1 parent bf1a9eb commit b75f6df

File tree

11 files changed

+48
-71
lines changed

11 files changed

+48
-71
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
"csa/guzzle-cache-middleware": "^1.0",
4848
"libero/coding-standard": "^0.3",
4949
"php-vfs/php-vfs": "^1.4",
50-
"phpstan/phpstan": "^0.10",
51-
"phpstan/phpstan-phpunit": "^0.10",
52-
"phpstan/phpstan-symfony": "^0.10",
50+
"phpstan/phpstan": "^0.11",
51+
"phpstan/phpstan-phpunit": "^0.11",
52+
"phpstan/phpstan-symfony": "^0.11",
5353
"phpunit/phpunit": "^7.4",
5454
"psr/http-message": "^1.0",
5555
"symfony/browser-kit": "^4.1",

composer.lock

Lines changed: 32 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ parameters:
33
- '~^Call to an undefined method FluentDOM\\DOM\\Node\\.+?::getNodePath\(\)\.$~'
44
- '~^Cannot cast FluentDOM\\DOM\\Node\\.+? to string\.$~'
55
- '~^Cannot call method ([a-z]+)Node\(\) on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\|null\.$~'
6-
- '~^Method [^\s]+? should return FluentDOM\\DOM\\Element but returns DOMElement\.$~'
76
- '~^Service "csa_guzzle\.mock\.storage" is not registered in the container\.$~'
87
level: max
98
paths:

vendor-extra/JatsContentBundle/src/ViewConverter/FrontArticleTitleContentHeaderVisitor.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Libero\JatsContentBundle\ViewConverter;
66

7-
use FluentDOM\DOM\Document;
87
use FluentDOM\DOM\Element;
98
use Libero\ViewsBundle\Views\SimplifiedVisitor;
109
use Libero\ViewsBundle\Views\View;
@@ -24,10 +23,8 @@ public function __construct(ViewConverter $converter)
2423

2524
protected function doVisit(Element $object, View $view, array &$context = []) : View
2625
{
27-
/** @var Document $document */
28-
$document = $object->ownerDocument;
29-
30-
$title = $document->xpath()->firstOf('jats:article-meta/jats:title-group/jats:article-title', $object);
26+
$title = $object->ownerDocument->xpath()
27+
->firstOf('jats:article-meta/jats:title-group/jats:article-title', $object);
3128

3229
if (!$title instanceof Element) {
3330
return $view;

vendor-extra/JatsContentBundle/src/ViewConverter/FrontItemTagsVisitor.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Libero\JatsContentBundle\ViewConverter;
66

77
use DOMNodeList;
8-
use FluentDOM\DOM\Document;
98
use FluentDOM\DOM\Element;
109
use Libero\ViewsBundle\Views\ConvertsLists;
1110
use Libero\ViewsBundle\Views\SimplifiedVisitor;
@@ -27,11 +26,9 @@ public function __construct(ViewConverter $converter)
2726

2827
protected function doVisit(Element $object, View $view, array &$context = []) : View
2928
{
30-
/** @var Document $document */
31-
$document = $object->ownerDocument;
32-
3329
/** @var DOMNodeList|Element[] $keywordGroups */
34-
$keywordGroups = $document->xpath()->evaluate('jats:article-meta/jats:kwd-group[@kwd-group-type]', $object);
30+
$keywordGroups = $object->ownerDocument->xpath()
31+
->evaluate('jats:article-meta/jats:kwd-group[@kwd-group-type]', $object);
3532

3633
if (0 === count($keywordGroups)) {
3734
return $view;

vendor-extra/JatsContentBundle/src/ViewConverter/FrontSubjectGroupContentHeaderVisitor.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Libero\JatsContentBundle\ViewConverter;
66

77
use DOMNodeList;
8-
use FluentDOM\DOM\Document;
98
use FluentDOM\DOM\Element;
109
use Libero\ViewsBundle\Views\ConvertsLists;
1110
use Libero\ViewsBundle\Views\SimplifiedVisitor;
@@ -34,11 +33,8 @@ public function __construct(ViewConverter $converter, TranslatorInterface $trans
3433

3534
protected function doVisit(Element $object, View $view, array &$context = []) : View
3635
{
37-
/** @var Document $document */
38-
$document = $object->ownerDocument;
39-
4036
/** @var DOMNodeList|Element[] $subjects */
41-
$subjects = $document->xpath()->evaluate(
37+
$subjects = $object->ownerDocument->xpath()->evaluate(
4238
'jats:article-meta/jats:article-categories/jats:subj-group[@subj-group-type="heading"]/jats:subject',
4339
$object
4440
);

vendor-extra/JatsContentBundle/src/ViewConverter/KeywordGroupTagListVisitor.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Libero\JatsContentBundle\ViewConverter;
66

77
use DOMNodeList;
8-
use FluentDOM\DOM\Document;
98
use FluentDOM\DOM\Element;
109
use Libero\ViewsBundle\Views\ConvertsLists;
1110
use Libero\ViewsBundle\Views\SimplifiedVisitor;
@@ -34,10 +33,8 @@ public function __construct(ViewConverter $converter, TranslatorInterface $trans
3433

3534
protected function doVisit(Element $object, View $view, array &$context = []) : View
3635
{
37-
/** @var Document $document */
38-
$document = $object->ownerDocument;
39-
40-
$title = $document->xpath()->firstOf('jats:title', $object);
36+
$title = $object->ownerDocument->xpath()
37+
->firstOf('jats:title', $object);
4138

4239
/** @var DOMNodeList|Element[] $keywords */
4340
$keywords = $object('jats:kwd');

vendor-extra/JatsContentBundle/src/ViewConverter/SectionVisitor.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Libero\JatsContentBundle\ViewConverter;
66

77
use DOMNodeList;
8-
use FluentDOM\DOM\Document;
98
use FluentDOM\DOM\Element;
109
use FluentDOM\DOM\Node\NonDocumentTypeChildNode;
1110
use Libero\ViewsBundle\Views\ConvertsChildren;
@@ -32,10 +31,8 @@ protected function doVisit(Element $object, View $view, array &$context = []) :
3231
{
3332
$context['level'] = $context['level'] ?? 1;
3433

35-
/** @var Document $document */
36-
$document = $object->ownerDocument;
37-
38-
$heading = $document->xpath()->firstOf('jats:title', $object);
34+
$heading = $object->ownerDocument->xpath()
35+
->firstOf('jats:title', $object);
3936

4037
if ($heading instanceof Element) {
4138
$view = $view->withArgument(

vendor-extra/JatsContentBundle/tests/EventListener/ItemTagsListenerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace tests\Libero\JatsContentBundle\EventListener;
66

7-
use FluentDOM\DOM\Document;
87
use Libero\ContentPageBundle\Event\CreateContentPageEvent;
98
use Libero\JatsContentBundle\EventListener\ItemTagsListener;
109
use Libero\ViewsBundle\Views\View;
@@ -24,7 +23,6 @@ public function it_does_nothing_if_it_does_not_find_the_front() : void
2423
{
2524
$listener = new ItemTagsListener($this->createFailingConverter());
2625

27-
/** @var Document $document */
2826
$document = $this->loadDocument(
2927
<<<XML
3028
<?xml version="1.0" encoding="UTF-8"?>

vendor-extra/LiberoContentBundle/src/ViewConverter/FrontContentHeaderVisitor.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Libero\LiberoContentBundle\ViewConverter;
66

7-
use FluentDOM\DOM\Document;
87
use FluentDOM\DOM\Element;
98
use Libero\ViewsBundle\Views\SimplifiedVisitor;
109
use Libero\ViewsBundle\Views\View;
@@ -24,10 +23,8 @@ public function __construct(ViewConverter $converter)
2423

2524
protected function doVisit(Element $object, View $view, array &$context = []) : View
2625
{
27-
/** @var Document $document */
28-
$document = $object->ownerDocument;
29-
30-
$title = $document->xpath()->firstOf('libero:title[1]', $object);
26+
$title = $object->ownerDocument->xpath()
27+
->firstOf('libero:title[1]', $object);
3128

3229
if (!$title instanceof Element) {
3330
return $view;

0 commit comments

Comments
 (0)