Skip to content

Commit

Permalink
Refactoring: renamed Carrooi\Menu namespace to Contributte\MenuControl
Browse files Browse the repository at this point in the history
  • Loading branch information
foxycode committed Mar 28, 2020
1 parent 3feb613 commit 95c1d58
Show file tree
Hide file tree
Showing 32 changed files with 106 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cache:
install:
- travis_retry composer install --no-progress --prefer-dist

script: vendor/bin/tester -s -p php -c tests/php.ini tests/CarrooiTests/Menu/
script: vendor/bin/tester -s -p php -c tests/php.ini tests/CarrooiTests/

after_failure:
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Build Status](https://img.shields.io/travis/Carrooi/Nette-Menu.svg?style=flat-square)](https://travis-ci.org/Carrooi/Nette-Menu)
[![Donate](https://img.shields.io/badge/donate-PayPal-brightgreen.svg?style=flat-square)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPH6AC9D5LGHY)
[![Build Status](https://travis-ci.org/contributte/menu-control.svg?branch=nette24)](https://travis-ci.org/contributte/menu-control)

# Nette menu

Expand All @@ -15,14 +14,14 @@ Nette component for creating menus, breadcrumbs and sitemaps.
**Install package with composer:**

```
$ composer require carrooi/nette-menu
$ composer require contributte/menu-control
```

**Register as nette extension:**

```yaml
extensions:
menu: Carrooi\Menu\DI\MenuExtension
menu: Contributte\MenuControl\DI\MenuExtension

menu:
```
Expand Down Expand Up @@ -66,8 +65,8 @@ menu:

namespace App;

use Carrooi\Menu\UI\IMenuComponentFactory;
use Carrooi\Menu\UI\MenuComponent;
use Contributte\MenuControl\UI\IMenuComponentFactory;
use Contributte\MenuControl\UI\MenuComponent;
use Nette\Application\UI\Presenter;

final class BasePresenter extends Presenter
Expand Down Expand Up @@ -117,9 +116,9 @@ This package includes 3 default templates (menu, breadcrumbs, sitemap). However
should be used in real project. The other two templates should only help you in the beginning with building your own
templates which will fit your's website look.

* [menu.latte](./src/Carrooi/Menu/UI/templates/menu.latte)
* [breadcrumbs.latte](./src/Carrooi/Menu/UI/templates/menu.latte)
* [sitemap.latte](./src/Carrooi/Menu/UI/templates/sitemap.latte)
* [menu.latte](./src/UI/templates/menu.latte)
* [breadcrumbs.latte](./src/UI/templates/menu.latte)
* [sitemap.latte](./src/UI/templates/sitemap.latte)

Changing templates can be done in your menu configuration:

Expand Down Expand Up @@ -233,8 +232,8 @@ This menu package uses custom `IAuthorizator` interface which you can use to wri
namespace App;
use Carrooi\Menu\IMenuItem;
use Carrooi\Menu\Security\IAuthorizator;
use Contributte\MenuControl\IMenuItem;
use Contributte\MenuControl\Security\IAuthorizator;
final class FrontAuthorizator implements IAuthorizator
{
Expand Down Expand Up @@ -269,8 +268,8 @@ your custom link generator.
namespace App;
use Carrooi\Menu\IMenuItem;
use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\IMenuItem;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;
final class FrontLinkGenerator implements ILinkGenerator
{
Expand Down Expand Up @@ -316,7 +315,7 @@ menu:
If you want to build your menu maybe from database instead of neon config, you can do that by creating `IMenuLoader`
class.

See the default [ArrayMenuLoader](./src/Carrooi/Menu/Loaders/ArrayMenuLoader.php) how it works.
See the default [ArrayMenuLoader](../src/Loaders/ArrayMenuLoader.php) how it works.

## Changelog

Expand Down
21 changes: 14 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{
"name": "carrooi/nette-menu",
"name": "contributte/menu-control",
"type": "library",
"description": "Menu for Nette framework",
"description": "Menu control for Nette framework",
"keywords": ["nette", "menu", "control", "component", "breadcrumbs"],
"homepage": "https://github.com/Carrooi/Nette-Menu",
"homepage": "https://github.com/contributte/menu-control",
"license": "MIT",
"authors": [
{
"name": "David Kudera",
"homepage": "http://davidkudera.com",
"email": "[email protected]"
"homepage": "https://kudera.dev"
},
{
"name": "Milan Felix Šulc",
"homepage": "https://f3l1x.io"
},
{
"name": "Tomáš Jacík",
"homepage": "https://tomasjacik.cz"
}
],
"support": {
"issues": "https://github.com/Carrooi/Nette-Menu/issues"
"issues": "https://github.com/contributte/menu-control/issues"
},
"require": {
"php": ">=7.1",
Expand All @@ -28,7 +35,7 @@
},
"autoload": {
"psr-4": {
"Carrooi\\Menu\\": "src/"
"Contributte\\MenuControl\\": "src/"
}
},
"autoload-dev": {
Expand Down
22 changes: 11 additions & 11 deletions src/AbstractMenuItemsContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Carrooi\Menu\Security\IAuthorizator;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\Security\IAuthorizator;
use Nette\Http\Request;
use Nette\Localization\ITranslator;

Expand All @@ -16,25 +16,25 @@ abstract class AbstractMenuItemsContainer implements IMenuItemsContainer
{


/** @var \Carrooi\Menu\IMenu */
/** @var IMenu */
protected $menu;

/** @var \Carrooi\Menu\LinkGenerator\ILinkGenerator */
/** @var ILinkGenerator */
protected $linkGenerator;

/** @var \Nette\Localization\ITranslator */
/** @var ITranslator */
protected $translator;

/** @var \Carrooi\Menu\Security\IAuthorizator */
/** @var IAuthorizator */
protected $authorizator;

/** @var \Nette\Http\Request */
protected $httpRequest;

/** @var \Carrooi\Menu\IMenuItemFactory */
/** @var IMenuItemFactory */
protected $menuItemFactory;

/** @var \Carrooi\Menu\IMenuItem[] */
/** @var IMenuItem[] */
private $items = [];


Expand All @@ -56,7 +56,7 @@ public function setLinkGenerator(ILinkGenerator $linkGenerator): void


/**
* @return \Carrooi\Menu\IMenuItem[]
* @return \Contributte\MenuControl\IMenuItem[]
*/
public function getItems(): array
{
Expand Down Expand Up @@ -148,7 +148,7 @@ private function hasVisibleItemsOn(string $type): bool

/**
* @param string $type
* @return \Carrooi\Menu\AbstractMenuItemsContainer[]
* @return AbstractMenuItemsContainer[]
*/
private function getVisibleItemsOn(string $type): array
{
Expand Down
22 changes: 11 additions & 11 deletions src/DI/MenuExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

declare(strict_types=1);

namespace Carrooi\Menu\DI;

use Carrooi\Menu\LinkGenerator\NetteLinkGenerator;
use Carrooi\Menu\Loaders\ArrayMenuLoader;
use Carrooi\Menu\Localization\ReturnTranslator;
use Carrooi\Menu\Menu;
use Carrooi\Menu\MenuContainer;
use Carrooi\Menu\MenuItemFactory;
use Carrooi\Menu\Security\OptimisticAuthorizator;
use Carrooi\Menu\UI\IMenuComponentFactory;
use Carrooi\Menu\UI\MenuComponent;
namespace Contributte\MenuControl\DI;

use Contributte\MenuControl\LinkGenerator\NetteLinkGenerator;
use Contributte\MenuControl\Loaders\ArrayMenuLoader;
use Contributte\MenuControl\Localization\ReturnTranslator;
use Contributte\MenuControl\Menu;
use Contributte\MenuControl\MenuContainer;
use Contributte\MenuControl\MenuItemFactory;
use Contributte\MenuControl\Security\OptimisticAuthorizator;
use Contributte\MenuControl\UI\IMenuComponentFactory;
use Contributte\MenuControl\UI\MenuComponent;
use Nette\DI\CompilerExtension;
use Nette\DI\ContainerBuilder;
use Nette\DI\ServiceDefinition;
Expand Down
2 changes: 1 addition & 1 deletion src/IMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Nette\Application\UI\Presenter;

Expand Down
2 changes: 1 addition & 1 deletion src/IMenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

/**
* @author David Kudera <[email protected]>
Expand Down
6 changes: 3 additions & 3 deletions src/IMenuItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Carrooi\Menu\Security\IAuthorizator;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\Security\IAuthorizator;
use Nette\Http\Request;
use Nette\Localization\ITranslator;

Expand Down
4 changes: 2 additions & 2 deletions src/IMenuItemsContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;

/**
* @author David Kudera <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions src/LinkGenerator/ILinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Carrooi\Menu\LinkGenerator;
namespace Contributte\MenuControl\LinkGenerator;

use Carrooi\Menu\IMenuItem;
use Contributte\MenuControl\IMenuItem;

/**
* @author David Kudera <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions src/LinkGenerator/NetteLinkGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Carrooi\Menu\LinkGenerator;
namespace Contributte\MenuControl\LinkGenerator;

use Carrooi\Menu\IMenuItem;
use Contributte\MenuControl\IMenuItem;
use Nette\Application\LinkGenerator;

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Loaders/ArrayMenuLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Carrooi\Menu\Loaders;
namespace Contributte\MenuControl\Loaders;

use Carrooi\Menu\IMenu;
use Carrooi\Menu\IMenuItem;
use Carrooi\Menu\IMenuItemsContainer;
use Contributte\MenuControl\IMenu;
use Contributte\MenuControl\IMenuItem;
use Contributte\MenuControl\IMenuItemsContainer;
use Nette\Utils;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Loaders/IMenuLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Carrooi\Menu\Loaders;
namespace Contributte\MenuControl\Loaders;

use Carrooi\Menu\IMenu;
use Contributte\MenuControl\IMenu;

/**
* @author David Kudera <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion src/Localization/ReturnTranslator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Carrooi\Menu\Localization;
namespace Contributte\MenuControl\Localization;

use Nette\Localization\ITranslator;

Expand Down
10 changes: 5 additions & 5 deletions src/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Carrooi\Menu\Loaders\IMenuLoader;
use Carrooi\Menu\Security\IAuthorizator;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\Loaders\IMenuLoader;
use Contributte\MenuControl\Security\IAuthorizator;
use Nette\Application\UI\Presenter;
use Nette\Http\Request;
use Nette\Localization\ITranslator;
Expand All @@ -18,7 +18,7 @@ final class Menu extends AbstractMenuItemsContainer implements IMenu
{


/** @var \Carrooi\Menu\Loaders\IMenuLoader */
/** @var IMenuLoader */
private $loader;

/** @var string */
Expand Down
4 changes: 2 additions & 2 deletions src/MenuContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

/**
* @author David Kudera <[email protected]>
Expand All @@ -11,7 +11,7 @@ final class MenuContainer
{


/** @var \Carrooi\Menu\IMenu[] */
/** @var IMenu[] */
private $menus = [];


Expand Down
7 changes: 3 additions & 4 deletions src/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Carrooi\Menu\Security\IAuthorizator;
use Nette\Application\UI\InvalidLinkException;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\Security\IAuthorizator;
use Nette\Http\Request;
use Nette\Localization\ITranslator;

Expand Down
6 changes: 3 additions & 3 deletions src/MenuItemFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Carrooi\Menu;
namespace Contributte\MenuControl;

use Carrooi\Menu\LinkGenerator\ILinkGenerator;
use Carrooi\Menu\Security\IAuthorizator;
use Contributte\MenuControl\LinkGenerator\ILinkGenerator;
use Contributte\MenuControl\Security\IAuthorizator;
use Nette\Http\Request;
use Nette\Localization\ITranslator;

Expand Down
Loading

0 comments on commit 95c1d58

Please sign in to comment.