Compare commits

...

5 Commits

  1. 28
      .php-cs-fixer.dist.php
  2. 2
      RoboFile.php
  3. 1
      arsse.php
  4. 1
      lib/AbstractException.php
  5. 1
      lib/Arsse.php
  6. 1
      lib/CLI.php
  7. 3
      lib/Conf.php
  8. 1
      lib/Conf/Exception.php
  9. 1
      lib/Context/AbstractContext.php
  10. 1
      lib/Context/BooleanMembers.php
  11. 1
      lib/Context/Context.php
  12. 1
      lib/Context/ExclusionContext.php
  13. 2
      lib/Context/ExclusionMembers.php
  14. 1
      lib/Context/RootContext.php
  15. 1
      lib/Context/UnionContext.php
  16. 41
      lib/Database.php
  17. 1
      lib/Db/AbstractDriver.php
  18. 1
      lib/Db/AbstractResult.php
  19. 1
      lib/Db/AbstractStatement.php
  20. 1
      lib/Db/Driver.php
  21. 1
      lib/Db/Exception.php
  22. 1
      lib/Db/ExceptionInput.php
  23. 1
      lib/Db/ExceptionRetry.php
  24. 1
      lib/Db/ExceptionTimeout.php
  25. 1
      lib/Db/MySQL/Driver.php
  26. 5
      lib/Db/MySQL/ExceptionBuilder.php
  27. 1
      lib/Db/MySQL/PDODriver.php
  28. 1
      lib/Db/MySQL/PDOStatement.php
  29. 1
      lib/Db/MySQL/Result.php
  30. 1
      lib/Db/MySQL/Statement.php
  31. 1
      lib/Db/PDODriver.php
  32. 1
      lib/Db/PDOError.php
  33. 1
      lib/Db/PDOResult.php
  34. 1
      lib/Db/PDOStatement.php
  35. 1
      lib/Db/PostgreSQL/Dispatch.php
  36. 1
      lib/Db/PostgreSQL/Driver.php
  37. 1
      lib/Db/PostgreSQL/PDODriver.php
  38. 4
      lib/Db/PostgreSQL/PDOResult.php
  39. 1
      lib/Db/PostgreSQL/PDOStatement.php
  40. 1
      lib/Db/PostgreSQL/Result.php
  41. 1
      lib/Db/PostgreSQL/Statement.php
  42. 1
      lib/Db/Result.php
  43. 1
      lib/Db/ResultAggregate.php
  44. 1
      lib/Db/ResultEmpty.php
  45. 1
      lib/Db/SQLState.php
  46. 1
      lib/Db/SQLite3/AbstractPDODriver.php
  47. 1
      lib/Db/SQLite3/Driver.php
  48. 1
      lib/Db/SQLite3/ExceptionBuilder.php
  49. 1
      lib/Db/SQLite3/PDODriver.php
  50. 1
      lib/Db/SQLite3/PDOStatement.php
  51. 1
      lib/Db/SQLite3/Result.php
  52. 1
      lib/Db/SQLite3/Statement.php
  53. 1
      lib/Db/Statement.php
  54. 1
      lib/Db/Transaction.php
  55. 1
      lib/Exception.php
  56. 1
      lib/ExceptionFatal.php
  57. 1
      lib/ExceptionType.php
  58. 1
      lib/Factory.php
  59. 3
      lib/Feed.php
  60. 1
      lib/Feed/Exception.php
  61. 3
      lib/Feed/Item.php
  62. 1
      lib/ImportExport/AbstractImportExport.php
  63. 1
      lib/ImportExport/Exception.php
  64. 1
      lib/ImportExport/OPML.php
  65. 1
      lib/Lang.php
  66. 1
      lib/Lang/Exception.php
  67. 1
      lib/Misc/Date.php
  68. 1
      lib/Misc/HTTP.php
  69. 1
      lib/Misc/Query.php
  70. 1
      lib/Misc/QueryFilter.php
  71. 4
      lib/Misc/URL.php
  72. 17
      lib/Misc/ValueInfo.php
  73. 1
      lib/REST.php
  74. 1
      lib/REST/AbstractHandler.php
  75. 1
      lib/REST/Exception.php
  76. 1
      lib/REST/Exception501.php
  77. 1
      lib/REST/Fever/API.php
  78. 1
      lib/REST/Fever/User.php
  79. 1
      lib/REST/Handler.php
  80. 1
      lib/REST/Miniflux/Status.php
  81. 1
      lib/REST/Miniflux/Token.php
  82. 3
      lib/REST/Miniflux/V1.php
  83. 9
      lib/REST/NextcloudNews/V1_2.php
  84. 1
      lib/REST/NextcloudNews/Versions.php
  85. 3
      lib/REST/TinyTinyRSS/API.php
  86. 1
      lib/REST/TinyTinyRSS/Exception.php
  87. 1
      lib/REST/TinyTinyRSS/Icon.php
  88. 3
      lib/REST/TinyTinyRSS/Search.php
  89. 1
      lib/Rule/Exception.php
  90. 1
      lib/Rule/Rule.php
  91. 1
      lib/Service.php
  92. 1
      lib/Service/Daemon.php
  93. 1
      lib/Service/Driver.php
  94. 1
      lib/Service/Exception.php
  95. 1
      lib/Service/Serial/Driver.php
  96. 1
      lib/Service/Subprocess/Driver.php
  97. 1
      lib/User.php
  98. 1
      lib/User/Driver.php
  99. 1
      lib/User/Exception.php
  100. 1
      lib/User/ExceptionConflict.php

