Skip to content

Commit 6c162f0

Browse files
Update version CakePHP & PHP 7
1 parent 59c3c68 commit 6c162f0

11 files changed

+30
-403
lines changed

.editorconfig

-16
This file was deleted.

.gitignore

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*.pyc
22
phpunit.xml
3-
vendor/
4-
composer.lock
5-
tmp
3+
/vendor/*
4+
/config/app.php
5+
/tmp/*
6+
/logs/*
7+
/.idea/*
8+
/composer.lock

.scrutinizer.yml

-17
This file was deleted.

.travis.yml

-56
This file was deleted.

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
[![Build Status](https://img.shields.io/travis/hiromi2424/cakephp-slack-log-engine/master.svg?style=flat-square)](https://travis-ci.org/hiromi2424/cakephp-slack-log-engine)
2-
[![Coverage Status](https://img.shields.io/codecov/c/github/hiromi2424/cakephp-slack-log-engine.svg?style=flat-square)](https://codecov.io/github/hiromi2424/cakephp-slack-log-engine)
3-
[![Total Downloads](https://img.shields.io/packagist/dt/hiromi2424/cakephp-slack-log-engine.svg?style=flat-square)](https://packagist.org/packages/hiromi2424/cakephp-slack-log-engine)
4-
[![Latest Stable Version](https://img.shields.io/packagist/v/hiromi2424/cakephp-slack-log-engine.svg?style=flat-square)](https://packagist.org/packages/hiromi2424/cakephp-slack-log-engine)
5-
[![Scrutinizer](https://img.shields.io/scrutinizer/g/hiromi2424/cakephp-slack-log-engine.svg)](https://scrutinizer-ci.com/g/hiromi2424/cakephp-slack-log-engine/)
6-
71
## What is this?
82

93
This is CakePHP plugin to provide a log engine that post to slack using incoming webhooks.
@@ -15,13 +9,13 @@ The engine uses [Slack for PHP](https://github.com/maknz/slack) and is just thin
159
## Installation
1610

1711
```
18-
composer require hiromi2424/cakephp-slack-log-engine
12+
composer require jeffersonsimaogoncalves/cakephp-slack-log-engine
1913
```
2014

2115
## Requirements
2216

17+
* PHP 7
2318
* CakePHP 3.x
24-
* PHP 5.5+
2519

2620
## Usage
2721

@@ -48,3 +42,6 @@ Either `client` or `hookUrl` is required.
4842
- `clientClass` [string(optional)] slack client class. This option is used only with `hookUrl` option.
4943

5044
Other available settings can be seen at [Slack for PHP Official Docs](https://github.com/maknz/slack#settings)
45+
## Credits
46+
47+
This work is based on the [code by Hiroki Shimizu](https://github.com/hiromi2424/cakephp-slack-log-engine).

composer.json

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name":"hiromi2424/cakephp-slack-log-engine",
2+
"name":"jeffersonsimaogoncalves/cakephp-slack-log-engine",
33
"description":"Slack log engine for CakePHP",
44
"type":"cakephp-plugin",
55
"keywords":[
@@ -8,37 +8,33 @@
88
"log",
99
"slack"
1010
],
11-
"homepage":"https://github.com/hiromi2424/cakephp-slack-log-engine",
11+
"homepage":"https://github.com/jeffersonsimaogoncalves/cakephp-slack-log-engine",
1212
"license":"MIT",
1313
"authors":[
1414
{
1515
"name":"Hiroki Shimizu",
1616
"role":"Author",
1717
"homepage":"https://github.com/hiromi2424/"
18+
},
19+
{
20+
"name": "Jefferson Simão Gonçalves",
21+
"homepage": "https://github.com/jeffersonsimaogoncalves"
1822
}
1923
],
2024
"require":{
21-
"cakephp/cakephp": "~3.0",
25+
"php": ">=7.0",
26+
"cakephp/cakephp": "^3.6",
2227
"maknz/slack": "~1.7"
2328
},
24-
"require-dev": {
25-
"phpunit/phpunit": "*"
26-
},
2729
"autoload": {
2830
"psr-4": {
2931
"SlackLogEngine\\": "src"
3032
}
3133
},
32-
"autoload-dev": {
33-
"psr-4": {
34-
"SlackLogEngine\\Test\\": "tests",
35-
"Cake\\Test\\Fixture\\": "./vendor/cakephp/cakephp/tests/Fixture"
36-
}
37-
},
3834
"suggest": {
3935
},
4036
"support":{
41-
"source":"https://github.com/hiromi2424/cakephp-slack-log-engine",
42-
"issues":"https://github.com/hiromi2424/cakephp-slack-log-engine/issues"
37+
"source":"https://github.com/jeffersonsimaogoncalves/cakephp-slack-log-engine",
38+
"issues":"https://github.com/jeffersonsimaogoncalves/cakephp-slack-log-engine/issues"
4339
}
4440
}

phpunit.xml.dist

-29
This file was deleted.

src/Log/Engine/SlackLogEngine.php

+9-5
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ class SlackLogEngine extends BaseLog
2929
* @var array
3030
*/
3131
protected $_defaultConfig = [
32-
'types' => null,
33-
'levels' => [],
34-
'scopes' => [],
35-
'clientClass' => '\Maknz\Slack\Client'
32+
'types' => null,
33+
'levels' => [],
34+
'scopes' => [],
35+
'clientClass' => '\Maknz\Slack\Client',
3636
];
3737

3838
/**
@@ -62,7 +62,7 @@ public function __construct(array $config = [])
6262
if (isset($config['client'])) {
6363
$this->_SlackClient = $config['client'];
6464
unset($config['client']);
65-
} elseif (isset($config['hookUrl'])) {
65+
} else if (isset($config['hookUrl'])) {
6666
$hookUrl = $config['hookUrl'];
6767
$className = $config['clientClass'];
6868
unset($config['hookUrl'], $config['clientClass']);
@@ -86,6 +86,7 @@ public function getClient()
8686
* Set slack client
8787
*
8888
* @param \Maknz\Slack\Client $client slack client
89+
*
8990
* @return \Maknz\Slack\Client slack client
9091
*/
9192
public function setClient(SlackClient $client)
@@ -103,7 +104,9 @@ public function setClient(SlackClient $client)
103104
* See Cake\Log\Log::$_levels for list of possible levels.
104105
* @param string $message The message you want to log.
105106
* @param array $context Additional information about the logged message
107+
*
106108
* @return bool success
109+
* @throws \Exception
107110
*/
108111
public function log($level, $message, array $context = [])
109112
{
@@ -121,6 +124,7 @@ public function log($level, $message, array $context = [])
121124
if (Configure::read('debug')) {
122125
throw $e;
123126
}
127+
124128
// otherwise DO nothing
125129
return false;
126130
}

tests/TestCase/AllTest.php

-21
This file was deleted.

0 commit comments

Comments
 (0)