Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: apply multiple updates #7

Merged
merged 4 commits into from
Aug 25, 2023
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
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
php: ['8.0', '8.1', '8.2']
php: ['8.1', '8.2']
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }}
Expand All @@ -22,7 +22,6 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: fileinfo
tools: composer
coverage: none

- name: Setup Problem Matches
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Please see the [upgrade guide](UPGRADE.md) for information on how to upgrade to

## Requirements

- PHP 8.0 or higher
- Laravel 9.0 or higher
- PHP 8.1 or higher
- Laravel 10.x or higher

## Install

Via Composer

```shell
$ composer require owenvoke/blade-entypo
composer require owenvoke/blade-entypo
```

## Configuration
Expand Down Expand Up @@ -85,7 +85,7 @@ Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed re
## Testing

```bash
$ composer test
composer test
```

## Contributing
Expand Down
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@
"description": "A package to easily make use of Entypo in your Laravel Blade views",
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.1",
"blade-ui-kit/blade-icons": "^1.5",
"illuminate/support": "^9.0|^10.0"
"illuminate/support": "^10.0",
"thecodingmachine/safe": "^2.5"
},
"require-dev": {
"laravel/pint": "^1.5",
"orchestra/testbench": "^7.22|^8.0",
"pestphp/pest": "^1.22.3",
"phpstan/phpstan": "^1.9.17",
"spatie/pest-plugin-snapshots": "^1.0.1",
"symfony/var-dumper": "^6.0"
"laravel/pint": "^1.11",
"orchestra/testbench": "^8.5",
"pestphp/pest": "^2.16",
"phpstan/phpstan": "^1.10",
"symfony/var-dumper": "^6.3",
"thecodingmachine/phpstan-safe-rule": "^1.2"
},
"autoload": {
"psr-4": {
Expand Down
6 changes: 5 additions & 1 deletion config/generation.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?php

declare(strict_types=1);

use function Safe\file_get_contents;
use function Safe\file_put_contents;

// Uses Icons from:
// https://github.com/adamwathan/entypo-optimized/tree/master/dist/icons

$svgNormalization = static function (string $tempFilepath, array $iconSet) {
/** @var string $svgContent */
$svgContent = file_get_contents($tempFilepath);
$svgContent = str_replace('<svg ', '<svg fill="currentColor" ', $svgContent);
file_put_contents($tempFilepath, $svgContent);
Expand Down
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
includes:
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon

parameters:
level: 8
paths:
Expand Down
15 changes: 5 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</source>
</phpunit>
7 changes: 3 additions & 4 deletions tests/CompilesIconsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@
declare(strict_types=1);

use OwenVoke\BladeEntypo\Tests\TestCase;
use function Spatie\Snapshots\assertMatchesSnapshot;

uses(TestCase::class);

it('compiles a single anonymous component', function () {
$result = svg('entypo-plus')->toHtml();

assertMatchesSnapshot($result);
expect($result)->toMatchSnapshot();
});

it('can add classes to icons', function () {
$result = svg('entypo-plus', 'w-6 h-6 text-gray-500')->toHtml();

assertMatchesSnapshot($result);
expect($result)->toMatchSnapshot();
});

it('can add styles to icons', function () {
$result = svg('entypo-plus', ['style' => 'color: #555'])->toHtml();

assertMatchesSnapshot($result);
expect($result)->toMatchSnapshot();
});
Loading