28
.php_cs.dist → .php-cs-fixer.dist.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
const BASE = __DIR__.DIRECTORY_SEPARATOR;
@ -13,7 +14,10 @@ $paths = [
BASE."arsse.php",
BASE."RoboFile.php",
BASE."lib",
BASE."tests",
BASE."tests/cases",
BASE."tests/lib",
BASE."tests/bootstrap.php",
BASE."tests/server.php",
];
$rules = [
// house rules where PSR series is silent
@ -35,6 +39,7 @@ $rules = [
'no_blank_lines_after_phpdoc' => true,
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true, // this could probably use more configuration
'no_mixed_echo_print' => ['use' => "echo"],
'no_short_bool_cast' => true,
@ -48,26 +53,11 @@ $rules = [
'pow_to_exponentiation' => true,
'set_type_to_cast' => true,
'standardize_not_equals' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => ['elements' => ["arrays"]],
'unary_operator_spaces' => true,
'yoda_style' => false,
// PSR standard to apply
'@PSR2' => true,
// PSR-12 rules; php-cs-fixer does not yet support PSR-12 natively
'compact_nullable_typehint' => true,
'declare_equal_normalize' => ['space' => "none"],
'function_typehint_space' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'no_alternative_syntax' => true,
'no_empty_statement' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_whitespace_in_blank_line' => true,
'return_type_declaration' => ['space_before' => "none"],
'single_trait_insert_per_statement' => true,
'short_scalar_cast' => true,
'visibility_required' => ['elements' => ["const", "property", "method"]],
'@PSR12' => true,
// house exceptions to PSR rules
'braces' => ['position_after_functions_and_oop_constructs' => "same"],
'function_declaration' => ['closure_function_spacing' => "none"],
@ -82,4 +72,4 @@ foreach ($paths as $path) {
$finder = $finder->in($path);
}
}
return \PhpCsFixer\Config::create()->setRiskyAllowed(true)->setRules($rules)->setFinder($finder);
return (new \PhpCsFixer\Config)->setRiskyAllowed(true)->setRules($rules)->setFinder($finder);

2
RoboFile.php

@ -164,7 +164,7 @@ class RoboFile extends \Robo\Tasks {
if (
(IS_WIN && (!exec(escapeshellarg($bin)." --help $blackhole", $junk, $status) || $status))
|| (!IS_WIN && (!exec("which ".escapeshellarg($bin)." $blackhole", $junk, $status) || $status))
) {
) {
return false;
}
}

1
arsse.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
const BASE = __DIR__.DIRECTORY_SEPARATOR;

1
lib/AbstractException.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
abstract class AbstractException extends \Exception {

1
lib/Arsse.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
class Arsse {

1
lib/CLI.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use JKingWeb\Arsse\REST\Fever\User as Fever;

3
lib/Conf.php

@ -5,6 +5,7 @@
/** Conf class */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use AllowDynamicProperties;
@ -15,7 +16,7 @@ use JKingWeb\Arsse\Misc\ValueInfo as Value;
* The Conf class serves both as a means of importing and querying configuration information, as well as a source for default parameters when a configuration file does not specify a value.
* All public properties are configuration parameters that may be set by the server administrator. */
#[AllowDynamicProperties]
class Conf {
class Conf {
/** @var string Default language to use for logging and errors */
public $lang = "en";

1
lib/Conf/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Conf;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/Context/AbstractContext.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
abstract class AbstractContext {

1
lib/Context/BooleanMembers.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
trait BooleanMembers {

1
lib/Context/Context.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
class Context extends RootContext {

1
lib/Context/ExclusionContext.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
class ExclusionContext extends AbstractContext {

2
lib/Context/ExclusionMembers.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
use JKingWeb\Arsse\Misc\ValueInfo;
@ -243,7 +244,6 @@ trait ExclusionMembers {
return $this->act(__FUNCTION__, func_num_args(), $spec);
}
public function markedRange($start = null, $end = null) {
if ($start === null && $end === null) {
$spec = null;

1
lib/Context/RootContext.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
abstract class RootContext extends AbstractContext {

1
lib/Context/UnionContext.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Context;
class UnionContext extends RootContext implements \ArrayAccess, \Countable, \IteratorAggregate {

41
lib/Database.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use JKingWeb\DrUUID\UUID;
@ -280,7 +281,7 @@ class Database {
}
/** Renames a user
*
*
* This does not have an effect on their numeric ID, but has a cascading effect on many tables
*/
public function userRename(string $user, string $name): bool {
@ -337,7 +338,7 @@ class Database {
}
/** Retrieves any metadata associated with a user
*
*
* @param string $user The user whose metadata is to be retrieved
* @param bool $includeLarge Whether to include values which can be arbitrarily large text
*/
@ -855,8 +856,8 @@ class Database {
sum(case when \"read\" = 1 and hidden = 0 then 1 else 0 end) as marked
from arsse_marks group by subscription
) as mark_stats on mark_stats.subscription = s.id",
["str", "int"],
[$user, $folder]
["str", "int"],
[$user, $folder]
);
$q->setWhere("s.owner = ?", ["str"], [$user]);
$nocase = $this->db->sqlToken("nocase");
@ -1613,26 +1614,26 @@ class Database {
}
// ensure any used array-type context options contain at least one member
foreach ([
"articles",
"articles",
"editions",
"subscriptions",
"folders",
"foldersShallow",
"labels",
"labelNames",
"tags",
"tagNames",
"searchTerms",
"titleTerms",
"authorTerms",
"folders",
"foldersShallow",
"labels",
"labelNames",
"tags",
"tagNames",
"searchTerms",
"titleTerms",
"authorTerms",
"annotationTerms",
"modifiedRanges",
"markedRanges",
] as $m) {
if ($context->$m() && !$context->$m) {
throw new Db\ExceptionInput("tooShort", ['field' => $m, 'action' => $this->caller(), 'min' => 1]);
}
if ($context->$m() && !$context->$m) {
throw new Db\ExceptionInput("tooShort", ['field' => $m, 'action' => $this->caller(), 'min' => 1]);
}
}
// next compute the context, supplying the query to manipulate directly
$this->articleFilter($context, $q);
}
@ -1921,8 +1922,8 @@ class Database {
touched = 1
where
article in (select article from target_articles)
and subscription in (select distinct subscription from target_articles)",
[$subq->getTypes(), "bool"],
and subscription in (select distinct subscription from target_articles)",
[$subq->getTypes(), "bool"],
[$subq->getValues(), $data['read']]
);
$this->db->prepare($q->getQuery(), $q->getTypes())->run($q->getValues());
@ -1952,7 +1953,7 @@ class Database {
where
article in (select article from target_articles)
and subscription in (select distinct subscription from target_articles)",
[$subq->getTypes(), $setTypes],
[$subq->getTypes(), $setTypes],
[$subq->getValues(), $setValues]
);
$this->db->prepare($q->getQuery(), $q->getTypes())->run($q->getValues());

1
lib/Db/AbstractDriver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
use JKingWeb\Arsse\Arsse;

1
lib/Db/AbstractResult.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
abstract class AbstractResult implements Result {

1
lib/Db/AbstractStatement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
use JKingWeb\Arsse\Misc\Date;

1
lib/Db/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
interface Driver {

1
lib/Db/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/Db/ExceptionInput.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class ExceptionInput extends \JKingWeb\Arsse\AbstractException {

1
lib/Db/ExceptionRetry.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class ExceptionRetry extends \JKingWeb\Arsse\AbstractException {

1
lib/Db/ExceptionTimeout.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class ExceptionTimeout extends \JKingWeb\Arsse\AbstractException {

1
lib/Db/MySQL/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\MySQL;
use JKingWeb\Arsse\Arsse;

5
lib/Db/MySQL/ExceptionBuilder.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\MySQL;
use JKingWeb\Arsse\Db\Exception;
@ -27,7 +28,7 @@ trait ExceptionBuilder {
public static function buildConnectionException($code, string $msg): array {
switch ($code) {
case 1045:
// @codeCoverageIgnoreStart
// @codeCoverageIgnoreStart
case 1043:
case 1044:
case 1046:
@ -48,7 +49,7 @@ trait ExceptionBuilder {
case 2018:
case 2026:
case 2028:
// @codeCoverageIgnoreEnd
// @codeCoverageIgnoreEnd
return [Exception::class, 'connectionFailure', ['engine' => "MySQL", 'message' => $msg]];
default:
return [Exception::class, 'engineErrorGeneral', $msg]; // @codeCoverageIgnore

1
lib/Db/MySQL/PDODriver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\MySQL;
use JKingWeb\Arsse\Arsse;

1
lib/Db/MySQL/PDOStatement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\MySQL;
class PDOStatement extends \JKingWeb\Arsse\Db\PDOStatement {

1
lib/Db/MySQL/Result.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\MySQL;
class Result extends \JKingWeb\Arsse\Db\AbstractResult {

1
lib/Db/MySQL/Statement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\MySQL;
class Statement extends \JKingWeb\Arsse\Db\AbstractStatement {

1
lib/Db/PDODriver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
trait PDODriver {

1
lib/Db/PDOError.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
trait PDOError {

1
lib/Db/PDOResult.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class PDOResult extends AbstractResult {

1
lib/Db/PDOStatement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
abstract class PDOStatement extends AbstractStatement {

1
lib/Db/PostgreSQL/Dispatch.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
trait Dispatch {

1
lib/Db/PostgreSQL/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
use JKingWeb\Arsse\Arsse;

1
lib/Db/PostgreSQL/PDODriver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
use JKingWeb\Arsse\Arsse;

4
lib/Db/PostgreSQL/PDOResult.php

@ -4,11 +4,11 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
class PDOResult extends \JKingWeb\Arsse\Db\PDOResult {
// This method exists to transparent handle byte-array results
// This method exists to transparently handle byte-array results
public function valid() {
$this->cur = $this->set->fetch(\PDO::FETCH_ASSOC);

1
lib/Db/PostgreSQL/PDOStatement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
use JKingWeb\Arsse\Db\Result;

1
lib/Db/PostgreSQL/Result.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
class Result extends \JKingWeb\Arsse\Db\AbstractResult {

1
lib/Db/PostgreSQL/Statement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\PostgreSQL;
class Statement extends \JKingWeb\Arsse\Db\AbstractStatement {

1
lib/Db/Result.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
interface Result extends \Iterator {

1
lib/Db/ResultAggregate.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class ResultAggregate extends AbstractResult {

1
lib/Db/ResultEmpty.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class ResultEmpty extends AbstractResult {

1
lib/Db/SQLState.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
trait SQLState {

1
lib/Db/SQLite3/AbstractPDODriver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
abstract class AbstractPDODriver extends Driver {

1
lib/Db/SQLite3/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
use JKingWeb\Arsse\Arsse;

1
lib/Db/SQLite3/ExceptionBuilder.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
use JKingWeb\Arsse\Db\Exception;

1
lib/Db/SQLite3/PDODriver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
use JKingWeb\Arsse\Arsse;

1
lib/Db/SQLite3/PDOStatement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
class PDOStatement extends \JKingWeb\Arsse\Db\PDOStatement {

1
lib/Db/SQLite3/Result.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
class Result extends \JKingWeb\Arsse\Db\AbstractResult {

1
lib/Db/SQLite3/Statement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db\SQLite3;
class Statement extends \JKingWeb\Arsse\Db\AbstractStatement {

1
lib/Db/Statement.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
interface Statement {

1
lib/Db/Transaction.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Db;
class Transaction {

1
lib/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
class Exception extends AbstractException {

1
lib/ExceptionFatal.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
class ExceptionFatal extends AbstractException {

1
lib/ExceptionType.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
class ExceptionType extends AbstractException {

1
lib/Factory.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
class Factory {

3
lib/Feed.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use JKingWeb\Arsse\Feed\Item;
@ -16,7 +17,7 @@ use PicoFeed\Reader\Reader;
use PicoFeed\Reader\Favicon;
use PicoFeed\Scraper\Scraper;
class Feed {
class Feed {
public $title;
public $siteUrl;
public $iconUrl;

1
lib/Feed/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Feed;
use GuzzleHttp\Exception\BadResponseException;

3
lib/Feed/Item.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Feed;
class Item {
@ -21,4 +22,4 @@ class Item {
public $enclosureUrl;
public $enclosureType;
public $categories = [];
}
}

1
lib/ImportExport/AbstractImportExport.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\ImportExport;
use JKingWeb\Arsse\Arsse;

1
lib/ImportExport/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\ImportExport;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/ImportExport/OPML.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\ImportExport;
use JKingWeb\Arsse\Arsse;

1
lib/Lang.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
class Lang {

1
lib/Lang/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Lang;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/Misc/Date.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Misc;
abstract class Date {

1
lib/Misc/HTTP.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Misc;
use Psr\Http\Message\MessageInterface;

1
lib/Misc/Query.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Misc;
class Query extends QueryFilter {

1
lib/Misc/QueryFilter.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Misc;
class QueryFilter {

4
lib/Misc/URL.php

@ -4,14 +4,14 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Misc;
/**
* A collection of functions for manipulating URLs
*/
class URL {
/** Returns whether a URL is absolute i.e. has a scheme */
/** Returns whether a URL is absolute i.e. whether it has a scheme */
public static function absolute(string $url): bool {
return (bool) strlen((string) parse_url($url, \PHP_URL_SCHEME));
}

17
lib/Misc/ValueInfo.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Misc;
use JKingWeb\Arsse\ExceptionType;
@ -107,7 +108,7 @@ class ValueInfo {
if ($strict && !$drop) {
throw new ExceptionType("strictFailure", $type);
}
return (!$drop) ? (int) $value->getTimestamp(): null;
return (!$drop) ? (int) $value->getTimestamp() : null;
} elseif ($value instanceof \DateInterval) {
if ($strict && !$drop) {
throw new ExceptionType("strictFailure", $type);
@ -159,7 +160,7 @@ class ValueInfo {
if ($strict && !$drop) {
throw new ExceptionType("strictFailure", $type);
}
return (!$drop) ? (float) $value->getTimestamp(): null;
return (!$drop) ? (float) $value->getTimestamp() : null;
} elseif ($value instanceof \DateInterval) {
if ($drop) {
return null;
@ -203,13 +204,13 @@ class ValueInfo {
if ($value->days) {
$dateSpec = $value->days."D";
} else {
$dateSpec .= $value->y ? $value->y."Y": "";
$dateSpec .= $value->m ? $value->m."M": "";
$dateSpec .= $value->d ? $value->d."D": "";
$dateSpec .= $value->y ? $value->y."Y" : "";
$dateSpec .= $value->m ? $value->m."M" : "";
$dateSpec .= $value->d ? $value->d."D" : "";
}
$timeSpec .= $value->h ? $value->h."H": "";
$timeSpec .= $value->i ? $value->i."M": "";
$timeSpec .= $value->s ? $value->s."S": "";
$timeSpec .= $value->h ? $value->h."H" : "";
$timeSpec .= $value->i ? $value->i."M" : "";
$timeSpec .= $value->s ? $value->s."S" : "";
$timeSpec = $timeSpec ? "T".$timeSpec : "";
if (!$dateSpec && !$timeSpec) {
return "PT0S";

1
lib/REST.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use JKingWeb\Arsse\Misc\URL;

1
lib/REST/AbstractHandler.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST;
use JKingWeb\Arsse\Arsse;

1
lib/REST/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/REST/Exception501.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST;
class Exception501 extends \Exception {

1
lib/REST/Fever/API.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\Fever;
use JKingWeb\Arsse\Arsse;

1
lib/REST/Fever/User.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\Fever;
use JKingWeb\Arsse\Arsse;

1
lib/REST/Handler.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST;
use Psr\Http\Message\ServerRequestInterface;

1
lib/REST/Miniflux/Status.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\Miniflux;
use JKingWeb\Arsse\Misc\HTTP;

1
lib/REST/Miniflux/Token.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\Miniflux;
use JKingWeb\Arsse\Arsse;

3
lib/REST/Miniflux/V1.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\Miniflux;
use JKingWeb\Arsse\Arsse;
@ -212,7 +213,7 @@ class V1 extends \JKingWeb\Arsse\REST\AbstractHandler {
public function __construct() {
}
public static function respError($data, int $status = 400, array $headers = []): ResponseInterface {
assert(isset(Arsse::$lang) && Arsse::$lang instanceof \JKingWeb\Arsse\Lang, new \Exception("Language database must be initialized before use"));
$data = (array) $data;

9
lib/REST/NextcloudNews/V1_2.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\NextcloudNews;
use JKingWeb\Arsse\Arsse;
@ -293,7 +294,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
switch ($e->getCode()) {
// folder already exists
case 10236: return HTTP::respEmpty(409);
// folder name not acceptable
// folder name not acceptable
case 10231:
case 10232: return HTTP::respEmpty(422);
// other errors related to input
@ -324,9 +325,9 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
switch ($e->getCode()) {
// folder does not exist
case 10239: return HTTP::respEmpty(404);
// folder already exists
// folder already exists
case 10236: return HTTP::respEmpty(409);
// folder name not acceptable
// folder name not acceptable
case 10231:
case 10232: return HTTP::respEmpty(422);
// other errors related to input
@ -458,7 +459,7 @@ class V1_2 extends \JKingWeb\Arsse\REST\AbstractHandler {
switch ($e->getCode()) {
// subscription does not exist
case 10239: return HTTP::respEmpty(404);
// name is invalid
// name is invalid
case 10231:
case 10232: return HTTP::respEmpty(422);
// other errors related to input

1
lib/REST/NextcloudNews/Versions.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\NextcloudNews;
use JKingWeb\Arsse\Misc\HTTP;

3
lib/REST/TinyTinyRSS/API.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\TinyTinyRSS;
use JKingWeb\Arsse\Feed;
@ -999,7 +1000,7 @@ class API extends \JKingWeb\Arsse\REST\AbstractHandler {
switch ($e->getCode()) {
case 10236: // label already exists
// retrieve the ID of the existing label; duplicating a label silently returns the existing one
return $this->labelOut(Arsse::$db->labelPropertiesGet(Arsse::$user->id, $in['name'], true)['id']);
return $this->labelOut(Arsse::$db->labelPropertiesGet(Arsse::$user->id, $in['name'], true)['id']);
default: // other errors related to input
throw new Exception("INCORRECT_USAGE");
}

1
lib/REST/TinyTinyRSS/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\TinyTinyRSS;
class Exception extends \Exception {

1
lib/REST/TinyTinyRSS/Icon.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\TinyTinyRSS;
use JKingWeb\Arsse\Arsse;

3
lib/REST/TinyTinyRSS/Search.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\REST\TinyTinyRSS;
use JKingWeb\Arsse\Context\Context;
@ -319,7 +320,7 @@ class Search {
$start = $day."T00:00:00 $tz";
$end = $day."T23:59:59 $tz";
$cc = $neg ? $c->not : $c;
// NOTE: TTRSS treats multiple positive dates as contradictory; we instead treat them as complimentary instead, because it makes more sense
// NOTE: TTRSS treats multiple positive dates as contradictory; we instead treat them as complimentary because this makes more sense
return $cc->modifiedRanges(array_merge($cc->modifiedRanges, [[$start, $end]]));
}

1
lib/Rule/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Rule;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/Rule/Rule.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Rule;
abstract class Rule {

1
lib/Service.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use JKingWeb\Arsse\Misc\Date;

1
lib/Service/Daemon.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Service;
use JKingWeb\Arsse\AbstractException;

1
lib/Service/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Service;
interface Driver {

1
lib/Service/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Service;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/Service/Serial/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Service\Serial;
use JKingWeb\Arsse\Arsse;

1
lib/Service/Subprocess/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\Service\Subprocess;
use JKingWeb\Arsse\Arsse;

1
lib/User.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse;
use JKingWeb\Arsse\Misc\ValueInfo as V;

1
lib/User/Driver.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\User;
interface Driver {

1
lib/User/Exception.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\User;
class Exception extends \JKingWeb\Arsse\AbstractException {

1
lib/User/ExceptionConflict.php

@ -4,6 +4,7 @@
* See LICENSE and AUTHORS files for details */
declare(strict_types=1);
namespace JKingWeb\Arsse\User;
class ExceptionConflict extends Exception {

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save