Skip to content

Commit

Permalink
Merge pull request #18 from bluzphp/develop
Browse files Browse the repository at this point in the history
Updated code style
  • Loading branch information
Anton authored Sep 3, 2021
2 parents cac36f3 + 256bd45 commit 60f5bc7
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 16 deletions.
37 changes: 26 additions & 11 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
checks:
php:
code_rating: true
deprecated_code_usage: true
duplication: true
no_short_open_tag: true
build:
cache:
directories:
- "vendor"
- "~/.composer"
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
checks:
php:
psr2_switch_declaration: true
psr2_class_declaration: true
no_short_open_tag: true
deprecated_code_usage: true
code_rating: true
dependencies:
override:
- COMPOSER_ROOT_VERSION=dev-master
filter:
excluded_paths: [bin, docs, docker, data, tests, vendor]
excluded_paths:
- "bin/"
- "data/"
- "docs/"
- "docker/"
- "public/"
- "tests/"
dependency_paths:
- "vendor/"
tools:
external_code_coverage: false
php_analyzer: true
php_code_sniffer:
config:
standard: PSR2
standard: PSR12
php_cpd:
enabled: true
excluded_dirs: [bin, docs, docker, data, tests, vendor]
excluded_dirs: [bin, data, docs, docker, public, tests, vendor]
php_loc:
enabled: true
excluded_dirs: [bin, docs, docker, data, tests, vendor]
excluded_dirs: [bin, data, docs, docker, public, tests, vendor]
php_mess_detector: true
php_pdepend: true
sensiolabs_security_checker: true
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012-2019 by Bluz PHP Team
Copyright (c) by Bluz PHP Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Module options for Bluz Skeleton
# Module Options for Bluz Skeleton
## Achievements

[![Latest Stable Version](https://img.shields.io/packagist/v/bluzphp/module-options.svg?label=version&style=flat)](https://packagist.org/packages/bluzphp/module-options)

[![Build Status](https://img.shields.io/travis/bluzphp/module-options/master.svg?style=flat)](https://travis-ci.org/bluzphp/module-options)
[![Build Status](https://img.shields.io/travis/bluzphp/module-options/master.svg?style=flat)](https://travis-ci.com/bluzphp/module-options)

[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/bluzphp/module-options.svg?style=flat)](https://scrutinizer-ci.com/g/bluzphp/module-options/)

Expand Down
13 changes: 11 additions & 2 deletions application/models/Options/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@

namespace Application\Options;

use Bluz\Db\Exception\DbException;
use Bluz\Db\Exception\InvalidPrimaryKeyException;
use Bluz\Db\Exception\TableNotFoundException;

/**
* Class Table
*
* @package Application\Options
*
* @method static Row create(array $data = [])
* @method static Row findRow($primaryKey)
* @method static Row findRowWhere($whereList)
* @method static Row|null findRow($primaryKey)
* @method static Row|null findRowWhere($whereList)
*/
class Table extends \Bluz\Db\Table
{
Expand Down Expand Up @@ -44,6 +48,7 @@ class Table extends \Bluz\Db\Table
* @param string $key
* @param string $namespace
* @return mixed
* @throws DbException
*/
public static function get(string $key, string $namespace = self::NAMESPACE_DEFAULT)
{
Expand All @@ -60,6 +65,9 @@ public static function get(string $key, string $namespace = self::NAMESPACE_DEFA
* @param mixed $value
* @param string $namespace
* @return mixed
* @throws DbException
* @throws InvalidPrimaryKeyException
* @throws TableNotFoundException
*/
public static function set(string $key, $value, string $namespace = self::NAMESPACE_DEFAULT)
{
Expand All @@ -79,6 +87,7 @@ public static function set(string $key, $value, string $namespace = self::NAMESP
* @param string $key
* @param string $namespace
* @return integer
* @throws DbException
*/
public static function remove(string $key, string $namespace = self::NAMESPACE_DEFAULT)
{
Expand Down
5 changes: 5 additions & 0 deletions application/modules/options/views/grid.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ if (!$grid) {
</td>
</tr>
<?php endforeach; ?>
<?php if ($grid->total() === 0) : ?>
<tr>
<td colspan="6" align="center"><?=__('No data')?></td>
</tr>
<?php endif ?>
</tbody>
</table>
<?= $this->partial('grid/empty-rows.phtml', ['grid' => $grid]) ?>
Expand Down
2 changes: 2 additions & 0 deletions data/migrations/20170317111122_options_permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,7 @@ public function up()
public function down()
{
$this->execute('DELETE FROM acl_privileges WHERE module = "options"');
$this->execute('DELETE FROM acl_privileges WHERE module = "api" AND privilege = "Options/Read"');
$this->execute('DELETE FROM acl_privileges WHERE module = "api" AND privilege = "Options/Edit"');
}
}
3 changes: 3 additions & 0 deletions tests/unit/modules/options/controllers/CrudTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Bluz PHP Team
* @link https://github.com/bluzphp/skeleton
Expand All @@ -10,6 +11,7 @@
namespace Application\Tests\Options;

use Application\Tests\ControllerTestCase;
use Bluz\Application\Exception\ApplicationException;
use Bluz\Http\RequestMethod;
use Bluz\Http\StatusCode;

Expand All @@ -27,6 +29,7 @@ class CrudTest extends ControllerTestCase
* setUp
*
* @return void
* @throws ApplicationException
*/
public function setUp(): void
{
Expand Down
1 change: 1 addition & 0 deletions tests/unit/modules/options/controllers/GridTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @copyright Bluz PHP Team
* @link https://github.com/bluzphp/skeleton
Expand Down

0 comments on commit 60f5bc7

Please sign in to comment.