Skip to content

Commit e47c194

Browse files
author
Anton
authored
Merge pull request #472 from bluzphp/develop
Migrated to 7.3 Added support of PHP 7.4 Updated travis email address
2 parents 83cea87 + 8f8f0d2 commit e47c194

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+300
-251
lines changed

.travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if [ "$TRAVIS_REPO_SLUG" == "bluzphp/framework" ] && [ "$TRAVIS_TAG" != "" ] &&
1616
cp -R docs/html $HOME/docs-latest
1717

1818
cd $HOME
19-
git config --global user.email "travis@travis-ci.org"
19+
git config --global user.email "travis@travis-ci.com"
2020
git config --global user.name "travis-ci"
2121
git config --global push.default simple
2222
git clone --quiet https://${GITHUB_TOKEN}@github.com/bluzphp/bluzphp.github.io > /dev/null

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ matrix:
1010
- php: 8.0
1111
env:
1212
global:
13+
- XDEBUG_MODE=coverage
1314
- secure: "QKyI/QO6H6pFE04Iz/4IcSuttMdY3o85mD2BTNV2Y2SeSPxLfuukqPrxjANrTc4GfI1v7/bZM43uMl3aRa76+HRZ83ZsXR8uv1VZUgNHYuoq7jdZb18BitM36h0LbHzTbYetJLiYg7l3mnbAezTXPXHfpNIWvZcuyZzatyF/lng="
1415
before_install:
1516
# Prefer IPv4 over IPv6

