Skip to content

Commit

Permalink
Fix name of varible,extera param
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-fathi committed May 25, 2017
1 parent 72310ce commit dc2f5a4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/Log/Engine/BaseLog.php
Expand Up @@ -84,10 +84,9 @@ public function scopes()
* or add additional info to the logged message.
*
* @param mixed $data The data to be converted to string and logged.
* @param array $context Additional logging information for the message.
* @return string
*/
protected function _format($data, array $context = [])
protected function _format($data)
{
if (is_string($data)) {
return $data;
Expand Down
14 changes: 7 additions & 7 deletions src/Log/Engine/FileLog.php
Expand Up @@ -182,23 +182,23 @@ protected function _getFilename($level)
*/
protected function _rotateFile($filename)
{
$filepath = $this->_path . $filename;
clearstatcache(true, $filepath);
$filePath = $this->_path . $filename;
clearstatcache(true, $filePath);

if (!file_exists($filepath) ||
filesize($filepath) < $this->_size
if (!file_exists($filePath) ||
filesize($filePath) < $this->_size
) {
return null;
}

$rotate = $this->_config['rotate'];
if ($rotate === 0) {
$result = unlink($filepath);
$result = unlink($filePath);
} else {
$result = rename($filepath, $filepath . '.' . time());
$result = rename($filePath, $filePath . '.' . time());
}

$files = glob($filepath . '.*');
$files = glob($filePath . '.*');
if ($files) {
$filesToDelete = count($files) - $rotate;
while ($filesToDelete > 0) {
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Log/LogTest.php
Expand Up @@ -126,7 +126,7 @@ public function testDrop()
}

/**
* test config() with valid key name
* test invalid level
*
* @expectedException \InvalidArgumentException
* @return void
Expand Down

0 comments on commit dc2f5a4

Please sign in to comment.