Skip to content

Commit 00ef35c

Browse files
authored
🔖 Navi v3.0 (#72)
2 parents 83580d1 + 7ac3e60 commit 00ef35c

File tree

20 files changed

+121
-479
lines changed

20 files changed

+121
-479
lines changed

.github/workflows/compatibility.yml

-43
This file was deleted.

.github/workflows/main.yml

+22-27
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,36 @@
1-
name: main
1+
name: Main
22

3-
on: [pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
410

511
jobs:
6-
main:
7-
runs-on: ${{ matrix.operating-system }}
12+
php:
13+
name: PHP ${{ matrix.php }}
14+
runs-on: ubuntu-latest
15+
816
strategy:
17+
fail-fast: true
918
matrix:
10-
operating-system: [ubuntu-latest]
11-
php-versions: ['7.4', '8.0', '8.1', '8.2']
19+
php: [8.1, 8.2]
20+
1221
steps:
13-
- name: Checkout
22+
- name: Checkout code
1423
uses: actions/checkout@v3
1524

1625
- name: Setup PHP
1726
uses: shivammathur/setup-php@v2
1827
with:
19-
php-version: ${{ matrix.php-versions }}
20-
coverage: xdebug
21-
env:
22-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
24-
- name: Validate composer.json and composer.lock
25-
run: composer validate --strict
26-
27-
- name: Get composer cache directory
28-
id: composercache
29-
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
30-
31-
- uses: actions/cache@v3
32-
with:
33-
path: ${{ steps.composercache.outputs.dir }}
34-
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
35-
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer-
28+
php-version: ${{ matrix.php }}
29+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
30+
coverage: none
3631

3732
- name: Install Composer dependencies
38-
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest
33+
run: composer install --prefer-dist --no-interaction --no-progress
3934

40-
- name: PHP lint
41-
run: composer run-script lint
35+
- name: Run Pint
36+
run: vendor/bin/pint --test

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup PHP, with composer and extensions
1818
uses: shivammathur/setup-php@v2
1919
with:
20-
php-version: '7.4'
20+
php-version: '8.1'
2121
coverage: xdebug
2222
env:
2323
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/vendor
2+
composer.lock

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
![Latest Stable Version](https://img.shields.io/packagist/v/log1x/navi.svg?style=flat-square)
44
![Total Downloads](https://img.shields.io/packagist/dt/log1x/navi.svg?style=flat-square)
5-
![Build Status](https://img.shields.io/github/actions/workflow/status/log1x/navi/compatibility.yml?branch=master&style=flat-square)
5+
![Build Status](https://img.shields.io/github/actions/workflow/status/log1x/navi/main.yml?branch=master&style=flat-square)
66

77
Hate the WordPress NavWalker? **Me too**.
88

99
Navi is a developer-friendly alternative to the NavWalker. Easily build your WordPress menus using an iterable object inside of a template/view.
1010

1111
## Requirements
1212

13-
- [PHP](https://secure.php.net/manual/en/install.php) >= 7.0
13+
- [PHP](https://secure.php.net/manual/en/install.php) >= 8.0
1414

1515
## Installation
1616

@@ -37,7 +37,7 @@ Check out the [**examples**](examples) folder to see how to use Navi in your pro
3737

3838
use Log1x\Navi\Navi;
3939

40-
$navigation = (new Navi())->build('primary_navigation');
40+
$navigation = Navi::make()->build('primary_navigation');
4141

4242
if ($navigation->isEmpty()) {
4343
return;

composer.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
}
2424
},
2525
"require": {
26-
"php": "^7.0|^8.0"
26+
"php": "^8.0"
2727
},
2828
"require-dev": {
29-
"squizlabs/php_codesniffer": "^3.4"
29+
"laravel/pint": "^1.14"
3030
},
3131
"extra": {
3232
"acorn": {
@@ -37,10 +37,5 @@
3737
"Navi": "Log1x\\Navi\\Facades\\Navi"
3838
}
3939
}
40-
},
41-
"scripts": {
42-
"lint": [
43-
"phpcs --ignore=vendor,examples --extensions=php --standard=PSR12 ."
44-
]
4540
}
4641
}

composer.lock

-101
This file was deleted.

examples/sage-9/app/Controllers/App.php

-16
This file was deleted.

examples/sage-9/resources/views/partials/navigation.blade.php

-23
This file was deleted.

examples/sage-10/app/View/Composers/Navigation.php examples/sage/app/View/Composers/Navigation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace App\View\Composers;
44

5-
use Roots\Acorn\View\Composer;
65
use Log1x\Navi\Facades\Navi;
6+
use Roots\Acorn\View\Composer;
77

88
class Navigation extends Composer
99
{

examples/vanilla/template-parts/site-nav.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @link https://github.com/log1x/navi
66
*/
77

8-
$navigation = new \Log1x\Navi\Navi()->build('primary-menu');
8+
$navigation = \Log1x\Navi\Navi::make()->build('primary-menu');
99
?>
1010

1111
<?php if ( $navigation->isNotEmpty() ) : ?>

pint.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"exclude": [
3+
"examples/vanilla"
4+
],
5+
"notName": [
6+
"plugin.php"
7+
]
8+
}

plugin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
* Plugin Name: Navi
55
* Plugin URI: https://github.com/log1x/navi
66
* Description: A developer-friendly alternative to the WordPress NavWalker.
7-
* Version: 2.0.4
7+
* Version: 3.0.0
88
* Author: Brandon Nifong
99
* Author URI: https://github.com/log1x
1010
*/
1111

12-
if (! file_exists($composer = __DIR__ . '/vendor/autoload.php')) {
12+
if (! file_exists($composer = __DIR__.'/vendor/autoload.php')) {
1313
return;
1414
}
1515

src/Contracts/Arrayable.php

-13
This file was deleted.

src/Contracts/Jsonable.php

-14
This file was deleted.

src/Facades/Navi.php

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* @method static bool isNotEmpty()
1212
*
1313
* @see \Log1x\Navi\Navi
14-
* @see \Illuminate\Support\Fluent
1514
*/
1615
class Navi extends Facade
1716
{

0 commit comments

Comments
 (0)