mirror of
https://github.com/flarum/core.git
synced 2025-08-04 15:37:51 +02:00
fix
This commit is contained in:
@@ -192,7 +192,7 @@ class Serializer extends \Tobyz\JsonApiServer\Serializer
|
||||
$deferred = $this->deferred;
|
||||
|
||||
/** @var Closure $resolve */
|
||||
while ($resolve = $deferred->shift()) {
|
||||
while (($resolve = $deferred->shift()) && is_callable($resolve)) {
|
||||
$resolve();
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,9 @@ namespace Flarum\Frontend\Compiler;
|
||||
use Flarum\Frontend\Compiler\Source\FileSource;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Str;
|
||||
use Less_FileManager;
|
||||
use Less_Parser;
|
||||
use Less_Tree_Import;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
@@ -129,8 +131,10 @@ class LessCompiler extends RevisionCompiler
|
||||
];
|
||||
})->unique('path');
|
||||
|
||||
return function ($evald) use ($baseSources): ?array {
|
||||
$relativeImportPath = Str::of($evald->PathAndUri()[0])->split('/\/less\//');
|
||||
return function (Less_Tree_Import $evald) use ($baseSources): ?array {
|
||||
$pathAndUri = Less_FileManager::getFilePath($evald->getPath(), $evald->currentFileInfo);
|
||||
|
||||
$relativeImportPath = Str::of($pathAndUri[0])->split('/\/less\//');
|
||||
$extensionId = $baseSources->where('path', $relativeImportPath->first())->pluck('extensionId')->first();
|
||||
|
||||
$overrideImport = $this->lessImportOverrides
|
||||
@@ -141,7 +145,7 @@ class LessCompiler extends RevisionCompiler
|
||||
return null;
|
||||
}
|
||||
|
||||
return [$overrideImport['newFilePath'], $evald->PathAndUri()[1]];
|
||||
return [$overrideImport['newFilePath'], $pathAndUri[1]];
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -209,7 +209,7 @@ class CreateTest extends TestCase
|
||||
*/
|
||||
public function discussion_creation_limited_by_throttler()
|
||||
{
|
||||
$this->send(
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/discussions', [
|
||||
'authenticatedAs' => 2,
|
||||
'json' => [
|
||||
@@ -224,6 +224,8 @@ class CreateTest extends TestCase
|
||||
])
|
||||
);
|
||||
|
||||
$this->assertEquals(201, $response->getStatusCode());
|
||||
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/discussions', [
|
||||
'authenticatedAs' => 2,
|
||||
|
@@ -104,7 +104,7 @@ class CreateTest extends TestCase
|
||||
*/
|
||||
public function limited_by_throttler()
|
||||
{
|
||||
$this->send(
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/posts', [
|
||||
'authenticatedAs' => 2,
|
||||
'json' => [
|
||||
@@ -121,6 +121,8 @@ class CreateTest extends TestCase
|
||||
])
|
||||
);
|
||||
|
||||
$this->assertEquals(201, $response->getStatusCode(), (string) $response->getBody());
|
||||
|
||||
$response = $this->send(
|
||||
$this->request('POST', '/api/posts', [
|
||||
'authenticatedAs' => 2,
|
||||
|
Reference in New Issue
Block a user