Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of git://github.com/zendframework/zf2 into cach…
Browse files Browse the repository at this point in the history
…e_interfaces
  • Loading branch information
marc-mabe committed May 31, 2012
3 parents 79fbe51 + dcc1eaf + 6f4b805 commit a30a64f
Show file tree
Hide file tree
Showing 29 changed files with 211 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .travis/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
travisdir=$(dirname $(readlink /proc/$$/fd/255))
travisdir=$(dirname "$0")
testdir="$travisdir/../tests"
testedcomponents=(`cat "$travisdir/tested-components"`)
result=0
Expand Down
1 change: 1 addition & 0 deletions .travis/skipped-components
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Zend/Amf
Zend/Date
Zend/Dojo
Zend/Queue
Zend/Service
Zend/Test
Expand Down
4 changes: 3 additions & 1 deletion .travis/tested-components
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,19 @@ Zend/Form
Zend/GData
Zend/Http
Zend/InfoCard
Zend/InputFilter
Zend/Json
Zend/Ldap
Zend/Loader
Zend/Locale
Zend/Log
Zend/Mail
Zend/Markup
Zend/Math
Zend/Measure
Zend/Memory
Zend/Mime
Zend/Module
Zend/ModuleManager
Zend/Mvc
Zend/Navigation
Zend/OAuth
Expand Down
30 changes: 30 additions & 0 deletions src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Log
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Log\Exception;

/**
* @category Zend
* @package Zend_Log
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Exception/InvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
*/
class InvalidArgumentException
extends \InvalidArgumentException
implements \Zend\Log\Exception
implements ExceptionInterface
{}
2 changes: 1 addition & 1 deletion src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
*/
class RuntimeException
extends \RuntimeException
implements \Zend\Log\Exception
implements ExceptionInterface
{}
38 changes: 38 additions & 0 deletions src/Filter/FilterInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Log
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Log\Filter;

/**
* @category Zend
* @package Zend_Log
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface FilterInterface
{
/**
* Returns TRUE to accept the message, FALSE to block it.
*
* @param array $event event data
* @return boolean accepted?
*/
public function filter(array $event);
}
5 changes: 2 additions & 3 deletions src/Filter/Priority.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

namespace Zend\Log\Filter;

use Zend\Log\Exception,
Zend\Log\Filter;
use Zend\Log\Exception;

/**
* @category Zend
Expand All @@ -31,7 +30,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Priority implements Filter
class Priority implements FilterInterface
{
/**
* @var int
Expand Down
6 changes: 2 additions & 4 deletions src/Filter/Regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
*/
namespace Zend\Log\Filter;

use Zend\Log\Exception,
Zend\Log\Filter;
use Zend\Log\Exception;

/**
* @category Zend
Expand All @@ -34,7 +33,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Regex implements Filter
class Regex implements FilterInterface
{
/**
* Regex to match
Expand All @@ -47,7 +46,6 @@ class Regex implements Filter
* Filter out any log messages not matching the pattern
*
* @param string $regex Regular expression to test the log message
* @return Message
* @throws Exception\InvalidArgumentException
*/
public function __construct($regex)
Expand Down
5 changes: 2 additions & 3 deletions src/Filter/SuppressFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

namespace Zend\Log\Filter;

use Zend\Log\Exception,
Zend\Log\Filter;
use Zend\Log\Exception;

/**
* @category Zend
Expand All @@ -31,7 +30,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class SuppressFilter implements Filter
class SuppressFilter implements FilterInterface
{
/**
* @var boolean
Expand Down
3 changes: 1 addition & 2 deletions src/Filter/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
namespace Zend\Log\Filter;

use Zend\Log\Exception,
Zend\Log\Filter,
Zend\Validator\ValidatorInterface as ZendValidator;

/**
Expand All @@ -32,7 +31,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Validator implements Filter
class Validator implements FilterInterface
{
/**
* Regex to match
Expand Down
7 changes: 3 additions & 4 deletions src/Formatter/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
* @namespace
*/
namespace Zend\Log\Formatter;
use Zend\Log\Formatter,
Zend\Log\Exception;

