Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove psr/log as dependency #10235

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
"nextcloud/kitinerary-flatpak": "^1.0",
"nextcloud/kitinerary-sys": "^1.0.1",
"phpmailer/dkimvalidator": "^0.3.0",
"psr/log": "^1",
"rubix/ml": "2.5.1",
"sabberworm/php-css-parser": "^8.6.0",
"youthweb/urllinker": "^2.0"
},
"require-dev": {
"fig/log-test": "^1.1",
"psalm/phar": "^5.26.1",
"roave/security-advisories": "dev-master"
},
Expand All @@ -55,6 +55,9 @@
"OCA\\Mail\\": "lib/"
}
},
"replace": {
"psr/log": "*"
},
"scripts": {
"cs:check": "php-cs-fixer fix --dry-run --diff",
"cs:fix": "php-cs-fixer fix",
Expand Down
100 changes: 48 additions & 52 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@
</errorLevel>
</UndefinedFunction>
</issueHandlers>
<stubs>
<file name="tests/stubs/Psr_Log_LoggerAwareInterface.php" />
<file name="tests/stubs/Psr_Log_LoggerInterface.php" />
</stubs>
</psalm>
14 changes: 14 additions & 0 deletions tests/stubs/Psr_Log_LoggerAwareInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Psr\Log;

/**
* Describes a logger-aware instance.
*/
interface LoggerAwareInterface
{
/**
* Sets a logger instance on the object.
*/
public function setLogger(LoggerInterface $logger): void;
}
98 changes: 98 additions & 0 deletions tests/stubs/Psr_Log_LoggerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?php

namespace Psr\Log;

/**
* Describes a logger instance.
*
* The message MUST be a string or object implementing __toString().
*
* The message MAY contain placeholders in the form: {foo} where foo
* will be replaced by the context data in key "foo".
*
* The context array can contain arbitrary data. The only assumption that
* can be made by implementors is that if an Exception instance is given
* to produce a stack trace, it MUST be in a key named "exception".
*
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
* for the full interface specification.
*/
interface LoggerInterface
{
/**
* System is unusable.
*
* @param mixed[] $context
*/
public function emergency(string|\Stringable $message, array $context = []): void;

/**
* Action must be taken immediately.
*
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
* @param mixed[] $context
*/
public function alert(string|\Stringable $message, array $context = []): void;

/**
* Critical conditions.
*
* Example: Application component unavailable, unexpected exception.
*
* @param mixed[] $context
*/
public function critical(string|\Stringable $message, array $context = []): void;

/**
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
* @param mixed[] $context
*/
public function error(string|\Stringable $message, array $context = []): void;

/**
* Exceptional occurrences that are not errors.
*
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
* @param mixed[] $context
*/
public function warning(string|\Stringable $message, array $context = []): void;

/**
* Normal but significant events.
*
* @param mixed[] $context
*/
public function notice(string|\Stringable $message, array $context = []): void;

/**
* Interesting events.
*
* Example: User logs in, SQL logs.
*
* @param mixed[] $context
*/
public function info(string|\Stringable $message, array $context = []): void;

/**
* Detailed debug information.
*
* @param mixed[] $context
*/
public function debug(string|\Stringable $message, array $context = []): void;

/**
* Logs with an arbitrary level.
*
* @param mixed $level
* @param mixed[] $context
*
* @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, string|\Stringable $message, array $context = []): void;
}
Loading