Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Oct 11, 2024
1 parent 9573d7d commit 4e78479
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ public function filters(): array
public function query(Context $context): object
{
return (new RequestWrapper($this->cache, 'https://flarum.org/api/extensions', 'GET', null, [
'Accept' => 'application/json',
]))->withQueryParams([
'filter' => [
// @todo
'compatible-with' => '1.8.6', // Application::VERSION,
],
]);
'Accept' => 'application/json',
]))->withQueryParams([
'filter' => [
// @todo
'compatible-with' => '1.8.6', // Application::VERSION,
],
]);
}

public function paginate(object $query, OffsetPagination $pagination): void
Expand All @@ -156,7 +156,6 @@ public function paginate(object $query, OffsetPagination $pagination): void
public function results(object $query, Context $context): iterable
{
/** @var RequestWrapper $query */

$json = $query->cache(function (RequestWrapper $query) {
try {
$response = (new Client())->send($query->getRequest());
Expand Down
7 changes: 7 additions & 0 deletions extensions/package-manager/src/Api/Schema/SortColumn.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/

namespace Flarum\ExtensionManager\Api\Schema;

use Flarum\ExtensionManager\External\RequestWrapper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Flarum\ExtensionManager\Exception\ExtensionAlreadyInstalledException;
use Flarum\ExtensionManager\Extension\Event\Installed;
use Flarum\ExtensionManager\RequirePackageValidator;
use Flarum\ExtensionManager\Support\Util;
use Illuminate\Contracts\Events\Dispatcher;
use Symfony\Component\Console\Input\StringInput;

Expand Down
1 change: 0 additions & 1 deletion extensions/package-manager/src/Composer/ComposerJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use Flarum\Extension\Extension;
use Flarum\Extension\ExtensionManager;
use Flarum\ExtensionManager\Support\Util;
use Flarum\Foundation\Paths;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Str;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/

namespace Flarum\ExtensionManager\Exception;

use Exception;
Expand Down
9 changes: 8 additions & 1 deletion extensions/package-manager/src/External/RequestWrapper.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?php

/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/

namespace Flarum\ExtensionManager\External;

use Closure;
use Illuminate\Contracts\Cache\Repository;
use Illuminate\Support\Collection;
use Laminas\Diactoros\Request;

/**
Expand Down Expand Up @@ -42,6 +48,7 @@ public function __call(string $name, array $arguments): static
{
$new = $this->request->$name(...$arguments);
$this->request = $new;

return $this;
}

Expand Down
1 change: 0 additions & 1 deletion extensions/package-manager/tests/integration/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use Flarum\Extension\Extension;
use Flarum\ExtensionManager\Composer\ComposerAdapter;
use Flarum\ExtensionManager\Composer\ComposerJson;
use Flarum\ExtensionManager\Support\Util;
use Flarum\Foundation\Paths;
use Flarum\Testing\integration\RetrievesAuthorizedUsers;
use Illuminate\Support\Arr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public function newModel(Context $context): object
return new ($this->model());
}

public final function filters(): array
final public function filters(): array
{
throw new RuntimeException('Not supported in Flarum, please use a model searcher instead https://docs.flarum.org/extend/search.');
}
Expand Down

0 comments on commit 4e78479

Please sign in to comment.