Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
emgiezet committed Aug 3, 2013
1 parent b011fe8 commit 24d1c99
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 57 deletions.
11 changes: 5 additions & 6 deletions src/Errbit/Errors/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
namespace Errbit\Errors;


/**
* Converts a native PHP error, notice, or warning into something that
* sort of resembles an Exception.
Expand All @@ -24,7 +23,7 @@ class Base

/**
* Create a new error wrapping the given error context info.
*
*
* @param string $message message
* @param integer $line line
* @param string $file filename
Expand All @@ -39,17 +38,17 @@ public function __construct($message, $line, $file, $trace)
}
/**
* Message getter
*
*
* @return string error message
*
*
*/
public function getMessage()
{
return $this->_message;
}
/**
* Line getter
*
*
* @return integer the number of line
*/
public function getLine()
Expand All @@ -58,7 +57,7 @@ public function getLine()
}
/**
* File getter
*
*
* @return string name of the file
*/
public function getFile()
Expand Down
2 changes: 0 additions & 2 deletions src/Errbit/Errors/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
*/
namespace Errbit\Errors;



class Notice extends Base
{
}
1 change: 0 additions & 1 deletion src/Errbit/Exception/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
namespace Errbit\Exception;


/**
* Errbit PHP Notifier.
*
Expand Down
30 changes: 15 additions & 15 deletions src/Errbit/Exception/Notice.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright © Flippa.com Pty. Ltd.
* See the LICENSE file for details.
*
*
* @category Errors
* @package ErrbitPHP
* @subpackage Errbit
Expand All @@ -19,7 +19,7 @@

/**
* Builds a complete payload for the notice sent to Errbit.
*
*
* @category Errors
* @package ErrbitPHP
* @subpackage Errbit
Expand Down Expand Up @@ -56,10 +56,10 @@ public function __construct($exception, $options = array())

/**
* Convenience method to instantiate a new notice.
*
*
* @param mixed $exception - Exception
* @param mixed $options - array of options
*
*
* @return Notice
*/
public static function forException($exception, $options = array())
Expand Down Expand Up @@ -115,7 +115,7 @@ public static function className($exception)
*
* @param Errbit\XmlBuilder $builder the builder instance to set the data into
* @param array $array the stack frame entry
*
*
* @return null
*/
public static function xmlVarsFor($builder, $array)
Expand Down Expand Up @@ -150,7 +150,7 @@ function ($var) use ($value) {
*/
public function filterTrace($str)
{

if (empty($this->_options['backtrace_filters']) || !is_array($this->_options['backtrace_filters'])) {
return $str;
}
Expand Down Expand Up @@ -294,7 +294,7 @@ function ($env) use ($options) {
// -- Private Methods
/**
* Filtering data
*
*
* @return null
*/
private function _filterData()
Expand All @@ -309,9 +309,9 @@ private function _filterData()
}
/**
* Filtering params
*
*
* @param strin $name param name
*
*
* @return null
*/
private function _filterParams($name)
Expand All @@ -334,9 +334,9 @@ private function _filterParams($name)

/**
* Building request url
*
*
* @return string url
*
*
*/
private function _buildRequestUrl()
{
Expand All @@ -352,7 +352,7 @@ private function _buildRequestUrl()
}
/**
* Protocol guesser
*
*
* @return string http or https protocol
*/
private function _guessProtocol()
Expand All @@ -367,7 +367,7 @@ private function _guessProtocol()
}
/**
* Host guesser
*
*
* @return string servername
*/
private function _guessHost()
Expand All @@ -382,9 +382,9 @@ private function _guessHost()
}
/**
* Port guesser
*
*
* @return string port
*
*
*/
private function _guessPort()
{
Expand Down
25 changes: 12 additions & 13 deletions src/Errbit/Handlers/ErrorHandlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright © Flippa.com Pty. Ltd.
* See the LICENSE file for details.
*
*
* @category Errors
* @package ErrbitPHP
* @subpackage Errbit
Expand All @@ -21,7 +21,6 @@
use Errbit\Errors\Error;
use Errbit\Errors\Fatal;


/**
* The default error handlers that delegate to Errbit::notify().
*
Expand All @@ -34,8 +33,8 @@ class ErrorHandlers
*
* @param [Errbit] $errbit the client instance
* @param [Array] $handlers an array of handler names, instead of registering all
*
* @return self
*
* @return self
*/
public static function register($errbit, $handlers = array('exception', 'error', 'fatal'))
{
Expand All @@ -48,9 +47,9 @@ public static function register($errbit, $handlers = array('exception', 'error',
* Instantiate a new handler for the given client.
*
* @param Errbit $errbit the client to use
*
*
* @return null
*
*
*/
public function __construct($errbit, $handlers)
{
Expand All @@ -61,7 +60,7 @@ public function __construct($errbit, $handlers)
// -- Handlers
/**
* on Error
*
*
* @param integer $code error code
* @param string $message error message
* @param string $file error file
Expand Down Expand Up @@ -90,17 +89,17 @@ public function onError($code, $message, $file, $line)
}
/**
* On exception
*
*
*
*
*/
public function onException($exception)
{
$this->_errbit->notify($exception);
}
/**
* On shut down
*
*
*
*
*/
public function onShutdown()
{
Expand All @@ -112,8 +111,8 @@ public function onShutdown()
// -- Private Methods
/**
* Installer
*
*
*
*
*/
private function _install($handlers)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Errbit/Utils/XmlBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ public function asXml()
}
/**
* Util to converts special chars to be valid with xml
*
*
* @param string $string xml string to converte the special chars
*
*
* @return string escaped string
*/
static function utf8ForXML($string)
public static function utf8ForXML($string)
{
return preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $string);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Errbit/Tests/ErrbitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ public function tearDown()

public function testBase()
{

$service = m::mock('service');
$service->shouldReceive('readTemp')->times(3)->andReturn(10, 12, 14);

// $handler = new ErrorHanlers();
$this->markTestIncomplete('This test has not been implemented yet.');
}

}
}
2 changes: 1 addition & 1 deletion tests/Errbit/Tests/Errors/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ public function testBase()
$this->assertEquals('trace', $trace, 'trace missmatch');
}

}
}
5 changes: 2 additions & 3 deletions tests/Errbit/Tests/Errors/ErrorTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
namespace Errbit\Tests\Errors;
use Errbit\Errors\Error;

