Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: enflow/laravel-outdated-browser
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.0.0
Choose a base ref
...
head repository: enflow/laravel-outdated-browser
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Apr 19, 2021

  1. Allow PHP 8

    mbardelmeijer committed Apr 19, 2021
    Copy the full SHA
    e185ba5 View commit details
  2. Copy the full SHA
    1b4eea3 View commit details

Commits on Feb 9, 2022

  1. Copy the full SHA
    ccb2dd2 View commit details
  2. Tweak PHP CS fixer

    mbardelmeijer committed Feb 9, 2022
    Copy the full SHA
    fd134e2 View commit details
  3. Fix PHP CS

    mbardelmeijer committed Feb 9, 2022
    Copy the full SHA
    3d62862 View commit details
  4. Copy the full SHA
    a68ede0 View commit details

Commits on Mar 13, 2022

  1. Copy the full SHA
    d6fdce0 View commit details
  2. Merge branch 'laravel9'

    mbardelmeijer committed Mar 13, 2022
    Copy the full SHA
    ae97cf4 View commit details

Commits on Feb 24, 2023

  1. Laravel 10

    mbardelmeijer committed Feb 24, 2023
    Copy the full SHA
    438c395 View commit details

Commits on Mar 20, 2023

  1. Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0

    Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.1.0 to 2.2.0.
    - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases)
    - [Commits](aglipanci/laravel-pint-action@2.1.0...2.2.0)
    
    ---
    updated-dependencies:
    - dependency-name: aglipanci/laravel-pint-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 20, 2023
    Copy the full SHA
    6ed40cc View commit details
  2. Merge pull request #3 from enflow/dependabot/github_actions/aglipanci…

    …/laravel-pint-action-2.2.0
    
    Bump aglipanci/laravel-pint-action from 2.1.0 to 2.2.0
    github-actions[bot] authored Mar 20, 2023
    Copy the full SHA
    b2715c6 View commit details

