Skip to content

Commit

Permalink
Merge branch '10.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Mar 13, 2023
2 parents abe0a65 + ec7fc9b commit 5c8b33f
Show file tree
Hide file tree
Showing 23 changed files with 43 additions and 26 deletions.
1 change: 1 addition & 0 deletions src/Illuminate/Console/View/Components/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Console\QuestionHelper;
use ReflectionClass;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;

use function Termwind\render;
use function Termwind\renderUsing;

Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Console/View/Components/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
namespace Illuminate\Console\View\Components;

use Symfony\Component\Console\Output\OutputInterface;
use function Termwind\terminal;
use Throwable;

use function Termwind\terminal;

class Task extends Component
{
/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Console/resources/views/components/line.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="mx-2 mb-1 mt-<?php echo $marginTop ?>">
<span class="px-1 bg-<?php echo $bgColor ?> text-<?php echo $fgColor ?> uppercase"><?php echo $title ?></span>
<span class="<?php if ($title) {
echo 'ml-1';
} ?>">
echo 'ml-1';
} ?>">
<?php echo htmlspecialchars($content) ?>
</span>
</div>
1 change: 1 addition & 0 deletions src/Illuminate/Database/Eloquent/Casts/ArrayObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/**
* @template TKey of array-key
* @template TItem
*
* @extends \ArrayObject<TKey, TItem>
*/
class ArrayObject extends BaseArrayObject implements Arrayable, JsonSerializable
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

use function Termwind\terminal;

#[AsCommand(name: 'serve')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
namespace Illuminate\Foundation\Exceptions\Whoops;

use Illuminate\Contracts\Foundation\ExceptionRenderer;
use function tap;
use Whoops\Run as Whoops;

use function tap;

class WhoopsExceptionRenderer implements ExceptionRenderer
{
/**
Expand Down
19 changes: 11 additions & 8 deletions src/Illuminate/Log/LogManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,16 +402,19 @@ protected function createMonologDriver(array $config)
$config['handler_with'] ?? []
);

$handler = $this->prepareHandler(
$this->app->make($config['handler'], $with), $config
);

$processors = collect($config['processors'] ?? [])
->map(fn ($processor) => $this->app->make($processor['processor'] ?? $processor, $processor['with'] ?? []))
->toArray();

return new Monolog(
$this->parseChannel($config),
[
$this->prepareHandler(
$this->app->make($config['handler'], $with), $config
),
],
collect($config['processors'] ?? [])
->map(fn ($processor) => $this->app->make($processor['processor'] ?? $processor, $processor['with'] ?? [])
)->toArray());
[$handler],
$processors,
);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/Mailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ public function assertDontSeeInHtml($string, $escape = true)
*/
public function assertSeeInOrderInHtml($strings, $escape = true)
{
$strings = $escape ? array_map('e', ($strings)) : $strings;
$strings = $escape ? array_map('e', $strings) : $strings;

[$html, $text] = $this->renderForAssertions();

Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Queue/Console/WorkCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Support\Carbon;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Terminal;

use function Termwind\terminal;

#[AsCommand(name: 'queue:work')]
Expand Down
10 changes: 5 additions & 5 deletions tests/Foundation/FoundationViteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ public function testItCanSpecifyAttributesForPreloadedAssets()
.'<link rel="modulepreload" href="https://example.com/'.$buildDir.'/assets/import.versioned.js" general="attribute" crossorigin data-persistent-across-pages="YES" keep-me empty-string="" zero="0" />'
.'<link rel="stylesheet" href="https://example.com/'.$buildDir.'/assets/app.versioned.css" />'
.'<script type="module" src="https://example.com/'.$buildDir.'/assets/app.versioned.js"></script>',
$result->toHtml());
$result->toHtml());