use Zend\Log\Exception;

/**
* @category Zend
Expand All @@ -33,7 +33,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ErrorHandler implements Formatter
class ErrorHandler implements FormatterInterface
{
const DEFAULT_FORMAT = '%timestamp% %priorityName% (%priority%) %message% (errno %extra[errno]%) in %extra[file]% on line %extra[line]%';

Expand All @@ -48,7 +48,6 @@ class ErrorHandler implements Formatter
* Class constructor
*
* @param null|string $format Format specifier for log messages
* @return void
* @throws Zend\Log\Exception\InvalidArgumentException
*/
public function __construct($format = null)
Expand Down
4 changes: 1 addition & 3 deletions src/Formatter/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@
*/
namespace Zend\Log\Formatter;

use Zend\Log\Formatter;

/**
* @category Zend
* @package Zend_Log
* @subpackage Formatter
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class ExceptionHandler implements Formatter
class ExceptionHandler implements FormatterInterface
{
/**
* This method formats the event for the PHP Exception
Expand Down
38 changes: 38 additions & 0 deletions src/Formatter/FormatterInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Log
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace Zend\Log\Formatter;

/**
* @category Zend
* @package Zend_Log
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface FormatterInterface
{
/**
* Formats data into a single line to be written by the writer.
*
* @param array $event event data
* @return string formatted line to write to the log
*/
public function format($event);
}
5 changes: 2 additions & 3 deletions src/Formatter/Simple.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@

namespace Zend\Log\Formatter;

use Zend\Log\Formatter,
Zend\Log\Exception;
use Zend\Log\Exception;

/**
* @category Zend
Expand All @@ -31,7 +30,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Simple implements Formatter
class Simple implements FormatterInterface
{
/**
* @var string
Expand Down
11 changes: 5 additions & 6 deletions src/Formatter/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

namespace Zend\Log\Formatter;

use Traversable;
use Zend\Stdlib\ArrayUtils;
use DOMDocument,
DOMElement,
Zend\Log\Formatter;
use Traversable,
Zend\Stdlib\ArrayUtils,
DOMDocument,
DOMElement;

/**
* @category Zend
Expand All @@ -34,7 +33,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Xml implements Formatter
class Xml implements FormatterInterface
{
/**
* @var string Name of root element
Expand Down
6 changes: 3 additions & 3 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Logger implements Loggable, Pluggable
class Logger implements LoggerInterface, Pluggable
{
/**
* @const int defined from the BSD Syslog message severities
Expand Down Expand Up @@ -211,7 +211,7 @@ public function addWriter($writer, $priority=1)
{
if (is_string($writer)) {
$writer = $this->plugin($writer);
} elseif (!$writer instanceof Writer) {
} elseif (!$writer instanceof Writer\WriterInterface) {
throw new Exception\InvalidArgumentException(sprintf(
'Writer must implement Zend\Log\Writer; received "%s"',
is_object($writer) ? get_class($writer) : gettype($writer)
Expand Down Expand Up @@ -245,7 +245,7 @@ public function setWriters($writers)
throw new Exception\InvalidArgumentException('Writers must be a SplPriorityQueue of Zend\Log\Writer');
}
foreach ($writers->toArray() as $writer) {
if (!$writer instanceof Writer) {
if (!$writer instanceof Writer\WriterInterface) {
throw new Exception\InvalidArgumentException('Writers must be a SplPriorityQueue of Zend\Log\Writer');
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/LoggerAware.php → src/LoggerAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
namespace Zend\Log;

use Zend\Log\Logger;
use Zend\Log\LoggerInterface;

/**
* Logger aware interface
Expand All @@ -33,7 +33,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface LoggerAware
interface LoggerAwareInterface
{
public function setLogger(Logger $logger);
public function setLogger(LoggerInterface $logger);
}
2 changes: 1 addition & 1 deletion src/Loggable.php → src/LoggerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Loggable
interface LoggerInterface
{
/**
* @param string $message
Expand Down
Loading

0 comments on commit a30a64f

Please sign in to comment.