src/Acl/Acl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class Acl
2828
/**
2929
* Check user access by pair module-privilege
3030
*
31-
* @param string $module
32-
* @param string $privilege
31+
* @param string $module
32+
* @param string|null $privilege
3333
*
3434
* @return bool
3535
*/
36-
public function isAllowed($module, $privilege): bool
36+
public function isAllowed(string $module, ?string $privilege): bool
3737
{
3838
if ($privilege) {
3939
$user = Auth::getIdentity();

src/Application/Application.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ public function isDebug(): bool
118118
/**
119119
* Return/setup Layout Flag
120120
*
121-
* @param bool|null $flag
121+
* @param bool|null $flag
122122
*
123123
* @return bool
124124
*/
125-
public function useLayout($flag = null): bool
125+
public function useLayout(?bool $flag = null): bool
126126
{
127127
if (is_bool($flag)) {
128128
$this->layoutFlag = $flag;
@@ -134,12 +134,12 @@ public function useLayout($flag = null): bool
134134
/**
135135
* Initialize system packages
136136
*
137-
* @param string $environment
137+
* @param string $environment
138138
*
139-
* @throws ApplicationException
140139
* @return void
140+
* @throws ApplicationException
141141
*/
142-
public function init($environment = 'production'): void
142+
public function init(string $environment = 'production'): void
143143
{
144144
$this->environment = $environment;
145145

@@ -400,7 +400,7 @@ protected function postProcess(): void
400400
* @throws ControllerException
401401
* @throws ReflectionException
402402
*/
403-
public function dispatch($module, $controller, array $params = []): Controller
403+
public function dispatch(string $module, string $controller, array $params = []): Controller
404404
{
405405
$instance = new Controller($module, $controller, $params);
406406

@@ -419,11 +419,11 @@ public function dispatch($module, $controller, array $params = []): Controller
419419
/**
420420
* Extension point: pre dispatch
421421
*
422-
* @param Controller $controller
422+
* @param Controller $controller
423423
*
424424
* @return void
425425
*/
426-
protected function preDispatch($controller): void
426+
protected function preDispatch(Controller $controller): void
427427
{
428428
// check HTTP method
429429
$controller->checkHttpMethod();
@@ -445,7 +445,7 @@ protected function preDispatch($controller): void
445445
* @throws ControllerException
446446
* @throws ReflectionException
447447
*/
448-
protected function doDispatch($controller): void
448+
protected function doDispatch(Controller $controller): void
449449
{
450450
// run controller
451451
$controller->run();
@@ -454,11 +454,11 @@ protected function doDispatch($controller): void
454454
/**
455455
* Extension point: post dispatch
456456
*
457-
* @param Controller $controller
457+
* @param Controller $controller
458458
*
459459
* @return void
460460
*/
461-
protected function postDispatch($controller): void
461+
protected function postDispatch(Controller $controller): void
462462
{
463463
// nothing by default
464464
}

src/Application/Helper/Error.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,28 @@
1212
namespace Bluz\Application\Helper;
1313

1414
use Bluz\Application\Application;
15+
use Bluz\Common\Exception\CommonException;
16+
use Bluz\Common\Exception\ComponentException;
1517
use Bluz\Controller\Controller;
18+
use Bluz\Controller\ControllerException;
1619
use Bluz\Proxy\Response;
1720
use Bluz\Proxy\Router;
21+
use Exception;
22+
use ReflectionException;
1823

1924
/**
2025
* Reload helper can be declared inside Bootstrap
2126
*
22-
* @param \Exception $exception
27+
* @param Exception $exception
2328
*
2429
* @return Controller
30+
* @throws CommonException
31+
* @throws ComponentException
32+
* @throws ControllerException
33+
* @throws ReflectionException
2534
*/
2635
return
27-
function ($exception) {
36+
function (Exception $exception) {
2837
/**
2938
* @var Application $this
3039
*/

src/Application/Helper/Forbidden.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* @return Controller
2424
*/
2525
return
26-
function ($exception) {
26+
function (ForbiddenException $exception) {
2727
/**
2828
* @var Application $this
2929
*/

src/Application/Helper/Redirect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* @return null
2626
*/
2727
return
28-
function ($exception) {
28+
function (RedirectException $exception) {
2929
/**
3030
* @var Application $this
3131
*/

src/Auth/Model/AbstractTable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ abstract class AbstractTable extends Table
5858
/**
5959
* Get AuthRow
6060
*
61-
* @param string $provider
62-
* @param string $foreignKey
61+
* @param string $provider
62+
* @param string $foreignKey
6363
*
6464
* @return RowInterface
6565
* @throws InvalidArgumentException
6666
* @throws DbException
6767
* @throws InvalidPrimaryKeyException
6868
*/
69-
public static function getAuthRow($provider, $foreignKey): ?RowInterface
69+
public static function getAuthRow(string $provider, string $foreignKey): ?RowInterface
7070
{
7171
return static::findRow(['provider' => $provider, 'foreignKey' => $foreignKey]);
7272
}

src/Common/Container/ArrayAccess.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
* @author Anton Shevchuk
2121
* @see ArrayAccess
2222
*
23-
* @method void doSetContainer($key, $value)
24-
* @method mixed doGetContainer($key)
25-
* @method bool doContainsContainer($key)
26-
* @method void doDeleteContainer($key)
23+
* @method void doSetContainer(string $key, $value)
24+
* @method mixed doGetContainer(string $key)
25+
* @method bool doContainsContainer(string $key)
26+
* @method void doDeleteContainer(string $key)
2727
*/
2828
trait ArrayAccess
2929
{

src/Common/Container/Container.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,24 @@ trait Container
2828
/**
2929
* Set key/value pair
3030
*
31-
* @param string $key
31+
* @param string $key
3232
* @param mixed $value
3333
*
3434
* @return void
3535
*/
36-
protected function doSetContainer($key, $value): void
36+
protected function doSetContainer(string $key, $value): void
3737
{
3838
$this->container[$key] = $value;
3939
}
4040

4141
/**
4242
* Get value by key
4343
*
44-
* @param string $key
44+
* @param string $key
4545
*
4646
* @return mixed
4747
*/
48-
protected function doGetContainer($key)
48+
protected function doGetContainer(string $key)
4949
{
5050
if ($this->doContainsContainer($key)) {
5151
return $this->container[$key];
@@ -56,23 +56,23 @@ protected function doGetContainer($key)
5656
/**
5757
* Check contains key in container
5858
*
59-
* @param string $key
59+
* @param string $key
6060
*
6161
* @return bool
6262
*/
63-
protected function doContainsContainer($key): bool
63+
protected function doContainsContainer(string $key): bool
6464
{
6565
return array_key_exists($key, $this->container);
6666
}
6767

6868
/**
6969
* Delete value by key
7070
*
71-
* @param string $key
71+
* @param string $key
7272
*
7373
* @return void
7474
*/
75-
protected function doDeleteContainer($key): void
75+
protected function doDeleteContainer(string $key): void
7676
{
7777
unset($this->container[$key]);
7878
}

0 commit comments

Comments
 (0)