$this->assertSame([
"https://example.com/$buildDir/assets/app.versioned.css" => [
Expand Down Expand Up @@ -1041,7 +1041,7 @@ public function testPreloadAssetsGetAssetNonce()
.'<link rel="modulepreload" href="https://example.com/'.$buildDir.'/assets/app.versioned.js" nonce="expected-nonce" />'
.'<link rel="stylesheet" href="https://example.com/'.$buildDir.'/assets/app.versioned.css" nonce="expected-nonce" />'
.'<script type="module" src="https://example.com/'.$buildDir.'/assets/app.versioned.js" nonce="expected-nonce"></script>',
$result->toHtml());
$result->toHtml());

$this->assertSame([
"https://example.com/$buildDir/assets/app.versioned.css" => [
Expand Down Expand Up @@ -1088,7 +1088,7 @@ public function testCrossoriginAttributeIsInheritedByPreloadTags()
.'<link rel="modulepreload" href="https://example.com/'.$buildDir.'/assets/app.versioned.js" crossorigin="script-crossorigin" />'
.'<link rel="stylesheet" href="https://example.com/'.$buildDir.'/assets/app.versioned.css" crossorigin="style-crossorigin" />'
.'<script type="module" src="https://example.com/'.$buildDir.'/assets/app.versioned.js" crossorigin="script-crossorigin"></script>',
$result->toHtml());
$result->toHtml());

$this->assertSame([
"https://example.com/$buildDir/assets/app.versioned.css" => [
Expand Down Expand Up @@ -1127,7 +1127,7 @@ public function testItCanConfigureTheManifestFilename()
$this->assertSame(
'<link rel="modulepreload" href="https://example.com/'.$buildDir.'/assets/app-from-custom-manifest.versioned.js" />'
.'<script type="module" src="https://example.com/'.$buildDir.'/assets/app-from-custom-manifest.versioned.js"></script>',
$result->toHtml());
$result->toHtml());

unlink(public_path("{$buildDir}/custom-manifest.json"));
rmdir(public_path($buildDir));
Expand Down Expand Up @@ -1166,7 +1166,7 @@ public function testItOnlyOutputsUniquePreloadTags()
.'<link rel="stylesheet" href="https://example.com/'.$buildDir.'/assets/app-versioned.css" />'
.'<script type="module" src="https://example.com/'.$buildDir.'/assets/app-versioned.js"></script>'
.'<script type="module" src="https://example.com/'.$buildDir.'/assets/Welcome-versioned.js"></script>',
$result->toHtml());
$result->toHtml());

$this->assertSame([
"https://example.com/$buildDir/assets/app-versioned.css" => [
Expand Down
8 changes: 4 additions & 4 deletions tests/Support/SupportStrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ public function testStrExcerpt()
$this->assertSame('...abc...', Str::excerpt('z abc d', 'b', ['radius' => 1]));
$this->assertSame('[...]is a beautiful morn[...]', Str::excerpt('This is a beautiful morning', 'beautiful', ['omission' => '[...]', 'radius' => 5]));
$this->assertSame(
'This is the ultimate supercalifragilisticexpialidoceous very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome tempera[...]',
Str::excerpt('This is the ultimate supercalifragilisticexpialidoceous very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome temperatures. So what are you gonna do about it?', 'very',
['omission' => '[...]'],
));
'This is the ultimate supercalifragilisticexpialidoceous very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome tempera[...]',
Str::excerpt('This is the ultimate supercalifragilisticexpialidoceous very looooooooooooooooooong looooooooooooong beautiful morning with amazing sunshine and awesome temperatures. So what are you gonna do about it?', 'very',
['omission' => '[...]'],
));

$this->assertSame('...y...', Str::excerpt('taylor', 'y', ['radius' => 0]));
$this->assertSame('...ayl...', Str::excerpt('taylor', 'Y', ['radius' => 1]));
Expand Down
2 changes: 1 addition & 1 deletion tests/Testing/TestResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ public function testAssertLocation()
app()->instance('url', $url = new UrlGenerator(new RouteCollection, new Request));

$response = TestResponse::fromBaseResponse(
(new RedirectResponse($url->to('https://foo.com')))
new RedirectResponse($url->to('https://foo.com'))
);

$response->assertLocation('https://foo.com');
Expand Down
4 changes: 1 addition & 3 deletions tests/Validation/ValidationValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,7 @@ public function testCustomException()

$v = new Validator($trans, ['name' => ''], ['name' => 'required']);

$exception = new class($v) extends ValidationException
{
};
$exception = new class($v) extends ValidationException {};
$v->setException($exception);

try {
Expand Down
1 change: 1 addition & 0 deletions types/Cache/Repository.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Cache\Repository;

use function PHPStan\Testing\assertType;

/** @var Repository $cache */
Expand Down
1 change: 1 addition & 0 deletions types/Contracts/Cache/Repository.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Contracts\Cache\Repository;

use function PHPStan\Testing\assertType;

/** @var Repository $cache */
Expand Down
1 change: 1 addition & 0 deletions types/Database/Eloquent/Factories/Factory.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Database\Eloquent\Factories\Factory;

use function PHPStan\Testing\assertType;

/**
Expand Down
1 change: 1 addition & 0 deletions types/Database/Eloquent/ModelNotFoundException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Database\Eloquent\ModelNotFoundException;

use function PHPStan\Testing\assertType;

/** @var ModelNotFoundException<User> $exception */
Expand Down
1 change: 1 addition & 0 deletions types/Http/Request.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Http\Request;

use function PHPStan\Testing\assertType;

class TestEnum
Expand Down
1 change: 1 addition & 0 deletions types/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\Collection;

use function PHPStan\Testing\assertType;

$collection = collect([new User]);
Expand Down
1 change: 1 addition & 0 deletions types/Support/Facades/Cache.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Support\Facades\Cache;

use function PHPStan\Testing\assertType;

assertType('mixed', Cache::get('key'));
Expand Down
1 change: 1 addition & 0 deletions types/Support/Fluent.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Support\Fluent;

use function PHPStan\Testing\assertType;

$fluent = new Fluent(['name' => 'Taylor', 'age' => 25, 'user' => new User]);
Expand Down
1 change: 1 addition & 0 deletions types/Support/LazyCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Support\LazyCollection;

use function PHPStan\Testing\assertType;

$collection = new LazyCollection([new User]);
Expand Down
1 change: 1 addition & 0 deletions types/Support/Timebox.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Support\Timebox;

use function PHPStan\Testing\assertType;

assertType('int', (new Timebox)->call(function ($timebox) {
Expand Down

0 comments on commit 5c8b33f

Please sign in to comment.