Skip to content
This repository was archived by the owner on Jan 13, 2019. It is now read-only.

Small fixes #1

Merged
merged 1 commit into from
Feb 20, 2017
Merged
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a58c62e4bde1485f95b52fa56a2e4320)](https://www.codacy.com/app/LEXASOFT/PHP-Censor-Telegram-Plugin)
# PHP-Censor-Telegram-Plugin
Telegram plugin for PHP Censor
Telegram plugin for [PHP Censor](https://github.com/corpsee/php-censor)
# Installation
First of all - `composer require lexasoft/php-censor-telegram-plugin`

Expand All @@ -12,7 +12,7 @@ In the PHP Censor Project config section add the Telegram trigger
complete:
telegram:
api_key: "<YOUR_BOT_TOKEN_HERE>"
message: [%ICON_BUILD%] [%PROJECT_TITLE%](%PROJECT_URI%) - [Build #%BUILD%](%BUILD_URI%) has finished for commit [%SHORT_COMMIT% (%COMMIT_EMAIL%)](%COMMIT_URI%) on branch [%BRANCH%](%BRANCH_URI%)
message: "[%ICON_BUILD%] [%PROJECT_TITLE%](%PROJECT_URI%) - [Build #%BUILD%](%BUILD_URI%) has finished for commit [%SHORT_COMMIT% (%COMMIT_EMAIL%)](%COMMIT_URI%) on branch [%BRANCH%](%BRANCH_URI%)"
recipients:
- <user id>
- "-<group id>"
Expand Down
12 changes: 3 additions & 9 deletions src/Telegram.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<?php
/**
* PHPCI - Continuous Integration for PHP
*
* @copyright Copyright 2014, Block 8 Limited.
* @license https://github.com/Block8/PHPCI/blob/master/LICENSE.md
* @link https://www.phptesting.org/
*/

namespace PHPCensor\Plugin;

Expand All @@ -15,6 +8,7 @@

/**
* Telegram Plugin
*
* @author LEXASOFT <lexasoft83@gmail.com>
* @package PHPCensor
* @subpackage Plugins
Expand Down Expand Up @@ -121,9 +115,9 @@ private function buildMessage()
$buildIcon = $this->build->isSuccessful() ? '✅' : '❎';
$buildLog = $this->build->getLog();
$buildLog = str_replace(['[0;32m', '[0;31m', '[0m', '/[0m'], '', $buildLog);
$buildmessages = explode('RUNNING PLUGIN: ', $buildLog);
$buildMessages = explode('RUNNING PLUGIN: ', $buildLog);

foreach ($buildmessages as $bm) {
foreach ($buildMessages as $bm) {
$pos = mb_strpos($bm, "\n");
$firstRow = mb_substr($bm, 0, $pos);

Expand Down