Commits on Apr 17, 2023

  1. Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0

    Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.3.6 to 1.4.0.
    - [Release notes](https://github.com/dependabot/fetch-metadata/releases)
    - [Commits](dependabot/fetch-metadata@v1.3.6...v1.4.0)
    
    ---
    updated-dependencies:
    - dependency-name: dependabot/fetch-metadata
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Apr 17, 2023
    Copy the full SHA
    3fdb88f View commit details
  2. Merge pull request #4 from enflow/dependabot/github_actions/dependabo…

    …t/fetch-metadata-1.4.0
    
    Bump dependabot/fetch-metadata from 1.3.6 to 1.4.0
    github-actions[bot] authored Apr 17, 2023
    Copy the full SHA
    0896a89 View commit details

Commits on May 22, 2023

  1. Bump dependabot/fetch-metadata from 1.4.0 to 1.5.0

    Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.4.0 to 1.5.0.
    - [Release notes](https://github.com/dependabot/fetch-metadata/releases)
    - [Commits](dependabot/fetch-metadata@v1.4.0...v1.5.0)
    
    ---
    updated-dependencies:
    - dependency-name: dependabot/fetch-metadata
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 22, 2023
    Copy the full SHA
    bf9d58c View commit details
  2. Merge pull request #5 from enflow/dependabot/github_actions/dependabo…

    …t/fetch-metadata-1.5.0
    
    Bump dependabot/fetch-metadata from 1.4.0 to 1.5.0
    github-actions[bot] authored May 22, 2023
    Copy the full SHA
    02b82b9 View commit details

Commits on May 29, 2023

  1. Bump dependabot/fetch-metadata from 1.5.0 to 1.5.1

    Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.0 to 1.5.1.
    - [Release notes](https://github.com/dependabot/fetch-metadata/releases)
    - [Commits](dependabot/fetch-metadata@v1.5.0...v1.5.1)
    
    ---
    updated-dependencies:
    - dependency-name: dependabot/fetch-metadata
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 29, 2023
    Copy the full SHA
    b899c52 View commit details
  2. Bump aglipanci/laravel-pint-action from 2.2.0 to 2.3.0

    Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.2.0 to 2.3.0.
    - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases)
    - [Commits](aglipanci/laravel-pint-action@2.2.0...2.3.0)
    
    ---
    updated-dependencies:
    - dependency-name: aglipanci/laravel-pint-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored May 29, 2023
    Copy the full SHA
    05d09b7 View commit details
  3. Merge pull request #6 from enflow/dependabot/github_actions/dependabo…

    …t/fetch-metadata-1.5.1
    
    Bump dependabot/fetch-metadata from 1.5.0 to 1.5.1
    github-actions[bot] authored May 29, 2023
    Copy the full SHA
    6dd99f1 View commit details

Commits on Jul 3, 2023

  1. Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0

    Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 1.5.1 to 1.6.0.
    - [Release notes](https://github.com/dependabot/fetch-metadata/releases)
    - [Commits](dependabot/fetch-metadata@v1.5.1...v1.6.0)
    
    ---
    updated-dependencies:
    - dependency-name: dependabot/fetch-metadata
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jul 3, 2023
    Copy the full SHA
    1b11b6f View commit details
  2. Merge pull request #8 from enflow/dependabot/github_actions/dependabo…

    …t/fetch-metadata-1.6.0
    
    Bump dependabot/fetch-metadata from 1.5.1 to 1.6.0
    github-actions[bot] authored Jul 3, 2023
    Copy the full SHA
    fd7dfdc View commit details

Commits on Jul 21, 2023

  1. Merge pull request #7 from enflow/dependabot/github_actions/aglipanci…

    …/laravel-pint-action-2.3.0
    mbardelmeijer authored Jul 21, 2023
    Copy the full SHA
    8d5908a View commit details

Commits on Sep 4, 2023

  1. Bump actions/checkout from 3 to 4

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Sep 4, 2023
    Copy the full SHA
    857d02b View commit details
  2. Merge pull request #9 from enflow/dependabot/github_actions/actions/c…

    …heckout-4
    
    Bump actions/checkout from 3 to 4
    mbardelmeijer authored Sep 4, 2023
    Copy the full SHA
    a901b38 View commit details

Commits on Oct 9, 2023

  1. Bump stefanzweifel/git-auto-commit-action from 4 to 5

    Bumps [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) from 4 to 5.
    - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases)
    - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md)
    - [Commits](stefanzweifel/git-auto-commit-action@v4...v5)
    
    ---
    updated-dependencies:
    - dependency-name: stefanzweifel/git-auto-commit-action
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Oct 9, 2023
    Copy the full SHA
    facf3b9 View commit details

Commits on Dec 25, 2023

  1. Bump aglipanci/laravel-pint-action from 2.3.0 to 2.3.1

    Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.3.0 to 2.3.1.
    - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases)
    - [Commits](aglipanci/laravel-pint-action@2.3.0...2.3.1)
    
    ---
    updated-dependencies:
    - dependency-name: aglipanci/laravel-pint-action
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Dec 25, 2023
    Copy the full SHA
    b08d620 View commit details
  2. Merge pull request #11 from enflow/dependabot/github_actions/aglipanc…

    …i/laravel-pint-action-2.3.1
    
    Bump aglipanci/laravel-pint-action from 2.3.0 to 2.3.1
    github-actions[bot] authored Dec 25, 2023
    Copy the full SHA
    45dfdae View commit details

Commits on Mar 13, 2024

  1. Merge pull request #10 from enflow/dependabot/github_actions/stefanzw…

    …eifel/git-auto-commit-action-5
    
    Bump stefanzweifel/git-auto-commit-action from 4 to 5
    mbardelmeijer authored Mar 13, 2024
    Copy the full SHA
    6eb5d2e View commit details

Commits on Mar 15, 2024

  1. Upgrade for Laravel 11

    mbardelmeijer committed Mar 15, 2024
    Copy the full SHA
    089542d View commit details
  2. Allow phpunit 10

    mbardelmeijer committed Mar 15, 2024
    Copy the full SHA
    190f898 View commit details
  3. Fix GitHub actions test

    mbardelmeijer committed Mar 15, 2024
    Copy the full SHA
    d5eec6c View commit details
  4. Tweak GitHub Actions

    mbardelmeijer committed Mar 15, 2024
    Copy the full SHA
    c604be7 View commit details
  5. Merge pull request #12 from enflow/laravel11

    Upgrade for Laravel 11
    mbardelmeijer authored Mar 15, 2024
    Copy the full SHA
    4ead324 View commit details

