Skip to content

Commit b48aba3

Browse files
authored
Merge pull request #4738 from ampproject/always-download-latest-phpstan
Always download latest version of PHPStan
2 parents 2bfb9bb + 9595e2c commit b48aba3

File tree

6 files changed

+37
-30
lines changed

6 files changed

+37
-30
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"extra": {
4444
"downloads": {
4545
"phpstan": {
46-
"url": "https://github.com/phpstan/phpstan/releases/download/0.12.14/phpstan.phar",
46+
"url": "https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar",
4747
"path": "vendor/bin/phpstan",
4848
"type": "phar"
4949
}
@@ -101,6 +101,6 @@
101101
"minimum-stability": "dev",
102102
"prefer-stable": true,
103103
"scripts": {
104-
"analyze": "if [ -z $TEST_SKIP_PHPSTAN ]; then phpstan analyze --ansi; fi"
104+
"analyze": "if [ -z $TEST_SKIP_PHPSTAN ]; then phpstan --version; phpstan analyze --ansi; fi"
105105
}
106106
}

composer.lock

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

includes/class-amp-theme-support.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1600,16 +1600,6 @@ public static function filter_admin_bar_script_loader_tag( $tag, $handle ) {
16001600
* @param string[] $script_handles AMP script handles for components identified during output buffering.
16011601
*/
16021602
public static function ensure_required_markup( Document $dom, $script_handles = [] ) {
1603-
/**
1604-
* Elements.
1605-
*
1606-
* @var DOMElement $meta
1607-
* @var DOMElement $script
1608-
* @var DOMElement $link
1609-
* @var DOMElement $style
1610-
* @var DOMElement $noscript
1611-
*/
1612-
16131603
// Gather all links.
16141604
$links = [
16151605
Attribute::REL_PRECONNECT => [
@@ -1625,6 +1615,11 @@ public static function ensure_required_markup( Document $dom, $script_handles =
16251615
],
16261616
];
16271617
$link_elements = $dom->head->getElementsByTagName( Tag::LINK );
1618+
/**
1619+
* Link element.
1620+
*
1621+
* @var DOMElement $link
1622+
*/
16281623
foreach ( $link_elements as $link ) {
16291624
if ( $link->hasAttribute( Attribute::REL ) ) {
16301625
$links[ $link->getAttribute( Attribute::REL ) ][] = $link;
@@ -1662,6 +1657,12 @@ public static function ensure_required_markup( Document $dom, $script_handles =
16621657
$ordered_scripts = [];
16631658
$head_scripts = [];
16641659
$runtime_src = wp_scripts()->registered[ Amp::RUNTIME ]->src;
1660+
1661+
/**
1662+
* Script element.
1663+
*
1664+
* @var DOMElement $script
1665+
*/
16651666
foreach ( $dom->head->getElementsByTagName( Tag::SCRIPT ) as $script ) { // Note that prepare_response() already moved body scripts to head.
16661667
$head_scripts[] = $script;
16671668
}

includes/sanitizers/class-amp-link-sanitizer.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,6 @@ public function add_meta_tag( $content = self::DEFAULT_META_CONTENT ) {
130130
* Process links by adding adding AMP query var to links in paired mode and adding rel=amphtml.
131131
*/
132132
public function process_links() {
133-
/**
134-
* Element.
135-
*
136-
* @var DOMElement $element
137-
*/
138-
139133
// Remove admin bar from DOM to prevent mutating it.
140134
$admin_bar_container = $this->dom->getElementById( 'wpadminbar' );
141135
$admin_bar_placeholder = null;
@@ -144,6 +138,11 @@ public function process_links() {
144138
$admin_bar_container->parentNode->replaceChild( $admin_bar_placeholder, $admin_bar_container );
145139
}
146140

141+
/**
142+
* Element.
143+
*
144+
* @var DOMElement $element
145+
*/
147146
foreach ( $this->dom->xpath->query( '//*[ local-name() = "a" or local-name() = "area" ]' ) as $element ) {
148147
if ( ! $element->hasAttribute( 'href' ) ) {
149148
continue;

lib/common/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
},
3333
"downloads": {
3434
"phpstan": {
35-
"url": "https://github.com/phpstan/phpstan/releases/download/0.12.14/phpstan.phar",
35+
"url": "https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar",
3636
"path": "vendor/bin/phpstan",
3737
"type": "phar"
3838
}

lib/optimizer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
"downloads": {
3535
"phpstan": {
36-
"url": "https://github.com/phpstan/phpstan/releases/download/0.12.14/phpstan.phar",
36+
"url": "https://github.com/phpstan/phpstan/releases/latest/download/phpstan.phar",
3737
"path": "vendor/bin/phpstan",
3838
"type": "phar"
3939
}

0 commit comments

Comments
 (0)