use \Mockery as m;

Expand All @@ -14,8 +13,8 @@ public function tearDown()

public function testBase()
{

$this->markTestIncomplete('This test has not been implemented yet.');
}

}
}
2 changes: 1 addition & 1 deletion tests/Errbit/Tests/Errors/FatalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function testFatal()
$this->assertEquals($actualTrace, $trace, 'trace missmatch');
}

}
}
2 changes: 1 addition & 1 deletion tests/Errbit/Tests/Errors/NoticeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function testBase()
$this->markTestIncomplete('This test has not been implemented yet.');
}

}
}
2 changes: 1 addition & 1 deletion tests/Errbit/Tests/Errors/WarningTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public function testBase()
$this->markTestIncomplete('This test has not been implemented yet.');
}

}
}
2 changes: 1 addition & 1 deletion tests/Errbit/Tests/Exception/ExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function testBase()
$this->markTestIncomplete('This test has not been implemented yet.');
}

}
}
2 changes: 1 addition & 1 deletion tests/Errbit/Tests/Exception/NoticeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function testBase()
$this->markTestIncomplete('This test has not been implemented yet.');
}

}
}
6 changes: 3 additions & 3 deletions tests/Errbit/Tests/Handlers/ErrorHandlersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function tearDown()

public function testNoticeHandle()
{

// $service = m::mock('service');
// $service->shouldReceive('readTemp')->times(3)->andReturn(10, 12, 14);

Expand All @@ -34,11 +34,11 @@ public function testNoticeHandle()
try {
foreach ($errors as $error) {
$handler->onError($error, 'Errbit Test: '.$error, __FILE__, 666);
}
}
} catch ( \Exception $e) {
$catched[] = $e->getMessage();
}
$this->assertTrue(count($catched) == 0, 'Exceptions are thrown during errbit notice');
}

}
}
3 changes: 1 addition & 2 deletions tests/Errbit/Tests/Utils/XmlBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace Errbit\Tests\Utils;

use \Mockery as m;
use Errbit\Utils\XmlBuilder;
use Errbit\Exception\Notice;

class XmlBuilderTest extends \PHPUnit_Framework_TestCase
Expand Down Expand Up @@ -46,4 +45,4 @@ public function testBase()

}

}
}
1 change: 0 additions & 1 deletion tests/Errbit/Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@

require_once 'PHPUnit/TextUI/TestRunner.php';


// Include the composer autoloader
$autoloader = require dirname(__DIR__) . '/vendor/autoload.php';

0 comments on commit 24d1c99

Please sign in to comment.