Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
medilies committed Nov 12, 2023
1 parent 87075aa commit e3d11d0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, libxml, fileinfo, sockets
extensions: dom, libxml, sockets
coverage: none

- name: Setup problem matchers
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ app()->get(Support::class);

Requires:

- PHP 8.1
- `sockets` extension.
- PHP >= 8.1

`chrome-php/chrome` dependencies:

- ext-sockets

## Usage

Expand Down
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
],
"require": {
"php": "^8.1",
"illuminate/container": "*",
"chrome-php/chrome": "^1.9"
},
"require-dev": {
"laravel/pint": "^1.0",
"pestphp/pest": "^2.0",
"pestphp/pest-plugin-laravel": "^2.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
Expand Down
10 changes: 10 additions & 0 deletions src/ChromePhpConfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace RowBloom\ChromePhpRenderer;

class ChromePhpConfig
{
public function __construct(public ?string $chromePath = null)
{
}
}
7 changes: 3 additions & 4 deletions src/ChromePhpRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
use RowBloom\RowBloom\Config;
use RowBloom\RowBloom\Fs\File;
use RowBloom\RowBloom\Options;
use RowBloom\RowBloom\Renderers\RendererContract;
use RowBloom\RowBloom\Renderers\Contract as RenderersContract;
use RowBloom\RowBloom\Renderers\Sizing\LengthUnit;
use RowBloom\RowBloom\Renderers\Sizing\Margin;
use RowBloom\RowBloom\Types\Css;
use RowBloom\RowBloom\Types\Html;

class ChromePhpRenderer implements RendererContract
class ChromePhpRenderer implements RenderersContract
{
public const NAME = 'Chrome';

Expand Down Expand Up @@ -52,8 +52,7 @@ public function render(Html $html, Css $css, Options $options, Config $config =

$this->phpChromeOptions = [];

/** @var BrowserFactory */
$browserFactory = app()->make(BrowserFactory::class, ['chromeBinary' => $this->config?->chromePath]);
$browserFactory = new BrowserFactory($this->config?->getDriverConfig(ChromePhpConfig::class)->chromePath);

Check failure on line 55 in src/ChromePhpRenderer.php

View workflow job for this annotation

GitHub Actions / phpstan

Access to an undefined property object::$chromePath.
$browser = $browserFactory->createBrowser();
$page = $browser->createPage();

Expand Down

0 comments on commit e3d11d0

Please sign in to comment.