Skip to content

Commit

Permalink
fix some baselined psalm errors
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Lockett <[email protected]>
  • Loading branch information
Gary Lockett committed Sep 12, 2022
1 parent 81bae82 commit 33080b2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 38 deletions.
14 changes: 1 addition & 13 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,6 @@
<code>$this-&gt;data['previous']</code>
<code>$this-&gt;data['trace']</code>
</MixedReturnStatement>
<PropertyNotSetInConstructor occurrences="1">
<code>$data</code>
</PropertyNotSetInConstructor>
<UndefinedDocblockClass occurrences="1">
<code>Exception|Throwable</code>
</UndefinedDocblockClass>
</file>
<file src="src/Listener/EventLoggingListenerAggregate.php">
<InvalidPropertyAssignmentValue occurrences="1"/>
Expand Down Expand Up @@ -558,7 +552,6 @@
<code>$config['laminas-developer-tools']</code>
<code>$configuration['laminas-developer-tools']['profiler']</code>
</MixedArrayAccess>
<MixedArrayOffset occurrences="1"/>
<MixedAssignment occurrences="16">
<code>$adapter</code>
<code>$app</code>
Expand Down Expand Up @@ -629,13 +622,8 @@
<PossiblyNullReference occurrences="1">
<code>getEventManager</code>
</PossiblyNullReference>
<UndefinedClass occurrences="6">
<code>EventLoggingListenerAggregate</code>
<code>ProfilerListener</code>
<UndefinedClass occurrences="1">
<code>ProfilingAdapter</code>
<code>ToolbarListener</code>
<code>\ZendDeveloperTools\Profiler</code>
<code>\ZendDeveloperTools\Report</code>
</UndefinedClass>
<UndefinedInterfaceMethod occurrences="2">
<code>getApplication</code>
Expand Down
4 changes: 3 additions & 1 deletion src/Exception/ExceptionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Laminas\DeveloperTools\Exception;

interface ExceptionInterface
use Throwable;

interface ExceptionInterface extends Throwable
{
}
5 changes: 3 additions & 2 deletions src/Exception/SerializableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@ class SerializableException implements Serializable
/**
* Saves the exception data in an array.
*
* @param Exception|Throwable $exception
* @param Throwable $exception
*/
public function __construct($exception)
{
$previous = $exception->getPrevious();
$this->data = [
'code' => $exception->getCode(),
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'class' => get_class($exception),
'message' => $exception->getMessage(),
'previous' => $exception->getPrevious() ? new self($exception->getPrevious()) : null,
'previous' => $previous !== null ? new self($previous) : null,
'trace' => $this->filterTrace(
$exception->getTrace(),
$exception->getFile(),
Expand Down
41 changes: 19 additions & 22 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Laminas\DeveloperTools;

use BjyProfiler\Db\Adapter\ProfilingAdapter;
use Laminas\DeveloperTools\ReportInterface;
use Laminas\EventManager\EventInterface;
use Laminas\ModuleManager\Feature\BootstrapListenerInterface;
use Laminas\ModuleManager\Feature\ConfigProviderInterface;
Expand All @@ -14,9 +13,6 @@
use Laminas\ModuleManager\Feature\ViewHelperProviderInterface;
use Laminas\ModuleManager\ModuleEvent;
use Laminas\ModuleManager\ModuleManagerInterface;
use ZendDeveloperTools\Listener\EventLoggingListenerAggregate;
use ZendDeveloperTools\Listener\ProfilerListener;
use ZendDeveloperTools\Listener\ToolbarListener;

use function array_map;
use function define;
Expand Down Expand Up @@ -160,24 +156,25 @@ public function getServiceConfig()
ReportInterface::class => Report::class,

// Legacy Zend Framework aliases
'ZendDeveloperTools\ReportInterface' => ReportInterface::class,
\ZendDeveloperTools\Report::class => Report::class,
'ZendDeveloperTools\ExceptionCollector' => 'Laminas\DeveloperTools\ExceptionCollector',
'ZendDeveloperTools\RequestCollector' => 'Laminas\DeveloperTools\RequestCollector',
'ZendDeveloperTools\ConfigCollector' => 'Laminas\DeveloperTools\ConfigCollector',
'ZendDeveloperTools\MailCollector' => 'Laminas\DeveloperTools\MailCollector',
'ZendDeveloperTools\MemoryCollector' => 'Laminas\DeveloperTools\MemoryCollector',
'ZendDeveloperTools\TimeCollector' => 'Laminas\DeveloperTools\TimeCollector',
'ZendDeveloperTools\FlushListener' => 'Laminas\DeveloperTools\FlushListener',
\ZendDeveloperTools\Profiler::class => Profiler::class,
'ZendDeveloperTools\Config' => 'Laminas\DeveloperTools\Config',
'ZendDeveloperTools\Event' => 'Laminas\DeveloperTools\Event',
'ZendDeveloperTools\StorageListener' => 'Laminas\DeveloperTools\StorageListener',
ToolbarListener::class => Listener\ToolbarListener::class,
ProfilerListener::class => Listener\ProfilerListener::class,
EventLoggingListenerAggregate::class
=> Listener\EventLoggingListenerAggregate::class,
'ZendDeveloperTools\DbCollector' => 'Laminas\DeveloperTools\DbCollector',
/** phpcs:disable Generic.Files.LineLength */
'ZendDeveloperTools\ReportInterface' => ReportInterface::class,
'ZendDeveloperTools\Report' => Report::class,
'ZendDeveloperTools\ExceptionCollector' => 'Laminas\DeveloperTools\ExceptionCollector',
'ZendDeveloperTools\RequestCollector' => 'Laminas\DeveloperTools\RequestCollector',
'ZendDeveloperTools\ConfigCollector' => 'Laminas\DeveloperTools\ConfigCollector',
'ZendDeveloperTools\MailCollector' => 'Laminas\DeveloperTools\MailCollector',
'ZendDeveloperTools\MemoryCollector' => 'Laminas\DeveloperTools\MemoryCollector',
'ZendDeveloperTools\TimeCollector' => 'Laminas\DeveloperTools\TimeCollector',
'ZendDeveloperTools\FlushListener' => 'Laminas\DeveloperTools\FlushListener',
'ZendDeveloperTools\Profiler' => Profiler::class,
'ZendDeveloperTools\Config' => 'Laminas\DeveloperTools\Config',
'ZendDeveloperTools\Event' => 'Laminas\DeveloperTools\Event',
'ZendDeveloperTools\StorageListener' => 'Laminas\DeveloperTools\StorageListener',
'ZendDeveloperTools\Listener\ToolbarListener' => Listener\ToolbarListener::class,
'ZendDeveloperTools\Listener\ProfilerListener' => Listener\ProfilerListener::class,
'ZendDeveloperTools\Listener\EventLoggingListenerAggregate' => Listener\EventLoggingListenerAggregate::class,
'ZendDeveloperTools\DbCollector' => 'Laminas\DeveloperTools\DbCollector',
/** phpcs:enable Generic.Files.LineLength */
],
'invokables' => [
Report::class => Report::class,
Expand Down

0 comments on commit 33080b2

Please sign in to comment.