Removed most logging.

This commit is contained in:
James Cole 2016-03-19 11:25:11 +01:00
parent 7aa2565e89
commit 322fef2db1
17 changed files with 0 additions and 95 deletions

View File

@ -58,15 +58,8 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface
$compare = $this->triggerValue;
$result = bccomp($amount, $compare, 4);
if ($result === 0) {
// found something
Log::debug($amount . ' is exactly ' . $compare . '. Return true.');
return true;
}
// found nothing.
Log::debug($amount . ' is not exactly ' . $compare . '. Return false.');
return false;
}

View File

@ -58,15 +58,9 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface
$compare = $this->triggerValue;
$result = bccomp($amount, $compare, 4);
if ($result === -1) {
// found something
Log::debug($amount . ' is less than ' . $compare . '. Return true.');
return true;
}
// found nothing.
Log::debug($amount . ' is not less than ' . $compare . '. Return false.');
return false;
}

View File

@ -58,15 +58,9 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface
$compare = $this->triggerValue;
$result = bccomp($amount, $compare, 4);
if ($result === 1) {
// found something
Log::debug($amount . ' is more than ' . $compare . '. Return true.');
return true;
}
// found nothing.
Log::debug($amount . ' is not more than ' . $compare . '. Return false.');
return false;
}

View File

@ -59,15 +59,9 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf
$strpos = strpos($source, $search);
if (!($strpos === false)) {
// found something
Log::debug('"' . $source . '" contains the text "' . $search . '". Return true.');
return true;
}
// found nothing.
Log::debug('"' . $source . '" does not contain the text "' . $search . '". Return false.');
return false;
}

View File

@ -61,23 +61,15 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface
// if the string to search for is longer than the description,
// shorten the search string.
if ($searchLength > $descriptionLength) {
Log::debug('Search string "' . $search . '" (' . $searchLength . ') is longer than "' . $description . '" (' . $descriptionLength . '). ');
$search = substr($search, ($descriptionLength * -1));
$searchLength = strlen($search);
Log::debug('Search string is now "' . $search . '" (' . $searchLength . ') instead.');
}
$part = substr($description, $searchLength * -1);
if ($part == $search) {
Log::debug('"' . $description . '" ends with "' . $search . '". Return true.');
return true;
}
Log::debug('"' . $description . '" does not end with "' . $search . '". Return false.');
return false;
}
}

View File

@ -57,13 +57,8 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface
$search = strtolower($this->triggerValue);
if ($description == $search) {
Log::debug('"' . $description . '" equals "' . $search . '" exactly. Return true.');
return true;
}
Log::debug('"' . $description . '" does not equal "' . $search . '". Return false.');
return false;
}
}

View File

@ -59,13 +59,8 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac
$part = substr($description, 0, strlen($search));
if ($part == $search) {
Log::debug('"' . $description . '" starts with "' . $search . '". Return true.');
return true;
}
Log::debug('"' . $description . '" does not start with "' . $search . '". Return false.');
return false;
}
}

View File

@ -11,7 +11,6 @@ declare(strict_types = 1);
namespace FireflyIII\Rules\Triggers;
use FireflyIII\Models\TransactionJournal;
use Log;
/**
* Class FromAccountContains
@ -58,15 +57,9 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf
$strpos = strpos($fromAccountName, $search);
if (!($strpos === false)) {
// found something
Log::debug('"' . $fromAccountName . '" contains the text "' . $search . '". Return true.');
return true;
}
// found nothing.
Log::debug('"' . $fromAccountName . '" does not contain the text "' . $search . '". Return false.');
return false;
}

View File

@ -61,22 +61,16 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface
// if the string to search for is longer than the account name,
// shorten the search string.
if ($searchLength > $nameLength) {
Log::debug('Search string "' . $search . '" (' . $searchLength . ') is longer than "' . $name . '" (' . $nameLength . '). ');
$search = substr($search, ($nameLength * -1));
$searchLength = strlen($search);
Log::debug('Search string is now "' . $search . '" (' . $searchLength . ') instead.');
}
$part = substr($name, $searchLength * -1);
if ($part == $search) {
Log::debug('"' . $name . '" ends with "' . $search . '". Return true.');
return true;
}
Log::debug('"' . $name . '" does not end with "' . $search . '". Return false.');
return false;
}

View File

@ -57,12 +57,8 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface
$search = strtolower($this->triggerValue);
if ($name == $search) {
Log::debug('"' . $name . '" equals "' . $search . '" exactly. Return true.');
return true;
}
Log::debug('"' . $name . '" does not equal "' . $search . '" exactly. Return false.');
return false;
}

View File

@ -59,13 +59,8 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac
$part = substr($name, 0, strlen($search));
if ($part == $search) {
Log::debug('"' . $name . '" starts with "' . $search . '". Return true.');
return true;
}
Log::debug('"' . $name . '" does not start with "' . $search . '". Return false.');
return false;
}
}

View File

@ -58,16 +58,8 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac
$strpos = strpos($toAccountName, $search);
if (!($strpos === false)) {
// found something
Log::debug('"' . $toAccountName . '" contains the text "' . $search . '". Return true.');
return true;
}
// found nothing.
Log::debug('"' . $toAccountName . '" does not contain the text "' . $search . '". Return false.');
return false;
}
}

View File

@ -61,23 +61,16 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface
// if the string to search for is longer than the account name,
// shorten the search string.
if ($searchLength > $toAccountNameLength) {
Log::debug('Search string "' . $search . '" (' . $searchLength . ') is longer than "' . $toAccountName . '" (' . $toAccountNameLength . '). ');
$search = substr($search, ($toAccountNameLength * -1));
$searchLength = strlen($search);
Log::debug('Search string is now "' . $search . '" (' . $searchLength . ') instead.');
}
$part = substr($toAccountName, $searchLength * -1);
if ($part == $search) {
Log::debug('"' . $toAccountName . '" ends with "' . $search . '". Return true.');
return true;
}
Log::debug('"' . $toAccountName . '" does not end with "' . $search . '". Return false.');
return false;
}
}

View File

@ -57,12 +57,8 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface
$search = strtolower($this->triggerValue);
if ($toAccountName == $search) {
Log::debug('"' . $toAccountName . '" equals "' . $search . '" exactly. Return true.');
return true;
}
Log::debug('"' . $toAccountName . '" does not equal "' . $search . '". Return false.');
return false;
}

View File

@ -59,12 +59,8 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface
$part = substr($toAccountName, 0, strlen($search));
if ($part == $search) {
Log::debug('"' . $toAccountName . '" starts with "' . $search . '". Return true.');
return true;
}
Log::debug('"' . $toAccountName . '" does not start with "' . $search . '". Return false.');
return false;
}

View File

@ -57,12 +57,8 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface
$search = strtolower($this->triggerValue);
if ($type == $search) {
Log::debug('Journal is of type "' . $type . '" which matches with "' . $search . '". Return true');
return true;
}
Log::debug('Journal is of type "' . $type . '" which does not match with "' . $search . '". Return false');
return false;
}
}

View File

@ -11,7 +11,6 @@ declare(strict_types = 1);
namespace FireflyIII\Rules\Triggers;
use FireflyIII\Models\TransactionJournal;
use Log;
/**
* Class UserAction
@ -51,8 +50,6 @@ final class UserAction extends AbstractTrigger implements TriggerInterface
*/
public function triggered(TransactionJournal $journal)
{
Log::debug('user_action always returns true.');
return true;
}
}