Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Web/Blog/articles/2024-10-02-alpha-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ final readonly class RssController
cache: function () {
return file_get_contents('https://stitcher.io/rss')
},
expiresAt: (new DateTimeImmutable())->add(new DateInterval('P1D'))
expiresAt: new DateTimeImmutable()->add(new DateInterval('P1D'))
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Blog/articles/2024-10-31-alpha-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function __invoke(): void
```php
use Tempest\Generation\ClassManipulator;

(new ClassManipulator(PackageMigration::class))
new ClassManipulator(PackageMigration::class)
->removeClassAttribute(DoNotDiscover::class)
->setNamespace('App\\Migrations')
->print();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ final readonly class MarkdownInitializer implements Initializer
{
$environment = new Environment();

$highlighter = (new Highlighter(new CssTheme()));
$highlighter = new Highlighter(new CssTheme());

$highlighter
->addLanguage(new TempestViewLanguage())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ final readonly class JsonController
{
$data = [ /* … */ ];

return (new Ok($data))->setContentType(ContentType::JSON);
return new Ok($data)->setContentType(ContentType::JSON);
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final readonly class RssController
cache: function () {
return file_get_contents('https://stitcher.io/rss')
},
expiresAt: (new DateTimeImmutable())->add(new DateInterval('P1D'))
expiresAt: new DateTimeImmutable()->add(new DateInterval('P1D'))
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Web/Documentation/content/main/1-framework/13-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ With this `User` model, you already have a lot of helper methods in place to bui
```php
use App\Auth\User;

$user = (new User(
$user = new User(
name: 'Brent',
email: 'brendt@stitcher.io',
))
)
->setPassword('password')
->save()
->grantPermission('admin');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `ImmutableString` and `MutableString` classes wraps a normal string, and pro
```php
use Tempest\Support\Str\ImmutableString;

$slug = (new ImmutableString('https://tempestphp.com/docs/framework/14-primitive-helpers'))
$slug = new ImmutableString('https://tempestphp.com/docs/framework/14-primitive-helpers')
->trim('/')
->afterLast('/')
->replaceRegex('/\d+-/', '')
Expand Down Expand Up @@ -40,7 +40,7 @@ The `ImmutableArray` and `MutableArray` classes wrap an array, and provide a flu
```php
use Tempest\Support\Arr\ImmutableArray;

$items = (new ImmutableArray(glob(__DIR__ . '/Content/*.md')))
$items = new ImmutableArray(glob(__DIR__ . '/Content/*.md'))
->reverse()
->map(function (string $path) {
// …
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can build your own CSS theme with just a couple of classes, copy over [the b
If you don't want to or can't load a CSS file, you can opt to use the `InlineTheme` class. This theme takes the path to a CSS file, and will parse it into inline styles:

```php
$highlighter = (new Highlighter(new InlineTheme(__DIR__ . '/../src/Themes/Css/solarized-dark.css')));
$highlighter = new Highlighter(new InlineTheme(__DIR__ . '/../src/Themes/Css/solarized-dark.css'));
```

### Terminal themes
Expand All @@ -63,7 +63,7 @@ echo $highlighter->parse($code, 'php');
This package can render an optional gutter if needed.

```php
$highlighter = (new Highlighter())->withGutter(startAt: 10);
$highlighter = new Highlighter()->withGutter(startAt: 10);
```

The gutter will show additions and deletions, and can start at any given line number:
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Homepage/codeblocks/markdown-initializer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ final readonly class MarkdownInitializer implements Initializer
public function initialize(Container $container): MarkdownConverter
{
$environment = new Environment();
$highlighter = (new Highlighter(new CssTheme()));
$highlighter = new Highlighter(new CssTheme());

$highlighter
->addLanguage(new TempestViewLanguage())
Expand Down
Loading