Skip to content

Commit db69cf7

Browse files
committed
Over Haul
1 parent 12e4b1b commit db69cf7

27 files changed

+200
-129
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ composer.phar
33
composer.lock
44
build
55
.php_cs.cache
6+
.idea/

.php_cs.dist renamed to .php-cs-fixer.dist.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
<?php
22

3-
$finder = PhpCsFixer\Finder::create()
3+
use PhpCsFixer\Config;
4+
use PhpCsFixer\Finder;
5+
6+
$finder = (new Finder())
47
->in(__DIR__)
58
->exclude([
69
'vendor',
710
])
811
;
912

10-
return PhpCsFixer\Config::create()
11-
->setFinder($finder)
13+
return (new Config())
1214
->setRules([
1315
'@PSR2' => true,
1416
// Concatenation should be used with at least one whitespace around.
1517
'concat_space' => ['spacing' => 'one'],
1618
// Unused use statements must be removed.
1719
'ordered_imports' => true,
1820
// Removes extra empty lines.
19-
'no_extra_consecutive_blank_lines' => true,
21+
'no_extra_blank_lines' => true,
2022
// An empty line feed should precede a return statement.
21-
'blank_line_before_return' => true,
23+
'blank_line_before_statement' => true,
2224
// Unused use statements must be removed.
2325
'no_unused_imports' => true,
2426
// Remove trailing whitespace at the end of blank lines.
@@ -34,12 +36,13 @@
3436
// Remove duplicated semicolons.
3537
'no_empty_statement' => true,
3638
// PHP multi-line arrays should have a trailing comma.
37-
'trailing_comma_in_multiline_array' => true,
39+
'trailing_comma_in_multiline' => true,
3840
// There should be no empty lines after class opening brace.
3941
'no_blank_lines_after_class_opening' => true,
4042
// There should not be blank lines between docblock and the documented element.
4143
'no_blank_lines_after_phpdoc' => true,
4244
// Phpdocs should start and end with content, excluding the very first and last line of the docblocks.
4345
'phpdoc_trim' => true,
4446
])
47+
->setFinder($finder)
4548
;

Tests/BaseTestCase.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace Nwidart\Menus\Tests;
3+
namespace KyleMassacre\Menus\Tests;
44

55
use Collective\Html\HtmlServiceProvider;
6-
use Nwidart\Menus\MenusServiceProvider;
6+
use KyleMassacre\Menus\MenusServiceProvider;
77
use Orchestra\Testbench\TestCase as OrchestraTestCase;
88

