Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated code style and requirements #12

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
language: php
php:
- 7.1
- 7.2
- 7.3
- master
- 7.4
- 8.0
- 8.1
matrix:
allow_failures:
- php: master
- php: 8.0
- php: 8.1
env:
- BLUZ_MODULE=auth
before_install:
Expand All @@ -26,7 +26,7 @@ before_script:
- php vendor/bin/bluzman db:seed:run
script:
# Check code style
- php vendor/bin/phpcs ./application --standard=PSR1,PSR2 --encoding=utf-8 --ignore=./application/_loader.php
- php vendor/bin/phpcs ./application --standard=PSR12 --encoding=utf-8 --ignore=./application/_loader.php
# Run built-in web-server
- php vendor/bin/bluzman server:start --host 127.0.0.1 -b -e testing
# Run codeception tests
Expand Down
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

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

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

Expand All @@ -16,12 +16,12 @@
To install the module run the command:

```bash
php /vendor/bin/bluzman module:install auth
php ./vendor/bin/bluzman module:install auth
```

### Remove module
To remove the module, run the command:

```bash
php /vendor/bin/bluzman module:remove auth
php ./vendor/bin/bluzman module:remove auth
```
5 changes: 3 additions & 2 deletions application/modules/auth/controllers/auth.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

/**
* Auth controller
*/

namespace Application;

use Bluz\Controller\Controller;
Expand Down Expand Up @@ -70,8 +72,7 @@
Response::redirectTo('users', 'profile');
} elseif ($authRow) {
// Try to login
$user = Users\Table::findRow($authRow->userId);
Auth\Table::tryLogin($user);
Auth\Provider\Token::login($authRow);
Messages::addNotice('You are signed');
} else {
// User not found
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"license": "MIT",
"description": "bluz auth module",
"require": {
"bluzphp/framework": "~7.11",
"bluzphp/composer-plugin": "~2.3",
"hybridauth/hybridauth": "~3.0"
"bluzphp/composer-plugin": "~2.4",
"hybridauth/hybridauth": "~3.7"
}
}