Skip to content

Commit

Permalink
allowed property added
Browse files Browse the repository at this point in the history
  • Loading branch information
s3b4stian committed Aug 1, 2019
1 parent c93c22a commit 119eaea
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
#### Data Mapper
* `Linna\DataMapper\UUID4` class

#### Router
* `Linna\Router\Route->allowed` property
* `Linna\Router\Route->getAllowed()` method
* `Linna\Router\Exception` namespace
* `Linna\Router\Exception\RedirectException` exception

### Changed
* minimum php version 7.2
* tests updated

#### Router
* `Linna\Router\Router->__construct()` now require a `Linna\Router\RouteCollection` as first argument
* `Linna\Router\Exception` namespace
* `Linna\Router\Exception\RedirectException` exception

#### Storage
* `Linna\Storage\ConnectorsInterface->getResource()` now has return type `object`
Expand Down
16 changes: 16 additions & 0 deletions src/Linna/Router/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ class Route implements RouteInterface
*/
public $callback;

/**
* @var string Ip address from which the route is callable, ip address
* format is intentionally not specified.
*/
public $allowed = '*';

/**
* Constructor.
*
Expand Down Expand Up @@ -203,6 +209,16 @@ public function getCallback(): callable
};
}

/**
* Return Ip addresses from which the route is callable.
*
* @return string
*/
public function getAllowed(): string
{
return $this->allowed;
}

/**
* Return route array.
*
Expand Down

0 comments on commit 119eaea

Please sign in to comment.