99
abstract class BaseTestCase extends OrchestraTestCase
@@ -32,12 +32,12 @@ protected function getEnvironmentSetUp($app)
3232
{
3333
$app['config']->set('menus', [
3434
'styles' => [
35-
'navbar' => \Nwidart\Menus\Presenters\Bootstrap\NavbarPresenter::class,
36-
'navbar-right' => \Nwidart\Menus\Presenters\Bootstrap\NavbarRightPresenter::class,
37-
'nav-pills' => \Nwidart\Menus\Presenters\Bootstrap\NavPillsPresenter::class,
38-
'nav-tab' => \Nwidart\Menus\Presenters\Bootstrap\NavTabPresenter::class,
39-
'sidebar' => \Nwidart\Menus\Presenters\Bootstrap\SidebarMenuPresenter::class,
40-
'navmenu' => \Nwidart\Menus\Presenters\Bootstrap\NavMenuPresenter::class,
35+
'navbar' => \KyleMassacre\Menus\Presenters\Bootstrap\NavbarPresenter::class,
36+
'navbar-right' => \KyleMassacre\Menus\Presenters\Bootstrap\NavbarRightPresenter::class,
37+
'nav-pills' => \KyleMassacre\Menus\Presenters\Bootstrap\NavPillsPresenter::class,
38+
'nav-tab' => \KyleMassacre\Menus\Presenters\Bootstrap\NavTabPresenter::class,
39+
'sidebar' => \KyleMassacre\Menus\Presenters\Bootstrap\SidebarMenuPresenter::class,
40+
'navmenu' => \KyleMassacre\Menus\Presenters\Bootstrap\NavMenuPresenter::class,
4141
],
4242

4343
'ordering' => false,

Tests/MenuBuilderTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace Nwidart\Menus\Tests;
3+
namespace KyleMassacre\Menus\Tests;
44

55
use Illuminate\Config\Repository;
6-
use Nwidart\Menus\MenuBuilder;
7-
use Nwidart\Menus\MenuItem;
6+
use KyleMassacre\Menus\MenuBuilder;
7+
use KyleMassacre\Menus\MenuItem;
88

99
class MenuBuilderTest extends BaseTestCase
1010
{

Tests/MenuItemTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace Nwidart\Menus\Tests;
3+
namespace KyleMassacre\Menus\Tests;
44

55
use Illuminate\Support\Arr;
6-
use Nwidart\Menus\Menu;
7-
use Nwidart\Menus\MenuItem;
6+
use KyleMassacre\Menus\Menu;
7+
use KyleMassacre\Menus\MenuItem;
88

99
class MenuItemTest extends BaseTestCase
1010
{

Tests/MenuTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace Nwidart\Menus\Tests;
3+
namespace KyleMassacre\Menus\Tests;
44

5-
use Nwidart\Menus\Menu;
6-
use Nwidart\Menus\MenuBuilder;
5+
use KyleMassacre\Menus\Menu;
6+
use KyleMassacre\Menus\MenuBuilder;
77

88
class MenuTest extends BaseTestCase
99
{
@@ -138,9 +138,9 @@ public function it_can_destroy_all_menus()
138138
public function it_still_generates_empty_menu_after_adding_dropdown()
139139
{
140140
$this->menu->create('test', function (MenuBuilder $menu) {
141-
$menu->dropdown('Test', function($sub) {
141+
$menu->dropdown('Test', function ($sub) {
142142

143-
})->hideWhen(function() {
143+
})->hideWhen(function () {
144144
return true;
145145
});
146146
});
@@ -161,7 +161,7 @@ public function it_still_generates_empty_menu_after_adding_item()
161161
{
162162
$this->menu->create('test', function (MenuBuilder $menu) {
163163
$menu->url('/', 'Test')
164-
->hideWhen(function() {
164+
->hideWhen(function () {
165165
return true;
166166
});
167167
});

composer.json

+22-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "nwidart/laravel-menus",
2+
"name": "kylemassacre/laravel-menus",
33
"description": "Laravel Menu management",
44
"keywords": [
55
"laravel",
@@ -17,29 +17,33 @@
1717
{
1818
"name": "Pingpong Labs",
1919
"email": "[email protected]"
20+
},
21+
{
22+
"name": "Kyle Ellis",
23+
"email": "[email protected]"
2024
}
2125
],
2226
"require": {
23-
"php": ">=7.3",
24-
"illuminate/support": "^8.0",
25-
"illuminate/config": "^8.0",
26-
"illuminate/view": "^8.0",
27-
"laravelcollective/html": "6.2.*"
27+
"php": "^8.0",
28+
"illuminate/support": "^10.0",
29+
"illuminate/config": "^10.0",
30+
"illuminate/view": "^10.0",
31+
"laravelcollective/html": "^6.4"
2832
},
2933
"require-dev": {
30-
"phpunit/phpunit": "^8.5",
31-
"mockery/mockery": "~1.0",
32-
"orchestra/testbench": "^6.2",
33-
"friendsofphp/php-cs-fixer": "^2.16"
34+
"phpunit/phpunit": ">=9.6",
35+
"mockery/mockery": "^1.6",
36+
"orchestra/testbench": "^8",
37+
"friendsofphp/php-cs-fixer": "^3.52"
3438
},
3539
"autoload": {
3640
"psr-4": {
37-
"Nwidart\\Menus\\": "src"
41+
"KyleMassacre\\Menus\\": "src"
3842
}
3943
},
4044
"autoload-dev": {
4145
"psr-4": {
42-
"Nwidart\\Menus\\Tests\\": "Tests"
46+
"KyleMassacre\\Menus\\Tests\\": "Tests"
4347
}
4448
},
4549
"extra": {
@@ -48,12 +52,15 @@
4852
},
4953
"laravel": {
5054
"providers": [
51-
"Nwidart\\Menus\\MenusServiceProvider"
55+
"KyleMassacre\\Menus\\MenusServiceProvider"
5256
],
5357
"aliases": {
54-
"Menu": "Nwidart\\Menus\\Facades\\Menu"
58+
"Menu": "KyleMassacre\\Menus\\Facades\\Menu"
5559
}
5660
}
5761
},
58-
"minimum-stability": "stable"
62+
"minimum-stability": "stable",
63+
"scripts": {
64+
"php-cs-fixer": "php-cs-fixer --config=./.php-cs-fixer.dist.php"
65+
}
5966
}

config/config.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
return [
44

55
'styles' => [
6-
'navbar' => \Nwidart\Menus\Presenters\Bootstrap\NavbarPresenter::class,
7-
'navbar-right' => \Nwidart\Menus\Presenters\Bootstrap\NavbarRightPresenter::class,
8-
'nav-pills' => \Nwidart\Menus\Presenters\Bootstrap\NavPillsPresenter::class,
9-
'nav-tab' => \Nwidart\Menus\Presenters\Bootstrap\NavTabPresenter::class,
10-
'sidebar' => \Nwidart\Menus\Presenters\Bootstrap\SidebarMenuPresenter::class,
11-
'navmenu' => \Nwidart\Menus\Presenters\Bootstrap\NavMenuPresenter::class,
12-
'adminlte' => \Nwidart\Menus\Presenters\Admin\AdminltePresenter::class,
13-
'zurbmenu' => \Nwidart\Menus\Presenters\Foundation\ZurbMenuPresenter::class,
6+
'navbar' => \KyleMassacre\Menus\Presenters\Bootstrap\NavbarPresenter::class,
7+
'navbar-right' => \KyleMassacre\Menus\Presenters\Bootstrap\NavbarRightPresenter::class,
8+
'nav-pills' => \KyleMassacre\Menus\Presenters\Bootstrap\NavPillsPresenter::class,
9+
'nav-tab' => \KyleMassacre\Menus\Presenters\Bootstrap\NavTabPresenter::class,
10+
'sidebar' => \KyleMassacre\Menus\Presenters\Bootstrap\SidebarMenuPresenter::class,
11+
'navmenu' => \KyleMassacre\Menus\Presenters\Bootstrap\NavMenuPresenter::class,
12+
'adminlte' => \KyleMassacre\Menus\Presenters\Admin\AdminltePresenter::class,
13+
'zurbmenu' => \KyleMassacre\Menus\Presenters\Foundation\ZurbMenuPresenter::class,
1414
],
1515

1616
'ordering' => false,

phpunit.xml.dist

+30-27
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="vendor/autoload.php"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
verbose="true"
7-
convertErrorsToExceptions="true"
8-
convertNoticesToExceptions="true"
9-
convertWarningsToExceptions="true"
10-
processIsolation="false"
11-
stopOnFailure="false">
12-
<testsuites>
13-
<testsuite name="Laravel Menus Test Suite">
14-
<directory>Tests</directory>
15-
</testsuite>
16-
</testsuites>
17-
<filter>
18-
<whitelist>
19-
<directory suffix=".php">src/</directory>
20-
</whitelist>
21-
</filter>
22-
<logging>
23-
<log type="tap" target="build/report.tap"/>
24-
<log type="junit" target="build/report.junit.xml"/>
25-
<log type="coverage-html" target="build/coverage"/>
26-
<log type="coverage-text" target="build/coverage.txt"/>
27-
<log type="coverage-clover" target="build/logs/clover.xml"/>
28-
</logging>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
bootstrap="vendor/autoload.php"
5+
backupGlobals="false"
6+
colors="true"
7+
processIsolation="false"
8+
stopOnFailure="false"
9+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
10+
cacheDirectory=".phpunit.cache"
11+
backupStaticProperties="false">
12+
<coverage>
13+
<report>
14+
<clover outputFile="build/logs/clover.xml"/>
15+
<html outputDirectory="build/coverage"/>
16+
<text outputFile="build/coverage.txt"/>
17+
</report>
18+
</coverage>
19+
<testsuites>
20+
<testsuite name="Laravel Menus Test Suite">
21+
<directory>Tests</directory>
22+
</testsuite>
23+
</testsuites>
24+
<logging>
25+
<junit outputFile="build/report.junit.xml"/>
26+
</logging>
27+
<source>
28+
<include>
29+
<directory suffix=".php">src/</directory>
30+
</include>
31+
</source>
2932
</phpunit>

src/Facades/Menu.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace Nwidart\Menus\Facades;
3+
namespace KyleMassacre\Menus\Facades;
44

55
use Closure;
66
use Illuminate\Support\Facades\Facade;
7-
use Nwidart\Menus\MenuBuilder;
7+
use KyleMassacre\Menus\MenuBuilder;
88

99
/**
1010
* @method static MenuBuilder make($name, Closure $callback) Make new menu.

src/Menu.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Nwidart\Menus;
3+
namespace KyleMassacre\Menus;
44

55
use Closure;
66
use Countable;
@@ -42,7 +42,7 @@ public function __construct(Factory $views, Repository $config)
4242
* @param string $name
4343
* @param Closure $callback
4444
*
45-
* @return \Nwidart\Menus\MenuBuilder
45+
* @return \KyleMassacre\Menus\MenuBuilder
4646
*/
4747
public function make($name, \Closure $callback)
4848
{
@@ -55,7 +55,7 @@ public function make($name, \Closure $callback)
5555
* @param string $name
5656
* @param Callable $resolver
5757
*
58-
* @return \Nwidart\Menus\MenuBuilder
58+
* @return \KyleMassacre\Menus\MenuBuilder
5959
*/
6060
public function create($name, Closure $resolver)
6161
{

0 commit comments

Comments
 (0)