Commits on Apr 15, 2024

  1. Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4

    Bumps [aglipanci/laravel-pint-action](https://github.com/aglipanci/laravel-pint-action) from 2.3.1 to 2.4.
    - [Release notes](https://github.com/aglipanci/laravel-pint-action/releases)
    - [Commits](aglipanci/laravel-pint-action@2.3.1...2.4)
    
    ---
    updated-dependencies:
    - dependency-name: aglipanci/laravel-pint-action
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Apr 15, 2024
    Copy the full SHA
    f3a040a View commit details
  2. Merge pull request #14 from enflow/dependabot/github_actions/aglipanc…

    …i/laravel-pint-action-2.4
    
    Bump aglipanci/laravel-pint-action from 2.3.1 to 2.4
    github-actions[bot] authored Apr 15, 2024
    Copy the full SHA
    e6431cb View commit details

Commits on Feb 22, 2025

  1. Laravel 12 support

    mbardelmeijer committed Feb 22, 2025
    Copy the full SHA
    d860628 View commit details
21 changes: 14 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/docs export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/example export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore

# All test snapshots and text stubs must have LF line endings
tests/**/__snapshots__/** text eol=lf
tests/**/stubs/** text eol=lf
tests/**/stubs/**/*.jpg binary
tests/**/stubs/**/*.png binary
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
32 changes: 32 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: dependabot-auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:

- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.6.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto-merge Dependabot PRs for semver-minor updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto-merge Dependabot PRs for semver-patch updates
if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}}
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
24 changes: 24 additions & 0 deletions .github/workflows/fix-php-code-style-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Fix PHP code style issues

on:
push:
paths:
- '**.php'

jobs:
php-code-styling:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Fix PHP code style issues
uses: aglipanci/laravel-pint-action@2.4

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Fix styling
23 changes: 0 additions & 23 deletions .github/workflows/php-cs-fixer.yml

This file was deleted.

83 changes: 43 additions & 40 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
name: run-tests

on: [push, pull_request]
on:
push:
pull_request:

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [7.4]
laravel: [8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [ 8.4, 8.3 ]
laravel: [ ^12.0, ^11.0 ]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: ^12.0
testbench: ^10.0
- laravel: ^11.0
testbench: ^9.0

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Setup problem matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
- name: Execute tests
run: vendor/bin/phpunit
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
.php_cs.cache
.phpunit.result.cache
.phpunit.cache
composer.lock
coverage
docs
phpunit.xml
psalm.xml
vendor
32 changes: 0 additions & 32 deletions .php_cs.dist

This file was deleted.

14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@
}
],
"require": {
"php": "^7.4",
"illuminate/support": "^8.0"
"php": "^8.3",
"illuminate/support": "^11.0|^12.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"orchestra/testbench": "^6.0",
"phpunit/phpunit": "^9.3"
"laravel/pint": "^1.0",
"orchestra/testbench": "^9.0|^10.0",
"phpunit/phpunit": "^11.0"
},
"config": {
"sort-packages": true
@@ -38,10 +38,10 @@
}
},
"scripts": {
"format": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"format": "vendor/bin/pint",
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"minimum-stability": "dev",
"prefer-stable": true
}
}
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" backupStaticAttributes="false" colors="true" verbose="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Enflow's Laravel Outdated Browser">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
10 changes: 0 additions & 10 deletions resources/views/logic.blade.php

This file was deleted.

4 changes: 3 additions & 1 deletion src/Detector/UserAgentDetector.php
Original file line number Diff line number Diff line change
@@ -13,9 +13,11 @@ public function __construct()
$this->regexes = config('outdated-browser.blocked_user_agent_regexes', []);
}

public function setRegexes(array $regexes)
public function setRegexes(array $regexes): self
{
$this->regexes = $regexes;

return $this;
}

public function isOutdated(Request $request): bool
2 changes: 1 addition & 1 deletion src/Memory/CookieMemory.php
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ class CookieMemory implements Memory

public function hasContinued(): bool
{
return ! ! Cookie::get(static::KEY);
return (bool) Cookie::get(static::KEY);
}

public function remember(): void
2 changes: 1 addition & 1 deletion src/Memory/SessionMemory.php
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ class SessionMemory implements Memory

public function hasContinued(): bool
{
return ! ! session()->get(static::KEY);
return (bool) session()->get(static::KEY);
}

public function remember(): void
16 changes: 6 additions & 10 deletions src/OutdatedBrowserMiddleware.php
Original file line number Diff line number Diff line change
@@ -10,15 +10,11 @@

class OutdatedBrowserMiddleware
{
public Detector $detector;
public Memory $memory;
public Inspector $inspector;

public function __construct(Detector $detector, Memory $memory, Inspector $inspector)
{
$this->detector = $detector;
$this->memory = $memory;
$this->inspecter = $inspector;
public function __construct(
public readonly Detector $detector,
public readonly Memory $memory,
public readonly Inspector $inspector,
) {
}

public function handle(Request $request, Closure $next)
@@ -34,7 +30,7 @@ public function handle(Request $request, Closure $next)
}

// We cannot ask here.
if ($this->inspecter->shouldPresentGate($request) !== true) {
if ($this->inspector->shouldPresentGate($request) !== true) {
return $next($request);
}

Loading