Skip to content

Commit

Permalink
🔖 Navi v3.0 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Mar 18, 2024
2 parents 83580d1 + 7ac3e60 commit 00ef35c
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 479 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/compatibility.yml

This file was deleted.

49 changes: 22 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
name: main
name: Main

on: [pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
main:
runs-on: ${{ matrix.operating-system }}
php:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1', '8.2']
php: [8.1, 8.2]

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Get composer cache directory
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- uses: actions/cache@v3
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.php-versions }}-composer-
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: none

- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader --no-suggest
run: composer install --prefer-dist --no-interaction --no-progress

- name: PHP lint
run: composer run-script lint
- name: Run Pint
run: vendor/bin/pint --test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
coverage: xdebug
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/vendor
composer.lock
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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

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

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

## Requirements

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

## Installation

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

use Log1x\Navi\Navi;

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

if ($navigation->isEmpty()) {
return;
Expand Down
9 changes: 2 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
}
},
"require": {
"php": "^7.0|^8.0"
"php": "^8.0"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.4"
"laravel/pint": "^1.14"
},
"extra": {
"acorn": {
Expand All @@ -37,10 +37,5 @@
"Navi": "Log1x\\Navi\\Facades\\Navi"
}
}
},
"scripts": {
"lint": [
"phpcs --ignore=vendor,examples --extensions=php --standard=PSR12 ."
]
}
}
101 changes: 0 additions & 101 deletions composer.lock

This file was deleted.

16 changes: 0 additions & 16 deletions examples/sage-9/app/Controllers/App.php

This file was deleted.

23 changes: 0 additions & 23 deletions examples/sage-9/resources/views/partials/navigation.blade.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\View\Composers;

use Roots\Acorn\View\Composer;
use Log1x\Navi\Facades\Navi;
use Roots\Acorn\View\Composer;

class Navigation extends Composer
{
Expand Down
2 changes: 1 addition & 1 deletion examples/vanilla/template-parts/site-nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @link https://github.com/log1x/navi
*/

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

<?php if ( $navigation->isNotEmpty() ) : ?>
Expand Down
8 changes: 8 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"exclude": [
"examples/vanilla"
],
"notName": [
"plugin.php"
]
}
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* Plugin Name: Navi
* Plugin URI: https://github.com/log1x/navi
* Description: A developer-friendly alternative to the WordPress NavWalker.
* Version: 2.0.4
* Version: 3.0.0
* Author: Brandon Nifong
* Author URI: https://github.com/log1x
*/

if (! file_exists($composer = __DIR__ . '/vendor/autoload.php')) {
if (! file_exists($composer = __DIR__.'/vendor/autoload.php')) {
return;
}

Expand Down
13 changes: 0 additions & 13 deletions src/Contracts/Arrayable.php

This file was deleted.

14 changes: 0 additions & 14 deletions src/Contracts/Jsonable.php

This file was deleted.

1 change: 0 additions & 1 deletion src/Facades/Navi.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
* @method static bool isNotEmpty()
*
* @see \Log1x\Navi\Navi
* @see \Illuminate\Support\Fluent
*/
class Navi extends Facade
{
Expand Down
Loading

0 comments on commit 00ef35c

Please sign in to comment.