Skip to content

Commit 78beeae

Browse files
author
Anton
authored
Merge pull request #466 from bluzphp/develop
Updated version of codeception
2 parents a6375bf + 08523c2 commit 78beeae

28 files changed

Lines changed: 55 additions & 36 deletions

.scrutinizer.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override:
6+
- php-scrutinizer-run
17
checks:
28
php:
39
psr2_switch_declaration: true

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2012-2017 by Bluz PHP Team
3+
Copyright (c) 2012-2019 by Bluz PHP Team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"zendframework/zend-httphandlerrunner": "~1.0"
1515
},
1616
"require-dev": {
17-
"codeception/codeception": "~2.5",
17+
"codeception/codeception": "2.5.3",
1818
"php-coveralls/php-coveralls": "~2.1",
1919
"squizlabs/php_codesniffer": "~3.3",
2020
"phploc/phploc": "~4.0",

src/Crud/CrudInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ interface CrudInterface
2424
/**
2525
* Default limit for READ SET of elements
2626
*/
27-
const DEFAULT_LIMIT = 10;
27+
public const DEFAULT_LIMIT = 10;
2828

2929
/**
3030
* Get item by primary key(s)

src/Db/Db.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ class Db
7575
*
7676
* @throws ConfigurationException
7777
* @return void
78-
* @throws DbException
7978
*/
8079
public function setConnect(array $connect): void
8180
{
@@ -268,7 +267,7 @@ public function query($sql, array $params = [], array $types = []): int
268267
/**
269268
* Create new query select builder
270269
*
271-
* @param array|string ...$select The selection expressions
270+
* @param string[] $select The selection expressions
272271
*
273272
* @return Query\Select
274273
*/
@@ -567,7 +566,7 @@ public function fetchObjects(string $sql, array $params = [], $object = null)
567566
{
568567
$stmt = $this->prepare($sql, $params);
569568

570-
if (is_string($object)) {
569+
if (\is_string($object)) {
571570
// fetch to some class by name
572571
$result = $stmt->fetchAll(\PDO::FETCH_CLASS, $object);
573572
} else {
@@ -660,7 +659,7 @@ protected function ok(): void
660659
protected function log(string $sql, array $context = []): void
661660
{
662661
$sql = str_replace('%', '%%', $sql);
663-
$sql = preg_replace('/\?/', '"%s"', $sql, count($context));
662+
$sql = preg_replace('/\?/', '"%s"', $sql, \count($context));
664663

665664
// replace mask by data
666665
$log = vsprintf($sql, $context);

src/Db/Relations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ public static function findRelation($row, $relation): array
125125
}
126126

127127
// check many-to-many relations
128-
if (count($relations) === 1) {
129-
$relations = Relations::getRelations($model, current($relations));
128+
if (\count($relations) === 1) {
129+
$relations = self::getRelations($model, current($relations));
130130
}
131131

132132
$field = $relations[$model];

src/Db/Row.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ public function assert($data): void
153153
* @throws DbException
154154
* @throws InvalidPrimaryKeyException
155155
* @throws TableNotFoundException
156-
* @throws \Bluz\Common\Exception\ConfigurationException
157156
*/
158157
public function save()
159158
{

src/Grid/Helper/Filter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
return
1616
/**
17+
* @param string $column
18+
* @param string $filter
19+
* @param string $value
20+
* @param bool $reset
21+
*
1722
* @return string|null $url
1823
*/
1924
function ($column, $filter, $value, $reset = true) {

src/Grid/Helper/Limit.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
return
1616
/**
17+
* @param int $limit
18+
*
1719
* @return string
1820
*/
1921
function ($limit = 25) {
@@ -23,7 +25,7 @@ function ($limit = 25) {
2325
$rewrite = [];
2426
$rewrite['limit'] = (int)$limit;
2527

26-
if ($limit != $this->getLimit()) {
28+
if ($limit !== $this->getLimit()) {
2729
$rewrite['page'] = 1;
2830
}
2931

src/Grid/Helper/Order.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414

1515
return
1616
/**
17+
* @param string $column
18+
* @param null $order
19+
* @param string $defaultOrder
20+
* @param bool $reset
21+
*
1722
* @return string|null $url
1823
*/
1924
function ($column, $order = null, $defaultOrder = Grid\Grid::ORDER_ASC, $reset = true) {
@@ -29,7 +34,7 @@ function ($column, $order = null, $defaultOrder = Grid\Grid::ORDER_ASC, $reset =
2934
// change order
3035
if (null === $order) {
3136
if (isset($orders[$column])) {
32-
$order = ($orders[$column] == Grid\Grid::ORDER_ASC) ?
37+
$order = ($orders[$column] === Grid\Grid::ORDER_ASC) ?
3338
Grid\Grid::ORDER_DESC : Grid\Grid::ORDER_ASC;
3439
} else {
3540
$order = $defaultOrder;

0 commit comments

Comments
 (0)