Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Oct 24, 2023
1 parent 87dee24 commit cc1639d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
4 changes: 2 additions & 2 deletions js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ import '../css/charts.css';
);
});

window.initPackageStats = function (average, date, versions, statsUrl, versionStatsUrl) {
window.initPackageStats = function (average, date, statsUrl, versionStatsUrl) {
colors = [
'#f28d1a',
'#1765f4',
Expand Down Expand Up @@ -274,7 +274,7 @@ import '../css/charts.css';
initializeVersionListExpander();
};

window.initPhpStats = function (average, date, versions, versionStatsUrl) {
window.initPhpStats = function (average, date, versionStatsUrl) {
colors = PHP_VERSION_COLORS;

var match,
Expand Down
15 changes: 15 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ parameters:
count: 1
path: src/Entity/Version.php

-
message: "#^Query error\\: Column \"audit_log\\.attributes\" expects value type string, got type array\\<string, mixed\\>$#"
count: 1
path: src/EventListener/PackageListener.php

-
message: "#^Query error\\: Column \"audit_log\\.datetime\" expects value type string, got type DateTimeImmutable$#"
count: 1
path: src/EventListener/PackageListener.php

-
message: "#^Query error\\: Column \"audit_log\\.id\" expects value type string, got type Symfony\\\\Component\\\\Uid\\\\Ulid$#"
count: 1
path: src/EventListener/PackageListener.php

-
message: "#^Method App\\\\Model\\\\FavoriteManager\\:\\:getFavoriteCount\\(\\) should return int\\<0, max\\> but returns int\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions src/Controller/PackageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ public function viewPackageAction(Request $req, string $name, CsrfTokenManagerIn

$version = null;
$expandedVersion = null;
/** @var Version[] $versions */
$versions = $package->getVersions()->toArray();

usort($versions, Package::class.'::sortVersions');
Expand Down
3 changes: 1 addition & 2 deletions templates/package/php_stats.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@
(function () {
var average = {{ average|json_encode|raw }};
var date = {{ date|json_encode|raw }};
var versions = {{ versions|json_encode|raw }};
initPhpStats(average, date, versions, {{ path('version_php_stats', {name: package.name, version: '_VERSION_', type: 'effective'})|replace({effective: '_TYPE_'})|json_encode|raw }});
initPhpStats(average, date, {{ path('version_php_stats', {name: package.name, version: '_VERSION_', type: 'effective'})|replace({effective: '_TYPE_'})|json_encode|raw }});
}());
</script>
{% endblock %}
3 changes: 1 addition & 2 deletions templates/package/stats.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@
(function () {
var average = {{ average|json_encode|raw }};
var date = {{ date|json_encode|raw }};
var versions = {{ versions|json_encode|raw }};
initPackageStats(average, date, versions, {{ path('package_stats', {name: package.name})|json_encode|raw }}, {{ path('version_stats', {name: package.name, version: '_VERSION_'})|json_encode|raw }});
initPackageStats(average, date, {{ path('package_stats', {name: package.name})|json_encode|raw }}, {{ path('version_stats', {name: package.name, version: '_VERSION_'})|json_encode|raw }});
}());
</script>
{% endblock %}
1 change: 0 additions & 1 deletion tests/Package/SymlinkDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public static function getTestGetTargetListingBlocks(): array
private static function invoke($object, $method): mixed
{
$refl = new \ReflectionMethod($object, $method);
$refl->setAccessible(true);

$args = func_get_args();
array_shift($args); // object
Expand Down
2 changes: 0 additions & 2 deletions tests/Package/UpdaterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ protected function setUp(): void
$this->package->setName('test/pkg');
$this->package->setRepository('https://example.com/test/pkg');
$reflProp = new \ReflectionProperty(Package::class, 'id');
$reflProp->setAccessible(true);
$reflProp->setValue($this->package, 1);

$this->ioMock = $this->createMock(NullIO::class);
Expand All @@ -73,7 +72,6 @@ protected function setUp(): void
}));
$emMock->expects($this->any())->method('persist')->will($this->returnCallback(static function ($object) {
if ($reflProperty = new \ReflectionProperty($object, 'id')) {
$reflProperty->setAccessible(true);
$reflProperty->setValue($object, random_int(0, 10000));
}
}));
Expand Down

0 comments on commit cc1639d

Please sign in to comment.